content
stringlengths 5
1.05M
|
|---|
local deepcopy = require("deepcopy").deepcopy
local List = {
first = 1,
last = 0,
list = {}
}
function List.new ()
return deepcopy(List)
end
function List:get (index)
return self.list[index]
end
function List:set (index, value)
if not ( self.last >= index and index >= self.first ) then error("Index out of bounds") end
self.list[index] = value
end
function List:insert (index, value)
self.list:insert(index, value)
end
function List:clone ()
return deepcopy(self)
end
function List:pushRight (value)
local last = self.last + 1
self.last = last
self.list[last] = value
end
function List:popRight ()
local last = self.last
if self.first > last then error("List is empty") end
local value = self.list[last]
self.list[last] = nil -- To allow garbage collection
self.list.last = last - 1
return value
end
|
require 'busted.runner'()
local assert = require 'spec.tools.assert'
local configer = require 'nelua.configer'
local config = configer.get()
local version = require 'nelua.version'
describe("Nelua runner should", function()
it("version numbers" , function()
version.detect_git_info()
assert.same(#version.NELUA_GIT_HASH, 40)
assert(version.NELUA_GIT_BUILD > 0)
assert(version.NELUA_GIT_DATE ~= 'unknown')
end)
it("compile simple programs" , function()
assert.run('--generator lua --no-cache --compile examples/helloworld.nelua')
assert.run(' --no-cache --compile examples/helloworld.nelua')
assert.run('--generator lua --compile-binary examples/helloworld.nelua')
-- force reusing the cache:
assert.run(' --compile-binary examples/helloworld.nelua')
end)
it("run simple programs", function()
assert.run({'--no-cache', '--timing', '--eval', "return 0"})
assert.run('--generator lua examples/helloworld.nelua', 'hello world')
assert.run(' examples/helloworld.nelua', 'hello world')
assert.run({'--generator', 'lua', '--eval', ""}, '')
assert.run({'--lint', '--eval', ""})
assert.run({'--generator', 'lua', '--eval', "print(_G.arg[1])", "hello"}, 'hello')
assert.run({'--eval', ""})
if config.cc == 'gcc' then
assert.run({'--cflags="-Wall"', '--eval',
"## cflags '-w -g' linklib 'm' ldflags '-s'"})
end
end)
it("error on parsing an invalid program" , function()
assert.run_error('--aninvalidflag', 'unknown option')
assert.run_error('--lint --eval invalid')
assert.run_error('--lint invalid', 'invalid: No such file or directory')
--assert.run_error({'--eval', "f()"}, 'undefined')
assert.run_error({'--generator', 'lua', '--eval', "local a = 1_x"}, "literal suffix '_x' is undefined")
assert.run_error(' --cc invgcc examples/helloworld.nelua', 'failed to retrieve compiler information')
end)
it("print correct generated AST" , function()
assert.run('--print-ast examples/helloworld.nelua', [[Block {
{
Call {
{
String {
"hello world",
nil
}
},
Id {
"print"
}
}
}
}]])
assert.run('--print-analyzed-ast examples/helloworld.nelua', [[type = "stringview"]])
end)
it("print correct generated code", function()
assert.run('--generator lua --print-code examples/helloworld.nelua', 'print("hello world")')
end)
it("define option", function()
assert.run({
'--generator', 'lua',
'--analyze',
'--define', 'DEF1',
'-DDEF2',
'-D', 'DEF3=1',
"-DDEF4='asd'",
'--eval',[[
## assert(DEF1 == true)
## assert(DEF2 == true)
## assert(DEF3 == 1)
## assert(DEF4 == 'asd')
]]})
assert.run_error('-D1 examples/helloworld.nelua', "failed parsing parameter '1'")
end)
it("pragma option", function()
assert.run({
'--generator', 'lua',
'--analyze',
'--pragma', 'DEF1',
'-PDEF2',
'-P', 'DEF3=1',
"-PDEF4='asd'",
'--eval',[[
## assert(context.pragmas.DEF1 == true)
## assert(context.pragmas.DEF2 == true)
## assert(context.pragmas.DEF3 == 1)
## assert(context.pragmas.DEF4 == 'asd')
]]})
end)
it("configure module search paths", function()
assert.run({'-L', './examples', '--eval',[[
require 'helloworld'
]]}, 'hello world')
assert.run_error({'--eval',[[
require 'helloworld'
]]}, "module 'helloworld' not found")
assert.run_error({'-L', './examples/invalid', '--analyze', '--eval',[[--nothing]]}, 'is not a valid directory')
assert.run({'-L', './examples/?.lua', '--analyze', '--eval',[[
## assert(config.path:find('examples'))
]]})
local defconfig = configer.get_default()
local oldaddpath = defconfig.add_path
defconfig.add_path = {'/tests'}
assert.run({'-L', './examples', '--analyze', '--eval',[[
## assert(config.path:find('examples'))
## assert(config.path:find('tests'))
]]})
defconfig.add_path = oldaddpath
assert.run({'--path', './examples', '--analyze', '--eval',[[
## assert(config.path:match('examples'))
]]})
end)
it("debug options", function()
assert.run({'--debug-resolve', '--analyze', '--eval',[[
local x = 1
]]}, "symbol 'x' resolved to type 'int64'")
assert.run({'--debug-scope-resolve', '--analyze', '--eval',[[
local x = 1
]]}, "scope resolved 1 symbols")
end)
it("program arguments", function()
assert.run({'--eval',[[
require 'arg'
assert(arg[1] == 'a')
assert(arg[2] == 'b')
assert(arg[3] == 'c')
assert(#arg == 3)
]], 'a', 'b', 'c'})
end)
it("shared libraries", function()
assert.run({'--shared', '-o', 'libmylib', 'tests/libmylib.nelua'})
assert.run({'-o', 'mylib_test', 'tests/mylib_test.nelua'}, [[mylib - init
mylib - in top scope
mylib - sum
the sum is:
3
mylib - terminate]])
os.remove('libmylib.so')
os.remove('mylib_test')
end)
it("static libraries", function()
assert.run({'--static', '-o', 'libmylib', 'tests/libmylib.nelua'})
assert.run({'-o', 'mylib_test', 'tests/mylib_test.nelua'}, [[mylib - init
mylib - in top scope
mylib - sum
the sum is:
3
mylib - terminate]])
os.remove('libmylib.a')
os.remove('libmylib.o')
os.remove('mylib_test')
end)
it("error tracebacks", function()
assert.run_error({'--eval',[[
local function f(x: auto)
## static_error('fail')
end
f(1)
]]}, "polymorphic function instantiation")
end)
end)
|
local skynet = require("skynet")
local function print_t(s)
local str = "{"
for k, v in pairs(t) do
if type(v) == "table" then
v = print_v(v)
end
str = str .. k .. "=" .. v .. ","
end
str = str .. "}"
return str
end
skynet.start(function()
skynet.error("Server Start")
local s = skynet.newservice("lesson10_service")
skynet.call(s, "lua", "open", {
host = "127.0.0.1",
port = "3306",
database = "test",
user = "root",
password = "zwf1004713"
})
print(skynet.call(s, "lua", "insert", "user", {name = "zhang", age = 10}))
end)
|
--
-- Copyright (c) 2016-2017 Nicholas Corgan (n.corgan@gmail.com)
--
-- Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
-- or copy at http://opensource.org/licenses/MIT)
--
local pkmn = require("pkmn")
local luaunit = require("luaunit")
local items_tests = {}
items_tests.item_list = {}
-- Stupid hacky functions to be able to test indexing and attributes
function items_tests.item_list.get_item_name(items, index)
local item_name = items[index].item
end
function items_tests.item_list.set_item_name(items, index, item_name)
items[index].item = item_name
end
-- Actual common test functions
function items_tests.item_list_test_empty_slot(items)
for item_index = 1, #items
do
luaunit.assertEquals(items[item_index].item, pkmn.item.NONE)
luaunit.assertEquals(items[item_index].amount, 0)
end
end
function items_tests.item_list_test_out_of_range_error(items, item_name)
luaunit.assertError(pkmn.item_list.add, items, item_name, 0)
luaunit.assertError(pkmn.item_list.add, items, item_name, 100)
luaunit.assertError(pkmn.item_list.remove, items, item_name, 0)
luaunit.assertError(pkmn.item_list.remove, items, item_name, 100)
end
function items_tests.item_bag_test_invalid_items(bag, item_names)
for i = 1, #item_names
do
luaunit.assertError(pkmn.item_bag.add, bag, item_names[i], 1)
end
end
function items_tests.item_list_test_invalid_items(items, item_names)
for i = 1, #item_names
do
luaunit.assertError(pkmn.item_list.add, items, item_names[i], 1)
end
end
function items_tests.item_list_test_setting_items(items, item_names)
luaunit.assertEquals(items.num_items, 0)
luaunit.assertEquals(#item_names, 8)
-- Make sure invalid indices are caught.
luaunit.assertError(
items_tests.item_list.get_item_name,
items,
0
)
luaunit.assertError(
items_tests.item_list.get_item_name,
items,
#items+1
)
luaunit.assertError(
items_tests.item_list.set_item_name,
items,
0,
item_names[1]
)
luaunit.assertError(
items_tests.item_list.set_item_name,
items,
#items+1,
item_names[1]
)
items[1].item = item_names[1]
items[1].amount = 50
items[2].item = item_names[2]
items[2].amount = 40
items[3].item = item_names[3]
items[3].amount = 30
luaunit.assertEquals(items.num_items, 3)
luaunit.assertEquals(items[1].item, item_names[1])
luaunit.assertEquals(items[1].amount, 50)
luaunit.assertEquals(items[2].item, item_names[2])
luaunit.assertEquals(items[2].amount, 40)
luaunit.assertEquals(items[3].item, item_names[3])
luaunit.assertEquals(items[3].amount, 30)
-- Make sure the item list being contiguous is enforced.
luaunit.assertError(
items_tests.item_list.set_item_name,
items,
11,
item_names[4]
)
items[2].item = pkmn.item.NONE
luaunit.assertEquals(items.num_items, 2)
luaunit.assertEquals(items[1].item, item_names[1])
luaunit.assertEquals(items[1].amount, 50)
luaunit.assertEquals(items[2].item, item_names[3])
luaunit.assertEquals(items[2].amount, 30)
luaunit.assertEquals(items[3].item, pkmn.item.NONE)
luaunit.assertEquals(items[3].amount, 0)
items[1].item = pkmn.item.NONE
items[1].item = pkmn.item.NONE
luaunit.assertEquals(items.num_items, 0)
for item_index = 1, 3
do
luaunit.assertEquals(items[item_index].item, pkmn.item.NONE)
luaunit.assertEquals(items[item_index].amount, 0)
end
end
function items_tests.item_list_test_add_remove(items, item_names)
luaunit.assertEquals(items.num_items, 0)
luaunit.assertEquals(#item_names, 8)
-- Test add/remove functions.
items:add(item_names[1], 30)
items:add(item_names[2], 99)
items:add(item_names[3], 1)
luaunit.assertEquals(items[1].item, item_names[1])
luaunit.assertEquals(items[1].amount, 30)
luaunit.assertEquals(items[2].item, item_names[2])
luaunit.assertEquals(items[2].amount, 99)
luaunit.assertEquals(items[3].item, item_names[3])
luaunit.assertEquals(items[3].amount, 1)
luaunit.assertEquals(items.num_items, 3)
items:add(item_names[3], 15)
luaunit.assertEquals(items[1].item, item_names[1])
luaunit.assertEquals(items[1].amount, 30)
luaunit.assertEquals(items[2].item, item_names[2])
luaunit.assertEquals(items[2].amount, 99)
luaunit.assertEquals(items[3].item, item_names[3])
luaunit.assertEquals(items[3].amount, 16)
luaunit.assertEquals(items.num_items, 3)
items:remove(item_names[2], 20)
luaunit.assertEquals(items[1].item, item_names[1])
luaunit.assertEquals(items[1].amount, 30)
luaunit.assertEquals(items[2].item, item_names[2])
luaunit.assertEquals(items[2].amount, 79)
luaunit.assertEquals(items[3].item, item_names[3])
luaunit.assertEquals(items[3].amount, 16)
luaunit.assertEquals(items.num_items, 3)
items:move(1, 2)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 79)
luaunit.assertEquals(items[2].item, item_names[1])
luaunit.assertEquals(items[2].amount, 30)
luaunit.assertEquals(items[3].item, item_names[3])
luaunit.assertEquals(items[3].amount, 16)
luaunit.assertEquals(items.num_items, 3)
items:remove(item_names[1], 30)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 79)
luaunit.assertEquals(items[2].item, item_names[3])
luaunit.assertEquals(items[2].amount, 16)
luaunit.assertEquals(items[3].item, pkmn.item.NONE)
luaunit.assertEquals(items[3].amount, 0)
luaunit.assertEquals(items.num_items, 2)
items:add(item_names[4], 90)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 79)
luaunit.assertEquals(items[2].item, item_names[3])
luaunit.assertEquals(items[2].amount, 16)
luaunit.assertEquals(items[3].item, item_names[4])
luaunit.assertEquals(items[3].amount, 90)
luaunit.assertEquals(items.num_items, 3)
items:add(item_names[5], 2)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 79)
luaunit.assertEquals(items[2].item, item_names[3])
luaunit.assertEquals(items[2].amount, 16)
luaunit.assertEquals(items[3].item, item_names[4])
luaunit.assertEquals(items[3].amount, 90)
luaunit.assertEquals(items[4].item, item_names[5])
luaunit.assertEquals(items[4].amount, 2)
luaunit.assertEquals(items.num_items, 4)
items:remove(item_names[2], 30)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 49)
luaunit.assertEquals(items[2].item, item_names[3])
luaunit.assertEquals(items[2].amount, 16)
luaunit.assertEquals(items[3].item, item_names[4])
luaunit.assertEquals(items[3].amount, 90)
luaunit.assertEquals(items[4].item, item_names[5])
luaunit.assertEquals(items[4].amount, 2)
luaunit.assertEquals(items.num_items, 4)
items:add(item_names[6], 12)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 49)
luaunit.assertEquals(items[2].item, item_names[3])
luaunit.assertEquals(items[2].amount, 16)
luaunit.assertEquals(items[3].item, item_names[4])
luaunit.assertEquals(items[3].amount, 90)
luaunit.assertEquals(items[4].item, item_names[5])
luaunit.assertEquals(items[4].amount, 2)
luaunit.assertEquals(items[5].item, item_names[6])
luaunit.assertEquals(items[5].amount, 12)
luaunit.assertEquals(items.num_items, 5)
items:remove(item_names[3], 16)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 49)
luaunit.assertEquals(items[2].item, item_names[4])
luaunit.assertEquals(items[2].amount, 90)
luaunit.assertEquals(items[3].item, item_names[5])
luaunit.assertEquals(items[3].amount, 2)
luaunit.assertEquals(items[4].item, item_names[6])
luaunit.assertEquals(items[4].amount, 12)
luaunit.assertEquals(items.num_items, 4)
items:add(item_names[7], 65)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 49)
luaunit.assertEquals(items[2].item, item_names[4])
luaunit.assertEquals(items[2].amount, 90)
luaunit.assertEquals(items[3].item, item_names[5])
luaunit.assertEquals(items[3].amount, 2)
luaunit.assertEquals(items[4].item, item_names[6])
luaunit.assertEquals(items[4].amount, 12)
luaunit.assertEquals(items[5].item, item_names[7])
luaunit.assertEquals(items[5].amount, 65)
luaunit.assertEquals(items.num_items, 5)
items:add(item_names[8], 6)
luaunit.assertEquals(items[1].item, item_names[2])
luaunit.assertEquals(items[1].amount, 49)
luaunit.assertEquals(items[2].item, item_names[4])
luaunit.assertEquals(items[2].amount, 90)
luaunit.assertEquals(items[3].item, item_names[5])
luaunit.assertEquals(items[3].amount, 2)
luaunit.assertEquals(items[4].item, item_names[6])
luaunit.assertEquals(items[4].amount, 12)
luaunit.assertEquals(items[5].item, item_names[7])
luaunit.assertEquals(items[5].amount, 65)
luaunit.assertEquals(items[6].item, item_names[8])
luaunit.assertEquals(items[6].amount, 6)
luaunit.assertEquals(items.num_items, 6)
items:remove(item_names[5], 2)
items:remove(item_names[2], 49)
items:remove(item_names[8], 6)
items:remove(item_names[6], 12)
items:remove(item_names[4], 90)
items:remove(item_names[7], 65)
luaunit.assertEquals(items.num_items, 0)
end
return items_tests
|
return {
-- Whether or not to enable Git index clean/dirty display
index_enabled = false,
-- Whether or not to enable showing the date and/or time at the right side of the terminal
-- screen on the prompt
date_time_enabled = true,
-- Date/time format, see http://man7.org/linux/man-pages/man3/strftime.3.html
date_time_format = '%B %d, %Y %H:%M:%S',
}
|
--[[
# LuaJIT Vector library
This file implements some vector utillity functions, and multiple
conventions for using vector operations in Lua(mostly graphics/game programming).
It has been designed for best performance with LuaJIT and it's FFI library in mind.
Currently, only 2 or 3 component vectors are supported.
# Usage
```
local vec2 = vector2(type, metafunctions)
local vec3 = vector3(type, metafunctions)
```
type is a luajit ctype(can be a string like "double" or a userdata ctype reference; see LuaJIT FFI docs.)
metafunctions is a boolean(If enabled, arithmetic metamethods are available)
The vector2/vector3 functions return a FFI ctype that can be used to generate a new
vector variable(See LuaJIT FFI docs for initialization rules).
In general, most functions are available in 3 variants:
* No prefix usually means the last argument is target, a vector in which the result is stored in.
- `foo:add_v(bar, result)`
* "l_"-prefix means the target argument is the first function argument.
- `foo:l_add_v(bar)` is equal to `foo:add_v(bar, foo)`
* "n_"-prefix means the target argument is a new vector of the same type, and that new vector is returned.
- `local new = foo:n_add_v(bar)` is equal to `local new = vec3(); foo:add_v(bar, new)`
- this is also the default for the metamethods, and allows for an easy chaining syntax
* `local foo = vec3(0,0,0):n_add_v(1,2,3):n_mul_n(2)` is equal to `local foo = vec3(0,0,0) + vec3(1,2,3)*2`
As you can see the metamethod syntax is clean, but might create more new vectors than needed, hindering performance.
Vectors are (internally) always refered to by reference.
## Available functions
* add_v,sub_v,add_n,sub_n,mul_n,mul_v,div,min_n,max_n,min_v,max_v,clamp,neg,zero,one,copy_to,len,normalize,abs,dotp,tostring,equals
* l_neg,l_normalize,l_abs,l_add_v,l_sub_v,l_add_n,l_sub_n,l_mul_n,l_mul_v,l_div,l_min_n,l_max_n,l_min_v,l_max_v,l_clamp
* n_neg,n_normalize,n_abs,n_add_v,n_sub_v,n_add_n,n_sub_n,n_mul_n,n_mul_v,n_div,n_min_n,n_max_n,n_min_v,n_max_v,n_clamp,n_copy,n_zero,n_one
## Examples
get a new vector type that uses float and supports metamethods(syntax sugar)
```
local vec3 = vector3("float", true)
```
create a new vector and initialize to 0,1,0
```
local dir = vec3(0,1,0)
```
normalize dir vector(All l_ prefixed functions store results in the vector before the ":"-invocation)
```
dir:l_normalize()
```
-- add dir to pos, store result in a new vector(newpos)
```
local newpos = vec3()
pos:add_v(dir, newpos)
```
the meta-methods always wrap the n_ prefixed functions (creates a new vector for the result)
```
local newpos = pos + dir -- this is the same as the above example
```
]]
-- TODO: Fallback version that works without LuaJIT(maybe only need compatible FFI library for PUC Lua?)
-- TODO: matrix operations?
-- TODO: generic version fort n-vectors?
-- TODO: test assumed lower overhead of wrapping functions
-- TODO: create proper benchmark + analysis tools(support luajit profiler, compare bytecode, etc.)
local ffi = require("ffi")
local function get_nwrap(type_cb)
local function nwrap0(fn)
return function()
local type = type_cb()
local target = type()
fn(target)
return target
end
end
local function nwrap1(fn)
return function(a)
local type = type_cb()
local target = type()
fn(a, target)
return target
end
end
local function nwrap2(fn)
return function(a,b)
local type = type_cb()
local target = type()
fn(a, b, target)
return target
end
end
local function nwrap3(fn)
return function(a,b,c)
local type = type_cb()
local target = type()
fn(a, b, c, target)
return target
end
end
return nwrap0, nwrap1, nwrap2, nwrap3
end
-- TODO: benchmark lwrap vs raw
local function get_lwrap()
local function lwrap1(fn)
return function(a)
fn(a, a)
return a
end
end
local function lwrap2(fn)
return function(a,b)
fn(a, b, a)
return a
end
end
local function lwrap3(fn)
return function(a,b,c)
fn(a, b, c, a)
return a
end
end
return lwrap1, lwrap2, lwrap3
end
local function vector2(ctype, metafunctions)
ctype = ctype or "float"
ffi.cdef("struct __attribute__(( aligned(16) )) vec2_ct { __attribute__(( packed )) " .. ctype .." x, y; };")
-- for all vector functions:
-- v/v1/v2 argument is a vector argument
-- n is a numeric argument
-- target argument is where a vector result is stored
local function v2_add_v2(v1,v2,target)
target.x = v1.x+v2.x
target.y = v1.y+v2.y
end
local function v2_sub_v2(v1,v2,target)
target.x = v1.x-v2.x
target.y = v1.y-v2.y
end
local function v2_add_n(v1,n,target)
target.x = v1.x+n
target.y = v1.y+n
end
local function v2_sub_n(v1,n,target)
target.x = v1.x-n
target.y = v1.y-n
end
local function v2_mul_n(v,n,target)
target.x = v.x*n
target.y = v.y*n
end
local function v2_mul_v2(v1,v2,target)
target.x = v1.x*v2.x
target.y = v1.y*v2.y
end
local function v2_div(v,n,target)
target.x = v.x/n
target.y = v.y/n
end
local _min = math.min
local function v2_min_n(v,n,target)
target.x = _min(v.x,n)
target.y = _min(v.y,n)
end
local _max = math.max
local function v2_max_n(v,n,target)
target.x = _max(v.x,n)
target.y = _max(v.y,n)
end
local function v2_min_v(v1,v2,target)
target.x = _min(v1.x,v2.x)
target.y = _min(v1.y,v2.y)
end
local function v2_max_v(v1,v2,target)
target.x = _max(v1.x,v2.x)
target.y = _max(v1.y,v2.y)
end
local function v2_clamp(v,min,max,target)
target.x = _min(_max(v.x,min),max)
target.y = _min(_max(v.y,min),max)
end
local function v2_neg(v,target)
target.x = -v.x
target.y = -v.y
end
local function v2_copy_to(v,target)
target.x = v.x
target.y = v.y
end
local function v2_zero(target)
target.x = 0
target.y = 0
end
local function v2_one(target)
target.x = 1
target.y = 1
end
local _sqrt = math.sqrt
local function v2_len(v)
return _sqrt(v.x^2+v.y^2)
end
local function v2_normalize(v,target)
local mag = v2_len(v)
target.x = v.x/mag
target.y = v.y/mag
end
local _abs = math.abs
local function v2_abs(v,target)
target.x = _abs(v.x)
target.y = _abs(v.y)
end
local function v2_dotp(v1,v2)
return v1.x*v2.x+v1.y*v2.y
end
local function v2_tostring(v)
return "vec2 ("..v.x..", "..v.y..")"
end
local function v2_equals(v1,v2)
return (v1.x==v2.x) and (v1.y==v2.y)
end
local vec2_type
-- these function wrapper utillity functions are used to get versions of a function with a fixed argument
-- return functions with the target-argument set to a new vector
local nwrap0, nwrap1, nwrap2, nwrap3 = get_nwrap(function() return vec2_type end)
-- return functions with the target-argument set to the first argument(modify in place)
local lwrap1, lwrap2, lwrap3 = get_lwrap()
-- list of functions. If the function has a vector result, it's saved in the last argument(target)
local vec2_funcs = {
add_v = v2_add_v2,
sub_v = v2_sub_v2,
add_n = v2_add_n,
sub_n = v2_sub_n,
mul_n = v2_mul_n,
mul_v = v2_mul_v2,
div = v2_div,
min_n = v2_min_n,
max_n = v2_max_n,
min_v = v2_min_v,
max_v = v2_max_v,
clamp = v2_clamp,
neg = v2_neg,
zero = v2_zero,
one = v2_one,
copy_to = v2_copy_to,
len = v2_len,
normalize = v2_normalize,
abs = v2_abs,
dotp = v2_dotp,
tostring = v2_tostring,
equals = v2_equals,
-- list of left argument wrapped functions. target is first argument
-- (e.g. l_add_v(a,b) calls add_v(a,b,a))
l_neg = lwrap1(v2_neg),
l_normalize = lwrap1(v2_normalize),
l_abs = lwrap1(v2_abs),
l_add_v = lwrap2(v2_add_v2),
l_sub_v = lwrap2(v2_sub_v2),
l_add_n = lwrap2(v2_add_n),
l_sub_n = lwrap2(v2_sub_n),
l_mul_n = lwrap2(v2_mul_n),
l_mul_v = lwrap2(v2_mul_v2),
l_div = lwrap2(v2_div),
l_min_n = lwrap2(v2_min_n),
l_max_n = lwrap2(v2_max_n),
l_min_v = lwrap2(v2_min_v),
l_max_v = lwrap2(v2_max_v),
l_clamp = lwrap3(v2_clamp),
-- list of new vector wrapped functions. target us always a new vector
-- (warning: might be slow due to GC)
-- (e.g. "n_add_v(a,b)" is equal to "v=vec3();add_v(a,b,v);return v;")
n_neg = nwrap1(v2_neg),
n_normalize = nwrap1(v2_normalize),
n_abs = nwrap1(v2_abs),
n_add_v = nwrap2(v2_add_v2),
n_sub_v = nwrap2(v2_sub_v2),
n_add_n = nwrap2(v2_add_n),
n_sub_n = nwrap2(v2_sub_n),
n_mul_n = nwrap2(v2_mul_n),
n_mul_v = nwrap2(v2_mul_v2),
n_div = nwrap2(v2_div),
n_min_n = nwrap2(v2_min_n),
n_max_n = nwrap2(v2_max_n),
n_min_v = nwrap2(v2_min_v),
n_max_v = nwrap2(v2_max_v),
n_clamp = nwrap3(v2_clamp),
n_copy = nwrap1(v2_copy_to),
n_zero = nwrap0(v2_zero),
n_one = nwrap0(v2_one),
}
-- optional meta-methods for the vector
local __add, __sub, __mul, __div, __unm, __len
if metafunctions then
__add = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v2_add_n(a,b,vec2_type())
elseif b.is_vec3 then
return v2_add_v2(a,b,vec2_type())
end
end
__sub = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v2_sub_n(a,b,vec2_type())
elseif b.is_vec3 then
return v2_sub_v2(a,b,vec2_type())
end
end
__mul = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v2_mul_n(a,b,vec2_type())
elseif b.is_vec3 then
return v2_dotp(a,b)
end
end
__div = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v2_div(a,b,vec2_type())
end
end
__unm = function(a)
return v2_neg(a, vec2_type())
end
__len = function(a)
return v2_len(a)
end
end
-- create metatable for type(can't be changed after the ffi.metatype call)
local vec2_mt = {
__index = {
is_vec = true,
is_vec2 = true,
},
__tostring = v2_tostring, -- always included meta-methods
__eq = v2_equals,
__add = __add, __sub = __sub, -- optional meta-methods
__mul = __mul, __div = __div,
__unm = __unm, __len = __len
}
-- add functions to metatype
for k,v in pairs(vec2_funcs) do
vec2_mt.__index[k] = v
end
-- create metatype
vec2_type = ffi.metatype("struct vec2_ct", vec2_mt)
-- return metatype and function list
return vec2_type, vec2_funcs
end
local function vector3(ctype, metafunctions)
ctype = ctype or "float"
ffi.cdef("struct __attribute__(( aligned(16) )) vec3_ct { __attribute__(( packed )) " .. ctype .." x, y, z; };")
-- for all vector functions:
-- v/v1/v2 argument is a vector argument
-- n is a numeric argument
-- target argument is where a vector result is stored
local function v3_add_v3(v1,v2,target)
target.x = v1.x+v2.x
target.y = v1.y+v2.y
target.z = v1.z+v2.z
end
local function v3_sub_v3(v1,v2,target)
target.x = v1.x-v2.x
target.y = v1.y-v2.y
target.z = v1.z-v2.z
end
local function v3_add_n(v1,n,target)
target.x = v1.x+n
target.y = v1.y+n
target.z = v1.z+n
end
local function v3_sub_n(v1,n,target)
target.x = v1.x-n
target.y = v1.y-n
target.z = v1.z-n
end
local function v3_mul_n(v,n,target)
target.x = v.x*n
target.y = v.y*n
target.z = v.z*n
end
local function v3_mul_v3(v1,v2,target)
target.x = v1.x*v2.x
target.y = v1.y*v2.y
target.z = v1.z*v2.z
end
local function v3_div(v,n,target)
target.x = v.x/n
target.y = v.y/n
target.z = v.z/n
end
local _min = math.min
local function v3_min_n(v,n,target)
target.x = _min(v.x,n)
target.y = _min(v.y,n)
target.z = _min(v.z,n)
end
local _max = math.max
local function v3_max_n(v,n,target)
target.x = _max(v.x,n)
target.y = _max(v.y,n)
target.z = _max(v.z,n)
end
local function v3_min_v(v1,v2,target)
target.x = _min(v1.x,v2.x)
target.y = _min(v1.y,v2.y)
target.z = _min(v1.z,v2.z)
end
local function v3_max_v(v1,v2,target)
target.x = _max(v1.x,v2.x)
target.y = _max(v1.y,v2.y)
target.z = _max(v1.z,v2.z)
end
local function v3_clamp(v,min,max,target)
target.x = _min(_max(v.x,min),max)
target.y = _min(_max(v.y,min),max)
target.z = _min(_max(v.z,min),max)
end
local function v3_neg(v,target)
target.x = -v.x
target.y = -v.y
target.z = -v.z
end
local function v3_copy_to(v,target)
target.x = v.x
target.y = v.y
target.z = v.z
end
local function v3_zero(target)
target.x = 0
target.y = 0
target.z = 0
end
local function v3_one(target)
target.x = 1
target.y = 1
target.z = 1
end
local _sqrt = math.sqrt
local function v3_len(v)
return _sqrt(v.x^2+v.y^2+v.z^2)
end
local function v3_normalize(v,target)
local mag = v3_len(v)
target.x = v.x/mag
target.y = v.y/mag
target.z = v.z/mag
end
local _abs = math.abs
local function v3_abs(v,target)
target.x = _abs(v.x)
target.y = _abs(v.y)
target.z = _abs(v.z)
end
local function v3_dotp(v1,v2)
return v1.x*v2.x+v1.y*v2.y+v1.z*v2.z
end
local function v3_tostring(v)
return "vec3 ("..v.x..", "..v.y..", "..v.z..")"
end
local function v3_equals(v1,v2)
return (v1.x==v2.x) and (v1.y==v2.y) and (v1.z==v2.z)
end
local vec3_type
-- these function wrapper utillity functions are used to get versions of a function with a fixed argument
-- return functions with the target-argument set to a new vector
local nwrap0, nwrap1, nwrap2, nwrap3 = get_nwrap(function() return vec3_type end)
-- return functions with the target-argument set to the first argument(modify in place)
local lwrap1, lwrap2, lwrap3 = get_lwrap()
-- list of functions. If the function has a vector result, it's saved in the last argument(target)
local vec3_funcs = {
add_v = v3_add_v3,
sub_v = v3_sub_v3,
add_n = v3_add_n,
sub_n = v3_sub_n,
mul_n = v3_mul_n,
mul_v = v3_mul_v3,
div = v3_div,
min_n = v3_min_n,
max_n = v3_max_n,
min_v = v3_min_v,
max_v = v3_max_v,
clamp = v3_clamp,
neg = v3_neg,
zero = v3_zero,
one = v3_one,
copy_to = v3_copy_to,
len = v3_len,
normalize = v3_normalize,
abs = v3_abs,
dotp = v3_dotp,
tostring = v3_tostring,
equals = v3_equals,
-- list of left argument wrapped functions. target is first argument
-- (e.g. l_add_v(a,b) calls add_v(a,b,a))
l_neg = lwrap1(v3_neg),
l_normalize = lwrap1(v3_normalize),
l_abs = lwrap1(v3_abs),
l_add_v = lwrap2(v3_add_v3),
l_sub_v = lwrap2(v3_sub_v3),
l_add_n = lwrap2(v3_add_n),
l_sub_n = lwrap2(v3_sub_n),
l_mul_n = lwrap2(v3_mul_n),
l_mul_v = lwrap2(v3_mul_v3),
l_div = lwrap2(v3_div),
l_min_n = lwrap2(v3_min_n),
l_max_n = lwrap2(v3_max_n),
l_min_v = lwrap2(v3_min_v),
l_max_v = lwrap2(v3_max_v),
l_clamp = lwrap3(v3_clamp),
-- list of new vector wrapped functions. target us always a new vector
-- (warning: might be slow due to GC)
-- (e.g. "n_add_v(a,b)" is equal to "v=vec3();add_v(a,b,v);return v;")
n_neg = nwrap1(v3_neg),
n_normalize = nwrap1(v3_normalize),
n_abs = nwrap1(v3_abs),
n_add_v = nwrap2(v3_add_v3),
n_sub_v = nwrap2(v3_sub_v3),
n_add_n = nwrap2(v3_add_n),
n_sub_n = nwrap2(v3_sub_n),
n_mul_n = nwrap2(v3_mul_n),
n_mul_v = nwrap2(v3_mul_v3),
n_div = nwrap2(v3_div),
n_min_n = nwrap2(v3_min_n),
n_max_n = nwrap2(v3_max_n),
n_min_v = nwrap2(v3_min_v),
n_max_v = nwrap2(v3_max_v),
n_clamp = nwrap3(v3_clamp),
n_copy = nwrap1(v3_copy_to),
n_zero = nwrap0(v3_zero),
n_one = nwrap0(v3_one),
}
-- optional meta-methods for the vector
local __add, __sub, __mul, __div, __unm, __len
if metafunctions then
__add = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v3_add_n(a,b,vec3_type())
elseif b.is_vec3 then
return v3_add_v3(a,b,vec3_type())
end
end
__sub = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v3_sub_n(a,b,vec3_type())
elseif b.is_vec3 then
return v3_sub_v3(a,b,vec3_type())
end
end
__mul = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v3_mul_n(a,b,vec3_type())
elseif b.is_vec3 then
return v3_dotp(a,b)
end
end
__div = function(a,b)
if (type(b)=="number") or (not b.is_vec3) then
return v3_div(a,b,vec3_type())
end
end
__unm = function(a)
return v3_neg(a, vec3_type())
end
__len = function(a)
return v3_len(a)
end
end
-- create metatable for type(can't be changed after the ffi.metatype call)
local vec3_mt = {
__index = {
is_vec = true,
is_vec3 = true,
},
__tostring = v3_tostring, -- always included meta-methods
__eq = v3_equals,
__add = __add, __sub = __sub, -- optional meta-methods
__mul = __mul, __div = __div,
__unm = __unm, __len = __len
}
-- add functions to metatype
for k,v in pairs(vec3_funcs) do
vec3_mt.__index[k] = v
end
-- create metatype
vec3_type = ffi.metatype("struct vec3_ct", vec3_mt)
-- return metatype and function list
return vec3_type, vec3_funcs
end
return {
vector2 = vector2,
vector3 = vector3
}
|
AAPClassic.QL = {}
if (tonumber(string.sub(AAPClassic.Build, 1, 1)) > 2) then
--return
end
function AAPClassic.MakeQuestList()
AAPClassic.GroupQuestFrame = {}
AAPClassic.GroupQuestFrame = CreateFrame("frame", "AAP_SugQuestFrameFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate")
AAPClassic.GroupQuestFrame:SetWidth(300)
AAPClassic.GroupQuestFrame:SetHeight(150)
AAPClassic.GroupQuestFrame:SetMovable(true)
AAPClassic.GroupQuestFrame:EnableMouse(true)
AAPClassic.GroupQuestFrame:SetFrameStrata("LOW")
AAPClassic.GroupQuestFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
AAPClassic.GroupQuestFrame:SetBackdrop({
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 10, edgeSize = 10, insets = { left = 2, right = 2, top = 2, bottom = 2 }
});
AAPClassic.GroupQuestFrame:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
AAPClassic.GroupQuestFrame:StartMoving();
AAPClassic.GroupQuestFrame.isMoving = true;
end
end)
AAPClassic.GroupQuestFrame:SetScript("OnMouseUp", function(self, button)
if button == "LeftButton" and AAPClassic.GroupQuestFrame.isMoving then
AAPClassic.GroupQuestFrame:StopMovingOrSizing();
AAPClassic.GroupQuestFrame.isMoving = false;
end
end)
AAPClassic.GroupQuestFrame:SetScript("OnHide", function(self)
if (AAPClassic.GroupQuestFrame.isMoving) then
AAPClassic.GroupQuestFrame:StopMovingOrSizing();
AAPClassic.GroupQuestFrame.isMoving = false;
end
end)
AAPClassic.GroupQuestFrame:Hide()
AAPClassic.GroupQuestFrameFS1 = AAPClassic.GroupQuestFrame:CreateFontString("CLQaaFS1", "ARTWORK", "ChatFontNormal")
AAPClassic.GroupQuestFrameFS1:SetParent(AAPClassic.GroupQuestFrame)
AAPClassic.GroupQuestFrameFS1:SetPoint("TOPLEFT", AAPClassic.GroupQuestFrame, "TOPLEFT", 0, 0)
AAPClassic.GroupQuestFrameFS1:SetWidth(300)
AAPClassic.GroupQuestFrameFS1:SetHeight(38)
AAPClassic.GroupQuestFrameFS1:SetJustifyH("CENTER")
AAPClassic.GroupQuestFrameFS1:SetFontObject("GameFontNormalLarge")
AAPClassic.GroupQuestFrameFS1:SetText("Quests Text")
AAPClassic.GroupQuestFrameFS1:SetTextColor(1, 1, 0)
AAPClassic.GroupQuestFrameFS2 = AAPClassic.GroupQuestFrame:CreateFontString("CLQaaFS2", "ARTWORK", "ChatFontNormal")
AAPClassic.GroupQuestFrameFS2:SetParent(AAPClassic.GroupQuestFrame)
AAPClassic.GroupQuestFrameFS2:SetPoint("TOPLEFT", AAPClassic.GroupQuestFrame, "TOPLEFT", 0, -30)
AAPClassic.GroupQuestFrameFS2:SetWidth(300)
AAPClassic.GroupQuestFrameFS2:SetHeight(38)
AAPClassic.GroupQuestFrameFS2:SetJustifyH("CENTER")
AAPClassic.GroupQuestFrameFS2:SetFontObject("GameFontNormalLarge")
AAPClassic.GroupQuestFrameFS2:SetText("Suggested Players: ")
AAPClassic.GroupQuestFrameFS2:SetTextColor(1, 1, 0)
AAPClassic.GroupQuestFrame["Button1"] = CreateFrame("Button", "AAP_SBX1", UIParent, "SecureActionButtonTemplate")
AAPClassic.GroupQuestFrame["Button1"]:SetPoint("BOTTOMLEFT", AAPClassic.GroupQuestFrame, "BOTTOMLEFT", 15, 5)
AAPClassic.GroupQuestFrame["Button1"]:SetWidth(110)
AAPClassic.GroupQuestFrame["Button1"]:SetHeight(30)
AAPClassic.GroupQuestFrame["Button1"]:SetText("Accept Quest")
AAPClassic.GroupQuestFrame["Button1"]:SetParent(AAPClassic.GroupQuestFrame)
AAPClassic.GroupQuestFrame.Button1:SetNormalFontObject("GameFontNormal")
AAPClassic.GroupQuestFrame.Button1ntex = AAPClassic.GroupQuestFrame.Button1:CreateTexture()
AAPClassic.GroupQuestFrame.Button1ntex:SetTexture("Interface/Buttons/UI-Panel-Button-Up")
AAPClassic.GroupQuestFrame.Button1ntex:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.GroupQuestFrame.Button1ntex:SetAllPoints()
AAPClassic.GroupQuestFrame.Button1:SetNormalTexture(AAPClassic.GroupQuestFrame.Button1ntex)
AAPClassic.GroupQuestFrame.Button1htex = AAPClassic.GroupQuestFrame.Button1:CreateTexture()
AAPClassic.GroupQuestFrame.Button1htex:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
AAPClassic.GroupQuestFrame.Button1htex:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.GroupQuestFrame.Button1htex:SetAllPoints()
AAPClassic.GroupQuestFrame.Button1:SetHighlightTexture(AAPClassic.GroupQuestFrame.Button1htex)
AAPClassic.GroupQuestFrame.Button1ptex = AAPClassic.GroupQuestFrame.Button1:CreateTexture()
AAPClassic.GroupQuestFrame.Button1ptex:SetTexture("Interface/Buttons/UI-Panel-Button-Down")
AAPClassic.GroupQuestFrame.Button1ptex:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.GroupQuestFrame.Button1ptex:SetAllPoints()
AAPClassic.GroupQuestFrame.Button1:SetPushedTexture(AAPClassic.GroupQuestFrame.Button1ptex)
AAPClassic.GroupQuestFrame["Button1"]:SetScript("OnClick", function(self, arg1)
AAPClassic.QAskPopWantedAsk("yes")
end)
AAPClassic.GroupQuestFrame["Button2"] = CreateFrame("Button", "AAP_SBX2", UIParent, "SecureActionButtonTemplate")
AAPClassic.GroupQuestFrame["Button2"]:SetPoint("BOTTOMRIGHT", AAPClassic.GroupQuestFrame, "BOTTOMRIGHT", -15, 5)
AAPClassic.GroupQuestFrame["Button2"]:SetWidth(110)
AAPClassic.GroupQuestFrame["Button2"]:SetHeight(30)
AAPClassic.GroupQuestFrame["Button2"]:SetText("Decline Quest")
AAPClassic.GroupQuestFrame["Button2"]:SetParent(AAPClassic.GroupQuestFrame)
AAPClassic.GroupQuestFrame.Button2:SetNormalFontObject("GameFontNormal")
AAPClassic.GroupQuestFrame.Button2ntex = AAPClassic.GroupQuestFrame.Button2:CreateTexture()
AAPClassic.GroupQuestFrame.Button2ntex:SetTexture("Interface/Buttons/UI-Panel-Button-Up")
AAPClassic.GroupQuestFrame.Button2ntex:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.GroupQuestFrame.Button2ntex:SetAllPoints()
AAPClassic.GroupQuestFrame.Button2:SetNormalTexture(AAPClassic.GroupQuestFrame.Button2ntex)
AAPClassic.GroupQuestFrame.Button2htex = AAPClassic.GroupQuestFrame.Button2:CreateTexture()
AAPClassic.GroupQuestFrame.Button2htex:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
AAPClassic.GroupQuestFrame.Button2htex:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.GroupQuestFrame.Button2htex:SetAllPoints()
AAPClassic.GroupQuestFrame.Button2:SetHighlightTexture(AAPClassic.GroupQuestFrame.Button2htex)
AAPClassic.GroupQuestFrame.Button2ptex = AAPClassic.GroupQuestFrame.Button2:CreateTexture()
AAPClassic.GroupQuestFrame.Button2ptex:SetTexture("Interface/Buttons/UI-Panel-Button-Down")
AAPClassic.GroupQuestFrame.Button2ptex:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.GroupQuestFrame.Button2ptex:SetAllPoints()
AAPClassic.GroupQuestFrame.Button2:SetPushedTexture(AAPClassic.GroupQuestFrame.Button2ptex)
AAPClassic.GroupQuestFrame["Button2"]:SetScript("OnClick", function(self, arg1)
AAPClassic.QAskPopWantedAsk("no")
end)
AAPClassic.QL.MainFrame = CreateFrame("frame", "AAPClassic_QL_QButtonMi_MainFrame", UIParent)
AAPClassic.QL.MainFrame:SetWidth(1)
AAPClassic.QL.MainFrame:SetHeight(1)
AAPClassic.QL.MainFrame:SetMovable(true)
AAPClassic.QL.MainFrame:EnableMouse(true)
AAPClassic.QL.MainFrame:SetFrameStrata("MEDIUM")
AAPClassic.QL.MainFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 1, 1)
AAPClassic.QL.QButtonFrame = CreateFrame("frame", "AAPClassic_QL_QButton_ListFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate")
AAPClassic.QL.QButtonFrame:SetWidth(55)
AAPClassic.QL.QButtonFrame:SetHeight(55)
AAPClassic.QL.QButtonFrame:SetFrameStrata("MEDIUM")
AAPClassic.QL.QButtonFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
AAPClassic.QL.QButtonFrame:SetMovable(true)
AAPClassic.QL.QButtonFrame:EnableMouse(true)
AAPClassic.QL.QButtonFrame:SetScript("OnMouseDown", function(self, button)
if (button == "LeftButton" and not AAPClassic.QL.QButtonFrame.isMoving) then
AAPClassic.QL.QButtonFrame:StartMoving();
AAPClassic.QL.QButtonFrame.isMoving = true;
end
end)
AAPClassic.QL.QButtonFrame:SetScript("OnMouseUp", function(self, button)
if (button == "LeftButton" and AAPClassic.QL.QButtonFrame.isMoving) then
AAPClassic.QL.QButtonFrame:StopMovingOrSizing();
AAPClassic.QL.QButtonFrame.isMoving = false;
end
end)
AAPClassic.QL.QButtonFrame:SetScript("OnHide", function(self)
if (AAPClassic.QL.QButtonFrame.isMoving) then
AAPClassic.QL.QButtonFrame:StopMovingOrSizing();
AAPClassic.QL.QButtonFrame.isMoving = false;
end
end)
AAPClassic.QL.QButtonFrame:SetBackdrop({
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 10, edgeSize = 10, insets = { left = 2, right = 2, top = 2, bottom = 2 }
});
AAPClassic.QL.QButtonFrame["Button"] = CreateFrame("Button", "AAPClassic_QL_QButtonFrame_Button", AAPClassic.QL.QButtonFrame, "SecureActionButtonTemplate")
AAPClassic.QL.QButtonFrame["Button"]:SetWidth(37)
AAPClassic.QL.QButtonFrame["Button"]:SetHeight(37)
AAPClassic.QL.QButtonFrame["Button"]:SetText("X")
AAPClassic.QL.QButtonFrame["Button"]:SetPoint("CENTER", AAPClassic.QL.QButtonFrame, "CENTER", 0, 0)
AAPClassic.QL.QButtonFrame["Button"]:SetNormalFontObject("GameFontNormalLarge")
AAPClassic.QL.QButtonFrame["Buttonntex"] = AAPClassic.QL.QButtonFrame["Button"]:CreateTexture()
AAPClassic.QL.QButtonFrame["Buttonntex"]:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
AAPClassic.QL.QButtonFrame["Buttonntex"]:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.QL.QButtonFrame["Buttonntex"]:SetAllPoints()
AAPClassic.QL.QButtonFrame["Button"]:SetNormalTexture("Interface/Buttons/UI-Panel-Button-Highlight")
AAPClassic.QL.QButtonFrame["Buttonhtex"] = AAPClassic.QL.QButtonFrame["Button"]:CreateTexture()
AAPClassic.QL.QButtonFrame["Buttonhtex"]:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
AAPClassic.QL.QButtonFrame["Buttonhtex"]:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.QL.QButtonFrame["Buttonhtex"]:SetAllPoints()
AAPClassic.QL.QButtonFrame["Button"]:SetHighlightTexture(AAPClassic.QL.QButtonFrame["Buttonhtex"])
AAPClassic.QL.QButtonFrame["Buttonptex"] = AAPClassic.QL.QButtonFrame["Button"]:CreateTexture()
AAPClassic.QL.QButtonFrame["Buttonptex"]:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
AAPClassic.QL.QButtonFrame["Buttonptex"]:SetTexCoord(0, 0.625, 0, 0.6875)
AAPClassic.QL.QButtonFrame["Buttonptex"]:SetAllPoints()
AAPClassic.QL.QButtonFrame["Button"]:SetPushedTexture(AAPClassic.QL.QButtonFrame["Buttonptex"])
AAPClassic.QL.QButtonFrame["ButtonCD"] = CreateFrame("Cooldown", "AAPClassic_QL_QButtonFrame_ButtonCooldown", AAPClassic.QL.QButtonFrame["Button"], "CooldownFrameTemplate")
AAPClassic.QL.QButtonFrame["ButtonCD"]:SetAllPoints()
AAPClassic.QL.QButtonFrame:Hide()
AAPClassic.QL.ListFrame = CreateFrame("frame", "AAPClassic_QL_QuestList_ListFrame", UIParent)
AAPClassic.QL.ListFrame:SetWidth(1)
AAPClassic.QL.ListFrame:SetHeight(1)
AAPClassic.QL.ListFrame:SetFrameStrata("MEDIUM")
AAPClassic.QL.ListFrame:SetPoint("TOPLEFT", AAPClassic.QL.MainFrame, "TOPLEFT", 0, 0)
AAPClassic.QL.ListFrame:SetMovable(true)
AAPClassic.QL.ListFrame:EnableMouse(true)
AAPClassic.QL.ListFrame:SetScript("OnMouseDown", function(self, button)
if (button == "LeftButton" and not AAPClassic.QL.MainFrame.isMoving) then
AAPClassic.QL.MainFrame:StartMoving();
AAPClassic.QL.MainFrame.isMoving = true;
end
end)
AAPClassic.QL.ListFrame:SetScript("OnMouseUp", function(self, button)
if (button == "LeftButton" and AAPClassic.QL.MainFrame.isMoving) then
AAPClassic.QL.MainFrame:StopMovingOrSizing();
AAPClassic.QL.MainFrame.isMoving = false;
end
end)
AAPClassic.QL.ListFrame:SetScript("OnHide", function(self)
if (AAPClassic.QL.MainFrame.isMoving) then
AAPClassic.QL.MainFrame:StopMovingOrSizing();
AAPClassic.QL.MainFrame.isMoving = false;
end
end)
AAPClassic.QL.QuestFrames = {}
local CLi
for CLi = 1, 20 do
AAPClassic.QL.QuestFrames[CLi] = CreateFrame("frame", "AAPClassic_QL_QuestFrames" .. CLi, AAPClassic.QL.ListFrame, BackdropTemplateMixin and "BackdropTemplate")
AAPClassic.QL.QuestFrames[CLi]:SetWidth(250)
AAPClassic.QL.QuestFrames[CLi]:SetHeight(20)
AAPClassic.QL.QuestFrames[CLi]:SetPoint("BOTTOMLEFT", AAPClassic.QL.ListFrame, "BOTTOMLEFT", 0, -((CLi * 20) + CLi))
AAPClassic.QL.QuestFrames[CLi]:SetBackdrop({
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 10, edgeSize = 10, insets = { left = 2, right = 2, top = 2, bottom = 2 }
});
AAPClassic.QL.QuestFrames[CLi]:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
AAPClassic.QL.MainFrame:StartMoving();
AAPClassic.QL.MainFrame.isMoving = true;
end
end)
AAPClassic.QL.QuestFrames[CLi]:SetScript("OnMouseUp", function(self, button)
if button == "LeftButton" and AAPClassic.QL.MainFrame.isMoving then
AAPClassic.QL.MainFrame:StopMovingOrSizing();
AAPClassic.QL.MainFrame.isMoving = false;
end
end)
AAPClassic.QL.QuestFrames[CLi]:SetScript("OnHide", function(self)
if (AAPClassic.QL.MainFrame.isMoving) then
AAPClassic.QL.MainFrame:StopMovingOrSizing();
AAPClassic.QL.MainFrame.isMoving = false;
end
end)
AAPClassic.QL.QuestFrames[CLi]:Hide()
AAPClassic.QL.QuestFrames["FS" .. CLi] = AAPClassic.QL.ListFrame:CreateFontString("CLQFS" .. CLi, "ARTWORK", "ChatFontNormal")
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetParent(AAPClassic.QL.QuestFrames[CLi])
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetPoint("TOPLEFT", AAPClassic.QL.QuestFrames[CLi], "TOPLEFT", 5, 0)
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetWidth(600)
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetHeight(20)
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetJustifyH("LEFT")
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetFontObject("GameFontNormal")
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetText("")
AAPClassic.QL.QuestFrames["FS" .. CLi]:SetTextColor(1, 1, 0)
end
end
AAPClassic.QL.QuestListEventFrame = CreateFrame("Frame")
AAPClassic.QL.QuestListEventFrame:RegisterEvent("ADDON_LOADED")
AAPClassic.QL.QuestListEventFrame:SetScript("OnEvent", function(self, event, ...)
if (event == "ADDON_LOADED") then
local arg1, arg2, arg3, arg4, arg5 = ...;
if (arg1 == "AAP-TBC-Classic") then
AAPClassic.MakeQuestList()
end
end
end)
|
require'ffi'.cdef[[
unsigned XXH_versionNumber(void);
typedef union {
uint64_t u64[2];
uint32_t u32[4];
uint8_t u8[16];
} XXH128_hash_t;
uint32_t XXH32 (const void* input, size_t length, uint32_t seed);
uint64_t XXH64 (const void* input, size_t length, uint64_t seed);
XXH128_hash_t XXH128(const void* input, size_t length, uint64_t seed);
XXH128_hash_t XXH3_128bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize);
typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
typedef struct XXH3_state_s XXH3_state_t;
XXH3_state_t* XXH3_createState(void);
XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr);
void XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state);
XXH_errorcode XXH3_128bits_reset(XXH3_state_t* statePtr);
XXH_errorcode XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, uint64_t seed);
XXH_errorcode XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize);
XXH_errorcode XXH3_128bits_update (XXH3_state_t* statePtr, const void* input, size_t length);
XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* statePtr);
]]
|
local luvitTime = require"timer"
local time = {}
function time.setTimeout(timeout, callback)
local timer = luvitTime.setTimeout(timeout, callback)
return function()
luvitTime.clearTimer(timer)
end
end
function time.setInterval(timeout, callback)
local timer = luvitTime.setInterval(timeout, callback)
return function()
luvitTime.clearTimer(timer)
end
end
return time
|
-- Copyright 2006-2021 Mitchell. See LICENSE.
-- jq 1.6 Lua lexer -- https://stedolan.github.io/jq/wiki
-- Anonymously contributed.
local lexer = require('lexer')
local token, word_match = lexer.token, lexer.word_match
local P, S = lpeg.P, lpeg.S
local lex = lexer.new('jq')
-- Whitespace.
lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1))
-- Keywords.
lex:add_rule('keyword', token(lexer.KEYWORD, word_match{
-- keywords not listed by jq's "builtins", minus operators 'and' and 'or', plus the '?' shorthand
'as', 'break', 'catch', 'def', 'elif', 'else', 'end', 'foreach', 'if', 'import', 'include',
'label', 'module', 'reduce', 'then', 'try'
} + '?'))
-- Functions.
lex:add_rule('function', token(lexer.FUNCTION, word_match{
-- jq 1.6 built-in functions (SQL in upper caisse)
'acos', 'acosh', 'add', 'all', 'any', 'arrays', 'ascii_downcase', 'ascii_upcase', 'asin', 'asinh',
'atan', 'atan2', 'atanh', 'booleans', 'bsearch', 'builtins', 'capture', 'cbrt', 'ceil',
'combinations', 'contains', 'copysign', 'cos', 'cosh', 'debug', 'del', 'delpaths', 'drem',
'empty', 'endswith', 'env', 'erf', 'erfc', 'error', 'exp', 'exp10', 'exp2', 'explode', 'expm1',
'fabs', 'fdim', 'finites', 'first', 'flatten', 'floor', 'fma', 'fmax', 'fmin', 'fmod', 'format',
'frexp', 'from_entries', 'fromdate', 'fromdateiso8601', 'fromjson', 'fromstream', 'gamma',
'get_jq_origin', 'get_prog_origin', 'get_search_list', 'getpath', 'gmtime', 'group_by', 'gsub',
'halt', 'halt_error', 'has', 'hypot', 'implode', 'IN', 'in', 'INDEX', 'index', 'indices',
'infinite', 'input', 'input_filename', 'input_line_number', 'inputs', 'inside', 'isempty',
'isfinite', 'isinfinite', 'isnan', 'isnormal', 'iterables', 'j0', 'j1', 'jn', 'JOIN', 'join',
'keys', 'keys_unsorted', 'last', 'ldexp', 'leaf_paths', 'length', 'lgamma', 'lgamma_r', 'limit',
'localtime', 'log', 'log10', 'log1p', 'log2', 'logb', 'ltrimstr', 'map', 'map_values', 'match',
'max', 'max_by', 'min', 'min_by', 'mktime', 'modf', 'modulemeta', 'nan', 'nearbyint', 'nextafter',
'nexttoward', 'normals', 'not', 'now', 'nth', 'nulls', 'numbers', 'objects', 'path', 'paths',
'pow', 'pow10', 'range', 'recurse', 'recurse_down', 'remainder', 'repeat', 'reverse', 'rindex',
'rint', 'round', 'rtrimstr', 'scalars', 'scalars_or_empty', 'scalb', 'scalbln', 'scan', 'select',
'setpath', 'significand', 'sin', 'sinh', 'sort', 'sort_by', 'split', 'splits', 'sqrt',
'startswith', 'stderr', 'strflocaltime', 'strftime', 'strings', 'strptime', 'sub', 'tan', 'tanh',
'test', 'tgamma', 'to_entries', 'todate', 'todateiso8601', 'tojson', 'tonumber', 'tostream',
'tostring', 'transpose', 'trunc', 'truncate_stream', 'type', 'unique', 'unique_by', 'until',
'utf8bytelength', 'values', 'walk', 'while', 'with_entries', 'y0', 'y1', 'yn'
}))
-- Strings.
local string = token(lexer.STRING, lexer.range('"', true))
local literal = token(lexer.STRING, word_match('null false true'))
lex:add_rule('string', string + literal)
-- Operators.
-- 'not' isn't an operator but a function (filter)
lex:add_rule('operator', token(lexer.OPERATOR,
P('.[]') + '?//' + '//=' + 'and' + '[]' + '//' + '==' + '!=' + '>=' + '<=' + '|=' + '+=' + '-=' +
'*=' + '/=' + '%=' + 'or' + S('=+-*/%<>()[]{}.,') + '|' + ';'))
-- Identifiers.
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
-- Comments.
lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol('#')))
-- Numbers.
lex:add_rule('number', token(lexer.NUMBER, lexer.number))
-- Formats.
lex:add_rule('format',
token('format', '@' * word_match('text json html uri csv tsv sh base64 base64d')))
lex:add_style('format', lexer.styles.constant)
-- Variables.
lex:add_rule('sysvar', token('sysvar', '$' * word_match('ENV ORIGIN __loc__')))
lex:add_style('sysvar', lexer.styles.constant .. {bold = true})
lex:add_rule('variable', token(lexer.VARIABLE, '$' * lexer.word))
-- Fold points.
lex:add_fold_point(lexer.KEYWORD, 'if', 'end')
lex:add_fold_point(lexer.OPERATOR, '[', ']')
lex:add_fold_point(lexer.OPERATOR, '{', '}')
lex:add_fold_point(lexer.COMMENT, lexer.fold_consecutive_lines('#'))
return lex
|
local time = {}
local skynet_loaded, skynet = pcall(require, 'skynet')
--- Default time now
time.now = function()
if skynet_loaded then
return math.floor(skynet.time() * 1000)
end
return os.time() + math.random(1000)
end
return time
|
-- Homebrew menubar
local Homebrew = {
menubar = hs.menubar.new(),
items = {},
disabled = false,
notified = false,
}
function Homebrew:showMenu()
self.menubar:returnToMenuBar()
self.menubar:setIcon('./assets/cask.pdf')
self.menubar:setTooltip(string.format("%d updated formula%s available", #self.items, plural(self.items)))
end
function Homebrew:hideMenu()
self.menubar:removeFromMenuBar()
end
function Homebrew:loadOutdated()
self.items = {}
local pipe = io.popen('/usr/local/bin/brew outdated -v | grep -v pinned | cut -f 1 -d " "', 'r')
for item in pipe:lines() do
table.insert(self.items, item)
end
pipe:close()
if next(self.items) == nil then
self.disabled = true
self.notified = false
self:hideMenu()
else
self.disabled = false
self:showMenu()
if not self.notified then
hs.notify.show('Homebrew', 'Formulas updated', table.concat(self.items, ', '))
self.notified = true
end
end
end
function Homebrew:getMenu()
local menu = {
{title=string.format("Update %s formula%s", #self.items, plural(self.items)), fn=function() self.disabled = true; hs.task.new('/usr/local/bin/brew', function() Homebrew:loadOutdated() end, table.merge({'upgrade'}, self.items)):start() end, disabled=self.disabled},
{title='-'},
}
for _, item in ipairs(self.items) do
table.insert(menu, {title=item, fn=function() self.disabled = true; hs.task.new('/usr/local/bin/brew', function() Homebrew:loadOutdated() end, {'upgrade', item}):start() end, disabled=self.disabled})
end
return menu
end
function Homebrew:update()
print('Updating Homebrew')
hs.task.new('/usr/local/bin/brew', function() Homebrew:loadOutdated() end, {'update'}):start()
end
function table.merge(t1, t2)
for k,v in ipairs(t2) do
table.insert(t1, v)
end
return t1
end
function plural(a)
local suffix = ''
if #a > 1 then
suffix = 's'
end
return suffix
end
if Homebrew then
Homebrew:hideMenu()
Homebrew.menubar:setMenu(function() return Homebrew:getMenu() end)
Homebrew:update(); hs.timer.doEvery(3 * 3600, function() Homebrew:update() end)
end
|
--[[
Project: SA-MP API
Author: LUCHARE
All structures are taken from mod_s0beit_sa.
Copyright: BlastHack
mod_sa is available from https://github.com/BlastHackNet/mod_s0beit_sa/
]]
local sys = require 'SA-MP API.kernel'
sys.ffi.cdef[[
struct stTextdraw {
char szText[800 + 1];
char szString[1600 + 2];
float fLetterWidth;
float fLetterHeight;
unsigned int dwLetterColor;
unsigned char byte_unk;
unsigned char byteCenter;
unsigned char byteBox;
float fBoxSizeX;
float fBoxSizeY;
unsigned int dwBoxColor;
unsigned char byteProportional;
unsigned int dwShadowColor;
unsigned char byteShadowSize;
unsigned char byteOutline;
unsigned char byteLeft;
unsigned char byteRight;
int iStyle;
float fX;
float fY;
unsigned char unk[8];
unsigned int dword99B;
unsigned int dword99F;
unsigned int index;
unsigned char byte9A7;
unsigned short sModel;
float fRot[3];
float fZoom;
unsigned short sColor[2];
unsigned char f9BE;
unsigned char byte9BF;
unsigned char byte9C0;
unsigned int dword9C1;
unsigned int dword9C5;
unsigned int dword9C9;
unsigned int dword9CD;
unsigned char byte9D1;
unsigned int dword9D2;
}__attribute__ ((packed));
]]
|
MINOMODELS = {
{
name = "Corpse",
model = "models/player/corpse1.mdl",
cost = 0
},
{
name = "Zombie",
model = "models/player/zombie_classic.mdl",
cost = 1000
},
{
name = "Fast Zombie",
model = "models/player/zombie_fast.mdl",
cost = 5000
},
{
name = "Skeleton",
model = "models/player/skeleton.mdl",
cost = 10000
}
}
|
dofile("codeblocks/_codeblocks.lua")
dofile("codeblocks/codeblocks.lua")
ACTION.Manual = true
|
data:extend({
{
type = "double-setting",
name = "heli-gun-damage-modifier",
setting_type = "startup",
default_value = 1,
minimum_value = 0,
},
{
type = "string-setting",
name = "heli-consumption",
setting_type = "startup",
default_value = "3.2MW",
},
{
type = "string-setting",
name = "heli-braking-power",
setting_type = "startup",
default_value = "1MW",
},
{
type = "int-setting",
name = "heli-weight",
setting_type = "startup",
default_value = 2800,
minimum_value = 0,
},
----------------------------------------------
{
type = "bool-setting",
name = "heli-deactivate-inserters",
setting_type = "runtime-global",
default_value = true,
},
{
type = "double-setting",
name = "heli-crash-dmg-mult",
setting_type = "runtime-global",
default_value = 1,
minimum_value = 0,
},
----------------------------------------------
{
type = "bool-setting",
name = "heli-auto-focus-searchfields",
setting_type = "runtime-per-user",
default_value = false,
},
{
type = "double-setting",
name = "heli-gui-heliSelection-defaultZoom",
setting_type = "runtime-per-user",
default_value = 0.3,
minimum_value = 0.2,
maximum_value = 1.26,
},
{
type = "double-setting",
name = "heli-gui-heliPadSelection-defaultZoom",
setting_type = "runtime-per-user",
default_value = 0.2,
minimum_value = 0.025,
maximum_value = 1.0125,
},
{
type = "bool-setting",
name = "heli-gaugeGui-show",
setting_type = "runtime-per-user",
default_value = true,
},
{
type = "bool-setting",
name = "heli-gaugeGui-play-fuel-warning-sound",
setting_type = "runtime-per-user",
default_value = true,
},
{
type = "bool-setting",
name = "heli-fuel-alert",
setting_type = "runtime-per-user",
default_value = false,
},
{
type = "bool-setting",
name = "heli-remote-dont-auto-land-player",
setting_type = "runtime-per-user",
default_value = true,
},
})
|
local object = require 'object'
local timer = require 'timer'
local color = require 'color'
local graphics = require 'graphics'
local input = require 'input'
local debugscreen = object {
active = __TESTING,
fps = 0,
mem = 0,
_init = function(self)
self.update_clock = timer:create_interval(1, self:bind(self.update_clock))
end,
toggle = function(self) self.active = not self.active end,
draw_debug = function(self)
if not self.active then return end
graphics:set_color(color.PUREWHITE)
graphics:write(0, 0, "FPS:%s Mem:%s KP:%s", self.fps, self.mem, input.lastKey and input.lastKey or ' ')
if self.player then
graphics:write(0, 10, "X:%3i Y:%3i", self.player.x, self.player.y)
graphics:write(0, 20, "dX:%3i dY:%3i", self.player.dx, self.player.dy)
end
end,
update_clock = function(self)
self.fps = string.format("%3i", love.timer.getFPS())
local mem = tonumber(collectgarbage("count"))
if mem >= 1000 then
self.mem = string.format("%3.1fM", mem/1000)
else
self.mem = string.format("%3ik", mem)
end
end,
update_debug = function(self, dt)
--
end,
}
return debugscreen
|
local System = System
local io = io
local stdin = io.stdin
local stdout = io.stdout
local read = stdin.read
local write = stdout.write
local select = select
local string = string
local byte = string.byte
local char = string.char
local Console = {}
function Console.Read()
local ch = read(stdin, 1)
return byte(ch)
end
function Console.ReadLine()
return read(stdin)
end
function Console.Write(v, ...)
if select("#", ...) ~= 0 then
v = v:Format(...)
else
v = v:ToString()
end
write(stdout, v)
end
function Console.WriteChar(v)
write(stdout, char(v))
end
function Console.WriteLine(v, ...)
if select("#", ...) ~= 0 then
v = v:Format(...)
else
v = v:ToString()
end
write(stdout, v, "\n")
end
function Console.WriteLineChar(v)
write(stdout, char(v), "\n")
end
System.define("System.Console", Console)
|
--[[
Title: Sessions Data Filter
Author(s): big
CreateDate: 2021.06.09
ModifyDate: 2021.11.04
Desc:
use the lib:
------------------------------------------------------------
local SessionsDataFilter = NPL.load('(gl)Mod/WorldShare/filters/database/SessionsDataFilter.lua')
SessionsDataFilter:Init()
------------------------------------------------------------
]]
-- libs
local SessionsData = NPL.load('(gl)Mod/WorldShare/database/SessionsData.lua')
local SessionsDataFilter = NPL.export()
function SessionsDataFilter:Init()
GameLogic.GetFilters():add_filter(
'database.sessions_data.get_session_by_username',
function(...)
return SessionsData:GetSessionByUsername(...)
end
)
GameLogic.GetFilters():add_filter(
'database.sessions_data.save_session',
function(...)
return SessionsData:SaveSession(...)
end
)
GameLogic.GetFilters():add_filter(
'database.sessions_data.get_sessions',
function()
return SessionsData:GetSessions()
end
)
end
|
-- an implementation of printf
function sprintf(...)
return string.format(...)
end
function printf (...)
print(sprintf(...))
end
x = sprintf("Hello %s from %s on %s", "there", "Lua Tests", "XYZ")
assert (x == "Hello there from Lua Tests on XYZ")
print(x)
|
--[[ BonaLuna bignumber library
Copyright (C) 2010-2015 Christophe Delord
http://cdsoft.fr/bl/bonaluna.html
BonaLuna is based on Lua 5.3
Copyright (C) 1994-2015 Lua.org, PUC-Rio
Freely available under the terms of the Lua license.
--]]
-- Inspired by BigNum (http://oss.digirati.com.br/luabignum/)
bn = {}
do
-- Low level integer routines {{{
local int, int_copy, int_trim, int_tostring, int_tonumber
local int_abscmp, int_cmp, int_iszero, int_isone
local int_neg, int_abs
local int_add, int_sub, int_mul, int_divmod
local int_pow
local int_zero, int_one, int_two
local int_gcd
local RADIX = 10000000
local RADIX_LEN = math.floor(math.log10(RADIX))
local _sep = nil
assert(RADIX^2 < 2^53, "RADIX^2 shall be storable on a lua number")
function bn.sep(s)
if s == "_" or s == " " or s == "" or not s then
if s == "" then s = nil end
_sep = s
else
error("bn separator shall be \"_\", \" \" or nil")
end
end
int_trim = function(a)
for i = #a, 1, -1 do
if a[i] and a[i] ~= 0 then break end
table.remove(a)
end
if #a == 0 then a.sign = 1 end
end
int = function(n)
n = n or 0
if type(n) == "table" then return n end
if type(n) == "number" then n = string.format("%.0f", math.floor(n)) end
assert(type(n) == "string")
n = string.gsub(n, "[ _]", "")
local sign = 1
local d = 1 -- current digit index
if string.sub(n, d, d) == '+' then d = d+1
elseif string.sub(n, d, d) == '-' then sign = -1; d = d+1
end
local base = 10
if string.lower(string.sub(n, d, d+1)) == "0x" then
d = d+2
base = 16
elseif string.lower(string.sub(n, d, d+1)) == "0o" then
d = d+2
base = 8
elseif string.lower(string.sub(n, d, d+1)) == "0b" then
d = d+2
base = 2
end
local self = {sign=1}
if base == 10 then
for i = #n, d, -RADIX_LEN do
local digit = string.sub(n, math.max(d, i-RADIX_LEN+1), i)
self[#self+1] = tonumber(digit)
end
else
local bn_base = {sign=1; base}
local bn_shift = {sign=1; 1}
local bn_digit = {sign=1; 0}
for i = #n, d, -1 do
bn_digit[1] = tonumber(string.sub(n, i, i), base)
self = int_add(self, int_mul(bn_digit, bn_shift))
bn_shift = int_mul(bn_shift, bn_base)
end
end
self.sign = sign
int_trim(self)
return self
end
int_zero = int(0)
int_one = int(1)
int_two = int(2)
int_copy = function(n)
local c = {sign=n.sign}
for i = 1, #n do
c[i] = n[i]
end
return c
end
local base_prefix = {[2]="0b", [8]="0o", [16]="0x"}
local base_group = {[2]=4, [10]=3, [16]=4}
local function groupby(s, n)
if n and _sep then
s = s:reverse()
s = s..(("0"):rep((n-1) - (s:len()-1)%n)) -- padding
s = s:gsub("("..("."):rep(n)..")", "%1".._sep) -- group by n digits
s = s:reverse()
s = s:gsub("^".._sep, "")
end
return s
end
int_tostring = function(n, base, bits)
base = base or 10
local s = ""
local sign = n.sign
if base == 10 and not bits then
local fmt = string.format("%%0%dd", RADIX_LEN)
for i = 1, #n do
s = string.format(fmt, n[i]) .. s
end
s = groupby(s, base_group[base])
s = string.gsub(s, "^[_0]+", "")
if s == "" then s = "0" end
else
local prefix = base_prefix[base]
local bitsperdigits = math.log2(base)
local bn_base = int(base)
if bits then
_, n = int_divmod(n, int_pow(int_two, int(bits)))
for i = 1, bits, bitsperdigits do
local d
n, d = int_divmod(n, bn_base)
d = int_tonumber(d)
s = string.sub("0123456789ABCDEF", d+1, d+1) .. s
end
s = groupby(s, base_group[base])
else
local absn = int_abs(n)
while #absn > 0 do
local d
absn, d = int_divmod(absn, bn_base)
d = int_tonumber(d)
s = string.sub("0123456789ABCDEF", d+1, d+1) .. s
end
s = groupby(s, base_group[base])
s = string.gsub(s, "^0+", "")
if s == "" then s = "0" end
end
if prefix then s = prefix .. (_sep or "") .. s end
end
if sign < 0 and not bits then s = "-" .. s end
return s
end
int_tonumber = function(n)
local s = n.sign < 0 and "-0" or "0"
local fmt = string.format("%%0%dd", RADIX_LEN)
for i = #n, 1, -1 do
s = s..string.format(fmt, n[i])
end
return tonumber(s..".")
end
int_iszero = function(a)
return #a == 0
end
int_isone = function(a)
return #a == 1 and a[1] == 1 and a.sign == 1
end
int_cmp = function(a, b)
if #a == 0 and #b == 0 then return 0 end -- 0 == -0
if a.sign > b.sign then return 1 end
if a.sign < b.sign then return -1 end
if #a > #b then return a.sign end
if #a < #b then return -a.sign end
for i = #a, 1, -1 do
if a[i] > b[i] then return a.sign end
if a[i] < b[i] then return -a.sign end
end
return 0
end
int_abscmp = function(a, b)
if #a > #b then return 1 end
if #a < #b then return -1 end
for i = #a, 1, -1 do
if a[i] > b[i] then return 1 end
if a[i] < b[i] then return -1 end
end
return 0
end
int_neg = function(a)
local b = int_copy(a)
b.sign = -a.sign
return b
end
int_add = function(a, b)
if a.sign == b.sign then -- a+b = a+b, (-a)+(-b) = -(a+b)
local c = int()
c.sign = a.sign
local carry = 0
for i = 1, math.max(#a, #b) + 1 do -- +1 for the last carry
c[i] = carry + (a[i] or 0) + (b[i] or 0)
if c[i] >= RADIX then
c[i] = c[i] - RADIX
carry = 1
else
carry = 0
end
end
int_trim(c)
return c
else
return int_sub(a, int_neg(b))
end
end
int_sub = function(a, b)
if a.sign == b.sign then
local A, B
local cmp = int_abscmp(a, b)
if cmp >= 0 then A = a; B = b; else A = b; B = a; end
local c = int()
local carry = 0
for i = 1, #A do
c[i] = A[i] - (B[i] or 0) - carry
if c[i] < 0 then
c[i] = c[i] + RADIX
carry = 1
else
carry = 0
end
end
assert(carry == 0) -- should be true if |A| >= |B|
c.sign = (cmp >= 0) and a.sign or -a.sign
int_trim(c)
return c
else
local c = int_add(a, int_neg(b))
c.sign = a.sign
return c
end
end
int_mul = function(a, b)
local c = int()
for i = 1, #a do
local carry = 0
for j = 1, #b do
carry = (c[i+j-1] or 0) + a[i]*b[j] + carry
c[i+j-1] = carry % RADIX
carry = math.floor(carry / RADIX)
end
if carry ~= 0 then
c[i + #b] = carry
end
end
for i = #c, 1, -1 do
if c[i] and c[i] ~= 0 then break end
table.remove(c, i)
end
c.sign = a.sign * b.sign
int_trim(c)
return c
end
local function int_absdiv2(a)
local c = int()
local carry = 0
for i = 1, #a do
c[i] = 0
end
for i = #a, 1, -1 do
c[i] = math.floor(carry + a[i] / 2)
if a[i] % 2 ~= 0 then
carry = math.floor(RADIX / 2)
else
carry = 0
end
end
c.sign = a.sign
int_trim(c)
return c, (a[1] or 0) % 2
end
int_divmod = function(a, b)
-- euclidian division using dichotomie
-- searching q and r such that a = q*b + r and |r| < |b|
assert(not int_iszero(b), "Division by zero")
if int_iszero(a) then return int_zero, int_zero end
if b.sign < 0 then a = int_neg(a); b = int_neg(b) end
local qmin = int_neg(a)
local qmax = a
if int_cmp(qmax, qmin) < 0 then qmin, qmax = qmax, qmin end
local rmin = int_sub(a, int_mul(qmin, b))
if rmin.sign > 0 and int_cmp(rmin, b) < 0 then return qmin, rmin end
local rmax = int_sub(a, int_mul(qmax, b))
if rmax.sign > 0 and int_cmp(rmax, b) < 0 then return qmax, rmax end
assert(rmin.sign ~= rmax.sign)
local q = int_absdiv2(int_add(qmin, qmax))
local r = int_sub(a, int_mul(q, b))
while r.sign < 0 or int_cmp(r, b) >= 0 do
if r.sign == rmin.sign then
qmin, qmax = q, qmax
rmin, rmax = r, rmax
else
qmin, qmax = qmin, q
rmin, rmax = rmin, r
end
q = int_absdiv2(int_add(qmin, qmax))
r = int_sub(a, int_mul(q, b))
end
return q, r
end
int_pow = function(a, b)
assert(b.sign > 0)
if #b == 0 then return int_one end
if #b == 1 and b[1] == 1 then return a end
if #b == 1 and b[1] == 2 then return int_mul(a, a) end
local c
local q, r = int_absdiv2(b)
c = int_pow(a, q)
c = int_mul(c, c)
if r == 1 then c = int_mul(c, a) end
return c
end
int_abs = function(a)
local b = int_copy(a)
b.sign = 1
return b
end
int_gcd = function(a, b)
a = int_abs(a)
b = int_abs(b)
while true do
local q
local order = int_cmp(a, b)
if order == 0 then return a end
if order > 0 then
q, a = int_divmod(a, b)
if int_iszero(a) then return b end
else
q, b = int_divmod(b, a)
if int_iszero(b) then return a end
end
end
end
-- }}}
-- bn {{{
function bn.tostring(n, base, bits)
if n.isInt then return int_tostring(n, base, bits) end
if n.isRat then return string.format("%s / %s", n.num, n.den) end
return tostring(n.n)
end
function bn.tonumber(n)
if n.isInt then return int_tonumber(n) end
if n.isRat then return int_tonumber(n.num) / int_tonumber(n.den) end
return n.n
end
function bn.divmod(a, b)
if a.isInt and b.isInt then
local q, r = int_divmod(a, b)
return bn.Int(q), bn.Int(r)
elseif a.isInt and b.isRat then
local q, r = int_divmod(a*b.den, b.num)
return bn.Int(q), bn.Rat(r, b.den)
elseif a.isRat and b.isInt then
local q, r = int_divmod(a.num*b, b*a.den)
return bn.Int(q), bn.Rat(r, a.den)
elseif a.isRat and b.isRat then
local q, r = int_divmod(a.num*b.den, b.num*a.den)
return bn.Int(q), bn.Rat(r, a.den*b.den)
else
a = a:tonumber()
b = b:tonumber()
return bn.Int(math.floor(a/b)), bn.Float(math.fmod(a, b))
end
end
function bn.powmod(a, b, m)
assert(a.isInt and b.isInt and b.sign >= 0 and m.isInt)
local result = bn.one
local r
a = a % m
while not b:iszero() do
b, r = bn.divmod(b, bn.two)
if r:isone() then
result = (result*a) % m
end
a = (a*a) % m
end
return result
end
-- }}}
-- metatable {{{
local mt = {}
mt.__index = mt
function mt.tostring(n, base, bits) return bn.tostring(n, base, bits) end
function mt.__tostring(n, base, bits) return bn.tostring(n, base, bits) end
function mt.tonumber(n) return bn.tonumber(n) end
function mt.__tonumber(n) return bn.tonumber(n) end
function mt.toInt(n)
if n.isInt then return n end
if n.isRat then local q, r = int_divmod(n.num, n.den) return bn.Int(q) end
if n.isFloat then return bn.Int(n.n) end
end
function mt.toRat(n, eps)
if n.isInt then return n end
if n.isRat then return n end
if n.isFloat then
local num = 1
local den = 1
eps = eps or 1e-6
local absn = math.abs(n.n)
local r = num / den
--while r ~= n do
while math.abs(absn - r) > eps do
if r < absn then
num = num + 1
else
den = den + 1
num = math.floor(absn * den)
end
r = num / den
end
r = bn.Rat(num, den)
if n.n < 0 then r = -r end
return r
end
end
function mt.toFloat(n)
return bn.Float(n:tonumber())
end
function mt.iszero(n)
return n:tonumber() == 0
end
function mt.isone(n)
return n:tonumber() == 1
end
function mt.__unm(a)
if a.isInt then return bn.Int(int_neg(a)) end
if a.isRat then return bn.Rat(-a.num, a.den) end
return bn.Float(-a:tonumber())
end
function mt.__add(a, b)
if a.isInt then
if b.isInt then return bn.Int(int_add(a, b)) end
if b.isRat then return bn.Rat(a*b.den + b.num, b.den) end
elseif a.isRat then
if b.isInt then return bn.Rat(a.num + b*a.den, a.den) end
if b.isRat then return bn.Rat(a.num*b.den + b.num*a.den, a.den*b.den) end
end
return bn.Float(a:tonumber() + b:tonumber())
end
function mt.__sub(a, b)
if a.isInt then
if b.isInt then return bn.Int(int_sub(a, b)) end
if b.isRat then return bn.Rat(a*b.den - b.num, b.den) end
elseif a.isRat then
if b.isInt then return bn.Rat(a.num - b*a.den, a.den) end
if b.isRat then return bn.Rat(a.num*b.den - b.num*a.den, a.den*b.den) end
end
return bn.Float(a:tonumber() - b:tonumber())
end
function mt.__mul(a, b)
if a.isInt then
if b.isInt then return bn.Int(int_mul(a, b)) end
if b.isRat then return bn.Rat(a*b.num, b.den) end
elseif a.isRat then
if b.isInt then return bn.Rat(a.num*b, a.den) end
if b.isRat then return bn.Rat(a.num*b.num, a.den*b.den) end
end
return bn.Float(a:tonumber() * b:tonumber())
end
function mt.__div(a, b)
if a.isInt then
if b.isInt then return bn.Rat(a, b) end
if b.isRat then return bn.Rat(a*b.den, b.num) end
elseif a.isRat then
if b.isInt then return bn.Rat(a.num, a.den*b) end
if b.isRat then return bn.Rat(a.num*b.den, a.den*b.num) end
end
return bn.Float(a:tonumber() / b:tonumber())
end
function mt.__idiv(a, b)
local q, r = bn.divmod(a, b)
return q
end
function mt.__mod(a, b)
local q, r = bn.divmod(a, b)
return r
end
function mt.__pow(a, b)
if a.isInt then
if b.isInt then
if b.sign > 0 then
return bn.Int(int_pow(a, b))
else
return bn.Rat(bn.one, bn.Int(int_pow(a, int_neg(b))))
end
end
elseif a.isRat then
if b.isInt then return (a.num^b) / (a.den^b) end
end
return bn.Float(a:tonumber() ^ b:tonumber())
end
function mt.__eq(a, b)
if a.isInt then
if b.isInt then return int_cmp(a, b) == 0 end
if b.isRat then return int_cmp(a*b.den, b.num) == 0 end
elseif a.isRat then
if b.isInt then return int_cmp(a.num, b*a.den) == 0 end
if b.isRat then return int_cmp(a.num*b.den, b.num*a.den) == 0 end
end
return a:tonumber() == b:tonumber()
end
function mt.__lt(a, b)
if a.isInt then
if b.isInt then return int_cmp(a, b) < 0 end
if b.isRat then return int_cmp(a*b.den, b.num) * b.den.sign < 0 end
elseif a.isRat then
if b.isInt then return int_cmp(a.num, b*a.den) * a.den.sign < 0 end
if b.isRat then return int_cmp(a.num*b.den, b.num*a.den) * a.den.sign*b.den.sign < 0 end
end
return a:tonumber() < b:tonumber()
end
function mt.__le(a, b)
if a.isInt then
if b.isInt then return int_cmp(a, b) <= 0 end
if b.isRat then return int_cmp(a*b.den, b.num) * b.den.sign <= 0 end
elseif a.isRat then
if b.isInt then return int_cmp(a.num, b*a.den) * a.den.sign <= 0 end
if b.isRat then return int_cmp(a.num*b.den, b.num*a.den) * a.den.sign*b.den.sign <= 0 end
end
return a:tonumber() <= b:tonumber()
end
function mt.__band(a, b) return bn.band(a, b) end
function mt.__bor(a, b) return bn.bor(a, b) end
function mt.__bxor(a, b) return bn.bxor(a, b) end
function mt.__bnot(a) return bn.bnot(a) end
function mt.__shl(a, b) return bn.lshift(a, b) end
function mt.__shr(a, b) return bn.rshift(a, b) end
-- }}}
-- bn.Int {{{
function bn.Int(n)
if type(n) == "table" then
if n.toInt then return n:toInt() end
local self = int_copy(n)
self.isInt = true
return setmetatable(self, mt)
else
local self = int(n)
self.isInt = true
return setmetatable(self, mt)
end
end
bn.zero = bn.Int(0)
bn.one = bn.Int(1)
bn.two = bn.Int(2)
-- }}}
-- bn.Rat {{{
local rat_simpl
function bn.Rat(num, den)
if not den then
if type(num) == "table" then
if num.toRat then return num:toRat() end
return bn.Int(num)
else
return bn.Float(num):toRat()
end
else
local self = {num=bn.Int(num), den=bn.Int(den)}
assert(not int_iszero(self.den), "Division by zero")
if int_iszero(self.num) then return bn.zero end
if self.den.sign < 0 then
self.num = -self.num
self.den = -self.den
end
if int_isone(self.den) then return self.num end
rat_simpl(self)
if int_isone(self.den) then return self.num end
self.isRat = true
return setmetatable(self, mt)
end
end
rat_simpl = function(a)
local num = a.num
local den = a.den
local gcd = bn.Int(int_gcd(num, den))
a.num = bn.Int(int_divmod(a.num, gcd))
a.den = bn.Int(int_divmod(a.den, gcd))
end
-- }}}
-- bn.Float {{{
function bn.Float(n)
if type(n) == "table" then
if n.toFloat then return n:toFloat() end
error(string.format("Can not convert %s to Float", n))
else
if type(n) == "string" then
n = string.gsub(n, "[ _]", "")
end
local self = {n=1.0*tonumber(n)}
self.isFloat = true
return setmetatable(self, mt)
end
end
-- }}}
-- math/mathx fonctions {{{
bn.huge = bn.Float(math.huge)
bn.inf = bn.Float(1/0)
bn.nan = bn.Float(-(0/0))
bn.pi = bn.Float(math.pi)
bn.e = bn.Float(math.exp(1))
function bn.abs(x)
if x.isInt then return bn.Int(int_abs(x)) end
if x.isRat then return bn.Rat(int_abs(x.num), int_abs(x.den)) end
return bn.Float(math.abs(x:tonumber()))
end
function bn.acos(x) return bn.Float(math.acos(x:tonumber())) end
function bn.asin(x) return bn.Float(math.asin(x:tonumber())) end
function bn.atan(x, y) return bn.Float(math.atan(x:tonumber(), y and y:tonumber())) end
function bn.atan2(y, x) return bn.Float(math.atan2(y:tonumber(), x:tonumber())) end
function bn.ceil(x)
if x.isInt then return x end
if x.isRat then
local q, r = int_divmod(x.num, x.den)
if not int_iszero(r) then q = int_add(q, bn.one) end
return bn.Int(q)
end
return bn.Int(math.ceil(x:tonumber()))
end
function bn.copysign(x, y) --return bn.Float(math.copysign(x:tonumber(), y:tonumber())) end
if y >= bn.zero then return x else return -x end
end
function bn.cos(x) return bn.Float(math.cos(x:tonumber())) end
function bn.cosh(x) return bn.Float(math.cosh(x:tonumber())) end
function bn.deg(x) return bn.Float(math.deg(x:tonumber())) end
function bn.erf(x) return bn.Float(math.erf(x:tonumber())) end
function bn.erfc(x) return bn.Float(math.erfc(x:tonumber())) end
function bn.exp(x) return bn.Float(math.exp(x:tonumber())) end
function bn.exp2(x) return bn.Float(math.exp2(x:tonumber())) end
function bn.expm1(x) return bn.Float(math.expm1(x:tonumber())) end
function bn.fdim(x, y)
if x > y then return x-y end
return bn.zero
end
function bn.floor(x)
if x.isInt then return x end
if x.isRat then
local q, r = int_divmod(x.num, x.den)
return bn.Int(q)
end
return bn.Int(math.floor(x:tonumber()))
end
function bn.fma(x, y, z)
if x.isFloat or y.isFloat or z.isFloat then return bn.Float(math.fma(x:tonumber(), y:tonumber(), z:tonumber())) end
return x*y + z
end
function bn.fmax(x, y)
if x.isFloat or y.isFloat then return bn.Float(math.fmax(x:tonumber(), y:tonumber())) end
return bn.max(x, y)
end
function bn.fmin(x, y)
if x.isFloat or y.isFloat then return bn.Float(math.fmin(x:tonumber(), y:tonumber())) end
return bn.min(x, y)
end
function bn.fmod(x, y) return bn.Float(math.fmod(x:tonumber(), y:tonumber())) end
function bn.frexp(y) local mant, exp = math.frexp(y:tonumber()) return bn.Float(mant), bn.Int(exp) end
function bn.gamma(x) return bn.Float(math.gamma(x:tonumber())) end
function bn.hypot(x, y) return bn.Float(math.hypot(x:tonumber(), y:tonumber())) end
function bn.isfinite(x) if x.isFloat then return math.isfinite(x:tonumber()) else return true end end
function bn.isinf(x) if x.isFloat then return math.isinf(x:tonumber()) else return false end end
function bn.isnan(x) if x.isFloat then return math.isnan(x:tonumber()) else return false end end
function bn.isnormal(x) if x.isFloat then return math.isnormal(x:tonumber()) else return x ~= bn.zero end end
function bn.j0(x) return bn.Float(math.j0(x:tonumber())) end
function bn.j1(x) return bn.Float(math.j1(x:tonumber())) end
function bn.jn(x, y) return bn.Float(math.jn(x:tonumber(), y:tonumber())) end
function bn.ldexp(m, e)
if m.isFloat or e.isFloat then return bn.Float(math.ldexp(m:tonumber(), e:tonumber())) end
return m * bn.two^e
end
function bn.lgamma(x) return bn.Float(math.lgamma(x:tonumber())) end
function bn.log(x, base)
if base then return bn.Float(math.log(x:tonumber())/math.log(base)) end
return bn.Float(math.log(x:tonumber()))
end
function bn.log10(x) return bn.Float(math.log10(x:tonumber())) end
function bn.log1p(x) return bn.Float(math.log1p(x:tonumber())) end
function bn.log2(x) return bn.Float(math.log2(x:tonumber())) end
function bn.logb(x) return bn.Float(math.logb(x:tonumber())) end
function bn.max(x, ...)
for i, y in ipairs({...}) do
if y > x then
x = y
end
end
return x
end
function bn.min(x, ...)
for i, y in ipairs({...}) do
if y < x then
x = y
end
end
return x
end
function bn.modf(x)
if x.isInt then
return x, bn.zero
elseif x.isRat then
local q, r = int_divmod(x.num, x.den)
return bn.Int(q), bn.Rat(r, x.den)
else
local i, f = math.modf(x:tonumber())
return bn.Int(i), bn.Float(f)
end
end
function bn.nearbyint(x) return bn.Int(math.nearbyint(x:tonumber())) end
function bn.nextafter(x, y) return bn.Float(math.nextafter(x:tonumber(), y:tonumber())) end
function bn.pow(x, y) return x ^ y end
function bn.rad(x) return bn.Float(math.rad(x:tonumber())) end
function bn.remainder(x, y) return bn.Float(math.remainder(x:tonumber(), y:tonumber())) end
function bn.round(x) return bn.Float(math.round(x:tonumber())) end
function bn.scalbn(x, y) return bn.Float(math.scalbn(x:tonumber(), y:tonumber())) end
function bn.random(m, n)
if not m then return bn.Float(math.random()) end
if not n then return bn.Int(math.random(m:tonumber())) end
return bn.Int(math.random(m:tonumber(), n:tonumber()))
end
function bn.randomseed(x) math.randomseed(x:tonumber()) end
function bn.sin(x) return bn.Float(math.sin(x:tonumber())) end
function bn.sinh(x) return bn.Float(math.sinh(x:tonumber())) end
function bn.sqrt(x) return bn.Float(math.sqrt(x:tonumber())) end
function bn.cbrt(x) return bn.Float(math.cbrt(x:tonumber())) end
function bn.tan(x) return bn.Float(math.tan(x:tonumber())) end
function bn.tanh(x) return bn.Float(math.tanh(x:tonumber())) end
function bn.trunc(x) return bn.Float(math.trunc(x:tonumber())) end
function bn.y0(x) return bn.Float(math.y0(x:tonumber())) end
function bn.y1(x) return bn.Float(math.y1(x:tonumber())) end
function bn.yn(x, y) return bn.Float(math.yn(x:tonumber(), y:tonumber())) end
function bn.hex(x, bits) return int_tostring(x, 16, bits) end
function bn.dec(x, bits) return int_tostring(x, 10, bits) end
function bn.oct(x, bits) return int_tostring(x, 8, bits) end
function bn.bin(x, bits) return int_tostring(x, 2, bits) end
function bn.type(x)
if x.isInt then return "Integer" end
if x.isRat then return "Rational" end
return "Float"
end
-- }}}
-- bitwise operations {{{
local bn_two_pow_32 = bn.Int(2^32)
function bn.bnot(x, bits)
assert(x.isInt)
if bits == nil then
return -x-bn.one
else
local b = bn.two ^ bn.Int(bits)
x = x % b
return (b-bn.one-x) % b
end
end
function bn.extract(x, field, width)
assert(x.isInt)
if width == nil then width = 1 end
local shift = bn.two ^ bn.Int(field)
local mask = bn.two ^ bn.Int(width)
return bn.Int(x / shift) % mask
end
function bn.replace(x, v, field, width)
assert(x.isInt)
assert(v.isInt)
if width == nil then width = 1 end
local shift = bn.two ^ bn.Int(field)
local mask = bn.two ^ bn.Int(width)
return x + (v - (bn.Int(x / shift) % mask)) * shift;
end
function bn.lshift(x, disp)
assert(x.isInt)
if disp < 0 then return bn.rshift(x, -disp) end
return x * bn.two^bn.Int(disp)
end
function bn.rshift(x, disp)
assert(x.isInt)
if disp < 0 then return bn.lshift(x, -disp) end
return bn.Int(x / bn.two^bn.Int(disp))
end
-- }}}
end
|
BigWigs:AddColors("Falric", {
[72422] = {"blue","orange"},
[72426] = {"blue","red"},
})
BigWigs:AddColors("Marwyn", {
[72363] = "red",
[72368] = {"blue","yellow"},
[72383] = {"blue","orange"},
})
|
------------------------------------------------------------------------------
-- Require --
------------------------------------------------------------------------------
require ("orm.class.global")
require ("orm.tools.func")
------------------------------------------------------------------------------
-- Constants --
------------------------------------------------------------------------------
local _db = require("DB")
local _dbName = ""
local _needCommitTransaction = false
local _timer
-- Database settings
local db
db = {
-- Execute SQL query
init = function (name)
if _dbName ~= "" and _dbName ~= name then
error(_dbName..","..name.."two db use the same thread")
end
_dbName = name
_db.init(_dbName)
_timer = lua_timer.createTimer(1)
local beginTransation = function( )
db.execute("begin exclusive transaction")
end
local commitTransation = function( )
db.execute("commit transaction")
end
beginTransation()
_timer:start(2000,function ()
if _needCommitTransaction then
commitTransation()
beginTransation()
_needCommitTransaction = false
end
end)
end,
execute = function (query, params, needLastInsertId)
params = params or {}
local result, rowId = _db.update(query,params,needLastInsertId)
_needCommitTransaction = true
if result then
return result, rowId
else
BACKTRACE(WARNING, "Wrong SQL query")
end
end,
-- Return insert query id
insert = function (query, params, needLastInsertId)
local result, rowId = db.execute(query, params, needLastInsertId)
return result, rowId
end,
batchInsert = function (saveParams)
local results = {}
for _, saveParam in ipairs(saveParams) do
local insert = saveParam["insert"]
local bindValues = saveParam["bindValues"]
local needPrimaryKey = saveParam["needPrimaryKey"]
local result, rowId = db.execute(insert, bindValues, needPrimaryKey)
local r = {}
r["result"] = result
r["rowId"] = rowId
table.insert(results, r)
end
return results
end,
query = function (query, params, name)
params = params or {}
local data = _db.query(query,params,name)
_needCommitTransaction = true
return data
end,
-- get parced data
rows = function (query, params)
params = params or {}
local data = _db.query(query,params)
_needCommitTransaction = true
return data
end
}
return db
|
local ExampleController = {}
-- that's gonna be a problem in tests :/
local service = require "ServiceOutsideThisProject"
function ExampleController.calculate(number1, number2)
return service.multiply(number1, number2)
end
return ExampleController
|
object_tangible_loot_npc_loot_spice_giggledust_generic = object_tangible_loot_npc_loot_shared_spice_giggledust_generic:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_npc_loot_spice_giggledust_generic, "object/tangible/loot/npc/loot/spice_giggledust_generic.iff")
|
if onServer() then
package.path = package.path .. ";data/scripts/lib/?.lua"
include ("common")
professions = include ("professions")
ranks = include ("ranks")
function initialize(help, action, ...)
local flag, msg = false, ""
player = Player()
if action then
local args = {...}
local rest_command = ""
if #args > 0 then
for i,v in pairs(args) do
rest_command = rest_command .. " " .. tostring(v)
end
end
player:sendChatMessage(player.name, 0, "/crew " .. action .. rest_command)
else
player:sendChatMessage(player.name, 0, "/crew")
end
if action == "fill" then
local ship = Entity(Player().craftIndex)
ship.crew = ship.minCrew
ship:addCrew(1, CrewMan(CrewProfessionType.Captain, 1))
player:sendChatMessage("Crew", 0, "Minimal crew has boarded the ship!")
elseif action == "add" then
local ship = Entity(Player().craftIndex)
flag, msg = addCrew(ship, ...)
player:sendChatMessage("Crew", 0, msg)
elseif action == "clear" then
Entity(Player().craftIndex).crew = Crew()
player:sendChatMessage("Crew", 0, "Current ship's crew has been cleared.")
elseif action == "help" or action == nil then
player:sendChatMessage("Crew", 0, help)
else
player:sendChatMessage("Crew", 0, "Unknown action: " .. action)
end
terminate()
end
function addCrew(ship, profession, rank, level, amount)
-- absolutely require a desired profession
if profession then
local adj_level = limit(tonumber(level or 1), 4, 1)
local profession_id = getCrewProfession(profession)
if profession_id then
local profession_ent = CrewProfession(profession_id)
if profession_ent == nil then
return false, "ERROR: " .. profession .. " not recognized profession"
end
-- If no rank parameter passed, assume rest is 1, 1, 1
local adj_rank = getRank(rank)
if adj_rank then
if adj_rank == 0 then
adj_level = 1
end
if tonumber(amount or 1) then
ship:addCrew(tonumber(amount or 1), CrewMan(profession_ent, adj_rank, adj_level))
return true, string.format("%ix Level %i %s added.", tonumber(amount or 1), adj_level, professions[profession_id])
else
return false, "ERROR: " .. amount .. " not a valid bnumber"
end
else
return false, "ERROR: " .. rank .. " is invalid rank"
end
else
return false, "ERROR: " .. profession .. " not recognized profession"
end
else
return false, ("ERROR: not enough arguments")
end
end
end
|
-- Lightweight module implementing a routine to split a string.
--
-- sample usage:
-- local stringsplit = require 'stringsplit' -- stringsplit on path
-- split = stringsplit.split
-- local s = split('t', 'earth')
-- assert (type(s) == 'table' and #s == 2)
-- assert (s[1] == 'ear' and s[2] == 'h')
--
-- Author: J. 'KwirkyJ' Smith <kwirkyj.smith0@gmail.com>
-- Year: 2016
-- Version: 1.0.0
-- License: MIT(X11) License
local stringsplit = {_VERSION = '1.0.0'}
---split(delimiter, text)
-- Split text into a list consisting of the strings in text
-- separated by the delimiter;
-- example with Pattern:
-- strsplit(",%s*", "Anna, Bob, Charlie,Dolores")
-- >> {'Anna', 'Bob', 'Charlie', 'Doloes'} Pattern eats whitespace.
-- @param delimiter {String} Any non-empty string, can be a Pattern.
-- @param text {String} Any string, can be empty.
-- @error iff delimiter or text are not {String} type;
-- elseiff delimiter is the empty string ('').
-- @return {Table} Array of strings; if first character(s) match pattern
-- the first element will be ''; no match returns {<text>}.
stringsplit.split = function(delimiter, text)
local list = {}
local pos = 1
assert (type(delimiter) == 'string', 'delimiter must be a string')
assert (type(text) == 'string', 'text must be a string')
assert (delimiter ~= '', 'delimiter cannot be empty string')
local start, stop
while 1 do
start, stop = string.find(text, delimiter, pos)
if start then
table.insert(list, string.sub(text, pos, start-1))
pos = stop+1
else
table.insert(list, string.sub(text, pos))
break
end
end
return list
end
return stringsplit
|
dire_zombie_attack_meele = class({})
function dire_zombie_attack_meele:GetCastAnimationCustom() return ACT_DOTA_ATTACK end
function dire_zombie_attack_meele:GetPlaybackRateOverride() return 1.0 end
function dire_zombie_attack_meele:GetCastPointSpeed() return 0 end
function dire_zombie_attack_meele:GetCastPoint()
if IsServer() then
return self:GetCaster():GetAttackAnimationPoint()
end
end
function dire_zombie_attack_meele:GetCooldown(iLevel)
if IsServer() then
local attacks_per_second = self:GetCaster():GetAttacksPerSecond()
local attack_speed = (1 / attacks_per_second)
return self.BaseClass.GetCooldown(self, self:GetLevel()) + attack_speed
end
end
function dire_zombie_attack_meele:OnSpellStart()
local caster = self:GetCaster()
local origin = caster:GetOrigin()
local point = ClampPosition(origin, self:GetCursorPosition(), self:GetCastRange(Vector(0,0,0), nil), self:GetCastRange(Vector(0,0,0), nil))
local projectile_direction = Direction2D(origin, point)
self.radius = self:GetSpecialValueFor("radius")
local direction = Direction2D(origin, point)
CustomEntitiesLegacy:MeeleAttack(caster, {
vDirection = direction,
vOrigin = origin,
fRadius = self.radius,
bIsBasicAttack = true,
iMaxTargets = -1,
Callback = function(hTarget)
CustomEntitiesLegacy:AttackWithBaseDamage(caster, {
hTarget = hTarget,
hAbility = self,
})
self:PlayEffectsOnImpact(hTarget)
end
})
self:PlayEffectsOnMiss(point)
MeeleEFX(caster, direction, self.radius, Vector(255, 0, 0))
end
function dire_zombie_attack_meele:PlayEffectsOnImpact(hTarget)
EFX('particles/juggernaut/juggernaut_basic_attack_impact.vpcf', PATTACH_ABSORIGIN, hTarget, {
release = true
})
EmitSoundOn("Hero_Juggernaut.Attack", hTarget)
end
function dire_zombie_attack_meele:PlayEffectsOnMiss(pos)
EmitSoundOnLocationWithCaster(pos, "Hero_Juggernaut.PreAttack", self:GetCaster())
end
if IsClient() then require("wrappers/abilities") end
Abilities.Castpoint(dire_zombie_attack_meele)
|
local function L(s, ...)
return string.format(SH_SZ.Language[s] or s, ...)
end
function SH_SZ:GetStepText(step, numstep)
local t = step.type
if (t == "place") then
return L("place_point_x", numstep)
elseif (t == "confirm") then
return L"finalize_placement"
end
end
function SH_SZ:MakePoint(parent, pos, mx, my)
local ep = LocalPlayer():EyePos()
local av = LocalPlayer():GetAimVector()
local pnt = self:QuickButton("P", function() end, parent)
pnt:SetSize(24, 24)
pnt:SetPos(mx - 12, my - 12)
pnt.m_v3DPos = pos
pnt.OnMousePressed = function(me, mc)
if (mc == MOUSE_LEFT) then
parent.m_DraggingPoint = me
end
end
pnt.OnMouseReleased = function(me, mc)
if (mc == MOUSE_LEFT and parent.m_DraggingPoint == me) then
parent.m_DraggingPoint = nil
end
end
pnt.OnCursorMoved = function(me)
if (parent.m_DraggingPoint == me) then
me:DoMove()
end
end
pnt.Think = function(me)
if (ep ~= LocalPlayer():EyePos() or av ~= LocalPlayer():GetAimVector()) then
ep = LocalPlayer():EyePos()
av = LocalPlayer():GetAimVector()
local ts = me.m_v3DPos:ToScreen()
local x, y = ts.x, ts.y
me:SetPos(math.Clamp(x - 12, 0, ScrW() - 1), math.Clamp(y - 12, 0, ScrH() - 1))
me:SetPaintedManually(x <= 0 or x >= ScrW() or y <= 0 or y >= ScrH())
end
end
pnt.DoMove = function(me)
local mx, my = gui.MousePos()
me:SetPos(mx - me:GetWide() * 0.5, my - me:GetTall() * 0.5)
local sp = LocalPlayer():GetShootPos()
local t = {
start = sp,
endpos = sp + gui.ScreenToVector(mx, my) * 16384,
filter = ents.GetAll(),
}
local tr = util.TraceLine(t)
me.m_v3DPos = tr.HitPos
end
local function AddAxis(axis, ap, dir, col)
cam.Start3D()
local ap = (pos + dir * 64):ToScreen()
cam.End3D()
local ax = self:QuickButton(axis, function() end, parent)
ax:SetSize(16, 16)
ax:SetPos(ap.x - 8, ap.y - 8)
ax.m_Background = col
ax.OnMousePressed = pnt.OnMousePressed
ax.OnMouseReleased = pnt.OnMouseReleased
ax.OnCursorMoved = pnt.OnCursorMoved
ax.DoMove = function()
debugoverlay.Line(pos, pos + dir * 16384, 1, color_white, true)
cam.Start3D()
local np = gui.ScreenToVector(gui.MousePos())
cam.End3D()
local pp = np:Cross(pos)
debugoverlay.Line(pp, pp + dir * 512, 1, Color(255, 0, 0), true)
end
end
-- local x = AddAxis("X", xp, Vector(1, 0, 0), Color(255, 0, 0))
-- local y = AddAxis("Y", yp, Vector(0, 1, 0), Color(0, 255, 0))
-- local z = AddAxis("Z", zp, Vector(0, 0, 1), Color(0, 0, 255))
pnt.OnRemove = function(me)
-- if (IsValid(x)) then x:Remove() end
-- if (IsValid(y)) then y:Remove() end
-- if (IsValid(z)) then z:Remove() end
end
return pnt
end
local shape = SH_SZ.Shapes.cube
local points = {}
local sz_size = SH_SZ.MaximumSize
local sz_options = table.Copy(SH_SZ.DefaultOptions)
local curstep = 1
local curcat = 1
local cur, cursz
local last_mx, last_my
local moving_cam = false
local function step()
return shape.steps[curstep]
end
local function advance_step()
curstep = curstep + 1
local new = step()
_SZ_EDITOR_SIZE:SetVisible(new.type == "confirm")
end
local function reset()
for _, pnt in pairs (points) do
pnt:Remove()
end
points = {}
curstep = 1
_SZ_EDITOR_SIZE:SetVisible(false)
end
hook.Add("PostDrawTranslucentRenderables", "SH_SZ.PostDrawTranslucentRenderables", function()
if (_SZ_EDITOR_OPEN and #points >= shape.points) then
local pts = {}
for _, v in ipairs (points) do
table.insert(pts, v.m_v3DPos)
end
cam.Start3D()
shape.render(pts, sz_size, color_white)
cam.End3D()
end
end)
local ss, styl, th, m, m2 = SH_SZ:GetScreenScale(), SH_SZ.Style, SH_SZ:GetPadding(), SH_SZ:GetMargin(), SH_SZ:GetMargin() * 0.5
function SH_SZ:MakeTabAdd(body)
local tab_add = vgui.Create("DPanel", body)
tab_add:SetDrawBackground(false)
tab_add:Dock(FILL)
local lbl = self:QuickLabel(L"safezone_type", "{prefix}Large", styl.text, tab_add)
lbl:Dock(TOP)
lbl:DockMargin(0, 0, 0, m2)
local types = vgui.Create("DPanel", tab_add)
types:SetTall(32 * ss + m * 2)
types:Dock(TOP)
types.Paint = function(me, w, h)
draw.RoundedBox(4, 0, 0, w, h, styl.inbg)
end
for tid, typ in pairs (self.Shapes) do
local mat = Material(typ.icon, "noclamp smooth")
local tbtn = vgui.Create("DButton", types)
tbtn:SetToolTip(L(typ.name))
tbtn:SetText("")
tbtn:SetSize(types:GetTall(), types:GetTall())
tbtn:Dock(LEFT)
tbtn.Paint = function(me, w, h)
if (shape.id == typ.id) then
draw.RoundedBox(4, m2, m2, w - m, h - m, styl.header)
end
surface.SetMaterial(mat)
surface.SetDrawColor(styl.text)
surface.DrawTexturedRect(w * 0.5 - 16 * ss, h * 0.5 - 16 * ss, 32 * ss, 32 * ss)
end
tbtn.DoClick = function(me, w, h)
shape = typ
reset()
end
end
local lbl = self:QuickLabel(L"options", "{prefix}Large", styl.text, tab_add)
lbl:Dock(TOP)
lbl:DockMargin(0, m2, 0, m2)
local opts = vgui.Create("DScrollPanel", tab_add)
opts:Dock(FILL)
opts:GetCanvas():DockPadding(m2, m2, m2, m2)
opts.Paint = function(me, w, h)
draw.RoundedBox(4, 0, 0, w, h, styl.inbg)
end
self:PaintScroll(opts)
local function AddOption(id, text)
local opt = sz_options[id] or self.DefaultOptions[id]
local lbl = self:QuickLabel(L(text), "{prefix}Medium", styl.text, opts)
lbl:SetMouseInputEnabled(true)
lbl:SetKeyboardInputEnabled(true)
lbl:SetTextInset(lbl:GetTall() + m2, 0)
lbl:Dock(TOP)
lbl:DockMargin(0, 0, 0, m2)
if (isbool(opt)) then
local btn = self:QuickButton("", function()
sz_options[id] = not sz_options[id]
end, lbl)
btn:SetSize(lbl:GetTall(), lbl:GetTall())
btn.Paint = function(me, w, h)
local ok = sz_options[id]
draw.RoundedBox(4, 0, 0, w, h, ok and styl.header or styl.bg)
if (ok) then
draw.SimpleText("✓", "SH_SZ.Medium", w * 0.5, h * 0.5, styl.text, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
end
elseif (isnumber(opt)) then
local entry = self:QuickEntry(opt, lbl)
entry:SetNumeric(true)
entry:SetSize(lbl:GetTall() * 2, lbl:GetTall())
entry:DockMargin(0, m, 0, m)
entry.OnValueChange = function(me, tx)
sz_options[id] = tonumber(tx) or 0
end
lbl:SetTextInset(entry:GetWide() + m2, 0)
elseif (isstring(opt)) then
local entry = self:QuickEntry(opt, lbl)
entry:SetSize(lbl:GetTall() * 10, lbl:GetTall())
entry:DockMargin(0, m, 0, m)
entry.OnValueChange = function(me, tx)
sz_options[id] = tx
end
lbl:SetTextInset(entry:GetWide() + m2, 0)
end
end
AddOption("name", "name")
AddOption("namecolor", "name_color")
AddOption("entermsg", "enter_message")
AddOption("leavemsg", "leave_message")
AddOption("hud", "enable_hud_indicator")
AddOption("noatk", "prevent_attacking_with_weapons")
AddOption("nonpc", "automatically_remove_npcs")
AddOption("noprop", "delete_non_admin_props")
AddOption("ptime", "time_until_protection_enables")
local btns = vgui.Create("DPanel", tab_add)
btns:SetDrawBackground(false)
btns:Dock(BOTTOM)
btns:DockMargin(0, m, 0, 0)
local resetbtn = self:QuickButton(L"reset", function() end, btns)
resetbtn:SetWide(100 * ss)
resetbtn:Dock(LEFT)
resetbtn.DoClick = function()
reset()
end
local confirm = self:QuickButton(L"confirm", function() end, btns)
confirm:SetWide(100 * ss)
confirm:Dock(RIGHT)
confirm.DoClick = function()
if (#points < shape.points) then
return end
net.Start("SH_SZ.New")
net.WriteUInt(shape.id, 16)
for i = 1, shape.points do
net.WriteVector(points[i].m_v3DPos)
end
net.WriteFloat(sz_size)
net.WriteUInt(table.Count(sz_options), 16)
for opt, val in pairs (sz_options) do
net.WriteString(opt)
net.WriteType(val)
end
net.SendToServer()
reset()
end
btns.Think = function()
confirm:SetVisible(step().type == "confirm")
end
return tab_add
end
function SH_SZ:MakeTabEdit(body)
cur, cursz = nil, nil
local tab_edit = vgui.Create("DPanel", body)
tab_edit:SetVisible(false)
tab_edit:SetDrawBackground(false)
tab_edit:Dock(FILL)
local scroll = vgui.Create("DScrollPanel", tab_edit)
scroll:SetWide(120 * ss)
scroll:Dock(LEFT)
scroll:GetCanvas():DockPadding(m2, m2, m2, m2)
scroll.Paint = function(me, w, h)
draw.RoundedBox(4, 0, 0, w, h, styl.inbg)
end
self:PaintScroll(scroll)
local edit = vgui.Create("DScrollPanel", tab_edit)
edit:SetVisible(false)
edit:Dock(FILL)
edit:DockMargin(m, 0, 0, 0)
edit:GetCanvas():DockPadding(m2, m2, m2, m2)
edit.Paint = scroll.Paint
tab_edit.m_Edit = edit
self:PaintScroll(edit)
edit.BuildList = function(me, sz)
me:Clear()
local lbl = self:QuickLabel(L"options", "{prefix}Large", styl.text, edit)
lbl:Dock(TOP)
lbl:DockMargin(0, 0, 0, m2)
local function AddOption(id, text)
local opt = sz.opts[id] or self.DefaultOptions[id]
local lbl = self:QuickLabel(L(text), "{prefix}Medium", styl.text, edit)
lbl:SetMouseInputEnabled(true)
lbl:SetKeyboardInputEnabled(true)
lbl:SetTextInset(lbl:GetTall() + m2, 0)
lbl:Dock(TOP)
lbl:DockMargin(0, 0, 0, m2)
if (isbool(opt)) then
local btn = self:QuickButton("", function()
sz.opts[id] = not sz.opts[id]
end, lbl)
btn:SetSize(lbl:GetTall(), lbl:GetTall())
btn.Paint = function(me, w, h)
local ok = sz.opts[id]
draw.RoundedBox(4, 0, 0, w, h, ok and styl.header or styl.bg)
if (ok) then
draw.SimpleText("✓", "SH_SZ.Medium", w * 0.5, h * 0.5, styl.text, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
end
elseif (isnumber(opt)) then
local entry = self:QuickEntry(opt, lbl)
entry:SetNumeric(true)
entry:SetSize(lbl:GetTall() * 2, lbl:GetTall())
entry:DockMargin(0, m, 0, m)
entry.OnValueChange = function(me, tx)
sz.opts[id] = tonumber(tx) or 0
end
lbl:SetTextInset(entry:GetWide() + m2, 0)
elseif (isstring(opt)) then
local entry = self:QuickEntry(opt, lbl)
entry:SetSize(lbl:GetTall() * 10, lbl:GetTall())
entry:DockMargin(0, m, 0, m)
entry.OnValueChange = function(me, tx)
sz.opts[id] = tx
end
lbl:SetTextInset(entry:GetWide() + m2, 0)
end
end
AddOption("name", "name")
AddOption("namecolor", "name_color")
AddOption("entermsg", "enter_message")
AddOption("leavemsg", "leave_message")
AddOption("hud", "enable_hud_indicator")
AddOption("noatk", "prevent_attacking_with_weapons")
AddOption("nonpc", "automatically_remove_npcs")
AddOption("noprop", "delete_non_admin_props")
AddOption("ptime", "time_until_protection_enables")
me:SetVisible(true)
end
local btns = vgui.Create("DPanel", tab_edit)
btns:SetVisible(false)
btns:SetDrawBackground(false)
btns:Dock(BOTTOM)
btns:DockMargin(0, m, 0, 0)
tab_edit.m_Buttons = btns
local save = self:QuickButton(L"save", function() end, btns)
save:SetWide(100 * ss)
save:Dock(RIGHT)
save.DoClick = function()
net.Start("SH_SZ.Edit")
net.WriteUInt(cur, 16)
local shape = self.ShapesIndex[cursz.shape]
for i = 1, shape.points do
net.WriteVector(points[i].m_v3DPos)
self.SafeZones[cur].points[i] = points[i].m_v3DPos
end
net.WriteFloat(sz_size)
self.SafeZones[cur].size = sz_size
net.WriteUInt(table.Count(cursz.opts), 16)
for k, v in pairs (cursz.opts) do
net.WriteString(k)
net.WriteType(v)
self.SafeZones[cur].opts[k] = v
end
net.SendToServer()
if (IsValid(cursz.btn)) then
cursz.btn:SetText(cursz.opts.name or "?")
end
end
local tp = self:QuickButton(L"teleport_there", function() end, btns)
tp:SetWide(100 * ss)
tp:Dock(RIGHT)
tp:DockMargin(m, 0, m, 0)
tp.DoClick = function(me)
net.Start("SH_SZ.Teleport")
net.WriteUInt(cur, 16)
net.SendToServer()
me.m_vTeleporting = LocalPlayer():GetPos()
end
tp.Think = function(me)
-- Update button positions
if (me.m_vTeleporting and me.m_vTeleporting ~= LocalPlayer():GetPos()) then
timer.Simple(0, function()
for _, pnt in pairs (points) do
if (!IsValid(pnt)) then
return end
local ts = pnt.m_v3DPos:ToScreen()
pnt:SetPos(ts.x - pnt:GetWide() * 0.5, ts.y - pnt:GetTall() * 0.5)
me.m_vTeleporting = nil
end
end)
end
end
local delete = self:QuickButton(L"delete", function() end, btns)
delete:SetColor(styl.close_hover)
delete:SetWide(100)
delete:Dock(RIGHT)
delete.DoClick = function()
net.Start("SH_SZ.Delete")
net.WriteUInt(cur, 16)
net.SendToServer()
if (IsValid(cursz.btn)) then
edit:SetVisible(false)
btns:SetVisible(false)
_SZ_EDITOR_SIZE:SetVisible(false)
cursz.btn:Remove()
for _, pnt in pairs (points) do
if (!IsValid(pnt)) then
return end
pnt:Remove()
end
points = {}
table.remove(self.SafeZones, cur)
cur, cursz = nil, nil
end
end
for i, sz in pairs (self.SafeZones) do
local btn = self:QuickButton(sz.opts.name or "?", function(me)
if (cur == i) then
return end
cur = i
cursz = table.Copy(sz)
shape = self.ShapesIndex[sz.shape]
reset()
for _, o in pairs (self.SafeZones) do
o.btn:SetColor(styl.text)
end
me:SetColor(styl.header)
edit:BuildList(cursz)
btns:SetVisible(true)
_SZ_EDITOR_SIZE:SetVisible(true)
_SZ_EDITOR_SIZE:Set(sz.size, true)
for _, point in pairs (sz.points) do
local ts = point:ToScreen()
local pnt = self:MakePoint(_SZ_EDITOR_CANVAS, point, ts.x, ts.y)
table.insert(points, pnt)
end
end, scroll)
btn:Dock(TOP)
btn:DockMargin(0, 0, 0, m2)
btn.m_Background = styl.bg
sz.btn = btn
end
return tab_edit
end
local UpdateEditor = false
function SH_SZ:ShowEditor()
if (IsValid(_SZ_EDITOR)) then _SZ_EDITOR:Close() end
if (IsValid(_SZ_EDITOR_SIZE)) then _SZ_EDITOR_SIZE:Close() end
if !(CAMI.PlayerHasAccess(LocalPlayer(), "Safezone - edit", nil)) then return end
UpdateEditor = false
ss = self:GetScreenScale()
styl = self.Style
th, m = self:GetPadding(), self:GetMargin()
m2 = m * 0.5
shape = SH_SZ.Shapes.cube
points = {}
sz_size = SH_SZ.MaximumSize
sz_options = table.Copy(self.DefaultOptions)
curstep = 1
curcat = 1
last_mx, last_my = gui.MousePos()
moving_cam = false
local tab_add, tab_edit
local cont = vgui.Create("DPanel")
cont:SetDrawBackground(false)
cont:Dock(FILL)
cont.OnMousePressed = function(me, mc)
if (mc == MOUSE_RIGHT) then
moving_cam = true
last_mx, last_my = gui.MousePos()
end
end
cont.OnMouseReleased = function(me, mc)
if (mc == MOUSE_RIGHT) then
moving_cam = false
end
if (step().type ~= "place" or !tab_add:IsVisible()) then
return end
if (mc == MOUSE_LEFT) then
local mx, my = gui.MousePos()
local sp = LocalPlayer():GetShootPos()
local t = {
start = sp,
endpos = sp + gui.ScreenToVector(mx, my) * 16384,
filter = ents.GetAll(),
}
local tr = util.TraceLine(t)
local pnt = self:MakePoint(me, tr.HitPos, mx, my)
table.insert(points, pnt)
advance_step()
end
end
cont.OnCursorMoved = function(me)
local pnt = me.m_DraggingPoint
if (IsValid(pnt)) then
pnt:DoMove()
end
if (moving_cam) then
local x, y = gui.MousePos()
local dx, dy = x - last_mx, y - last_my
if (dx ~= 0 or dy ~= 0) then
local ang = LocalPlayer():EyeAngles()
LocalPlayer():SetEyeAngles(ang - Angle(-dy * 0.25, dx * 0.25, 0))
last_mx, last_my = x, y
end
end
end
cont.PaintOver = function(me, w, h)
if (!tab_add:IsVisible()) then
return end
local mx, my = gui.MousePos()
local wi, he = w * 0.25, 24 * ss
local x, y = w * 0.5 - wi * 0.5, h * 0.7 - he * 0.5
local mult = 1
if (mx >= x and mx <= x + wi and my >= y and my <= y + he) then
mult = 0.5
end
surface.SetAlphaMultiplier(mult)
draw.RoundedBoxEx(4, x, y, wi * 0.1, he, styl.header, true, false, true, false)
draw.RoundedBoxEx(4, x + wi * 0.1, y, wi * 0.9, he, styl.inbg, false, true, false, true)
draw.SimpleText(curstep .. "/" .. #shape.steps, "SH_SZ.Large", x + wi * 0.05, y + he * 0.5, styl.text, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
draw.SimpleText(self:GetStepText(step(), curstep), "SH_SZ.Large", x + wi * 0.1 + he * 0.25, y + he * 0.5, styl.text, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
surface.SetAlphaMultiplier(1)
end
_SZ_EDITOR_CANVAS = cont
local frame = self:MakeWindow("Safe Zone Editor")
frame:SetSize(self.WindowSize.w * ss, self.WindowSize.h * ss)
frame:SetPos(th, th)
frame:MakePopup()
frame.OnClose = function()
cont:Remove()
_SZ_EDITOR_SIZE:Close()
_SZ_EDITOR_OPEN = false
if (!UpdateEditor) then
net.Start("SH_SZ.Closed")
net.SendToServer()
end
end
frame.Think = function(this)
if ((this.nextThink or 0) > CurTime()) then return end
if (UpdateEditor) then
_SZ_EDITOR:Close()
UpdateEditor = false
self:ShowEditor()
end
this.nextThink = CurTime() + 0.2
end
_SZ_EDITOR = frame
_SZ_EDITOR_OPEN = true
local cats = vgui.Create("DScrollPanel", frame)
cats:SetWide(100 * ss)
cats:Dock(LEFT)
cats.Paint = function(me, w, h)
surface.SetDrawColor(styl.inbg)
surface.DrawRect(0, 0, w, h)
end
self:PaintScroll(cats)
local cat_add = self:QuickButton(L"add", function() end, cats)
cat_add:SetContentAlignment(4)
cat_add:SetTextInset(m + 4, 0)
cat_add:SetTall(40 * ss)
cat_add:Dock(TOP)
cat_add.m_iCatID = 1
cat_add.PaintOver = function(me, w, h)
if (curcat == me.m_iCatID) then
surface.SetDrawColor(styl.header)
surface.DrawRect(0, 0, 4, h)
end
end
cat_add.DoClick = function()
reset()
curcat = 1
tab_add:SetVisible(true)
tab_edit:SetVisible(false)
end
local cat_list = self:QuickButton(L"edit", function() end, cats)
cat_list:SetContentAlignment(4)
cat_list:SetTextInset(m + 4, 0)
cat_list:SetTall(40 * ss)
cat_list:Dock(TOP)
cat_list.m_iCatID = 2
cat_list.PaintOver = cat_add.PaintOver
cat_list.DoClick = function()
reset()
curcat = 2
tab_add:SetVisible(false)
tab_edit:SetVisible(true)
cur, cursz = nil, nil
tab_edit.m_Edit:Clear()
tab_edit.m_Edit:SetVisible(false)
tab_edit.m_Buttons:SetVisible(false)
end
local body = vgui.Create("DPanel", frame)
body:SetDrawBackground(false)
body:Dock(FILL)
body:DockPadding(m, m, m, m)
tab_add = self:MakeTabAdd(body)
tab_edit = self:MakeTabEdit(body)
local frame = self:MakeWindow(L"size")
frame:SetVisible(false)
frame.m_Close:Remove()
frame:SetSize(200 * ss, 300 * ss)
frame:MoveBelow(_SZ_EDITOR, th)
frame:AlignLeft(th)
_SZ_EDITOR_SIZE = frame
local re_size = vgui.Create("DPanel", frame)
re_size:SetDrawBackground(false)
re_size:Dock(FILL)
re_size:InvalidateParent(true)
local size_adj = self:QuickButton("▲ " .. self.MaximumSize, function() end, re_size)
size_adj:SetWide(re_size:GetWide())
size_adj.OnMousePressed = function(me)
me.m_iOldY = gui.MouseY()
me.m_bDragging = true
end
size_adj.OnMouseReleased = function(me)
me.m_bDragging = false
end
size_adj.OnCursorExited = size_adj.OnMouseReleased
size_adj.Set = function(me, f, p)
me:SetText("▲ " .. f)
sz_size = f
if (p) then
me.y = (re_size:GetTall() - me:GetTall()) * (1 - f / self.MaximumSize)
end
end
size_adj.Think = function(me)
if (me.m_bDragging) then
local my = gui.MouseY()
local oy = me.m_iOldY
if (oy) then
local dy = my - oy
local new = math.Clamp(me.y + dy, 0, re_size:GetTall() - me:GetTall())
me.y = new
local frac = me.y / (re_size:GetTall() - me:GetTall())
local height = math.Round((1 - frac) * self.MaximumSize)
me:Set(height)
end
me.m_iOldY = my
end
end
local fill = self:QuickButton(L"fill_vertically", function()
local fi = 0
for _, pnt in pairs (points) do
local pos = pnt.m_v3DPos
local t = {start = pos, endpos = pos + Vector(0, 0, 16384), filter = ents.GetAll()}
local tr = util.TraceLine(t)
local zdist = math.Round(math.abs(tr.HitPos.z - pos.z))
if (fi == 0 or zdist < fi) then
fi = zdist
end
end
fi = math.min(fi, self.MaximumSize)
if (fi > 0) then
size_adj:Set(fi, true)
end
end, frame)
fill:Dock(TOP)
re_size.Paint = function(me, w, h)
surface.SetAlphaMultiplier(0.5)
surface.SetDrawColor(styl.header)
surface.DrawRect(0, size_adj.y, w, h)
surface.SetAlphaMultiplier(1)
end
frame.Set = function(me, ...)
size_adj:Set(...)
end
end
local undomodelblend = false
hook.Add("PreDrawViewModel", "SH_SZ.PreDrawViewModel", function()
if (_SZ_EDITOR_OPEN) then
undomodelblend = true
render.SetBlend(0)
end
end)
hook.Add("PreDrawPlayerHands", "SH_SZ.PreDrawPlayerHands", function()
if (_SZ_EDITOR_OPEN) then
undomodelblend = true
render.SetBlend(0)
end
end)
hook.Add("CreateMove", "SH_SZ.CreateMove", function(cmd)
if (!_SZ_EDITOR_OPEN) then
return end
local layout = SH_SZ.CameraControls
if (input.IsKeyDown(layout.forward)) then
cmd:SetForwardMove(10000)
elseif (input.IsKeyDown(layout.back)) then
cmd:SetForwardMove(-10000)
end
if (input.IsKeyDown(layout.left)) then
cmd:SetSideMove(-10000)
elseif (input.IsKeyDown(layout.right)) then
cmd:SetSideMove(10000)
end
end)
hook.Add("HUDPaint", "SH_SZ.HUDPaintCamera", function(cmd)
if (!_SZ_EDITOR_OPEN) then
return end
local x, y = _SZ_EDITOR:GetPos()
y = y * 2 + _SZ_EDITOR:GetTall()
if (IsValid(_SZ_EDITOR_SIZE)) then
x = x * 2 + _SZ_EDITOR_SIZE:GetWide()
end
local layout = SH_SZ.CameraControls
local keyz = input.GetKeyName(layout.forward) .. "/" .. input.GetKeyName(layout.left) .. "/" .. input.GetKeyName(layout.back) .. "/" .. input.GetKeyName(layout.right)
draw.SimpleText(keyz:upper() .. ": " .. L"move_camera", "SH_SZ.Large", x, y, SH_SZ.Style.text)
draw.SimpleText(L"rotate_camera", "SH_SZ.Large", x, y + draw.GetFontHeight("SH_SZ.Large"), SH_SZ.Style.text)
end)
hook.Add("PostDrawViewModel", "SH_SZ.PostDrawViewModel", function()
if (undomodelblend) then
undomodelblend = false
render.SetBlend(1)
end
end)
net.Receive("SH_SZ.Menu", function()
local length = net.ReadUInt(32)
local data = net.ReadData(length)
local uncompressed = util.Decompress(data)
if (!uncompressed) then
ErrorNoHalt("[SAFEZONE] Unable to decompress area data!\n")
return
end
SH_SZ.SafeZones = util.JSONToTable(uncompressed)
UpdateEditor = true
if (net.ReadBool()) then
SH_SZ:ShowEditor()
end
end)
|
local Menu = Game:addState('Menu')
function Menu:enteredState()
end
function Menu:update(dt)
--Put the actual Menu Logic Here
end
function Menu:draw()
-- Draw the Menu PARTS here. Separate from Logic.
end
function Menu:keypressed(key, code)
end
|
id = 'V-38681'
severity = 'low'
weight = 10.0
title = 'All GIDs referenced in /etc/passwd must be defined in /etc/group'
description = 'Inconsistency in GIDs between /etc/passwd and /etc/group could lead to a user having unintended rights.'
fixtext = 'Add a group to the system for each GID referenced without a corresponding group.'
checktext = [=[To ensure all GIDs referenced in /etc/passwd are defined in /etc/group, run the following command:
# pwck -r | grep 'no group'
There should be no output.
If there is output, this is a finding.]=]
function test()
end
function fix()
end
|
-- hammerspoon config
--#region requires
-- these are nice to have loaded when generating docs. idk if there's an overhead cost
require("hs.ipc")
require("hs.doc")
--#endregion requires
--#region loggers
local configLog = hs.logger.new("config", "info")
--#endregion loggers
--#region Spoons
hs.loadSpoon("Zoom")
hs.loadSpoon("LitraGlow")
hs.loadSpoon("MMMute")
local muter = spoon.MMMute
muter:setDefaultVolume(75)
hs.loadSpoon("WiFun")
--#endregion Spoons
--#region key bindings
local hyper = {"shift", "cmd", "alt", "ctrl"}
muter:bindHotkeys({toggle = {hyper, "M"}})
--#endregion key bindings
--#region Watchers registration
-- this pattern seems to be the safest way to register a watcher
local camName = "USB2.0 FHD UVC WebCam"
local usbw = hs.usb.watcher
local pow = hs.caffeinate.watcher
local config = hs.pathwatcher
--#endregion Watchers registration
--#region Utils
local function setWifi()
-- is there a connected usb device named "USB 10/100/1000 LAN"
-- maybe this could be more clever based on network config?
local usb = hs.usb.attachedDevices()
for _,device in pairs(usb) do
if device.productName == "USB 10/100/1000 LAN" then
spoon.WiFun:disconnectWiFi()
return
end
end
spoon.WiFun:reconnectWiFi()
end
local function on_cam(cam, prop, scope, element)
print("in camw")
print("cam:name(): "..cam:name().. "")
print("prop: "..prop.. "")
print("scope: "..scope.. "")
print("element: "..element.. "")
end
function startCamWatcher()
print("in startCamWatcher")
for i,cam in pairs(hs.camera.allCameras()) do
print(i, cam)
if cam:name() == camName then
configLog.i("found camera: " .. camName)
configLog.i("starting camera watcher")
cam:setPropertyWatcherCallback(on_cam):startPropertyWatcher()
break;
end
end
end
local function stopCamWatcher()
configLog.i("stopping camera watcher")
end
-- this method is stupid. Use hs.inspect.inspect(obj) instead
function inspect(tbl)
return hs.inspect.inspect(tbl)
end
--#endregion Utils
--#region Callbacks
local function on_usb(data)
configLog.i("USB Event " ..data.productName.. " " ..data.eventType.. "");
if data.productName == "USB 10/100/1000 LAN" then
if data.eventType == "added" then
configLog.i("USB Event " ..data.productName.. " " ..data.eventType.. "");
spoon.WiFun:disconnectWiFi()
-- hs.notify.show("Monitor", "connected", "");
elseif data.eventType == "removed" then
configLog.i("USB Event " ..data.productName.. " " ..data.eventType.. "");
spoon.WiFun:reconnectWiFi()
-- hs.notify.show("Monitor", "disconnected", "");
end
end
-- if data.productName == camName then
-- if data.eventType == "added" then
-- startCamWatcher()
-- elseif data.eventType == "removed" then
-- stopCamWatcher()
-- end
-- end
end
local function on_pow(event)
local name = "?"
for key,val in pairs(pow) do
if event == val then name = key end
end
configLog.f("Power event %d => %s", event, name)
if event == pow.screensDidUnlock
or event == pow.screensaverDidStop
then
configLog.i("Screen awakened!")
setWifi()
return
end
if event == pow.screensDidLock
or event == pow.screensaverDidStart
then
configLog.i("Screen locked.")
return
end
end
function reloadConfig(files)
local doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()
end
end
zoomStatusMenuBarItem = hs.menubar.new(nil)
zoomStatusMenuBarItem:setClickCallback(function()
spoon.Zoom:toggleMute()
end)
updateZoomStatus = function(event)
-- hs.printf("updateZoomStatus(%s)", event)
-- hs.http.get("")
if (event == "videoStarted" or event == "from-running-to-meeting") then
hs.urlevent.openURL("hammerspoon://lights?action=on")
end
if (event == "from-meeting-to-running" or event == "from-running-to-closed") then
hs.urlevent.openURL("hammerspoon://lights?action=off")
end
end
--#endregion Callbacks
--#region Watchers start
spoon.Zoom:setStatusCallback(updateZoomStatus)
spoon.Zoom:pollStatus(1)
spoon.Zoom:start()
uw = usbw.new(on_usb)
uw:start()
configLog.i("USB events watcher started.")
cw = pow.new(on_pow)
cw:start()
configLog.i("Power events watcher started.")
conw = config.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig)
conw:start()
configLog.i("Config files watcher started.")
hs.urlevent.bind("lights", function(eventName, params)
print(eventName)
print(params["action"])
if params["action"] == "on" then
spoon.LitraGlow:turnOn()
hs.timer.doAfter(1, function()
spoon.LitraGlow:turnOn()
end)
hs.timer.doAfter(2, function()
spoon.LitraGlow:turnOn()
end)
end
if params["action"] == "off" then
spoon.LitraGlow:turnOff()
hs.timer.doAfter(1, function()
spoon.LitraGlow:turnOff()
end)
hs.timer.doAfter(2, function()
spoon.LitraGlow:turnOff()
end)
end
end)
--#endregion Watchers start
--#region Setup
-- call reloadConfig every day at midnight, and refresh every hour
hs.timer.doAt(0,hs.timer.hours(1), hs.reload):start()
-- set wifi on startup
setWifi()
--#endregion Setup
--#region finally
local configNotify = hs.notify.new({title="Config",subTitle="loaded", informativeText=os.date("%I:%M %p"), autoWithdraw=true, alwaysPresent=true, withdrawAfter=10})
configNotify:send()
configLog.i("Config loaded");
--#endregion finally
|
local matchesNeeded = 50
local bombs = {"lr", "ud", "14", "23"}
return {
number = 9,
name = "Diagonals Disabled",
message = "Diagonal matches are diabled for this level. Make sure you destroy " .. matchesNeeded .. " to proceed.",
timer = true,
countDownSpeed = 12, -- only used if timer is true. Controls the speed of the timer.
newColumn = function(column)
probability(column, { 1/10, "normal", function(n) column[n] = gems.wild() end })
probability(column, {
1/10, "any", function(n) column[n].bomb = bombs[math.random(#bombs)] end,
1/10, "normal", function(n) column[3] = gems.burn() end,
})
return column
end,
boardMap = function()
return [[
| . . . . . . . . . |
| . . . . F . . . . |
| . . . F . F . . . |
| . . F . . . F . . |
| . F . . . . . F . |
]], {
}
end,
music= "4u",
background= "interference",
vert = 3,
horz = 3,
upDiag = false,
downDiag = false,
checkObjectives = function(game)
return game.scores.levelMatches >= matchesNeeded
end
}
|
-- lua test by ysoftman
-- argument test
-- 커맨드라인의 인자를 전역 arg 테이블로 제공한다.
-- lua -v argument.lua a b 10
-- arg 주소값
print(arg)
-- (.lua 뒤부터)인자 개수
print(#arg)
print(arg[0]) -- argument.lua
print(arg[1]) -- a
print(arg[2]) -- b
print(arg[3]) -- 10
print(arg[4]) -- nil
print(arg[-1]) -- -v
print(arg[-2]) -- lua
print(arg[-3]) -- nil
|
--初始化日志模块
Debug.LogInit("../logs/logic","logic",true);
--读取配置文件
local sType = require("ServiceType");
local config = require("GameConfig");
--初始化协议
ProtoManager.Init(config.protoType,"C:\\Users\\Administrator\\Documents\\GitHub\\distributed-architecture-of-moba-game-server\\ServerApp\\scripts\\logic\\const");
--如果是Protobuf协议,还需要注册映射表
local cmdNameMap=require("logic/const/CmdNameMap");
if cmdNameMap then
ProtoManager.RegisterCmdMap(cmdNameMap);
else
Debug.LogError("Protobuf register cmdNameMap failed");
end
local logicServerConfig=config.servers[sType.Logic];
local logicConfig=require("logic/LogicConfig");
--开启服务器
Netbus.TcpListen(logicServerConfig.port
,function(s)
local ip,port = Session.GetAddress(s);
print("new client come ["..ip..":"..port.."]");
end);
print("Logic server [tcp] listen at: ", logicServerConfig.port);
Netbus.UdpListen(logicConfig.udp_port);
print("Logic server [udp] listen at: ", logicConfig.udp_port);
--注册服务
local logicService = require("logic/LogicService");
local ret = Service.Register(sType.Logic,logicService);
if ret then
print("register Logic Service:[" .. sType.Logic .. "] service success");
else
Debug.LogError("register Logic Service:[" .. sType.Logic .. "] service failed");
end
|
sacred_tome_smc_aujante = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "",
directObjectTemplate = "object/tangible/mission/quest_item/aujante_klee_q2_needed.iff",
craftingValues = {},
customizationStringNames = {},
customizationValues = {}
}
addLootItemTemplate("sacred_tome_smc_aujante", sacred_tome_smc_aujante)
|
require "helm"
-- Variables -{{{
local api = vim.api
local fn = vim.fn
-- }}}
-- Set the filetype -{{{
function helm_filetype()
helm_start({
prompt = 'Filetype:',
on_enter = function(f)
vim.cmd('set filetype=' .. f)
end,
items = fn.getcompletion('', 'filetype'),
})
end
-- }}}
-- Run commands -{{{
function helm_command()
helm_start({
prompt = 'Command:',
on_enter = function(c)
fn.feedkeys(':' .. c, 'n')
end,
items = fn.getcompletion('', 'command'),
})
end
-- }}}
-- Keybindings -{{{
api.nvim_set_keymap('n', '<Leader>ft', ':lua helm_filetype()<CR>',
{ noremap = true, silent = true })
api.nvim_set_keymap('n', '<Leader>;', ':lua helm_command()<CR>',
{ noremap = true, silent = true })
-- }}}
|
local ECSSystemMgr = BaseClass()
function ECSSystemMgr:Init( world, sceneMgr )
self.ecs_system_mgr_list = {}
local arge = {
sceneMgr=sceneMgr
}
local systems = {
"UMO.DamageSystem",
"UMO.AISystem",
"UMO.MovementUpdateSystem",
}
for i,v in ipairs(systems) do
local system = world:CreateManager(v, arge)
table.insert(self.ecs_system_mgr_list, system)
end
end
function ECSSystemMgr:update( delta_time )
for i,v in ipairs(self.ecs_system_mgr_list) do
v:Update()
end
end
return ECSSystemMgr
|
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by shuieryin.
--- DateTime: 12/01/2018 10:43 PM
---
function cofiCostFunc(params, Y, R, num_users, num_movies, num_features, lambda)
--COFICOSTFUNC Collaborative filtering cost function
-- [J, grad] = COFICOSTFUNC(params, Y, R, num_users, num_movies, ...
-- num_features, lambda) returns the cost and gradient for the
-- collaborative filtering problem.
-- Unfold the U and W matrices from params
local X = torch.reshape(params[{ { 1, num_movies * num_features } }], num_movies, num_features)
local Theta = torch.reshape(params[{ { num_movies * num_features + 1, length(params) } }], num_users, num_features)
-- You need to return the following values correctly
local J = 0
local X_grad = torch.zeros(X:size())
local Theta_grad = torch.zeros(Theta:size())
-- ====================== YOUR CODE HERE ======================
-- Instructions: Compute the cost function and gradient for collaborative
-- filtering. Concretely, you should first implement the cost
-- function (without regularization) and make sure it is
-- matches our costs. After that, you should implement the
-- gradient and use the checkCostFunction routine to check
-- that the gradient is correct. Finally, you should implement
-- regularization.
-- Notes: X - num_movies x num_features matrix of movie features
-- Theta - num_users x num_features matrix of user features
-- Y - num_movies x num_users matrix of user ratings of movies
-- R - num_movies x num_users matrix, where R(i, j) = 1 if the
-- i-th movie was rated by the j-th user
-- You should set the following variables correctly:
-- X_grad - num_movies x num_features matrix, containing the
-- partial derivatives w.r.t. to each element of X
-- Theta_grad - num_users x num_features matrix, containing the
-- partial derivatives w.r.t. to each element of Theta
-- =============================================================
local grad = torch.reshape(X_grad, X_grad:numel()):cat(torch.reshape(Theta_grad, Theta_grad:numel()))
return J, grad
end
|
-- language specific higlights
local lush = require("lush")
local base = require("lush_jsx.base")
local M = {}
M = lush(function()
return {
luaIn {base.LushJSXRed},
luaFunction {base.LushJSXAqua},
luaTable {base.LushJSXOrange},
}
end)
return M
|
local vim = vim
local results = {}
local handle = nil
local function onread(err, data)
if err then
print('ERROR: ', err)
end
if data then
local vals = vim.split(data, "\n")
for _, d in pairs(vals) do
if d ~= "" then
table.insert(results, d)
end
end
end
end
local function set_qf_list()
if results == nil then
return
end
local num_matches = #results
if #results > 0 then
vim.fn.setqflist({}, "r", {lines = results})
vim.api.nvim_command("cwindow")
for i = 0, num_matches do
results[i] = nil
end
end
results = {}
end
local function perform_grep(term)
local stdout = vim.loop.new_pipe(false)
local stderr = vim.loop.new_pipe(false)
handle = vim.loop.spawn(
"rg",
{
args = {term, "--vimgrep", "--smart-case"},
stdio = {stdout, stderr}
},
vim.schedule_wrap(
function()
stdout:read_stop()
stderr:read_stop()
stdout:close()
stderr:close()
handle:close()
set_qf_list()
end
)
)
vim.loop.read_start(stdout, onread)
vim.loop.read_start(stderr, onread)
end
return {
perform_grep = perform_grep
}
|
local cvarName = "hostname"
local logger = GPM.Logger( "Hostname" )
if (SERVER) then
timer.Remove( "HostnameThink" )
local hook_Run = hook.Run
do
local cvars_String = cvars.String
local GetHostName = GetHostName
function game.HostName()
return cvars_String( cvarName, GetHostName() )
end
end
do
local net_Start = net.Start
local net_Broadcast = net.Broadcast
local net_WriteString = net.WriteString
do
local timer_Simple = timer.Simple
local RunConsoleCommand = RunConsoleCommand
function game.SetHostName( any )
local new = tostring( any )
if hook_Run( "OnHostNameChanged", new ) == true then return end
RunConsoleCommand( cvarName, new )
timer_Simple(0, function()
net_Start( "GPM:SendHostName" )
net_WriteString( new )
net_Broadcast()
logger:debug( "Hostname changed, new hostname is '{1}'", new )
end)
end
end
do
local net_Send = net.Send
util.AddNetworkString( "GPM:SendHostName" )
hook.Add("PlayerInitialized", "GPM:SendHostName", function( ply )
net_Start( "GPM:SendHostName" )
net_WriteString( game.HostName() )
net_Send( ply )
end)
end
end
end
if (CLIENT) then
local hostname = "Garry's Mod"
function game.HostName()
return hostname
end
function game.SetHostName( str )
hostname = str
end
do
local net_ReadString = net.ReadString
local game_SetHostName = game.SetHostName
local RunConsoleCommand = RunConsoleCommand
net.Receive("GPM:SendHostName", function()
local hostname = net_ReadString()
if (hostname ~= "") then
game_SetHostName( hostname )
RunConsoleCommand( cvarName, hostname )
logger:debug( "Hostname changed, new hostname is '{1}'", hostname )
end
end)
end
hook.Add("PlayerDisconnected", "GPM:Hostname", function()
RunConsoleCommand( cvarName, "Garry's Mod" )
end)
end
GetHostName = game.HostName
|
--[[
Made by Jesus. o/
--]]
local ITEM = Clockwork.item:New();
ITEM.name = "Turret";
ITEM.cost = 30000;
ITEM.batch = 1;
ITEM.model = "models/Combine_turrets/Floor_turret.mdl";
ITEM.weight = 6.5;
ITEM.access = "VI";
ITEM.useText = "Deploy";
ITEM.color = Color(0, 25, 255, 255);
ITEM.classes = {CLASS_EMP, CLASS_EOW};
ITEM.category = "Others";
ITEM.business = true;
ITEM.description = "A large device, it folds up about the size of a suitcase for storage.";
-- Turrets system.
function ITEM:OnUse(player, itemEntity)
local trace = player:GetEyeTraceNoCursor();
if (trace.HitPos:Distance(player:GetShootPos()) <= 192) then
local entity = ents.Create("npc_turret_floor")
Clockwork.player:GiveProperty(player, entity);
entity:SetModel(self.model);
entity:SetPos(trace.HitPos);
for k, v in ipairs(_player.GetAll()) do
if (Schema:PlayerIsCombine(v)) then
entity:AddEntityRelationship(v, 3, 99)
else
entity:AddEntityRelationship(v, 1, 99)
end;
end;
player:TakeItem(self);
entity:Spawn();
timer.Simple(120, function() entity:Fire("Self Destruct", "", 0) end);
if (IsValid(itemEntity) ) then
local physicsObject = itemEntity:GetPhysicsObject();
entity:SetPos(itemEntity:GetPos());
entity:SetAngles(itemEntity:GetAngles());
if (IsValid(physicsObject)) then
if (!physicsObject:IsMoveable()) then
physicsObject = entity:GetPhysicsObject();
if (IsValid(physicsObject)) then
physicsObject:EnableMotion(false);
end;
end;
end;
else
Clockwork.entity:MakeFlushToGround(entity, trace.HitPos, trace.HitNormal);
player:TakeItem(self);
Clockwork.schema:AddCombineDisplayLine("Getting Turret Data...", Color(255, 100, 255, 255) );
end;
else
Clockwork.player:Notify(player, "You can't drop a turret that far away!")
return false;
end;
end;
-- When the ITEM is dropped.
function ITEM:OnDrop(player, position) end;
ITEM:Register();
|
mobs:register_mob("livingnether:whip", {
type = "monster",
passive = false,
attack_type = "dogfight",
attack_animals = false,
damage = 15,
reach = 4,
damage = 25,
hp_min = 45,
hp_max = 60,
armor = 100,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 2, 0.4},
visual = "mesh",
mesh = "Whip.b3d",
visual_size = {x = 1.0, y = 1.0},
textures = {
{"texturewhip.png"},
},
sounds = {
attack = "livingnether_whip",
distance = 16,
},
makes_footstep_sound = false,
walk_velocity = 0,
run_velocity = 0,
jump = false,
jump_height = 6,
fly = false,
stepheight = 1,
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 0,
animation = {
speed_normal = 50,
speed_run = 50,
stand_start = 0,
stand_end = 100,
run_start = 100,
run_end = 200,
walk_start = 0,
walk_end = 100,
speed_punch = 100,
punch_start = 200,
punch_end = 300,
},
view_range = 4,
on_rightclick = function(self, clicker)
-- feed or tame
if mobs:feed_tame(self, clicker, 4, false, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 5, 50, 80, false, nil) then return end
end,
})
if not mobs.custom_spawn_livingnether then
mobs:spawn({
name = "livingnether:whip",
nodes = {"nether:rack_deep"},
min_light = 0,
interval = 60,
active_object_count = 5,
chance = 8000, -- 15000
min_height = -8000,
max_height = -3000,
})
end
mobs:register_egg("livingnether:whip", ("Flesh Whip"), "awhip.png")
|
MINIGAME.Time = 120
---------------------------------------------------------
--
---------------------------------------------------------
function MINIGAME:Start()
print(self.Name .. " has started.")
self.BaseClass.Start(self)
end
---------------------------------------------------------
--
---------------------------------------------------------
function MINIGAME:Finish(timeLimit)
self.BaseClass.Finish(self, timeLimit)
print(self.Name .. " has finished.")
end
---------------------------------------------------------
--
---------------------------------------------------------
function MINIGAME:HasRequirements(players, teams)
return teams > 1
end
---------------------------------------------------------
--
---------------------------------------------------------
function MINIGAME:CanPlayerSlap(player, target, nextSlap)
if (target:Team() == player:Team()) then
return false
end
end
---------------------------------------------------------
--
---------------------------------------------------------
function MINIGAME:PlayerSlap(player, target, nextSlap)
timer.Simple(0, function()
self:RemovePlayer(target)
local won = self:AnnounceWin()
if (won) then
self:Finish()
end
end)
return nextSlap
end
---------------------------------------------------------
--
---------------------------------------------------------
function MINIGAME:CanPlayerSuicide(player)
return false
end
|
local Button = require("window_button")
local MessageBox = {}
local __metatable = {}
local _MESSGB_SIZE = { WIDTH = 770, HEIGHT = 292 }
MessageBox.States =
{
SINGLE = "single",
DOUBLE = "double"
}
MessageBox.Button = 1
MessageBox.Inited = false
MessageBox.Textures = {}
MessageBox.Textures.light = {}
MessageBox.Textures.dark = {}
local function _getColorTheme()
if love.system.getOS() == "Horizon" then
return love.system.getColorTheme()
end
return "light"
end
function MessageBox.initTextures()
if MessageBox.Inited then
return
end
MessageBox.Textures.light.single =
{
love.graphics.newImage("internal/graphics/messagebox_light.png"),
love.graphics.newImage("internal/graphics/messagebox_light_pressed.png")
}
MessageBox.Textures.light.double =
{
love.graphics.newImage("internal/graphics/messagebox_light_two_none.png"),
love.graphics.newImage("internal/graphics/messagebox_light_two_left.png"),
love.graphics.newImage("internal/graphics/messagebox_light_two_left_pressed.png"),
love.graphics.newImage("internal/graphics/messagebox_light_two_right.png"),
love.graphics.newImage("internal/graphics/messagebox_light_two_right_pressed.png")
}
MessageBox.Textures.dark.single =
{
love.graphics.newImage("internal/graphics/messagebox_dark.png"),
love.graphics.newImage("internal/graphics/messagebox_dark_pressed.png")
}
MessageBox.Textures.dark.double =
{
love.graphics.newImage("internal/graphics/messagebox_dark_two_none.png"),
love.graphics.newImage("internal/graphics/messagebox_dark_two_left.png"),
love.graphics.newImage("internal/graphics/messagebox_dark_two_left_pressed.png"),
love.graphics.newImage("internal/graphics/messagebox_dark_two_right.png"),
love.graphics.newImage("internal/graphics/messagebox_dark_two_right_pressed.png")
}
MessageBox.Inited = true
end
function MessageBox.new(text, buttons)
local messagebox = {}
MessageBox.initTextures()
messagebox.text = text
messagebox.buttons = {}
messagebox.theme = _getColorTheme()
messagebox.state = #buttons == 1 and MessageBox.States.SINGLE or MessageBox.States.DOUBLE
messagebox.defaultTexture = MessageBox.Textures[messagebox.theme][messagebox.state][1]
messagebox.currentTexture = messagebox.defaultTexture
messagebox.opacity = 0
messagebox.selection = 1
messagebox.submitted = false
messagebox.textColors = {}
messagebox.textColors.light = {0, 0, 0}
messagebox.textColors.dark = {1, 1, 1}
messagebox.oldFont = love.graphics.getFont()
function messagebox:initButtons()
for index = 1, #buttons do
local scale = self:getScaleValue()
local width = (#buttons == 1 and _MESSGB_SIZE.WIDTH or (_MESSGB_SIZE.WIDTH * 0.5))
local offset = (#buttons == 2 and width or 0)
local x, y = self:getPosition()
local position = { x = x + (index - 1) * offset,
y = (y + _MESSGB_SIZE.HEIGHT * scale) - 70 * scale }
local button = Button(buttons[index], index, position, width, scale)
table.insert(self.buttons, button)
end
self.buttons[self.selection]:setSelected(true)
self:updateTexture()
end
function messagebox:updateTexture()
-- press
if self.state == "single" then
self.currentTexture = MessageBox.Textures[self.theme][self.state][MessageBox.Button]
else
local id = 3
-- press
if self.selection == 0 then
if MessageBox.Button == 2 then
id = 3
elseif MessageBox.Button == 3 then
id = 5
end
else -- gamepadaxis
if self.selection == 1 then
id = 2
elseif self.selection == 2 then
id = 4
end
end
self.currentTexture = MessageBox.Textures[self.theme][self.state][id]
end
end
function messagebox:poll(name, ...)
local args = {...}
table.remove(args, 1)
local x, y = args[1], args[2]
if name == "resize" then
self:initButtons()
end
if self.opacity < 1 then
return
end
-- touch events
local pass = false
if name == "touchpressed" or name == "mousepressed" then
for _, button in ipairs(self.buttons) do
if button:touchpressed(x, y) then
MessageBox.Button = button:getIndex() + 1
self:updateTexture()
pass = true
break
end
end
if not pass then
MessageBox.Button = 1
self.selection = 0
for _, button in ipairs(self.buttons) do
button:setSelected(false)
end
end
elseif name == "touchreleased" or name == "mousereleased" then
if pass then
self.currentTexture = self.defaultTexture
self.submitted = true
end
end
-- gamepadaxis
if name == "gamepadaxis" and not self.submitted then
local axis, value = args[1], args[2]
if axis == "leftx" then
self.buttons[self.selection]:setSelected(false)
if value > 0.5 then
self.selection = math.min(self.selection + 1, #self.buttons)
elseif value < -0.5 then
self.selection = math.max(self.selection - 1, 1)
end
self.buttons[self.selection]:setSelected(true)
MessageBox.Button = self.selection + 1
self:updateTexture()
end
end
-- gamepadpressed
if name == "gamepadpressed" then
if self.selection > 0 and args[1] == "a" then
self.buttons[self.selection]:setSelected(false)
MessageBox.Button = self.selection + 1
self:updateTexture()
self.submitted = true
end
elseif name == "gamepadreleased" then
self.currentTexture = self.defaultTexture
end
end
function messagebox:update(dt)
if self.submitted and self.opacity == 0 then
return true
end
if MessageBox.Button ~= 1 and self.submitted then
self.opacity = math.max(self.opacity - dt / 0.10, 0)
else
self.opacity = math.min(self.opacity + dt / 0.20, 1)
end
end
function messagebox:getScaleValue()
local _, screenHeight = love.graphics.getDimensions()
if screenHeight == 720 then
return 1
end
return 1.5
end
function messagebox:getPosition()
local screenWidth, screenHeight = love.graphics.getDimensions()
local scale = self:getScaleValue()
local width, height = _MESSGB_SIZE.WIDTH * scale, _MESSGB_SIZE.HEIGHT * scale
return (screenWidth - width) * 0.5, (screenHeight - height) * 0.5
end
local font = love.graphics.newFont(24 * messagebox:getScaleValue())
function messagebox:draw()
love.graphics.push("all")
love.graphics.setColor(1, 1, 1, self.opacity)
local x, y = self:getPosition()
local scale = self:getScaleValue()
love.graphics.draw(self.currentTexture, x, y, 0, scale, scale)
love.graphics.setFont(font)
local r, g, b = unpack(self.textColors[_getColorTheme()])
love.graphics.setColor(r, g, b, self.opacity)
love.graphics.printf(self.text, x, y + 12, _MESSGB_SIZE.WIDTH * scale, "center")
for _, button in ipairs(self.buttons) do
button:draw(self.theme, self.opacity)
end
love.graphics.pop()
end
function messagebox:getPressedButton()
if not self.submitted then
return
end
return MessageBox.Button
end
messagebox:initButtons()
return setmetatable(messagebox, __metatable)
end
__metatable.__call = function(_, ...)
return MessageBox.new(...)
end
return setmetatable(MessageBox, {__call = function(_, ...)
return MessageBox.new(...)
end})
|
ITEM.name = "Scrap Cloth"
ITEM.model = Model("models/props_debris/concrete_chunk04a.mdl")
ITEM.description = "A set of scrap cloth."
ITEM.width = 1
ITEM.height = 1
ITEM.price = 5
ITEM.category = "Crafting"
ITEM.rarity = "Common"
ITEM.noBusiness = true
ITEM.maxStack = 15;
ITEM.defaultStack = 1;
|
local enumUtils = LazarusMod:GetModule('enumutilities')
enumUtils:AppendToEnum(kMinimapBlipType, "TunnelExit")
|
local Registry = {}
local self = Registry
function Registry.initialize(preload)
if not self.preload then
self.base_scripts = {}
for _,path in ipairs(Utils.getFilesRecursive("data/common", ".lua")) do
local chunk = love.filesystem.load("data/common/"..path..".lua")
self.base_scripts["data/"..path] = chunk
end
local chapter = Kristal.getModOption("chapter") or 2
for _,path in ipairs(Utils.getFilesRecursive("data/chapter_"..tostring(chapter), ".lua")) do
local chunk = love.filesystem.load("data/chapter_"..tostring(chapter).."/"..path..".lua")
self.base_scripts["data/"..path] = chunk
end
Registry.initActors()
end
if not preload then
Registry.initObjects()
Registry.initItems()
Registry.initSpells()
Registry.initPartyMembers()
Registry.initEncounters()
Registry.initEnemies()
Registry.initWaves()
Registry.initBullets()
Kristal.modCall("onRegistered")
end
self.preload = preload
end
-- Getter Functions --
function Registry.getActor(id)
return self.actors[id]
end
function Registry.getItem(id)
return self.items[id]
end
function Registry.getSpell(id)
return self.spells[id]
end
function Registry.getPartyMember(id)
return self.party_members[id]
end
function Registry.getPartyMemberFromActor(id)
return self.party_from_actor[id]
end
function Registry.getEncounter(id)
return self.encounters[id]
end
function Registry.getEnemy(id)
return self.enemies[id]
end
function Registry.createEnemy(id, ...)
if self.enemies[id] then
return self.enemies[id](...)
else
error("Attempt to create non existent enemy \"" .. id .. "\"")
end
end
function Registry.getWave(id)
return self.waves[id]
end
function Registry.createWave(id, ...)
if self.waves[id] then
return self.waves[id](...)
else
error("Attempt to create non existent wave \"" .. id .. "\"")
end
end
function Registry.getBullet(id)
return self.bullets[id]
end
function Registry.createBullet(id, ...)
if self.bullets[id] then
return self.bullets[id](...)
else
error("Attempt to create non existent bullet \"" .. id .. "\"")
end
end
-- Register Functions --
function Registry.registerActor(id, tbl)
self.actors[id] = tbl
end
function Registry.registerPartyMember(id, tbl)
self.party_members[id] = tbl
if tbl.actor then
self.party_from_actor[tbl.actor] = tbl
end
end
function Registry.registerItem(id, tbl)
self.items[id] = tbl
end
function Registry.registerSpell(id, tbl)
self.spells[id] = tbl
end
function Registry.registerEncounter(id, class)
self.encounters[id] = class
end
function Registry.registerEnemy(id, class)
self.enemies[id] = class
end
function Registry.registerWave(id, class)
self.waves[id] = class
end
function Registry.registerBullet(id, class)
self.bullets[id] = class
end
-- Internal Functions --
function Registry.initObjects()
for _,path,object in self.iterScripts("objects") do
local path_tbl = Utils.split(path, "/")
local new_path = path_tbl[#path_tbl]
local id = object.id or new_path
if id:lower() == id then
print("WARNING: Object '"..id.."' registered in lowercase!")
end
if _G[id] then
print("WARNING: Object '"..id.."' already exists, replacing")
end
_G[id] = object
end
Kristal.modCall("onRegisterObjects")
end
function Registry.initActors()
self.actors = {}
for _,path,actor in self.iterScripts("data/actors") do
actor.id = actor.id or path
self.registerActor(actor.id, actor)
end
Kristal.modCall("onRegisterActors")
end
function Registry.initPartyMembers()
self.party_members = {}
self.party_from_actor = {}
for _,path,char in self.iterScripts("data/party") do
char.id = char.id or path
self.registerPartyMember(char.id, char)
end
end
function Registry.initItems()
self.items = {}
for _,path,item in self.iterScripts("data/items") do
item.id = item.id or path
self.registerItem(item.id, item)
end
Kristal.modCall("onRegisterItems")
end
function Registry.initSpells()
self.spells = {}
for _,path,spell in self.iterScripts("data/spells") do
spell.id = spell.id or path
self.registerSpell(spell.id, spell)
end
Kristal.modCall("onRegisterSpells")
end
function Registry.initEncounters()
self.encounters = {}
for _,path,encounter in self.iterScripts("battle/encounters") do
encounter.id = encounter.id or path
self.registerEncounter(encounter.id, encounter)
end
Kristal.modCall("onRegisterEncounters")
end
function Registry.initEnemies()
self.enemies = {}
for _,path,enemy in self.iterScripts("battle/enemies") do
enemy.id = enemy.id or path
self.registerEnemy(enemy.id, enemy)
end
Kristal.modCall("onRegisterEnemies")
end
function Registry.initWaves()
self.waves = {}
for _,path,wave in self.iterScripts("battle/waves") do
wave.id = wave.id or path
self.registerWave(wave.id, wave)
end
Kristal.modCall("onRegisterWaves")
end
function Registry.initBullets()
self.bullets = {}
for _,path,bullet in self.iterScripts("battle/bullets") do
bullet.id = bullet.id or path
self.registerBullet(bullet.id, bullet)
end
Kristal.modCall("onRegisterBullets")
end
function Registry.iterScripts(base_path)
local result = {}
CLASS_NAME_GETTER = function(k)
for _,v in ipairs(result) do
if v.path == k then
return v.out[1]
end
end
return DEFAULT_CLASS_NAME_GETTER(k)
end
local chunks = nil
local parsed = {}
local addChunk, requireChunk, parse
addChunk = function(path, chunk, id, full_path)
local success,a,b,c,d,e,f = pcall(chunk)
if not success then
if type(a) == "table" and a.included then
requireChunk(path, a.included)
success,a,b,c,d,e,f = pcall(chunk)
if not success then
error(type(a) == "table" and a.msg or a)
end
table.insert(result, {out = {a,b,c,d,e,f}, path = id, full_path = full_path})
else
error(a)
end
else
table.insert(result, {out = {a,b,c,d,e,f}, path = id, full_path = full_path})
return a
end
end
requireChunk = function(path, req_id)
for full_path,chunk in pairs(chunks) do
if not parsed[full_path] and full_path:sub(1, #path) == path then
local id = full_path:sub(#path + 1)
if id:sub(1, 1) == "/" then
id = id:sub(2)
end
if id == req_id then
parsed[full_path] = true
addChunk(path, chunk, id, full_path)
end
end
end
end
parse = function(path, _chunks)
chunks = _chunks
parsed = {}
for full_path,chunk in pairs(chunks) do
if not parsed[full_path] and full_path:sub(1, #path) == path then
local id = full_path:sub(#path + 1)
if id:sub(1, 1) == "/" then
id = id:sub(2)
end
parsed[full_path] = true
addChunk(path, chunk, id, full_path)
end
end
end
parse(base_path, self.base_scripts)
if Mod then
parse("scripts/"..base_path, Mod.info.script_chunks)
end
CLASS_NAME_GETTER = DEFAULT_CLASS_NAME_GETTER
local i = 0
---@diagnostic disable-next-line: undefined-field
local n = table.getn(result)
return function()
i = i + 1
if i <= n then
return result[i].full_path, result[i].path, unpack(result[i].out)
end
end
end
return Registry
|
local f = string.format
local function useAnsi()
return (LivelyEpsilonConfig or {}).useAnsi or false
end
local function showDeprecations()
return (LivelyEpsilonConfig or {}).logDeprecation or true
end
local function logLevel()
local logLvl = (LivelyEpsilonConfig or {}).logLevel
if isString(logLvl) then logLvl = logLvl:upper() end
return logLvl
end
local function timestamp()
if (LivelyEpsilonConfig or {}).logTime == true then
return string.format("[%7.1f]", Cron.now())
else
return ""
end
end
local red = "\u{001b}[41m\u{001b}[37m"
local yellow = "\u{001b}[33m"
local cyan = "\u{001b}[36m"
local grey = "\u{001b}[90;1m"
local magenta = "\u{001b}[95m"
local reset = "\u{001b}[0m"
logError = function (message)
local logLvl = logLevel()
if logLvl == nil or logLvl == "DEBUG" or logLvl == "INFO" or logLvl == "WARNING" or logLvl == "ERROR" then
print(f("%s%s[ERROR] %s%s", timestamp(), useAnsi() and red or "", message, useAnsi() and reset or ""))
end
end
logWarning = function (message)
local logLvl = logLevel()
if logLvl == nil or logLvl == "DEBUG" or logLvl == "INFO" or logLvl == "WARNING" then
print(f("%s%s[WARN] %s%s", timestamp(), useAnsi() and yellow or "", message, useAnsi() and reset or ""))
end
end
logInfo = function (message)
local logLvl = logLevel()
if logLvl == nil or logLvl == "DEBUG" or logLvl == "INFO" then
print(f("%s%s[INFO] %s%s", timestamp(), useAnsi() and cyan or "", message, useAnsi() and reset or ""))
end
end
logDebug = function (message)
local logLvl = logLevel()
if logLvl == nil or logLvl == "DEBUG" then
print(f("%s%s[DEBUG] %s%s", timestamp(), useAnsi() and grey or "", message, useAnsi() and reset or ""))
end
end
logDeprecation = function(message)
if showDeprecations() then
print(f("%s%s[DEPRECATION] %s%s", timestamp(), useAnsi() and magenta or "", message, useAnsi() and reset or ""))
end
end
|
local RunState = class('RunState', PlayerActState)
function RunState:OnEnter()
PlayerActState.OnEnter(self)
--localPlayer.Avatar:PlayAnimation("RunFront", 2, 1, 0.1, true, true, 1)
localPlayer.Avatar:PlayAnimation('RunFront', 2, 1, 0.1, true, true, localPlayer.WalkSpeed / 6)
if Data.Player.curEquipmentID == 0 then
localPlayer.Avatar:PlayAnimation('RunFront', 2, 1, 0.1, true, true, localPlayer.WalkSpeed / 6)
elseif Config.Item[Data.Player.curEquipmentID].Type == 1 then
localPlayer.Avatar:PlayAnimation('OneHandedSwordRun', 2, 1, 0.1, true, true, localPlayer.WalkSpeed / 6)
elseif Config.Item[Data.Player.curEquipmentID].Type == 4 then
localPlayer.Avatar:PlayAnimation('Jogging', 2, 1, 0.1, true, true, localPlayer.WalkSpeed / 6)
end
end
function RunState:OnUpdate(dt)
PlayerActState.OnUpdate(self, dt)
FsmMgr.playerActFsm:TriggerMonitor(
{
'Idle',
'Hit',
'SwimIdle',
'Fly',
'Vertigo',
'TakeOutItem',
'UseItem'
}
)
self:IdleMonitor()
self:WalkMonitor()
self:JumpMonitor()
end
function RunState:OnLeave()
PlayerActState.OnLeave(self)
end
return RunState
|
slot0 = require("protobuf")
slot1 = require("common_pb")
module("p13_pb")
SC_13001 = slot0.Descriptor()
SC_13002 = slot0.Descriptor()
CS_13003 = slot0.Descriptor()
SC_13004 = slot0.Descriptor()
CS_13005 = slot0.Descriptor()
SC_13006 = slot0.Descriptor()
CS_13007 = slot0.Descriptor()
SC_13008 = slot0.Descriptor()
CS_13009 = slot0.Descriptor()
SC_13010 = slot0.Descriptor()
SC_13011 = slot0.Descriptor()
CS_13101 = slot0.Descriptor()
SC_13102 = slot0.Descriptor()
CS_13103 = slot0.Descriptor()
SC_13104 = slot0.Descriptor()
SC_13105 = slot0.Descriptor()
CHAPTERINFO = slot0.Descriptor()
ELITEFLEETINFO = slot0.Descriptor()
CURRENTCHAPTERINFO = slot0.Descriptor()
CHAPTERCELLINFO = slot0.Descriptor()
CELLFLAG = slot0.Descriptor()
CHAPTERCELLPOS = slot0.Descriptor()
GROUPINCHAPTER = slot0.Descriptor()
SHIPINCHAPTER = slot0.Descriptor()
STRATEGYINFO = slot0.Descriptor()
AI_ACT = slot0.Descriptor()
CS_13107 = slot0.Descriptor()
SC_13108 = slot0.Descriptor()
CS_13109 = slot0.Descriptor()
SC_13110 = slot0.Descriptor()
SC_13201 = slot0.Descriptor()
EXPEDITION_DAILY_COUNT = slot0.Descriptor()
CS_13301 = slot0.Descriptor()
SC_13302 = slot0.Descriptor()
ESCORT_INFO = slot0.Descriptor()
ESCORT_POS = slot0.Descriptor()
CS_13401 = slot0.Descriptor()
SC_13402 = slot0.Descriptor()
CS_13403 = slot0.Descriptor()
SC_13404 = slot0.Descriptor()
PRO_CHAPTER_SUBMARINE = slot0.Descriptor()
REACTCHAPTER_INFO = slot0.Descriptor()
CS_13501 = slot0.Descriptor()
SC_13502 = slot0.Descriptor()
CS_13503 = slot0.Descriptor()
SC_13504 = slot0.Descriptor()
FLEETDUTYKEYVALUEPAIR = slot0.Descriptor()
({
SC_13001_CHAPTER_LIST_FIELD = slot0.FieldDescriptor(),
SC_13001_CURRENT_CHAPTER_FIELD = slot0.FieldDescriptor(),
SC_13001_DAILY_REPAIR_COUNT_FIELD = slot0.FieldDescriptor(),
SC_13001_REACT_CHAPTER_FIELD = slot0.FieldDescriptor(),
SC_13001_FLEET_LIST_FIELD = slot0.FieldDescriptor(),
SC_13002_COLLECTION_LIST_FIELD = slot0.FieldDescriptor(),
SC_13002_MAX_TEAM_FIELD = slot0.FieldDescriptor(),
CS_13003_ID_FIELD = slot0.FieldDescriptor(),
CS_13003_SHIP_ID_LIST_FIELD = slot0.FieldDescriptor(),
SC_13004_RESULT_FIELD = slot0.FieldDescriptor(),
CS_13005_ID_FIELD = slot0.FieldDescriptor(),
SC_13006_RESULT_FIELD = slot0.FieldDescriptor(),
SC_13006_EXP_FIELD = slot0.FieldDescriptor(),
SC_13006_DROP_LIST_FIELD = slot0.FieldDescriptor(),
SC_13006_NEW_COLLECTION_FIELD = slot0.FieldDescriptor(),
SC_13006_IS_CRI_FIELD = slot0.FieldDescriptor(),
CS_13007_ID_FIELD = slot0.FieldDescriptor(),
SC_13008_RESULT_FIELD = slot0.FieldDescriptor(),
CS_13009_TYPE_FIELD = slot0.FieldDescriptor(),
SC_13010_RESULT_FIELD = slot0.FieldDescriptor(),
SC_13010_COLLECTION_LIST_FIELD = slot0.FieldDescriptor(),
SC_13011_COLLECTION_FIELD = slot0.FieldDescriptor(),
CS_13101_ID_FIELD = slot0.FieldDescriptor(),
CS_13101_GROUP_ID_LIST_FIELD = slot0.FieldDescriptor(),
CS_13101_ELITE_FLEET_LIST_FIELD = slot0.FieldDescriptor(),
CS_13101_OPERATION_ITEM_FIELD = slot0.FieldDescriptor(),
CS_13101_LOOP_FLAG_FIELD = slot0.FieldDescriptor(),
CS_13101_FLEET_DUTIES_FIELD = slot0.FieldDescriptor(),
SC_13102_RESULT_FIELD = slot0.FieldDescriptor(),
SC_13102_CURRENT_CHAPTER_FIELD = slot0.FieldDescriptor(),
CS_13103_ACT_FIELD = slot0.FieldDescriptor(),
CS_13103_GROUP_ID_FIELD = slot0.FieldDescriptor(),
CS_13103_ACT_ARG_1_FIELD = slot0.FieldDescriptor(),
CS_13103_ACT_ARG_2_FIELD = slot0.FieldDescriptor(),
SC_13104_RESULT_FIELD = slot0.FieldDescriptor(),
SC_13104_MOVE_PATH_FIELD = slot0.FieldDescriptor(),
SC_13104_DROP_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_MAP_UPDATE_FIELD = slot0.FieldDescriptor(),
SC_13104_SHIP_UPDATE_FIELD = slot0.FieldDescriptor(),
SC_13104_AI_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_AI_ACT_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_SUBMARINE_ACT_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_ESCORT_ACT_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_FLEET_ACT_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_BUFF_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_ADD_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_DEL_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
SC_13104_CELL_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
SC_13105_MAP_UPDATE_FIELD = slot0.FieldDescriptor(),
SC_13105_AI_LIST_FIELD = slot0.FieldDescriptor(),
SC_13105_ADD_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
SC_13105_DEL_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
SC_13105_BUFF_LIST_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_ID_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_PROGRESS_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_KILL_BOSS_COUNT_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_KILL_ENEMY_COUNT_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_TAKE_BOX_COUNT_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_DEFEAT_COUNT_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD = slot0.FieldDescriptor(),
CHAPTERINFO_PASS_COUNT_FIELD = slot0.FieldDescriptor(),
ELITEFLEETINFO_MAP_ID_FIELD = slot0.FieldDescriptor(),
ELITEFLEETINFO_MAIN_ID_FIELD = slot0.FieldDescriptor(),
ELITEFLEETINFO_COMMANDERS_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_ID_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_TIME_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_CELL_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_GROUP_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_AI_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_ESCORT_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_ROUND_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_BUFF_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_LOOP_FLAG_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_CHAPTER_HP_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_KILL_COUNT_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD = slot0.FieldDescriptor(),
CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLINFO_POS_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLINFO_ITEM_TYPE_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLINFO_ITEM_ID_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLINFO_ITEM_FLAG_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLINFO_ITEM_DATA_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLINFO_EXTRA_ID_FIELD = slot0.FieldDescriptor(),
CELLFLAG_POS_FIELD = slot0.FieldDescriptor(),
CELLFLAG_FLAG_LIST_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLPOS_ROW_FIELD = slot0.FieldDescriptor(),
CHAPTERCELLPOS_COLUMN_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_ID_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_SHIP_LIST_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_POS_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_STEP_COUNT_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_STRATEGY_IDS_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_BULLET_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_START_POS_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_COMMANDER_LIST_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_KILL_COUNT_FIELD = slot0.FieldDescriptor(),
GROUPINCHAPTER_FLEET_ID_FIELD = slot0.FieldDescriptor(),
SHIPINCHAPTER_ID_FIELD = slot0.FieldDescriptor(),
SHIPINCHAPTER_HP_RANT_FIELD = slot0.FieldDescriptor(),
STRATEGYINFO_ID_FIELD = slot0.FieldDescriptor(),
STRATEGYINFO_COUNT_FIELD = slot0.FieldDescriptor(),
AI_ACT_AI_POS_FIELD = slot0.FieldDescriptor(),
AI_ACT_STRATEGY_ID_FIELD = slot0.FieldDescriptor(),
AI_ACT_TARGET_POS_FIELD = slot0.FieldDescriptor(),
AI_ACT_MOVE_PATH_FIELD = slot0.FieldDescriptor(),
AI_ACT_MAP_UPDATE_FIELD = slot0.FieldDescriptor(),
AI_ACT_SHIP_UPDATE_FIELD = slot0.FieldDescriptor(),
AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD = slot0.FieldDescriptor(),
AI_ACT_ACT_TYPE_FIELD = slot0.FieldDescriptor(),
AI_ACT_HP_DEL_FIELD = slot0.FieldDescriptor(),
CS_13107_ID_FIELD = slot0.FieldDescriptor(),
CS_13107_ELITE_FLEET_LIST_FIELD = slot0.FieldDescriptor(),
SC_13108_RESULT_FIELD = slot0.FieldDescriptor(),
CS_13109_ID_FIELD = slot0.FieldDescriptor(),
SC_13110_DROP_SHIP_LIST_FIELD = slot0.FieldDescriptor(),
SC_13201_COUNT_LIST_FIELD = slot0.FieldDescriptor(),
SC_13201_ELITE_EXPEDITION_COUNT_FIELD = slot0.FieldDescriptor(),
SC_13201_ESCORT_EXPEDITION_COUNT_FIELD = slot0.FieldDescriptor(),
SC_13201_CHAPTER_COUNT_LIST_FIELD = slot0.FieldDescriptor(),
SC_13201_QUICK_EXPEDITION_LIST_FIELD = slot0.FieldDescriptor(),
EXPEDITION_DAILY_COUNT_ID_FIELD = slot0.FieldDescriptor(),
EXPEDITION_DAILY_COUNT_COUNT_FIELD = slot0.FieldDescriptor(),
CS_13301_TYPE_FIELD = slot0.FieldDescriptor(),
SC_13302_ESCORT_INFO_FIELD = slot0.FieldDescriptor(),
SC_13302_DROP_LIST_FIELD = slot0.FieldDescriptor(),
ESCORT_INFO_LINE_ID_FIELD = slot0.FieldDescriptor(),
ESCORT_INFO_AWARD_TIMESTAMP_FIELD = slot0.FieldDescriptor(),
ESCORT_INFO_FLASH_TIMESTAMP_FIELD = slot0.FieldDescriptor(),
ESCORT_INFO_MAP_FIELD = slot0.FieldDescriptor(),
ESCORT_POS_MAP_ID_FIELD = slot0.FieldDescriptor(),
ESCORT_POS_CHAPTER_ID_FIELD = slot0.FieldDescriptor(),
CS_13401_TYPE_FIELD = slot0.FieldDescriptor(),
SC_13402_NEXT_REFRESH_TIME_FIELD = slot0.FieldDescriptor(),
SC_13402_REFRESH_COUNT_FIELD = slot0.FieldDescriptor(),
SC_13402_CHAPTER_LIST_FIELD = slot0.FieldDescriptor(),
SC_13402_PROGRESS_FIELD = slot0.FieldDescriptor(),
CS_13403_TYPE_FIELD = slot0.FieldDescriptor(),
SC_13404_RESULT_FIELD = slot0.FieldDescriptor(),
SC_13404_CHAPTER_ID_FIELD = slot0.FieldDescriptor(),
PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD = slot0.FieldDescriptor(),
PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD = slot0.FieldDescriptor(),
PRO_CHAPTER_SUBMARINE_INDEX_FIELD = slot0.FieldDescriptor(),
REACTCHAPTER_INFO_COUNT_FIELD = slot0.FieldDescriptor(),
REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD = slot0.FieldDescriptor(),
REACTCHAPTER_INFO_ACTIVE_ID_FIELD = slot0.FieldDescriptor(),
REACTCHAPTER_INFO_DAILY_COUNT_FIELD = slot0.FieldDescriptor(),
CS_13501_ACTIVE_ID_FIELD = slot0.FieldDescriptor(),
SC_13502_RESULT_FIELD = slot0.FieldDescriptor(),
CS_13503_TYPE_FIELD = slot0.FieldDescriptor(),
SC_13504_RESULT_FIELD = slot0.FieldDescriptor(),
FLEETDUTYKEYVALUEPAIR_KEY_FIELD = slot0.FieldDescriptor(),
FLEETDUTYKEYVALUEPAIR_VALUE_FIELD = slot0.FieldDescriptor()
})["SC_13001_CHAPTER_LIST_FIELD"].name = "chapter_list"
()["SC_13001_CHAPTER_LIST_FIELD"].full_name = "p13.sc_13001.chapter_list"
()["SC_13001_CHAPTER_LIST_FIELD"].number = 1
()["SC_13001_CHAPTER_LIST_FIELD"].index = 0
()["SC_13001_CHAPTER_LIST_FIELD"].label = 3
()["SC_13001_CHAPTER_LIST_FIELD"].has_default_value = false
()["SC_13001_CHAPTER_LIST_FIELD"].default_value = {}
()["SC_13001_CHAPTER_LIST_FIELD"].message_type = CHAPTERINFO
()["SC_13001_CHAPTER_LIST_FIELD"].type = 11
()["SC_13001_CHAPTER_LIST_FIELD"].cpp_type = 10
()["SC_13001_CURRENT_CHAPTER_FIELD"].name = "current_chapter"
()["SC_13001_CURRENT_CHAPTER_FIELD"].full_name = "p13.sc_13001.current_chapter"
()["SC_13001_CURRENT_CHAPTER_FIELD"].number = 2
()["SC_13001_CURRENT_CHAPTER_FIELD"].index = 1
()["SC_13001_CURRENT_CHAPTER_FIELD"].label = 1
()["SC_13001_CURRENT_CHAPTER_FIELD"].has_default_value = false
()["SC_13001_CURRENT_CHAPTER_FIELD"].default_value = nil
()["SC_13001_CURRENT_CHAPTER_FIELD"].message_type = CURRENTCHAPTERINFO
()["SC_13001_CURRENT_CHAPTER_FIELD"].type = 11
()["SC_13001_CURRENT_CHAPTER_FIELD"].cpp_type = 10
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].name = "daily_repair_count"
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].full_name = "p13.sc_13001.daily_repair_count"
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].number = 3
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].index = 2
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].label = 2
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].has_default_value = false
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].default_value = 0
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].type = 13
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"].cpp_type = 3
()["SC_13001_REACT_CHAPTER_FIELD"].name = "react_chapter"
()["SC_13001_REACT_CHAPTER_FIELD"].full_name = "p13.sc_13001.react_chapter"
()["SC_13001_REACT_CHAPTER_FIELD"].number = 4
()["SC_13001_REACT_CHAPTER_FIELD"].index = 3
()["SC_13001_REACT_CHAPTER_FIELD"].label = 1
()["SC_13001_REACT_CHAPTER_FIELD"].has_default_value = false
()["SC_13001_REACT_CHAPTER_FIELD"].default_value = nil
()["SC_13001_REACT_CHAPTER_FIELD"].message_type = REACTCHAPTER_INFO
()["SC_13001_REACT_CHAPTER_FIELD"].type = 11
()["SC_13001_REACT_CHAPTER_FIELD"].cpp_type = 10
()["SC_13001_FLEET_LIST_FIELD"].name = "fleet_list"
()["SC_13001_FLEET_LIST_FIELD"].full_name = "p13.sc_13001.fleet_list"
()["SC_13001_FLEET_LIST_FIELD"].number = 5
()["SC_13001_FLEET_LIST_FIELD"].index = 4
()["SC_13001_FLEET_LIST_FIELD"].label = 3
()["SC_13001_FLEET_LIST_FIELD"].has_default_value = false
()["SC_13001_FLEET_LIST_FIELD"].default_value = {}
()["SC_13001_FLEET_LIST_FIELD"].message_type = ELITEFLEETINFO
()["SC_13001_FLEET_LIST_FIELD"].type = 11
()["SC_13001_FLEET_LIST_FIELD"].cpp_type = 10
SC_13001.name = "sc_13001"
SC_13001.full_name = "p13.sc_13001"
SC_13001.nested_types = {}
SC_13001.enum_types = {}
SC_13001.fields = {
()["SC_13001_CHAPTER_LIST_FIELD"],
()["SC_13001_CURRENT_CHAPTER_FIELD"],
()["SC_13001_DAILY_REPAIR_COUNT_FIELD"],
()["SC_13001_REACT_CHAPTER_FIELD"],
()["SC_13001_FLEET_LIST_FIELD"]
}
SC_13001.is_extendable = false
SC_13001.extensions = {}
()["SC_13002_COLLECTION_LIST_FIELD"].name = "collection_list"
()["SC_13002_COLLECTION_LIST_FIELD"].full_name = "p13.sc_13002.collection_list"
()["SC_13002_COLLECTION_LIST_FIELD"].number = 1
()["SC_13002_COLLECTION_LIST_FIELD"].index = 0
()["SC_13002_COLLECTION_LIST_FIELD"].label = 3
()["SC_13002_COLLECTION_LIST_FIELD"].has_default_value = false
()["SC_13002_COLLECTION_LIST_FIELD"].default_value = {}
()["SC_13002_COLLECTION_LIST_FIELD"].message_type = slot1.COLLECTIONINFO
()["SC_13002_COLLECTION_LIST_FIELD"].type = 11
()["SC_13002_COLLECTION_LIST_FIELD"].cpp_type = 10
()["SC_13002_MAX_TEAM_FIELD"].name = "max_team"
()["SC_13002_MAX_TEAM_FIELD"].full_name = "p13.sc_13002.max_team"
()["SC_13002_MAX_TEAM_FIELD"].number = 2
()["SC_13002_MAX_TEAM_FIELD"].index = 1
()["SC_13002_MAX_TEAM_FIELD"].label = 2
()["SC_13002_MAX_TEAM_FIELD"].has_default_value = false
()["SC_13002_MAX_TEAM_FIELD"].default_value = 0
()["SC_13002_MAX_TEAM_FIELD"].type = 13
()["SC_13002_MAX_TEAM_FIELD"].cpp_type = 3
SC_13002.name = "sc_13002"
SC_13002.full_name = "p13.sc_13002"
SC_13002.nested_types = {}
SC_13002.enum_types = {}
SC_13002.fields = {
()["SC_13002_COLLECTION_LIST_FIELD"],
()["SC_13002_MAX_TEAM_FIELD"]
}
SC_13002.is_extendable = false
SC_13002.extensions = {}
()["CS_13003_ID_FIELD"].name = "id"
()["CS_13003_ID_FIELD"].full_name = "p13.cs_13003.id"
()["CS_13003_ID_FIELD"].number = 1
()["CS_13003_ID_FIELD"].index = 0
()["CS_13003_ID_FIELD"].label = 2
()["CS_13003_ID_FIELD"].has_default_value = false
()["CS_13003_ID_FIELD"].default_value = 0
()["CS_13003_ID_FIELD"].type = 13
()["CS_13003_ID_FIELD"].cpp_type = 3
()["CS_13003_SHIP_ID_LIST_FIELD"].name = "ship_id_list"
()["CS_13003_SHIP_ID_LIST_FIELD"].full_name = "p13.cs_13003.ship_id_list"
()["CS_13003_SHIP_ID_LIST_FIELD"].number = 2
()["CS_13003_SHIP_ID_LIST_FIELD"].index = 1
()["CS_13003_SHIP_ID_LIST_FIELD"].label = 3
()["CS_13003_SHIP_ID_LIST_FIELD"].has_default_value = false
()["CS_13003_SHIP_ID_LIST_FIELD"].default_value = {}
()["CS_13003_SHIP_ID_LIST_FIELD"].type = 13
()["CS_13003_SHIP_ID_LIST_FIELD"].cpp_type = 3
CS_13003.name = "cs_13003"
CS_13003.full_name = "p13.cs_13003"
CS_13003.nested_types = {}
CS_13003.enum_types = {}
CS_13003.fields = {
()["CS_13003_ID_FIELD"],
()["CS_13003_SHIP_ID_LIST_FIELD"]
}
CS_13003.is_extendable = false
CS_13003.extensions = {}
()["SC_13004_RESULT_FIELD"].name = "result"
()["SC_13004_RESULT_FIELD"].full_name = "p13.sc_13004.result"
()["SC_13004_RESULT_FIELD"].number = 1
()["SC_13004_RESULT_FIELD"].index = 0
()["SC_13004_RESULT_FIELD"].label = 2
()["SC_13004_RESULT_FIELD"].has_default_value = false
()["SC_13004_RESULT_FIELD"].default_value = 0
()["SC_13004_RESULT_FIELD"].type = 13
()["SC_13004_RESULT_FIELD"].cpp_type = 3
SC_13004.name = "sc_13004"
SC_13004.full_name = "p13.sc_13004"
SC_13004.nested_types = {}
SC_13004.enum_types = {}
SC_13004.fields = {
()["SC_13004_RESULT_FIELD"]
}
SC_13004.is_extendable = false
SC_13004.extensions = {}
()["CS_13005_ID_FIELD"].name = "id"
()["CS_13005_ID_FIELD"].full_name = "p13.cs_13005.id"
()["CS_13005_ID_FIELD"].number = 1
()["CS_13005_ID_FIELD"].index = 0
()["CS_13005_ID_FIELD"].label = 2
()["CS_13005_ID_FIELD"].has_default_value = false
()["CS_13005_ID_FIELD"].default_value = 0
()["CS_13005_ID_FIELD"].type = 13
()["CS_13005_ID_FIELD"].cpp_type = 3
CS_13005.name = "cs_13005"
CS_13005.full_name = "p13.cs_13005"
CS_13005.nested_types = {}
CS_13005.enum_types = {}
CS_13005.fields = {
()["CS_13005_ID_FIELD"]
}
CS_13005.is_extendable = false
CS_13005.extensions = {}
()["SC_13006_RESULT_FIELD"].name = "result"
()["SC_13006_RESULT_FIELD"].full_name = "p13.sc_13006.result"
()["SC_13006_RESULT_FIELD"].number = 1
()["SC_13006_RESULT_FIELD"].index = 0
()["SC_13006_RESULT_FIELD"].label = 2
()["SC_13006_RESULT_FIELD"].has_default_value = false
()["SC_13006_RESULT_FIELD"].default_value = 0
()["SC_13006_RESULT_FIELD"].type = 13
()["SC_13006_RESULT_FIELD"].cpp_type = 3
()["SC_13006_EXP_FIELD"].name = "exp"
()["SC_13006_EXP_FIELD"].full_name = "p13.sc_13006.exp"
()["SC_13006_EXP_FIELD"].number = 2
()["SC_13006_EXP_FIELD"].index = 1
()["SC_13006_EXP_FIELD"].label = 2
()["SC_13006_EXP_FIELD"].has_default_value = false
()["SC_13006_EXP_FIELD"].default_value = 0
()["SC_13006_EXP_FIELD"].type = 13
()["SC_13006_EXP_FIELD"].cpp_type = 3
()["SC_13006_DROP_LIST_FIELD"].name = "drop_list"
()["SC_13006_DROP_LIST_FIELD"].full_name = "p13.sc_13006.drop_list"
()["SC_13006_DROP_LIST_FIELD"].number = 3
()["SC_13006_DROP_LIST_FIELD"].index = 2
()["SC_13006_DROP_LIST_FIELD"].label = 3
()["SC_13006_DROP_LIST_FIELD"].has_default_value = false
()["SC_13006_DROP_LIST_FIELD"].default_value = {}
()["SC_13006_DROP_LIST_FIELD"].message_type = slot1.DROPINFO
()["SC_13006_DROP_LIST_FIELD"].type = 11
()["SC_13006_DROP_LIST_FIELD"].cpp_type = 10
()["SC_13006_NEW_COLLECTION_FIELD"].name = "new_collection"
()["SC_13006_NEW_COLLECTION_FIELD"].full_name = "p13.sc_13006.new_collection"
()["SC_13006_NEW_COLLECTION_FIELD"].number = 4
()["SC_13006_NEW_COLLECTION_FIELD"].index = 3
()["SC_13006_NEW_COLLECTION_FIELD"].label = 3
()["SC_13006_NEW_COLLECTION_FIELD"].has_default_value = false
()["SC_13006_NEW_COLLECTION_FIELD"].default_value = {}
()["SC_13006_NEW_COLLECTION_FIELD"].message_type = slot1.COLLECTIONINFO
()["SC_13006_NEW_COLLECTION_FIELD"].type = 11
()["SC_13006_NEW_COLLECTION_FIELD"].cpp_type = 10
()["SC_13006_IS_CRI_FIELD"].name = "is_cri"
()["SC_13006_IS_CRI_FIELD"].full_name = "p13.sc_13006.is_cri"
()["SC_13006_IS_CRI_FIELD"].number = 5
()["SC_13006_IS_CRI_FIELD"].index = 4
()["SC_13006_IS_CRI_FIELD"].label = 2
()["SC_13006_IS_CRI_FIELD"].has_default_value = false
()["SC_13006_IS_CRI_FIELD"].default_value = 0
()["SC_13006_IS_CRI_FIELD"].type = 13
()["SC_13006_IS_CRI_FIELD"].cpp_type = 3
SC_13006.name = "sc_13006"
SC_13006.full_name = "p13.sc_13006"
SC_13006.nested_types = {}
SC_13006.enum_types = {}
SC_13006.fields = {
()["SC_13006_RESULT_FIELD"],
()["SC_13006_EXP_FIELD"],
()["SC_13006_DROP_LIST_FIELD"],
()["SC_13006_NEW_COLLECTION_FIELD"],
()["SC_13006_IS_CRI_FIELD"]
}
SC_13006.is_extendable = false
SC_13006.extensions = {}
()["CS_13007_ID_FIELD"].name = "id"
()["CS_13007_ID_FIELD"].full_name = "p13.cs_13007.id"
()["CS_13007_ID_FIELD"].number = 1
()["CS_13007_ID_FIELD"].index = 0
()["CS_13007_ID_FIELD"].label = 2
()["CS_13007_ID_FIELD"].has_default_value = false
()["CS_13007_ID_FIELD"].default_value = 0
()["CS_13007_ID_FIELD"].type = 13
()["CS_13007_ID_FIELD"].cpp_type = 3
CS_13007.name = "cs_13007"
CS_13007.full_name = "p13.cs_13007"
CS_13007.nested_types = {}
CS_13007.enum_types = {}
CS_13007.fields = {
()["CS_13007_ID_FIELD"]
}
CS_13007.is_extendable = false
CS_13007.extensions = {}
()["SC_13008_RESULT_FIELD"].name = "result"
()["SC_13008_RESULT_FIELD"].full_name = "p13.sc_13008.result"
()["SC_13008_RESULT_FIELD"].number = 1
()["SC_13008_RESULT_FIELD"].index = 0
()["SC_13008_RESULT_FIELD"].label = 2
()["SC_13008_RESULT_FIELD"].has_default_value = false
()["SC_13008_RESULT_FIELD"].default_value = 0
()["SC_13008_RESULT_FIELD"].type = 13
()["SC_13008_RESULT_FIELD"].cpp_type = 3
SC_13008.name = "sc_13008"
SC_13008.full_name = "p13.sc_13008"
SC_13008.nested_types = {}
SC_13008.enum_types = {}
SC_13008.fields = {
()["SC_13008_RESULT_FIELD"]
}
SC_13008.is_extendable = false
SC_13008.extensions = {}
()["CS_13009_TYPE_FIELD"].name = "type"
()["CS_13009_TYPE_FIELD"].full_name = "p13.cs_13009.type"
()["CS_13009_TYPE_FIELD"].number = 1
()["CS_13009_TYPE_FIELD"].index = 0
()["CS_13009_TYPE_FIELD"].label = 2
()["CS_13009_TYPE_FIELD"].has_default_value = false
()["CS_13009_TYPE_FIELD"].default_value = 0
()["CS_13009_TYPE_FIELD"].type = 13
()["CS_13009_TYPE_FIELD"].cpp_type = 3
CS_13009.name = "cs_13009"
CS_13009.full_name = "p13.cs_13009"
CS_13009.nested_types = {}
CS_13009.enum_types = {}
CS_13009.fields = {
()["CS_13009_TYPE_FIELD"]
}
CS_13009.is_extendable = false
CS_13009.extensions = {}
()["SC_13010_RESULT_FIELD"].name = "result"
()["SC_13010_RESULT_FIELD"].full_name = "p13.sc_13010.result"
()["SC_13010_RESULT_FIELD"].number = 1
()["SC_13010_RESULT_FIELD"].index = 0
()["SC_13010_RESULT_FIELD"].label = 2
()["SC_13010_RESULT_FIELD"].has_default_value = false
()["SC_13010_RESULT_FIELD"].default_value = 0
()["SC_13010_RESULT_FIELD"].type = 13
()["SC_13010_RESULT_FIELD"].cpp_type = 3
()["SC_13010_COLLECTION_LIST_FIELD"].name = "collection_list"
()["SC_13010_COLLECTION_LIST_FIELD"].full_name = "p13.sc_13010.collection_list"
()["SC_13010_COLLECTION_LIST_FIELD"].number = 2
()["SC_13010_COLLECTION_LIST_FIELD"].index = 1
()["SC_13010_COLLECTION_LIST_FIELD"].label = 3
()["SC_13010_COLLECTION_LIST_FIELD"].has_default_value = false
()["SC_13010_COLLECTION_LIST_FIELD"].default_value = {}
()["SC_13010_COLLECTION_LIST_FIELD"].message_type = slot1.COLLECTIONINFO
()["SC_13010_COLLECTION_LIST_FIELD"].type = 11
()["SC_13010_COLLECTION_LIST_FIELD"].cpp_type = 10
SC_13010.name = "sc_13010"
SC_13010.full_name = "p13.sc_13010"
SC_13010.nested_types = {}
SC_13010.enum_types = {}
SC_13010.fields = {
()["SC_13010_RESULT_FIELD"],
()["SC_13010_COLLECTION_LIST_FIELD"]
}
SC_13010.is_extendable = false
SC_13010.extensions = {}
()["SC_13011_COLLECTION_FIELD"].name = "collection"
()["SC_13011_COLLECTION_FIELD"].full_name = "p13.sc_13011.collection"
()["SC_13011_COLLECTION_FIELD"].number = 1
()["SC_13011_COLLECTION_FIELD"].index = 0
()["SC_13011_COLLECTION_FIELD"].label = 3
()["SC_13011_COLLECTION_FIELD"].has_default_value = false
()["SC_13011_COLLECTION_FIELD"].default_value = {}
()["SC_13011_COLLECTION_FIELD"].message_type = slot1.COLLECTIONINFO
()["SC_13011_COLLECTION_FIELD"].type = 11
()["SC_13011_COLLECTION_FIELD"].cpp_type = 10
SC_13011.name = "sc_13011"
SC_13011.full_name = "p13.sc_13011"
SC_13011.nested_types = {}
SC_13011.enum_types = {}
SC_13011.fields = {
()["SC_13011_COLLECTION_FIELD"]
}
SC_13011.is_extendable = false
SC_13011.extensions = {}
()["CS_13101_ID_FIELD"].name = "id"
()["CS_13101_ID_FIELD"].full_name = "p13.cs_13101.id"
()["CS_13101_ID_FIELD"].number = 1
()["CS_13101_ID_FIELD"].index = 0
()["CS_13101_ID_FIELD"].label = 2
()["CS_13101_ID_FIELD"].has_default_value = false
()["CS_13101_ID_FIELD"].default_value = 0
()["CS_13101_ID_FIELD"].type = 13
()["CS_13101_ID_FIELD"].cpp_type = 3
()["CS_13101_GROUP_ID_LIST_FIELD"].name = "group_id_list"
()["CS_13101_GROUP_ID_LIST_FIELD"].full_name = "p13.cs_13101.group_id_list"
()["CS_13101_GROUP_ID_LIST_FIELD"].number = 2
()["CS_13101_GROUP_ID_LIST_FIELD"].index = 1
()["CS_13101_GROUP_ID_LIST_FIELD"].label = 3
()["CS_13101_GROUP_ID_LIST_FIELD"].has_default_value = false
()["CS_13101_GROUP_ID_LIST_FIELD"].default_value = {}
()["CS_13101_GROUP_ID_LIST_FIELD"].type = 13
()["CS_13101_GROUP_ID_LIST_FIELD"].cpp_type = 3
()["CS_13101_ELITE_FLEET_LIST_FIELD"].name = "elite_fleet_list"
()["CS_13101_ELITE_FLEET_LIST_FIELD"].full_name = "p13.cs_13101.elite_fleet_list"
()["CS_13101_ELITE_FLEET_LIST_FIELD"].number = 3
()["CS_13101_ELITE_FLEET_LIST_FIELD"].index = 2
()["CS_13101_ELITE_FLEET_LIST_FIELD"].label = 3
()["CS_13101_ELITE_FLEET_LIST_FIELD"].has_default_value = false
()["CS_13101_ELITE_FLEET_LIST_FIELD"].default_value = {}
()["CS_13101_ELITE_FLEET_LIST_FIELD"].message_type = ELITEFLEETINFO
()["CS_13101_ELITE_FLEET_LIST_FIELD"].type = 11
()["CS_13101_ELITE_FLEET_LIST_FIELD"].cpp_type = 10
()["CS_13101_OPERATION_ITEM_FIELD"].name = "operation_item"
()["CS_13101_OPERATION_ITEM_FIELD"].full_name = "p13.cs_13101.operation_item"
()["CS_13101_OPERATION_ITEM_FIELD"].number = 4
()["CS_13101_OPERATION_ITEM_FIELD"].index = 3
()["CS_13101_OPERATION_ITEM_FIELD"].label = 1
()["CS_13101_OPERATION_ITEM_FIELD"].has_default_value = false
()["CS_13101_OPERATION_ITEM_FIELD"].default_value = 0
()["CS_13101_OPERATION_ITEM_FIELD"].type = 13
()["CS_13101_OPERATION_ITEM_FIELD"].cpp_type = 3
()["CS_13101_LOOP_FLAG_FIELD"].name = "loop_flag"
()["CS_13101_LOOP_FLAG_FIELD"].full_name = "p13.cs_13101.loop_flag"
()["CS_13101_LOOP_FLAG_FIELD"].number = 5
()["CS_13101_LOOP_FLAG_FIELD"].index = 4
()["CS_13101_LOOP_FLAG_FIELD"].label = 1
()["CS_13101_LOOP_FLAG_FIELD"].has_default_value = false
()["CS_13101_LOOP_FLAG_FIELD"].default_value = 0
()["CS_13101_LOOP_FLAG_FIELD"].type = 13
()["CS_13101_LOOP_FLAG_FIELD"].cpp_type = 3
()["CS_13101_FLEET_DUTIES_FIELD"].name = "fleet_duties"
()["CS_13101_FLEET_DUTIES_FIELD"].full_name = "p13.cs_13101.fleet_duties"
()["CS_13101_FLEET_DUTIES_FIELD"].number = 6
()["CS_13101_FLEET_DUTIES_FIELD"].index = 5
()["CS_13101_FLEET_DUTIES_FIELD"].label = 3
()["CS_13101_FLEET_DUTIES_FIELD"].has_default_value = false
()["CS_13101_FLEET_DUTIES_FIELD"].default_value = {}
()["CS_13101_FLEET_DUTIES_FIELD"].message_type = FLEETDUTYKEYVALUEPAIR
()["CS_13101_FLEET_DUTIES_FIELD"].type = 11
()["CS_13101_FLEET_DUTIES_FIELD"].cpp_type = 10
CS_13101.name = "cs_13101"
CS_13101.full_name = "p13.cs_13101"
CS_13101.nested_types = {}
CS_13101.enum_types = {}
CS_13101.fields = {
()["CS_13101_ID_FIELD"],
()["CS_13101_GROUP_ID_LIST_FIELD"],
()["CS_13101_ELITE_FLEET_LIST_FIELD"],
()["CS_13101_OPERATION_ITEM_FIELD"],
()["CS_13101_LOOP_FLAG_FIELD"],
()["CS_13101_FLEET_DUTIES_FIELD"]
}
CS_13101.is_extendable = false
CS_13101.extensions = {}
()["SC_13102_RESULT_FIELD"].name = "result"
()["SC_13102_RESULT_FIELD"].full_name = "p13.sc_13102.result"
()["SC_13102_RESULT_FIELD"].number = 1
()["SC_13102_RESULT_FIELD"].index = 0
()["SC_13102_RESULT_FIELD"].label = 2
()["SC_13102_RESULT_FIELD"].has_default_value = false
()["SC_13102_RESULT_FIELD"].default_value = 0
()["SC_13102_RESULT_FIELD"].type = 13
()["SC_13102_RESULT_FIELD"].cpp_type = 3
()["SC_13102_CURRENT_CHAPTER_FIELD"].name = "current_chapter"
()["SC_13102_CURRENT_CHAPTER_FIELD"].full_name = "p13.sc_13102.current_chapter"
()["SC_13102_CURRENT_CHAPTER_FIELD"].number = 2
()["SC_13102_CURRENT_CHAPTER_FIELD"].index = 1
()["SC_13102_CURRENT_CHAPTER_FIELD"].label = 1
()["SC_13102_CURRENT_CHAPTER_FIELD"].has_default_value = false
()["SC_13102_CURRENT_CHAPTER_FIELD"].default_value = nil
()["SC_13102_CURRENT_CHAPTER_FIELD"].message_type = CURRENTCHAPTERINFO
()["SC_13102_CURRENT_CHAPTER_FIELD"].type = 11
()["SC_13102_CURRENT_CHAPTER_FIELD"].cpp_type = 10
SC_13102.name = "sc_13102"
SC_13102.full_name = "p13.sc_13102"
SC_13102.nested_types = {}
SC_13102.enum_types = {}
SC_13102.fields = {
()["SC_13102_RESULT_FIELD"],
()["SC_13102_CURRENT_CHAPTER_FIELD"]
}
SC_13102.is_extendable = false
SC_13102.extensions = {}
()["CS_13103_ACT_FIELD"].name = "act"
()["CS_13103_ACT_FIELD"].full_name = "p13.cs_13103.act"
()["CS_13103_ACT_FIELD"].number = 1
()["CS_13103_ACT_FIELD"].index = 0
()["CS_13103_ACT_FIELD"].label = 2
()["CS_13103_ACT_FIELD"].has_default_value = false
()["CS_13103_ACT_FIELD"].default_value = 0
()["CS_13103_ACT_FIELD"].type = 13
()["CS_13103_ACT_FIELD"].cpp_type = 3
()["CS_13103_GROUP_ID_FIELD"].name = "group_id"
()["CS_13103_GROUP_ID_FIELD"].full_name = "p13.cs_13103.group_id"
()["CS_13103_GROUP_ID_FIELD"].number = 2
()["CS_13103_GROUP_ID_FIELD"].index = 1
()["CS_13103_GROUP_ID_FIELD"].label = 2
()["CS_13103_GROUP_ID_FIELD"].has_default_value = false
()["CS_13103_GROUP_ID_FIELD"].default_value = 0
()["CS_13103_GROUP_ID_FIELD"].type = 13
()["CS_13103_GROUP_ID_FIELD"].cpp_type = 3
()["CS_13103_ACT_ARG_1_FIELD"].name = "act_arg_1"
()["CS_13103_ACT_ARG_1_FIELD"].full_name = "p13.cs_13103.act_arg_1"
()["CS_13103_ACT_ARG_1_FIELD"].number = 3
()["CS_13103_ACT_ARG_1_FIELD"].index = 2
()["CS_13103_ACT_ARG_1_FIELD"].label = 1
()["CS_13103_ACT_ARG_1_FIELD"].has_default_value = false
()["CS_13103_ACT_ARG_1_FIELD"].default_value = 0
()["CS_13103_ACT_ARG_1_FIELD"].type = 13
()["CS_13103_ACT_ARG_1_FIELD"].cpp_type = 3
()["CS_13103_ACT_ARG_2_FIELD"].name = "act_arg_2"
()["CS_13103_ACT_ARG_2_FIELD"].full_name = "p13.cs_13103.act_arg_2"
()["CS_13103_ACT_ARG_2_FIELD"].number = 4
()["CS_13103_ACT_ARG_2_FIELD"].index = 3
()["CS_13103_ACT_ARG_2_FIELD"].label = 1
()["CS_13103_ACT_ARG_2_FIELD"].has_default_value = false
()["CS_13103_ACT_ARG_2_FIELD"].default_value = 0
()["CS_13103_ACT_ARG_2_FIELD"].type = 13
()["CS_13103_ACT_ARG_2_FIELD"].cpp_type = 3
CS_13103.name = "cs_13103"
CS_13103.full_name = "p13.cs_13103"
CS_13103.nested_types = {}
CS_13103.enum_types = {}
CS_13103.fields = {
()["CS_13103_ACT_FIELD"],
()["CS_13103_GROUP_ID_FIELD"],
()["CS_13103_ACT_ARG_1_FIELD"],
()["CS_13103_ACT_ARG_2_FIELD"]
}
CS_13103.is_extendable = false
CS_13103.extensions = {}
()["SC_13104_RESULT_FIELD"].name = "result"
()["SC_13104_RESULT_FIELD"].full_name = "p13.sc_13104.result"
()["SC_13104_RESULT_FIELD"].number = 1
()["SC_13104_RESULT_FIELD"].index = 0
()["SC_13104_RESULT_FIELD"].label = 2
()["SC_13104_RESULT_FIELD"].has_default_value = false
()["SC_13104_RESULT_FIELD"].default_value = 0
()["SC_13104_RESULT_FIELD"].type = 13
()["SC_13104_RESULT_FIELD"].cpp_type = 3
()["SC_13104_MOVE_PATH_FIELD"].name = "move_path"
()["SC_13104_MOVE_PATH_FIELD"].full_name = "p13.sc_13104.move_path"
()["SC_13104_MOVE_PATH_FIELD"].number = 2
()["SC_13104_MOVE_PATH_FIELD"].index = 1
()["SC_13104_MOVE_PATH_FIELD"].label = 3
()["SC_13104_MOVE_PATH_FIELD"].has_default_value = false
()["SC_13104_MOVE_PATH_FIELD"].default_value = {}
()["SC_13104_MOVE_PATH_FIELD"].message_type = CHAPTERCELLPOS
()["SC_13104_MOVE_PATH_FIELD"].type = 11
()["SC_13104_MOVE_PATH_FIELD"].cpp_type = 10
()["SC_13104_DROP_LIST_FIELD"].name = "drop_list"
()["SC_13104_DROP_LIST_FIELD"].full_name = "p13.sc_13104.drop_list"
()["SC_13104_DROP_LIST_FIELD"].number = 3
()["SC_13104_DROP_LIST_FIELD"].index = 2
()["SC_13104_DROP_LIST_FIELD"].label = 3
()["SC_13104_DROP_LIST_FIELD"].has_default_value = false
()["SC_13104_DROP_LIST_FIELD"].default_value = {}
()["SC_13104_DROP_LIST_FIELD"].message_type = slot1.DROPINFO
()["SC_13104_DROP_LIST_FIELD"].type = 11
()["SC_13104_DROP_LIST_FIELD"].cpp_type = 10
()["SC_13104_MAP_UPDATE_FIELD"].name = "map_update"
()["SC_13104_MAP_UPDATE_FIELD"].full_name = "p13.sc_13104.map_update"
()["SC_13104_MAP_UPDATE_FIELD"].number = 4
()["SC_13104_MAP_UPDATE_FIELD"].index = 3
()["SC_13104_MAP_UPDATE_FIELD"].label = 3
()["SC_13104_MAP_UPDATE_FIELD"].has_default_value = false
()["SC_13104_MAP_UPDATE_FIELD"].default_value = {}
()["SC_13104_MAP_UPDATE_FIELD"].message_type = CHAPTERCELLINFO
()["SC_13104_MAP_UPDATE_FIELD"].type = 11
()["SC_13104_MAP_UPDATE_FIELD"].cpp_type = 10
()["SC_13104_SHIP_UPDATE_FIELD"].name = "ship_update"
()["SC_13104_SHIP_UPDATE_FIELD"].full_name = "p13.sc_13104.ship_update"
()["SC_13104_SHIP_UPDATE_FIELD"].number = 5
()["SC_13104_SHIP_UPDATE_FIELD"].index = 4
()["SC_13104_SHIP_UPDATE_FIELD"].label = 3
()["SC_13104_SHIP_UPDATE_FIELD"].has_default_value = false
()["SC_13104_SHIP_UPDATE_FIELD"].default_value = {}
()["SC_13104_SHIP_UPDATE_FIELD"].message_type = SHIPINCHAPTER
()["SC_13104_SHIP_UPDATE_FIELD"].type = 11
()["SC_13104_SHIP_UPDATE_FIELD"].cpp_type = 10
()["SC_13104_AI_LIST_FIELD"].name = "ai_list"
()["SC_13104_AI_LIST_FIELD"].full_name = "p13.sc_13104.ai_list"
()["SC_13104_AI_LIST_FIELD"].number = 6
()["SC_13104_AI_LIST_FIELD"].index = 5
()["SC_13104_AI_LIST_FIELD"].label = 3
()["SC_13104_AI_LIST_FIELD"].has_default_value = false
()["SC_13104_AI_LIST_FIELD"].default_value = {}
()["SC_13104_AI_LIST_FIELD"].message_type = CHAPTERCELLINFO
()["SC_13104_AI_LIST_FIELD"].type = 11
()["SC_13104_AI_LIST_FIELD"].cpp_type = 10
()["SC_13104_AI_ACT_LIST_FIELD"].name = "ai_act_list"
()["SC_13104_AI_ACT_LIST_FIELD"].full_name = "p13.sc_13104.ai_act_list"
()["SC_13104_AI_ACT_LIST_FIELD"].number = 7
()["SC_13104_AI_ACT_LIST_FIELD"].index = 6
()["SC_13104_AI_ACT_LIST_FIELD"].label = 3
()["SC_13104_AI_ACT_LIST_FIELD"].has_default_value = false
()["SC_13104_AI_ACT_LIST_FIELD"].default_value = {}
()["SC_13104_AI_ACT_LIST_FIELD"].message_type = AI_ACT
()["SC_13104_AI_ACT_LIST_FIELD"].type = 11
()["SC_13104_AI_ACT_LIST_FIELD"].cpp_type = 10
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].name = "submarine_act_list"
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].full_name = "p13.sc_13104.submarine_act_list"
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].number = 8
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].index = 7
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].label = 3
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].has_default_value = false
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].default_value = {}
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].message_type = AI_ACT
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].type = 11
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"].cpp_type = 10
()["SC_13104_ESCORT_ACT_LIST_FIELD"].name = "escort_act_list"
()["SC_13104_ESCORT_ACT_LIST_FIELD"].full_name = "p13.sc_13104.escort_act_list"
()["SC_13104_ESCORT_ACT_LIST_FIELD"].number = 9
()["SC_13104_ESCORT_ACT_LIST_FIELD"].index = 8
()["SC_13104_ESCORT_ACT_LIST_FIELD"].label = 3
()["SC_13104_ESCORT_ACT_LIST_FIELD"].has_default_value = false
()["SC_13104_ESCORT_ACT_LIST_FIELD"].default_value = {}
()["SC_13104_ESCORT_ACT_LIST_FIELD"].message_type = AI_ACT
()["SC_13104_ESCORT_ACT_LIST_FIELD"].type = 11
()["SC_13104_ESCORT_ACT_LIST_FIELD"].cpp_type = 10
()["SC_13104_FLEET_ACT_LIST_FIELD"].name = "fleet_act_list"
()["SC_13104_FLEET_ACT_LIST_FIELD"].full_name = "p13.sc_13104.fleet_act_list"
()["SC_13104_FLEET_ACT_LIST_FIELD"].number = 10
()["SC_13104_FLEET_ACT_LIST_FIELD"].index = 9
()["SC_13104_FLEET_ACT_LIST_FIELD"].label = 3
()["SC_13104_FLEET_ACT_LIST_FIELD"].has_default_value = false
()["SC_13104_FLEET_ACT_LIST_FIELD"].default_value = {}
()["SC_13104_FLEET_ACT_LIST_FIELD"].message_type = AI_ACT
()["SC_13104_FLEET_ACT_LIST_FIELD"].type = 11
()["SC_13104_FLEET_ACT_LIST_FIELD"].cpp_type = 10
()["SC_13104_BUFF_LIST_FIELD"].name = "buff_list"
()["SC_13104_BUFF_LIST_FIELD"].full_name = "p13.sc_13104.buff_list"
()["SC_13104_BUFF_LIST_FIELD"].number = 11
()["SC_13104_BUFF_LIST_FIELD"].index = 10
()["SC_13104_BUFF_LIST_FIELD"].label = 3
()["SC_13104_BUFF_LIST_FIELD"].has_default_value = false
()["SC_13104_BUFF_LIST_FIELD"].default_value = {}
()["SC_13104_BUFF_LIST_FIELD"].type = 13
()["SC_13104_BUFF_LIST_FIELD"].cpp_type = 3
()["SC_13104_ADD_FLAG_LIST_FIELD"].name = "add_flag_list"
()["SC_13104_ADD_FLAG_LIST_FIELD"].full_name = "p13.sc_13104.add_flag_list"
()["SC_13104_ADD_FLAG_LIST_FIELD"].number = 12
()["SC_13104_ADD_FLAG_LIST_FIELD"].index = 11
()["SC_13104_ADD_FLAG_LIST_FIELD"].label = 3
()["SC_13104_ADD_FLAG_LIST_FIELD"].has_default_value = false
()["SC_13104_ADD_FLAG_LIST_FIELD"].default_value = {}
()["SC_13104_ADD_FLAG_LIST_FIELD"].type = 13
()["SC_13104_ADD_FLAG_LIST_FIELD"].cpp_type = 3
()["SC_13104_DEL_FLAG_LIST_FIELD"].name = "del_flag_list"
()["SC_13104_DEL_FLAG_LIST_FIELD"].full_name = "p13.sc_13104.del_flag_list"
()["SC_13104_DEL_FLAG_LIST_FIELD"].number = 13
()["SC_13104_DEL_FLAG_LIST_FIELD"].index = 12
()["SC_13104_DEL_FLAG_LIST_FIELD"].label = 3
()["SC_13104_DEL_FLAG_LIST_FIELD"].has_default_value = false
()["SC_13104_DEL_FLAG_LIST_FIELD"].default_value = {}
()["SC_13104_DEL_FLAG_LIST_FIELD"].type = 13
()["SC_13104_DEL_FLAG_LIST_FIELD"].cpp_type = 3
()["SC_13104_CELL_FLAG_LIST_FIELD"].name = "cell_flag_list"
()["SC_13104_CELL_FLAG_LIST_FIELD"].full_name = "p13.sc_13104.cell_flag_list"
()["SC_13104_CELL_FLAG_LIST_FIELD"].number = 14
()["SC_13104_CELL_FLAG_LIST_FIELD"].index = 13
()["SC_13104_CELL_FLAG_LIST_FIELD"].label = 3
()["SC_13104_CELL_FLAG_LIST_FIELD"].has_default_value = false
()["SC_13104_CELL_FLAG_LIST_FIELD"].default_value = {}
()["SC_13104_CELL_FLAG_LIST_FIELD"].message_type = CELLFLAG
()["SC_13104_CELL_FLAG_LIST_FIELD"].type = 11
()["SC_13104_CELL_FLAG_LIST_FIELD"].cpp_type = 10
SC_13104.name = "sc_13104"
SC_13104.full_name = "p13.sc_13104"
SC_13104.nested_types = {}
SC_13104.enum_types = {}
SC_13104.fields = {
()["SC_13104_RESULT_FIELD"],
()["SC_13104_MOVE_PATH_FIELD"],
()["SC_13104_DROP_LIST_FIELD"],
()["SC_13104_MAP_UPDATE_FIELD"],
()["SC_13104_SHIP_UPDATE_FIELD"],
()["SC_13104_AI_LIST_FIELD"],
()["SC_13104_AI_ACT_LIST_FIELD"],
()["SC_13104_SUBMARINE_ACT_LIST_FIELD"],
()["SC_13104_ESCORT_ACT_LIST_FIELD"],
()["SC_13104_FLEET_ACT_LIST_FIELD"],
()["SC_13104_BUFF_LIST_FIELD"],
()["SC_13104_ADD_FLAG_LIST_FIELD"],
()["SC_13104_DEL_FLAG_LIST_FIELD"],
()["SC_13104_CELL_FLAG_LIST_FIELD"]
}
SC_13104.is_extendable = false
SC_13104.extensions = {}
()["SC_13105_MAP_UPDATE_FIELD"].name = "map_update"
()["SC_13105_MAP_UPDATE_FIELD"].full_name = "p13.sc_13105.map_update"
()["SC_13105_MAP_UPDATE_FIELD"].number = 1
()["SC_13105_MAP_UPDATE_FIELD"].index = 0
()["SC_13105_MAP_UPDATE_FIELD"].label = 3
()["SC_13105_MAP_UPDATE_FIELD"].has_default_value = false
()["SC_13105_MAP_UPDATE_FIELD"].default_value = {}
()["SC_13105_MAP_UPDATE_FIELD"].message_type = CHAPTERCELLINFO
()["SC_13105_MAP_UPDATE_FIELD"].type = 11
()["SC_13105_MAP_UPDATE_FIELD"].cpp_type = 10
()["SC_13105_AI_LIST_FIELD"].name = "ai_list"
()["SC_13105_AI_LIST_FIELD"].full_name = "p13.sc_13105.ai_list"
()["SC_13105_AI_LIST_FIELD"].number = 2
()["SC_13105_AI_LIST_FIELD"].index = 1
()["SC_13105_AI_LIST_FIELD"].label = 3
()["SC_13105_AI_LIST_FIELD"].has_default_value = false
()["SC_13105_AI_LIST_FIELD"].default_value = {}
()["SC_13105_AI_LIST_FIELD"].message_type = CHAPTERCELLINFO
()["SC_13105_AI_LIST_FIELD"].type = 11
()["SC_13105_AI_LIST_FIELD"].cpp_type = 10
()["SC_13105_ADD_FLAG_LIST_FIELD"].name = "add_flag_list"
()["SC_13105_ADD_FLAG_LIST_FIELD"].full_name = "p13.sc_13105.add_flag_list"
()["SC_13105_ADD_FLAG_LIST_FIELD"].number = 3
()["SC_13105_ADD_FLAG_LIST_FIELD"].index = 2
()["SC_13105_ADD_FLAG_LIST_FIELD"].label = 3
()["SC_13105_ADD_FLAG_LIST_FIELD"].has_default_value = false
()["SC_13105_ADD_FLAG_LIST_FIELD"].default_value = {}
()["SC_13105_ADD_FLAG_LIST_FIELD"].type = 13
()["SC_13105_ADD_FLAG_LIST_FIELD"].cpp_type = 3
()["SC_13105_DEL_FLAG_LIST_FIELD"].name = "del_flag_list"
()["SC_13105_DEL_FLAG_LIST_FIELD"].full_name = "p13.sc_13105.del_flag_list"
()["SC_13105_DEL_FLAG_LIST_FIELD"].number = 4
()["SC_13105_DEL_FLAG_LIST_FIELD"].index = 3
()["SC_13105_DEL_FLAG_LIST_FIELD"].label = 3
()["SC_13105_DEL_FLAG_LIST_FIELD"].has_default_value = false
()["SC_13105_DEL_FLAG_LIST_FIELD"].default_value = {}
()["SC_13105_DEL_FLAG_LIST_FIELD"].type = 13
()["SC_13105_DEL_FLAG_LIST_FIELD"].cpp_type = 3
()["SC_13105_BUFF_LIST_FIELD"].name = "buff_list"
()["SC_13105_BUFF_LIST_FIELD"].full_name = "p13.sc_13105.buff_list"
()["SC_13105_BUFF_LIST_FIELD"].number = 5
()["SC_13105_BUFF_LIST_FIELD"].index = 4
()["SC_13105_BUFF_LIST_FIELD"].label = 3
()["SC_13105_BUFF_LIST_FIELD"].has_default_value = false
()["SC_13105_BUFF_LIST_FIELD"].default_value = {}
()["SC_13105_BUFF_LIST_FIELD"].type = 13
()["SC_13105_BUFF_LIST_FIELD"].cpp_type = 3
SC_13105.name = "sc_13105"
SC_13105.full_name = "p13.sc_13105"
SC_13105.nested_types = {}
SC_13105.enum_types = {}
SC_13105.fields = {
()["SC_13105_MAP_UPDATE_FIELD"],
()["SC_13105_AI_LIST_FIELD"],
()["SC_13105_ADD_FLAG_LIST_FIELD"],
()["SC_13105_DEL_FLAG_LIST_FIELD"],
()["SC_13105_BUFF_LIST_FIELD"]
}
SC_13105.is_extendable = false
SC_13105.extensions = {}
()["CHAPTERINFO_ID_FIELD"].name = "id"
()["CHAPTERINFO_ID_FIELD"].full_name = "p13.chapterinfo.id"
()["CHAPTERINFO_ID_FIELD"].number = 1
()["CHAPTERINFO_ID_FIELD"].index = 0
()["CHAPTERINFO_ID_FIELD"].label = 2
()["CHAPTERINFO_ID_FIELD"].has_default_value = false
()["CHAPTERINFO_ID_FIELD"].default_value = 0
()["CHAPTERINFO_ID_FIELD"].type = 13
()["CHAPTERINFO_ID_FIELD"].cpp_type = 3
()["CHAPTERINFO_PROGRESS_FIELD"].name = "progress"
()["CHAPTERINFO_PROGRESS_FIELD"].full_name = "p13.chapterinfo.progress"
()["CHAPTERINFO_PROGRESS_FIELD"].number = 2
()["CHAPTERINFO_PROGRESS_FIELD"].index = 1
()["CHAPTERINFO_PROGRESS_FIELD"].label = 2
()["CHAPTERINFO_PROGRESS_FIELD"].has_default_value = false
()["CHAPTERINFO_PROGRESS_FIELD"].default_value = 0
()["CHAPTERINFO_PROGRESS_FIELD"].type = 13
()["CHAPTERINFO_PROGRESS_FIELD"].cpp_type = 3
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].name = "kill_boss_count"
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].full_name = "p13.chapterinfo.kill_boss_count"
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].number = 3
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].index = 2
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].label = 2
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].has_default_value = false
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].default_value = 0
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].type = 13
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"].cpp_type = 3
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].name = "kill_enemy_count"
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].full_name = "p13.chapterinfo.kill_enemy_count"
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].number = 4
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].index = 3
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].label = 2
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].has_default_value = false
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].default_value = 0
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].type = 13
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"].cpp_type = 3
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].name = "take_box_count"
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].full_name = "p13.chapterinfo.take_box_count"
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].number = 5
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].index = 4
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].label = 2
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].has_default_value = false
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].default_value = 0
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].type = 13
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"].cpp_type = 3
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].name = "defeat_count"
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].full_name = "p13.chapterinfo.defeat_count"
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].number = 6
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].index = 5
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].label = 2
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].has_default_value = false
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].default_value = 0
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].type = 13
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"].cpp_type = 3
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].name = "today_defeat_count"
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].full_name = "p13.chapterinfo.today_defeat_count"
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].number = 7
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].index = 6
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].label = 2
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].has_default_value = false
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].default_value = 0
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].type = 13
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"].cpp_type = 3
()["CHAPTERINFO_PASS_COUNT_FIELD"].name = "pass_count"
()["CHAPTERINFO_PASS_COUNT_FIELD"].full_name = "p13.chapterinfo.pass_count"
()["CHAPTERINFO_PASS_COUNT_FIELD"].number = 8
()["CHAPTERINFO_PASS_COUNT_FIELD"].index = 7
()["CHAPTERINFO_PASS_COUNT_FIELD"].label = 2
()["CHAPTERINFO_PASS_COUNT_FIELD"].has_default_value = false
()["CHAPTERINFO_PASS_COUNT_FIELD"].default_value = 0
()["CHAPTERINFO_PASS_COUNT_FIELD"].type = 13
()["CHAPTERINFO_PASS_COUNT_FIELD"].cpp_type = 3
CHAPTERINFO.name = "chapterinfo"
CHAPTERINFO.full_name = "p13.chapterinfo"
CHAPTERINFO.nested_types = {}
CHAPTERINFO.enum_types = {}
CHAPTERINFO.fields = {
()["CHAPTERINFO_ID_FIELD"],
()["CHAPTERINFO_PROGRESS_FIELD"],
()["CHAPTERINFO_KILL_BOSS_COUNT_FIELD"],
()["CHAPTERINFO_KILL_ENEMY_COUNT_FIELD"],
()["CHAPTERINFO_TAKE_BOX_COUNT_FIELD"],
()["CHAPTERINFO_DEFEAT_COUNT_FIELD"],
()["CHAPTERINFO_TODAY_DEFEAT_COUNT_FIELD"],
()["CHAPTERINFO_PASS_COUNT_FIELD"]
}
CHAPTERINFO.is_extendable = false
CHAPTERINFO.extensions = {}
()["ELITEFLEETINFO_MAP_ID_FIELD"].name = "map_id"
()["ELITEFLEETINFO_MAP_ID_FIELD"].full_name = "p13.elitefleetinfo.map_id"
()["ELITEFLEETINFO_MAP_ID_FIELD"].number = 1
()["ELITEFLEETINFO_MAP_ID_FIELD"].index = 0
()["ELITEFLEETINFO_MAP_ID_FIELD"].label = 1
()["ELITEFLEETINFO_MAP_ID_FIELD"].has_default_value = false
()["ELITEFLEETINFO_MAP_ID_FIELD"].default_value = 0
()["ELITEFLEETINFO_MAP_ID_FIELD"].type = 13
()["ELITEFLEETINFO_MAP_ID_FIELD"].cpp_type = 3
()["ELITEFLEETINFO_MAIN_ID_FIELD"].name = "main_id"
()["ELITEFLEETINFO_MAIN_ID_FIELD"].full_name = "p13.elitefleetinfo.main_id"
()["ELITEFLEETINFO_MAIN_ID_FIELD"].number = 2
()["ELITEFLEETINFO_MAIN_ID_FIELD"].index = 1
()["ELITEFLEETINFO_MAIN_ID_FIELD"].label = 3
()["ELITEFLEETINFO_MAIN_ID_FIELD"].has_default_value = false
()["ELITEFLEETINFO_MAIN_ID_FIELD"].default_value = {}
()["ELITEFLEETINFO_MAIN_ID_FIELD"].type = 13
()["ELITEFLEETINFO_MAIN_ID_FIELD"].cpp_type = 3
()["ELITEFLEETINFO_COMMANDERS_FIELD"].name = "commanders"
()["ELITEFLEETINFO_COMMANDERS_FIELD"].full_name = "p13.elitefleetinfo.commanders"
()["ELITEFLEETINFO_COMMANDERS_FIELD"].number = 3
()["ELITEFLEETINFO_COMMANDERS_FIELD"].index = 2
()["ELITEFLEETINFO_COMMANDERS_FIELD"].label = 3
()["ELITEFLEETINFO_COMMANDERS_FIELD"].has_default_value = false
()["ELITEFLEETINFO_COMMANDERS_FIELD"].default_value = {}
()["ELITEFLEETINFO_COMMANDERS_FIELD"].message_type = slot1.COMMANDERSINFO
()["ELITEFLEETINFO_COMMANDERS_FIELD"].type = 11
()["ELITEFLEETINFO_COMMANDERS_FIELD"].cpp_type = 10
ELITEFLEETINFO.name = "elitefleetinfo"
ELITEFLEETINFO.full_name = "p13.elitefleetinfo"
ELITEFLEETINFO.nested_types = {}
ELITEFLEETINFO.enum_types = {}
ELITEFLEETINFO.fields = {
()["ELITEFLEETINFO_MAP_ID_FIELD"],
()["ELITEFLEETINFO_MAIN_ID_FIELD"],
()["ELITEFLEETINFO_COMMANDERS_FIELD"]
}
ELITEFLEETINFO.is_extendable = false
ELITEFLEETINFO.extensions = {}
()["CURRENTCHAPTERINFO_ID_FIELD"].name = "id"
()["CURRENTCHAPTERINFO_ID_FIELD"].full_name = "p13.currentchapterinfo.id"
()["CURRENTCHAPTERINFO_ID_FIELD"].number = 1
()["CURRENTCHAPTERINFO_ID_FIELD"].index = 0
()["CURRENTCHAPTERINFO_ID_FIELD"].label = 2
()["CURRENTCHAPTERINFO_ID_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_ID_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_ID_FIELD"].type = 13
()["CURRENTCHAPTERINFO_ID_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_TIME_FIELD"].name = "time"
()["CURRENTCHAPTERINFO_TIME_FIELD"].full_name = "p13.currentchapterinfo.time"
()["CURRENTCHAPTERINFO_TIME_FIELD"].number = 2
()["CURRENTCHAPTERINFO_TIME_FIELD"].index = 1
()["CURRENTCHAPTERINFO_TIME_FIELD"].label = 2
()["CURRENTCHAPTERINFO_TIME_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_TIME_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_TIME_FIELD"].type = 13
()["CURRENTCHAPTERINFO_TIME_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].name = "cell_list"
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].full_name = "p13.currentchapterinfo.cell_list"
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].number = 3
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].index = 2
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].message_type = CHAPTERCELLINFO
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].type = 11
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].name = "group_list"
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].full_name = "p13.currentchapterinfo.group_list"
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].number = 4
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].index = 3
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].message_type = GROUPINCHAPTER
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].type = 11
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].name = "ai_list"
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].full_name = "p13.currentchapterinfo.ai_list"
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].number = 5
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].index = 4
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].message_type = CHAPTERCELLINFO
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].type = 11
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].name = "escort_list"
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].full_name = "p13.currentchapterinfo.escort_list"
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].number = 6
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].index = 5
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].message_type = CHAPTERCELLINFO
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].type = 11
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_ROUND_FIELD"].name = "round"
()["CURRENTCHAPTERINFO_ROUND_FIELD"].full_name = "p13.currentchapterinfo.round"
()["CURRENTCHAPTERINFO_ROUND_FIELD"].number = 7
()["CURRENTCHAPTERINFO_ROUND_FIELD"].index = 6
()["CURRENTCHAPTERINFO_ROUND_FIELD"].label = 2
()["CURRENTCHAPTERINFO_ROUND_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_ROUND_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_ROUND_FIELD"].type = 13
()["CURRENTCHAPTERINFO_ROUND_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].name = "is_submarine_auto_attack"
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].full_name = "p13.currentchapterinfo.is_submarine_auto_attack"
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].number = 8
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].index = 7
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].label = 1
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].type = 13
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].name = "operation_buff"
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].full_name = "p13.currentchapterinfo.operation_buff"
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].number = 9
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].index = 8
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].label = 3
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].type = 13
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].name = "model_act_count"
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].full_name = "p13.currentchapterinfo.model_act_count"
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].number = 10
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].index = 9
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].label = 1
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].type = 13
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].name = "buff_list"
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].full_name = "p13.currentchapterinfo.buff_list"
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].number = 11
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].index = 10
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].type = 13
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].name = "loop_flag"
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].full_name = "p13.currentchapterinfo.loop_flag"
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].number = 12
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].index = 11
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].label = 1
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].type = 13
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].name = "extra_flag_list"
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].full_name = "p13.currentchapterinfo.extra_flag_list"
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].number = 13
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].index = 12
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].type = 13
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].name = "cell_flag_list"
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].full_name = "p13.currentchapterinfo.cell_flag_list"
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].number = 14
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].index = 13
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].message_type = CELLFLAG
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].type = 11
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].name = "chapter_hp"
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].full_name = "p13.currentchapterinfo.chapter_hp"
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].number = 15
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].index = 14
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].label = 2
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].type = 13
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].name = "chapter_strategy_list"
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].full_name = "p13.currentchapterinfo.chapter_strategy_list"
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].number = 16
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].index = 15
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].label = 3
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].message_type = STRATEGYINFO
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].type = 11
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].name = "kill_count"
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].full_name = "p13.currentchapterinfo.kill_count"
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].number = 17
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].index = 16
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].label = 2
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].type = 13
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].name = "init_ship_count"
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].full_name = "p13.currentchapterinfo.init_ship_count"
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].number = 18
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].index = 17
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].label = 2
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].type = 13
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].name = "continuous_kill_count"
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].full_name = "p13.currentchapterinfo.continuous_kill_count"
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].number = 19
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].index = 18
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].label = 2
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].default_value = 0
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].type = 13
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"].cpp_type = 3
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].name = "battle_statistics"
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].full_name = "p13.currentchapterinfo.battle_statistics"
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].number = 20
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].index = 19
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].label = 3
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].message_type = STRATEGYINFO
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].type = 11
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"].cpp_type = 10
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].name = "fleet_duties"
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].full_name = "p13.currentchapterinfo.fleet_duties"
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].number = 21
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].index = 20
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].label = 3
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].has_default_value = false
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].default_value = {}
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].message_type = FLEETDUTYKEYVALUEPAIR
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].type = 11
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"].cpp_type = 10
CURRENTCHAPTERINFO.name = "currentchapterinfo"
CURRENTCHAPTERINFO.full_name = "p13.currentchapterinfo"
CURRENTCHAPTERINFO.nested_types = {}
CURRENTCHAPTERINFO.enum_types = {}
CURRENTCHAPTERINFO.fields = {
()["CURRENTCHAPTERINFO_ID_FIELD"],
()["CURRENTCHAPTERINFO_TIME_FIELD"],
()["CURRENTCHAPTERINFO_CELL_LIST_FIELD"],
()["CURRENTCHAPTERINFO_GROUP_LIST_FIELD"],
()["CURRENTCHAPTERINFO_AI_LIST_FIELD"],
()["CURRENTCHAPTERINFO_ESCORT_LIST_FIELD"],
()["CURRENTCHAPTERINFO_ROUND_FIELD"],
()["CURRENTCHAPTERINFO_IS_SUBMARINE_AUTO_ATTACK_FIELD"],
()["CURRENTCHAPTERINFO_OPERATION_BUFF_FIELD"],
()["CURRENTCHAPTERINFO_MODEL_ACT_COUNT_FIELD"],
()["CURRENTCHAPTERINFO_BUFF_LIST_FIELD"],
()["CURRENTCHAPTERINFO_LOOP_FLAG_FIELD"],
()["CURRENTCHAPTERINFO_EXTRA_FLAG_LIST_FIELD"],
()["CURRENTCHAPTERINFO_CELL_FLAG_LIST_FIELD"],
()["CURRENTCHAPTERINFO_CHAPTER_HP_FIELD"],
()["CURRENTCHAPTERINFO_CHAPTER_STRATEGY_LIST_FIELD"],
()["CURRENTCHAPTERINFO_KILL_COUNT_FIELD"],
()["CURRENTCHAPTERINFO_INIT_SHIP_COUNT_FIELD"],
()["CURRENTCHAPTERINFO_CONTINUOUS_KILL_COUNT_FIELD"],
()["CURRENTCHAPTERINFO_BATTLE_STATISTICS_FIELD"],
()["CURRENTCHAPTERINFO_FLEET_DUTIES_FIELD"]
}
CURRENTCHAPTERINFO.is_extendable = false
CURRENTCHAPTERINFO.extensions = {}
()["CHAPTERCELLINFO_POS_FIELD"].name = "pos"
()["CHAPTERCELLINFO_POS_FIELD"].full_name = "p13.chaptercellinfo.pos"
()["CHAPTERCELLINFO_POS_FIELD"].number = 1
()["CHAPTERCELLINFO_POS_FIELD"].index = 0
()["CHAPTERCELLINFO_POS_FIELD"].label = 2
()["CHAPTERCELLINFO_POS_FIELD"].has_default_value = false
()["CHAPTERCELLINFO_POS_FIELD"].default_value = nil
()["CHAPTERCELLINFO_POS_FIELD"].message_type = CHAPTERCELLPOS
()["CHAPTERCELLINFO_POS_FIELD"].type = 11
()["CHAPTERCELLINFO_POS_FIELD"].cpp_type = 10
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].name = "item_type"
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].full_name = "p13.chaptercellinfo.item_type"
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].number = 2
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].index = 1
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].label = 2
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].has_default_value = false
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].default_value = 0
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].type = 13
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"].cpp_type = 3
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].name = "item_id"
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].full_name = "p13.chaptercellinfo.item_id"
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].number = 3
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].index = 2
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].label = 1
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].has_default_value = false
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].default_value = 0
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].type = 13
()["CHAPTERCELLINFO_ITEM_ID_FIELD"].cpp_type = 3
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].name = "item_flag"
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].full_name = "p13.chaptercellinfo.item_flag"
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].number = 4
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].index = 3
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].label = 1
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].has_default_value = false
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].default_value = 0
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].type = 13
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"].cpp_type = 3
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].name = "item_data"
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].full_name = "p13.chaptercellinfo.item_data"
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].number = 5
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].index = 4
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].label = 1
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].has_default_value = false
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].default_value = 0
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].type = 13
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"].cpp_type = 3
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].name = "extra_id"
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].full_name = "p13.chaptercellinfo.extra_id"
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].number = 6
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].index = 5
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].label = 3
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].has_default_value = false
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].default_value = {}
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].type = 13
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"].cpp_type = 3
CHAPTERCELLINFO.name = "chaptercellinfo"
CHAPTERCELLINFO.full_name = "p13.chaptercellinfo"
CHAPTERCELLINFO.nested_types = {}
CHAPTERCELLINFO.enum_types = {}
CHAPTERCELLINFO.fields = {
()["CHAPTERCELLINFO_POS_FIELD"],
()["CHAPTERCELLINFO_ITEM_TYPE_FIELD"],
()["CHAPTERCELLINFO_ITEM_ID_FIELD"],
()["CHAPTERCELLINFO_ITEM_FLAG_FIELD"],
()["CHAPTERCELLINFO_ITEM_DATA_FIELD"],
()["CHAPTERCELLINFO_EXTRA_ID_FIELD"]
}
CHAPTERCELLINFO.is_extendable = false
CHAPTERCELLINFO.extensions = {}
()["CELLFLAG_POS_FIELD"].name = "pos"
()["CELLFLAG_POS_FIELD"].full_name = "p13.cellflag.pos"
()["CELLFLAG_POS_FIELD"].number = 1
()["CELLFLAG_POS_FIELD"].index = 0
()["CELLFLAG_POS_FIELD"].label = 2
()["CELLFLAG_POS_FIELD"].has_default_value = false
()["CELLFLAG_POS_FIELD"].default_value = nil
()["CELLFLAG_POS_FIELD"].message_type = CHAPTERCELLPOS
()["CELLFLAG_POS_FIELD"].type = 11
()["CELLFLAG_POS_FIELD"].cpp_type = 10
()["CELLFLAG_FLAG_LIST_FIELD"].name = "flag_list"
()["CELLFLAG_FLAG_LIST_FIELD"].full_name = "p13.cellflag.flag_list"
()["CELLFLAG_FLAG_LIST_FIELD"].number = 2
()["CELLFLAG_FLAG_LIST_FIELD"].index = 1
()["CELLFLAG_FLAG_LIST_FIELD"].label = 3
()["CELLFLAG_FLAG_LIST_FIELD"].has_default_value = false
()["CELLFLAG_FLAG_LIST_FIELD"].default_value = {}
()["CELLFLAG_FLAG_LIST_FIELD"].type = 13
()["CELLFLAG_FLAG_LIST_FIELD"].cpp_type = 3
CELLFLAG.name = "cellflag"
CELLFLAG.full_name = "p13.cellflag"
CELLFLAG.nested_types = {}
CELLFLAG.enum_types = {}
CELLFLAG.fields = {
()["CELLFLAG_POS_FIELD"],
()["CELLFLAG_FLAG_LIST_FIELD"]
}
CELLFLAG.is_extendable = false
CELLFLAG.extensions = {}
()["CHAPTERCELLPOS_ROW_FIELD"].name = "row"
()["CHAPTERCELLPOS_ROW_FIELD"].full_name = "p13.chaptercellpos.row"
()["CHAPTERCELLPOS_ROW_FIELD"].number = 1
()["CHAPTERCELLPOS_ROW_FIELD"].index = 0
()["CHAPTERCELLPOS_ROW_FIELD"].label = 2
()["CHAPTERCELLPOS_ROW_FIELD"].has_default_value = false
()["CHAPTERCELLPOS_ROW_FIELD"].default_value = 0
()["CHAPTERCELLPOS_ROW_FIELD"].type = 13
()["CHAPTERCELLPOS_ROW_FIELD"].cpp_type = 3
()["CHAPTERCELLPOS_COLUMN_FIELD"].name = "column"
()["CHAPTERCELLPOS_COLUMN_FIELD"].full_name = "p13.chaptercellpos.column"
()["CHAPTERCELLPOS_COLUMN_FIELD"].number = 2
()["CHAPTERCELLPOS_COLUMN_FIELD"].index = 1
()["CHAPTERCELLPOS_COLUMN_FIELD"].label = 2
()["CHAPTERCELLPOS_COLUMN_FIELD"].has_default_value = false
()["CHAPTERCELLPOS_COLUMN_FIELD"].default_value = 0
()["CHAPTERCELLPOS_COLUMN_FIELD"].type = 13
()["CHAPTERCELLPOS_COLUMN_FIELD"].cpp_type = 3
CHAPTERCELLPOS.name = "chaptercellpos"
CHAPTERCELLPOS.full_name = "p13.chaptercellpos"
CHAPTERCELLPOS.nested_types = {}
CHAPTERCELLPOS.enum_types = {}
CHAPTERCELLPOS.fields = {
()["CHAPTERCELLPOS_ROW_FIELD"],
()["CHAPTERCELLPOS_COLUMN_FIELD"]
}
CHAPTERCELLPOS.is_extendable = false
CHAPTERCELLPOS.extensions = {}
()["GROUPINCHAPTER_ID_FIELD"].name = "id"
()["GROUPINCHAPTER_ID_FIELD"].full_name = "p13.groupinchapter.id"
()["GROUPINCHAPTER_ID_FIELD"].number = 1
()["GROUPINCHAPTER_ID_FIELD"].index = 0
()["GROUPINCHAPTER_ID_FIELD"].label = 2
()["GROUPINCHAPTER_ID_FIELD"].has_default_value = false
()["GROUPINCHAPTER_ID_FIELD"].default_value = 0
()["GROUPINCHAPTER_ID_FIELD"].type = 13
()["GROUPINCHAPTER_ID_FIELD"].cpp_type = 3
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].name = "ship_list"
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].full_name = "p13.groupinchapter.ship_list"
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].number = 2
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].index = 1
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].label = 3
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].has_default_value = false
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].default_value = {}
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].message_type = SHIPINCHAPTER
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].type = 11
()["GROUPINCHAPTER_SHIP_LIST_FIELD"].cpp_type = 10
()["GROUPINCHAPTER_POS_FIELD"].name = "pos"
()["GROUPINCHAPTER_POS_FIELD"].full_name = "p13.groupinchapter.pos"
()["GROUPINCHAPTER_POS_FIELD"].number = 3
()["GROUPINCHAPTER_POS_FIELD"].index = 2
()["GROUPINCHAPTER_POS_FIELD"].label = 2
()["GROUPINCHAPTER_POS_FIELD"].has_default_value = false
()["GROUPINCHAPTER_POS_FIELD"].default_value = nil
()["GROUPINCHAPTER_POS_FIELD"].message_type = CHAPTERCELLPOS
()["GROUPINCHAPTER_POS_FIELD"].type = 11
()["GROUPINCHAPTER_POS_FIELD"].cpp_type = 10
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].name = "step_count"
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].full_name = "p13.groupinchapter.step_count"
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].number = 4
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].index = 3
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].label = 2
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].has_default_value = false
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].default_value = 0
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].type = 13
()["GROUPINCHAPTER_STEP_COUNT_FIELD"].cpp_type = 3
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].name = "box_strategy_list"
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].full_name = "p13.groupinchapter.box_strategy_list"
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].number = 5
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].index = 4
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].label = 3
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].has_default_value = false
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].default_value = {}
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].message_type = STRATEGYINFO
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].type = 11
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"].cpp_type = 10
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].name = "ship_strategy_list"
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].full_name = "p13.groupinchapter.ship_strategy_list"
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].number = 6
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].index = 5
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].label = 3
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].has_default_value = false
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].default_value = {}
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].message_type = STRATEGYINFO
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].type = 11
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"].cpp_type = 10
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].name = "strategy_ids"
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].full_name = "p13.groupinchapter.strategy_ids"
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].number = 7
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].index = 6
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].label = 3
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].has_default_value = false
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].default_value = {}
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].type = 13
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"].cpp_type = 3
()["GROUPINCHAPTER_BULLET_FIELD"].name = "bullet"
()["GROUPINCHAPTER_BULLET_FIELD"].full_name = "p13.groupinchapter.bullet"
()["GROUPINCHAPTER_BULLET_FIELD"].number = 8
()["GROUPINCHAPTER_BULLET_FIELD"].index = 7
()["GROUPINCHAPTER_BULLET_FIELD"].label = 2
()["GROUPINCHAPTER_BULLET_FIELD"].has_default_value = false
()["GROUPINCHAPTER_BULLET_FIELD"].default_value = 0
()["GROUPINCHAPTER_BULLET_FIELD"].type = 13
()["GROUPINCHAPTER_BULLET_FIELD"].cpp_type = 3
()["GROUPINCHAPTER_START_POS_FIELD"].name = "start_pos"
()["GROUPINCHAPTER_START_POS_FIELD"].full_name = "p13.groupinchapter.start_pos"
()["GROUPINCHAPTER_START_POS_FIELD"].number = 9
()["GROUPINCHAPTER_START_POS_FIELD"].index = 8
()["GROUPINCHAPTER_START_POS_FIELD"].label = 2
()["GROUPINCHAPTER_START_POS_FIELD"].has_default_value = false
()["GROUPINCHAPTER_START_POS_FIELD"].default_value = nil
()["GROUPINCHAPTER_START_POS_FIELD"].message_type = CHAPTERCELLPOS
()["GROUPINCHAPTER_START_POS_FIELD"].type = 11
()["GROUPINCHAPTER_START_POS_FIELD"].cpp_type = 10
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].name = "commander_list"
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].full_name = "p13.groupinchapter.commander_list"
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].number = 10
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].index = 9
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].label = 3
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].has_default_value = false
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].default_value = {}
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].message_type = slot1.COMMANDERSINFO
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].type = 11
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"].cpp_type = 10
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].name = "move_step_down"
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].full_name = "p13.groupinchapter.move_step_down"
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].number = 11
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].index = 10
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].label = 2
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].has_default_value = false
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].default_value = 0
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].type = 13
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"].cpp_type = 3
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].name = "kill_count"
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].full_name = "p13.groupinchapter.kill_count"
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].number = 12
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].index = 11
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].label = 2
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].has_default_value = false
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].default_value = 0
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].type = 13
()["GROUPINCHAPTER_KILL_COUNT_FIELD"].cpp_type = 3
()["GROUPINCHAPTER_FLEET_ID_FIELD"].name = "fleet_id"
()["GROUPINCHAPTER_FLEET_ID_FIELD"].full_name = "p13.groupinchapter.fleet_id"
()["GROUPINCHAPTER_FLEET_ID_FIELD"].number = 13
()["GROUPINCHAPTER_FLEET_ID_FIELD"].index = 12
()["GROUPINCHAPTER_FLEET_ID_FIELD"].label = 2
()["GROUPINCHAPTER_FLEET_ID_FIELD"].has_default_value = false
()["GROUPINCHAPTER_FLEET_ID_FIELD"].default_value = 0
()["GROUPINCHAPTER_FLEET_ID_FIELD"].type = 13
()["GROUPINCHAPTER_FLEET_ID_FIELD"].cpp_type = 3
GROUPINCHAPTER.name = "groupinchapter"
GROUPINCHAPTER.full_name = "p13.groupinchapter"
GROUPINCHAPTER.nested_types = {}
GROUPINCHAPTER.enum_types = {}
GROUPINCHAPTER.fields = {
()["GROUPINCHAPTER_ID_FIELD"],
()["GROUPINCHAPTER_SHIP_LIST_FIELD"],
()["GROUPINCHAPTER_POS_FIELD"],
()["GROUPINCHAPTER_STEP_COUNT_FIELD"],
()["GROUPINCHAPTER_BOX_STRATEGY_LIST_FIELD"],
()["GROUPINCHAPTER_SHIP_STRATEGY_LIST_FIELD"],
()["GROUPINCHAPTER_STRATEGY_IDS_FIELD"],
()["GROUPINCHAPTER_BULLET_FIELD"],
()["GROUPINCHAPTER_START_POS_FIELD"],
()["GROUPINCHAPTER_COMMANDER_LIST_FIELD"],
()["GROUPINCHAPTER_MOVE_STEP_DOWN_FIELD"],
()["GROUPINCHAPTER_KILL_COUNT_FIELD"],
()["GROUPINCHAPTER_FLEET_ID_FIELD"]
}
GROUPINCHAPTER.is_extendable = false
GROUPINCHAPTER.extensions = {}
()["SHIPINCHAPTER_ID_FIELD"].name = "id"
()["SHIPINCHAPTER_ID_FIELD"].full_name = "p13.shipinchapter.id"
()["SHIPINCHAPTER_ID_FIELD"].number = 1
()["SHIPINCHAPTER_ID_FIELD"].index = 0
()["SHIPINCHAPTER_ID_FIELD"].label = 2
()["SHIPINCHAPTER_ID_FIELD"].has_default_value = false
()["SHIPINCHAPTER_ID_FIELD"].default_value = 0
()["SHIPINCHAPTER_ID_FIELD"].type = 13
()["SHIPINCHAPTER_ID_FIELD"].cpp_type = 3
()["SHIPINCHAPTER_HP_RANT_FIELD"].name = "hp_rant"
()["SHIPINCHAPTER_HP_RANT_FIELD"].full_name = "p13.shipinchapter.hp_rant"
()["SHIPINCHAPTER_HP_RANT_FIELD"].number = 2
()["SHIPINCHAPTER_HP_RANT_FIELD"].index = 1
()["SHIPINCHAPTER_HP_RANT_FIELD"].label = 2
()["SHIPINCHAPTER_HP_RANT_FIELD"].has_default_value = false
()["SHIPINCHAPTER_HP_RANT_FIELD"].default_value = 0
()["SHIPINCHAPTER_HP_RANT_FIELD"].type = 13
()["SHIPINCHAPTER_HP_RANT_FIELD"].cpp_type = 3
SHIPINCHAPTER.name = "shipinchapter"
SHIPINCHAPTER.full_name = "p13.shipinchapter"
SHIPINCHAPTER.nested_types = {}
SHIPINCHAPTER.enum_types = {}
SHIPINCHAPTER.fields = {
()["SHIPINCHAPTER_ID_FIELD"],
()["SHIPINCHAPTER_HP_RANT_FIELD"]
}
SHIPINCHAPTER.is_extendable = false
SHIPINCHAPTER.extensions = {}
()["STRATEGYINFO_ID_FIELD"].name = "id"
()["STRATEGYINFO_ID_FIELD"].full_name = "p13.strategyinfo.id"
()["STRATEGYINFO_ID_FIELD"].number = 1
()["STRATEGYINFO_ID_FIELD"].index = 0
()["STRATEGYINFO_ID_FIELD"].label = 2
()["STRATEGYINFO_ID_FIELD"].has_default_value = false
()["STRATEGYINFO_ID_FIELD"].default_value = 0
()["STRATEGYINFO_ID_FIELD"].type = 13
()["STRATEGYINFO_ID_FIELD"].cpp_type = 3
()["STRATEGYINFO_COUNT_FIELD"].name = "count"
()["STRATEGYINFO_COUNT_FIELD"].full_name = "p13.strategyinfo.count"
()["STRATEGYINFO_COUNT_FIELD"].number = 3
()["STRATEGYINFO_COUNT_FIELD"].index = 1
()["STRATEGYINFO_COUNT_FIELD"].label = 2
()["STRATEGYINFO_COUNT_FIELD"].has_default_value = false
()["STRATEGYINFO_COUNT_FIELD"].default_value = 0
()["STRATEGYINFO_COUNT_FIELD"].type = 13
()["STRATEGYINFO_COUNT_FIELD"].cpp_type = 3
STRATEGYINFO.name = "strategyinfo"
STRATEGYINFO.full_name = "p13.strategyinfo"
STRATEGYINFO.nested_types = {}
STRATEGYINFO.enum_types = {}
STRATEGYINFO.fields = {
()["STRATEGYINFO_ID_FIELD"],
()["STRATEGYINFO_COUNT_FIELD"]
}
STRATEGYINFO.is_extendable = false
STRATEGYINFO.extensions = {}
()["AI_ACT_AI_POS_FIELD"].name = "ai_pos"
()["AI_ACT_AI_POS_FIELD"].full_name = "p13.ai_act.ai_pos"
()["AI_ACT_AI_POS_FIELD"].number = 1
()["AI_ACT_AI_POS_FIELD"].index = 0
()["AI_ACT_AI_POS_FIELD"].label = 2
()["AI_ACT_AI_POS_FIELD"].has_default_value = false
()["AI_ACT_AI_POS_FIELD"].default_value = nil
()["AI_ACT_AI_POS_FIELD"].message_type = CHAPTERCELLPOS
()["AI_ACT_AI_POS_FIELD"].type = 11
()["AI_ACT_AI_POS_FIELD"].cpp_type = 10
()["AI_ACT_STRATEGY_ID_FIELD"].name = "strategy_id"
()["AI_ACT_STRATEGY_ID_FIELD"].full_name = "p13.ai_act.strategy_id"
()["AI_ACT_STRATEGY_ID_FIELD"].number = 2
()["AI_ACT_STRATEGY_ID_FIELD"].index = 1
()["AI_ACT_STRATEGY_ID_FIELD"].label = 1
()["AI_ACT_STRATEGY_ID_FIELD"].has_default_value = false
()["AI_ACT_STRATEGY_ID_FIELD"].default_value = 0
()["AI_ACT_STRATEGY_ID_FIELD"].type = 13
()["AI_ACT_STRATEGY_ID_FIELD"].cpp_type = 3
()["AI_ACT_TARGET_POS_FIELD"].name = "target_pos"
()["AI_ACT_TARGET_POS_FIELD"].full_name = "p13.ai_act.target_pos"
()["AI_ACT_TARGET_POS_FIELD"].number = 3
()["AI_ACT_TARGET_POS_FIELD"].index = 2
()["AI_ACT_TARGET_POS_FIELD"].label = 1
()["AI_ACT_TARGET_POS_FIELD"].has_default_value = false
()["AI_ACT_TARGET_POS_FIELD"].default_value = nil
()["AI_ACT_TARGET_POS_FIELD"].message_type = CHAPTERCELLPOS
()["AI_ACT_TARGET_POS_FIELD"].type = 11
()["AI_ACT_TARGET_POS_FIELD"].cpp_type = 10
()["AI_ACT_MOVE_PATH_FIELD"].name = "move_path"
()["AI_ACT_MOVE_PATH_FIELD"].full_name = "p13.ai_act.move_path"
()["AI_ACT_MOVE_PATH_FIELD"].number = 4
()["AI_ACT_MOVE_PATH_FIELD"].index = 3
()["AI_ACT_MOVE_PATH_FIELD"].label = 3
()["AI_ACT_MOVE_PATH_FIELD"].has_default_value = false
()["AI_ACT_MOVE_PATH_FIELD"].default_value = {}
()["AI_ACT_MOVE_PATH_FIELD"].message_type = CHAPTERCELLPOS
()["AI_ACT_MOVE_PATH_FIELD"].type = 11
()["AI_ACT_MOVE_PATH_FIELD"].cpp_type = 10
()["AI_ACT_MAP_UPDATE_FIELD"].name = "map_update"
()["AI_ACT_MAP_UPDATE_FIELD"].full_name = "p13.ai_act.map_update"
()["AI_ACT_MAP_UPDATE_FIELD"].number = 5
()["AI_ACT_MAP_UPDATE_FIELD"].index = 4
()["AI_ACT_MAP_UPDATE_FIELD"].label = 3
()["AI_ACT_MAP_UPDATE_FIELD"].has_default_value = false
()["AI_ACT_MAP_UPDATE_FIELD"].default_value = {}
()["AI_ACT_MAP_UPDATE_FIELD"].message_type = CHAPTERCELLINFO
()["AI_ACT_MAP_UPDATE_FIELD"].type = 11
()["AI_ACT_MAP_UPDATE_FIELD"].cpp_type = 10
()["AI_ACT_SHIP_UPDATE_FIELD"].name = "ship_update"
()["AI_ACT_SHIP_UPDATE_FIELD"].full_name = "p13.ai_act.ship_update"
()["AI_ACT_SHIP_UPDATE_FIELD"].number = 6
()["AI_ACT_SHIP_UPDATE_FIELD"].index = 5
()["AI_ACT_SHIP_UPDATE_FIELD"].label = 3
()["AI_ACT_SHIP_UPDATE_FIELD"].has_default_value = false
()["AI_ACT_SHIP_UPDATE_FIELD"].default_value = {}
()["AI_ACT_SHIP_UPDATE_FIELD"].message_type = SHIPINCHAPTER
()["AI_ACT_SHIP_UPDATE_FIELD"].type = 11
()["AI_ACT_SHIP_UPDATE_FIELD"].cpp_type = 10
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].name = "commander_skill_effect_id"
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].full_name = "p13.ai_act.commander_skill_effect_id"
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].number = 7
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].index = 6
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].label = 1
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].has_default_value = false
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].default_value = 0
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].type = 13
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"].cpp_type = 3
()["AI_ACT_ACT_TYPE_FIELD"].name = "act_type"
()["AI_ACT_ACT_TYPE_FIELD"].full_name = "p13.ai_act.act_type"
()["AI_ACT_ACT_TYPE_FIELD"].number = 8
()["AI_ACT_ACT_TYPE_FIELD"].index = 7
()["AI_ACT_ACT_TYPE_FIELD"].label = 1
()["AI_ACT_ACT_TYPE_FIELD"].has_default_value = false
()["AI_ACT_ACT_TYPE_FIELD"].default_value = 0
()["AI_ACT_ACT_TYPE_FIELD"].type = 13
()["AI_ACT_ACT_TYPE_FIELD"].cpp_type = 3
()["AI_ACT_HP_DEL_FIELD"].name = "hp_del"
()["AI_ACT_HP_DEL_FIELD"].full_name = "p13.ai_act.hp_del"
()["AI_ACT_HP_DEL_FIELD"].number = 9
()["AI_ACT_HP_DEL_FIELD"].index = 8
()["AI_ACT_HP_DEL_FIELD"].label = 1
()["AI_ACT_HP_DEL_FIELD"].has_default_value = false
()["AI_ACT_HP_DEL_FIELD"].default_value = 0
()["AI_ACT_HP_DEL_FIELD"].type = 13
()["AI_ACT_HP_DEL_FIELD"].cpp_type = 3
AI_ACT.name = "ai_act"
AI_ACT.full_name = "p13.ai_act"
AI_ACT.nested_types = {}
AI_ACT.enum_types = {}
AI_ACT.fields = {
()["AI_ACT_AI_POS_FIELD"],
()["AI_ACT_STRATEGY_ID_FIELD"],
()["AI_ACT_TARGET_POS_FIELD"],
()["AI_ACT_MOVE_PATH_FIELD"],
()["AI_ACT_MAP_UPDATE_FIELD"],
()["AI_ACT_SHIP_UPDATE_FIELD"],
()["AI_ACT_COMMANDER_SKILL_EFFECT_ID_FIELD"],
()["AI_ACT_ACT_TYPE_FIELD"],
()["AI_ACT_HP_DEL_FIELD"]
}
AI_ACT.is_extendable = false
AI_ACT.extensions = {}
()["CS_13107_ID_FIELD"].name = "id"
()["CS_13107_ID_FIELD"].full_name = "p13.cs_13107.id"
()["CS_13107_ID_FIELD"].number = 1
()["CS_13107_ID_FIELD"].index = 0
()["CS_13107_ID_FIELD"].label = 2
()["CS_13107_ID_FIELD"].has_default_value = false
()["CS_13107_ID_FIELD"].default_value = 0
()["CS_13107_ID_FIELD"].type = 13
()["CS_13107_ID_FIELD"].cpp_type = 3
()["CS_13107_ELITE_FLEET_LIST_FIELD"].name = "elite_fleet_list"
()["CS_13107_ELITE_FLEET_LIST_FIELD"].full_name = "p13.cs_13107.elite_fleet_list"
()["CS_13107_ELITE_FLEET_LIST_FIELD"].number = 2
()["CS_13107_ELITE_FLEET_LIST_FIELD"].index = 1
()["CS_13107_ELITE_FLEET_LIST_FIELD"].label = 3
()["CS_13107_ELITE_FLEET_LIST_FIELD"].has_default_value = false
()["CS_13107_ELITE_FLEET_LIST_FIELD"].default_value = {}
()["CS_13107_ELITE_FLEET_LIST_FIELD"].message_type = ELITEFLEETINFO
()["CS_13107_ELITE_FLEET_LIST_FIELD"].type = 11
()["CS_13107_ELITE_FLEET_LIST_FIELD"].cpp_type = 10
CS_13107.name = "cs_13107"
CS_13107.full_name = "p13.cs_13107"
CS_13107.nested_types = {}
CS_13107.enum_types = {}
CS_13107.fields = {
()["CS_13107_ID_FIELD"],
()["CS_13107_ELITE_FLEET_LIST_FIELD"]
}
CS_13107.is_extendable = false
CS_13107.extensions = {}
()["SC_13108_RESULT_FIELD"].name = "result"
()["SC_13108_RESULT_FIELD"].full_name = "p13.sc_13108.result"
()["SC_13108_RESULT_FIELD"].number = 1
()["SC_13108_RESULT_FIELD"].index = 0
()["SC_13108_RESULT_FIELD"].label = 2
()["SC_13108_RESULT_FIELD"].has_default_value = false
()["SC_13108_RESULT_FIELD"].default_value = 0
()["SC_13108_RESULT_FIELD"].type = 13
()["SC_13108_RESULT_FIELD"].cpp_type = 3
SC_13108.name = "sc_13108"
SC_13108.full_name = "p13.sc_13108"
SC_13108.nested_types = {}
SC_13108.enum_types = {}
SC_13108.fields = {
()["SC_13108_RESULT_FIELD"]
}
SC_13108.is_extendable = false
SC_13108.extensions = {}
()["CS_13109_ID_FIELD"].name = "id"
()["CS_13109_ID_FIELD"].full_name = "p13.cs_13109.id"
()["CS_13109_ID_FIELD"].number = 1
()["CS_13109_ID_FIELD"].index = 0
()["CS_13109_ID_FIELD"].label = 2
()["CS_13109_ID_FIELD"].has_default_value = false
()["CS_13109_ID_FIELD"].default_value = 0
()["CS_13109_ID_FIELD"].type = 13
()["CS_13109_ID_FIELD"].cpp_type = 3
CS_13109.name = "cs_13109"
CS_13109.full_name = "p13.cs_13109"
CS_13109.nested_types = {}
CS_13109.enum_types = {}
CS_13109.fields = {
()["CS_13109_ID_FIELD"]
}
CS_13109.is_extendable = false
CS_13109.extensions = {}
()["SC_13110_DROP_SHIP_LIST_FIELD"].name = "drop_ship_list"
()["SC_13110_DROP_SHIP_LIST_FIELD"].full_name = "p13.sc_13110.drop_ship_list"
()["SC_13110_DROP_SHIP_LIST_FIELD"].number = 1
()["SC_13110_DROP_SHIP_LIST_FIELD"].index = 0
()["SC_13110_DROP_SHIP_LIST_FIELD"].label = 3
()["SC_13110_DROP_SHIP_LIST_FIELD"].has_default_value = false
()["SC_13110_DROP_SHIP_LIST_FIELD"].default_value = {}
()["SC_13110_DROP_SHIP_LIST_FIELD"].type = 13
()["SC_13110_DROP_SHIP_LIST_FIELD"].cpp_type = 3
SC_13110.name = "sc_13110"
SC_13110.full_name = "p13.sc_13110"
SC_13110.nested_types = {}
SC_13110.enum_types = {}
SC_13110.fields = {
()["SC_13110_DROP_SHIP_LIST_FIELD"]
}
SC_13110.is_extendable = false
SC_13110.extensions = {}
()["SC_13201_COUNT_LIST_FIELD"].name = "count_list"
()["SC_13201_COUNT_LIST_FIELD"].full_name = "p13.sc_13201.count_list"
()["SC_13201_COUNT_LIST_FIELD"].number = 1
()["SC_13201_COUNT_LIST_FIELD"].index = 0
()["SC_13201_COUNT_LIST_FIELD"].label = 3
()["SC_13201_COUNT_LIST_FIELD"].has_default_value = false
()["SC_13201_COUNT_LIST_FIELD"].default_value = {}
()["SC_13201_COUNT_LIST_FIELD"].message_type = EXPEDITION_DAILY_COUNT
()["SC_13201_COUNT_LIST_FIELD"].type = 11
()["SC_13201_COUNT_LIST_FIELD"].cpp_type = 10
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].name = "elite_expedition_count"
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].full_name = "p13.sc_13201.elite_expedition_count"
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].number = 2
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].index = 1
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].label = 2
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].has_default_value = false
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].default_value = 0
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].type = 13
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"].cpp_type = 3
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].name = "escort_expedition_count"
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].full_name = "p13.sc_13201.escort_expedition_count"
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].number = 3
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].index = 2
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].label = 2
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].has_default_value = false
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].default_value = 0
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].type = 13
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"].cpp_type = 3
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].name = "chapter_count_list"
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].full_name = "p13.sc_13201.chapter_count_list"
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].number = 4
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].index = 3
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].label = 3
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].has_default_value = false
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].default_value = {}
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].message_type = EXPEDITION_DAILY_COUNT
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].type = 11
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"].cpp_type = 10
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].name = "quick_expedition_list"
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].full_name = "p13.sc_13201.quick_expedition_list"
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].number = 5
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].index = 4
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].label = 3
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].has_default_value = false
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].default_value = {}
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].type = 13
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"].cpp_type = 3
SC_13201.name = "sc_13201"
SC_13201.full_name = "p13.sc_13201"
SC_13201.nested_types = {}
SC_13201.enum_types = {}
SC_13201.fields = {
()["SC_13201_COUNT_LIST_FIELD"],
()["SC_13201_ELITE_EXPEDITION_COUNT_FIELD"],
()["SC_13201_ESCORT_EXPEDITION_COUNT_FIELD"],
()["SC_13201_CHAPTER_COUNT_LIST_FIELD"],
()["SC_13201_QUICK_EXPEDITION_LIST_FIELD"]
}
SC_13201.is_extendable = false
SC_13201.extensions = {}
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].name = "id"
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].full_name = "p13.expedition_daily_count.id"
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].number = 1
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].index = 0
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].label = 2
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].has_default_value = false
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].default_value = 0
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].type = 13
()["EXPEDITION_DAILY_COUNT_ID_FIELD"].cpp_type = 3
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].name = "count"
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].full_name = "p13.expedition_daily_count.count"
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].number = 2
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].index = 1
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].label = 2
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].has_default_value = false
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].default_value = 0
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].type = 13
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"].cpp_type = 3
EXPEDITION_DAILY_COUNT.name = "expedition_daily_count"
EXPEDITION_DAILY_COUNT.full_name = "p13.expedition_daily_count"
EXPEDITION_DAILY_COUNT.nested_types = {}
EXPEDITION_DAILY_COUNT.enum_types = {}
EXPEDITION_DAILY_COUNT.fields = {
()["EXPEDITION_DAILY_COUNT_ID_FIELD"],
()["EXPEDITION_DAILY_COUNT_COUNT_FIELD"]
}
EXPEDITION_DAILY_COUNT.is_extendable = false
EXPEDITION_DAILY_COUNT.extensions = {}
()["CS_13301_TYPE_FIELD"].name = "type"
()["CS_13301_TYPE_FIELD"].full_name = "p13.cs_13301.type"
()["CS_13301_TYPE_FIELD"].number = 1
()["CS_13301_TYPE_FIELD"].index = 0
()["CS_13301_TYPE_FIELD"].label = 2
()["CS_13301_TYPE_FIELD"].has_default_value = false
()["CS_13301_TYPE_FIELD"].default_value = 0
()["CS_13301_TYPE_FIELD"].type = 13
()["CS_13301_TYPE_FIELD"].cpp_type = 3
CS_13301.name = "cs_13301"
CS_13301.full_name = "p13.cs_13301"
CS_13301.nested_types = {}
CS_13301.enum_types = {}
CS_13301.fields = {
()["CS_13301_TYPE_FIELD"]
}
CS_13301.is_extendable = false
CS_13301.extensions = {}
()["SC_13302_ESCORT_INFO_FIELD"].name = "escort_info"
()["SC_13302_ESCORT_INFO_FIELD"].full_name = "p13.sc_13302.escort_info"
()["SC_13302_ESCORT_INFO_FIELD"].number = 1
()["SC_13302_ESCORT_INFO_FIELD"].index = 0
()["SC_13302_ESCORT_INFO_FIELD"].label = 3
()["SC_13302_ESCORT_INFO_FIELD"].has_default_value = false
()["SC_13302_ESCORT_INFO_FIELD"].default_value = {}
()["SC_13302_ESCORT_INFO_FIELD"].message_type = ESCORT_INFO
()["SC_13302_ESCORT_INFO_FIELD"].type = 11
()["SC_13302_ESCORT_INFO_FIELD"].cpp_type = 10
()["SC_13302_DROP_LIST_FIELD"].name = "drop_list"
()["SC_13302_DROP_LIST_FIELD"].full_name = "p13.sc_13302.drop_list"
()["SC_13302_DROP_LIST_FIELD"].number = 2
()["SC_13302_DROP_LIST_FIELD"].index = 1
()["SC_13302_DROP_LIST_FIELD"].label = 3
()["SC_13302_DROP_LIST_FIELD"].has_default_value = false
()["SC_13302_DROP_LIST_FIELD"].default_value = {}
()["SC_13302_DROP_LIST_FIELD"].message_type = slot1.DROPINFO
()["SC_13302_DROP_LIST_FIELD"].type = 11
()["SC_13302_DROP_LIST_FIELD"].cpp_type = 10
SC_13302.name = "sc_13302"
SC_13302.full_name = "p13.sc_13302"
SC_13302.nested_types = {}
SC_13302.enum_types = {}
SC_13302.fields = {
()["SC_13302_ESCORT_INFO_FIELD"],
()["SC_13302_DROP_LIST_FIELD"]
}
SC_13302.is_extendable = false
SC_13302.extensions = {}
()["ESCORT_INFO_LINE_ID_FIELD"].name = "line_id"
()["ESCORT_INFO_LINE_ID_FIELD"].full_name = "p13.escort_info.line_id"
()["ESCORT_INFO_LINE_ID_FIELD"].number = 1
()["ESCORT_INFO_LINE_ID_FIELD"].index = 0
()["ESCORT_INFO_LINE_ID_FIELD"].label = 2
()["ESCORT_INFO_LINE_ID_FIELD"].has_default_value = false
()["ESCORT_INFO_LINE_ID_FIELD"].default_value = 0
()["ESCORT_INFO_LINE_ID_FIELD"].type = 13
()["ESCORT_INFO_LINE_ID_FIELD"].cpp_type = 3
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].name = "award_timestamp"
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].full_name = "p13.escort_info.award_timestamp"
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].number = 2
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].index = 1
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].label = 2
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].has_default_value = false
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].default_value = 0
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].type = 13
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"].cpp_type = 3
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].name = "flash_timestamp"
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].full_name = "p13.escort_info.flash_timestamp"
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].number = 3
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].index = 2
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].label = 2
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].has_default_value = false
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].default_value = 0
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].type = 13
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"].cpp_type = 3
()["ESCORT_INFO_MAP_FIELD"].name = "map"
()["ESCORT_INFO_MAP_FIELD"].full_name = "p13.escort_info.map"
()["ESCORT_INFO_MAP_FIELD"].number = 4
()["ESCORT_INFO_MAP_FIELD"].index = 3
()["ESCORT_INFO_MAP_FIELD"].label = 3
()["ESCORT_INFO_MAP_FIELD"].has_default_value = false
()["ESCORT_INFO_MAP_FIELD"].default_value = {}
()["ESCORT_INFO_MAP_FIELD"].message_type = ESCORT_POS
()["ESCORT_INFO_MAP_FIELD"].type = 11
()["ESCORT_INFO_MAP_FIELD"].cpp_type = 10
ESCORT_INFO.name = "escort_info"
ESCORT_INFO.full_name = "p13.escort_info"
ESCORT_INFO.nested_types = {}
ESCORT_INFO.enum_types = {}
ESCORT_INFO.fields = {
()["ESCORT_INFO_LINE_ID_FIELD"],
()["ESCORT_INFO_AWARD_TIMESTAMP_FIELD"],
()["ESCORT_INFO_FLASH_TIMESTAMP_FIELD"],
()["ESCORT_INFO_MAP_FIELD"]
}
ESCORT_INFO.is_extendable = false
ESCORT_INFO.extensions = {}
()["ESCORT_POS_MAP_ID_FIELD"].name = "map_id"
()["ESCORT_POS_MAP_ID_FIELD"].full_name = "p13.escort_pos.map_id"
()["ESCORT_POS_MAP_ID_FIELD"].number = 1
()["ESCORT_POS_MAP_ID_FIELD"].index = 0
()["ESCORT_POS_MAP_ID_FIELD"].label = 2
()["ESCORT_POS_MAP_ID_FIELD"].has_default_value = false
()["ESCORT_POS_MAP_ID_FIELD"].default_value = 0
()["ESCORT_POS_MAP_ID_FIELD"].type = 13
()["ESCORT_POS_MAP_ID_FIELD"].cpp_type = 3
()["ESCORT_POS_CHAPTER_ID_FIELD"].name = "chapter_id"
()["ESCORT_POS_CHAPTER_ID_FIELD"].full_name = "p13.escort_pos.chapter_id"
()["ESCORT_POS_CHAPTER_ID_FIELD"].number = 2
()["ESCORT_POS_CHAPTER_ID_FIELD"].index = 1
()["ESCORT_POS_CHAPTER_ID_FIELD"].label = 2
()["ESCORT_POS_CHAPTER_ID_FIELD"].has_default_value = false
()["ESCORT_POS_CHAPTER_ID_FIELD"].default_value = 0
()["ESCORT_POS_CHAPTER_ID_FIELD"].type = 13
()["ESCORT_POS_CHAPTER_ID_FIELD"].cpp_type = 3
ESCORT_POS.name = "escort_pos"
ESCORT_POS.full_name = "p13.escort_pos"
ESCORT_POS.nested_types = {}
ESCORT_POS.enum_types = {}
ESCORT_POS.fields = {
()["ESCORT_POS_MAP_ID_FIELD"],
()["ESCORT_POS_CHAPTER_ID_FIELD"]
}
ESCORT_POS.is_extendable = false
ESCORT_POS.extensions = {}
()["CS_13401_TYPE_FIELD"].name = "type"
()["CS_13401_TYPE_FIELD"].full_name = "p13.cs_13401.type"
()["CS_13401_TYPE_FIELD"].number = 1
()["CS_13401_TYPE_FIELD"].index = 0
()["CS_13401_TYPE_FIELD"].label = 2
()["CS_13401_TYPE_FIELD"].has_default_value = false
()["CS_13401_TYPE_FIELD"].default_value = 0
()["CS_13401_TYPE_FIELD"].type = 13
()["CS_13401_TYPE_FIELD"].cpp_type = 3
CS_13401.name = "cs_13401"
CS_13401.full_name = "p13.cs_13401"
CS_13401.nested_types = {}
CS_13401.enum_types = {}
CS_13401.fields = {
()["CS_13401_TYPE_FIELD"]
}
CS_13401.is_extendable = false
CS_13401.extensions = {}
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].name = "next_refresh_time"
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].full_name = "p13.sc_13402.next_refresh_time"
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].number = 1
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].index = 0
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].label = 2
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].has_default_value = false
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].default_value = 0
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].type = 13
()["SC_13402_NEXT_REFRESH_TIME_FIELD"].cpp_type = 3
()["SC_13402_REFRESH_COUNT_FIELD"].name = "refresh_count"
()["SC_13402_REFRESH_COUNT_FIELD"].full_name = "p13.sc_13402.refresh_count"
()["SC_13402_REFRESH_COUNT_FIELD"].number = 2
()["SC_13402_REFRESH_COUNT_FIELD"].index = 1
()["SC_13402_REFRESH_COUNT_FIELD"].label = 2
()["SC_13402_REFRESH_COUNT_FIELD"].has_default_value = false
()["SC_13402_REFRESH_COUNT_FIELD"].default_value = 0
()["SC_13402_REFRESH_COUNT_FIELD"].type = 13
()["SC_13402_REFRESH_COUNT_FIELD"].cpp_type = 3
()["SC_13402_CHAPTER_LIST_FIELD"].name = "chapter_list"
()["SC_13402_CHAPTER_LIST_FIELD"].full_name = "p13.sc_13402.chapter_list"
()["SC_13402_CHAPTER_LIST_FIELD"].number = 3
()["SC_13402_CHAPTER_LIST_FIELD"].index = 2
()["SC_13402_CHAPTER_LIST_FIELD"].label = 3
()["SC_13402_CHAPTER_LIST_FIELD"].has_default_value = false
()["SC_13402_CHAPTER_LIST_FIELD"].default_value = {}
()["SC_13402_CHAPTER_LIST_FIELD"].message_type = PRO_CHAPTER_SUBMARINE
()["SC_13402_CHAPTER_LIST_FIELD"].type = 11
()["SC_13402_CHAPTER_LIST_FIELD"].cpp_type = 10
()["SC_13402_PROGRESS_FIELD"].name = "progress"
()["SC_13402_PROGRESS_FIELD"].full_name = "p13.sc_13402.progress"
()["SC_13402_PROGRESS_FIELD"].number = 4
()["SC_13402_PROGRESS_FIELD"].index = 3
()["SC_13402_PROGRESS_FIELD"].label = 2
()["SC_13402_PROGRESS_FIELD"].has_default_value = false
()["SC_13402_PROGRESS_FIELD"].default_value = 0
()["SC_13402_PROGRESS_FIELD"].type = 13
()["SC_13402_PROGRESS_FIELD"].cpp_type = 3
SC_13402.name = "sc_13402"
SC_13402.full_name = "p13.sc_13402"
SC_13402.nested_types = {}
SC_13402.enum_types = {}
SC_13402.fields = {
()["SC_13402_NEXT_REFRESH_TIME_FIELD"],
()["SC_13402_REFRESH_COUNT_FIELD"],
()["SC_13402_CHAPTER_LIST_FIELD"],
()["SC_13402_PROGRESS_FIELD"]
}
SC_13402.is_extendable = false
SC_13402.extensions = {}
()["CS_13403_TYPE_FIELD"].name = "type"
()["CS_13403_TYPE_FIELD"].full_name = "p13.cs_13403.type"
()["CS_13403_TYPE_FIELD"].number = 2
()["CS_13403_TYPE_FIELD"].index = 0
()["CS_13403_TYPE_FIELD"].label = 2
()["CS_13403_TYPE_FIELD"].has_default_value = false
()["CS_13403_TYPE_FIELD"].default_value = 0
()["CS_13403_TYPE_FIELD"].type = 13
()["CS_13403_TYPE_FIELD"].cpp_type = 3
CS_13403.name = "cs_13403"
CS_13403.full_name = "p13.cs_13403"
CS_13403.nested_types = {}
CS_13403.enum_types = {}
CS_13403.fields = {
()["CS_13403_TYPE_FIELD"]
}
CS_13403.is_extendable = false
CS_13403.extensions = {}
()["SC_13404_RESULT_FIELD"].name = "result"
()["SC_13404_RESULT_FIELD"].full_name = "p13.sc_13404.result"
()["SC_13404_RESULT_FIELD"].number = 1
()["SC_13404_RESULT_FIELD"].index = 0
()["SC_13404_RESULT_FIELD"].label = 2
()["SC_13404_RESULT_FIELD"].has_default_value = false
()["SC_13404_RESULT_FIELD"].default_value = 0
()["SC_13404_RESULT_FIELD"].type = 13
()["SC_13404_RESULT_FIELD"].cpp_type = 3
()["SC_13404_CHAPTER_ID_FIELD"].name = "chapter_id"
()["SC_13404_CHAPTER_ID_FIELD"].full_name = "p13.sc_13404.chapter_id"
()["SC_13404_CHAPTER_ID_FIELD"].number = 2
()["SC_13404_CHAPTER_ID_FIELD"].index = 1
()["SC_13404_CHAPTER_ID_FIELD"].label = 1
()["SC_13404_CHAPTER_ID_FIELD"].has_default_value = false
()["SC_13404_CHAPTER_ID_FIELD"].default_value = nil
()["SC_13404_CHAPTER_ID_FIELD"].message_type = PRO_CHAPTER_SUBMARINE
()["SC_13404_CHAPTER_ID_FIELD"].type = 11
()["SC_13404_CHAPTER_ID_FIELD"].cpp_type = 10
SC_13404.name = "sc_13404"
SC_13404.full_name = "p13.sc_13404"
SC_13404.nested_types = {}
SC_13404.enum_types = {}
SC_13404.fields = {
()["SC_13404_RESULT_FIELD"],
()["SC_13404_CHAPTER_ID_FIELD"]
}
SC_13404.is_extendable = false
SC_13404.extensions = {}
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].name = "chapter_id"
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].full_name = "p13.pro_chapter_submarine.chapter_id"
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].number = 1
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].index = 0
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].label = 2
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].has_default_value = false
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].default_value = 0
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].type = 13
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"].cpp_type = 3
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].name = "active_time"
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].full_name = "p13.pro_chapter_submarine.active_time"
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].number = 2
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].index = 1
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].label = 2
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].has_default_value = false
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].default_value = 0
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].type = 13
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"].cpp_type = 3
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].name = "index"
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].full_name = "p13.pro_chapter_submarine.index"
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].number = 3
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].index = 2
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].label = 2
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].has_default_value = false
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].default_value = 0
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].type = 13
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"].cpp_type = 3
PRO_CHAPTER_SUBMARINE.name = "pro_chapter_submarine"
PRO_CHAPTER_SUBMARINE.full_name = "p13.pro_chapter_submarine"
PRO_CHAPTER_SUBMARINE.nested_types = {}
PRO_CHAPTER_SUBMARINE.enum_types = {}
PRO_CHAPTER_SUBMARINE.fields = {
()["PRO_CHAPTER_SUBMARINE_CHAPTER_ID_FIELD"],
()["PRO_CHAPTER_SUBMARINE_ACTIVE_TIME_FIELD"],
()["PRO_CHAPTER_SUBMARINE_INDEX_FIELD"]
}
PRO_CHAPTER_SUBMARINE.is_extendable = false
PRO_CHAPTER_SUBMARINE.extensions = {}
()["REACTCHAPTER_INFO_COUNT_FIELD"].name = "count"
()["REACTCHAPTER_INFO_COUNT_FIELD"].full_name = "p13.reactchapter_info.count"
()["REACTCHAPTER_INFO_COUNT_FIELD"].number = 1
()["REACTCHAPTER_INFO_COUNT_FIELD"].index = 0
()["REACTCHAPTER_INFO_COUNT_FIELD"].label = 2
()["REACTCHAPTER_INFO_COUNT_FIELD"].has_default_value = false
()["REACTCHAPTER_INFO_COUNT_FIELD"].default_value = 0
()["REACTCHAPTER_INFO_COUNT_FIELD"].type = 13
()["REACTCHAPTER_INFO_COUNT_FIELD"].cpp_type = 3
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].name = "active_timestamp"
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].full_name = "p13.reactchapter_info.active_timestamp"
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].number = 2
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].index = 1
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].label = 2
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].has_default_value = false
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].default_value = 0
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].type = 13
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"].cpp_type = 3
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].name = "active_id"
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].full_name = "p13.reactchapter_info.active_id"
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].number = 3
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].index = 2
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].label = 2
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].has_default_value = false
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].default_value = 0
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].type = 13
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"].cpp_type = 3
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].name = "daily_count"
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].full_name = "p13.reactchapter_info.daily_count"
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].number = 4
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].index = 3
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].label = 2
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].has_default_value = false
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].default_value = 0
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].type = 13
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"].cpp_type = 3
REACTCHAPTER_INFO.name = "reactchapter_info"
REACTCHAPTER_INFO.full_name = "p13.reactchapter_info"
REACTCHAPTER_INFO.nested_types = {}
REACTCHAPTER_INFO.enum_types = {}
REACTCHAPTER_INFO.fields = {
()["REACTCHAPTER_INFO_COUNT_FIELD"],
()["REACTCHAPTER_INFO_ACTIVE_TIMESTAMP_FIELD"],
()["REACTCHAPTER_INFO_ACTIVE_ID_FIELD"],
()["REACTCHAPTER_INFO_DAILY_COUNT_FIELD"]
}
REACTCHAPTER_INFO.is_extendable = false
REACTCHAPTER_INFO.extensions = {}
()["CS_13501_ACTIVE_ID_FIELD"].name = "active_id"
()["CS_13501_ACTIVE_ID_FIELD"].full_name = "p13.cs_13501.active_id"
()["CS_13501_ACTIVE_ID_FIELD"].number = 1
()["CS_13501_ACTIVE_ID_FIELD"].index = 0
()["CS_13501_ACTIVE_ID_FIELD"].label = 2
()["CS_13501_ACTIVE_ID_FIELD"].has_default_value = false
()["CS_13501_ACTIVE_ID_FIELD"].default_value = 0
()["CS_13501_ACTIVE_ID_FIELD"].type = 13
()["CS_13501_ACTIVE_ID_FIELD"].cpp_type = 3
CS_13501.name = "cs_13501"
CS_13501.full_name = "p13.cs_13501"
CS_13501.nested_types = {}
CS_13501.enum_types = {}
CS_13501.fields = {
()["CS_13501_ACTIVE_ID_FIELD"]
}
CS_13501.is_extendable = false
CS_13501.extensions = {}
()["SC_13502_RESULT_FIELD"].name = "result"
()["SC_13502_RESULT_FIELD"].full_name = "p13.sc_13502.result"
()["SC_13502_RESULT_FIELD"].number = 1
()["SC_13502_RESULT_FIELD"].index = 0
()["SC_13502_RESULT_FIELD"].label = 2
()["SC_13502_RESULT_FIELD"].has_default_value = false
()["SC_13502_RESULT_FIELD"].default_value = 0
()["SC_13502_RESULT_FIELD"].type = 13
()["SC_13502_RESULT_FIELD"].cpp_type = 3
SC_13502.name = "sc_13502"
SC_13502.full_name = "p13.sc_13502"
SC_13502.nested_types = {}
SC_13502.enum_types = {}
SC_13502.fields = {
()["SC_13502_RESULT_FIELD"]
}
SC_13502.is_extendable = false
SC_13502.extensions = {}
()["CS_13503_TYPE_FIELD"].name = "type"
()["CS_13503_TYPE_FIELD"].full_name = "p13.cs_13503.type"
()["CS_13503_TYPE_FIELD"].number = 1
()["CS_13503_TYPE_FIELD"].index = 0
()["CS_13503_TYPE_FIELD"].label = 2
()["CS_13503_TYPE_FIELD"].has_default_value = false
()["CS_13503_TYPE_FIELD"].default_value = 0
()["CS_13503_TYPE_FIELD"].type = 13
()["CS_13503_TYPE_FIELD"].cpp_type = 3
CS_13503.name = "cs_13503"
CS_13503.full_name = "p13.cs_13503"
CS_13503.nested_types = {}
CS_13503.enum_types = {}
CS_13503.fields = {
()["CS_13503_TYPE_FIELD"]
}
CS_13503.is_extendable = false
CS_13503.extensions = {}
()["SC_13504_RESULT_FIELD"].name = "result"
()["SC_13504_RESULT_FIELD"].full_name = "p13.sc_13504.result"
()["SC_13504_RESULT_FIELD"].number = 1
()["SC_13504_RESULT_FIELD"].index = 0
()["SC_13504_RESULT_FIELD"].label = 2
()["SC_13504_RESULT_FIELD"].has_default_value = false
()["SC_13504_RESULT_FIELD"].default_value = 0
()["SC_13504_RESULT_FIELD"].type = 13
()["SC_13504_RESULT_FIELD"].cpp_type = 3
SC_13504.name = "sc_13504"
SC_13504.full_name = "p13.sc_13504"
SC_13504.nested_types = {}
SC_13504.enum_types = {}
SC_13504.fields = {
()["SC_13504_RESULT_FIELD"]
}
SC_13504.is_extendable = false
SC_13504.extensions = {}
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].name = "key"
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].full_name = "p13.fleetDutykeyValuePair.key"
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].number = 1
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].index = 0
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].label = 2
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].has_default_value = false
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].default_value = 0
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].type = 13
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"].cpp_type = 3
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].name = "value"
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].full_name = "p13.fleetDutykeyValuePair.value"
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].number = 2
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].index = 1
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].label = 2
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].has_default_value = false
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].default_value = 0
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].type = 13
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"].cpp_type = 3
FLEETDUTYKEYVALUEPAIR.name = "fleetDutykeyValuePair"
FLEETDUTYKEYVALUEPAIR.full_name = "p13.fleetDutykeyValuePair"
FLEETDUTYKEYVALUEPAIR.nested_types = {}
FLEETDUTYKEYVALUEPAIR.enum_types = {}
FLEETDUTYKEYVALUEPAIR.fields = {
()["FLEETDUTYKEYVALUEPAIR_KEY_FIELD"],
()["FLEETDUTYKEYVALUEPAIR_VALUE_FIELD"]
}
FLEETDUTYKEYVALUEPAIR.is_extendable = false
FLEETDUTYKEYVALUEPAIR.extensions = {}
ai_act = slot0.Message(AI_ACT)
cellflag = slot0.Message(CELLFLAG)
chaptercellinfo = slot0.Message(CHAPTERCELLINFO)
chaptercellpos = slot0.Message(CHAPTERCELLPOS)
chapterinfo = slot0.Message(CHAPTERINFO)
cs_13003 = slot0.Message(CS_13003)
cs_13005 = slot0.Message(CS_13005)
cs_13007 = slot0.Message(CS_13007)
cs_13009 = slot0.Message(CS_13009)
cs_13101 = slot0.Message(CS_13101)
cs_13103 = slot0.Message(CS_13103)
cs_13107 = slot0.Message(CS_13107)
cs_13109 = slot0.Message(CS_13109)
cs_13301 = slot0.Message(CS_13301)
cs_13401 = slot0.Message(CS_13401)
cs_13403 = slot0.Message(CS_13403)
cs_13501 = slot0.Message(CS_13501)
cs_13503 = slot0.Message(CS_13503)
currentchapterinfo = slot0.Message(CURRENTCHAPTERINFO)
elitefleetinfo = slot0.Message(ELITEFLEETINFO)
escort_info = slot0.Message(ESCORT_INFO)
escort_pos = slot0.Message(ESCORT_POS)
expedition_daily_count = slot0.Message(EXPEDITION_DAILY_COUNT)
fleetDutykeyValuePair = slot0.Message(FLEETDUTYKEYVALUEPAIR)
groupinchapter = slot0.Message(GROUPINCHAPTER)
pro_chapter_submarine = slot0.Message(PRO_CHAPTER_SUBMARINE)
reactchapter_info = slot0.Message(REACTCHAPTER_INFO)
sc_13001 = slot0.Message(SC_13001)
sc_13002 = slot0.Message(SC_13002)
sc_13004 = slot0.Message(SC_13004)
sc_13006 = slot0.Message(SC_13006)
sc_13008 = slot0.Message(SC_13008)
sc_13010 = slot0.Message(SC_13010)
sc_13011 = slot0.Message(SC_13011)
sc_13102 = slot0.Message(SC_13102)
sc_13104 = slot0.Message(SC_13104)
sc_13105 = slot0.Message(SC_13105)
sc_13108 = slot0.Message(SC_13108)
sc_13110 = slot0.Message(SC_13110)
sc_13201 = slot0.Message(SC_13201)
sc_13302 = slot0.Message(SC_13302)
sc_13402 = slot0.Message(SC_13402)
sc_13404 = slot0.Message(SC_13404)
sc_13502 = slot0.Message(SC_13502)
sc_13504 = slot0.Message(SC_13504)
shipinchapter = slot0.Message(SHIPINCHAPTER)
strategyinfo = slot0.Message(STRATEGYINFO)
return
|
sneeker = {}
sneeker.modname = core.get_current_modname()
sneeker.modpath = core.get_modpath(sneeker.modname)
local debugging = core.settings:get_bool("enable_debug_mods", false)
sneeker.log = function(lvl, msg)
if lvl == "debug" and not debugging then return end
if msg == nil then
msg = lvl
lvl = nil
end
msg = "[" .. sneeker.modname .. "] " .. msg
if lvl == "debug" then
msg = "[DEBUG]" .. msg
lvl = nil;
end
if not lvl then
core.log(msg)
else
core.log(lvl, msg)
end
end
local scripts = {
"settings",
"tnt_function",
"spawn",
}
for _, script in ipairs(scripts) do
dofile(sneeker.modpath .. "/" .. script .. ".lua")
end
local function jump(self, pos, direction)
local velocity = self.object:get_velocity()
if core.registered_nodes[core.get_node(pos).name].climbable then
self.object:set_velocity({x=velocity.x, y=4, z=velocity.z})
return
end
local spos = {x=pos.x+direction.x, y=pos.y, z=pos.z+direction.z}
local node = core.get_node_or_nil(spos)
spos.y = spos.y+1
local node2 = core.get_node_or_nil(spos)
local def, def2 = {}
if node and node.name then
def = core.registered_items[node.name]
end
if node2 and node2.name then
def2 = core.registered_items[node2.name]
end
if def and def.walkable
and def2 and not def2.walkable
and def.drawtype ~= "fencelike" then
self.object:set_velocity({
x = velocity.x*2.2,
y = self.jump_height,
z = velocity.z*2.2
})
end
end
local function random_turn(self)
if self.turn_timer > math.random(2, 5) then
local select_turn = math.random(1, 3)
if select_turn == 1 then
self.turn = "left"
elseif select_turn == 2 then
self.turn = "right"
elseif select_turn == 3 then
self.turn = "straight"
end
self.turn_timer = 0
self.turn_speed = 0.05*math.random()
end
end
local def = {
hp_max = 20,
physical = true,
collisionbox = {-0.25, -0.7, -0.25, 0.25, 0.8, 0.25},
visual = "mesh",
mesh = "character.b3d",
textures = {"sneeker.png"},
makes_footstep_sound = false,
-- Original
animation = {
stand_START = 0,
stand_END = 79,
walk_START = 168,
walk_END = 187
},
walk_speed = 1.5,
jump_height = 5,
animation_speed = 30,
knockback_level = 2
}
def.on_activate = function(self, staticdata)
self.yaw = 0
self.anim = 1
self.timer = 0
self.visualx = 1
self.jump_timer = 0
self.turn_timer = 0
self.turn_speed = 0
self.powered = false
self.knockback = false
self.state = math.random(1, 2)
self.old_y = self.object:get_pos().y
-- despawning
self.lifetime = sneeker.lifetime
self.lifetimer = 0
self.check_despawn_player_distance = true
local data = core.deserialize(staticdata)
if data and type(data) == "table" then
if data.powered == true then
self.powered = true
self.object:set_properties({textures = {"sneeker_powered.png"}})
end
else
if math.random(0, 20) == 20 then
self.powered = true
self.object:set_properties({textures = {"sneeker_powered.png"}})
end
end
end
local function isnan(n)
return tostring(n) == tostring((-1)^.5)
end
def.on_step = function(self, dtime)
-- update lifetime timer
-- FIXME: this is longer than realtime
self.lifetimer = self.lifetimer + dtime
if self.lifetimer >= self.lifetime then
-- TODO: should have a death animation
self.object:remove()
return true
end
if self.knockback then
return false
end
local ANIM_STAND = 1
local ANIM_WALK = 2
local pos = self.object:get_pos()
if sneeker.despawn_player_far then
-- run check about once per 60 seconds
local interval_reached = math.floor(self.lifetimer % 60) == 0
if not interval_reached and not self.check_despawn_player_distance then
self.check_despawn_player_distance = true
end
if interval_reached and self.check_despawn_player_distance then
local player_nearby = false
for _, entity in ipairs(core.get_objects_inside_radius(pos, sneeker.despawn_player_radius)) do
if entity:is_player() then
player_nearby = true
break
end
end
if not player_nearby then
self.object:remove()
return true
end
-- set flag to not check again until next interval
self.check_despawn_player_distance = false
end
end
local yaw = self.object:get_yaw()
local inside = core.get_objects_inside_radius(pos, 10)
local walk_speed = self.walk_speed
local animation = self.animation
local anim_speed = self.animation_speed
local velocity = self.object:get_velocity()
self.timer = self.timer+0.01
self.turn_timer = self.turn_timer+0.01
self.jump_timer = self.jump_timer+0.01
if not self.chase
and self.timer > math.random(2, 5) then
if math.random() > 0.8 then
self.state = "stand"
else
self.state = "walk"
end
self.timer = 0
end
if self.turn == "right" then
self.yaw = self.yaw+self.turn_speed
self.object:set_yaw(self.yaw)
elseif self.turn == "left" then
self.yaw = self.yaw-self.turn_speed
self.object:set_yaw(self.yaw)
end
if self.chase and self.visualx < 2 then
if self.hiss == false then
core.sound_play("sneeker_hiss", {pos=pos, gain=1.5, max_hear_distance=2*64})
end
self.visualx = self.visualx+0.05
self.object:set_properties({
visual_size = {x=self.visualx, y=1}
})
self.hiss = true
elseif self.visualx > 1 then
self.visualx = self.visualx-0.05
self.object:set_properties({
visual_size = {x=self.visualx, y=1}
})
self.hiss = false
end
self.chase = false
for _, object in ipairs(inside) do
if object:is_player() then
self.state = "chase"
end
end
if self.state == "stand" then
if self.anim ~= ANIM_STAND then
self.object:set_animation({x=animation.stand_START, y=animation.stand_END}, anim_speed, 0)
self.anim = ANIM_STAND
end
random_turn(self)
if velocity.x ~= 0
or velocity.z ~= 0 then
self.object:set_velocity({x=0, y=velocity.y, z=0})
end
end
if self.state == "walk" then
if self.anim ~= ANIM_WALK then
self.object:set_animation({x=animation.walk_START, y=animation.walk_END}, anim_speed, 0)
self.anim = ANIM_WALK
end
self.direction = {x=math.sin(yaw)*-1, y=-10, z=math.cos(yaw)}
if self.direction then
self.object:set_velocity({x=self.direction.x*walk_speed, y=velocity.y, z=self.direction.z*walk_speed})
end
random_turn(self)
local velocity = self.object:get_velocity()
if self.turn_timer > 1 then
local direction = self.direction
local npos = {x=pos.x+direction.x, y=pos.y+0.2, z=pos.z+direction.z}
if velocity.x == 0 or velocity.z == 0
or core.registered_nodes[core.get_node(npos).name].walkable then
local select_turn = math.random(1, 2)
if select_turn == 1 then
self.turn = "left"
elseif select_turn == 2 then
self.turn = "right"
end
self.turn_timer = 0
self.turn_speed = 0.05*math.random()
end
end
-- Jump
if self.jump_timer > 0.2 then
jump(self, pos, self.direction)
end
end
if self.state == "chase" then
if self.anim ~= ANIM_WALK then
self.object:set_animation({x=animation.walk_START, y=animation.walk_END}, anim_speed, 0)
self.anim = ANIM_WALK
end
self.turn = "straight"
local inside_2 = core.get_objects_inside_radius(pos, 2)
-- Boom
if #inside_2 ~= 0 then
for _, object in ipairs(inside_2) do
if object:is_player() and object:get_hp() ~= 0 then
self.chase = true
if self.visualx >= 2 then
self.object:remove()
sneeker.boom(pos, self.powered)
core.sound_play("sneeker_explode", {pos=pos, gain=sneeker.boom_gain, max_hear_distance=2*64})
return true
end
end
end
end
if #inside ~= 0 then
for _, object in ipairs(inside) do
if object:is_player() and object:get_hp() ~= 0 then
if #inside_2 ~= 0 then
for _, object in ipairs(inside_2) do
-- Stop move
if object:is_player() then
if self.anim ~= ANIM_STAND then
self.object:set_animation({x=animation.stand_START, y=animation.stand_END}, anim_speed, 0)
self.anim = ANIM_STAND
end
self.object:set_velocity({x=0, y=velocity.y, z=0})
return
end
end
end
local ppos = object:get_pos()
self.vec = {x=ppos.x-pos.x, y=ppos.y-pos.y, z=ppos.z-pos.z}
self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2
if ppos.x > pos.x then
self.yaw = self.yaw+math.pi
end
self.yaw = self.yaw-2
self.object:set_yaw(self.yaw)
self.direction = {x=math.sin(self.yaw)*-1, y=0, z=math.cos(self.yaw)}
local direction = self.direction
-- FIXME: hack
local can_set = true
for _, c in ipairs({direction.x*2.5, direction.z*2.5}) do
if isnan(c) then
can_set = false
break
end
end
if can_set then
self.object:set_velocity({x=direction.x*2.5, y=velocity.y, z=direction.z*2.5})
end
-- Jump
if self.jump_timer > 0.2 then
jump(self, pos, direction)
end
end
end
else
self.state = "stand"
end
end
-- Swim
local node = core.get_node(pos)
if core.get_item_group(node.name, "water") ~= 0 then
self.object:set_acceleration({x=0, y=1, z=0})
local velocity = self.object:get_velocity()
if self.object:get_velocity().y > 5 then
self.object:set_velocity({x=0, y=velocity.y-velocity.y/2, z=0})
else
self.object:set_velocity({x=0, y=velocity.y+1, z=0})
end
else
self.object:set_acceleration({x=0, y=-10, z=0})
end
return true
end
def.on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
if self.knockback == false then
local knockback_level = self.knockback_level
self.object:set_velocity({x=dir.x*knockback_level, y=3, z=dir.z*knockback_level})
self.knockback = true
core.after(0.6, function()
self.knockback = false
end)
end
if self.object:get_hp() < 1 then
local pos = self.object:get_pos()
local x = 1/math.random(1, 5)*dir.x
local z = 1/math.random(1, 5)*dir.z
local p = {x=pos.x+x, y=pos.y, z=pos.z+z}
local node = core.get_node_or_nil(p)
if node == nil or not node.name or node.name ~= "air" then
p = pos
end
local obj = core.add_item(p, {name="tnt:gunpowder", count=math.random(0, 2)})
end
end
def.get_staticdata = function(self)
return core.serialize({
powered = self.powered
})
end
core.register_entity("sneeker:sneeker", def)
core.register_craftitem("sneeker:spawnegg", {
description = "Sneeker Spawn Egg",
inventory_image = "sneeker_spawnegg.png",
stack_max = 64,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local pos = pointed_thing.above
pos.y = pos.y+1
core.add_entity(pos, "sneeker:sneeker")
if not core.settings:get_bool("creative_mode", false) then
itemstack:take_item()
end
return itemstack
end
end
})
|
-- 原作:Already Known?
-- 原作者:ahak (https://wow.curseforge.com/projects/alreadyknown)
-- 修改:houshuu
-------------------
-- 主要修改条目:
-- 模块化
-- 增加颜色设定
local E, L, V, P, G = unpack(ElvUI);
local AK = E:NewModule('Wind_AlreadyKnown');
local _G = _G
local r, g, b
local knownTable = {} -- Save known items for later use
local questItems = { -- Quest items and matching quests
-- Equipment Blueprint: Tuskarr Fishing Net
[128491] = 39359, -- Alliance
[128251] = 39359, -- Horde
-- Equipment Blueprint: Unsinkable
[128250] = 39358, -- Alliance
[128489] = 39358, -- Horde
}
local specialItems = { -- Items needing special treatment
-- Krokul Flute -> Flight Master's Whistle
[152964] = { 141605, 11, 269 } -- 269 for Flute applied Whistle, 257 (or anything else than 269) for pre-apply Whistle
}
-- Tooltip and scanning by Phanx @ http://www.wowinterface.com/forums/showthread.php?p=271406
-- Search string by Phanx @ https://github.com/Phanx/BetterBattlePetTooltip/blob/master/Addon.lua
local S_PET_KNOWN = strmatch(_G.ITEM_PET_KNOWN, "[^%(]+")
local scantip = CreateFrame("GameTooltip", "AKScanningTooltip", nil, "GameTooltipTemplate")
scantip:SetOwner(UIParent, "ANCHOR_NONE")
local function _checkIfKnown(itemLink)
if knownTable[itemLink] then -- Check if we have scanned this item already and it was known then
return true
end
local itemID = tonumber(itemLink:match("item:(%d+)"))
if itemID and questItems[itemID] then -- Check if item is a quest item.
if IsQuestFlaggedCompleted(questItems[itemID]) then -- Check if the quest for item is already done.
knownTable[itemLink] = true -- Mark as known for later use
return true -- This quest item is already known
end
return false -- Quest item is uncollected... or something went wrong
elseif itemID and specialItems[itemID] then -- Check if we need special handling, this is most likely going to break with then next item we add to this
local specialData = specialItems[itemID]
local _, specialLink = GetItemInfo(specialData[1])
if specialLink then
local specialTbl = { strsplit(":", specialLink) }
local specialInfo = tonumber(specialTbl[specialData[2]])
if specialInfo == specialData[3] then
knownTable[itemLink] = true -- Mark as known for later use
return true -- This specialItem is already known
end
end
return false -- Item is specialItem, but data isn't special
end
if itemLink:match("|H(.-):") == "battlepet" then -- Check if item is Caged Battlepet (dummy item 82800)
local _, battlepetID = strsplit(":", itemLink)
if C_PetJournal.GetNumCollectedInfo(battlepetID) > 0 then
knownTable[itemLink] = true -- Mark as known for later use
return true -- Battlepet is collected
end
return false -- Battlepet is uncollected... or something went wrong
end
scantip:ClearLines()
scantip:SetHyperlink(itemLink)
--for i = 2, scantip:NumLines() do -- Line 1 is always the name so you can skip it.
local lines = scantip:NumLines()
for i = 2, lines do -- Line 1 is always the name so you can skip it.
local text = _G["AKScanningTooltipTextLeft"..i]:GetText()
if text == _G.ITEM_SPELL_KNOWN or strmatch(text, S_PET_KNOWN) then
--knownTable[itemLink] = true -- Mark as known for later use
--return true -- Item is known and collected
if lines - i <= 3 then -- Mounts have Riding skill and Reputation requirements under Already Known -line
knownTable[itemLink] = true -- Mark as known for later use
end
elseif text == _G.TOY and _G["AKScanningTooltipTextLeft"..i + 2] and _G["AKScanningTooltipTextLeft"..i + 2]:GetText() == _G.ITEM_SPELL_KNOWN then
-- Check if items is Toy already known
knownTable[itemLink] = true
end
end
--return false -- Item is not known, uncollected... or something went wrong
return knownTable[itemLink] and true or false
end
local function _hookAH() -- Most of this found from AddOns/Blizzard_AuctionUI/Blizzard_AuctionUI.lua
local offset = FauxScrollFrame_GetOffset(BrowseScrollFrame)
for i=1, _G.NUM_BROWSE_TO_DISPLAY do
if (_G["BrowseButton"..i.."Item"] and _G["BrowseButton"..i.."ItemIconTexture"]) or _G["BrowseButton"..i].id then -- Something to do with ARL?
local itemLink
if _G["BrowseButton"..i].id then
itemLink = GetAuctionItemLink('list', _G["BrowseButton"..i].id)
else
itemLink = GetAuctionItemLink('list', offset + i)
end
if itemLink and _checkIfKnown(itemLink) then
if _G["BrowseButton"..i].id then
_G["BrowseButton"..i].Icon:SetVertexColor(r, g, b)
else
_G["BrowseButton"..i.."ItemIconTexture"]:SetVertexColor(r, g, b)
end
else
if _G["BrowseButton"..i].id then
_G["BrowseButton"..i].Icon:SetVertexColor(1, 1, 1)
_G["BrowseButton"..i].Icon:SetDesaturated(false)
else
_G["BrowseButton"..i.."ItemIconTexture"]:SetVertexColor(1, 1, 1)
_G["BrowseButton"..i.."ItemIconTexture"]:SetDesaturated(false)
end
end
end
end
end
local function _hookMerchant() -- Most of this found from FrameXML/MerchantFrame.lua
for i = 1, _G.MERCHANT_ITEMS_PER_PAGE do
local index = (((MerchantFrame.page - 1) * _G.MERCHANT_ITEMS_PER_PAGE) + i)
local itemButton = _G["MerchantItem"..i.."ItemButton"]
local merchantButton = _G["MerchantItem"..i]
local itemLink = GetMerchantItemLink(index)
if itemLink and _checkIfKnown(itemLink) then
SetItemButtonNameFrameVertexColor(merchantButton, r, g, b)
SetItemButtonSlotVertexColor(merchantButton, r, g, b)
SetItemButtonTextureVertexColor(itemButton, .8*r, .8*g, .8*b)
SetItemButtonNormalTextureVertexColor(itemButton, .8*r, .8*g, .8*b)
else
_G["MerchantItem"..i.."ItemButtonIconTexture"]:SetDesaturated(false)
end
end
end
function AK:Initialize()
self.db = E.db.WindTools["Trade"]["Already Known"]
if not self.db.enabled then return end
r, g, b = self.db.color.r, self.db.color.g, self.db.color.b
-- 商店頁面
hooksecurefunc("MerchantFrame_UpdateMerchantInfo", _hookMerchant)
-- AH載入
if IsAddOnLoaded("Blizzard_AuctionUI") then
if IsAddOnLoaded("Auc-Advanced") and _G.AucAdvanced.Settings.GetSetting("util.compactui.activated") then
hooksecurefunc("GetNumAuctionItems", _hookAH)
else
hooksecurefunc("AuctionFrameBrowse_Update", _hookAH)
end
else
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, ...)
if event == "ADDON_LOADED" and (...) == "Blizzard_AuctionUI" then
self:UnregisterEvent(event)
if IsAddOnLoaded("Auc-Advanced") and _G.AucAdvanced.Settings.GetSetting("util.compactui.activated") then
hooksecurefunc("GetNumAuctionItems", _hookAH)
else
hooksecurefunc("AuctionFrameBrowse_Update", _hookAH)
end
end
end)
end
end
local function InitializeCallback()
AK:Initialize()
end
E:RegisterModule(AK:GetName(), InitializeCallback)
|
require("mod.weird_thing.data.init")
|
BLT.Items.Menu = BLT.Items.Menu or class(BLT.Items.Item)
local Menu = BLT.Items.Menu
Menu.type_name = "Menu"
function Menu:Init(params)
self:WorkParams(params)
self.menu_type = true
self.panel = self.parent_panel:panel({
name = self.name .. "_panel",
w = self.w,
h = self.h,
visible = self.visible == true,
layer = self.layer or 1,
})
self.bg = self.panel:rect({
name = "background",
halign = "grow",
valign = "grow",
visible = not not self.background_color and self.background_visible,
render_template = self.background_blur and "VertexColorTexturedBlur3D",
texture = self.background_blur and "units/vanilla/textures/generic/small/white_df",
color = self.background_color,
alpha = self.background_alpha,
layer = 0
})
self._scroll = ScrollablePanel:new(self.panel, "ItemsPanel", {
layer = 4,
padding = 0.0001,
scroll_width = self.scrollbar == false and 0 or self.scroll_width,
color = self.scroll_color or self.highlight_color,
scroll_speed = self.scroll_speed
})
self.items_panel = self._scroll:canvas()
self._my_items = self._my_items or {}
self._reachable_items = self._reachable_items or {}
self._visible_items = {}
self:Reposition()
self:SetEnabled(self.enabled)
self:SetVisible(self.visible)
self:GrowHeight()
end
function Menu:GrowHeight(speed)
self:AlignItems()
end
function Menu:SetScrollSpeed(speed)
self.scroll_speed = speed
self._scroll._scroll_speed = self.scroll_speed
end
function Menu:ReloadInterface()
self.panel:child("background"):configure({
--visible = self.background_color ~= nil and self.background_visible,
--render_template = self.background_blur and "VertexColorTexturedBlur3D" or "VertexColorTextured",
--texture = self.background_blur and "guis/textures/test_blur_df" or "units/white_df",
color = self.background_color,
alpha = self.background_alpha,
})
self._scroll:set_scroll_color(self.scroll_color or self.highlight_color)
self:RecreateItems()
end
function Menu:WorkParams(params)
Menu.super.WorkParams(self, params)
params = params or {}
self:WorkParam("scroll_width", 12)
self:WorkParam("scroll_speed", 48)
self.background_visible = NotNil(self.background_visible, self.type_name == "Menu" and true or false)
self.private.background_color = NotNil(self.private.background_color, self.background_visible and self.background_color or nil)
self.auto_align = NotNil(self.auto_align, true)
self.auto_height = NotNil(self.auto_height, self.type_name == "Group" and true or false)
self.scrollbar = NotNil(self.scrollbar, self.auto_height ~= true or self.min_height ~= nil or self.max_height ~= nil)
if self.w == "half" then
self.w = self.parent_panel:w() / 2
end
end
function Menu:SetLayer(layer)
Menu.super.SetLayer(self, layer)
end
function Menu:AdditionalHeight()
return self:title_alive() and self.title:h() or 0
end
function Menu:SetSize(w, h, no_recreate)
self.orig_h = h
self:_SetSize(w, h, no_recreate)
end
function Menu:_SetSize(w, h, no_recreate)
if not self:alive() then
return
end
w = w or self.w
h = self.closed and self:AdditionalHeight() or (h or self.orig_h or self.h)
h = math.clamp(h, self.min_height or 0, self.max_height or h)
self.panel:set_size(w, h)
self:SetScrollPanelSize()
self.w = w
self.h = h
self:Reposition()
if not no_recreate then
self:RecreateItems()
end
self:MakeBorder()
end
function Menu:SetScrollPanelSize()
if not self:alive() or not self._scroll:alive() then
return
end
self._scroll:set_size(self.panel:w(), self.panel:h() - self:AdditionalHeight())
self._scroll:panel():set_bottom(self:Height())
end
function Menu:KeyPressed(o, k)
if self:Enabled() and (self:MouseFocused(x, y) or self.reach_ignore_focus) then
local dir = k == Idstring("down") and 1 or k == Idstring("up") and -1
local h = self.menu._highlighted
local next_item
if dir then
local next_index = (h and table.get_key(self._reachable_items, h) or (dir == 1 and 0 or #self._reachable_items)) + dir
if next_index > #self._reachable_items then
next_index = 1
elseif next_index < 1 then
next_index = #self._reachable_items
end
next_item = self._reachable_items[next_index]
end
if next_item then
next_item:Highlight()
return true
end
end
end
function Menu:MouseDoubleClick(button, x, y)
local menu = self.menu
if self:Enabled() then
if menu._highlighted and menu._highlighted.parent == self then
if menu._highlighted.MouseDoubleClick and menu._highlighted:MouseDoubleClick(button, x, y) then
return true
end
end
end
end
function Menu:MousePressed(button, x, y)
local menu = self.menu
if self:Enabled() then
for _, item in pairs(self._visible_items) do
if item:MousePressed(button, x, y) then
return true
end
end
if button == Idstring("0") then
if self._scroll:mouse_pressed(button, x, y) then
menu._scroll_hold = true
self:CheckItems()
return true
end
elseif self.scrollbar and self._scroll:is_scrollable() then
if button == Idstring("mouse wheel down") then
if self._scroll:scroll(x, y, -1) then
if menu._highlighted and menu._highlighted.parent == self then
menu._highlighted:MouseMoved(x,y)
end
self:CheckItems()
return true
end
elseif button == Idstring("mouse wheel up") then
if self._scroll:scroll(x, y, 1) then
if menu._highlighted and menu._highlighted.parent == self then
menu._highlighted:MouseMoved(x,y)
end
self:CheckItems()
return true
end
end
end
end
return false
end
function Menu:MouseMoved(x, y)
if self:Enabled() and self:MouseFocused(x, y) then
local _, pointer = self._scroll:mouse_moved(nil, x, y)
if pointer then
self:CheckItems()
if managers.mouse_pointer.set_pointer_image then
managers.mouse_pointer:set_pointer_image(pointer)
end
return true
else
if managers.mouse_pointer.set_pointer_image then
managers.mouse_pointer:set_pointer_image("arrow")
end
end
for _, item in pairs(self._visible_items) do
if item:MouseMoved(x, y) then
return true
end
end
end
return false
end
function Menu:CheckItems()
self._visible_items = {}
for _, item in pairs(self._my_items) do
if item:TryRendering() and (not item.override_panel or item.override_panel == self) then
table.insert(self._visible_items, item)
end
end
end
function Menu:MouseReleased(button, x, y)
self._scroll:mouse_released(button, x, y)
if not self.menu._highlighted then
managers.mouse_pointer:set_pointer_image("arrow")
end
for _, item in pairs(self._my_items) do
if item:MouseReleased(button, x, y) then
return true
end
end
end
function Menu:SetVisible(visible, animate, no_align)
local panel = self:Panel()
if not alive(panel) then
return
end
local was_visible = self.visible
BLT.Items.Item.super.SetVisible(self, visible, true)
if animate and visible and not was_visible then
panel:set_alpha(0)
play_anim(panel, {set = {alpha = 1}, time = 0.2})
end
if not no_align and self.parent.auto_align then
self.parent:AlignItems()
end
self.menu:CheckOpenedList()
end
function Menu:AlignItemsGrid(animate)
if not self:alive() then
return
end
local prev_item
local max_h = 0
local max_x = 0
local max_y = 0
for i, item in pairs(self._my_items) do
if not item.ignore_align and item:Visible() then
local offset = item:Offset()
local panel = item:Panel()
if panel:w() + (max_x + offset[1]) - self:ItemsWidth() > 0.001 then
max_y = max_h
max_x = 0
end
local x, y = max_x + offset[1], max_y + offset[2]
if animate then
play_anim(panel, {set = {x = x, y = y}})
else
panel:set_position(x, y)
end
local repos = item:Reposition()
if not repos or item.count_as_aligned then
prev_item = item
max_x = math.max(max_x, x + panel:w())
end
if (not repos or item.count_as_aligned or item.count_height) then
max_h = math.max(max_h, repos and item:Bottom() or y + panel:h())
end
end
end
local actual_max_h = max_h
max_h = max_h + self:AdditionalHeight() + (self.last_y_offset or (prev_item and prev_item:Offset()[2] or 0))
if self.auto_height and self.h ~= max_h then
self:_SetSize(nil, max_h, true)
end
self:UpdateCanvas(actual_max_h)
end
function Menu:AlignItems(menus)
if self.align_method == "grid" then
self:AlignItemsGrid(self.animate_align)
else
self:AlignItemsNormal(self.animate_align)
end
if self.parent.AlignItems then
self.parent:AlignItems()
end
if menus then
for _, item in pairs(self._my_items) do
if item.menu_type then
item:AlignItems(true)
end
end
end
end
function Menu:AlignItemsNormal(animate)
if not self:alive() then
return
end
local max_h = 0
local prev_item
for i, item in pairs(self._my_items) do
if not item.ignore_align and item:Visible() then
local offset = item:Offset()
local panel = item:Panel()
local x,y = offset[1], offset[2]
if alive(prev_item) then
y = y + prev_item:Panel():bottom()
end
if animate then
play_anim(panel, {set = {x = x, y = y}})
else
panel:set_position(x,y)
end
local repos = item:Reposition()
if not repos or item.count_as_aligned then
prev_item = item
end
if not repos or item.count_as_aligned or item.count_height then
max_h = math.max(max_h, repos and item:Bottom() or y + panel:h())
end
end
end
local actual_max_h = max_h
max_h = max_h + self:AdditionalHeight() + (self.last_y_offset or (prev_item and prev_item:Offset()[2] or 0))
if self.auto_height and self.h ~= max_h then
self:_SetSize(nil, max_h, true)
end
self:UpdateCanvas(actual_max_h)
end
function Menu:UpdateCanvas(max_h)
if not self:alive() then
return
end
if self.type_name == "Group" then
self:SetScrollPanelSize()
end
self._scroll:update_canvas_size(max_h)
self:CheckItems()
end
function Menu:GetMenu(name, shallow)
for _, menu in pairs(self._my_items) do
if menu.menu_type then
if menu.name == name then
return menu
elseif not shallow then
local item = menu:GetMenu(name)
if item and item.name then
return item
end
end
end
end
return false
end
function Menu:GetItem(name, shallow)
for _, item in pairs(self._my_items) do
if item.name == name then
return item
elseif item.menu_type and not shallow then
local i = item:GetItem(name)
if i then
return i
end
end
end
return nil
end
function Menu:GetItemByLabel(label, shallow)
for _, item in pairs(self._my_items) do
if item.label == label then
return item
elseif item.menu_type and not shallow then
local i = item:GetItemByLabel(label)
if i then
return i
end
end
end
return nil
end
function Menu:ClearItems(label)
local temp = clone(self._my_items)
self._my_items = {}
self._reachable_items = {}
for _, item in pairs(temp) do
if not label or type(label) == "table" or item.label == label then
self:RemoveItem(item)
elseif item:alive() then
table.insert(self._my_items, item)
if item.reachable then
table.insert(self._reachable_items, item)
end
end
end
self.menu:CheckOpenedList()
if self.auto_align then
self:AlignItems(true)
end
self:UpdateCanvas()
end
function Menu:RecreateItems()
for _, item in pairs(self._my_items) do
self:RecreateItem(item)
end
if self.auto_align then
self:AlignItems(true)
end
end
function Menu:RecreateItem(item, align_items)
if item.list then
item.list:parent():remove(item.list)
end
local panel = item:Panel()
if alive(panel) then
panel:parent():remove(panel)
end
if item.override_panel then
table.delete(item.override_panel._adopted_items, item)
if item.override_panel.Panel then
item.parent_panel = item.override_panel:Panel()
end
end
item.parent_panel = alive(item.parent_panel) and item.parent_panel or self.items_panel
item:Init()
item:PostInit()
if item.menu_type then
item:RecreateItems()
end
if align_items then
self:AlignItems(true)
end
end
function Menu:RemoveItem(item)
if not item then
return
end
if item.menu_type then
item:ClearItems()
end
if item._adopted_items then
for _, v in pairs(item._adopted_items) do
v.override_panel = nil
v:Destroy()
end
end
if item.override_panel then
table.delete(item.override_panel._adopted_items, item)
end
if item.list then
item.list:parent():remove(item.list)
end
table.delete(self._reachable_items, item)
table.delete(self._my_items, item)
table.delete(self._adopted_items, item)
local panel = item:Panel()
if alive(panel) then
panel:parent():remove(panel)
end
if self.auto_align then
self:AlignItems()
end
end
function Menu:ShouldClose()
for _, item in pairs(self._my_items) do
if item.menu_type and not item:ShouldClose() then
return false
end
if (item._textbox and item._textbox.cantype) or item.CanEdit then
return false
end
end
return true
end
function Menu:Items() return self._my_items end
function Menu:ItemsWidth() return self.items_panel:w() end
function Menu:ItemsHeight() return self.items_panel:h() end
function Menu:ItemsPanel() return self.items_panel end
function Menu:ImageButton(params)
local w = params.w or not params.icon_h and params.items_size
local h = params.h or params.icon_h or params.items_size
local _params = self:ConfigureItem(params)
_params.w = w or _params.w
_params.h = h or _params.h or _params.items_size
return self:NewItem(BLT.Items.ImageButton:new(_params))
end
function Menu:Group(params) return self:NewItem(BLT.Items.Group:new(self:ConfigureItem(params, true))) end
function Menu:Menu(params) return self:NewItem(BLT.Items.Menu:new(self:ConfigureItem(params, true))) end
function Menu:Button(params) return self:NewItem(BLT.Items.Item:new(self:ConfigureItem(params))) end
function Menu:ComboBox(params) return self:NewItem(BLT.Items.ComboBox:new(self:ConfigureItem(params))) end
function Menu:TextBox(params) return self:NewItem(BLT.Items.TextBox:new(self:ConfigureItem(params))) end
function Menu:ComboBox(params) return self:NewItem(BLT.Items.ComboBox:new(self:ConfigureItem(params))) end
function Menu:Slider(params) return self:NewItem(BLT.Items.Slider:new(self:ConfigureItem(params))) end
function Menu:KeyBind(params) return self:NewItem(BLT.Items.KeyBindItem:new(self:ConfigureItem(params))) end
function Menu:Toggle(params) return self:NewItem(BLT.Items.Toggle:new(self:ConfigureItem(params))) end
function Menu:ItemsGroup(params) return self:Group(params) end --Deprecated--
function Menu:NumberBox(params)
local _params = self:ConfigureItem(params)
_params.type_name = "NumberBox"
_params.filter = "number"
return self:NewItem(BLT.Items.TextBox:new(_params))
end
function Menu:Divider(params)
local _params = self:ConfigureItem(params)
_params.divider_type = true
return self:NewItem(BLT.Items.Item:new(_params))
end
function Menu:Image(params)
params.divider_type = true
return self:ImageButton(params)
end
function Menu:DivGroup(params)
local _params = self:ConfigureItem(params)
_params.divider_type = true
return self:NewItem(BLT.Items.Group:new(_params))
end
function Menu:GetIndex(name)
for k, item in pairs(self._my_items) do
if item.name == name then
return k
end
end
return 1
end
function Menu:ConfigureItem(item, menu)
item = clone(item)
if type(item) ~= "table" then
BLT:Log(LogLevel.ERROR, "BLTMenu", debug.traceback("Item is not a table"))
return
end
local inherit = NotNil(item.inherit, self)
item.inherit = inherit
item.parent = self
item.menu = self.menu
item.parent_panel = self.items_panel
if item.override_panel and item.override_panel.Panel then
item.parent_panel = item.override_panel:Panel()
end
if type(item.index) == "string" then
local split = string.split(item.index, "|")
local wanted_item = self:GetItem(split[2] or split[1])
if wanted_item then
item.index = wanted_item:Index() + (split[1] == "After" and 1 or split[1] == "Before" and -1 or 0)
else
BLT:LogF(LogLevel.ERROR, "BLTMenu", "Could not create index from string, %s, %s.", tostring(item.index), tostring(item))
item.index = nil
end
end
item.indx = item.indx or item.index
item.index = nil
return item
end
function Menu:NewItem(item)
if item.indx then
table.insert(self._my_items, item.indx, item)
else
table.insert(self._my_items, item)
end
local index = #self._my_items
if item.reachable then
table.insert(self._reachable_items, item)
end
item.indx = item.indx or index
if self.auto_align then self:AlignItems() end
if managers.mouse_pointer then
item:MouseMoved(managers.mouse_pointer:world_position())
end
return item
end
|
local E, C, L = select(2, ...):unpack()
local module = C.aura
local TIER = 7 -- Legion
local INSTANCE = 822 -- Broken Isles
module:RegisterDebuff(TIER, INSTANCE, 1790, 219045)
module:RegisterDebuff(TIER, INSTANCE, 1774, 217877)
module:RegisterDebuff(TIER, INSTANCE, 1789, 219812)
module:RegisterDebuff(TIER, INSTANCE, 1789, 219610)
module:RegisterDebuff(TIER, INSTANCE, 1795, 223373)
module:RegisterDebuff(TIER, INSTANCE, 1770, 216822)
module:RegisterDebuff(TIER, INSTANCE, 1769, 217206)
module:RegisterDebuff(TIER, INSTANCE, 1783, 219861)
module:RegisterDebuff(TIER, INSTANCE, 1783, 219349)
module:RegisterDebuff(TIER, INSTANCE, 1749, 212852)
|
------------------------------------------------------------------------------
-- Dial class
------------------------------------------------------------------------------
local ctrl = {
nick = "dial",
parent = iup.WIDGET,
creation = "S",
subdir = "elem",
callback = {
-- mousemove_cb = "d", -- already registered by the val
-- button_press_cb = "d", -- already registered by the val
-- button_release_cb = "d", -- already registered by the val
},
}
function ctrl.createElement(class, param)
return iup.Dial(param[1])
end
iup.RegisterWidget(ctrl)
iup.SetClass(ctrl, "iupWidget")
|
SILE.frames = {}
-- Buggy, relies on side effects
-- luacheck: ignore solver frame
-- See https://github.com/sile-typesetter/sile/issues/694
local cassowary = require("cassowary")
local solver = cassowary.SimplexSolver()
local solverNeedsReloading = true
local widthdims = pl.Set { "left", "right", "width" }
local heightdims = pl.Set { "top", "bottom", "height" }
local alldims = widthdims + heightdims
SILE.framePrototype = pl.class({
direction = "LTR-TTB",
enterHooks = {},
leaveHooks = {},
-- This gets called by Penlght when creating the frame instance
_init = function (self, spec, dummy)
local direction = SILE.documentState.direction
if direction then
self.direction = direction
end
self.constraints = {}
self.variables = {}
self.id = spec.id
for k, v in pairs(spec) do
if not alldims[k] then self[k] = v end
end
self.balanced = SU.boolean(self.balanced, false)
if not dummy then
for method in pairs(alldims) do
self.variables[method] = cassowary.Variable({ name = spec.id .. "_" .. method })
self[method] = function (instance_self)
instance_self:solve()
return SILE.measurement(instance_self.variables[method].value)
end
end
-- Add definitions of width and height
for method in pairs(alldims) do
if spec[method] then
self:constrain(method, spec[method])
end
end
end
end,
-- This gets called by us in typesetter before we start to use the frame
init = function (self, typesetter)
self.state = { totals = { height = SILE.measurement(0), pastTop = false } }
self:enter(typesetter)
self:newLine(typesetter)
if self:pageAdvanceDirection() == "TTB" then
self.state.cursorY = self:top()
elseif self:pageAdvanceDirection() == "LTR" then
self.state.cursorX = self:left()
elseif self:pageAdvanceDirection() == "RTL" then
self.state.cursorX = self:right()
elseif self:pageAdvanceDirection() == "BTT" then
self.state.cursorY = self:bottom()
end
end,
constrain = function (self, method, dimension)
self.constraints[method] = tostring(dimension)
self:invalidate()
end,
invalidate = function ()
solverNeedsReloading = true
end,
relax = function (self, method)
self.constraints[method] = nil
end,
reifyConstraint = function (self, solver, method, stay)
local constraint = self.constraints[method]
if not constraint then return end
constraint = SU.type(constraint) == "measurement"
and constraint:tonumber()
or SILE.frameParser:match(constraint)
SU.debug("frames", "Adding constraint " .. self.id .. "(" .. method .. ") = " .. tostring(constraint))
local eq = cassowary.Equation(self.variables[method], constraint)
solver:addConstraint(eq)
if stay then solver:addStay(eq) end
end,
addWidthHeightDefinitions = function (self, solver)
local vars = self.variables
solver:addConstraint(cassowary.Equation(vars.width, cassowary.minus(vars.right, vars.left)))
solver:addConstraint(cassowary.Equation(vars.height, cassowary.minus(vars.bottom, vars.top)))
end,
-- This is hideously inefficient,
-- but it's the easiest way to allow users to reconfigure frames at runtime.
solve = function (_)
if not solverNeedsReloading then return end
SU.debug("frames", "Solving...")
solver = cassowary.SimplexSolver()
if SILE.frames.page then
for method, _ in pairs(SILE.frames.page.constraints) do
SILE.frames.page:reifyConstraint(solver, method, true)
end
SILE.frames.page:addWidthHeightDefinitions(solver)
end
for id, frame in pairs(SILE.frames) do
if not (id == "page") then
for method, _ in pairs(frame.constraints) do
frame:reifyConstraint(solver, method)
end
frame:addWidthHeightDefinitions(solver)
end
end
solver:solve()
solverNeedsReloading = false
end,
writingDirection = function (self)
return self.direction:match("^(%a+)") or "LTR"
end,
pageAdvanceDirection = function (self)
return self.direction:match("-(%a+)$") or "TTB"
end,
advanceWritingDirection = function (self, length)
local amount = SU.cast("number", length)
if amount == 0 then return end
if self:writingDirection() == "RTL" then
self.state.cursorX = self.state.cursorX - amount
elseif self:writingDirection() == "LTR" then
self.state.cursorX = self.state.cursorX + amount
elseif self:writingDirection() == "TTB" then
self.state.cursorY = self.state.cursorY + amount
elseif self:writingDirection() == "BTT" then
self.state.cursorY = self.state.cursorY - amount
end
end,
advancePageDirection = function (self, length)
local amount = SU.cast("number", length)
if amount == 0 then return end
if self:pageAdvanceDirection() == "TTB" then
self.state.cursorY = self.state.cursorY + amount
elseif self:pageAdvanceDirection() == "RTL" then
self.state.cursorX = self.state.cursorX - amount
elseif self:pageAdvanceDirection() == "LTR" then
self.state.cursorX = self.state.cursorX + amount
elseif self:pageAdvanceDirection() == "BTT" then
self.state.cursorY = self.state.cursorY - amount
end
end,
newLine = function(self, _)
if self:writingDirection() == "LTR" then
self.state.cursorX = self:left()
elseif self:writingDirection() == "RTL" then
self.state.cursorX = self:right()
elseif self:writingDirection() == "TTB" then
self.state.cursorY = self:top()
elseif self:writingDirection() == "BTT" then
self.state.cursorY = self:bottom()
end
end,
lineWidth = function (self)
SU.warn("Method :lineWidth() is deprecated, please use :getLineWidth()")
return self:getLineWidth()
end,
getLineWidth = function (self)
if self:writingDirection() == "LTR" or self:writingDirection() == "RTL" then
return self:width()
else
return self:height()
end
end,
pageTarget = function (self)
SU.warn("Method :pageTarget() is deprecated, please use :getTargetLength()")
return self:getTargetLength()
end,
getTargetLength = function (self)
local direction = self:pageAdvanceDirection()
if direction == "TTB" or direction == "BTT" then
return self:height()
else
return self:width()
end
end,
enter = function (self, typesetter)
for i = 1, #self.enterHooks do
self.enterHooks[i](self, typesetter)
end
end,
leave = function (self, typesetter)
for i = 1, #self.leaveHooks do
self.leaveHooks[i](self, typesetter)
end
end,
isAbsoluteConstraint = function (self, method)
if not self.constraints[method] then return false end
local constraint = SILE.frameParser:match(self.constraints[method])
if type(constraint) ~= "table" then return true end
if not constraint.terms then return false end
for clv, _ in pairs(constraint.terms) do
if clv.name and not clv.name:match("^page_") then
return false
end
end
return true
end,
isMainContentFrame = function (self)
local tpt = SILE.documentState.thisPageTemplate
local frame = tpt.firstContentFrame
while frame do
if frame == self then return true end
if frame.next then frame = SILE.getFrame(frame.next) else return false end
end
return false
end,
__tostring = function(self)
local str = "<Frame: " .. self.id .. ": "
str = str .. " next=" .. (self.next or "nil") .. " "
for method, dimension in pairs(self.constraints) do
str = str .. method .. "=" .. dimension .. "; "
end
if self.hanmen then
str = str .. "tate=" .. (self.tate and "true" or "false") .. "; "
str = str .. "gridsize=" .. self.gridsize .. "; "
str = str .. "linegap=" .. self.linegap .. "; "
str = str .. "linelength=" .. self.linelength .. "; "
str = str .. "linecount=" .. self.linecount .. "; "
end
str = str .. ">"
return str
end
})
SILE.newFrame = function (spec, prototype)
SU.required(spec, "id", "frame declaration")
prototype = prototype or SILE.framePrototype
local frame = prototype(spec)
SILE.frames[spec.id] = frame
return frame
end
SILE.getFrame = function (id)
if type(id) == "table" then
SU.error("Passed a table, expected a string", true)
end
local frame, last_attempt
while not frame do
frame = SILE.frames[id]
id = id:gsub("_$", "")
if id == last_attempt then break end
last_attempt = id
end
return frame or SU.warn("Couldn't find frame ID "..id, true)
end
SILE.parseComplexFrameDimension = function (dimension)
local length = SILE.frameParser:match(SU.cast("string", dimension))
if type(length) == "table" then
local g = cassowary.Variable({ name = "t" })
local eq = cassowary.Equation(g, length)
solverNeedsReloading = true
solver:addConstraint(eq)
SILE.frames.page:solve()
solverNeedsReloading = true
return g.value
end
return length
end
|
pie = game:GetService("Workspace").Scripts.AccessStats
plr = game.Players.LocalPlayer.Name
stats = plr.."Stats"
for _,v in next, pie:GetChildren() do
if v.Name == stats then
v.EXP.Value = 999999
end
end
|
-- New Mode
local compat = require("compat")
local function W()
return of.getWidth()
end
local function W2()
return of.getWidth() / 2
end
local function H()
return of.getHeight()
end
local function H2()
return of.getHeight() / 2
end
local function C()
return glm.vec3(W2(), H2(), 0)
end
local config = {
startStr = "To sit in solemn silence \nin a dull, \ndark, dock, In a\n pestilential prison, with\n a life-long \nlock \n awaiting the sensation of a short, \nsharp, shock, From a cheap and \nchippy chopper on a big\n black block",
maxStrLen = 1000,
audioScale = 1,
drawX = 100,
drawY = 100,
maxCorruption = 300,
}
local state = {
str = config.startStr,
corruptedChars = 0,
}
local font = of.TrueTypeFont()
function setup()
compat:setup()
print("CorruptText")
font:load("FiraCode-Light.ttf", 32)
end
function update()
compat:update()
-- Corrupt a random position in the string
local randIdx = math.floor(of.random(1, #state.str))
-- Generate random ASCII character
local rval = of.random(0, 255)
local code = string.char(math.floor(rval))
state.str = string.sub(state.str, 1, randIdx) .. code .. string.sub(state.str, randIdx + 1, #state.str)
-- Limit maximum amount of text corruption
state.corruptedChars = state.corruptedChars + 1
if state.corruptedChars >= config.maxCorruption then
state.corruptedChars = 0
state.str = config.startStr
end
end
function draw()
compat:draw()
-- Modulate string draw location with audio data
local audioVal = inC[#inC / 2]
local ax = audioVal
local ay = audioVal
local ap = glm.vec2(ax, ay)
local p = glm.vec2(config.drawX, config.drawY) + ap * config.audioScale
font:drawString(state.str, p.x, p.y)
end
|
local entityEnumerator = {
__gc = function(enum)
if enum.destructor and enum.handle then
enum.destructor(enum.handle)
end
enum.destructor = nil
enum.handle = nil
end
}
local function EnumerateEntities(initFunc, moveFunc, disposeFunc)
return coroutine.wrap(
function()
local iter, id = initFunc()
if not id or id == 0 then
disposeFunc(iter)
return
end
local enum = {handle = iter, destructor = disposeFunc}
setmetatable(enum, entityEnumerator)
local next = true
repeat
coroutine.yield(id)
next, id = moveFunc(iter)
until not next
enum.destructor, enum.handle = nil, nil
disposeFunc(iter)
end
)
end
local function peds()
return EnumerateEntities(FindFirstPed, FindNextPed, EndFindPed)
end
Citizen.CreateThread(
function()
while true do
Citizen.Wait(pedConfig.LoopTime or 15000)
for ped in peds() do
local pedModel = GetEntityModel(ped) or "cockandballs";
if pedConfig.blacklist[pedModel] == true then
if not IsPedAPlayer(ped) then
ClearPedTasksImmediately(ped)
while not NetworkHasControlOfEntity(ped) do
NetworkRequestControlOfEntity(ped)
Citizen.Wait(1)
end
SetEntityAsMissionEntity(ped, true, true)
DeletePed(ped)
DeleteEntity(ped)
end
end
Citizen.Wait(pedConfig.TimeBetween or 5)
end
end
end
)
|
--- Turbo.lua HTTP Utilities module
-- Contains the HTTPHeaders and HTTPParser classes, which parses request and
-- response headers and also offers utilities to build request headers.
--
-- Also offers a few functions for parsing GET URL parameters, and different
-- POST data types.
--
-- Copyright John Abrahamsen 2011, 2012, 2013
--
-- "Permission is hereby granted, free of charge, to any person obtaining a copy of
-- this software and associated documentation files (the "Software"), to deal in
-- the Software without restriction, including without limitation the rights to
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-- of the Software, and to permit persons to whom the Software is furnished to do
-- so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE."
local log = require "turbo.log"
local status_codes = require "turbo.http_response_codes"
local deque = require "turbo.structs.deque"
local buffer = require "turbo.structs.buffer"
local escape = require "turbo.escape"
local util = require "turbo.util"
local platform = require "turbo.platform"
local ffi = require "ffi"
local libturbo_parser = util.load_libtffi()
require "turbo.cdef"
require "turbo.3rdparty.middleclass"
local fast_assert = util.fast_assert
local b = string.byte
local httputil = {} -- httputil namespace
--- Must match the enum in http-parser.h!
local method_map = {
[0] = "DELETE",
"GET",
"HEAD",
"POST",
"PUT",
"CONNECT",
"OPTIONS",
"TRACE",
"COPY",
"LOCK",
"MKCOL",
"MOVE",
"PROPFIND",
"PROPPATCH",
"SEARCH",
"UNLOCK",
"REPORT",
"MKACTIVITY",
"CHECKOUT",
"MERGE",
"MSEARCH",
"NOTIFY",
"SUBSCRIBE",
"UNSUBSCRIBE",
"PATCH",
"PURGE"
}
local function MAX(a,b) return a > b and a or b end
--*************** HTTP Header parsing ***************
--- URL Field table.
httputil.UF = {
SCHEMA = 0
, HOST = 1
, PORT = 2
, PATH = 3
, QUERY = 4
, FRAGMENT = 5
, USERINFO = 6
}
--- HTTP header type. Use on HTTPHeaders initialize() to specify
-- header type to parse.
httputil.hdr_t = {
HTTP_REQUEST = 0,
HTTP_RESPONSE = 1,
HTTP_BOTH = 2
}
local javascript_types = {
["application/javascript"] = true,
["application/json"] = true,
["application/x-javascript"] = true,
["text/x-javascript"] = true,
["text/x-json"] = true
}
--- HTTPParser Class
-- Class for creation and parsing of HTTP headers.
httputil.HTTPParser = class("HTTPParser")
--- Pass request headers as parameters to parse them into
-- the returned object.
function httputil.HTTPParser:initialize(hdr_str, hdr_t)
if hdr_str and hdr_t then
if hdr_t == httputil.hdr_t["HTTP_REQUEST"] then
self:parse_request_header(hdr_str)
elseif hdr_t == httputil.hdr_t["HTTP_RESPONSE"] then
self:parse_response_header(hdr_str)
end
end
-- Arguments are only parsed on-demand.
self._arguments_parsed = false
end
--- Parse standalone URL and populate class instance with values.
-- HTTPParser.get_url_field must be used to read out values.
-- @param url (String) URL string.
-- @note Will throw error if URL does not parse correctly.
function httputil.HTTPParser:parse_url(url)
if type(url) ~= "string" then
error("URL parameter is not a string")
end
local htpurl = ffi.C.malloc(ffi.sizeof("struct http_parser_url"))
if htpurl == nil then
error("Could not allocate memory")
end
ffi.gc(htpurl, ffi.C.free)
self.http_parser_url = ffi.cast("struct http_parser_url *", htpurl)
local rc = libturbo_parser.http_parser_parse_url(
url,
url:len(),
0,
self.http_parser_url)
if rc ~= 0 then
error("Could not parse URL")
end
if not self.url then
self.url = url
end
end
--- Get a URL field.
-- @param UF_prop (Number) Available fields described in the httputil.UF table.
-- @return nil if not found, else the string value is returned.
function httputil.HTTPParser:get_url_field(UF_prop)
if not self.url then
self:get_url()
end
if not self.http_parser_url then
self:parse_url(self.url)
end
if libturbo_parser.url_field_is_set(
self.http_parser_url, UF_prop) == true then
local url = ffi.cast("const char *", self.url)
local field = ffi.string(
url+self.http_parser_url.field_data[UF_prop].off,
self.http_parser_url.field_data[UF_prop].len)
return field
end
-- Field is not set.
return nil
end
--- Get URL.
-- @return Currently set URI or nil if not set.
function httputil.HTTPParser:get_url()
if self.url then
return self.url
else
if not self.tpw then
error("No URL or header has been parsed. Can not return URL.")
end
if self.tpw.url_str == nil then
error("No URL available for request headers.")
end
self.url = ffi.string(self.tpw.url_str, self.tpw.url_sz)
end
return self.url
end
--- Get HTTP method
-- @return Current method as string or nil if not set.
function httputil.HTTPParser:get_method()
if not self.tpw then
error("No header has been parsed. Can not return method.")
end
return method_map[self.tpw.parser.method]
end
--- Get the HTTP version.
-- @return Currently set version as string or nil if not set.
function httputil.HTTPParser:get_version()
return string.format(
"HTTP/%d.%d",
self.tpw.parser.http_major,
self.tpw.parser.http_minor)
end
--- Get the status code.
-- @return Status code and status code message if set, else nil.
function httputil.HTTPParser:get_status_code()
if not self.tpw then
error("No header has been parsed. Can not return status code.")
elseif self.hdr_t ~= httputil.hdr_t["HTTP_RESPONSE"] then
error("Parsed header not a HTTP response header.")
end
return self.tpw.parser.status_code, status_codes[self.status_code]
end
local function _unescape(s) return string.char(tonumber(s,16)) end
--- Internal function to parse ? and & separated key value fields.
-- @param uri (String)
local function _parse_arguments(uri)
local arguments = {}
local elements = 0;
for k, v in uri:gmatch("([^&=]+)=([^&]+)") do
elements = elements + 1;
if (elements > 256) then
-- Limit to 256 elements, which "should be enough for everyone".
break
end
v = v:gsub("+", " "):gsub("%%(%w%w)", _unescape);
if not arguments[k] then
arguments[k] = v;
else
if type(arguments[k]) == "string" then
local tmp = arguments[k];
arguments[k] = {tmp};
end
table.insert(arguments[k], v);
end
end
return arguments
end
--- Get URL argument of the header.
-- @param argument Key of argument to get value of.
-- @return If argument exists then the argument is either returned
-- as a table if multiple values is given the same key, or as a string if the
-- key only has one value. If argument does not exist, nil is returned.
function httputil.HTTPParser:get_argument(argument)
if not self._arguments_parsed then
self._arguments = _parse_arguments(self:get_url_field(httputil.UF.QUERY))
self._arguments_parsed = true
end
local arguments = self:get_arguments()
if arguments then
if type(arguments[argument]) == "table" then
return arguments[argument]
elseif type(arguments[argument]) == "string" then
return { arguments[argument] }
end
end
end
--- Get all arguments of the header as a table.
-- @return (Table) Table with keys and values.
function httputil.HTTPParser:get_arguments()
if not self._arguments_parsed then
local query = self:get_url_field(httputil.UF.QUERY)
if query then
self._arguments = _parse_arguments(query)
end
self._arguments_parsed = true
end
return self._arguments
end
--- Get given key from header key value section.
-- @param key (String) The key to get.
-- @param caseinsensitive (Boolean) If true then the key will be matched without
-- regard for case sensitivity.
-- @return The value of the key, or nil if not existing. May return a table if
-- multiple keys are set.
local strncasecmp
if platform.__LINUX__ or platform.__UNIX__ then
strncasecmp = ffi.C.strncasecmp
elseif platform.__WINDOWS__ then
-- Windows does not have strncasecmp, but has strnicmp, which does the
-- thing.
strncasecmp = ffi.C._strnicmp
end
function httputil.HTTPParser:get(key, caseinsensitive)
local value
local c = 0
local hdr_sz = tonumber(self.tpw.hkv_sz)
-- If caseinsensitive is nil then default to true.
if caseinsensitive == nil then
caseinsensitive = true
end
if hdr_sz <= 0 then
return nil
end
if caseinsensitive then
-- Case insensitive key.
for i = 0, hdr_sz-1 do
local field = self.tpw.hkv[i]
local key_sz = key:len()
if field.key_sz == key_sz then
if strncasecmp(
field.key,
key,
field.key_sz) == 0 then
local str = ffi.string(field.value, field.value_sz)
if c == 0 then
value = str
c = 1
elseif c == 1 then
value = {value, str}
c = 2
else
value[#value+1] = str
c = c + 1
end
end
end
end
else
-- Case sensitive key.
for i = 0, hdr_sz-1 do
local field = self.tpw.hkv[i]
local key_sz = key:len()
if field.key_sz == key_sz then
if ffi.C.memcmp(
field.key,
key,
MAX(field.key_sz, key_sz)) == 0 then
local str = ffi.string(field.value, field.value_sz)
if c == 0 then
value = str
c = 1
elseif c == 1 then
value = {value, str}
c = 2
else
value[#value+1] = str
c = c + 1
end
end
end
end
end
return value, c
end
--- Parse HTTP request or response headers.
-- Populates the class with all data in headers.
-- @param hdr_str (String) HTTP header string.
-- @param hdr_t (Number) A number defined in httputil.hdr_t representing header
-- type.
-- @note Will throw error on parsing failure.
function httputil.HTTPParser:parse_header(hdr_str, hdr_t)
-- Ensure the string is not GCed while we are still using it by keeping a
-- reference to it. There is no way for LuaJIT to know we are still
-- using pointers to it.
self.hdr_str = hdr_str
self.hdr_t = hdr_t
local tpw = libturbo_parser.turbo_parser_wrapper_init(
hdr_str,
hdr_str:len(),
hdr_t)
if tpw ~= nil then
ffi.gc(tpw, libturbo_parser.turbo_parser_wrapper_exit)
else
error("libturbo_parser could not allocate memory for struct.")
end
self.tpw = tpw
if libturbo_parser.turbo_parser_check(self.tpw) ~= true then
error(
string.format(
"libturbo_parser could not parse HTTP header. %s %s",
ffi.string(libturbo_parser.http_errno_name(
self.tpw.parser.http_errno)),
ffi.string(libturbo_parser.http_errno_description(
self.tpw.parser.http_errno))))
end
if self.tpw.headers_complete == false then
error("libturbo_parser could not parse header. Unknown error.")
end
end
--- Parse HTTP response headers.
-- Populates the class with all data in headers.
-- @param raw_headers (String) HTTP header string.
-- @note Will throw error on parsing failure.
function httputil.HTTPParser:parse_response_header(raw_headers)
self:parse_header(raw_headers, httputil.hdr_t["HTTP_RESPONSE"])
end
--- Parse HTTP request headers.
-- Populates the class with all data in headers.
-- @param raw_headers (String) HTTP header string.
-- @note Will throw error on parsing failure.
function httputil.HTTPParser:parse_request_header(raw_headers)
self:parse_header(raw_headers, httputil.hdr_t["HTTP_REQUEST"])
end
--- Parse HTTP post arguments.
function httputil.parse_post_arguments(data)
if type(data) ~= "string" then
error("data argument not a string.")
end
return _parse_arguments(data)
end
local DASH = string.byte('-')
local CR = string.byte'\r'
local LF = string.byte'\n'
-- finds the start of a line
local function find_line_start(str,pos, inc)
if not inc then inc = 1 end
local skipped = -1
-- skip any non-CRLF chars
repeat
b = str:byte(pos)
if b == nil then return nil end
pos = pos + inc
skipped = skipped+1
until (b==CR) or (b==LF)
local b2 = str:byte(pos)
if b2 == nil then return nil end
if (b2 == CR) or (b2 == LF) then
if b ~= b2 then
pos = pos + inc
end
end
return pos, skipped
end
-- @return end position of token, token string
local function getRFC822Atom(str,pos)
local fpos, lpos, token = str:find('([^%c%s()<>@,;:\\"/[%]?=]+)', pos)
return lpos, token
end
--- Parse multipart form data.
function httputil.parse_multipart_data(data, boundary)
local arguments = {}
local p1, p2, b1, b2
boundary = "--" .. boundary
p1, p2 = data:find(boundary, 1, true)
b1 = find_line_start(data,p2+1)
repeat
p1, p2 = data:find(boundary, p2, true)
if p1 == nil then break end
b2 = find_line_start(data,p1-1,-1)
do
local boundary_headers
local h1, h2, v1, skipped
v1 = b1
repeat
h1 = v1
v1 = find_line_start(data,v1)
if v1 == nil then goto next_boundary end
until skipped ~= 0
repeat
h2 = v1-1
v1, skipped = find_line_start(data,v1)
if v1 == nil then goto next_boundary end
until skipped == 0
boundary_headers = data:sub(h1,h2)
boundary_headers = boundary_headers:gsub("([^%c%s:]-):",
function(s) return string.gsub(s,"%u", function(c)
return string.lower(c) end) .. ":"
end)
if not boundary_headers then
goto next_boundary
end
do
local name, ctype
local argument = { }
for fname, fvalue, content_kvs in
boundary_headers:gmatch("([^%c%s:]+):%s*([^\r\n;]*);?([^\n\r]*)") do
if fvalue == "form-data" and fname=="content-disposition" then
argument[fname] = {}
local p = 1
repeat
p, key = getRFC822Atom(content_kvs,p)
if p == nil then break end
if content_kvs:byte(p+1) ~= string.byte('=') then
break
end
p=p+2
local _, p2, val = content_kvs:find('^"([^"]+)"',p)
if not p2 then
p2, val = getRFC822Atom(content_kvs,p)
if not p2 then break end
end
p = p2+1
if key=="name" then
name=val
end
argument[fname][key] = val
until false
else
if fname=="content-type" then
ctype = fvalue
fvalue = fvalue:lower()
elseif fname=="charset" or
fname=="content-transfer-encoding" then
fvalue = fvalue:lower()
end
argument[fname] = fvalue
end
end
if not name then
goto next_boundary
end
argument[1] = data:sub(v1, b2)
if argument["content-transfer-encoding"] == "base64" then
argument[1] = escape.base64_decode(argument[1])
end
if javascript_types[argument["content-type"]] then
argument[1] = escape.unescape(argument[1])
end
if arguments[name] then
arguments[name][#arguments[name] +1] = argument
else
arguments[name] = { argument }
end
end
end
::next_boundary::
b1 = find_line_start(data,p2+1)
until (b1+1 > #data) or
(data:byte(p2+1) == DASH and data:byte(p2+2) == DASH)
return arguments
end
--*************** HTTP Header generation ***************
--- HTTPHeaders Class
-- Class for creating HTTP headers in a programmatic fashion.
httputil.HTTPHeaders = class("HTTPHeaders")
function httputil.HTTPHeaders:initialize()
self._fields = {}
end
--- Set URI.
-- @param uri (String)
function httputil.HTTPHeaders:set_uri(uri)
if type(uri) ~= "string" then
error("argument #1 not a string.")
end
self.uri = uri
end
--- Get current URI.
-- @return Currently set URI or nil if not set.
function httputil.HTTPHeaders:get_uri() return self.uri end
--- Set HTTP method.
-- @param method (String) Must be string, or error is raised.
function httputil.HTTPHeaders:set_method(method)
if type(method) ~= "string" then
error("argument #1 not a string.")
end
self.method = method
end
--- Get HTTP method
-- @return Current method as string or nil if not set.
function httputil.HTTPHeaders:get_method() return self.method end
--- Set the HTTP version.
-- Applies when building response headers only.
-- @param version (String) Version in string form, e.g "1.1" or "1.0"
-- Must be string or error is raised.
function httputil.HTTPHeaders:set_version(version)
if type(version) ~= "string" then
error("argument #1 not a string.")
end
self.version = version
end
--- Get the current HTTP version.
-- @return Currently set version as string or nil if not set.
function httputil.HTTPHeaders:get_version() return self.version end
--- Set the status code.
-- Applies when building response headers.
-- @param code (Number) HTTP status code to set. Must be number or
-- error is raised.
function httputil.HTTPHeaders:set_status_code(code)
if type(code) ~= "number" then
error("argument #1 not a number.")
end
if not status_codes[code] then
error(string.format("Invalid HTTP status code given: %d", code))
end
self.status_code = code
end
--- Get the current status code.
-- @return Status code and status code message if set, else nil.
function httputil.HTTPHeaders:get_status_code()
return self.status_code, status_codes[self.status_code]
end
--- Get given key from header key value section.
-- @param key (String) The key to get.
-- @param caseinsensitive (Boolean) If true then the key will be matched without
-- regard for case sensitivity.
-- @return The value of the key, or nil if not existing. May return a table if
-- multiple keys are set.
function httputil.HTTPHeaders:get(key, caseinsensitive)
local value
local cnt = 0
if caseinsensitive == true then
key = key:lower()
for i = 1, #self._fields do
if self._fields[i] and self._fields[i][1]:lower() == key then
if cnt == 0 then
value = self._fields[i][2]
cnt = 1
elseif cnt == 1 then
value = {value, self._fields[i][2]}
cnt = 2
else
value[#value + 1] = self._fields[i][2]
cnt = cnt + 1
end
end
end
else
for i = 1, #self._fields do
if self._fields[i] and self._fields[i][1] == key then
if cnt == 0 then
value = self._fields[i][2]
cnt = 1
elseif cnt == 1 then
value = {value, self._fields[i][2]}
cnt = 2
else
value[#value + 1] = self._fields[i][2]
cnt = cnt + 1
end
end
end
end
return value, cnt
end
--- Add a key with value to the headers. Supports adding multiple values to
-- one key. E.g mutiple "Set-Cookie" header fields.
-- @param key (String) Key to add to headers. Must be string or error is raised.
-- @param value (String or Number) Value to associate with the key.
function httputil.HTTPHeaders:add(key, value)
if type(key) ~= "string" then
error("Key parameter must be a string.")
end
local t = type(value)
if t == "string" then
if value:find("\r\n", 1, true) then
error("String value contain <CR><LF>, not allowed.")
end
elseif t ~= "number" then
error("Value parameter must be a string or number.")
end
self._fields[#self._fields + 1] = {key, value}
end
--- Set a key with value to the headers. Overwiting existing key.
-- @param key (String) Key to set to headers. Must be string or error is raised.
-- @param value (String) Value to associate with the key.
function httputil.HTTPHeaders:set(key, value, caseinsensitive)
if type(key) ~= "string" then
error("Key parameter must be a string.")
end
local t = type(value)
if t == "string" then
if value:find("\r\n", 1, true) then
error("String value contain <CR><LF>, not allowed.")
end
elseif t ~= "number" then
error("Value parameter must be a string or number.")
end
self:remove(key, caseinsensitive)
self:add(key, value)
end
--- Remove key from headers.
-- @param key (String) Key to remove from headers. Must be string or error is raised.
-- @param caseinsensitive (Boolean) If true then the key will be matched without
-- regard for case sensitivity.
function httputil.HTTPHeaders:remove(key, caseinsensitive)
if type(key) ~= "string" then
error("Key parameter must be a string.")
end
if caseinsensitive == false then
for i = 1, #self._fields do
if self._fields[i] and self._fields[i][1] == key then
self._fields[i] = nil
end
end
else
key = key:lower()
for i = 1, #self._fields do
if self._fields[i] and self._fields[i][1]:lower() == key then
self._fields[i] = nil
end
end
end
end
--- Stringify data set in class as a HTTP request header.
-- @return (String) HTTP header string excluding final delimiter.
function httputil.HTTPHeaders:stringify_as_request()
local buffer = buffer:new()
for i = 1, #self._fields do
if self._fields[i] then
buffer:append_luastr_right(string.format("%s: %s\r\n",
self._fields[i][1], self._fields[i][2]));
end
end
return string.format("%s %s %s\r\n%s\r\n",
self.method,
self.uri,
self.version,
tostring(buffer))
end
--- Stringify data set in class as a HTTP response header.
-- If not "Date" field is set, it will be generated automatically.
-- @return (String) HTTP header string excluding final delimiter.
function httputil.HTTPHeaders:stringify_as_response()
local buf = buffer:new()
if not self:get("Date") then
-- Add current time as Date header if not set already.
self:add("Date", util.time_format_http_header(util.gettimeofday()))
end
for i = 1 , #self._fields do
if self._fields[i] then
-- string.format causes trace abort here.
-- Just build keyword values by abuse.
buf:append_luastr_right(self._fields[i][1])
buf:append_luastr_right(": ")
buf:append_luastr_right(tostring(self._fields[i][2]))
buf:append_luastr_right("\r\n")
end
end
return string.format("%s %d %s\r\n%s",
self.version,
self.status_code,
status_codes[self.status_code],
tostring(buf))
end
--- Convinience method to return HTTPHeaders:stringify_as_response on string
-- conversion.
function httputil.HTTPHeaders:__tostring()
return self:stringify_as_response()
end
return httputil
|
--This script runs a graphical user interface (GUI) in order to built up a documentation tree of the balance of an enterprise. It displays the tree saved in documentation_tree_balance.lua, the passive tree in documentation_tree_balance_passive.lua and the active tree stored in documentation_tree_balance_active.lua
--1. basic data
--1.1 libraries and clipboard
--1.1.1 libraries
require("iuplua") --require iuplua for GUIs
require("iuplua_scintilla") --for Scintilla-editor
--1.1.2 initalize clipboard
clipboard=iup.clipboard{}
--1.1.3 empty temporary tree needed to copy node with all its child nodes
tree_temp={} --An Zuordnung senden, Verdoppeln
--1.1.4 math.integer for Lua 5.1 and Lua 5.2
if _VERSION=='Lua 5.1' then
function math.tointeger(a) return a end
elseif _VERSION=='Lua 5.2' then
function math.tointeger(a) return a end
end --if _VERSION=='Lua 5.1' then
--1.1.5 securisation by allowing only necessary os.execute commands
do --sandboxing
local old=os.date("%H%M%S")
local secureTable={}
secureTable[old]=os.execute
function os.execute(a)
if
a:lower():match("^sftp ") or
a:lower():match("^dir ") or
a:lower():match("^pause") or
a:lower():match("^title") or
a:lower():match("^md ") or
a:lower():match("^copy ") or
a:lower():match("^color ") or
a:lower():match("^start ")
then
return secureTable[old](a)
else
print(a .." ist nicht erlaubt.")
end --if a:match("del") then
end --function os.execute(a)
secureTable[old .. "1"]=io.popen
function io.popen(a)
if
a:lower():match("^dir ") or
a:lower():match('^"dir ')
then
return secureTable[old .. "1"](a)
else
print(a .." ist nicht erlaubt.")
end --if a:match("del") then
end --function os.execute(a)
end --do --sandboxing
--1.2 color section
--1.2.1 color of the console associated with the graphical user interface if started with lua54.exe and not wlua54.exe
os.execute('color 71')
--1.2.2 Beckmann und Partner colors
color_red_bpc="135 31 28"
color_light_color_grey_bpc="196 197 199"
color_grey_bpc="162 163 165"
color_blue_bpc="18 32 86"
--1.2.3 color definitions
color_background=color_light_color_grey_bpc
color_buttons=color_blue_bpc -- works only for flat buttons, "18 32 86" is the blue of BPC
color_button_text="255 255 255"
color_background_tree="246 246 246"
--1.3 path of the graphical user interface and filename of this script
path=arg[0]:match("(.*)\\")
--test with: print(path)
thisfilename=arg[0]:match("\\([^\\]+)$")
--test with: print(arg[0])
--test with: print(thisfilename)
--2. installation of the repositories and scripts
p=io.popen('dir "' .. path .. '" /b/o')
installTable={}
for fileName in p:lines() do
fileName=fileName:lower()
--print(fileName)
if fileName=="documentation_tree_balance.lua" then installTable[fileName]="Lua script"
elseif fileName=="documentation_tree_balance_passive.lua" then installTable[fileName]="Lua script"
elseif fileName=="documentation_tree_balance_active.lua" then installTable[fileName]="Lua script"
elseif fileName=="documentation_tree_balance_indicators.lua" then installTable[fileName]="Lua script"
end --if fileName:lower()=="archiv" then
end --for fileName in p:lines() do
--2.1 install skript documentation_tree_balance.lua
documentation_tree_ProgrammText=[[
lua_tree_output={ branchname="Verzeichnisdokumentation",
{ branchname="Verzeichnis-Dokumentation",
state="COLLAPSED",
"]] .. path:gsub("\\","\\\\") .. [[\\]] .. thisfilename .. [[",
{ branchname="Baumdokumentationen Skripte",
state="COLLAPSED",
"]] .. path:gsub("\\","\\\\") .. [[\\documentation_tree_balance.lua",
"]] .. path:gsub("\\","\\\\") .. [[\\documentation_tree_balance_passive.lua",
"]] .. path:gsub("\\","\\\\") .. [[\\documentation_tree_balance_active.lua",
"]] .. path:gsub("\\","\\\\") .. [[\\documentation_tree_balance_indicators.lua",
},
{ branchname="Baumdokumentationen Verzeichnisse",
state="COLLAPSED",
"]] .. path:gsub("\\","\\\\") .. [[",
"]] .. path:gsub("\\","\\\\") .. [[\\Archiv",
},
},
}
]]
if installTable["documentation_tree_balance.lua"]==nil then
outputfile1=io.open(path .. "\\documentation_tree_balance.lua","w")
outputfile1:write(documentation_tree_ProgrammText)
outputfile1:close()
end --if installTable["documentation_tree_balance.lua"]==nil then
--2.1 install skript documentation_tree_balance.lua end
--2.2 install skript documentation_tree_balance_passive.lua
documentation_tree_script_ProgrammText=[[
--Wertebaum auf der untersten Stufe mit Werten
WerteTree={branchname="Bilanzausschnitt Passiva ohne Eigenkapital",
{branchname="Passiva Rückstellungen und Rücklagen",
{branchname="Rückstellungen",1000,},
{branchname="Rücklagen",32345,},
},
{branchname="Passiva Kredite",
{branchname="Kredite an Banken",600000,},
{branchname="Kredite an private Gläubiger",1112345,},
},
}
--Aggregation
Tiefe=0
TiefeRecursion(WerteTree)
print(Tiefe)
AnwendungTiefeRecursion(WerteTree)
WerteTreeAnsicht={}
AnsichtRecursion(WerteTree,WerteTreeAnsicht)
RemoveRecursion(WerteTreeAnsicht)
WerteTreeAnteile={}
AnteilRecursion(WerteTree,WerteTree,WerteTreeAnteile)
RemoveRecursion(WerteTreeAnteile)
WerteTreeAnteile.branchname="Passivseitenübersicht mit Anteilen"
--Fertiger Wertebaum
tree_script={branchname="Passivseite ohne Eigenkapital" ,
--WerteTree,
WerteTreeAnsicht,
WerteTreeAnteile,
}
]]
if installTable["documentation_tree_balance_passive.lua"]==nil then
outputfile1=io.open(path .. "\\documentation_tree_balance_passive.lua","w")
outputfile1:write(documentation_tree_script_ProgrammText)
outputfile1:close()
end --if installTable["documentation_tree_balance_passive.lua"]==nil then
--2.2 install skript documentation_tree_balance_passive.lua end
--2.3 install skript documentation_tree_balance_active.lua
documentation_tree_statistics_ProgrammText=[[
--Wertebaum auf der untersten Stufe mit Werten
WerteTree={branchname="Aktiva",
{branchname="Aktiva Waren",
{branchname="Fertigprodukte",1000000,},
{branchname="Halbfertigprodukte",1232345,},
},
{branchname="Aktiva flüssige Mittel",
{branchname="Guthaben bei Banken",100000,},
{branchname="Kasse",2345,},
},
}
--Aggregation
Tiefe=0
TiefeRecursion(WerteTree)
print(Tiefe)
AnwendungTiefeRecursion(WerteTree)
WerteTreeAnsicht={}
AnsichtRecursion(WerteTree,WerteTreeAnsicht)
RemoveRecursion(WerteTreeAnsicht)
WerteTreeAnteile={}
AnteilRecursion(WerteTree,WerteTree,WerteTreeAnteile)
RemoveRecursion(WerteTreeAnteile)
WerteTreeAnteile.branchname="Aktivseitenübersicht mit Anteilen"
--Fertiger Wertebaum
tree_statistics={branchname="Aktivseite" ,
--WerteTree,
WerteTreeAnsicht,
WerteTreeAnteile,
}
]]
if installTable["documentation_tree_balance_active.lua"]==nil then
outputfile1=io.open(path .. "\\documentation_tree_balance_active.lua","w")
outputfile1:write(documentation_tree_statistics_ProgrammText)
outputfile1:close()
end --if installTable["documentation_tree_balance_active.lua"]==nil then
--2.3 install skript documentation_tree_balance_active.lua end
--2.4 install skript documentation_tree_balance_indicators.lua
documentation_tree_statistics_ProgrammText=[[
Aktivseitensumme = tree3['title1']:match(": (%d[^ ]*%d)[^%d]*"):gsub("%.","")
Aktivseitensumme = tonumber(Aktivseitensumme)
Passivseitensumme_ohne_Eigenkapital= tree2['title1']:match(": (%d[^ ]*%d)[^%d]*"):gsub("%.","")
Passivseitensumme_ohne_Eigenkapital= tonumber(Passivseitensumme_ohne_Eigenkapital)
Eigenkapitalsumme = Aktivseitensumme - Passivseitensumme_ohne_Eigenkapital
Eigenkapitalquote = Eigenkapitalsumme / Aktivseitensumme
textfield1.value="Eigenkapital: " .. Eigenkapitalsumme .. "\n" ..
"Eigenkapitalquote: " .. Eigenkapitalquote .. "\n" ..
"Weitere Bilanzkennzahlen abhängig von der Bilanzstruktur ermitteln..."
]]
if installTable["documentation_tree_balance_indicators.lua"]==nil then
outputfile1=io.open(path .. "\\documentation_tree_balance_indicators.lua","w")
outputfile1:write(documentation_tree_statistics_ProgrammText)
outputfile1:close()
end --if installTable["documentation_tree_balance_indicators.lua"]==nil then
--2.4 install skript documentation_tree_balance_indicators.lua end
--test with (status before installment): for k,v in pairs(installTable) do print(k,v) end
--2.5 script for manual tree
path_documentation_tree= path .. "\\documentation_tree_balance.lua"
--2.5.1 search for valid tree
inputfile1=io.open(path .. "\\documentation_tree_balance.lua","r")
if inputfile1 then
while true do
TextInput=inputfile1:read()
if TextInput and TextInput:match('lua_tree_output={ branchname="') then break end
if TextInput==nil then break end
end --while true do
inputfile1:close()
end --if inputfile then
--2.5.2 if no valid tree is found in manual tree then take the securised file
if TextInput==nil then
os.execute('copy "' .. path .. '\\Archiv\\documentation_tree_Sicherung.lua" "' .. path_documentation_tree .. '"' )
end --if TextInput==nil then
--2.5.3 securise file with date and with standard name
os.execute('copy "' .. path_documentation_tree .. '" "' .. path .. '\\Archiv\\documentation_tree' .. os.date("_%Y%m%d") .. '.lua"' )
os.execute('copy "' .. path_documentation_tree .. '" "' .. path .. '\\Archiv\\documentation_tree_Sicherung.lua"' )
--3 functions
--3.1 general Lua functions
--3.1.1 function checking if file exits
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end --function file_exists(name)
--3.1.2 function escaping magic characters
function string.escape_forbidden_char(insertstring) --this function takes a string and returns the same string with escaped characters
return insertstring:gsub("\\", "\\\\"):gsub("\"", "\\\""):gsub("\'", "\\\'"):gsub("\n", "\\n"):gsub("\r", "\\n")
end --function string.escape_forbidden_char(insertstring)
--3.2 functions for GUI
--3.2.1 function for deleting all nodes of an given tree, but that does not delete the tree
function delete_nodes_of_tree(tree_given)
tree_given.delnode0 = "CHILDREN"
tree_given.title=''
end --function delete_nodes_of_tree(tree_given)
--3.2.2 function which saves the current iup tree as a Lua table
function save_tree_to_lua(tree, outputfile_path)
local output_tree_text="lua_tree_output=" --the output string
local outputfile=io.output(outputfile_path) --a output file
for i=0,tree.count - 1 do --loop for all nodes
if tree["KIND" .. i ]=="BRANCH" then --consider cases, if actual node is a branch
if (i > 0 and (tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) ) or i==0 then --consider cases if depth increases
output_tree_text = output_tree_text .. '{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' -- we open a new branch
--save state
if tree["STATE" .. i ]=="COLLAPSED" then
output_tree_text = output_tree_text .. 'state="COLLAPSED",\n'
end --if tree["STATE" .. i ]=="COLLAPSED" then
elseif i > 0 and tonumber(tree["DEPTH" .. i ]) < tonumber(tree["DEPTH" .. i-1 ]) then --if depth decreases
if tree["KIND" .. i-1 ] == "BRANCH" then --depending if the predecessor node was a branch we need to close one bracket more
for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do
output_tree_text = output_tree_text .. '},\n'
end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do
output_tree_text = output_tree_text .. '{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --and we open the new branch
--save state
if tree["STATE" .. i ]=="COLLAPSED" then
output_tree_text = output_tree_text .. 'state="COLLAPSED",\n'
end --if tree["STATE" .. i ]=="COLLAPSED" then
else
for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do -- or if the predecessor node was a leaf
output_tree_text = output_tree_text .. '},\n'
end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do
output_tree_text = output_tree_text .. '{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --and we open the new branch
--save state
if tree["STATE" .. i ]=="COLLAPSED" then
output_tree_text = output_tree_text .. 'state="COLLAPSED",\n'
end --if tree["STATE" .. i ]=="COLLAPSED" then
end --if tree["KIND" .. i-1 ] == "BRANCH" then
elseif i > 0 and tonumber(tree["DEPTH" .. i ]) == tonumber(tree["DEPTH" .. i-1 ]) then --or if depth stays the same
if tree["KIND" .. i-1 ] == "BRANCH" then --again consider if the predecessor node was a branch
output_tree_text = output_tree_text .. '},\n{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n'
--save state
if tree["STATE" .. i ]=="COLLAPSED" then
output_tree_text = output_tree_text .. 'state="COLLAPSED",\n'
end --if tree["STATE" .. i ]=="COLLAPSED" then
else --or a leaf
output_tree_text = output_tree_text .. '\n{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n'
--save state
if tree["STATE" .. i ]=="COLLAPSED" then
output_tree_text = output_tree_text .. 'state="COLLAPSED",\n'
end --if tree["STATE" .. i ]=="COLLAPSED" then
end --if tree["KIND" .. i-1 ] == "BRANCH" then
end --if (i > 0 and (tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) ) or i==0 then
elseif tree["KIND" .. i ]=="LEAF" then --or if actual node is a leaf
if (i > 0 and tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) or i==0 then
output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '",' --we add the leaf
elseif i > 0 and tonumber(tree["DEPTH" .. i ]) < tonumber(tree["DEPTH" .. i-1 ]) then
if tree["KIND" .. i-1 ] == "LEAF" then --in the same manner as above, depending if the predecessor node was a leaf or branch, we have to close a different number of brackets
for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do
output_tree_text = output_tree_text .. '},\n'
end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do
output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '",' --and in each case we add the new leaf
else
for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do
output_tree_text = output_tree_text .. '},\n'
end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do
output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '",'
end --if tree["KIND" .. i-1 ] == "LEAF" then
elseif i > 0 and tonumber(tree["DEPTH" .. i ]) == tonumber(tree["DEPTH" .. i-1 ]) then
if tree["KIND" .. i-1 ] == "LEAF" then
output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n'
else
output_tree_text = output_tree_text .. '},\n "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n'
end --if tree["KIND" .. i-1 ] == "LEAF" then
end --if (i > 0 and tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) or i==0 then
end --if tree["KIND" .. i ]=="BRANCH" then
end --for i=0,tree.count - 1 do
for j=1, tonumber(tree["DEPTH" .. tree.count-1]) do
output_tree_text = output_tree_text .. "}" --close as many brackets as needed
end --for j=1, tonumber(tree["DEPTH" .. tree.count-1]) do
if tree["KIND" .. tree.count-1]=="BRANCH" then
output_tree_text = output_tree_text .. "}" -- we need to close one more bracket if last node was a branch
end --if tree["KIND" .. tree.count-1]=="BRANCH" then
--output_tree_text=string.escape_forbidden_char(output_tree_text)
outputfile:write(output_tree_text) --write everything into the outputfile
outputfile:close()
end --function save_tree_to_lua(tree, outputfile_path)
--3.2.3 function which deletes nodes in the second tree, if they occur in the tree of the first argument
function compare_files_raw(fileText,compareFileText)
compareText=compareText .. "\nDatei: " .. fileText .. "\n\n"
--build the compare-table bTable from compareFileText
bTable={} i=0
for textLine in io.lines(compareFileText) do i=i+1 bTable[i]={bLine=textLine}
for c in textLine:gmatch(".") do
bTable[i][#bTable[i]+1]=c
end --for c in textLine:gmatch(".") do
end --for textLine in io.lines(fileText) do
--compare of all rows of fileText
comp1,comp2="","" j=0 j_raw=0
for textLine in io.lines(fileText) do
--find row to compare
j_raw=j_raw+1
j=j_raw
for naechster=1,#bTable do
if bTable[naechster] and bTable[naechster].bLine and textLine==bTable[naechster].bLine then
j=naechster break
end --if bTable[naechster] and bTable[naechster].bLine and textLine==bTable[naechster].bLine then
end --for naechster=1,#bTable do
--test with: print(j_raw,j)
if bTable[j] and textLine==bTable[j].bLine then
comp1,comp2="O","K"
elseif bTable[j] then
textLine=textLine .. string.rep(" ",math.max(#bTable[j].bLine-#textLine,0))
k=0 comp1,comp2="",""
--compare character by character
for c in textLine:gmatch(".") do
k=k+1
if c~=bTable[j][k] then
comp1=comp1 .. c comp2=comp2 .. tostring(bTable[j][k]):gsub("nil"," ")
elseif c=="\t" and tostring(bTable[j][k])=="\t" then
comp1=comp1 .. "\t" comp2=comp2 .. "\t"
elseif tostring(bTable[j][k])=="\t" then
comp1=comp1 .. " " comp2=comp2 .. "\t"
elseif c=="\t" then
comp1=comp1 .. "\t" comp2=comp2 .. " "
else
comp1=comp1 .. " " comp2=comp2 .. " "
end --if c~=bTable[j][k] then
end --for c in textLine:gmatch(".") do
compareText=compareText .. j_raw .. "\t" .. j .. "________________________" .. "\n" .. textLine .. "\n" .. comp1 .. "\n" .. comp2 .. "\n"
else
comp1,comp2="",""
compareText=compareText .. j_raw .. "\t" .. j .. "________________________" .. "\n" .. textLine .. "\n" .. comp1 .. "\n" .. comp2 .. "\n"
end --if bTable[j] and textLine==bTable[j].bLine then
end --for textLine in io.lines(fileText) do
end --function compare_files_raw(fileText,compareFileText)
function compare_files(file1,file2)
compare_files_raw(file1,file2)
compare_files_raw(file2,file1)
end --function compare_files(file1,file2)
--3.2 functions for GUI end
--3.3 functions for writing text files
--3.3.1 function for writing tree in a text file (function for printing tree)
function printtree()
--open a filedialog
filedlg2=iup.filedlg{dialogtype="SAVE",title="Ziel auswählen",filter="*.txt",filterinfo="Text Files", directory="c:\\temp"}
filedlg2:popup(iup.ANYWHERE,iup.ANYWHERE)
if filedlg2.status=="1" or filedlg2.status=="0" then
local outputfile=io.output(filedlg2.value) --setting the outputfile
for i=0,tree.totalchildcount0 do
local helper=tree['title' .. i]:gsub("\n","\\n")
for j=1,tree['depth' .. i] do
helper='\t' .. helper
end --for j=1,tree['depth' .. i] do
outputfile:write(helper, '\n')
end --for i=0,tree.totalchildcount0 do
outputfile:close() --close the outputfile
else --no outputfile was choosen
iup.Message("Schließen","Keine Datei ausgewählt")
iup.NextField(maindlg)
end --if filedlg2.status=="1" or filedlg2.status=="0" then
end --function printtree()
--3.3.2 function for printing dependencies in a csv file
function printdependencies()
--open a filedialog
filedlg3=iup.filedlg{dialogtype="SAVE",title="Ziel auswählen",filter="*.csv",filterinfo="csv Files", directory="c:\\temp"}
filedlg3:popup(iup.ANYWHERE,iup.ANYWHERE)
if filedlg3.status=="1" or filedlg3.status=="0" then
local outputfile=io.output(filedlg3.value)--setting the outputfile
-- want to write dependencies in output file, so each decendent in first colum, parent in second. This for all relations.
for i=0, tree.count - 1 do -- loop for nodes. in the loop we list all descendants in first generation in outputfile
local j=i+1 -- variable for decendents
while j<=tree.count -1 and tree["depth"..i]<tree["depth"..j] do -- while current node lies higher then following nodes -> then we are looking in descendants of current node
if tonumber(tree["depth"..i] + 1) == tonumber(tree["depth"..j]) then -- check if decendent is 1st generation
outputfile:write(tree["title"..j]:gsub("\n","\\n") .. ";" .. tree["title".. i]:gsub("\n","\\n")) --write the dependency
outputfile:write("\n")
end --if tonumber(tree["depth"..i] + 1) == tonumber(tree["depth"..j]) then
j=j+1
end --while j<=tree.count -1 and tree["depth"..i]<tree["depth"..j] do
end --for i=0, tree.count - 1 do
outputfile:close()--close the outputfile
else --no file was choosen
iup.Message("Schließen","Keine Datei ausgewählt")
iup.NextField(maindlg)
end --if filedlg3.status=="1" or filedlg3.status=="0" then
end --function printdependencies()
--3.3 functions for writing text files end
--3.4 function to change expand/collapse relying on depth
--This function is needed in the expand/collapsed dialog. This function relies on the depth of the given level.
function change_state_level(new_state,level,descendants_also,tree)
if descendants_also=="YES" then
for i=0,tree.count-1 do
if tree["depth" .. i]==level then
iup.TreeSetNodeAttributes(tree,i,{state=new_state}) --changing the state of current node
iup.TreeSetDescendantsAttributes(tree,i,{state=new_state})
end --if tree["depth" .. i]==level then
end --for i=0,tree.count-1 do
else
for i=0,tree.count-1 do
if tree["depth" .. i]==level then
iup.TreeSetNodeAttributes(tree,i,{state=new_state})
end --if tree["depth" .. i]==level then
end --for i=0,tree.count-1 do
end --if descendants_also=="YES" then
end --function change_state_level(new_state,level,descendants_also,tree)
--3.5 function to change expand/collapse relying on keyword
--This function is needed in the expand/collapsed dialog. This function changes the state for all nodes, which match a keyword. Otherwise it works like change_stat_level.
function change_state_keyword(new_state,keyword,descendants_also,tree)
if descendants_also=="YES" then
for i=0,tree.count-1 do
if tree["title" .. i]:match(keyword)~=nil then
iup.TreeSetNodeAttributes(tree,i,{state=new_state})
iup.TreeSetDescendantsAttributes(tree,i,{state=new_state})
end --if tree["title" .. i]:match(keyword)~=nil then
end --for i=0,tree.count-1 do
else
for i=0,tree.count-1 do
if tree["title" .. i]:match(keyword)~=nil then
iup.TreeSetNodeAttributes(tree,i,{state=new_state})
end --if tree["title" .. i]:match(keyword)~=nil then
end --for i=0,tree.count-1 do
end --if descendants_also=="YES" then
end --function change_state_keyword(new_state,level,descendants_also,tree)
--3.4 functions for summing up in the tree
--3.4.1 function for recursion to build the sum backwards
function BackwardRecursion(WerteTabelle)
local Summe=nil
local AnzahlNumber=0
for k,v in pairs(WerteTabelle) do
if type(v)=="table" and type(v[1])~="number" then
BackwardRecursion(v)
elseif type(v)=="table" and type(v[1])=="number" then print(k,v[1])
if Summe then Summe=Summe+v[1] else Summe = v[1] end
AnzahlNumber=AnzahlNumber+1
else print(k,v)
end --if type(v)=="table" and type(v[1])~="number" then
end --for k,v in pairs(WerteTabelle) do
print("AnzahlNumber",AnzahlNumber,#WerteTabelle)
if AnzahlNumber==#WerteTabelle and type(WerteTabelle[1])~="number" then
table.insert(WerteTabelle,1,Summe)
print(Summe)
end --if AnzahlNumber==#WerteTabelle[1] and type(WerteTabelle[1])~="number" then
end --function BackwardRecursion(WerteTabelle)
--3.4.2 calculate the depth to reduce number of recursions
function TiefeRecursion(WerteTabelle)
Tiefe=(Tiefe or 0)+1
for k,v in pairs(WerteTabelle) do
if type(v)=="table" then
TiefeRecursion(v)
end --if type(v)=="table" then
end --for k,v in pairs(WerteTabelle) do
end --function TiefeRecursion(WerteTabelle)
--3.4.3 function to use the recursion until depth to avoid endless loop
function AnwendungTiefeRecursion(WerteTabelle)
local i=0
while i<Tiefe do
i=i+1
if type(WerteTabelle[1])=="number" then break
else
BackwardRecursion(WerteTabelle)
end --if type(WerteTabelle[1])=="number" then break
end --while i<Tiefe do
end --function AnwendungTiefeRecursion(WerteTabelle)
--3.4.4 function for visualisation of the backward recursion to have values in the same line as the texts
--idea: TreeZurAnsicht recursiv branchname with element 1 to be added and delete element 1 TreeAusgabe wth function RemoveRecursion()
function AnsichtRecursion(TreeZurAnsicht,TreeAusgabe)
--TreeAusgabe.state="COLLAPSED"
TreeAusgabe.branchname=TreeZurAnsicht.branchname:gsub(" +$","") .. ": " .. tostring(TreeZurAnsicht[1]):gsub("%.(%d+)",",%1 "):gsub("(%d?%d?%d)(%d%d%d,)","%1.%2"):gsub("(%d?%d?%d)(%d%d%d)$","%1.%2"):gsub("(%d?%d?%d)(%d%d%d%.)","%1.%2"):gsub("(%d?%d?%d)(%d%d%d%.)","%1.%2"):gsub("(%d?%d?%d)(%d%d%d%.)","%1.%2"):gsub("(%d?%d?%d)(%d%d%d%.)","%1.%2"):gsub(" $","")
TreeAusgabe[1]=TreeZurAnsicht[1]
for k,v in ipairs(TreeZurAnsicht) do
if k>1 then TreeAusgabe[k]={} AnsichtRecursion(TreeZurAnsicht[k],TreeAusgabe[k]) end
end --for k,v in ipairs(TreeZurAnsicht) do
end --function AnsichtRecursion(TreeZurAnsicht,TreeAusgabe)
--3.4.5 function to calculate the portions with the sums of the levels above
function AnteilRecursion(TreeAnteile,SummeTabelle,TreeAusgabe)
--TreeAusgabe.state="COLLAPSED"
TreeAusgabe.branchname=TreeAnteile.branchname .. ": " .. math.floor(TreeAnteile[1]/SummeTabelle[1]*100+0.5)/100
TreeAusgabe[1]=TreeAnteile[1]
for k,v in ipairs(TreeAnteile) do
if type(v)=="table" then TreeAusgabe[k]={} AnteilRecursion(v,TreeAnteile,TreeAusgabe[k]) end
end --for k,v in ipairs(TreeAnteile) do
end --function AnteilRecursion(TreeAnteile,SummeTabelle,TreeAusgabe)
--3.4.6 function to delete the first elements if it is a number
function RemoveRecursion(WerteTabelle)
if type(WerteTabelle[1])=="number" then table.remove(WerteTabelle,1) end
for k,v in ipairs(WerteTabelle) do
if type(v)=="table" then RemoveRecursion(v) end
end --for k,v in ipairs(WerteTabelle) do
end --function RemoveRecursion(WerteTabelle)
--3.4 functions for summing up in the tree end
--4. dialogs
--4.1 rename dialog
--ok button
ok = iup.flatbutton{title = "OK",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function ok:flat_action()
tree.title = text.value
return iup.CLOSE
end --function ok:flat_action()
--cancel button
cancel = iup.flatbutton{title = "Abbrechen",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function cancel:flat_action()
return iup.CLOSE
end --function cancel:flat_action()
text = iup.multiline{size="120x50",border="YES",expand="YES",wordwrap="YES"} --textfield
label1 = iup.label{title="Name:"}--label for textfield
--open the dialog for renaming branch/leaf
dlg_rename = iup.dialog{
iup.vbox{label1, text, iup.hbox{ok,cancel}};
title="Knoten bearbeiten",
size="QUARTER",
startfocus=text,
}
--4.1 rename dialog end
--4.2 search dialog
searchtext = iup.multiline{border="YES",expand="YES", SELECTION="ALL",wordwrap="YES"} --textfield for search
--search to mark without going to the any node
searchmark = iup.flatbutton{title = "Markieren",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function searchmark:flat_action()
--unmark all nodes
for i=0, tree.count - 1 do
tree["color" .. i]="0 0 0"
end --for i=0, tree.count - 1 do
for i=0, tree2.count - 1 do
tree2["color" .. i]="0 0 0"
end --for i=0, tree2.count - 1 do
for i=0, tree3.count - 1 do
tree3["color" .. i]="0 0 0"
end --for i=0, tree3.count - 1 do
--unmark all nodes end
--mark all nodes
for i=0, tree.count - 1 do
if tree["title" .. i]:upper():match(searchtext.value:upper())~= nil then
iup.TreeSetAncestorsAttributes(tree,i,{color="255 0 0",})
iup.TreeSetNodeAttributes(tree,i,{color="0 0 250",})
iup.TreeSetDescendantsAttributes(tree,i,{color="90 195 0"})
end --if tree["title" .. i]:upper():match(searchtext.value:upper())~= nil then
end --for i=0, tree2.count - 1 do
for i=0, tree2.count - 1 do
if tree2["title" .. i]:upper():match(searchtext.value:upper())~= nil then
iup.TreeSetAncestorsAttributes(tree2,i,{color="255 0 0",})
iup.TreeSetNodeAttributes(tree2,i,{color="0 0 250",})
iup.TreeSetDescendantsAttributes(tree2,i,{color="90 195 0"})
end --if tree2["title" .. i]:upper():match(searchtext.value:upper())~= nil then
end --for i=0, tree2.count - 1 do
for i=0, tree3.count - 1 do
if tree3["title" .. i]:upper():match(searchtext.value:upper())~= nil then
iup.TreeSetAncestorsAttributes(tree3,i,{color="255 0 0",})
iup.TreeSetNodeAttributes(tree3,i,{color="0 0 250",})
iup.TreeSetDescendantsAttributes(tree3,i,{color="90 195 0"})
end --if tree3["title" .. i]:upper():match(searchtext.value:upper())~= nil then
end --for i=0, tree3.count - 1 do
--mark all nodes end
end --function searchmark:flat_action()
--unmark without leaving the search-window
unmark = iup.flatbutton{title = "Entmarkieren",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function unmark:flat_action()
--unmark all nodes
for i=0, tree.count - 1 do
tree["color" .. i]="0 0 0"
end --for i=0, tree.count - 1 do
for i=0, tree2.count - 1 do
tree2["color" .. i]="0 0 0"
end --for i=0, tree2.count - 1 do
for i=0, tree3.count - 1 do
tree3["color" .. i]="0 0 0"
end --for i=0, tree3.count - 1 do
--unmark all nodes end
end --function unmark:flat_action()
search_label=iup.label{title="Suchfeld:"} --label for textfield
--search searchtext.value in textfield1
search_in_textfield1 = iup.flatbutton{title = "Suche in der Vorschau",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
searchPosition=1
function search_in_textfield1:flat_action()
from,to=textfield1.value:find(searchtext.value,searchPosition)
searchPosition=to
if from==nil then
searchPosition=1
iup.Message("Suchtext in der Vorschau nicht gefunden","Suchtext in der Vorschau nicht gefunden")
else
textfield1.SELECTIONPOS=from-1 .. ":" .. to
end --if from==nil then
end -- function search_in_textfield1:flat_action()
--put above together in a search dialog
dlg_search =iup.dialog{
iup.vbox{iup.hbox{search_label,searchtext,},
iup.label{title="Sonderzeichen: %. für ., %- für -, %+ für +, %% für %, %[ für [, %] für ], %( für (, %) für ), %^ für ^, %$ für $, %? für ?",},
iup.hbox{searchmark,unmark,},
iup.label{title="rot: übergeordnete Knoten",fgcolor = "255 0 0", },
iup.label{title="blau: gleicher Knoten",fgcolor = "0 0 255", },
iup.label{title="grün: untergeordnete Knoten",fgcolor = "90 195 0", },
iup.hbox{search_in_textfield1,},
};
title="Suchen",
size="420x100",
startfocus=searchtext
}
--4.2 search dialog end
--4.3 replace dialog
--cancel button for search dialog
cancel_replace = iup.flatbutton{title = "Abbrechen",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function cancel_replace:flat_action()
--make everything black again
for i=0, tree.count - 1 do
tree["color" .. i]="0 0 0"
end --for i=0, tree.count - 1 do
for i=0, tree2.count - 1 do
tree2["color" .. i]="0 0 0"
end --for i=0, tree2.count - 1 do
return iup.CLOSE
end --function cancel_replace:flat_action()
searchtext_replace = iup.multiline{border="YES",expand="YES", SELECTION="ALL", wordwrap="YES"} --textfield for search
replacetext_replace = iup.multiline{border="YES",expand="YES", SELECTION="ALL", wordwrap="YES"} --textfield for replace
--search in upward direction
search_replace = iup.flatbutton{title = "Ersetzen",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function search_replace:flat_action()
for i=0, tree.count-1 do
if tree["TITLE" .. i]:match(searchtext_replace.value)~=nil then
tree["TITLE" .. i]=tree["TITLE" .. i]:gsub(searchtext_replace.value,replacetext_replace.value)
end --if tree["TITLE" .. i]:match(searchtext_replace.value)~=nil then
end --for i=0, tree.count-1 do
end --function search_replace:flat_action()
search_label_replace=iup.label{title= "Suchfeld: "} --label for textfield
replace_label_replace=iup.label{title="Ersetzen mit:"} --label for textfield
--put above together in a search dialog
dlg_search_replace =iup.dialog{
iup.vbox{
iup.hbox{search_label_replace,searchtext_replace},
iup.hbox{replace_label_replace,replacetext_replace},
iup.hbox{search_replace, cancel_replace,},
iup.label{title="Sonderzeichen: %. für ., %- für -, %+ für +, %% für %, %[ für [, %] für ], %( für (, %) für ), %^ für ^, %$ für $, %? für ?",},
};
title="Suchen und Ersetzen",
size="420x100",
startfocus=replacetext_replace
}
--4.3 replace dialog end
--4.4 expand and collapse dialog
--function needed for the expand and collapse dialog
function button_expand_collapse(new_state,tree)
if toggle_level.value=="ON" then
if checkbox_descendants_collapse.value=="ON" then
change_state_level(new_state,tree.depth,"YES",tree)
change_state_level(new_state,tree.depth,"YES",tree2)
change_state_level(new_state,tree.depth,"YES",tree3)
else
change_state_level(new_state,tree.depth,"NO",tree)
change_state_level(new_state,tree.depth,"NO",tree2)
change_state_level(new_state,tree.depth,"NO",tree3)
end --if checkbox_descendants_collapse.value="ON" then
elseif toggle_keyword.value=="ON" then
if checkbox_descendants_collapse.value=="ON" then
change_state_keyword(new_state,text_expand_collapse.value,"YES",tree)
change_state_keyword(new_state,text_expand_collapse.value,"YES",tree2)
change_state_keyword(new_state,text_expand_collapse.value,"YES",tree3)
else
change_state_keyword(new_state,text_expand_collapse.value,"NO",tree)
change_state_keyword(new_state,text_expand_collapse.value,"NO",tree2)
change_state_keyword(new_state,text_expand_collapse.value,"NO",tree3)
end --if checkbos_descendants_collapse.value=="ON" then
end --if toggle_level.value="ON" then
end --function button_expand_collapse(new_state,tree)
--button for expanding branches
expand_button=iup.flatbutton{title="Ausklappen",size="EIGHTH",BGCOLOR=color_buttons,FGCOLOR=color_button_text}
function expand_button:flat_action()
button_expand_collapse("EXPANDED",tree) --call above function with expand as new state
end --function expand_button:flat_action()
--button for collapsing branches
collapse_button=iup.flatbutton{title="Einklappen",size="EIGHTH",BGCOLOR=color_buttons,FGCOLOR=color_button_text}
function collapse_button:flat_action()
button_expand_collapse("COLLAPSED",tree) --call above function with collapsed as new state
end --function collapse_button:flat_action()
--button for cancelling the dialog
cancel_expand_collapse_button=iup.flatbutton{title="Abbrechen",size="EIGHTH",BGCOLOR=color_buttons,FGCOLOR=color_button_text}
function cancel_expand_collapse_button:flat_action()
return iup.CLOSE
end --function cancel_expand_collapse_button:flat_action()
--toggle if expand/collapse should be applied to current depth
toggle_level=iup.toggle{title="Nach aktueller Ebene", value="ON"}
function toggle_level:action()
text_expand_collapse.active="NO"
end --function toggle_level:action()
--toggle if expand/collapse should be applied to search, i.e. to all nodes containing the text in the searchfield
toggle_keyword=iup.toggle{title="Nach Suchwort", value="OFF"}
function toggle_keyword:action()
text_expand_collapse.active="YES"
end --function toggle_keyword:action()
--radiobutton for toggles, if search field or depth expand/collapse function
radio=iup.radio{iup.hbox{toggle_level,toggle_keyword},value=toggle_level}
--text field for expand/collapse
text_expand_collapse=iup.text{active="NO",expand="YES"}
--checkbox if descendants also be changed
checkbox_descendants_collapse=iup.toggle{title="Auf untergeordnete Knoten anwenden",value="ON"}
--put this together into a dialog
dlg_expand_collapse=iup.dialog{
iup.vbox{
iup.hbox{radio},
iup.hbox{text_expand_collapse},
iup.hbox{checkbox_descendants_collapse},
iup.hbox{expand_button,collapse_button,cancel_expand_collapse_button},
};
defaultenter=expand_button,
defaultesc=cancel_expand,
title="Ein-/Ausklappen",
size="QUARTER",
startfocus=searchtext,
}
--4.4 expand and collapse dialog end
--4. dialogs end
--5. context menus (menus for right mouse click)
--5.1 menu of tree
--5.1.1 copy node of tree
startcopy = iup.item {title = "Knoten kopieren"}
function startcopy:action() --copy node
clipboard.text = tree['title']
end --function startcopy:action()
--5.1.1.1 copy node of tree with all children and add to the root
startcopy_doubling = iup.item {title = "Verdoppeln"}
function startcopy_doubling:action() --copy first node with same text as selected node with all its child nodes
local TreeText=""
local takeNode="yes"
local actualDepth=1
local kindEndNode=""
local countNodeandChildren=0
local numberOfNode=math.tointeger(tonumber(tree.value))
local depthOfNode=tree["DEPTH" .. numberOfNode]
for i=numberOfNode, tree.count-1 do
if i==numberOfNode then
kindEndNode=tree["KIND" .. i ]
--test with: print(tree["TITLE" .. i])
TreeText='{branchname="' .. string.escape_forbidden_char(tree["TITLE"]) .. '",'
countNodeandChildren=countNodeandChildren+1
elseif i>numberOfNode and tonumber(tree["DEPTH" .. i])>tonumber(depthOfNode) and takeNode=="yes" and tonumber(tree["DEPTH" .. i])>actualDepth then
kindEndNode=tree["KIND" .. i ]
actualDepth=tonumber(tree["DEPTH" .. i])
if tree["KIND" .. i ]=="LEAF" then
TreeText=TreeText .. '\n"' .. string.escape_forbidden_char(tree["TITLE" .. i]) .. '",'
else
TreeText=TreeText .. '\n{branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i]) .. '",'
end --if tree["KIND" .. i ]=="LEAF" then
countNodeandChildren=countNodeandChildren+1
elseif i>numberOfNode and tonumber(tree["DEPTH" .. i])>tonumber(depthOfNode) and takeNode=="yes" and tonumber(tree["DEPTH" .. i])<actualDepth then
if tree["KIND" .. i-1 ]=="BRANCH" then
TreeText=TreeText .. '},\n'
end -- if tree["KIND" .. i ]=="BRANCH" and tree["KIND" .. i ]=="BRANCH" then
kindEndNode=tree["KIND" .. i ]
local numberOfcurlybrakets=math.tointeger(actualDepth-tonumber(tree["DEPTH" .. i]))
actualDepth=tonumber(tree["DEPTH" .. i])
for i=1,numberOfcurlybrakets do
TreeText=TreeText .. '},\n'
end --for i=1,numberOfcurlybrakets do
if tree["KIND" .. i ]=="LEAF" then
TreeText=TreeText .. '\n"' .. string.escape_forbidden_char(tree["TITLE" .. i]) .. '",'
else
TreeText=TreeText .. '\n{branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i]) .. '",'
end --if tree["KIND" .. i ]=="LEAF" then
countNodeandChildren=countNodeandChildren+1
elseif i>numberOfNode and tonumber(tree["DEPTH" .. i])>tonumber(depthOfNode) and takeNode=="yes" then
--tonumber(tree["DEPTH" .. i])==actualDepth
if tree["KIND" .. i-1 ]=="BRANCH" then
TreeText=TreeText .. '},\n'
end -- if tree["KIND" .. i ]=="BRANCH" and tree["KIND" .. i ]=="BRANCH" then
kindEndNode=tree["KIND" .. i ]
--test with: print(tree["DEPTH" .. i],tree.title0:match(".:\\.*") .. tree["TITLE" .. i])
if tree["KIND" .. i ]=="LEAF" then
TreeText=TreeText .. '\n"' .. string.escape_forbidden_char(tree["TITLE" .. i]) .. '",'
else
TreeText=TreeText .. '\n{branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i]) .. '",'
end --if tree["KIND" .. i ]=="LEAF" then
countNodeandChildren=countNodeandChildren+1
elseif i>numberOfNode then
takeNode="no"
end --if takeNode=="yes" then
end --for i=0, tree.count-1 do
--test with: print(kindEndNode)
--test with: print("countNodeandChildren: " .. countNodeandChildren)
--with countNodeandChildren==1 the curly braket is set by the last one
if kindEndNode=="BRANCH" and countNodeandChildren>1 then
TreeText=TreeText .. '},\n'
end -- if kindEndNode=="BRANCH" and countNodeandChildren>1 then
endnumberOfcurlybrakets=math.max(math.tointeger(actualDepth-depthOfNode-1),0)
for i=1,endnumberOfcurlybrakets do
TreeText=TreeText .. '},'
end --for i=1,endnumberOfcurlybrakets do
TreeText=TreeText .. '}'
--test with: print(TreeText)
--load TreeText as tree_temp
local _,numberCurlyBraketsBegin=TreeText:gsub("{","")
local _,numberCurlyBraketsEnd=TreeText:gsub("}","")
if numberCurlyBraketsBegin==numberCurlyBraketsEnd and _VERSION=='Lua 5.1' then
loadstring('tree_temp='..TreeText)()
--test with: for k,v in pairs(tree_temp) do print(k,v) end
tree_temp={branchname=tree["title0"],tree_temp}
iup.TreeAddNodes(tree,tree_temp)
elseif numberCurlyBraketsBegin==numberCurlyBraketsEnd then
load('tree_temp='..TreeText)() --now tree_temp is filled
--test with: for k,v in pairs(tree_temp) do print(k,v) end
tree_temp={branchname=tree["title0"],tree_temp}
iup.TreeAddNodes(tree,tree_temp)
else
iup.Message("Der Knoten kann nicht verdoppelt werden.","Der Knoten kann nicht verdoppelt werden.")
end --if numberCurlyBraketsBegin==numberCurlyBraketsEnd and _VERSION=='Lua 5.1' then
end --function startcopy_doubling:action()
--5.1.2 rename node and rename action for other needs of tree
renamenode = iup.item {title = "Knoten bearbeiten"}
function renamenode:action()
text.value = tree['title']
dlg_rename:popup(iup.CENTER, iup.CENTER) --popup rename dialog
iup.SetFocus(tree)
end --function renamenode:action()
--5.1.3 add branch to tree
addbranch = iup.item {title = "Ast hinzufügen"}
function addbranch:action()
tree.addbranch = ""
tree.value=tree.value+1
renamenode:action()
end --function addbranch:action()
--5.1.4 add branch of tree from clipboard
addbranch_fromclipboard = iup.item {title = "Ast aus Zwischenablage"}
function addbranch_fromclipboard:action()
tree.addbranch = clipboard.text
tree.value=tree.value+1
end --function addbranch_fromclipboard:action()
--5.1.5 add leaf of tree
addleaf = iup.item {title = "Blatt hinzufügen"}
function addleaf:action()
tree.addleaf = ""
tree.value=tree.value+1
renamenode:action()
end --function addleaf:action()
--5.1.6 add leaf of tree from clipboard
addleaf_fromclipboard = iup.item {title = "Blatt aus Zwischenablage"}
function addleaf_fromclipboard:action()
tree.addleaf = clipboard.text
tree.value=tree.value+1
end --function addleaf_fromclipboard:action()
--5.1.7 copy a version of the file selected in the tree and give it the next version number
startversion = iup.item {title = "Version archivieren"}
function startversion:action()
--get the version of the file
if tree['title']:match(".:\\.*%.[^\\]+") then
Version=0
p=io.popen('dir "' .. tree['title']:gsub("(%.+)","_Version*%1") .. '" /b/o')
for Datei in p:lines() do
--test with: iup.Message("Version",Datei)
if Datei:match("_Version(%d+)") then Version_alt=Version Version=tonumber(Datei:match("_Version(%d+)")) if Version<Version_alt then Version=Version_alt end end
--test with: iup.Message("Version",Version)
end --for Datei in p:lines() do
--test with: iup.Message(Version,Version+1)
Version=Version+1
iup.Message("Archivieren der Version:",tree['title']:gsub("(%.+)","_Version" .. Version .. "%1"))
os.execute('copy "' .. tree['title'] .. '" "' .. tree['title']:gsub("(%.+)","_Version" .. Version .. "%1") .. '"')
end --if tree['title']:match(".:\\.*%.[^\\]+") then
end --function startversion:action()
--5.1.8 start file of node of tree in IUP Lua scripter or start empty file in notepad or start empty scripter
startnodescripter = iup.item {title = "Skripter starten"}
function startnodescripter:action()
--read first line of file. If it is empty then scripter cannot open it. So open file with notepad.exe
if file_exists(tree['title']) then inputfile=io.open(tree['title'],"r") ErsteZeile=inputfile:read() inputfile:close() end
if file_exists(tree['title']) and ErsteZeile then
os.execute('start "d" C:\\Lua\\iupluascripter54.exe "' .. tree['title'] .. '"')
elseif file_exists(tree['title']) then
os.execute('start "d" notepad.exe "' .. tree['title'] .. '"')
else
os.execute('start "d" C:\\Lua\\iupluascripter54.exe ')
end --if file_exists(tree['title']) and ErsteZeile then
end --function startnodescripter:action()
--5.1.9 start the file or repository of the node of tree
startnode = iup.item {title = "Starten"}
function startnode:action()
if tree['title']:match("^.:\\.*%.[^\\ ]+$") or tree['title']:match("^.:\\.*[^\\]+$") or tree['title']:match("^.:\\$") or tree['title']:match("^[^ ]*//[^ ]+$") then
os.execute('start "D" "' .. tree['title'] .. '"')
elseif tree['title']:match("sftp .*") then
os.execute(tree['title'])
end --if tree['title']:match("^.:\\.*%.[^\\ ]+$") or tree['title']:match("^.:\\.*[^\\]+$") or tree['title']:match("^.:\\$") or tree['title']:match("^[^ ]*//[^ ]+$") then
end --function startnode:action()
--5.1.10 put the menu items together in the menu for tree
menu = iup.menu{
startcopy,
startcopy_doubling,
renamenode,
addbranch,
addbranch_fromclipboard,
addleaf,
addleaf_fromclipboard,
startversion,
startnodescripter,
startnode,
}
--5.1 menu of tree end
--5. context menus (menus for right mouse click) end
--6 buttons
--6.1 logo image definition and button with logo
img_logo = iup.image{
{ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,3,3,1,1,3,3,3,1,1,1,1,1,3,1,1,1,3,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,3,3,1,1,3,1,1,3,1,1,1,1,3,1,1,3,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,3,3,3,3,1,1,1,1,1,3,1,1,3,1,1,1,1,3,1,3,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,3,3,3,4,4,3,1,1,1,1,3,3,3,3,1,1,1,1,3,3,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,3,3,3,3,4,4,3,3,1,1,1,3,1,1,1,3,1,1,1,3,1,3,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,3,3,3,3,3,3,3,3,1,1,1,3,1,1,1,3,1,1,1,3,1,1,3,1,1,1,1,1,4,4,4 },
{ 4,1,1,3,3,3,3,3,3,3,3,1,1,1,3,3,3,3,1,1,3,1,3,1,1,1,3,1,3,1,1,4,4,4 },
{ 4,1,1,1,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,3,1,3,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,3,1,3,3,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,1,1,3,3,1,3,1,3,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,1,1,3,3,1,3,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,1,1,1,4,4,4,4,4,3,3,4,4,4,4,1,3,3,1,1,1,1,1,1,1,4,4,4,4 },
{ 4,1,1,1,1,1,1,1,4,4,4,4,3,3,3,3,3,3,4,4,4,3,1,1,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,1,4,4,4,4,4,3,3,3,3,3,3,3,3,3,4,3,4,1,1,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,1,1,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,1,1,1,1,1,1,4,4,4 },
{ 4,1,1,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,1,1,1,1,1,4,4,4 },
{ 4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,1,1,1,4,4,4 },
{ 4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,1,1,4,4,4 },
{ 4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,4,4,4 },
{ 4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4 },
{ 4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4 },
{ 4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4 },
{ 4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 },
{ 4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4 },
{ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4 },
{ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 },
{ 3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 },
{ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 }
; colors = { color_grey_bpc, color_light_color_grey_bpc, color_blue_bpc, "255 255 255" }
}
button_logo=iup.button{image=img_logo,title="", size="23x20"}
function button_logo:action()
iup.Message("Beckmann & Partner CONSULT","BERATUNGSMANUFAKTUR\nMeisenstraße 79\n33607 Bielefeld\nDr. Bruno Kaiser\nLizenz Open Source")
end --function button_logo:flat_action()
--6.2 button for saving tree
button_save_lua_table=iup.flatbutton{title="Baum speichern \n(als Text Strg+P)", size="95x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_save_lua_table:flat_action()
save_tree_to_lua(tree, path .. "\\documentation_tree_balance.lua")
end --function button_save_lua_table:flat_action()
--6.3 button for search in tree, tree2 and tree3
button_search=iup.flatbutton{title="Suchen\n(Strg+F)", size="85x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_search:flat_action()
searchtext.value=tree.title
searchtext.SELECTION="ALL"
dlg_search:popup(iup.ANYWHERE, iup.ANYWHERE)
end --function button_search:flat_action()
--6.4 button for replacing in tree
button_replace=iup.flatbutton{title="Suchen und Ersetzen\n(Strg+H)", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_replace:flat_action()
searchtext_replace.value=tree.title
replacetext_replace.SELECTION="ALL"
dlg_search_replace:popup(iup.ANYWHERE, iup.ANYWHERE)
end --function button_replace:flat_action()
--6.5 button for expand and collapse
button_expand_collapse_dialog=iup.flatbutton{title="Ein-/Ausklappen\n(Strg+R)", size="85x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_expand_collapse_dialog:flat_action()
text_expand_collapse.value=tree.title
dlg_expand_collapse:popup(iup.ANYWHERE, iup.ANYWHERE)
end --function button_expand_collapse_dialog:flat_action()
--6.6 button to update tree2, mark non existing files in grey and copy node with path
button_copy_title=iup.flatbutton{title="Aktualisieren der Passivseite", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_copy_title:flat_action()
--clipboard.text=tree2.title0:match(".:\\.*") .. tree2.title
--textfield1.value=tree2.title0:match(".:\\.*") .. tree2.title
delete_nodes_of_tree(tree2)
if file_exists(path .. "\\documentation_tree_balance_passive.lua") then
dofile(path .. "\\documentation_tree_balance_passive.lua")
tree_script=tree_script or {branchname="Nicht dokumentierte Dateien auf: " .. path, --copy with path
}
else
tree_script={branchname="Nicht dokumentierte Dateien auf: " .. path, --copy with path
}
temp_folder_content=io.popen('"dir /b /s "' .. path ..'""') --execute command to obtain the current directory. /s can be left out, if the subdirectories should not be considered
while true do
local line = temp_folder_content:read("*line")
if line == nil then break end
tree_script[#tree_script+1]=line:sub(path:len()+1, -1)
end --while true do
end --if file_exists(path .. "\\documentation_tree_balance_passive.lua") then
iup.TreeAddNodes(tree2, tree_script)
end --function button_copy_title:flat_action()
--6.7 button to edit in IUP Lua scripter the script for tree2
button_edit_treescript=iup.flatbutton{title="Programmieren der \nPassivseite", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_edit_treescript:flat_action()
os.execute('start "d" C:\\Lua\\iupluascripter54.exe "' .. path .. '\\documentation_tree_balance_passive.lua"')
end --function button_edit_treescript:flat_action()
--6.8 button to update tree3
button_statisticsupdate=iup.flatbutton{title="Aktualisieren der \nAktivseite", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_statisticsupdate:flat_action()
delete_nodes_of_tree(tree3)
if file_exists(path .. "\\documentation_tree_balance_active.lua") then
dofile(path .. "\\documentation_tree_balance_active.lua")
else
iup.Message("Es gibt keine Statistik","Es gibt keine Statistik")
end --if file_exists(path .. "\\documentation_tree_balance_passive.lua") then
iup.TreeAddNodes(tree3, tree_statistics)
end --function button_statisticsupdate:flat_action()
--6.9 button to edit in IUP Lua scripter the script for tree3
button_edit_treestatistics=iup.flatbutton{title="Programmieren der \nAktivseite", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_edit_treestatistics:flat_action()
os.execute('start "d" C:\\Lua\\iupluascripter54.exe "' .. path .. '\\documentation_tree_balance_active.lua"')
end --function button_edit_treestatistics:flat_action()
--6.10 button to update indicators
button_indicators_update=iup.flatbutton{title="Aktualisieren der \nKennzahlen", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_indicators_update:flat_action()
if file_exists(path .. "\\documentation_tree_balance_indicators.lua") then
dofile(path .. "\\documentation_tree_balance_indicators.lua")
else
iup.Message("Es gibt keine Statistik","Es gibt keine Statistik")
end --if file_exists(path .. "\\documentation_tree_balance_passive.lua") then
end --function button_indicators_update:flat_action()
--6.11 button to edit in IUP Lua scripter the script for indicators
button_indicators_edit=iup.flatbutton{title="Programmieren der \nKennzahlen", size="105x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text}
function button_indicators_edit:flat_action()
os.execute('start "d" C:\\Lua\\iupluascripter54.exe "' .. path .. '\\documentation_tree_balance_indicators.lua"')
end --function button_indicators_edit:flat_action()
--6.12 button with second logo
button_logo2=iup.button{image=img_logo,title="", size="23x20"}
function button_logo2:action()
iup.Message("Beckmann & Partner CONSULT","BERATUNGSMANUFAKTUR\nMeisenstraße 79\n33607 Bielefeld\nDr. Bruno Kaiser\nLizenz Open Source")
end --function button_logo:flat_action()
--6 buttons end
--7 Main Dialog
--7.1 load tree from file
if file_exists(path_documentation_tree) then
dofile(path_documentation_tree) --initialize the tree, read from the Lua file
for line in io.lines(path_documentation_tree) do
if line:match('=')~= nil then
tablename=line:sub(1,line:find('=')-1):gsub(' ', '')
break
end --if line:match('=')~= nil then
end --for line in io.lines(path_documentation_tree) do
--save table in the variable actualtree
--Lua 5.1 has the function loadstring() - in later versions, this is replaced by load(), hence we detect this here
if _VERSION=='Lua 5.1' then
loadstring('actualtree='..tablename)()
else
load('actualtree='..tablename)() --now actualtree is the table.
end --if _VERSION=='Lua 5.1' then
end --if file_exists(path_documentation_tree) then
tree=iup.tree{
map_cb=function(self)
self:AddNodes(actualtree)
end, --function(self)
SIZE="400x10",
showrename="YES",--F2 key active
markmode="SINGLE",--for Drag & Drop SINGLE not MULTIPLE
showdragdrop="YES",
}
--set the background color of the tree
tree.BGCOLOR=color_background_tree
-- Callback of the right mouse button click
function tree:rightclick_cb(id)
tree.value = id
menu:popup(iup.MOUSEPOS,iup.MOUSEPOS) --popup the defined menue
end --function tree:rightclick_cb(id)
-- Callback called when a node will be doubleclicked
function tree:executeleaf_cb(id)
if tree['title' .. id]:match("^.:\\.*%.[^\\ ]+$") or tree['title' .. id]:match("^.:\\.*[^\\]+$") or tree['title' .. id]:match("^.:\\$") or tree['title' .. id]:match("^[^ ]*//[^ ]+$") then os.execute('start "d" "' .. tree['title' .. id] .. '"') end
end --function tree:executeleaf_cb(id)
-- Callback for pressed keys
function tree:k_any(c)
if c == iup.K_DEL then
-- do a totalchildcount of marked node. Then pop the table entries, which correspond to them.
for j=0,tree.totalchildcount do
--table.remove(attributes, tree.value+1)
end --for j=0,tree.totalchildcount do
tree.delnode = "MARKED"
elseif c == iup.K_cP then -- added output of current table to a text file and dependencies to a csv file
printtree()
printdependencies()
elseif c == iup.K_cT then -- compare text files of tree and tree2
compareText=""
if tree.TITLE:match(".:\\.*%.[^\\]+") and (tree2.title0:match(".:\\.*") .. tree2.TITLE):match(".:\\.*%.[^\\]+") then
compare_files(tree.TITLE , tree2.title0:match(".:\\.*") .. tree2.TITLE)
textfield1.value=compareText
else
textfield1.value="Kein Vergleich von " .. tree.TITLE .. " \nmit " .. tree2.title0:match(".:\\.*") .. tree2.TITLE
end --if tree.TITLE:match(".:\\.*%.[^\\]+") and (tree2.title0:match(".:\\.*") .. tree2.TITLE):match(".:\\.*%.[^\\]+") then
elseif c == iup.K_cF then
searchtext.value=tree.title
searchtext.SELECTION="ALL"
dlg_search:popup(iup.ANYWHERE, iup.ANYWHERE)
elseif c == iup.K_cH then
searchtext_replace.value=tree.title
replacetext_replace.SELECTION="ALL"
dlg_search_replace:popup(iup.ANYWHERE, iup.ANYWHERE)
elseif c == iup.K_cD then
printdependencies()
elseif c == iup.K_Menu then
menu:popup(iup.MOUSEPOS,iup.MOUSEPOS) --popup the defined menue
end --if c == iup.K_DEL then
end --function tree:k_any(c)
--7.2 load tree2 from file
if file_exists(path .. "\\documentation_tree_balance_passive.lua") then
dofile(path .. "\\documentation_tree_balance_passive.lua")
tree_script=tree_script or {branchname="Nicht dokumentierte Dateien auf: " .. path, --Verbesserung durch Pfadangabe
}
else
tree_script={branchname="Nicht dokumentierte Dateien auf: " .. path, --Verbesserung durch Pfadangabe
}
temp_folder_content=io.popen('"dir /b /s "' .. path ..'""') --execute command to obtain the current directory. /s can be left out, if the subdirectories should not be considered
while true do
local line = temp_folder_content:read("*line")
if line == nil then break end
tree_script[#tree_script+1]=line:sub(path:len()+1, -1)
end --while true do
end --if file_exists(path .. "\\documentation_tree_balance_passive.lua") then
tree2=iup.tree{
map_cb=function(self)
self:AddNodes(tree_script)
end, --function(self)
SIZE="400x400",
showrename="YES",--F2 key active
markmode="MULTIPLE",--for Drag & Drop SINGLE not MULTIPLE
}
--set the background color of the tree
tree2.BGCOLOR=color_background_tree
-- Callback called when a node will be doubleclicked
function tree2:executeleaf_cb(id)
os.execute('start "d" "' .. tree2.title0:match(".:\\.*") .. tree2['title' .. id] .. '"')
end --function tree:executeleaf_cb(id)
-- Callback for pressed keys
function tree2:k_any(c)
if c == iup.K_cF then
searchtext.value=tree2.title
searchtext.SELECTION="ALL"
dlg_search:popup(iup.ANYWHERE, iup.ANYWHERE)
elseif c == iup.K_cT then -- compare text files of tree and tree2
compareText=""
if tree.TITLE:match(".:\\.*%.[^\\]+") and (tree2.title0:match(".:\\.*") .. tree2.TITLE):match(".:\\.*%.[^\\]+") then
compare_files(tree.TITLE , tree2.title0:match(".:\\.*") .. tree2.TITLE)
textfield1.value=compareText
else
textfield1.value="Kein Vergleich von " .. tree.TITLE .. " \nmit " .. tree2.title0:match(".:\\.*") .. tree2.TITLE
end --if tree.TITLE:match(".:\\.*%.[^\\]+") and (tree2.title0:match(".:\\.*") .. tree2.TITLE):match(".:\\.*%.[^\\]+") then
end --if c == iup.K_cF then
end --function tree2:k_any(c)
--7.3 load tree3 from file
dofile(path .. "\\documentation_tree_balance_active.lua")
tree3=iup.tree{
map_cb=function(self)
self:AddNodes(tree_statistics)
end, --function(self)
SIZE="550x400",
showrename="YES",--F2 key active
markmode="SINGLE",--for Drag & Drop SINGLE not MULTIPLE
}
tree3.BGCOLOR=color_background_tree
-- Callback for pressed keys
function tree3:k_any(c)
if c == iup.K_cF then
searchtext.value=tree3.title:match("(.*):")
searchtext.SELECTION="ALL"
dlg_search:popup(iup.ANYWHERE, iup.ANYWHERE)
end --if c == iup.K_cF then
end --function tree3:k_any(c)
--7.4 preview field as scintilla editor
textfield1=iup.scintilla{}
textfield1.SIZE="440x120" --I think this is not optimal! (since the size is so appears to be fixed)
--textfield1.wordwrap="WORD" --enable wordwarp
textfield1.WORDWRAPVISUALFLAGS="MARGIN" --show wrapped lines
textfield1.FONT="Courier New, 8" --font of shown code
textfield1.LEXERLANGUAGE="lua" --set the programming language to Lua for syntax higlighting
textfield1.KEYWORDS0="for end while date time if io elseif else execute do dofile require return break and or os type string nil not next false true gsub gmatch goto ipairs open popen pairs print" --list of keywords for syntaxhighlighting, this list is not complete and can be enlarged
--colors for syntax highlighting
textfield1.STYLEFGCOLOR0="0 0 0" -- 0-Default
textfield1.STYLEFGCOLOR1="0 128 0" -- 1-Lua comment
textfield1.STYLEFGCOLOR2="0 128 0" -- 2-Lua comment line
textfield1.STYLEFGCOLOR3="0 128 0" -- 3-JavaDoc/ Doxygen style Lua commen
textfield1.STYLEFGCOLOR4="180 0 0" -- 4-Number
textfield1.STYLEFGCOLOR5="0 0 255" -- 5-Keywords (id=0)
textfield1.STYLEFGCOLOR6="160 20 180" -- 6-String
textfield1.STYLEFGCOLOR7="128 0 0" -- 7-Character
textfield1.STYLEFGCOLOR8="160 20 180" -- 8-Literal string
textfield1.STYLEFGCOLOR9="0 0 255" -- 9-Old preprocessor block (obsolete)
textfield1.STYLEFGCOLOR10="128 0 0" -- 10-Operator
--textfield1.STYLEBOLD10="YES"
--textfield1.STYLEFGCOLOR11="255 0 255" -- 11-Identifier (this overwrites the default color)
--textfield1.STYLEITALIC10="YES"
textfield1.MARGINWIDTH0="40"
-- Callback for pressed keys
function textfield1:k_any(c)
if c == iup.K_cF then
searchtext.value=textfield1.value
searchtext.SELECTION="ALL"
dlg_search:popup(iup.ANYWHERE, iup.ANYWHERE)
end --if c == iup.K_cF then
end --function tree2:k_any(c)
--7.5 building the dialog and put buttons, trees and preview together
maindlg = iup.dialog{
--simply show a box with buttons
iup.vbox{
--first row of buttons
iup.hbox{
button_logo,
button_save_lua_table,
button_search,
button_replace,
button_expand_collapse_dialog,
iup.label{size="10x",},
button_statisticsupdate,
button_edit_treestatistics,
iup.fill{},
button_copy_title,
button_edit_treescript,
button_indicators_update,
button_indicators_edit,
iup.label{size="10x",},
button_logo2,
},
iup.hbox{
iup.vbox{
iup.frame{title="Aktivseite als Baum",tree3,},
iup.frame{title="Dateienstruktur als Baum",tree,},
},
iup.vbox{
iup.frame{title="Passivseite ohne Eigenkapital als Baum",tree2,},
iup.frame{title="Eigenkapital und Bilanzkennzahlen",textfield1,},
},
},
},
icon = img_logo,
title = path .. " Documentation Tree",
SIZE = 'FULLxFULL',
BACKGROUND=color_background
}
--7.5.1 show the dialog
maindlg:show()
--7.5.2 build indicators with the execution of an individual script
dofile(path .. "\\documentation_tree_balance_indicators.lua")
--7.6 Main Loop
if (iup.MainLoopLevel()==0) then
iup.MainLoop()
end --if (iup.MainLoopLevel()==0) then
|
fx_version 'bodacious'
games { 'gta5' }
author 'Nosmakos'
description 'Titans Productions Report System'
version '1.2.0'
ui_page 'html/index.html'
client_scripts {
'config.lua',
'client/main.lua',
}
server_scripts {
'@mysql-async/lib/MySQL.lua',
'config.lua',
'server/main.lua',
}
files {
'html/index.html',
'html/js/script.js',
'html/css/style.css',
'html/font/Prototype.ttf'
}
|
return function ()
local events = require'nvim-tree.events'
local M = {}
M.cfwob_whitelist = {
".git"
}
vim.g.nvim_tree_indent_markers = 0
vim.g.nvim_tree_git_hl = 1
vim.g.nvim_tree_gitignore = 0
vim.g.nvim_tree_width = 30
vim.g.nvim_tree_group_empty = 1
vim.g.nvim_tree_lsp_diagnostics = 1
vim.g.nvim_tree_auto_open = 0
vim.g.nvim_tree_auto_close = 0
vim.g.nvim_tree_quit_on_open = 0
vim.g.nvim_tree_hijack_netrw = 1
vim.g.nvim_tree_disable_netrw = 0
vim.g.nvim_tree_folder_devicons = 1
vim.g.nvim_tree_follow = 1
vim.g.nvim_tree_special_files = {}
vim.g.nvim_tree_disable_keybindings = 1 -- Disable default keybindings
vim.g.nvim_tree_side = "left"
vim.g.nvim_tree_tab_open = 0
vim.g.nvim_tree_hijack_cursor = 0
vim.g.nvim_tree_update_cwd = 1
-- Shorten the path to fit the window width:
vim.g.nvim_tree_root_folder_modifier = string.format(
[[:~]] -- Relative to home
.. [[:s?\v(.{%d})?§§\1?]] -- Add mark if longer than max width
.. [[:s?\v^§§.{-}(\/.{1,%d}$)?…\1?]] -- If mark: remove until the last '/' that fits in max width
.. [[:s?\v^§§.*\/(.*$)?…\1?]] -- If mark still here: basename is longer than max width. Keep only basename
.. [[:s?\v(.*)? \1?]], -- Add repo icon
vim.g.nvim_tree_width - 7,
vim.g.nvim_tree_width - 9
)
-- vim.g.nvim_tree_window_picker_chars = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890"
-- vim.g.nvim_tree_window_picker_chars = "aoeuidhtnsgcrld;qjkxbmwv"
vim.g.nvim_tree_window_picker_exclude = {
filetype = {
"packer",
"qf",
"Outline"
},
buftype = {
"terminal"
}
}
vim.g.nvim_tree_show_icons = {
git = 1,
folders = 1,
files = 1,
folder_arrows = 1
}
-- vim.g.nvim_tree_ignore = {"*.png", "*.jpg"}
vim.g.nvim_tree_icons = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
ignored = "◌"
},
folder = {
arrow_open = "",
arrow_closed = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
lsp = {
hint = "",
info = "",
warning = "",
error = "",
},
}
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
local bindings = {
["<CR>"] = tree_cb("edit"),
["o"] = ":lua Config.nvim_tree.xdg_open()<CR>",
["<2-LeftMouse>"] = tree_cb("edit"),
["<2-RightMouse>"] = tree_cb("cd"),
["<C-]>"] = tree_cb("cd"),
["<C-t>"] = tree_cb("tabnew"),
["v"] = tree_cb("vsplit"),
["s"] = tree_cb("split"),
["<BS>"] = tree_cb("close_node"),
["<S-CR>"] = tree_cb("close_node"),
["P"] = tree_cb("parent_node"),
["h"] = tree_cb("close_node"),
["l"] = tree_cb("edit"),
["K"] = tree_cb("first_sibling"),
["J"] = tree_cb("last_sibling"),
["<Tab>"] = tree_cb("preview"),
["I"] = tree_cb("toggle_ignored"),
["H"] = tree_cb("toggle_dotfiles"),
["R"] = tree_cb("refresh"),
["a"] = tree_cb("create"),
["d"] = tree_cb("remove"),
["r"] = tree_cb("rename"),
["<C-r>"] = tree_cb("full_rename"),
["x"] = tree_cb("cut"),
["y"] = tree_cb("copy"),
["p"] = tree_cb("paste"),
["[c"] = tree_cb("prev_git_item"),
["]c"] = tree_cb("next_git_item"),
["-"] = tree_cb("dir_up"),
["q"] = tree_cb("close"),
}
local function setup_bindings(buf_id)
for key, cb in pairs(bindings) do
vim.api.nvim_buf_set_keymap(
buf_id, "n", key, cb,
{ noremap = true, silent = true, nowait = true }
)
end
end
function M.custom_setup()
if vim.b.custom_setup_done == 1 then
return
end
vim.b.custom_setup_done = 1
setup_bindings(vim.api.nvim_get_current_buf())
end
function M.focus()
local view = require'nvim-tree.view'
local lib = require'nvim-tree.lib'
if view.win_open() then
view.focus()
else
lib.open()
end
end
function M.toggle_no_focus()
local lib = require'nvim-tree.lib'
local view = require'nvim-tree.view'
local cur_win = vim.api.nvim_get_current_win()
if view.win_open() then
view.close()
else
lib.open()
vim.api.nvim_set_current_win(cur_win)
end
end
function M.xdg_open()
local lib = require'nvim-tree.lib'
local node = lib.get_node_at_cursor()
if node then
vim.fn.jobstart("xdg-open '" .. node.absolute_path .. "' &", { detach = true })
end
end
function M.close_folders_without_open_buffers(use_whitelist)
if vim.g.nvim_tree_ready ~= 1 then return end
vim.schedule(function ()
local nt = require'nvim-tree'
local lib = require'nvim-tree.lib'
local buffers = vim.api.nvim_list_bufs()
local buf_map = {}
local whitelist_map = {}
for _, id in ipairs(buffers) do
if vim.api.nvim_buf_is_loaded(id) and vim.api.nvim_buf_get_option(id, "buflisted") then
buf_map[vim.api.nvim_buf_get_name(id)] = true
end
end
if use_whitelist then
for _, k in ipairs(M.cfwob_whitelist) do
whitelist_map[k] = true
end
end
local did_close = false
local _m = {}
function _m.recurse(parent)
local close = true
for _, node in ipairs(parent.entries) do
if node.open and #node.entries > 0 then
_m.recurse(node)
end
if buf_map[node.absolute_path] then
close = false
break
end
end
if close and parent ~= lib.Tree then
if not use_whitelist or whitelist_map[parent.name] then
lib.close_node(parent)
did_close = true
end
return true
end
return false
end
_m.recurse(lib.Tree)
if did_close then
nt.find_file(false)
end
end)
end
-- function M.global_bufenter()
-- local buf_path = vim.fn.expand('%')
-- if vim.fn.isdirectory(buf_path) == 1 then
-- vim.cmd("cd " .. buf_path)
-- vim.cmd("NvimTreeOpen")
-- M.refresh_needed = true
-- end
-- end
events.on_nvim_tree_ready(function ()
if M.refresh_needed then
vim.cmd("NvimTreeRefresh")
M.refresh_needed = false
end
vim.g.nvim_tree_ready = 1
end)
vim.api.nvim_exec([[
hi! link NvimTreeGitNew diffAdded
hi! link NvimTreeGitDeleted diffRemoved
" hi! link NvimTreeGitDirty GitDirty
hi! link NvimTreeGitStaged diffAdded
" hi! link NvimTreeFolderIcon NvimTreeFolderName
]], false)
vim.api.nvim_exec([[
augroup Config.nvim_tree
au!
au FileType NvimTree lua Config.nvim_tree.custom_setup()
" au BufEnter * lua Config.nvim_tree.global_bufenter()
au BufDelete * lua Config.nvim_tree.close_folders_without_open_buffers(true)
au BufWritePost * lua require'nvim-tree.lib'.refresh_tree(true)
augroup END
]], false)
_G.Config.nvim_tree = M
end
|
object_tangible_furniture_all_frn_all_chair_wooden_s1 = object_tangible_furniture_all_shared_frn_all_chair_wooden_s1:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_all_frn_all_chair_wooden_s1, "object/tangible/furniture/all/frn_all_chair_wooden_s1.iff")
|
local installer = require "nvim-lsp-installer.core.installer"
local _ = require "nvim-lsp-installer.core.functional"
local process = require "nvim-lsp-installer.core.process"
local path = require "nvim-lsp-installer.core.path"
local Result = require "nvim-lsp-installer.core.result"
local spawn = require "nvim-lsp-installer.core.spawn"
local Optional = require "nvim-lsp-installer.core.optional"
local M = {}
---@param package string
local function with_receipt(package)
return function()
local ctx = installer.context()
ctx.receipt:with_primary_source(ctx.receipt.luarocks(package))
end
end
---@param package string @The luarock package to install.
---@param opts {dev: boolean}|nil
function M.package(package, opts)
return function()
return M.install(package, opts).with_receipt()
end
end
---@async
---@param package string @The luarock package to install.
---@param opts {dev: boolean}|nil
function M.install(package, opts)
opts = opts or {}
local ctx = installer.context()
ctx:promote_cwd()
ctx.spawn.luarocks {
"install",
"--tree",
ctx.cwd:get(),
opts.dev and "--dev" or vim.NIL,
package,
ctx.requested_version:or_else(vim.NIL),
}
return {
with_receipt = with_receipt(package),
}
end
---@alias InstalledLuarock {package: string, version: string, arch: string, nrepo: string, namespace: string}
---@type fun(output: string): InstalledLuarock[]
M.parse_installed_rocks = _.compose(
_.map(_.compose(
-- https://github.com/luarocks/luarocks/blob/fbd3566a312e647cde57b5d774533731e1aa844d/src/luarocks/search.lua#L317
_.zip_table { "package", "version", "arch", "nrepo", "namespace" },
_.split "\t"
)),
_.split "\n"
)
---@async
---@param receipt InstallReceipt
---@param install_dir string
function M.get_installed_primary_package_version(receipt, install_dir)
if receipt.primary_source.type ~= "luarocks" then
return Result.failure "Receipt does not have a primary source of type luarocks"
end
local primary_package = receipt.primary_source.package
return spawn.luarocks({
"list",
"--tree",
install_dir,
"--porcelain",
}):map_catching(function(result)
local luarocks = M.parse_installed_rocks(result.stdout)
return Optional.of_nilable(_.find_first(_.prop_eq("package", primary_package), luarocks))
:map(_.prop "version")
:or_else_throw()
end)
end
---@alias OutdatedLuarock {name: string, installed: string, available: string, repo: string}
---@type fun(output: string): OutdatedLuarock[]
M.parse_outdated_rocks = _.compose(
_.map(_.compose(
-- https://github.com/luarocks/luarocks/blob/fbd3566a312e647cde57b5d774533731e1aa844d/src/luarocks/cmd/list.lua#L59
_.zip_table { "name", "installed", "available", "repo" },
_.split "\t"
)),
_.split "\n"
)
---@async
---@param receipt InstallReceipt
---@param install_dir string
function M.check_outdated_primary_package(receipt, install_dir)
if receipt.primary_source.type ~= "luarocks" then
return Result.failure "Receipt does not have a primary source of type luarocks"
end
local primary_package = receipt.primary_source.package
return spawn.luarocks({
"list",
"--outdated",
"--tree",
install_dir,
"--porcelain",
}):map_catching(function(result)
local outdated_rocks = M.parse_outdated_rocks(result.stdout)
return Optional.of_nilable(_.find_first(_.prop_eq("name", primary_package), outdated_rocks))
:map(
---@param outdated_rock OutdatedLuarock
function(outdated_rock)
return {
name = outdated_rock.name,
current_version = assert(outdated_rock.installed),
latest_version = assert(outdated_rock.available),
}
end
)
:or_else_throw()
end)
end
---@param install_dir string
function M.env(install_dir)
return {
PATH = process.extend_path { path.concat { install_dir, "bin" } },
}
end
return M
|
-----------------------------------
-- Ability: Spectral jig
-- Allows you to evade enemies by making you undetectable by sight and sound.
-- Obtained: Dancer Level 25
-- TP Required: 0
-- Recast Time: 30 seconds
-- Duration: 3 minutes
-----------------------------------
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/utils")
require("scripts/globals/msg")
-----------------------------------
function onAbilityCheck(player, target, ability)
return 0, 0
end
function onUseAbility(player, target, ability)
local baseDuration = 180
local durationMultiplier = 1.0 + utils.clamp(player:getMod(tpz.mod.JIG_DURATION), 0, 50) / 100
local finalDuration = math.floor(baseDuration * durationMultiplier * SNEAK_INVIS_DURATION_MULTIPLIER)
if (player:hasStatusEffect(tpz.effect.SNEAK) == false) then
player:addStatusEffect(tpz.effect.SNEAK, 0, 10, finalDuration)
player:addStatusEffect(tpz.effect.INVISIBLE, 0, 10, finalDuration)
ability:setMsg(tpz.msg.basic.SPECTRAL_JIG) -- Gains the effect of sneak and invisible
else
ability:setMsg(tpz.msg.basic.NO_EFFECT) -- no effect on player.
end
return 1
end
|
local awful = require "awful"
local beautiful = require "beautiful"
local wibox = require "wibox"
local vars = require "config.vars"
local widgets = require "widgets"
screen.connect_signal("request::desktop_decoration", function(s)
-- awful.tag(vars.tags, s, awful.layout.layouts[1])
for i = 1, 9, 1 do
awful.tag.add(i, {
icon = os.getenv "HOME" .. "/.config/awesome/theme/icons/taglist/" .. i .. ".svg",
icon_only = true,
layout = awful.layout.suit.tile,
screen = s,
selected = i == 1,
})
end
-- s.promptbox = widgets.create_promptbox()
s.layoutbox = widgets.create_layoutbox(s)
s.systray = wibox.widget.systray()
s.systray.visible = false
s.taglist = widgets.create_taglist(s)
s.tasklist = widgets.create_tasklist(s)
s.wibox = widgets.create_wibox(s)
end)
|
data:extend({
{
type = "custom-input",
name = "aq_quickbar_swap",
key_sequence = "X",
},
{
type = "custom-input",
name = "aq_quickbar_rotate",
key_sequence = "SHIFT + X",
}
})
|
local ObjectManager = require("managers.object.object_manager")
local QuestManager = require("managers.quest.quest_manager")
FsCrafting4 = {
waypoints = {
keren = { 1215, 2740, "naboo" },
coronet = { 19, -4775, "corellia" },
mosentha = { 1209, 2923, "tatooine" }
},
NOWIRE = 0,
REDWIRE = 1,
BLUEWIRE = 2,
YELLOWWIRE = 3
}
function FsCrafting4:activateQuest(pPlayer)
if (VillageJediManagerCommon.hasActiveQuestThisPhase(pPlayer)) then
return
end
local lastCompleted = self:getLastCompletedQuest(pPlayer)
if (lastCompleted > -1) then
local nextQuest = lastCompleted + 1
local questName = "fs_crafting4_quest_0" .. nextQuest
local questID = getPlayerQuestID(questName)
QuestManager.activateQuest(pPlayer, questID)
else
QuestManager.activateQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_00)
QuestManager.activateQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_01)
end
VillageJediManagerCommon.setActiveQuestThisPhase(pPlayer, VILLAGE_PHASE4_ENGINEER)
end
function FsCrafting4:sendTooLateSui(pPlayer)
if (readScreenPlayData(pPlayer, "VillageJediProgression", "FsCrafting4TooLateBox") == "1") then
return
end
local sui = SuiMessageBox.new("FsCrafting4", "noCallback")
sui.setTitle("@quest/force_sensitive/fs_crafting:crafting4_phase_change_title")
sui.setPrompt("@quest/force_sensitive/fs_crafting:crafting4_phase_over")
sui.hideCancelButton()
sui.sendTo(pPlayer)
writeScreenPlayData(pPlayer, "VillageJediProgression", "FsCrafting4TooLateBox", 1)
end
function FsCrafting4:removeCore(pPlayer)
local pInventory = CreatureObject(pPlayer):getSlottedObject("inventory")
if (pInventory == nil) then
return
end
local pCore = getContainerObjectByTemplate(pInventory, "object/tangible/item/quest/force_sensitive/fs_crafting4_computer_core.iff", true)
if (pCore ~= nil) then
SceneObject(pCore):destroyObjectFromWorld()
SceneObject(pCore):destroyObjectFromDatabase()
end
deleteScreenPlayData(pPlayer, "VillageJediProgression", "FsCrafting4TooLateBox")
end
function FsCrafting4:getActiveQuestNum(pPlayer)
for i = 7, 1, -1 do
local questName = "fs_crafting4_quest_0" .. i
local questID = getPlayerQuestID(questName)
if QuestManager.hasActiveQuest(pPlayer, questID) and not QuestManager.hasCompletedQuest(pPlayer, questID) then
return i
end
end
return -1
end
function FsCrafting4:getLastCompletedQuest(pPlayer)
for i = 7, 1, -1 do
local questName = "fs_crafting4_quest_0" .. i
local questID = getPlayerQuestID(questName)
if QuestManager.hasCompletedQuest(pPlayer, questID) then
return i
end
end
return -1
end
function FsCrafting4:notifyTrackingKitDestroyed(pItem)
if (pItem == nil) then
return 1
end
local ownerID = TangibleObject(pItem):getLuaStringData("ownerID")
local pOwner = getSceneObject(ownerID)
if (pOwner == nil) then
return 1
end
local pInventory = CreatureObject(pOwner):getSlottedObject("inventory")
if (pInventory == nil) then
return 1
end
local pTracker = getContainerObjectByTemplate(pInventory, "object/tangible/loot/collectible/collectible_rewards/fs_tracking_device.iff", true)
if (pTracker ~= nil) then
QuestManager.completeQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_02)
QuestManager.activateQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_03)
TangibleObject(pTracker):setLuaStringData("ownerID", ownerID)
TangibleObject(pTracker):setLuaStringData("needsTrackingData", "true")
createObserver(OBJECTREMOVEDFROMZONE, "FsCrafting4", "notifyTrackingDeviceDestroyed", pTracker, 1)
else
QuestManager.resetQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_02)
QuestManager.uncompleteQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_01)
if (VillageJediManagerTownship:getCurrentPhase() ~= 4) then
CreatureObject(pOwner):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_kit_destroyed_over")
else
CreatureObject(pOwner):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_kit_destroyed")
end
end
return 1
end
function FsCrafting4:notifyTrackingDeviceDestroyed(pItem)
if (pItem == nil) then
return 1
end
local ownerID = TangibleObject(pItem):getLuaStringData("ownerID")
local pOwner = getSceneObject(ownerID)
if (pOwner == nil) then
return 1
end
if (QuestManager.hasCompletedQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_06)) then
return 1
end
if (VillageJediManagerTownship:getCurrentPhase() ~= 4) then
CreatureObject(pOwner):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_tracking_device_destroyed_over")
else
CreatureObject(pOwner):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_tracking_device_destroyed")
end
QuestManager.resetQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_06)
QuestManager.resetQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_05)
QuestManager.resetQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_04)
QuestManager.resetQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_03)
QuestManager.resetQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_02)
QuestManager.uncompleteQuest(pOwner, QuestManager.quests.FS_CRAFTING4_QUEST_01)
return 1
end
function FsCrafting4:obtainSatelliteData(pPlayer, pDroid)
if (pPlayer == nil) then
return
end
local sui = SuiMessageBox.new("FsCrafting4", "obtainDataCallback")
if (pDroid == nil) then
sui.setTargetNetworkId(0)
else
sui.setTargetNetworkId(SceneObject(pDroid):getObjectID())
end
sui.setProperty("", "Size", "500,250")
sui.setTitle("@quest/force_sensitive/fs_crafting:tracking_data_title")
sui.setPrompt("@quest/force_sensitive/fs_crafting:tracking_data_msg")
sui.sendTo(pPlayer)
end
function FsCrafting4:noCallback(pPlayer, pSui, eventIndex, args)
end
function FsCrafting4:obtainDataCallback(pPlayer, pSui, eventIndex, args)
local cancelPressed = (eventIndex == 1)
if (cancelPressed) then
return
end
if (not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_03)) then
return
end
if (CreatureObject(pPlayer):getCashCredits() < 1100) then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:tracking_data_no_money")
return
end
CreatureObject(pPlayer):subtractCashCredits(1100)
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:tracking_data_purchase_msg_01")
createEvent(getRandomNumber(1000, 4000), "FsCrafting4", "doObtainCallbackMessage2", pPlayer, "")
end
function FsCrafting4:doObtainCallbackMessage2(pPlayer)
if (pPlayer == nil) then
return
end
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:tracking_data_purchase_msg_02")
createEvent(getRandomNumber(1000, 2000), "FsCrafting4", "doObtainCallbackMessage3", pPlayer, "")
end
function FsCrafting4:doObtainCallbackMessage3(pPlayer)
if (pPlayer == nil) then
return
end
local pInventory = CreatureObject(pPlayer):getSlottedObject("inventory")
if (pInventory == nil) then
return
end
local pTracker = getContainerObjectByTemplate(pInventory, "object/tangible/loot/collectible/collectible_rewards/fs_tracking_device.iff", true)
if (pTracker == nil) then
return
end
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:tracking_data_purchase_msg_03")
TangibleObject(pTracker):setLuaStringData("needsTrackingData", "false")
QuestManager.completeQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_03)
QuestManager.activateQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04)
end
function FsCrafting4:getAlternatePlanet(pPlayer)
local planetList = { "corellia", "dantooine", "dathomir", "endor", "lok", "naboo", "rori", "talus", "tatooine", "yavin4" }
local curPlanet = SceneObject(pPlayer):getZoneName()
local newPlanet = planetList[getRandomNumber(1, #planetList)]
if (newPlanet == curPlanet) then
newPlanet = FsCrafting4:getAlternatePlanet(pPlayer)
end
return newPlanet
end
function FsCrafting4:setupComputerCore(pCore, pPlayer)
TangibleObject(pCore):setLuaStringData("ownerID", SceneObject(pPlayer):getObjectID())
TangibleObject(pCore):setLuaStringData("puzzleGuess1", self.NOWIRE)
TangibleObject(pCore):setLuaStringData("puzzleGuess2", self.NOWIRE)
TangibleObject(pCore):setLuaStringData("puzzleGuess3", self.NOWIRE)
TangibleObject(pCore):setLuaStringData("puzzleGuess4", self.NOWIRE)
for i = 1, 4, 1 do
TangibleObject(pCore):setLuaStringData("puzzleSolution" .. i, getRandomNumber(1,3))
end
TangibleObject(pCore):setLuaStringData("puzzleIntegrity", getRandomNumber(93, 99))
end
FsCrafting4TrackingDeviceMenuComponent = {}
function FsCrafting4TrackingDeviceMenuComponent:fillObjectMenuResponse(pSceneObject, pMenuResponse, pPlayer)
if (pSceneObject == nil or pPlayer == nil) then
return
end
local ownerID = TangibleObject(pSceneObject):getLuaStringData("ownerID")
local pOwner = getSceneObject(ownerID)
if (pOwner == nil or pOwner ~= pPlayer) then
return
end
if (CreatureObject(pPlayer):isDead() or CreatureObject(pPlayer):isIncapacitated()) then
return
end
local menuResponse = LuaObjectMenuResponse(pMenuResponse)
menuResponse:addRadialMenuItem(20, 3, "@quest/force_sensitive/fs_crafting:tracking_device_menu_use")
end
function FsCrafting4TrackingDeviceMenuComponent:handleObjectMenuSelect(pSceneObject, pPlayer, selectedID)
if (pSceneObject == nil or pPlayer == nil) then
return 0
end
if (CreatureObject(pPlayer):isDead() or CreatureObject(pPlayer):isIncapacitated()) then
return 0
end
local ownerID = TangibleObject(pSceneObject):getLuaStringData("ownerID")
local pOwner = getSceneObject(ownerID)
if (pOwner == nil or pOwner ~= pPlayer) then
return 0
end
if (selectedID ~= 20) then
return 0
end
if (not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_03) and not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04)) then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:tracking_device_not_on_quest")
return 0
end
local needsTrackingData = TangibleObject(pSceneObject):getLuaStringData("needsTrackingData")
if (needsTrackingData == "true") then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:tracking_device_needs_data")
return 0
end
local trackingPlanet = TangibleObject(pSceneObject):getLuaStringData("trackingPlanet")
if (trackingPlanet == "") then
trackingPlanet = FsCrafting4:getAlternatePlanet(pPlayer)
TangibleObject(pSceneObject):setLuaStringData("trackingPlanet", trackingPlanet)
local messageString = LuaStringIdChatParameter("@quest/force_sensitive/fs_crafting:tracking_device_wrong_planet")
messageString:setTO(HelperFuncs:toTitleCase(trackingPlanet))
CreatureObject(pPlayer):sendSystemMessage(messageString:_getObject())
elseif (trackingPlanet ~= SceneObject(pPlayer):getZoneName()) then
local messageString = LuaStringIdChatParameter("@quest/force_sensitive/fs_crafting:tracking_device_wrong_planet")
messageString:setTO(HelperFuncs:toTitleCase(trackingPlanet))
CreatureObject(pPlayer):sendSystemMessage(messageString:_getObject())
elseif (FsCrafting4Goto:hasTaskStarted(pPlayer) or FsCrafting4Theater:hasTaskStarted(pPlayer)) then
FsCrafting4Goto:finish(pPlayer)
FsCrafting4Theater:finish(pPlayer)
FsCrafting4Goto:start(pPlayer)
else
FsCrafting4Goto:start(pPlayer)
end
return 0
end
FsCrafting4SatelliteMenuComponent = {}
function FsCrafting4SatelliteMenuComponent:fillObjectMenuResponse(pSceneObject, pMenuResponse, pPlayer)
if (pSceneObject == nil or pPlayer == nil) then
return
end
if (CreatureObject(pPlayer):isDead() or CreatureObject(pPlayer):isIncapacitated()) then
return
end
if (not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04)) then
return
end
local menuResponse = LuaObjectMenuResponse(pMenuResponse)
menuResponse:addRadialMenuItem(20, 3, "@quest/force_sensitive/fs_crafting:crafting4_menu_retrieve_core")
end
function FsCrafting4SatelliteMenuComponent:handleObjectMenuSelect(pSceneObject, pPlayer, selectedID)
if (pSceneObject == nil or pPlayer == nil) then
return 0
end
if (CreatureObject(pPlayer):isDead() or CreatureObject(pPlayer):isIncapacitated()) then
return 0
end
if (not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04) or QuestManager.hasCompletedQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04)) then
return 0
end
local pInventory = CreatureObject(pPlayer):getSlottedObject("inventory")
if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:inventory_full")
return 0
end
local pCore = getContainerObjectByTemplate(pInventory, "object/tangible/item/quest/force_sensitive/fs_crafting4_computer_core.iff", true)
if (pCore == nil) then
local pItem = giveItem(pInventory, "object/tangible/item/quest/force_sensitive/fs_crafting4_computer_core.iff", -1)
if (pItem ~= nil) then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_menu_core_received")
FsCrafting4Theater:finish(pPlayer)
FsCrafting4:setupComputerCore(pItem, pPlayer)
QuestManager.completeQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04)
QuestManager.activateQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05)
end
end
local pTracker = getContainerObjectByTemplate(pInventory, "object/tangible/loot/collectible/collectible_rewards/fs_tracking_device.iff", true)
if (pTracker ~= nil) then
TangibleObject(pTracker):setLuaStringData("needsTrackingData", "true")
end
return 0
end
FsCrafting4ComputerCoreMenuComponent = {}
function FsCrafting4ComputerCoreMenuComponent:fillObjectMenuResponse(pSceneObject, pMenuResponse, pPlayer)
if (pSceneObject == nil or pPlayer == nil) then
return
end
local ownerID = TangibleObject(pSceneObject):getLuaStringData("ownerID")
local pOwner = getSceneObject(ownerID)
if (pOwner == nil or pOwner ~= pPlayer) then
return
end
if (CreatureObject(pPlayer):isDead() or CreatureObject(pPlayer):isIncapacitated()) then
return
end
if (not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05) or QuestManager.hasCompletedQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05)) then
return
end
local menuResponse = LuaObjectMenuResponse(pMenuResponse)
menuResponse:addRadialMenuItem(68, 3, "@quest/force_sensitive/fs_crafting:crafting4_core_menu_configure")
menuResponse:addRadialMenuItemToRadialID(68, 69, 3, self:getConnectionMenuName(pSceneObject, 1))
menuResponse:addRadialMenuItemToRadialID(68, 70, 3, self:getConnectionMenuName(pSceneObject, 2))
menuResponse:addRadialMenuItemToRadialID(68, 71, 3, self:getConnectionMenuName(pSceneObject, 3))
menuResponse:addRadialMenuItemToRadialID(68, 72, 3, self:getConnectionMenuName(pSceneObject, 4))
menuResponse:addRadialMenuItemToRadialID(68, 73, 3, "@quest/force_sensitive/fs_crafting:crafting4_core_menu_test")
menuResponse:addRadialMenuItem(74, 3, "@quest/force_sensitive/fs_crafting:crafting4_core_menu_status")
end
function FsCrafting4ComputerCoreMenuComponent:handleObjectMenuSelect(pSceneObject, pPlayer, selectedID)
if (pSceneObject == nil or pPlayer == nil) then
return 0
end
if (CreatureObject(pPlayer):isDead() or CreatureObject(pPlayer):isIncapacitated()) then
return 0
end
local pInventory = CreatureObject(pPlayer):getSlottedObject("inventory")
if (pInventory == nil or SceneObject(pSceneObject):getParentID() ~= SceneObject(pInventory):getObjectID()) then
return 0
end
if (not QuestManager.hasActiveQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05) or QuestManager.hasCompletedQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05)) then
return 0
end
if (selectedID == 68) then
local sui = SuiMessageBox.new("FsCrafting4", "noCallback")
sui.setProperty("", "Size", "500,250")
sui.setTitle("@quest/force_sensitive/fs_crafting:crafting4_core_menu_configure")
sui.setPrompt("@quest/force_sensitive/fs_crafting:crafting4_core_config_help")
sui.hideCancelButton()
sui.sendTo(pPlayer)
elseif (selectedID == 69) then
self:setConnection(pSceneObject, pPlayer, 1)
elseif (selectedID == 70) then
self:setConnection(pSceneObject, pPlayer, 2)
elseif (selectedID == 71) then
self:setConnection(pSceneObject, pPlayer, 3)
elseif (selectedID == 72) then
self:setConnection(pSceneObject, pPlayer, 4)
elseif (selectedID == 73) then
self:attemptConfigure(pSceneObject, pPlayer)
elseif (selectedID == 74) then
self:sendCurrentStatus(pSceneObject, pPlayer)
end
return 0
end
function FsCrafting4ComputerCoreMenuComponent:attemptConfigure(pCore, pPlayer)
if (pCore == nil or pPlayer == nil) then
return
end
local puzzleGuess1 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleGuess1"))
local puzzleGuess2 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleGuess2"))
local puzzleGuess3 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleGuess3"))
local puzzleGuess4 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleGuess4"))
local puzzleGuesses = { puzzleGuess1, puzzleGuess2, puzzleGuess3, puzzleGuess4 }
local puzzleSolution1 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleSolution1"))
local puzzleSolution2 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleSolution2"))
local puzzleSolution3 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleSolution3"))
local puzzleSolution4 = tonumber(TangibleObject(pCore):getLuaStringData("puzzleSolution4"))
local puzzleSolutions = { puzzleSolution1, puzzleSolution2, puzzleSolution3, puzzleSolution4 }
local puzzleResults = { false, false, false, false }
local correctlyConnected = 0
for i = 1, 4, 1 do
if (puzzleGuesses[i] == puzzleSolutions[i]) then
puzzleResults[i] = true
correctlyConnected = correctlyConnected + 1
end
end
if (correctlyConnected == 4) then
QuestManager.completeQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05)
QuestManager.activateQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_06)
if (VillageJediManagerTownship:getCurrentPhase() == 4) then
local sui = SuiMessageBox.new("FsCrafting4", "noCallback")
sui.setProperty("", "Size", "500,250")
sui.setTitle("@quest/force_sensitive/fs_crafting:crafting4_core_menu_status")
sui.setPrompt("@quest/force_sensitive/fs_crafting:crafting4_core_completed")
sui.hideCancelButton()
sui.sendTo(pPlayer)
else
FsCrafting4:sendTooLateSui(pPlayer)
end
TangibleObject(pCore):setLuaStringData("correctlyConfigured", "true")
else
local correctWiresUsed = 0
local tempResults = puzzleResults
for i = 1, 4, 1 do
local alreadySolved = puzzleResults[i]
if (not alreadySolved) then
local curGuess = puzzleGuesses[i]
local doBreak = false
for j = 1, 4, 1 do
if (not doBreak) then
local alreadyUsed = tempResults[j]
if (not alreadyUsed) then
local correctWire = puzzleSolutions[j]
if (curGuess == correctWire) then
correctWiresUsed = correctWiresUsed + 1
tempResults[j] = true
doBreak = true
end
end
end
end
end
end
TangibleObject(pCore):setLuaStringData("lastGuess1", puzzleGuess1)
TangibleObject(pCore):setLuaStringData("lastGuess2", puzzleGuess2)
TangibleObject(pCore):setLuaStringData("lastGuess3", puzzleGuess3)
TangibleObject(pCore):setLuaStringData("lastGuess4", puzzleGuess4)
TangibleObject(pCore):setLuaStringData("lastCorrectWiresConnected", correctlyConnected)
TangibleObject(pCore):setLuaStringData("lastCorrectWiresUsed", correctWiresUsed)
local integrity = tonumber(TangibleObject(pCore):getLuaStringData("puzzleIntegrity"))
integrity = integrity - getRandomNumber(13,17)
TangibleObject(pCore):setLuaStringData("puzzleIntegrity", integrity)
if (integrity <= 0) then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_core_ruined")
QuestManager.resetQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_03)
QuestManager.resetQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_04)
QuestManager.resetQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_05)
QuestManager.activateQuest(pPlayer, QuestManager.quests.FS_CRAFTING4_QUEST_03)
SceneObject(pCore):destroyObjectFromWorld()
SceneObject(pCore):destroyObjectFromDatabase()
else
local resultString = "@quest/force_sensitive/fs_crafting:crafting4_core_current_result"
local litString = "@quest/force_sensitive/fs_crafting:crafting4_core_indicators_lit"
local flickerString = "@quest/force_sensitive/fs_crafting:crafting4_core_flickering"
local integrityString = "@quest/force_sensitive/fs_crafting:crafting4_core_integrity"
local msgPrompt = resultString .. " \\#pcontrast1 " .. litString .. " \\#pcontrast2 " .. correctlyConnected
msgPrompt = msgPrompt .. " \\#. \\#pcontrast1 " .. flickerString .. " \\#pcontrast2 " .. correctWiresUsed
msgPrompt = msgPrompt .. " \\#. \\#pcontrast1 " .. integrityString .. " \\#pcontrast2 " .. integrity .. "% \\#. "
local sui = SuiMessageBox.new("FsCrafting4", "noCallback")
sui.setProperty("", "Size", "500,250")
sui.setTitle("@quest/force_sensitive/fs_crafting:crafting4_core_menu_status")
sui.setPrompt(msgPrompt)
sui.hideCancelButton()
sui.sendTo(pPlayer)
end
end
end
function FsCrafting4ComputerCoreMenuComponent:sendCurrentStatus(pCore, pPlayer)
if (pCore == nil or pPlayer == nil) then
return
end
local msgPrompt
if (self:isConfigured(pCore)) then
msgPrompt = "@quest/force_sensitive/fs_crafting:crafting4_core_completed_status"
else
local wire1String = self:getConnectionMenuName(pCore, 1)
local wire2String = self:getConnectionMenuName(pCore, 2)
local wire3String = self:getConnectionMenuName(pCore, 3)
local wire4String = self:getConnectionMenuName(pCore, 4)
local status01 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_01"
local status02 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_02"
local status03 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_03"
local status04 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_04"
local status05 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_05"
msgPrompt = status01 .. " \\#pcontrast1 " .. status02 .. " \\#pcontrast2 " .. wire1String .. " \\#. \\#pcontrast1 " .. status03 .. " \\#pcontrast2 " .. wire2String
msgPrompt = msgPrompt .. " \\#. \\#pcontrast1 " .. status04 .. " \\#pcontrast2 " .. wire3String .. " \\#. \\#pcontrast1 " .. status05 .. " \\#pcontrast2 " .. wire4String
local lastGuess1 = tonumber(TangibleObject(pCore):getLuaStringData("lastGuess1"))
local lastGuess2 = tonumber(TangibleObject(pCore):getLuaStringData("lastGuess2"))
local lastGuess3 = tonumber(TangibleObject(pCore):getLuaStringData("lastGuess3"))
local lastGuess4 = tonumber(TangibleObject(pCore):getLuaStringData("lastGuess4"))
local lastCorrectConnected = tonumber(TangibleObject(pCore):getLuaStringData("lastCorrectWiresConnected"))
local lastCorrectUsed = tonumber(TangibleObject(pCore):getLuaStringData("lastCorrectWiresUsed"))
local integrity = tonumber(TangibleObject(pCore):getLuaStringData("puzzleIntegrity"))
if (lastGuess1 ~= nil and lastGuess2 ~= nil and lastGuess3 ~= nil and lastGuess4 ~= nil) then
local status06 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_06"
local status07 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_07"
local status08 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_08"
local status09 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_09"
local status10 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_10"
local status11 = "@quest/force_sensitive/fs_crafting:crafting4_core_current_status_11"
local resultString = "@quest/force_sensitive/fs_crafting:crafting4_core_current_result"
local litString = "@quest/force_sensitive/fs_crafting:crafting4_core_indicators_lit"
local flickerString = "@quest/force_sensitive/fs_crafting:crafting4_core_flickering"
local integrityString = "@quest/force_sensitive/fs_crafting:crafting4_core_integrity"
local last1String = self:getConnectionMenuName(pCore, 1, true)
local last2String = self:getConnectionMenuName(pCore, 2, true)
local last3String = self:getConnectionMenuName(pCore, 3, true)
local last4String = self:getConnectionMenuName(pCore, 4, true)
msgPrompt = msgPrompt .. " \\#. " .. status06 .. " \\#pcontrast1 " .. status07 .. " \\#pcontrast2 " .. last1String .. " \\#. \\#pcontrast1 " .. status08 .. " \\#pcontrast2 " .. last2String
msgPrompt = msgPrompt .. " \\#. \\#pcontrast1 " .. status09 .. " \\#pcontrast2 " .. last3String .. " \\#. \\#pcontrast1 " .. status10 .. " \\#pcontrast2 " .. last4String
msgPrompt = msgPrompt .. " \\#. " .. status11 .. " " .. resultString .. " \\#pcontrast1 " .. litString .. " \\#pcontrast2 " .. lastCorrectConnected
msgPrompt = msgPrompt .. " \\#. \\#pcontrast1 " .. flickerString .. " \\#pcontrast2 " .. lastCorrectUsed .. " \\#. \\#pcontrast1 " .. integrityString .. " \\#pcontrast2 " .. integrity .. "% \\#. "
else
msgPrompt = msgPrompt .. " \\#. " .. "@quest/force_sensitive/fs_crafting:crafting4_core_current_no_testing"
end
end
local sui = SuiMessageBox.new("FsCrafting4", "noCallback")
sui.setProperty("", "Size", "500,250")
sui.setTitle("@quest/force_sensitive/fs_crafting:crafting4_core_menu_status")
sui.setPrompt(msgPrompt)
sui.hideCancelButton()
sui.sendTo(pPlayer)
end
function FsCrafting4ComputerCoreMenuComponent:isConfigured(pCore)
return TangibleObject(pCore):getLuaStringData("correctlyConfigured") == "true"
end
function FsCrafting4ComputerCoreMenuComponent:setConnection(pCore, pPlayer, connectionNum)
if (pCore == nil or pPlayer == nil) then
return
end
local pGhost = CreatureObject(pPlayer):getPlayerObject()
if (pGhost == nil) then
return
end
local coreID = SceneObject(pCore):getObjectID()
local pageId = readData(coreID .. ":pageID")
if (pageId ~= 0) then
PlayerObject(pGhost):removeSuiBox(pageId)
deleteData(coreID .. ":pageID")
end
local sui = SuiListBox.new("FsCrafting4", "setConnectionCallback")
sui.setTargetNetworkId(coreID)
sui.setTitle("@quest/force_sensitive/fs_crafting:crafting4_core_msgbox_title")
local connPrompt
if (connectionNum == 1) then
connPrompt = "@quest/force_sensitive/fs_crafting:crafting4_core_set_connection_one"
elseif (connectionNum == 2) then
connPrompt = "@quest/force_sensitive/fs_crafting:crafting4_core_set_connection_two"
elseif (connectionNum == 3) then
connPrompt = "@quest/force_sensitive/fs_crafting:crafting4_core_set_connection_three"
elseif (connectionNum == 4) then
connPrompt = "@quest/force_sensitive/fs_crafting:crafting4_core_set_connection_four"
end
sui.setPrompt(connPrompt .. " " .. self:getWireSetting(pCore, connectionNum))
sui.add("No Wire", "")
sui.add("Red Wire", "")
sui.add("Blue Wire", "")
sui.add("Yellow Wire", "")
pageId = sui.sendTo(pPlayer)
writeData(coreID .. ":pageID", pageId)
writeData(coreID .. ":connectionNum", connectionNum)
end
function FsCrafting4:setConnectionCallback(pPlayer, pSui, eventIndex, args)
local pPageData = LuaSuiBoxPage(pSui):getSuiPageData()
if (pPageData == nil) then
printLuaError("FsCrafting4:setConnectionCallback, pageData is nil.")
return
end
local suiPageData = LuaSuiPageData(pPageData)
local coreID = suiPageData:getTargetNetworkId()
local pCore = getSceneObject(coreID)
if (pCore == nil) then
return
end
deleteData(coreID .. ":pageID")
local connectionNum = readData(coreID .. ":connectionNum")
deleteData(coreID .. ":connectionNum")
local cancelPressed = (eventIndex == 1)
if (cancelPressed or tonumber(args) < 0) then
CreatureObject(pPlayer):sendSystemMessage("@quest/force_sensitive/fs_crafting:crafting4_core_no_selection_made")
return
end
local chosenWire = tonumber(args)
local wireString
if (chosenWire == FsCrafting4.NOWIRE) then wireString = "@quest/force_sensitive/fs_crafting:crafting4_core_nothing"
elseif (chosenWire == FsCrafting4.REDWIRE) then wireString = "@quest/force_sensitive/fs_crafting:crafting4_core_a_red_wire"
elseif (chosenWire == FsCrafting4.BLUEWIRE) then wireString = "@quest/force_sensitive/fs_crafting:crafting4_core_a_blue_wire"
elseif (chosenWire == FsCrafting4.YELLOWWIRE) then wireString = "@quest/force_sensitive/fs_crafting:crafting4_core_a_yellow_wire"
else wireString = "@quest/force_sensitive/fs_crafting:crafting4_core_error" end
local connectionString
if (connectionNum == 1) then connectionString = "@quest/force_sensitive/fs_crafting:crafting4_core_connection_one_set"
elseif (connectionNum == 2) then connectionString = "@quest/force_sensitive/fs_crafting:crafting4_core_connection_two_set"
elseif (connectionNum == 3) then connectionString = "@quest/force_sensitive/fs_crafting:crafting4_core_connection_three_set"
elseif (connectionNum == 4) then connectionString = "@quest/force_sensitive/fs_crafting:crafting4_core_connection_four_set"
else connectionString = "@quest/force_sensitive/fs_crafting:crafting4_core_error" end
TangibleObject(pCore):setLuaStringData("puzzleGuess" .. connectionNum, chosenWire)
local messageString = LuaStringIdChatParameter(connectionString)
messageString:setTO(wireString)
CreatureObject(pPlayer):sendSystemMessage(messageString:_getObject())
end
function FsCrafting4ComputerCoreMenuComponent:getWireSetting(pCore, connectionNum)
local curGuess = tonumber(TangibleObject(pCore):getLuaStringData("puzzleGuess" .. connectionNum))
local wireString
if (curGuess == FsCrafting4.NOWIRE) then return "@quest/force_sensitive/fs_crafting:crafting4_core_nothing"
elseif (curGuess == FsCrafting4.REDWIRE) then return "@quest/force_sensitive/fs_crafting:crafting4_core_a_red_wire"
elseif (curGuess == FsCrafting4.BLUEWIRE) then return "@quest/force_sensitive/fs_crafting:crafting4_core_a_blue_wire"
elseif (curGuess == FsCrafting4.YELLOWWIRE) then return "@quest/force_sensitive/fs_crafting:crafting4_core_a_yellow_wire" end
return "@quest/force_sensitive/fs_crafting:crafting4_core_error"
end
function FsCrafting4ComputerCoreMenuComponent:getConnectionMenuName(pCore, connectionNum, lastGuess)
local menuName = "@quest/force_sensitive/fs_crafting:crafting4_core_error"
local guessData = tonumber(TangibleObject(pCore):getLuaStringData("puzzleGuess" .. connectionNum))
if (lastGuess) then
guessData = tonumber(TangibleObject(pCore):getLuaStringData("lastGuess" .. connectionNum))
end
local stringNum
if (connectionNum == 1) then stringNum = "one"
elseif (connectionNum == 2) then stringNum = "two"
elseif (connectionNum == 3) then stringNum = "three"
elseif (connectionNum == 4) then stringNum = "four" end
local wireString
if (guessData == FsCrafting4.NOWIRE) then wireString = "nothing"
elseif (guessData == FsCrafting4.REDWIRE) then wireString = "red"
elseif (guessData == FsCrafting4.BLUEWIRE) then wireString = "blue"
elseif (guessData == FsCrafting4.YELLOWWIRE) then wireString = "yellow" end
if (stringNum == "" or wireString == "") then
return menuName
end
return "@quest/force_sensitive/fs_crafting:crafting4_core_menu_" .. stringNum .. "_" .. wireString
end
|
-- Copyright (c) 2019 Redfern, Trevor <trevorredfern@gmail.com>
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
local tables = require "moonpie.tables"
local timer = {}
timer.__index = timer
function timer:new(name, range)
return setmetatable({
total = 0,
count = 0,
max = 0,
min = 0,
range = range or 100,
next = 1,
results = {},
name = name or "unnamed timer"
}, timer)
end
function timer:start()
self.start_time = love.timer.getTime()
end
function timer:stop()
self.stop_time = love.timer.getTime()
self.last = self.stop_time - self.start_time
if self.last > 0 then
-- store result
self.results[self.next] = self.last
self.next = self.next + 1
if self.next > self.range then
self.next = 1
end
self.total = tables.sum(self.results)
self.count = math.min(self.count + 1, self.range)
self.max = tables.max(self.results)
self.min = tables.min(self.results)
end
end
function timer:average()
return self.total / self.count
end
return timer
|
Hooks:PostHook(PlayerTweakData, "init", "PredatorShieldInit", function(self)
-- Thanks luffy <3
--Weapons stances
--Standalone shield Stance
--self.stances.predatorshield.standard.shoulders.translation = Vector3(-4.9, -13.573, -4.567)
--self.stances.predatorshield.crouched.shoulders.translation = Vector3(-4.9, -13.573, -4.567)
--self.stances.predatorshield.steelsight.shoulders.translation = Vector3(-4.9, -13.573, -4.567)
--self.stances.predatorshield_secondary.standard.shoulders.translation = Vector3(-4.9, -13.573, -4.567)
--self.stances.predatorshield_secondary.crouched.shoulders.translation = Vector3(-4.9, -13.573, -4.567)
--self.stances.predatorshield_secondary.steelsight.shoulders.translation = Vector3(-4.9, -13.573, -4.567)
end)
|
ITEM.name = "Plastic"
ITEM.description = "itemPlasticDesc"
ITEM.price = 1
ITEM.model = "models/mosi/fallout4/props/junk/components/plastic.mdl"
|
return {
version = "1.1",
luaversion = "5.1",
tiledversion = "0.18.2",
orientation = "orthogonal",
renderorder = "right-down",
width = 40,
height = 19,
tilewidth = 16,
tileheight = 16,
nextobjectid = 1,
properties = {},
tilesets = {
{
name = "Tiles",
firstgid = 1,
tilewidth = 16,
tileheight = 16,
spacing = 0,
margin = 0,
image = "../img/tiles.png",
imagewidth = 128,
imageheight = 80,
tileoffset = {
x = 0,
y = 0
},
properties = {
["hello"] = 0
},
terrains = {},
tilecount = 40,
tiles = {
{
id = 8,
objectGroup = {
type = "objectgroup",
name = "",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
draworder = "index",
properties = {},
objects = {
{
id = 1,
name = "",
type = "",
shape = "rectangle",
x = 0.25,
y = 0,
width = 15.25,
height = 4.75,
rotation = 0,
visible = true,
properties = {}
}
}
}
}
}
}
},
layers = {
{
type = "tilelayer",
name = "Background",
x = 0,
y = 0,
width = 40,
height = 19,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 19, 17, 19, 17, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 19, 19, 19, 19, 19, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 19, 19, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 17, 19, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
}
},
{
type = "tilelayer",
name = "platforms",
x = 0,
y = 0,
width = 40,
height = 19,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {
["collidable"] = true
},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
26, 26, 27, 26, 26, 26, 26, 27, 27, 26, 26, 27, 26, 27, 26, 27, 27, 26, 26, 27, 26, 27, 27, 26, 27, 27, 26, 26, 27, 27, 26, 27, 26, 27, 26, 27, 27, 27, 26, 26,
34, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 34, 35, 34, 34, 34, 34, 34, 35, 34, 34, 35, 35, 35, 34, 35, 35, 34, 35, 34, 35, 34, 35, 35
}
}
}
}
|
require("keybindings")
require("plugins")
require("theme")
require("basic")
require("lsp.setup")
require('plugin-config.nvim-cmp')
require('plugin-config.nvim-tree')
|
object_tangible_item_quest_force_sensitive_fs_crystal_force = object_tangible_item_quest_force_sensitive_shared_fs_crystal_force:new {
}
ObjectTemplates:addTemplate(object_tangible_item_quest_force_sensitive_fs_crystal_force, "object/tangible/item/quest/force_sensitive/fs_crystal_force.iff")
|
io.write(os.date("%F %T"))
|
local num_online_pin_map = require("qnFiles/qnPlist/hall/num_online_pin");
local roomLevels_pin_map = require("qnFiles/qnPlist/hall/roomLevels_pin");
local hall_game_list_item=
{
name="hall_game_list_item",type=0,typeName="View",time=0,report=0,x=0,y=0,width=296,height=370,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTopLeft,
{
name="bg",type=1,typeName="Image",time=58011102,report=0,x=0,y=0,width=277,height=372,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,file="hall/hall/hall_gameBg.png",
{
name="logo",type=1,typeName="Image",time=72520518,report=0,x=0,y=-10,width=245,height=340,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,file="hall/common/bg_blank.png",
{
name="onlineNumView",type=0,typeName="View",time=88854795,report=0,x=0,y=3,width=245,height=30,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignBottom,
{
name="word",type=1,typeName="Image",time=90408443,report=0,x=0,y=0,width=52,height=23,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignLeft,file=num_online_pin_map['word_online.png']
}
},
{
name="gameStatusView",type=0,typeName="View",time=94649113,x=0,y=3,width=245,height=30,nodeAlign=kAlignBottom,visible=1,fillParentWidth=0,fillParentHeight=0,
{
name="newGamesIcon",type=0,typeName="Image",time=94648694,x=0,y=0,width=95,height=23,nodeAlign=kAlignCenter,visible=0,fillParentWidth=0,fillParentHeight=0,file=roomLevels_pin_map['newGamesIcon.png']
}
},
{
name="moreGamesView",type=0,typeName="View",time=110475801,x=0,y=-38,width=213,height=207,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0
},
{
name="redDot",type=0,typeName="Image",time=111258134,x=0,y=0,width=32,height=32,nodeAlign=kAlignTopRight,visible=0,fillParentWidth=0,fillParentHeight=0,file="hall/common/msg_icon.png"
}
}
}
}
return hall_game_list_item;
|
local ffi = require 'ffi'
local torch = require 'torch'
local utils = require 'pcl.utils'
local pcl = require 'pcl.PointTypes'
local Correspondences = torch.class('pcl.Correspondences', pcl)
local methods = {}
local function init()
local Correspondences_method_names = {
'new',
'clone',
'delete',
'size',
'getAt',
'setAt',
'push_back',
'pop_back',
'clear',
'insert',
'erase',
'empty'
}
-- use utility function to automatically register new/clone results for GC delete
methods = utils.create_typed_methods("pcl_Correspondences_", Correspondences_method_names, '')
end
init()
function Correspondences:__init()
rawset(self, 'f', methods)
rawset(self, 'o', self.f.new())
end
function Correspondences:cdata()
return self.o
end
function Correspondences:clone()
return self.f.clone(self.o)
end
function Correspondences:size()
return self.f.size(self.o)
end
function Correspondences:__len()
return self:size()
end
function Correspondences:__index(idx)
local v = rawget(self, idx)
if not v then
v = Correspondences[idx]
if not v and type(idx) == 'number' then
local f, o = rawget(self, 'f'), rawget(self, 'o')
v = f.getAt(o, idx-1)
end
end
return v
end
function Correspondences:__newindex(idx, v)
local f, o = rawget(self, 'f'), rawget(self, 'o')
if type(idx) == 'number' then
f.setAt(o, idx-1, v)
else
rawset(self, idx, v)
end
end
function Correspondences:push_back(value)
self.f.push_back(self.o, value)
end
function Correspondences:pop_back()
return self.f.pop_back(self.o)
end
function Correspondences:clear()
self.f.clear(self.o)
end
function Correspondences:insert(pos, value)
self.f.insert(self.o, pos-1, value)
end
function Correspondences:erase(begin_pos, end_pos)
self.f.erase(self.o, begin_pos-1, (end_pos or begin_pos + 1)-1)
end
function Correspondences:empty()
return self.f.empty(self.o)
end
function Correspondences:__pairs()
return function (t, k)
local i = k or 1
if i > #t then
return nil
else
local v = t[i]
return i+1, v
end
end, self, nil
end
function Correspondences:__ipairs()
return self:__pairs()
end
function Correspondences:__tostring()
local t = {}
for i,v in ipairs(self) do
table.insert(t, tostring(v))
end
table.insert(t, string.format("[pcl.Correspondences of size %d]", #self))
return table.concat(t, '\n')
end
|
local itemUtil = {}
local sounds = require("__base__.prototypes.entity.sounds")
local danyao_pic = "__xiuxian__/graphics/icons/danyao/dan-juqi.png"
local dihuo_pic = "__xiuxian__/graphics/icons/地火.png"
function itemUtil.createDanyao(item_name)
data:extend(
{
{
type = "capsule",
name = item_name,
icon = danyao_pic,
icon_size = 128,
--icon_mipmaps = 3,
subgroup = "danyao",
capsule_action = {
type = "use-on-self",
attack_parameters = {
type = "projectile",
activation_type = "consume",
ammo_category = "capsule",
cooldown = 30,
range = 0,
ammo_type = {
category = "capsule",
target_type = "position",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
{
type = "damage",
damage = { type = "physical", amount = -80 }
},
{
type = "play-sound",
sound = sounds.eat_fish
}
}
}
}
}
}
},
stack_size = 100
}
})
end
function itemUtil.createDanyaoRecipe(item_name)
data:extend(
{
{
type = "recipe",
name = item_name,
enabled = false,
subgroup = "danyao",
ingredients = { { "lingshi", 50 } },
result = item_name
}
})
end
function itemUtil.createModule(item_name, tier)
--模块在其类别内的层。升级模块时使用:Ctrl +单击模块进入实体,如果它们具有相同的类别,它将用较高层模块替换较低层模块。
tier = tier or 1
data:extend(
{
{
type = "module",
name = item_name,
icon = dihuo_pic,
icon_size = 60,
subgroup = "地火",
category = "地火",
tier = tier,
effect = { speed = {bonus = 0.5}, consumption = {bonus = 0.5}},
ingredients = { { "lingshi", 50 } },
stack_size = 100
}
})
end
function itemUtil.createModuleRecipe(item_name,tier)
tier = tier or 1
data:extend(
{
{
type = "recipe",
name = item_name,
enabled = false,
subgroup = "地火",
ingredients = { { "lingshi-fire-ore", 100 * tier } },
result = item_name
}
})
end
return itemUtil
|
local dist, pos = ...
--[[
My Math:
newPos = pos[n] + change[n]
dist[n] = math.sqrt(change[n].x ^ 2 + change[n].y ^ 2 + change[n].z ^ 2)
dist[n] ^ 2 = change[n].x ^ 2 + change[n].y ^ 2 + change[n].z ^ 2
Which leads to:
newPos = pos[n] + change[n]
newPos = pos[1] + change[1]
newPos = pos[2] + change[2]
newPos = pos[3] + change[3]
newPos = pos[4] + change[4]
dist[n] ^ 2 = change[n].x ^ 2 + change[n].y ^ 2 + change[n].z ^ 2
dist[1] ^ 2 = change[1].x ^ 2 + change[1].y ^ 2 + change[1].z ^ 2
dist[2] ^ 2 = change[2].x ^ 2 + change[2].y ^ 2 + change[2].z ^ 2
dist[3] ^ 2 = change[3].x ^ 2 + change[3].y ^ 2 + change[3].z ^ 2
dist[4] ^ 2 = change[4].x ^ 2 + change[4].y ^ 2 + change[4].z ^ 2
math.sqrt(dist[1] ^ 2 - change[1].y ^ 2 - change[1].z ^ 2) = change[1].x
math.sqrt(dist[1] ^ 2 - change[1].x ^ 2 - change[1].z ^ 2) = change[1].y
math.sqrt(dist[1] ^ 2 - change[1].x ^ 2 - change[1].y ^ 2) = change[1].z
math.sqrt(dist[2] ^ 2 - change[2].y ^ 2 - change[2].z ^ 2) = change[2].x
math.sqrt(dist[2] ^ 2 - change[2].x ^ 2 - change[2].z ^ 2) = change[2].y
math.sqrt(dist[2] ^ 2 - change[2].x ^ 2 - change[2].y ^ 2) = change[2].z
math.sqrt(dist[3] ^ 2 - change[3].y ^ 2 - change[3].z ^ 2) = change[3].x
math.sqrt(dist[3] ^ 2 - change[3].x ^ 2 - change[3].z ^ 2) = change[3].y
math.sqrt(dist[3] ^ 2 - change[3].x ^ 2 - change[3].y ^ 2) = change[3].z
math.sqrt(dist[4] ^ 2 - change[4].y ^ 2 - change[4].z ^ 2) = change[4].x
math.sqrt(dist[4] ^ 2 - change[4].x ^ 2 - change[4].z ^ 2) = change[4].y
math.sqrt(dist[4] ^ 2 - change[4].x ^ 2 - change[4].y ^ 2) = change[4].z
Ending Math
]]--
function createAngle(p1, p2)
local p1To2 = p2 - p1
return p1To2 / p1To2:length()
end
local newPos = nil
--Finds a circle which the enemy can be at the edge of
do
local circle = {} --position, rotation (roll, pitch, yaw) and radius
do
local line = {pos[1], pos[2]}
|
fx_version 'cerulean'
game 'gta5'
description 'QB-Doorlock'
version '1.0.0'
shared_scripts {
'config.lua',
'@qb-core/import.lua'
}
server_script 'server/main.lua'
client_script 'client/main.lua'
|
local mock = require("luassert.mock")
local stub = require("luassert.stub")
local p = require("plenary.scandir")
local options = require("nvim-lsp-ts-utils.options")
local utils = require("nvim-lsp-ts-utils.utils")
local rename_file = require("nvim-lsp-ts-utils.rename-file")
local _loop = require("nvim-lsp-ts-utils.loop")
local o = mock(options, true)
local u = mock(utils, true)
local loop = mock(_loop, true)
describe("watcher", function()
stub(vim, "defer_fn")
local watcher = require("nvim-lsp-ts-utils.watcher")
local mock_root = "/my/root/dir"
after_each(function()
vim.defer_fn:clear()
u.buffer.root:clear()
watcher.state.reset()
end)
describe("state", function()
it("should contain default values", function()
assert.equals(watcher.state.watching, false)
assert.equals(watcher.state.unwatch, nil)
assert.equals(watcher.state._source, nil)
end)
it("should reset state on reset()", function()
watcher.state.watching = true
watcher.state.unwatch = function()
print("unwatching")
end
watcher.state._source = "test-file.ts"
watcher.state.reset()
assert.equals(watcher.state.watching, false)
assert.equals(watcher.state.unwatch, nil)
assert.equals(watcher.state._source, nil)
end)
describe("source", function()
it("should set source on set()", function()
watcher.state.source.set("test-file.ts")
assert.equals(watcher.state._source, "test-file.ts")
end)
it("should get source on get()", function()
watcher.state.source.set("test-file.ts")
assert.equals(watcher.state.source.get(), "test-file.ts")
end)
it("should reset source on reset()", function()
watcher.state.source.set("test-file.ts")
watcher.state.source.reset()
assert.equals(watcher.state.source.get(), nil)
end)
end)
end)
describe("start", function()
after_each(function()
loop.watch_dir:clear()
end)
it("should return immediately if already watching", function()
watcher.state.watching = true
watcher.start()
assert.stub(u.buffer.root).was_not_called()
end)
it("should return if root cannot be determined", function()
u.buffer.root.returns(nil)
watcher.start()
assert.equals(watcher.state.watching, false)
end)
describe("git project", function()
stub(p, "scan_dir")
before_each(function()
u.buffer.root.returns(mock_root)
u.config_file_exists.returns(true)
end)
after_each(function()
loop.watch_dir:clear()
p.scan_dir:clear()
end)
it("should call scan_dir with root dir and args", function()
p.scan_dir.returns({})
watcher.start()
assert.stub(p.scan_dir).was_called_with(
mock_root,
{ respect_gitignore = true, depth = 1, add_dirs = true }
)
end)
it("should not start watching if scan_dir result is empty", function()
p.scan_dir.returns({})
watcher.start()
assert.equals(watcher.state.watching, false)
end)
it("should not start watching if no dir found in scan_dir results", function()
p.scan_dir.returns({ "file1", "file2" })
u.file.is_dir.returns(false)
watcher.start()
assert.equals(watcher.state.watching, false)
end)
it("should call watch_dir with file path and start watching", function()
p.scan_dir.returns({ "dir1", "dir2" })
u.file.is_dir.returns(true)
watcher.start()
assert.equals(loop.watch_dir.calls[1].refs[1], "dir1")
assert.equals(loop.watch_dir.calls[2].refs[1], "dir2")
assert.equals(watcher.state.watching, true)
end)
it("should call callbacks on unwatch()", function()
local callback = stub.new()
loop.watch_dir.returns(callback)
p.scan_dir.returns({ "dir1", "dir2", "dir3" })
u.file.is_dir.returns(true)
watcher.start()
watcher.state.unwatch()
assert.stub(callback).was_called(3)
end)
end)
describe("watch_dir fallback", function()
local watch_dir = "/my/watch/dir"
before_each(function()
o.get.returns({ watch_dir = watch_dir })
u.file.is_dir.returns(true)
u.buffer.root.returns(mock_root)
u.config_file_exists.returns(false)
end)
after_each(function()
o.get:clear()
u.file.is_dir:clear()
loop.watch_dir:clear()
end)
it("should return if watch_dir is not set", function()
o.get.returns({})
watcher.start()
assert.equals(watcher.state.watching, false)
end)
it("should return if watch_dir is not dir", function()
u.file.is_dir.returns(false)
watcher.start()
assert.stub(u.file.is_dir).was_called_with(mock_root .. watch_dir)
assert.equals(watcher.state.watching, false)
end)
it("should start watching if watch_dir is dir", function()
watcher.start()
assert.equals(watcher.state.watching, true)
end)
it("should set unwatch to watch_dir callback", function()
local callback = stub.new()
loop.watch_dir.returns(callback)
watcher.start()
assert.equals(watcher.state.unwatch, callback)
end)
end)
describe("on_error", function()
local on_error
before_each(function()
o.get.returns({ watch_dir = "dir" })
u.file.is_dir.returns(true)
watcher.start()
on_error = loop.watch_dir.calls[1].refs[2].on_error
end)
after_each(function()
u.echo_warning:clear()
loop.watch_dir:clear()
watcher.state.reset()
end)
it("should echo error message and reset state", function()
watcher.state.watching = true
on_error("something went wrong")
assert.stub(u.echo_warning).was_called_with("error in watcher: something went wrong")
assert.equals(watcher.state.watching, false)
end)
end)
describe("on_event", function()
stub(rename_file, "on_move")
local watch_dir = "/my/watch/dir"
local on_event
before_each(function()
o.get.returns({ watch_dir = watch_dir })
u.is_tsserver_file.returns(true)
u.file.is_dir.returns(true)
watcher.start()
on_event = loop.watch_dir.calls[1].refs[2].on_event
end)
after_each(function()
u.is_tsserver_file:clear()
u.file.extension:clear()
loop.watch_dir:clear()
rename_file.on_move:clear()
watcher.state.reset()
end)
it("should return if path is not tsserver file and has extension", function()
u.is_tsserver_file.returns(false)
u.file.extension.returns(".md")
on_event("file.md")
assert.stub(u.is_tsserver_file).was_called()
assert.stub(u.file.extension).was_called()
assert.equals(watcher.state.source.get(), nil)
end)
it("should set source if not set", function()
on_event("file.ts")
assert.equals(watcher.state.source.get(), mock_root .. watch_dir .. "/" .. "file.ts")
end)
it("should reset source in defer callback", function()
on_event("file.ts")
local callback = vim.defer_fn.calls[1].refs[1]
callback()
assert.equals(watcher.state.source.get(), nil)
end)
it("should reset source if source and target are the same", function()
on_event("file.ts")
on_event("file.ts")
assert.stub(rename_file.on_move).was_not_called()
assert.equals(watcher.state.source.get(), nil)
end)
it("should call on_move with source and target and reset source", function()
local source = mock_root .. watch_dir .. "/" .. "file1.ts"
local target = mock_root .. watch_dir .. "/" .. "file2.ts"
u.file.stat.on_call_with(source).returns(nil)
u.file.stat.on_call_with(target).returns({})
on_event("file1.ts")
on_event("file2.ts")
assert.stub(rename_file.on_move).was_called_with(source, target)
assert.equals(watcher.state.source.get(), nil)
end)
end)
end)
end)
|
-----------------------------------------------------
-- Ah shit, here we go again made in MTA:SA
-- Haxardous
-----------------------------------------------------
function startAhShit()
local timehour, timeminute = getTime()
-- set CJ's skin model.
if not (getElementModel(localPlayer) == 0) then
setElementModel(localPlayer, 0)
print("skin model set to 0 (CJ Skin)")
end
-- set CJ's clothes.
addPedClothes(localPlayer, "vest", "vest", 0)
print("CJ's vest set to 0 (Clothes)")
-- set weather
if not (getWeather() == 0) then
setWeather(0)
print("weather set to 0")
elseif not (timerhour == 12) then
setTime(12, 0)
print("time set to 12:0")
end
-- playing sound
sound = playSound("ahshitherewegoagain.mp3")
setSoundVolume(sound, 100)
print("playing sound")
-- hiding HUD & chat
local components = { "ammo", "area_name" ,"armour", "breath", "clock", "health", "money",
"radar", "vehicle_name", "weapon", "radio", "wanted", "crosshair" }
for _,component in ipairs(components) do
if isPlayerHudComponentVisible(component) then
setPlayerHudComponentVisible("all", false)
print("hud has been hidden successfully")
if (isChatVisible() == true) then
showChat(false)
print("chat has been hidden successfully")
end
end
end
function drawText()
dxDrawText("Ah shit, here we go again.", 859 + 1, 919 + 1, 1061 + 1, 938 + 1, tocolor(1, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText("Ah shit, here we go again.", 859, 919, 1061, 938, tocolor(255, 255, 255, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)
end
addEventHandler("onClientRender", root, drawText)
-- position & camera
setElementPosition(localPlayer, 2208.33276, -1262.66333, 23.88005)
setElementRotation(localPlayer, 0, 0, -90)
setPedCameraRotation(localPlayer, -90)
fadeCamera(true)
setCameraShakeLevel(30)
-- movement
setControlState(localPlayer, "forwards", true)
setControlState(localPlayer, "walk", true)
-- restore stuff
setTimer(function()
-- display HUD
setPlayerHudComponentVisible("all", true)
showChat(true)
-- remove text
removeEventHandler("onClientRender", root, drawText)
-- camera
setCameraShakeLevel(0)
-- restore movement
setControlState(localPlayer, "forwards", false)
setControlState(localPlayer, "walk", false)
end, 3500, 1)
end
addCommandHandler("ahshit", startAhShit, false, false)
|
local M = {}
-- fallback to using global variable as default
local completion_opt_metatable = {
__index = function(_, key)
key = 'completion_'..key
return vim.g[key]
end
}
local option_table = setmetatable({}, completion_opt_metatable)
M.set_option_table = function(opt)
if opt ~= nil then
option_table = setmetatable(opt, completion_opt_metatable)
else
option_table = setmetatable({}, completion_opt_metatable)
end
end
M.get_option = function(opt)
return option_table[opt]
end
return M
|
-- 128 models outdoor / 8192 facets indoor is too restricting
-- This script extends that to x4 of the amounts
if offsets.MMVersion ~= 8 then
return
end
FacetRefsLimit = 0x8000
local _KNOWNGLOBALS = Game
local abs, floor, ceil, round, max, min = math.abs, math.floor, math.ceil, math.round, math.max, math.min
local i4, i2, i1, u4, u2, u1, i8, u8 = mem.i4, mem.i2, mem.i1, mem.u4, mem.u2, mem.u1, mem.i8, mem.u8
--[[
Only facets may reach indeces above 4096, so repack facets:
high-order bit 0x8000 indicates it's a facet, other bits contain facet index.
Other ObjRefs remain unhanged.
]]
local refs = {
[""] = "%",
RealRef = mem.StaticAlloc(4),
MyRefs = mem.StaticAlloc(640*480*4),
ZBufRefs = 0xF019B4,
RefsSize = 640*480*4,
}
local function patch(p, code, size)
mem.asmpatch(p, code:gsub("%%(%w*)%%", refs), size)
end
local function hook1(p, code, size)
mem.asmhook(p, code:gsub("%%(%w*)%%", refs), size)
end
local function hook2(p, code, size)
mem.asmhook2(p, code:gsub("%%(%w*)%%", refs), size)
end
-- Store D3D
patch(0x4BE89A, [[
or ax, 0x8000
]])
patch(0x4BE982, [[
or ax, 0x8000
]])
patch(0x4BF297, [[
or cx, 0x8000
]])
patch(0x4BF3EA, [[
or cx, 0x8000
]])
hook2(0x4BEC07, [[
and eax, 0x7FFF
shr eax, 6
]], 3)
-- Store indoor SW
patch(0x4AC94C, [[
or ax, 0x8000
]])
hook1(0x4AC035, [[
lea eax, [ecx + 0x8000]
mov [0xFFCFB0], eax
]])
-- Store ourdoor SW
patch(0x4772B5, [[
or ax, 0x8000
]])
patch(0x47778C, [[
or ax, 0x8000
]])
patch(0x477BE5, [[
or ax, 0x8000
]])
-- Render done
-- fill FacetRefs, return ZBufRefs to its traditional form
hook2(0x43DE78, [[
xor ecx, ecx
cmp [0xF01A08], ecx ; is D3D?
jnz @done
mov edi, [%ZBufRefs%]
@loop:
mov eax, [ecx + edi]
mov [ecx + %MyRefs%], eax
test ax, 0x8000
jz @next
shl ax, 3
or al, 6
mov [ecx + edi], eax
@next:
add ecx, 4
cmp ecx, %RefsSize%
jnz @loop
@done:
]])
-- D3D result
-- set RealRef, return result in traditional form
hook2(0x4BF6D9, [[
mov edx, eax
and edx, 0x7FFF
test ax, 0x8000
jz @next
shl edx, 3
or dl, 6
mov ax, dx
@next:
mov [%RealRef%], edx
leave
ret 4
]], 3)
-- With hooks above all standard maps should work fine already
-- ObjectByPixel
-- set RealRef
local ObjectByPixelHook = [[
savereg edx
mov edx, [ecx+eax*4]
xor edx, 6
test edx, 7
jnz @std
; facet:
mov edx, [%MyRefs% + eax*4]
and edx, 0x7FFF
shl edx, 3
or dl, 6
jmp @store
@std:
xor edx, 6
and edx, 0xFFFF
@store:
mov [%RealRef%], edx
]]
local hooks = {0x4212CE, 0x43097E, 0x4315E9, 0x432924}
for _, p in ipairs(hooks) do
hook2(p, ObjectByPixelHook)
end
hook2(0x420624, ObjectByPixelHook, 8)
-- Use RealRef for facets
patch(0x420635, [[
mov edx, [%RealRef%]
; !!! tmp
cmp dx, ax
jz @f
;int 3
mov dx, ax
@@:
]])
patch(0x42130D, [[
mov eax, [%RealRef%]
shr eax, 3
]])
patch(0x430987, [[
mov eax, [%RealRef%]
]])
patch(0x4315F4, [[
mov esi, [%RealRef%]
]])
patch(0x43292E, [[
mov eax, [%RealRef%]
]])
-- ObjectByPixel iteration routines (2 special cases)
-- on space press:
patch(0x468570, [[
mov eax, %MyRefs%
]])
hook2(0x4685B1, [[
and ecx, 0x8007
]], 2)
patch(0x468690, [[
mov eax, ecx
and ecx, 0x7FFF
test eax, 0x8000
jz @std
shl ecx, 3
or cl, 6
@std:
mov [%RealRef%], ecx
]])
-- because mm8patch calls the function passing a fake ref
hook1(0x4686A9, [[
mov ecx, [%RealRef%]
]])
-- 468F2F:
patch(0x468F2F, [[
mov eax, %MyRefs%
]])
patch(0x468F78, [[
cmp edi, ebx
jz @stay
xor eax, eax
@stay:
test eax, 0x8007
]])
patch(0x469010, [[
mov eax, esi
and esi, 0x7FFF
test eax, 0x8000
jz @std
shl esi, 3
add esi, 6
@std:
]])
-- MMExt structures
local function MyRef(p)
p = p - u4[refs.ZBufRefs]
if p >= 0 and p < refs.RefsSize then
return p + refs.MyRefs
end
-- error("unknown structure used an ObjectRef declaration")
end
local ObjectRef = structs.f.ObjectRef
function structs.f.ObjectRef(define, ...)
ObjectRef(define, ...)
define.members.Value = nil
define.members.Kind = nil
define.members.Index = nil
define
[0].CustomType('Value', 2, function(o, obj, _, val)
local p = obj["?ptr"] + o
local p1 = MyRef(p)
if val == nil then
local v = u2[p1 or p]
if p1 and v >= 0x8000 then
return (v - 0x8000)*8 + 6
end
return v
else
u2[p] = val
if p1 and val % 8 ~= 6 then
u2[p1] = val
elseif p1 then
u2[p1] = val:div(8) + 0x8000
end
end
end)
[0].CustomType('Kind', 0, function(o, obj, _, val)
if val == nil then
return obj.Value%8
else
obj.Value = obj.Value:AndNot(7) + val%8
end
end)
[0].CustomType('Index', 2, function(o, obj, _, val)
if val == nil then
return obj.Value:div(8)
else
obj.Value = obj.Value%8 + math.floor(val)*8
end
end)
end
function events.StructsLoaded()
structs.f.ObjectRef = ObjectRef
structs.ObjectRef = nil
end
local MTargetBuf, MTargetBufStd, MTarget
local function ObjectRefMouse(define, ...)
ObjectRef(define, ...)
define.members.Value = nil
define.members.Kind = nil
define.members.Index = nil
define
[0].CustomType('Value', 2, function(o, obj, _, val)
local p = obj["?ptr"] + o
if val == nil then
return u4[MTargetBuf]
else
u4[MTargetBuf] = val
end
end)
[0].CustomType('Kind', 0, function(o, obj, _, val)
if val == nil then
return u4[MTargetBuf]%8
else
u4[MTargetBuf] = u4[MTargetBuf]:AndNot(7) + val%8
end
end)
[0].CustomType('Index', 2, function(o, obj, _, val)
if val == nil then
return u4[MTargetBuf]:div(8)
else
u4[MTargetBuf] = u4[MTargetBuf]%8 + math.floor(val)*8
end
end)
end
local GameMouse = structs.f.GameMouse
function structs.f.GameMouse(define, ...)
GameMouse(define, ...)
function define.class.GetTarget()
if Game.RendererD3D ~= 0 then
MTargetBuf = MTargetBuf or mem.StaticAlloc(8)
MTargetBufStd = MTargetBuf + 4
MTarget = MTarget or mem.struct(ObjectRefMouse):new(MTargetBufStd)
i4[MTargetBufStd] = mem.call(0x4BF70D, 1, u4[u4[0x75CE00] + 3660])
i4[MTargetBuf] = i4[refs.RealRef]
return MTarget
end
local mouse = Game.Mouse
return Game.ObjectByPixel[mouse.Y][mouse.X]
end
end
|
data:extend(
{
{
type = "recipe",
name = "underground-belt-7",
category = "crafting-with-fluid",
enabled = false,
energy_required = 6,
ingredients =
{
{"steel-gear-wheel", 120},
{"underground-belt-6", 2},
{type="fluid", name="aerated-lubricant", amount=80}
},
result_count = 2,
result = "underground-belt-7"
}
}
)
|
local Packages = script.Parent.Parent.Parent.Parent.Parent.Parent
local Roact = require(Packages.Roact)
local UIBlox = Packages.UIBlox
local withStyle = require(UIBlox.Style.withStyle)
local AccordionView = require(UIBlox.App.Accordion.AccordionView)
local testImages = {
-- The 1st image is transparent.
"http://www.roblox.com/asset/?id=2583107839",
"http://www.roblox.com/asset/?id=410689385",
"http://www.roblox.com/asset/?id=410690022",
"http://www.roblox.com/asset/?id=410689825",
"http://www.roblox.com/asset/?id=410689711",
}
local function Story()
return withStyle(function(style)
return Roact.createElement("Frame", {
Size = UDim2.new(1, 0, 0, 400),
BackgroundTransparency = 1,
}, {
ListLayout = Roact.createElement("UIListLayout", {
FillDirection = Enum.FillDirection.Vertical,
HorizontalAlignment = Enum.HorizontalAlignment.Center,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 20),
}),
Accordion = Roact.createElement(AccordionView, {
LayoutOrder = 2,
items = testImages,
itemWidth = 355,
itemHeight = 188,
renderItem = function(item, transparency)
return Roact.createElement("ImageButton", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundColor3 = Color3.fromRGB(57, 59, 61),
BackgroundTransparency = 0.5,
BorderSizePixel = 0,
Image = item,
ImageTransparency = transparency,
AutoButtonColor = false,
})
end,
placeholderColor = Color3.fromRGB(255, 255, 255),
placeholderBaseTransparency = 0.5,
collapseButtonSize = 40,
renderCollapseButton = function(activatedCallback)
return Roact.createElement("ImageButton", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
Image = "rbxassetid://48657647",
AutoButtonColor = false,
[Roact.Event.Activated] = activatedCallback,
})
end,
}),
SomeFooterText = Roact.createElement("TextLabel", {
Size = UDim2.new(1, 0, 0, 50),
BackgroundTransparency = 1,
LayoutOrder = 3,
Text = "Test AccordionView Footer.\nThis should not move when the Accordion shrinks.",
TextColor3 = style.Theme.TextDefault.Color,
}),
})
end)
end
return Story
|
-- Copyright (C) 2010-2013 Ian MacLarty. See Copyright Notice in ../lt.h
function lt.Text(str, font, halign, valign)
halign = halign or "left"
valign = valign or "center"
local em = font.m or font.M or font["0"] or {width = 0.1, height = 0.1}
local space = em.width * (font.space or 1.0)
local hmove = em.width * (font.hmove or 0.05)
local vmove = em.height * (font.vmove or 1.2)
local kerntable = font.kern
local fixed_w = font.fixed and em.width
local x, y, dx, k, gap = 0, -em.height / 2, 0, 0, 0
local line = lt.Layer()
local scale = 1
-- print ( "local hmove, vmove, spacemove = " .. hmove .. "," .. vmove .. "," .. space)
-- Build an array of lines.
local lines = {line}
local i = 1
local len = str:len()
while i <= len do
local chr = str:sub(i, i)
local kernpair = kerntable and str:sub(i, i + 1)
if chr == "\n" then
line.width = x - gap
line = lt.Layer()
table.insert(lines, line)
y = y - vmove
x = 0
elseif chr == "\\" then
i = i + 1
chr = str:sub(i, i)
if chr == "+" then
scale = scale + 0.1
elseif chr == "-" then
scale = scale - 0.1
end
else
local img = font[chr] or font[string.upper(chr)] or font[string.lower(chr)]
if not img then
dx = space
gap = space
else
local w = fixed_w or img.width
local node = img
if scale ~= 1 then
node = node:Scale(scale)
end
line:Insert(node:Translate(x + w/2, y))
k = kerntable and kerntable[kernpair]
gap = (k and k * em.width or hmove)
dx = gap + w
end
x = x + scale * dx
end
i = i + 1
end
line.width = x - gap
-- Compute text bounding box.
local bb_width = 0;
local bb_height = #lines * vmove - (vmove - em.height)
local bb_top, bb_left, bb_bottom, bb_right
for _, line in ipairs(lines) do
if line.width > bb_width then
bb_width = line.width
end
end
if halign == "left" then
bb_left = 0
bb_right = bb_width
elseif halign == "right" then
bb_left = -bb_width
bb_right = 0
else -- centered
bb_left = -bb_width / 2
bb_right = bb_width / 2
end
-- Insert lines into haligned node.
local haligned = lt.Layer()
for _, line in ipairs(lines) do
if halign == "left" then
haligned:Insert(line)
elseif halign == "right" then
haligned:Insert(lt.Translate(line, -line.width, 0))
else -- centered
haligned:Insert(lt.Translate(line, -line.width / 2, 0))
end
end
-- Create valigned node.
local valigned
if valign == "top" then
valigned = haligned
bb_top = 0
bb_bottom = -bb_height
elseif valign == "bottom" then
valigned = lt.Translate(haligned, 0, bb_height)
bb_top = bb_height
bb_bottom = 0
else -- centered
valigned = lt.Translate(haligned, 0, bb_height / 2)
bb_top = bb_height / 2
bb_bottom = -bb_height / 2
end
valigned.width = bb_width
valigned.height = bb_height
valigned.left = bb_left
valigned.bottom = bb_bottom
valigned.right = bb_right
valigned.top = bb_top
return valigned
end
|
local dbg = rdebug()
local allItemsData = {}
function allItems()
MySQL.ready(function()
local data = MySQL.Sync.fetchAll('SELECT name FROM items', {
})
if data[1] ~= nil then
for i,v in pairs(data) do
allItemsData[v.name] = v
end
else
dbg.critical('Cannot find items! SQL error.')
end
end)
end
allItems()
function existItem(itemName,cb)
-- if we have already cached items use cache
if allItemsData[itemName] ~= nil then
cb(true)
else
-- we dont know if item is existing, try to check it
MySQL.ready(function()
local data = MySQL.Sync.fetchAll('SELECT name FROM items WHERE name = @name', {
['@name'] = itemName
})
if data[1] ~= nil then
cb(true)
else
cb(false)
end
end)
end
end
exports('existItem',existItem)
function createItem(itemName, label, weight, cb, options)
options = options or {}
options.can_remove = options.can_remove or true
options.rare = options.rare or false
existItem(itemName,function(exists)
if exists then
dbg.info('Item %s was found, skipping creation',itemName)
else
MySQL.Async.execute('INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES (@itemName, @label, @weight, @rare, @canRemove)', {
['@itemName'] = itemName,
['@label'] = label,
['@weight'] = round(weight,1),
['@rare'] = options.rare,
['@canRemove'] = options.can_remove
},function(changes)
if changes > 0 then
if cb ~= nil then
cb(true)
end
else
if cb ~= nil then
cb(false)
end
end
end)
end
end)
end
exports('createItem',createItem)
|
#!/usr/bin/env tarantool
package.path = "../?/init.lua;./?/init.lua;" .. package.path
package.cpath = "../?.so;../?.dylib;./?.so;./?.dylib;" .. package.cpath
local fiber = require 'fiber'
local tap = require 'tap'
local zookeeper = require 'zookeeper'
local zkacl = require 'zookeeper.acl'
local zkconst = require 'zookeeper.const'
local function get_hosts()
return os.getenv('ZOOKEEPER') or '127.0.0.1:2181'
end
local function test_global_watch_connect(t)
t:plan(6)
local cond = fiber.cond()
local user_context = {k1 = 'v1'}
local function global_watcher(z_, type, state, path, context)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.SESSION, 'type is session')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '', 'path is empty')
t:ok(rawequal(context, user_context), 'context is same')
cond:signal()
end
z = zookeeper.init(get_hosts())
z:set_watcher(global_watcher, user_context)
z:start()
if not cond:wait(1) then
t:fail('global watcher timed out')
else
t:ok(true, 'global watcher triggered')
end
z:close()
end
local function test_global_watch_connect_watcher_sleep(t)
t:plan(6)
local cond = fiber.cond()
local user_context = {k1 = 'v1'}
local function global_watcher(z_, type, state, path, context)
fiber.sleep(1)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.SESSION, 'type is session')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '', 'path is empty')
t:ok(rawequal(context, user_context), 'context is same')
cond:signal()
end
z = zookeeper.init(get_hosts())
z:set_watcher(global_watcher, user_context)
z:start()
if not cond:wait(1.5) then
t:fail('global watcher timed out')
else
t:ok(true, 'global watcher triggered')
end
z:close()
end
local function test_global_watch_exists(t, z)
t:plan(6)
z:delete('/mypath')
local cond = fiber.cond()
local function global_watcher(z_, type, state, path)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CREATED, 'type is CREATED')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
cond:signal()
end
z:set_watcher(global_watcher)
local _, _, rc = z:exists('/mypath', true)
t:is(rc, zkconst.api_errors.ZNONODE, 'no node before create')
fiber.create(function()
-- detach to wait before signal() happens
if not cond:wait(1) then
t:fail('global watcher timed out')
else
t:ok(true, 'global watcher triggered')
end
end)
z:create('/mypath')
z:set_watcher(nil)
z:delete('/mypath')
end
local function test_global_watch_get(t, z)
t:plan(6)
local cond = fiber.cond()
local function global_watcher(z_, type, state, path)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CHANGED, 'type is CHANGED')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
cond:signal()
end
z:set_watcher(global_watcher)
z:create('/mypath')
local _, _, rc = z:get('/mypath', true)
t:is(rc, zkconst.ZOK, 'get ZOK')
fiber.create(function()
-- detach to wait before signal() happens
if not cond:wait(1) then
t:fail('global watcher timed out')
else
t:ok(true, 'global watcher triggered')
end
end)
z:set('/mypath', 'value1')
z:set_watcher(nil)
z:delete('/mypath')
end
local function test_global_watch_get_children(t, z)
t:plan(5)
local cond = fiber.cond()
local function global_watcher(z_, type, state, path)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CHILD, 'type is CHILD')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
cond:signal()
end
z:set_watcher(global_watcher)
z:create('/mypath')
local _, rc = z:get_children('/mypath', true)
fiber.create(function()
-- detach to wait before signal() happens
if not cond:wait(1) then
t:fail('global watcher timed out')
else
t:ok(true, 'global watcher triggered')
end
end)
z:create('/mypath/n1')
z:set_watcher(nil)
z:delete('/mypath/n1')
z:delete('/mypath')
end
local function test_global_watch_get_children2(t, z)
t:plan(5)
local cond = fiber.cond()
local function global_watcher(z_, type, state, path)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CHILD, 'type is CHILD')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
cond:signal()
end
z:set_watcher(global_watcher)
z:create('/mypath')
local _, rc = z:get_children2('/mypath', true)
fiber.create(function()
-- detach to wait before signal() happens
if not cond:wait(1) then
t:fail('global watcher timed out')
else
t:ok(true, 'global watcher triggered')
end
end)
z:create('/mypath/n1')
z:set_watcher(nil)
z:delete('/mypath/n1')
z:delete('/mypath')
end
local function test_wexists(t, z)
t:plan(8)
local gcond = fiber.cond()
local lcond = fiber.cond()
local ch_cap = 2
local ch = fiber.channel(ch_cap)
local function global_watcher(z_, type, state, path)
t:fail('global watcher should not be called')
gcond:signal()
end
z:set_watcher(global_watcher)
local extra_context = {k1 = 'v1'}
local function local_watcher(z_, type, state, path, context)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CREATED, 'type is CREATED')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
t:ok(rawequal(context, extra_context), 'context is ok')
lcond:signal()
end
local _, _, rc = z:wexists('/mypath', local_watcher, extra_context)
t:is(rc, zkconst.api_errors.ZNONODE, 'no node before create')
fiber.create(function()
-- detach to wait before signal() happens
if not gcond:wait(0.5) then
t:ok(true, 'global watcher not triggered')
end
ch:put(true)
end)
fiber.create(function()
-- detach to wait before signal() happens
if not lcond:wait(1) then
t:fail('local watcher timed out')
else
t:ok(true, 'local watcher triggered')
end
ch:put(true)
end)
z:create('/mypath')
for _=1,ch_cap do
ch:get()
end
z:set_watcher(nil)
z:delete('/mypath')
end
local function test_wexists_sleep(t, z)
t:plan(8)
local gcond = fiber.cond()
local lcond = fiber.cond()
local ch_cap = 2
local ch = fiber.channel(ch_cap)
local function global_watcher(z_, type, state, path)
t:fail('global watcher should not be called')
gcond:signal()
end
z:set_watcher(global_watcher)
local extra_context = {k1 = 'v1'}
local function local_watcher(z_, type, state, path, context)
fiber.sleep(1)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CREATED, 'type is CREATED')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
t:ok(rawequal(context, extra_context), 'context is ok')
lcond:signal()
end
local _, _, rc = z:wexists('/mypath', local_watcher, extra_context)
t:is(rc, zkconst.api_errors.ZNONODE, 'no node before create')
fiber.create(function()
-- detach to wait before signal() happens
if not gcond:wait(0.5) then
t:ok(true, 'global watcher not triggered')
end
ch:put(true)
end)
fiber.create(function()
-- detach to wait before signal() happens
if not lcond:wait(1.5) then
t:fail('local watcher timed out')
else
t:ok(true, 'local watcher triggered')
end
ch:put(true)
end)
z:create('/mypath')
for _=1,ch_cap do
ch:get()
end
z:set_watcher(nil)
z:delete('/mypath')
end
local function test_wget(t, z)
t:plan(8)
local gcond = fiber.cond()
local lcond = fiber.cond()
local ch_cap = 2
local ch = fiber.channel(ch_cap)
local function global_watcher(z_, type, state, path)
t:fail('global watcher should not be called')
gcond:signal()
end
z:set_watcher(global_watcher)
local extra_context = {k1 = 'v1'}
local function local_watcher(z_, type, state, path, context)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CHANGED, 'type is CHANGED')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
t:ok(rawequal(context, extra_context), 'context is ok')
lcond:signal()
end
z:create('/mypath')
local _, _, rc = z:wget('/mypath', local_watcher, extra_context)
t:is(rc, zkconst.ZOK, 'path exists')
fiber.create(function()
-- detach to wait before signal() happens
if not gcond:wait(0.5) then
t:ok(true, 'global watcher not triggered')
end
ch:put(true)
end)
fiber.create(function()
-- detach to wait before signal() happens
if not lcond:wait(1) then
t:fail('local watcher timed out')
else
t:ok(true, 'local watcher triggered')
end
ch:put(true)
end)
z:set('/mypath', 'value2')
for _=1,ch_cap do
ch:get()
end
z:set_watcher(nil)
z:delete('/mypath')
end
local function test_wget_children(t, z)
t:plan(9)
local gcond = fiber.cond()
local lcond = fiber.cond()
local ch_cap = 2
local ch = fiber.channel(ch_cap)
local function global_watcher(z_, type, state, path)
t:fail('global watcher should not be called')
gcond:signal()
end
z:set_watcher(global_watcher)
local extra_context = {k1 = 'v1'}
local function local_watcher(z_, type, state, path, context)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CHILD, 'type is CHILD')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
t:ok(rawequal(context, extra_context), 'context is ok')
lcond:signal()
end
z:create('/mypath')
local children, rc = z:wget_children('/mypath', local_watcher, extra_context)
t:is_deeply(children, {}, 'no dhildren yet')
t:is(rc, zkconst.ZOK, 'path exists')
fiber.create(function()
-- detach to wait before signal() happens
if not gcond:wait(0.5) then
t:ok(true, 'global watcher not triggered')
end
ch:put(true)
end)
fiber.create(function()
-- detach to wait before signal() happens
if not lcond:wait(1) then
t:fail('local watcher timed out')
else
t:ok(true, 'local watcher triggered')
end
ch:put(true)
end)
z:create('/mypath/n1')
for _=1,ch_cap do
ch:get()
end
z:set_watcher(nil)
z:delete('/mypath/n1')
z:delete('/mypath')
end
local function test_wget_children2(t, z)
t:plan(9)
local gcond = fiber.cond()
local lcond = fiber.cond()
local ch_cap = 2
local ch = fiber.channel(ch_cap)
local function global_watcher(z_, type, state, path)
t:fail('global watcher should not be called')
gcond:signal()
end
z:set_watcher(global_watcher)
local extra_context = {k1 = 'v1'}
local function local_watcher(z_, type, state, path, context)
t:ok(rawequal(z_, z), 'z instance is the same')
t:is(type, zkconst.watch_types.CHILD, 'type is CHILD')
t:is(state, zkconst.states.CONNECTED, 'state is CONNECTED')
t:is(path, '/mypath', 'path is correct')
t:ok(rawequal(context, extra_context), 'context is ok')
lcond:signal()
end
z:create('/mypath')
local children, _, rc = z:wget_children2('/mypath', local_watcher, extra_context)
t:is_deeply(children, {}, 'no dhildren yet')
t:is(rc, zkconst.ZOK, 'path exists')
fiber.create(function()
-- detach to wait before signal() happens
if not gcond:wait(0.5) then
t:ok(true, 'global watcher not triggered')
end
ch:put(true)
end)
fiber.create(function()
-- detach to wait before signal() happens
if not lcond:wait(1) then
t:fail('local watcher timed out')
else
t:ok(true, 'local watcher triggered')
end
ch:put(true)
end)
z:create('/mypath/n1')
for _=1,ch_cap do
ch:get()
end
z:set_watcher(nil)
z:delete('/mypath/n1')
z:delete('/mypath')
end
local function main()
local hosts = get_hosts()
local z = zookeeper.init(hosts)
z:start()
z:wait_connected(10)
tap.test('test_global_watch_connect', test_global_watch_connect)
tap.test('test_global_watch_connect_watcher_sleep', test_global_watch_connect_watcher_sleep)
tap.test('test_global_watch_exists', test_global_watch_exists, z)
tap.test('test_global_watch_get', test_global_watch_get, z)
tap.test('test_global_watch_get_children', test_global_watch_get_children, z)
tap.test('test_global_watch_get_children2', test_global_watch_get_children2, z)
tap.test('test_wexists', test_wexists, z)
tap.test('test_wexists_sleep', test_wexists_sleep, z)
tap.test('test_wget', test_wget, z)
tap.test('test_wget_children', test_wget_children, z)
tap.test('test_wget_children2', test_wget_children2, z)
z:close()
end
main()
|
function scene5_load()
love.graphics.setBackgroundColor(153, 217, 234)
love.audio.play(bgmusic)
clouds2 = {}
for i = 1, 3 do
for y = 1, 8 do
table.insert(clouds2, cloud2:new(math.random()*140))
end
end
lastexplosion = {50, 40}
starttimer = 0
flyingquad = 3
playerx = 50
playery = 20
pspeedx = 0
pspeedy = 0
birds = {}
splatters = {}
birdtimer = 0
flyanimationtimer = 0
shakeamount = 5
awesometimer = 0
screenx = 0
landingtime = 2
groundy = 90
landing = false
end
function scene5_update(dt)
if starttimer < 20 then
birdtimer = birdtimer + dt
local birddelay = 0.5
while birdtimer > birddelay do
birdtimer = birdtimer - birddelay
table.insert(birds, bird:new())
end
end
if starttimer >= 25 and starttimer - dt < 25 then
landing = true
timeleft = landingtime
landingx = math.random(60)+20
end
if starttimer >= 25.4 and starttimer - dt < 25.4 then
approach:play()
end
if landing then
timeleft = timeleft - dt
if timeleft <= 0 then
timeleft = 0
groundy = groundy - 400*dt
if groundy <= playery-10 then
changegamestate("scene6")
end
end
end
for i,v in pairs(clouds2) do
v:update(dt)
end
flyanimationtimer = flyanimationtimer + dt
while flyanimationtimer > 0.1 do
flyanimationtimer = flyanimationtimer - 0.1
if flyingquad == 3 then
flyingquad = 4
else
flyingquad = 3
end
end
if awesometimer > 0 then
awesometimer = awesometimer - dt
end
if landing or starttimer < 24 then
playermovement2(dt)
else
if playerx > 50 then
playerx = playerx - 50*dt
elseif playerx < 50 then
playerx = playerx + 50*dt
end
if playery > 40 then
playery = playery - 50*dt
elseif playery < 40 then
playery = playery + 50*dt
end
end
--BIRDS
local delete = {}
for i, v in pairs(birds) do
if v:update(dt) == true then
table.insert(delete, i)
end
end
table.sort(delete, function(a,b) return a>b end)
for i, v in pairs(delete) do
table.remove(birds, v) --remove
end
--SPLATTERS
local delete = {}
for i, v in pairs(splatters) do
if v:update(dt) == true then
table.insert(delete, i)
end
end
table.sort(delete, function(a,b) return a>b end)
for i, v in pairs(delete) do
table.remove(splatters, v) --remove
end
for i, v in pairs(birds) do
if v:checkcol(playerx, playery) then
splat:stop()
splat:play()
pointsget(20)
table.insert(splatters, splatter:new(v.x, v.y))
skycolor = getrainbowcolor(math.random(), 400)
love.graphics.setBackgroundColor(skycolor)
lastexplosion = {v.x, v.y}
end
end
end
function playermovement2(dt)
if love.keyboard.isDown("left") then
playerx = math.max(0, playerx-dt*movement1speed)
elseif love.keyboard.isDown("right") then
playerx = math.min(100, playerx+dt*movement1speed)
end
if not landing then
if love.keyboard.isDown("up") then
playery = math.max(0, playery-dt*movement1speed)
elseif love.keyboard.isDown("down") then
playery = math.min(80, playery+dt*movement1speed)
end
end
end
function scene5_draw()
local r, g, b = love.graphics.getColor()
love.graphics.setColor(math.random(255), math.random(255), math.random(255), 100*math.min(1, (starttimer/2)))
for i = 1, backgroundstripes, 2 do
local pos = {playerx, playery}
local alpha = math.rad((i/backgroundstripes + math.fmod(sunrot/100, 1)) * 360)
local point1 = {pos[1]*scale+200*scale*math.cos(alpha), pos[2]*scale+200*scale*math.sin(alpha)}
local alpha = math.rad(((i+1)/backgroundstripes + math.fmod(sunrot/100, 1)) * 360)
local point2 = {pos[1]*scale+200*scale*math.cos(alpha), pos[2]*scale+200*scale*math.sin(alpha)}
love.graphics.polygon("fill", pos[1]*scale, pos[2]*scale, point1[1], point1[2], point2[1], point2[2])
end
love.graphics.setColor(r, g, b, 255)
for i,v in pairs(clouds2) do
v:draw()
end
for i,v in pairs(birds) do
v:draw()
end
for i,v in pairs(splatters) do
v:draw()
end
if groundy < 90 then
draw(groundwinimg, -200+landingx+2, groundy)
end
love.graphics.draw(playerimg, playerquad[flyingquad], (playerx)*scale, playery*scale, 0, scale, scale, 13, 6)
if sunglasses then
draw(sunglassesimg, playerx+4, playery)
end
if awesometimer > 0 then
draw(awesomeimg, (awesometimer*2-1)*100, 0)
love.graphics.setColor(0, 0, 0)
properprint("1000 points!", (awesometimer*2-1)*100+3, 73, scale)
love.graphics.setColor(255, 255, 255)
end
if starttimer > 24 then
if math.fmod(starttimer*5, 2) >= 1 then
love.graphics.setColor(255, 0, 0)
properprint("land in the target!", 0, 20, scale/1.5)
love.graphics.setColor(255, 255, 255)
end
end
if landing then
draw(arrowimg, math.max(8, landingx-(timeleft/landingtime)*80), 67, 0, 1, 1, 8)
draw(arrowimg, math.min(91, landingx+(timeleft/landingtime)*80), 67, 0, -1, 1, 9)
end
end
function scene5_action()
if not sunglasses then
sunglasses = true
awesometimer = 1
pointsget(1000)
sunglassessound:play()
end
end
|
return {'live','liveact','livealbum','liveband','liveconcert','livemuziek','liveopname','liveoptreden','liveprogramma','liveshow','livetelevisie','living','livrei','livreibediende','livreiknecht','livret','liv','livia','livio','livingstone','liveacts','liveopnamen','liveopnames','liveprogrammas','livreibedienden','livreien','livreiknechten','livrets','liveoptredens','lives','liveshows','livings','livreitje','livs','livias','livios'}
|
--love-polyfill version 1.2.0
--Implements 0.9.3 features and bugfixes into 0.9.2
--Lucien Greathouse (LPGhatguy)
local ffi = require("ffi")
--SDL headers we use
ffi.cdef([[
typedef struct SDL_Window SDL_Window;
SDL_Window *SDL_GL_GetCurrentWindow(void);
void SDL_MaximizeWindow(SDL_Window *window);
]])
--PhysFS headers we use
ffi.cdef([[
void PHYSFS_permitSymbolicLinks(int allow);
int PHYSFS_symbolicLinksPermitted();
int PHYSFS_isSymbolicLink(const char *fname);
]])
local liblove = (ffi.os == "Windows") and ffi.load("love") or ffi.C
local sdl = (ffi.os == "Windows") and ffi.load("SDL2") or ffi.C
if (not love) then
error("love-polyfill requires love to be loaded and in the global namespace", 2)
end
if (love.polyfill_0_9_3) then
return print("Skipping love-polyfill 0.9.3 load, 0.9.3 polyfill already loaded")
end
love.polyfill_0_9_3 = true
love.polyfill = {
version = {1, 2, 0},
versionCode = 6,
target = "0.9.2",
emulating = "0.9.3"
}
--Window additions
if (love.window) then
-- 0.9.2 was supposed to ship with this, but didn't.
love.window.maximize = love.window.maximize or function()
sdl.SDL_MaximizeWindow(sdl.SDL_GL_GetCurrentWindow())
end
end
-- 0.9.2 has a couple broken methods
if (love.graphics) then
-- Bugfix: 0.9.x's getColorMask doesn't return the correct state
local setcm = love.graphics.setColorMask
local valuecm = {true, true, true, true}
function love.graphics.getColorMask()
return valuecm[1], valuecm[2], valuecm[3], valuecm[4]
end
function love.graphics.setColorMask(r, g, b, a)
valuecm[1] = r
valuecm[2] = g
valuecm[3] = b
valuecm[4] = a
setcm(r, g, b, a)
end
end
if (love._version_revision == 2 and love.keyboard) then
--Bugfix: 0.9.2's getKeyFromScancode crashes on invalid scancodes
local scancode_list = {
"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",
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
"capslock", "return", "escape", "backspace", "tab", "space",
"-", "=", "[", "]", "\\", "nonus#", ";", "'", "`", ",", ".", "/", "=",
"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12",
"f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f34",
"printscreen", "scrolllock", "pause", "sysreq",
"insert", "home", "pageup", "delete", "end", "pagedown",
"right", "left", "down", "up",
"numlock", "kp/", "kp*", "kp-", "kp+", "kpenter",
"kp1", "kp2", "kp3", "kp4", "kp5", "kp6", "kp7", "kp8", "kp9", "kp0", "kp.",
"kp00", "kp000", "kp(", "kp)", "kp{", "kp}", "kptab", "kpbackspace",
"kpa", "kpb", "kpc", "kpd", "kpe", "kpf",
"kpxor", "kpower", "kp%", "kp<", "kp>", "kp&", "kp&&", "kp|", "kp||", "kp:", "kp#", "kp[SPACE]", "kp@", "kp!",
"kpmemstore", "kpmemrecall", "kpmemclear", "kpmem+", "kpmem-", "kpmem*", "kpmem/", "kp+-",
"kpclear", "kpclearentry", "kpbinary", "kpoctal", "kpdecimal", "kphex",
"lctrl", "lshift", "lalt", "lgui", "rctrl", "rshift", "ralt", "rgui",
"mode",
"audionext", "audioprev", "audiostop", "audioplay", "audiomute", "mediaselect",
"www", "mail", "calculator", "computer",
"acsearch", "achome", "acback", "acforward", "acstop", "acrefresh", "acbookmarks",
"brightnessdown", "brightnessup", "displayswitch",
"kbdillumtoggle", "kbdillumup",
"eject", "sleep", "app1", "app2",
"nonusbackslash", "application", "power",
"execute", "help", "menu", "select",
"stop", "again", "undo", "cut", "copy", "paste", "find", "mute", "volumeup", "volumedown", "kp", "kp=400",
"international1", "international2", "international3", "international4", "international5",
"international6", "international7", "international8", "international9",
"lang1", "lang2", "lang3", "lang4", "lang5", "lang6", "lang7", "lang8", "lang9",
"alterase", "cancel", "clear", "prior", "return2", "separator", "out", "oper", "clearagain", "crsel", "exsel",
"thousandsseparator", "decimalseparator", "currencyunit", "currencysubunit",
}
local scancode_set = {}
for key in ipairs(scancode_list) do
scancode_set[key] = true
end
local gkfs = love.keyboard.getKeyFromScancode
function love.keyboard.getKeyFromScancode(scancode)
if (scancode_set[scancode]) then
return gkfw(scancode)
else
return "unknown"
end
end
end
|
local function clamp(x, x1, x2)
return math.min(math.max(x, x1), x2)
end
local function squaredDistance(x1, y1, x2, y2)
return (x2 - x1) ^ 2 + (y2 - y1) ^ 2
end
local function distance(x1, y1, x2, y2)
return math.sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2)
end
local function sign(x)
return x < 0 and -1 or 1
end
local function get2(t, x, y)
return t[y] and t[y][x]
end
local function set2(t, x, y, value)
if value == nil then
if t[y] then
t[y][x] = nil
if not next(t[y]) then
t[y] = nil
end
end
else
t[y] = t[y] or {}
t[y][x] = value
end
end
local function toByte(fraction)
return clamp(math.floor(fraction * 256), 0, 255)
end
local function toByteColor(r, g, b, a)
return toByte(r), toByte(g), toByte(b), toByte(a)
end
local function keys(t)
local ks = {}
for k, v in pairs(t) do
table.insert(ks, k)
end
return ks
end
local function values(t)
local vs = {}
for k, v in pairs(t) do
table.insert(vs, v)
end
return vs
end
local function filter(t, f)
local result = {}
for i, v in ipairs(t) do
if f(v) then
table.insert(result, v)
end
end
return result
end
return {
clamp = clamp,
distance = distance,
get2 = get2,
filter = filter,
keys = keys,
set2 = set2,
sign = sign,
squaredDistance = squaredDistance,
toByte = toByte,
toByteColor = toByteColor,
values = values,
}
|
--
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
local pcall = pcall
local require = require
local core = require("apisix.core")
local _M = {
}
local function validate_plugin(name)
local pkg_name = "apisix.plugins." .. name
local ok, plugin_object = pcall(require, pkg_name)
if ok then
return true, plugin_object
end
pkg_name = "apisix.stream.plugins." .. name
return pcall(require, pkg_name)
end
local function check_conf(plugin_name, conf)
if not plugin_name then
return nil, {error_msg = "missing plugin name"}
end
local ok, plugin_object = validate_plugin(plugin_name)
if not ok then
return nil, {error_msg = "invalid plugin name"}
end
local schema = plugin_object.metadata_schema
if not schema then
return nil, {error_msg = "no metadata schema for plugin " .. plugin_name}
end
if not conf then
return nil, {error_msg = "missing configurations"}
end
core.log.info("schema: ", core.json.delay_encode(schema))
core.log.info("conf : ", core.json.delay_encode(conf))
local ok, err = core.schema.check(schema, conf)
if not ok then
return nil, {error_msg = "invalid configuration: " .. err}
end
return plugin_name
end
function _M.put(plugin_name, conf)
local plugin_name, err = check_conf(plugin_name, conf)
if not plugin_name then
return 400, err
end
local key = "/plugin_metadata/" .. plugin_name
core.log.info("key: ", key)
local res, err = core.etcd.set(key, conf)
if not res then
core.log.error("failed to put plugin metadata[", key, "]: ", err)
return 500, {error_msg = err}
end
return res.status, res.body
end
function _M.get(key)
local path = "/plugin_metadata"
if key then
path = path .. "/" .. key
end
local res, err = core.etcd.get(path)
if not res then
core.log.error("failed to get metadata[", key, "]: ", err)
return 500, {error_msg = err}
end
return res.status, res.body
end
function _M.post(key, conf)
return 400, {error_msg = "not support `POST` method for metadata"}
end
function _M.delete(key)
if not key then
return 400, {error_msg = "missing metadata key"}
end
local key = "/plugin_metadata/" .. key
local res, err = core.etcd.delete(key)
if not res then
core.log.error("failed to delete metadata[", key, "]: ", err)
return 500, {error_msg = err}
end
return res.status, res.body
end
return _M
|
local Util = {}
Util.safeDestroy = function(object)
if object.body:isDestroyed() == false then
object.body:destroy()
end
if object.fixture:isDestroyed() == false then
object.fixture:destroy()
end
end
Util.deepcopy = function(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[Util.deepcopy(orig_key)] = Util.deepcopy(orig_value)
end
setmetatable(copy, Util.deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
Util.scrambleTable = function(t)
local copy = Util.deepcopy(t)
local scrambled = {}
while #copy ~= 0 do
local size = #copy
local randomNumber = love.math.random(size)
table.insert(scrambled, table.remove(copy, randomNumber))
end
return scrambled
end
Util.printTable = function(t)
for _, v in pairs(t) do
if type(v) == "table" then
Util.printTable(v)
else
print(v)
end
end
end
return Util
|
Objects = {
createObject ( 11149, 3147.0029, -738.26074, 10.4, 0, 0, 90 ),
createObject ( 10815, 3008.9004, -788.90039, 7.7, 0, 0, 44.995 ),
createObject ( 10771, 3141.7998, -732.2002, 3.9, 0, 0, 90 ),
createObject ( 11145, 3141.7998, -795.09961, 2.7, 0, 0, 90 ),
createObject ( 11146, 3141.2559, -741.2002, 10.78133, 0, 0, 90 ),
createObject ( 10770, 3149.3379, -728.91113, 37.1, 0, 0, 90 ),
createObject ( 3114, 3126.7002, -788.96973, 8.134, 0, 0, 90 ),
createObject ( 16096, 2907.8, -774.5, 12.1, 0, 0, 179.995 ),
createObject ( 8661, 3130.8916, -776.59998, -2.5, 90, 90, 0 ),
createObject ( 8661, 3130.8916, -739.7002, -2.5, 90, 90, 0 ),
createObject ( 10772, 3142, -730.90002, 15.7, 0, 0, 90 ),
createObject ( 11237, 3149.3401, -729.09998, 37.1, 0, 0, 90 ),
createObject ( 8661, 3107.7998, -778.40039, -1.5, 90, 90, 90 ),
createObject ( 8661, 3067.7998, -778.40039, 2.8, 90, 90, 90 ),
createObject ( 8661, 3027.8, -778.40002, 3.5, 90, 90, 90 ),
createObject ( 8661, 2987.8999, -778.40002, 4, 90, 90, 90 ),
createObject ( 8661, 2947.8999, -778.40002, 2.9, 90, 90, 90 ),
createObject ( 8661, 2908.7, -778.59998, -2.5, 90, 90, 90 ),
createObject ( 3578, 3150.3999, -767.79999, 8 ),
createObject ( 8661, 3107.8, -799.59998, -1.5, 90, 90, 90 ),
createObject ( 8661, 3067.8999, -799.59998, 2.8, 90, 90, 90 ),
createObject ( 8661, 3028, -799.59998, 4.5, 90, 90, 90 ),
createObject ( 8661, 2988, -799.59998, 3.3, 90, 90, 90 ),
createObject ( 3578, 3150.3999, -786.20001, 8 ),
createObject ( 8661, 2948, -799.59998, 2.8, 90, 90, 90 ),
createObject ( 3578, 3150.3999, -776.5, 8 ),
createObject ( 8661, 2908.6001, -799.29999, -2.5, 90, 90, 90 ),
createObject ( 3578, 3150.3999, -795.79999, 8 ),
createObject ( 9819, 3149.2, -723.79999, 9.5, 0, 0, 270 ),
createObject ( 9822, 3148.7, -723.29999, 9.3, 0, 0, 270 ),
createObject ( 2922, 3145.8999, -715, 10.2 ),
createObject ( 3115, 3141.8, -831.20001, 15.4, 0, 0, 90 ),
createObject ( 3388, 3142.7, -703.5, 8.7 ),
createObject ( 2887, 3123.3, -797.70001, 11.3 ),
createObject ( 2634, 3150.8999, -714.79999, 10.3 ),
createObject ( 3785, 3150.1001, -667, 11.3 ),
createObject ( 3785, 3142.3, -705.40002, 12.9 ),
createObject ( 1893, 3151.8, -664, 14.6 ),
createObject ( 3785, 3141.8999, -719.90002, 11.9 ),
createObject ( 14699, 3148.8, -715, 12.7 ),
createObject ( 1893, 3151.8, -665.29999, 14.6 ),
createObject ( 1893, 3151.8, -666.59998, 14.6 ),
createObject ( 1893, 3151.8, -667.90002, 14.6 ),
createObject ( 1893, 3151.8, -669, 14.6 ),
createObject ( 1893, 3151.8, -670.09998, 14.6 ),
createObject ( 3526, 3149, -743.20001, 8.7, 0, 0, 270 ),
createObject ( 3526, 3145.6001, -743.20001, 8.7, 0, 0, 270 ),
createObject ( 2773, 3152.1001, -713.79999, 9.2 ),
createObject ( 2773, 3149.7, -713.79999, 9.2 ),
createObject ( 10757, 3119.5, -790.09998, 17.8, 0, 10.5, 287.241 ),
createObject ( 3385, 3153.7002, -671.7998, 8.7 ),
createObject ( 3385, 3151.4004, -671.7998, 8.7 ),
createObject ( 3395, 3152.3, -694.70001, 8.7, 0, 0, 90.25 ),
createObject ( 2690, 3142.8, -725, 10.3 ),
createObject ( 8674, 3134, -841.7002, 17.1 ),
createObject ( 8674, 3141.7, -841.70001, 17.1 ),
createObject ( 8674, 3149.3999, -841.70001, 17.1 ),
createObject ( 2944, 3128.8457, -740.2998, 10.2 ),
createObject ( 2887, 3123.2, -780.5, 11.3, 0, 0, 180 ),
createObject ( 3388, 3154.3999, -714.5, 8.7, 0, 0, 90.25 ),
createObject ( 16501, 3146.7998, -694, 8.8, 0, 0, 90 ),
createObject ( 16501, 3146.7998, -694, 13, 0, 0, 90 ),
createObject ( 3383, 3151.9004, -715.90039, 8.6, 0, 0, 179.742 ),
createObject ( 3397, 3153.5, -720.59998, 8.6 ),
createObject ( 16501, 3142.7, -792.5, 0.8 ),
createObject ( 3383, 3153.6001, -717, 8.6, 0, 0, 89.745 ),
createObject ( 3396, 3148.2002, -715.7002, 8.6, 0, 0, 89.747 ),
createObject ( 1502, 3142.7561, -788.96997, 0.5, 0, 0, 90 ),
createObject ( 1580, 3153, -717.40002, 9.7 ),
createObject ( 16501, 3142.7, -783.90002, 0.8 ),
createObject ( 16501, 3142.7002, -792.5, 5.2 ),
createObject ( 1580, 3153.6001, -717.40002, 9.7 ),
createObject ( 1579, 3153.6001, -717, 9.7 ),
createObject ( 1579, 3153, -717, 9.7 ),
createObject ( 16501, 3142.7, -785.40002, 5.2 ),
createObject ( 1654, 3150.3999, -715.59998, 9.86 ),
createObject ( 1502, 3142.7561, -780.37, 0.5, 0, 0, 90 ),
createObject ( 2036, 3152, -715.5, 9.7 ),
createObject ( 2035, 3151.8999, -716.09998, 9.7 ),
createObject ( 2044, 3152.1001, -715.79999, 9.7 ),
createObject ( 2058, 3153.3, -715.79999, 9.7 ),
createObject ( 2690, 3152.8, -715.40002, 10 ),
createObject ( 16501, 3142.7, -775.29999, 0.8 ),
createObject ( 2061, 3153.2, -716.70001, 10.2 ),
createObject ( 16501, 3142.7, -768.20001, 0.8 ),
createObject ( 1502, 3142.7561, -764.70001, 0.5, 0, 0, 90 ),
createObject ( 1672, 3153.6001, -717.79999, 9.74 ),
createObject ( 16501, 3142.7, -778.29999, 5.2 ),
createObject ( 1550, 3153.7, -718.5, 10 ),
createObject ( 16501, 3142.7, -771.20001, 5.2 ),
createObject ( 16501, 3142.7, -764.09998, 5.2 ),
createObject ( 16501, 3142.7, -759.70001, 0.8 ),
createObject ( 16501, 3142.7, -757.09998, 5.2 ),
createObject ( 16501, 3142.7, -752.70001, 0.8 ),
createObject ( 1654, 3150.3999, -715.90002, 9.9 ),
createObject ( 1654, 3150.3999, -716.20001, 9.9 ),
createObject ( 1654, 3150.7, -716.20001, 9.9 ),
createObject ( 16501, 3142.7, -750, 5.2 ),
createObject ( 1654, 3150.7, -715.90002, 9.9 ),
createObject ( 1654, 3150.7, -715.59998, 9.9 ),
createObject ( 1654, 3151, -715.90002, 9.9 ),
createObject ( 1654, 3151, -715.59998, 9.9 ),
createObject ( 1654, 3151, -716.20001, 9.9 ),
createObject ( 16501, 3139.1001, -795.90002, 5.2, 0, 0, 270 ),
createObject ( 16501, 3132, -795.90002, 5.2, 0, 0, 270 ),
createObject ( 1672, 3153.3999, -717.79999, 9.74 ),
createObject ( 1672, 3153.2, -717.79999, 9.74 ),
createObject ( 1672, 3153.2, -718, 9.74 ),
createObject ( 1672, 3153.3999, -718, 9.74 ),
createObject ( 1672, 3153.6001, -718, 9.74 ),
createObject ( 16501, 3139.1006, -795.90039, 0.8, 0, 0, 270 ),
createObject ( 16501, 3132, -795.90039, 0.8, 0, 0, 270 ),
createObject ( 16501, 3139.1001, -793.59998, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132, -793.59998, 4.7, 0, 90, 270 ),
createObject ( 3383, 3152.5, -715.90002, 13.3, 0, 180, 179.747 ),
createObject ( 16501, 3139.2002, -789.2002, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139.1001, -761.56, 5.2, 0, 0, 90 ),
createObject ( 3383, 3153.6001, -717.59998, 13.3, 0, 179.995, 90.747 ),
createObject ( 16501, 3132, -761.56, 5.2, 0, 0, 90 ),
createObject ( 3383, 3149.8999, -715.90002, 13.3, 0, 179.995, 179.747 ),
createObject ( 3383, 3153.6001, -720.09998, 13.3, 0, 179.995, 89.747 ),
createObject ( 16501, 3140.5, -761.56, -0.54, 90, 0, 90 ),
createObject ( 16501, 3133.3, -761.56, 0.8, 0, 0, 90 ),
createObject ( 16501, 3139.2, -784.79999, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139.2, -780.40002, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139.2, -776, 4.7, 0, 90, 270 ),
createObject ( 3383, 3153.6001, -722.70001, 13.3, 0, 179.995, 89.742 ),
createObject ( 3383, 3151.3999, -724.40002, 13.3, 0, 179.995, 359.492 ),
createObject ( 3383, 3148.8, -724.40002, 13.3, 0, 179.995, 0.239 ),
createObject ( 3383, 3147.7, -715.90002, 13.3, 0, 179.995, 179.747 ),
createObject ( 16501, 3139.2, -771.59998, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139.2, -767.20001, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139.2, -762.79999, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -789.20001, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -784.79999, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -780.40002, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -776, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -771.59998, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -767.20001, 4.7, 0, 90, 270 ),
createObject ( 16501, 3132.1001, -762.79999, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139.1001, -787.29999, 5.2, 0, 0, 270 ),
createObject ( 16501, 3132.1001, -787.29999, 5.2, 0, 0, 270 ),
createObject ( 16501, 3139.1006, -787.2998, 0.8, 0, 0, 270 ),
createObject ( 1502, 3134.1001, -787.35553, 0.5 ),
createObject ( 16501, 3139.1006, -778.7002, 0.8, 0, 0, 270 ),
createObject ( 16501, 3132.1006, -778.7002, 0.8, 0, 0, 270 ),
createObject ( 16501, 3132.1006, -778.7002, 5.2, 0, 0, 270 ),
createObject ( 16501, 3139.1006, -778.7002, 5.2, 0, 0, 270 ),
createObject ( 3026, 3012.8, -752.79999, 9.2 ),
createObject ( 2611, 3140.2, -778.5, 3, 0, 0, 180.25 ),
createObject ( 2612, 3140.2, -778.5, 1.8, 0, 0, 180 ),
createObject ( 2737, 3133.6001, -778.5, 3.2, 0, 0, 180 ),
createObject ( 3108, 3148.3, -684.70001, 15.7 ),
createObject ( 5171, 3135.6006, -783.2002, 1, 0, 0, 179.995 ),
createObject ( 2616, 3133.6001, -778.5, 1.7, 0, 0, 180 ),
createObject ( 2614, 3137.2002, -778.5, 3.4, 0, 0, 179.995 ),
createObject ( 18036, 3137.3999, -681.90002, 10.7, 0, 0, 270 ),
createObject ( 2205, 3136.2002, -774.59961, 0.5 ),
createObject ( 2205, 3138.5, -774.578, 0.5, 0, 0, 270 ),
createObject ( 2205, 3135.26, -775.94, 0.5, 0, 0, 90 ),
createObject ( 16501, 3142.5, -693.59998, 9, 0, 0, 90 ),
createObject ( 16501, 3135.5, -693.59998, 9, 0, 0, 90 ),
createObject ( 16501, 3139.4004, -693.59961, 13.4, 0, 0, 90 ),
createObject ( 16501, 3132.3999, -693.59998, 13.4, 0, 0, 90 ),
createObject ( 1714, 3136.9004, -776.2002, 0.5, 0, 0, 179.995 ),
createObject ( 1726, 3132.3999, -771.09998, 0.4 ),
createObject ( 1726, 3135.8, -771.09998, 0.4 ),
createObject ( 1502, 3130.4297, -693.59961, 8.68 ),
createObject ( 1726, 3139.3, -771.09998, 0.4 ),
createObject ( 1726, 3139.3, -768, 0.4 ),
createObject ( 1726, 3135.7998, -768, 0.4 ),
createObject ( 1726, 3132.4004, -768, 0.4 ),
createObject ( 2164, 3135.4004, -761.7002, 0.5 ),
createObject ( 14638, 3129.1001, -693.5, 8.7, 0, 0, 268.5 ),
createObject ( 2164, 3139, -761.70001, 0.5 ),
createObject ( 2164, 3141.1001, -761.70001, 0.5 ),
createObject ( 2161, 3142.7, -776.90002, 1.9, 0, 0, 270 ),
createObject ( 2161, 3142.7002, -775.5, 1.9, 0, 0, 270 ),
createObject ( 2197, 3132.2, -777, 0.5, 0, 0, 90 ),
createObject ( 2197, 3132.2, -775.29999, 0.5, 0, 0, 90 ),
createObject ( 2332, 3131.3, -776.09998, 1.8, 0, 0, 90 ),
createObject ( 1583, 3132.2, -674.70001, 8.7 ),
createObject ( 1583, 3137, -674.70001, 8.7 ),
createObject ( 1583, 3140.7, -677.70001, 8.7 ),
createObject ( 1583, 3134.3999, -682.20001, 8.7 ),
createObject ( 1583, 3142.1001, -685, 8.7 ),
createObject ( 1583, 3144.1001, -672.79999, 8.7 ),
createObject ( 1583, 3140.6001, -683.79999, 8.7 ),
createObject ( 1583, 3132.1001, -683.79999, 8.7 ),
createObject ( 1585, 3134.2, -683.09998, 8.7 ),
createObject ( 2332, 3131.3, -776.09998, 0.9, 0, 0, 90 ),
createObject ( 1585, 3133, -676.59998, 8.7 ),
createObject ( 1585, 3143.8, -675.59998, 8.7 ),
createObject ( 2163, 3131, -776.59998, 2.9, 0, 0, 90 ),
createObject ( 1585, 3141.3999, -681, 8.7 ),
createObject ( 1588, 3137, -674.79999, 9.4 ),
createObject ( 1588, 3132.2, -674.79999, 9.3 ),
createObject ( 1588, 3144, -672.90002, 9.4 ),
createObject ( 1588, 3134.3999, -682.29999, 9.4 ),
createObject ( 1588, 3132.2, -683.90002, 9.4 ),
createObject ( 1588, 3140.7, -677.79999, 9.4 ),
createObject ( 1588, 3140.6001, -683.90002, 9.4 ),
createObject ( 1588, 3142.1001, -685.09998, 9.4 ),
createObject ( 1583, 3138.3, -680.70001, 8.7 ),
createObject ( 1588, 3138.3, -680.79999, 9.4 ),
createObject ( 18608, 3136.7, -774.59998, 5.4 ),
createObject ( 3796, 3146.1001, -697.09998, 8.7, 0, 0, 52 ),
createObject ( 2985, 3135.5, -708.29999, 8.7, 0, 0, 270 ),
createObject ( 3633, 3146, -695.70001, 9.3, 0, 0, 322 ),
createObject ( 3633, 3147, -696.5, 9.3, 0, 0, 321.998 ),
createObject ( 3632, 3145.2, -696.29999, 9.3 ),
createObject ( 3632, 3144.8, -696.79999, 9.3 ),
createObject ( 3800, 3145.8999, -697.79999, 8.8 ),
createObject ( 3095, 3128.7998, -700.09961, 9.4, 90, 90, 179.995 ),
createObject ( 16662, 3137.1006, -747.90039, 1.4, 0, 0, 333.495 ),
createObject ( 16501, 3139, -758.40002, 4.7, 0, 90, 270 ),
createObject ( 16501, 3139, -754, 4.7, 0, 90, 270 ),
createObject ( 16501, 3131.8999, -758.40002, 4.7, 0, 90, 270 ),
createObject ( 16501, 3131.8999, -754, 4.7, 0, 90, 270 ),
createObject ( 16501, 3138.8, -751.90002, 0.8, 0, 0, 90 ),
createObject ( 16501, 3131.8, -751.90002, 0.8, 0, 0, 90 ),
createObject ( 16501, 3131.7998, -751.90039, 5.2, 0, 0, 90 ),
createObject ( 16501, 3138.7998, -751.90039, 5.2, 0, 0, 90 ),
createObject ( 1502, 3136.8, -761.56, 0.48 ),
createObject ( 1726, 3132.3, -762.20001, 0.4 ),
createObject ( 2164, 3131, -763.90002, 0.5, 0, 0, 90 ),
createObject ( 3114, 3126.7002, -789, 15.14, 0, 0, 90 ),
createObject ( 2205, 3133.3999, -792.20001, 0.5, 0, 0, 270 ),
createObject ( 2205, 3132.46, -793.534, 0.5, 0, 0, 179.5 ),
createObject ( 1714, 3132, -791.09998, 0.5, 0, 0, 67.995 ),
createObject ( 2205, 3133.3999, -790, 0.5, 0, 0, 270 ),
createObject ( 2161, 3130.8, -791.90002, 1.9, 0, 0, 90 ),
createObject ( 2161, 3130.7998, -790.59961, 1.9, 0, 0, 90 ),
createObject ( 2197, 3132.3, -795, 0.5, 0, 0, 90 ),
createObject ( 2164, 3137.1006, -787.40039, 0.5 ),
createObject ( 2164, 3140.3, -787.40002, 0.5 ),
createObject ( 2332, 3131.5, -793.59998, 1.9, 0, 0, 90 ),
createObject ( 2163, 3136.2998, -787.2998, 2.9, 0, 0, 359.495 ),
createObject ( 2163, 3138, -787.29999, 2.9, 0, 0, 359.495 ),
createObject ( 2163, 3139.7, -787.29999, 2.9, 0, 0, 359.495 ),
createObject ( 1726, 3142.1006, -791.09961, 0.4, 0, 0, 270 ),
createObject ( 1726, 3138.8, -795.29999, 0.4, 0, 0, 180 ),
createObject ( 2161, 3135.1001, -795.90002, 1.9, 0, 0, 178.75 ),
createObject ( 2161, 3141, -795.90039, 1.9, 0, 0, 178.748 ),
createObject ( 2161, 3142.7002, -789.7002, 1.9, 0, 0, 270.747 ),
createObject ( 1722, 3134.5, -793.09998, 0.5 ),
createObject ( 1722, 3134.5, -790, 0.5, 0, 0, 179.995 ),
createObject ( 2193, 3131.3999, -788.90002, 0.5 ),
createObject ( 2007, 3133.5, -787.90039, 0.5 ),
createObject ( 2606, 3137.2002, -778.5, 2.5, 0, 0, 179.995 ),
createObject ( 3498, 3142.1001, -693.79999, 10.9 ),
createObject ( 1622, 3120.7, -781.5, 16 ),
createObject ( 2161, 3130.8, -785.29999, 1.9, 0, 0, 90 ),
createObject ( 2179, 3155.8, -833.5, 10.3 ),
createObject ( 2161, 3130.8, -780.70001, 1.9, 0, 0, 90 ),
createObject ( 2164, 3130.8, -783.20001, 0.5, 0, 0, 90 ),
createObject ( 1726, 3142.1001, -782.70001, 0.4, 0, 0, 269.5 ),
createObject ( 2179, 3155.8, -831.20001, 6.6, 90, 0, 0 ),
createObject ( 2179, 3155.8, -831.20001, 12.9, 90, 0, 0 ),
createObject ( 1726, 3137, -779.29999, 0.4, 0, 0, 359.995 ),
createObject ( 2179, 3155.8, -827.40002, 11.3, 45, 0, 0 ),
createObject ( 2163, 3139, -778.70001, 2.9, 0, 0, 359.495 ),
createObject ( 2163, 3133.1001, -787.20001, 2.9, 0, 0, 180 ),
createObject ( 2179, 3155.8, -825.79999, 11.3, 315, 0, 0 ),
createObject ( 2163, 3133.8999, -778.70001, 2.9, 0, 0, 359.495 ),
createObject ( 2179, 3155.8999, -826.59998, 8.1 ),
createObject ( 1722, 3132.6001, -781.09998, 0.5, 0, 0, 269.745 ),
createObject ( 2179, 3155.8, -833.5, 8.1 ),
createObject ( 1722, 3134.6001, -781.20001, 0.5, 0, 0, 89.742 ),
createObject ( 2179, 3155.8999, -823.29999, 10.7 ),
createObject ( 2179, 3155.8999, -823.29999, 8 ),
createObject ( 2179, 3155.8999, -820.90002, 6.6, 90, 0, 0 ),
createObject ( 2161, 3139.5, -787.29999, 1.9, 0, 0, 178.748 ),
createObject ( 2179, 3155.8, -819.5, 8 ),
createObject ( 2161, 3142.7, -783.59998, 1.9, 0, 0, 268.748 ),
createObject ( 2179, 3155.8, -820.90002, 10.4, 90, 0, 0 ),
createObject ( 2007, 3135.5, -779.20001, 0.5 ),
createObject ( 2179, 3155.8, -818.40002, 10.7 ),
createObject ( 2179, 3155.8, -818.40002, 7.9 ),
createObject ( 2007, 3132.8, -786.79999, 0.5, 0, 0, 180 ),
createObject ( 2179, 3155.8999, -816.09998, 13.1, 90, 0, 0 ),
createObject ( 2179, 3155.8, -816.70001, 11.7, 300, 0, 0 ),
createObject ( 1726, 3141.6001, -755.79999, 0.4, 0, 0, 269.995 ),
createObject ( 2179, 3156, -814.79999, 7.6, 45, 0, 0 ),
createObject ( 2179, 3156.2, -816.29999, 9.2, 44.995, 0, 0 ),
createObject ( 1726, 3136, -761, 0.4, 0, 0, 179.995 ),
createObject ( 2179, 3155.8, -813, 7.9, 340, 0, 0 ),
createObject ( 2606, 3133.5, -761.29999, 2.5, 0, 0, 179.995 ),
createObject ( 2179, 3155.8, -810.29999, 10.7, 20, 0, 0 ),
createObject ( 2179, 3155.7998, -812, 10.7, 339.999, 0, 0 ),
createObject ( 2179, 3155.8, -809.29999, 8, 19.995, 0, 0 ),
createObject ( 2179, 3155.8999, -810.70001, 8.7, 90, 0, 0 ),
createObject ( 2179, 3155.8, -807.20001, 7.9, 325, 0, 0 ),
createObject ( 2179, 3155.8999, -805.09998, 11, 324.998, 0, 0 ),
createObject ( 2179, 3156.1001, -806.90002, 11, 35, 0, 0 ),
createObject ( 2179, 3155.8999, -804.70001, 7.8, 34.997, 0, 0 ),
createObject ( 2164, 3133.3999, -752, 0.5 ),
createObject ( 2164, 3139.1001, -752, 0.5 ),
createObject ( 2161, 3130.8, -759.70001, 1.9, 0, 0, 90 ),
createObject ( 2161, 3130.7, -753.79999, 1.9, 0, 0, 90 ),
createObject ( 2164, 3130.8, -756.90002, 0.5, 0, 0, 88.5 ),
createObject ( 2161, 3136.5, -751.90002, 1.9, 0, 0, 1.5 ),
createObject ( 2161, 3142.1001, -754.79999, 1.9, 0, 0, 271.5 ),
createObject ( 2161, 3142.1001, -758.70001, 1.9, 0, 0, 271.494 ),
createObject ( 2007, 3135.2, -752.29999, 0.5 ),
createObject ( 2007, 3132.3999, -752.29999, 0.5 ),
createObject ( 2007, 3138.1001, -752.40002, 0.5 ),
createObject ( 2007, 3140.8999, -752.40002, 0.5 ),
createObject ( 2007, 3131.2, -757.90002, 0.5, 0, 0, 90 ),
createObject ( 2007, 3131.2, -755.20001, 0.5, 0, 0, 90 ),
createObject ( 2163, 3130.5, -756.90002, 2.9, 0, 0, 89.495 ),
createObject ( 2163, 3142.3, -756.5, 2.9, 0, 0, 269.745 ),
createObject ( 3884, 3144.7, -706.79999, 26.9, 0, 0, 36 ),
createObject ( 3884, 3154, -706.2002, 27, 0, 0, 306.744 ),
createObject ( 3884, 3149.7, -759.29999, 27.9, 0, 0, 116.997 ),
createObject ( 3884, 3127.2, -802.09998, 13.5, 0, 0, 111.496 ),
createObject ( 3884, 3153.2, -839.79999, 15.2, 0, 0, 312.495 ),
createObject ( 3884, 3130.7, -839.09998, 15.2, 0, 0, 52.495 ),
createObject ( 16501, 3130.6001, -787.29999, 0.8, 0, 0, 270 ),
createObject ( 626, 3141.7002, -777.7998, 2.5 ),
createObject ( 626, 3131.8, -762.20001, 2.5 ),
createObject ( 626, 3132, -778, 2.5 ),
createObject ( 628, 3131.8, -760.59998, 2.5 ),
createObject ( 628, 3141.3, -760.59998, 2.5 ),
createObject ( 631, 3131.3999, -752.5, 1.4 ),
createObject ( 631, 3141.6001, -753.09998, 1.4 ),
createObject ( 638, 3143.1001, -786, 1.1 ),
createObject ( 638, 3143.1001, -790.40002, 1.1 ),
createObject ( 638, 3143.1001, -781.79999, 1.1 ),
createObject ( 638, 3143.1001, -777.5, 1.1 ),
createObject ( 638, 3143.1001, -766.09998, 1.1 ),
createObject ( 638, 3144.2, -762.20001, 1.1, 0, 0, 90 ),
createObject ( 626, 3148.8, -762.29999, 2.5 ),
createObject ( 626, 3154.5, -795.29999, 2.5 ),
createObject ( 10632, 3139.2, -693.79999, 12.5, 0, 0, 270 ),
createObject ( 3383, 3147.8999, -762.5, -1.6, 0, 0, 89.747 ),
createObject ( 3383, 3144.3, -765, -1.6, 0, 0, 359.747 ),
createObject ( 3383, 3145.2, -766.5, -1.6, 0, 0, 269.992 ),
createObject ( 3383, 3145.2, -768.70001, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145.2, -771.09998, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145.2, -773.29999, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145.2, -775.5, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145.2, -777.70001, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3143.7, -778.59998, -1.6, 0, 0, 179.989 ),
createObject ( 3383, 3144.2, -780.70001, -1.6, 0, 0, 359.984 ),
createObject ( 3383, 3145.1001, -782.20001, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145.1001, -784.40002, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145.1001, -786.20001, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3143.6001, -787.09998, -1.6, 0, 0, 179.989 ),
createObject ( 3383, 3144.1001, -789.20001, -1.6, 0, 0, 359.984 ),
createObject ( 3383, 3145, -790.70001, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145, -792.90002, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3145, -795.09998, -1.6, 0, 0, 269.989 ),
createObject ( 3383, 3143.5, -796, -1.6, 0, 0, 179.989 ),
createObject ( 3383, 3147.8999, -764.70001, -1.6, 0, 0, 89.747 ),
createObject ( 3383, 3147.8999, -766.90002, -1.6, 0, 0, 89.747 ),
createObject ( 3383, 3147.8999, -769.09998, -1.6, 0, 0, 89.747 ),
createObject ( 3383, 3147.8999, -771.29999, -1.6, 0, 0, 89.747 ),
createObject ( 3383, 3147.8999, -773.5, -1.6, 0, 0, 89.747 ),
createObject ( 3383, 3147.8999, -775.70001, -1.6, 0, 0, 89.997 ),
createObject ( 3383, 3147.8999, -777.90002, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -780.09998, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -782.29999, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -784.5, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -786.70001, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -788.90002, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -791.09998, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -793.29999, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3147.8999, -795.5, -1.6, 0, 0, 89.995 ),
createObject ( 3383, 3148.8, -797, -1.6, 0, 0, 179.745 ),
createObject ( 3383, 3151, -797, -1.6, 0, 0, 179.742 ),
createObject ( 3383, 3153.2, -797, -1.6, 0, 0, 179.492 ),
createObject ( 3095, 3155.25, -709.09998, 9.4, 90, 90, 0 ),
createObject ( 16501, 3121, -779.59998, 12.1, 90, 0, 0 ),
createObject ( 16501, 3123.1201, -777.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3127.3999, -777.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3123.1201, -777.48999, 5.2, 90, 0, 270 ),
createObject ( 16501, 3123.1201, -777.48999, -1.4, 90, 0, 270 ),
createObject ( 16501, 3126.6001, -777.5, 5.1, 90, 0, 270 ),
createObject ( 16501, 3126.6001, -777.5, -2, 90, 0, 270 ),
createObject ( 16501, 3121, -779.59998, 5.1, 90, 0, 0 ),
createObject ( 16501, 3121, -779.59998, 1.5, 90, 0, 0 ),
createObject ( 16501, 3121, -798.59998, 12.1, 90, 0, 0 ),
createObject ( 16501, 3123.1089, -800.71802, 12.1, 90, 0, 90 ),
createObject ( 16501, 3127.5, -800.71899, 12.1, 90, 0, 90 ),
createObject ( 16501, 3126.3999, -800.70001, 5.1, 90, 0, 90 ),
createObject ( 16501, 3123.1089, -800.71802, 5.1, 90, 0, 90 ),
createObject ( 16501, 3121, -798.59998, 5, 90, 0, 0 ),
createObject ( 16501, 3121, -798.59998, -1.6, 90, 0, 0 ),
createObject ( 16501, 3123.1101, -800.71802, -2, 90, 0, 90 ),
createObject ( 16501, 3126.3999, -800.70001, -1.9, 90, 0, 90 ),
createObject ( 16501, 3123.116, -797.255, 15.5666, 180, 90, 0 ),
createObject ( 16501, 3127.5, -797.255, 15.5666, 179.995, 90, 0 ),
createObject ( 16501, 3123.116, -790.20001, 15.5666, 179.995, 90, 0 ),
createObject ( 16501, 3123.116, -783.79999, 15.5666, 179.995, 90, 0 ),
createObject ( 16501, 3123.116, -780.95001, 15.5666, 179.995, 90, 0 ),
createObject ( 16501, 3127, -780.95001, 15.5666, 179.995, 90, 0 ),
createObject ( 16501, 3123.1201, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3127.3999, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3131.7, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3131.7, -800.71899, 12.1, 90, 0, 90 ),
createObject ( 16501, 3133.8201, -798.61102, 12, 90, 0, 180 ),
createObject ( 16501, 3123.1201, -781.71503, 12.1, 90, 0, 90 ),
createObject ( 16501, 3127.3999, -781.71503, 12.1, 90, 0, 90 ),
createObject ( 16501, 3131.7, -781.71503, 12.1, 90, 0, 90 ),
createObject ( 16501, 3131.7, -777.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3133.8201, -779.60498, 12, 90, 0, 179.995 ),
createObject ( 638, 3122.5, -800.20001, 16.4, 0, 0, 90 ),
createObject ( 638, 3125.2, -800.20001, 16.4, 0, 0, 90 ),
createObject ( 638, 3127.8999, -800.20001, 16.4, 0, 0, 90 ),
createObject ( 638, 3122.5, -777.90002, 16.4, 0, 0, 90 ),
createObject ( 638, 3125.2, -777.90002, 16.4, 0, 0, 90 ),
createObject ( 638, 3127.8999, -777.90002, 16.4, 0, 0, 90 ),
createObject ( 11014, 3149.8, -786.90002, 11, 0, 0, 270 ),
createObject ( 16501, 3136.1001, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3140.5, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3144.8, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3149.2, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 16501, 3153.5, -796.48999, 12.1, 90, 0, 270 ),
createObject ( 1892, 3133.8, -767.09998, 8.7 ),
createObject ( 2229, 3120.8999, -778.70001, 13.5, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -778.70001, 12.1, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -780.48499, 12.1, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -780.59998, 11.978, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -780.48499, 13.5, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -780.70001, 11.1, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -778.79999, 10.2, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -780.70001, 10.1, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -780.20001, 8.8, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -780.29999, 8.7, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -799.29999, 14.7, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -799.20001, 13.8, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -799.29999, 13.5, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -799.20001, 12.4, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -797.40002, 13.8, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -797.40002, 12.4, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -797.40002, 10.5, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -797.40002, 9.1, 0, 0, 90 ),
createObject ( 2229, 3120.8999, -799.29999, 11.4, 0, 90, 90 ),
createObject ( 2229, 3120.8999, -799.29999, 10.2, 0, 90, 90 ),
createObject ( 3578, 3126.1001, -781.59998, 8.9 ),
createObject ( 3578, 3128.7, -781.59998, 8.9 ),
createObject ( 3578, 3126.1001, -796.59998, 8.9, 0, 0, 180 ),
createObject ( 3578, 3128.8, -796.59998, 8.9, 0, 0, 179.995 ),
createObject ( 2887, 3132.1001, -797.70001, 11.3 ),
createObject ( 2887, 3132, -780.5, 11.3, 0, 0, 179.995 ),
createObject ( 3884, 3127.2, -775.79999, 13.5, 0, 0, 70.745 ),
createObject ( 2125, 3121.3, -789.09998, 16 ),
createObject ( 2125, 3124.7, -787.79999, 16 ),
createObject ( 16501, 3131, -767.20001, 12.1, 90, 0, 270 ),
createObject ( 16501, 3139.6599, -767.20001, 12.1, 90, 0, 270 ),
createObject ( 16501, 3130.99, -717.74445, 12.1, 90, 0, 90 ),
createObject ( 16501, 3130.4299, -695.79999, 12, 90, 0, 179.995 ),
createObject ( 16501, 3141.7, -697.90002, 12, 90, 0, 0 ),
createObject ( 16501, 3141.7, -702.20001, 12, 90, 0, 0 ),
createObject ( 16501, 3141.7, -706.59998, 12, 90, 0, 0 ),
createObject ( 16501, 3139.5, -707.75647, 12, 90, 0, 90 ),
createObject ( 16501, 3141.7, -712.5, 12, 90, 0, 0 ),
createObject ( 16501, 3141.7, -716.82001, 12, 90, 0, 0 ),
createObject ( 16501, 3137.54, -763.75, 13.45 ),
createObject ( 16501, 3137.54, -763.75, 8.2 ),
createObject ( 1649, 3137.5, -765, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.5, -760.70001, 10.4, 0, 0, 90 ),
createObject ( 16501, 3137.54, -756.70001, 13.45 ),
createObject ( 16501, 3137.54, -749.59998, 13.45 ),
createObject ( 16501, 3137.54, -742.5, 13.45 ),
createObject ( 16501, 3137.54, -742.5, 8.2 ),
createObject ( 16501, 3137.54, -749.59961, 8.2 ),
createObject ( 16501, 3137.54, -756.7002, 8.2 ),
createObject ( 1649, 3137.5, -756.40002, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.5, -752.09998, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.5, -747.79999, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.5, -743.5, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.5, -739.20001, 10.4, 0, 0, 90 ),
createObject ( 16501, 3141.7, -722.70001, 12, 90, 0, 0 ),
createObject ( 16501, 3141.7009, -720.29999, 13.4 ),
createObject ( 16501, 3139.6599, -724.83698, 12.1, 90, 0, 270 ),
createObject ( 16501, 3137.54, -735.40002, 13.45 ),
createObject ( 1502, 3141.71, -710.32001, 8.68, 0, 0, 90 ),
createObject ( 16501, 3141.7009, -710.09998, 13.4 ),
createObject ( 1502, 3141.71, -720.53003, 8.7, 0, 0, 90 ),
createObject ( 16501, 3137.3899, -697.20001, 8.8 ),
createObject ( 16501, 3137.3899, -697.20001, 13.2 ),
createObject ( 16501, 3137.3899, -704.29999, 8.8 ),
createObject ( 16501, 3137.3899, -704.29999, 13.2 ),
createObject ( 16501, 3137.54, -735.40002, 8.2 ),
createObject ( 16501, 3137.54, -728.29999, 8.2 ),
createObject ( 16501, 3137.54, -728.29999, 13.45 ),
createObject ( 1649, 3137.5, -734.90002, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.5, -730.59998, 10.4, 0, 0, 90 ),
createObject ( 1649, 3137.51, -727, 10.4, 0, 0, 90 ),
createObject ( 16501, 3133.1001, -763.75598, 8.2 ),
createObject ( 16501, 3133.1006, -763.75586, 13.45 ),
createObject ( 16501, 3133.1001, -756.70001, 8.2 ),
createObject ( 16501, 3133.1006, -756.7002, 13.45 ),
createObject ( 16501, 3133.1001, -749.59998, 8.2 ),
createObject ( 16501, 3133.1006, -749.59961, 13.45 ),
createObject ( 16501, 3133.1001, -742.5, 8.2 ),
createObject ( 16501, 3133.1001, -735.40002, 8.2 ),
createObject ( 16501, 3133.1001, -728.29999, 8.2 ),
createObject ( 16501, 3133.1001, -721.20001, 8.2 ),
createObject ( 16501, 3133.1006, -721.2002, 13.45 ),
createObject ( 16501, 3133.1006, -728.2998, 13.45 ),
createObject ( 16501, 3133.1006, -735.40039, 13.45 ),
createObject ( 16501, 3133.1006, -742.5, 13.45 ),
createObject ( 1649, 3133.1001, -765, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -760.70001, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -756.40002, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -752.09998, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -747.79999, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -743.5, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -739.20001, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -734.90002, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -730.59998, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -726.29999, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1001, -722, 10.4, 0, 0, 90 ),
createObject ( 1649, 3133.1101, -719.90002, 10.4, 0, 0, 90 ),
createObject ( 16501, 3135.8999, -707.75403, 13.32, 0, 0, 90 ),
createObject ( 16501, 3130.4299, -700.20001, 12, 90, 0, 179.995 ),
createObject ( 16501, 3130.4299, -704.59998, 12, 90, 0, 179.995 ),
createObject ( 16501, 3130.4299, -709, 12, 90, 0, 179.995 ),
createObject ( 16501, 3130.4299, -713.40002, 12, 90, 0, 179.995 ),
createObject ( 16501, 3130.427, -715.59998, 12, 90, 0, 179.995 ),
createObject ( 2985, 3137.6001, -708.29999, 8.7, 0, 0, 270 ),
createObject ( 1723, 3132.2, -708.40002, 8.7 ),
createObject ( 1723, 3131.1001, -711.79999, 8.7, 0, 0, 90 ),
createObject ( 1723, 3131.1001, -716, 8.7, 0, 0, 90 ),
createObject ( 1724, 3133.1001, -717.09998, 8.7, 0, 0, 180 ),
createObject ( 627, 3131.5, -717, 10.5, 0, 0, 287.25 ),
createObject ( 627, 3131.3, -708.79999, 10.5, 0, 0, 204.25 ),
createObject ( 630, 3141.2, -708.5, 9.7 ),
createObject ( 638, 3139, -724.29999, 9.4, 0, 0, 90 ),
createObject ( 638, 3141.2, -722, 9.4 ),
createObject ( 632, 3141.6001, -723.90002, 9.1 ),
createObject ( 638, 3139.3999, -708.29999, 9.4, 0, 0, 90 ),
createObject ( 640, 3141.2, -714.79999, 9.4 ),
createObject ( 631, 3141.1001, -718.09998, 9.6 ),
createObject ( 3031, 3140.7, -711.09998, 10.2, 0, 0, 240.75 ),
createObject ( 16501, 3132.5, -707.75647, 13.32, 0, 0, 90 ),
createObject ( 16501, 3132.29, -707.75684, 7.8, 0, 0, 90 ),
createObject ( 1649, 3133.6101, -707.79999, 10.4 ),
createObject ( 1502, 3135.8201, -707.78998, 8.67 ),
createObject ( 1649, 3131.1001, -707.79498, 10.4 ),
createObject ( 2206, 3132.6001, -694.29999, 8.7 ),
createObject ( 2206, 3135, -694.29999, 8.7 ),
createObject ( 939, 3130.5, -763.59998, 11.1, 0, 0, 90 ),
createObject ( 922, 3129.7, -752.90002, 9.6, 0, 0, 90 ),
createObject ( 3015, 3132.7, -694.40002, 9.7, 0, 0, 152.5 ),
createObject ( 3013, 3133.3, -694.20001, 9.8 ),
createObject ( 3013, 3133.7, -694.09998, 9.8 ),
createObject ( 2974, 3130.3, -758.09998, 8.7 ),
createObject ( 2969, 3136.7, -694.5, 9.8 ),
createObject ( 930, 3129.7, -753, 10.1, 0, 0, 90 ),
createObject ( 964, 3136.6001, -697.40002, 8.7, 0, 0, 270 ),
createObject ( 964, 3136.6001, -698.79999, 8.7, 0, 0, 270 ),
createObject ( 964, 3136.6001, -698.09998, 9.63, 0, 0, 270 ),
createObject ( 2038, 3133.7, -694.40002, 9.7 ),
createObject ( 2041, 3134.8, -694, 9.8 ),
createObject ( 2041, 3134.6001, -694, 9.8 ),
createObject ( 2042, 3134.8, -694.5, 9.8, 0, 0, 335 ),
createObject ( 2359, 3135.7, -694.29999, 9.83, 0, 0, 344 ),
createObject ( 13025, 3149.3, -700.20001, 21.9 ),
createObject ( 2977, 3131.2, -748.90002, 8.7 ),
createObject ( 2977, 3129.8999, -749, 8.7 ),
createObject ( 2977, 3129.8999, -747.40002, 8.7 ),
createObject ( 3386, 3130.3, -745.79999, 8.7 ),
createObject ( 3386, 3130.3, -744.70001, 8.7 ),
createObject ( 3386, 3130.3, -743.59998, 8.7 ),
createObject ( 3387, 3130.7, -731.59998, 8.7, 0, 0, 180 ),
createObject ( 3387, 3130.7, -732.59998, 8.7, 0, 0, 179.995 ),
createObject ( 3387, 3130.7, -733.59998, 8.7, 0, 0, 179.995 ),
createObject ( 3393, 3129.6001, -737.79999, 8.7, 0, 0, 182 ),
createObject ( 3388, 3130.7, -734.70001, 8.7 ),
createObject ( 3791, 3131.5, -752.5, 9.2, 0, 0, 90 ),
createObject ( 1671, 3130.7, -737.40002, 9.1, 0, 0, 314 ),
createObject ( 3383, 3139.7, -726.20001, 8.6, 0, 0, 180 ),
createObject ( 3383, 3139.6001, -766, 8.6 ),
createObject ( 3383, 3135.6001, -767.5, 15.6, 180, 0, 0 ),
createObject ( 3383, 3135.6001, -761.90002, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -757.40002, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -752.5, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -746.70001, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -741.90002, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -736.29999, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -732.09998, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.6001, -725.79999, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3135.3, -719.20001, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3133.5, -715.40002, 15.6, 179.995, 0, 0 ),
createObject ( 3383, 3139.2, -715.40002, 15.6, 179.995, 0, 0 ),
createObject ( 2922, 3141.8, -741.90002, 10.6, 0, 0, 88.5 ),
createObject ( 2891, 3138.6001, -726.5, 9.7 ),
createObject ( 2891, 3139.3, -726.5, 9.7 ),
createObject ( 2891, 3140.1001, -726.20001, 9.7 ),
createObject ( 2891, 3140.7, -726.59998, 9.7 ),
createObject ( 2889, 3149.3, -748.70001, 25.6 ),
createObject ( 2888, 3132.3, -766.20001, 11.9, 0, 0, 180 ),
createObject ( 3390, 3141.2, -759.70001, 8.7 ),
createObject ( 3391, 3141.2, -754.70001, 8.7 ),
createObject ( 3391, 3141.2, -732, 8.7 ),
createObject ( 3393, 3141.2, -738.40002, 8.7 ),
createObject ( 3395, 3141.1001, -748.59998, 8.7 ),
createObject ( 3387, 3141.3, -745.79999, 8.7, 0, 0, 180 ),
createObject ( 3387, 3141.3, -744.79999, 8.7, 0, 0, 179.995 ),
createObject ( 3387, 3141.3, -743.79999, 8.7, 0, 0, 179.995 ),
createObject ( 3387, 3141.3, -742.79999, 8.7, 0, 0, 179.995 ),
createObject ( 1714, 3140.1001, -732, 8.7, 0, 0, 70 ),
createObject ( 1714, 3140.2, -738.29999, 8.7, 0, 0, 69.999 ),
createObject ( 1714, 3140.1001, -748.5, 8.7, 0, 0, 69.999 ),
createObject ( 1714, 3140.2, -754.5, 8.7, 0, 0, 69.999 ),
createObject ( 1714, 3140.2, -759.5, 8.7, 0, 0, 69.999 ),
createObject ( 2775, 3134.8999, -708.20001, 12.5 ),
createObject ( 2792, 3136.8999, -707.79999, 11.5 ),
createObject ( 2793, 3141.7, -709.90002, 11.6, 0, 0, 270.25 ),
createObject ( 2794, 3141.7, -719.40002, 11.7, 0, 0, 90.75 ),
createObject ( 2795, 3141.8, -740.59998, 11.8, 0, 0, 91.5 ),
createObject ( 1892, 3135.8, -767.09998, 8.7 ),
createObject ( 16377, 3136.7, -702.79999, 9.7, 0, 0, 90 ),
createObject ( 1808, 3135.5, -707.40002, 8.7, 0, 0, 180 ),
createObject ( 1808, 3142.1001, -718.79999, 8.6, 0, 0, 90 ),
createObject ( 1808, 3142.3, -764.90002, 0.5, 0, 0, 270 ),
createObject ( 1808, 3142.3999, -780.70001, 0.5, 0, 0, 270 ),
createObject ( 1808, 3142.5, -789.20001, 0.5, 0, 0, 270 ),
createObject ( 2064, 3131.3999, -706.59998, 9.3, 0, 0, 144 ),
createObject ( 2060, 3140.7, -765.90002, 9.8 ),
createObject ( 2060, 3139.5, -766.20001, 9.8 ),
createObject ( 2060, 3138.3999, -765.70001, 9.8, 0, 0, 12 ),
createObject ( 1672, 3135.5, -767.29999, 10.3 ),
createObject ( 1672, 3135.1001, -767.29999, 10.3 ),
createObject ( 1672, 3137.1001, -767.29999, 10.3 ),
createObject ( 1672, 3133.5, -767.29999, 10.3 ),
createObject ( 1775, 3131, -712.90002, 9.8, 0, 0, 90 ),
createObject ( 1351, 2903.3999, -777.90002, 10, 0, 0, 90 ),
createObject ( 1346, 2918.6001, -801.09998, 11.4 ),
createObject ( 1297, 3118.7, -799.59998, 12.2 ),
createObject ( 1297, 3118.6001, -778, 12.2 ),
createObject ( 1278, 3156.3, -840.29999, 9.7, 0, 0, 218.25 ),
createObject ( 1278, 3127.5, -840.20001, 8.9, 0, 0, 136.249 ),
createObject ( 3934, 3141.5, -830.90002, 15.7 ),
createObject ( 3091, 3139.3, -767.79999, 9.3 ),
createObject ( 7347, 2947.8999, -814.5, -33.2, 0, 0, 270 ),
createObject ( 934, 3130, -723.70001, 10 ),
createObject ( 934, 3131.8999, -723.59998, 10 ),
createObject ( 958, 3130.5, -728.79999, 9.6, 0, 0, 270 ),
createObject ( 3502, 3147.3, -667.20001, 4.8 ),
createObject ( 3502, 3147.3, -675.90002, 4.8 ),
createObject ( 3502, 3147.3, -684.59998, 4.8 ),
createObject ( 3502, 3147.3, -693.29999, 4.8 ),
createObject ( 3502, 3147.3, -702, 4.8 ),
createObject ( 3502, 3147.3, -710.70001, 4.8 ),
createObject ( 3502, 3147.3, -719.40002, 4.8 ),
createObject ( 3502, 3147.3, -727.79999, 4.8 ),
createObject ( 3502, 3147.3, -736.5, 4.8 ),
createObject ( 7933, 3132.1001, -772.40002, 9.2, 0, 0, 90 ),
createObject ( 2944, 3143.8491, -721.59998, 17.2 ),
}
for index, object in ipairs ( Objects ) do
setElementDoubleSided ( object, true )
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.