content
stringlengths 5
1.05M
|
|---|
-----------------------------------------------------------------------------------------------------------------------
-- RedFlat volume indicator widget --
-----------------------------------------------------------------------------------------------------------------------
-- Indicator with audio icon
-----------------------------------------------------------------------------------------------------------------------
-- Grab environment
-----------------------------------------------------------------------------------------------------------------------
local setmetatable = setmetatable
local unpack = unpack or table.unpack
local wibox = require("wibox")
local beautiful = require("beautiful")
local redutil = require("redflat.util")
local svgbox = require("redflat.gauge.svgbox")
local reddash = require("redflat.gauge.graph.dash")
-- Initialize tables for module
-----------------------------------------------------------------------------------------------------------------------
local audio = { mt = {} }
-- Generate default theme vars
-----------------------------------------------------------------------------------------------------------------------
local function default_style()
local style = {
width = 100,
icon = redutil.base.placeholder(),
gauge = reddash.new,
dash = {},
dmargin = { 10, 0, 0, 0 },
color = { icon = "#a0a0a0", mute = "#404040" }
}
return redutil.table.merge(style, redutil.table.check(beautiful, "gauge.audio.blue") or {})
end
-- Create a new audio widget
-- @param style Table containing colors and geometry parameters for all elemets
-----------------------------------------------------------------------------------------------------------------------
function audio.new(style)
-- Initialize vars
--------------------------------------------------------------------------------
style = redutil.table.merge(default_style(), style or {})
-- Construct widget
--------------------------------------------------------------------------------
local icon = svgbox(style.icon)
local layout = wibox.layout.fixed.horizontal()
layout:add(icon)
local dash
if style.gauge then
dash = style.gauge(style.dash)
layout:add(wibox.container.margin(dash, unpack(style.dmargin)))
end
local widg = wibox.container.constraint(layout, "exact", style.width)
-- User functions
------------------------------------------------------------
function widg:set_value(x) if dash then dash:set_value(x) end end
function widg:set_mute(mute)
icon:set_color(mute and style.color.mute or style.color.icon)
end
--------------------------------------------------------------------------------
return widg
end
-- Config metatable to call audio module as function
-----------------------------------------------------------------------------------------------------------------------
function audio.mt:__call(...)
return audio.new(...)
end
return setmetatable(audio, audio.mt)
|
-- Do not edit! This file was generated by blocks/signal/addconstant_spec.py
local radio = require('radio')
local jigs = require('tests.jigs')
jigs.TestBlock(radio.AddConstantBlock, {
{
desc = "Number constant, 256 ComplexFloat32 inputs, 256 ComplexFloat32 output",
args = {2.5},
inputs = {radio.types.ComplexFloat32.vector_from_array({{-0.73127151, 0.69486749}, {0.52754927, -0.48986191}, {-0.00912983, -0.10101787}, {0.30318594, 0.57744670}, {-0.81228077, -0.94330502}, {0.67153019, -0.13446586}, {0.52456015, -0.99578792}, {-0.10922561, 0.44308007}, {-0.54247558, 0.89054137}, {0.80285490, -0.93882000}, {-0.94910830, 0.08282494}, {0.87829834, -0.23759152}, {-0.56680119, -0.15576684}, {-0.94191837, -0.55661666}, {-0.12422481, -0.00837552}, {-0.53383112, -0.53826690}, {-0.56243795, -0.08079307}, {-0.42043677, -0.95702058}, {0.67515594, 0.11290865}, {0.28458872, -0.62818748}, {0.98508680, 0.71989304}, {-0.75822008, -0.33460963}, {0.44296879, 0.42238355}, {0.87288117, -0.15578599}, {0.66007137, 0.34061113}, {-0.39326301, 0.17516121}, {0.76495802, 0.69239485}, {0.01056764, 0.17800452}, {-0.93094832, -0.51452005}, {0.59480852, -0.17137200}, {-0.65398520, 0.09759752}, {0.40608153, 0.34897169}, {-0.25059396, -0.12207674}, {0.01685298, 0.55688524}, {0.04187684, -0.21348982}, {-0.02061296, -0.94085008}, {-0.91302544, 0.40676415}, {0.96637541, 0.18636747}, {-0.21280062, -0.65930158}, {0.00447712, 0.96415329}, {0.54104626, 0.07923490}, {0.72057962, -0.53564775}, {0.02754333, 0.90493482}, {0.15558961, -0.08173654}, {-0.46144104, 0.09599262}, {0.91423255, -0.98858166}, {0.56731045, 0.64097184}, {0.77235913, 0.48100683}, {0.61827981, 0.03735657}, {0.12271573, -0.14781864}, {-0.88775343, 0.74002033}, {0.13999867, -0.60032117}, {0.00944094, -0.03014978}, {-0.28642008, -0.30784416}, {0.07695759, 0.24697889}, {0.22490492, -0.08370640}, {-0.94405001, -0.54078996}, {-0.64557749, 0.16892174}, {0.72201771, 0.59687787}, {0.59419513, 0.63287473}, {-0.48941192, 0.68348968}, {0.34622705, -0.83353174}, {-0.96661872, -0.97087997}, {0.51117355, -0.50088155}, {-0.78102273, 0.24960417}, {-0.31115428, -0.86096931}, {-0.68074894, 0.05476080}, {-0.66371012, -0.45417112}, {0.42317989, -0.09059674}, {-0.35599643, -0.05245798}, {-0.95273077, -0.22688580}, {-0.15816264, -0.62392139}, {-0.78247666, 0.79963702}, {0.02023196, -0.58181804}, {0.21129727, 0.63407934}, {-0.95836377, -0.96427095}, {-0.70707649, 0.43767095}, {-0.67954481, 0.40921125}, {0.35635161, 0.08940433}, {-0.55880052, 0.95118904}, {0.59562171, 0.03319904}, {-0.55360842, 0.29701284}, {-0.21020398, 0.15169193}, {-0.35750839, 0.26189572}, {-0.88242978, -0.40278813}, {0.93580663, 0.75106847}, {-0.38722676, 0.71702880}, {-0.37927276, 0.87857687}, {0.48768425, -0.16765547}, {-0.49528381, -0.98303950}, {0.75743574, -0.92416686}, {0.63882822, 0.92440224}, {0.14056113, -0.65696579}, {0.73556215, 0.94755048}, {0.40804628, 0.01774749}, {-0.24406233, -0.30613822}, {-0.58847648, 0.34830603}, {-0.13409975, -0.61176270}, {-0.79115158, 0.33191505}, {-0.40785465, -0.00040016}, {-0.34930867, 0.74324304}, {0.79935658, -0.96381402}, {-0.59829396, -0.34451860}, {0.97409946, 0.56540078}, {-0.32180870, -0.57394040}, {0.34891015, 0.67540216}, {0.86437494, -0.31230038}, {0.76478642, 0.37422037}, {-0.03100256, 0.97101647}, {-0.53071910, 0.45093039}, {-0.83063954, -0.66061169}, {0.82197559, -0.57406360}, {0.51823235, 0.20041765}, {0.68226439, -0.26378399}, {-0.31942952, -0.41756943}, {0.73483962, 0.20796506}, {0.90861493, 0.77453023}, {-0.72930807, 0.10234095}, {-0.79145002, -0.92172438}, {-0.85361314, 0.73233670}, {0.57623291, 0.65701193}, {-0.31820506, 0.23037209}, {0.56380719, -0.24392074}, {0.14156306, -0.55257183}, {-0.83651346, -0.46655273}, {0.78153634, 0.12889367}, {0.85013437, -0.08446148}, {-0.44563445, 0.57402933}, {0.65553629, -0.97523654}, {0.34082329, -0.81663376}, {-0.76979506, 0.77012014}, {-0.91995299, -0.52073330}, {0.97631699, -0.15797283}, {-0.76888371, -0.66523314}, {-0.51715940, 0.48801285}, {-0.79433179, 0.82152885}, {-0.24344546, 0.94052809}, {0.81844544, -0.41195285}, {-0.49317971, -0.04597981}, {-0.79974169, 0.30410039}, {-0.92075950, -0.97898769}, {0.96516722, -0.40890029}, {0.19314128, -0.10031093}, {-0.37343827, -0.87407041}, {0.82678401, 0.93962657}, {0.93959302, -0.77727538}, {-0.56961346, 0.23561376}, {0.95990574, 0.08582640}, {0.37637961, 0.32366887}, {-0.48182800, 0.08320452}, {-0.38535777, -0.50723761}, {-0.83726245, -0.43842655}, {0.96675342, -0.10419552}, {0.30402106, 0.28693217}, {0.88146901, -0.21904290}, {-0.38643140, -0.34551716}, {-0.36652973, 0.69426954}, {0.78700048, -0.39438137}, {-0.33133319, 0.08845083}, {0.15797088, 0.19192508}, {-0.50980401, -0.95925194}, {-0.51248139, -0.85534495}, {0.10240951, -0.85816729}, {-0.84974039, 0.27076420}, {-0.41835687, 0.58436954}, {-0.01347791, 0.72529793}, {-0.69164079, 0.00285917}, {0.58996701, -0.84578598}, {0.89845592, -0.65351576}, {0.55241799, 0.96979177}, {0.64310026, -0.36043200}, {-0.78624445, 0.02871650}, {0.83871394, -0.41302100}, {0.78751761, -0.71663874}, {0.82096338, -0.93648010}, {-0.36786264, 0.80617654}, {0.60771257, 0.81430751}, {0.68143702, 0.49236977}, {0.37919036, -0.64369029}, {-0.13472399, -0.68420619}, {0.42964891, 0.33555749}, {-0.49482721, -0.87117159}, {0.92677176, 0.61650527}, {0.09853987, 0.08275530}, {0.70258534, -0.09338064}, {-0.20857909, -0.32266170}, {-0.48406181, -0.95118302}, {0.29287767, -0.16663224}, {0.14120726, -0.87535673}, {-0.29011312, -0.72343177}, {-0.74974197, -0.48177409}, {0.65786874, -0.20440537}, {-0.19783570, 0.22488984}, {-0.53294069, -0.98504567}, {0.05740348, 0.00179924}, {0.29767919, -0.12336609}, {0.37302625, 0.46284387}, {-0.52325064, -0.00985550}, {-0.04234622, -0.54987586}, {-0.17550774, 0.12081487}, {0.81387901, 0.83541310}, {-0.44954929, 0.29283035}, {-0.90360534, -0.85689718}, {0.02338342, 0.75484818}, {-0.68106455, 0.53205574}, {0.76601923, -0.37639597}, {0.38511392, 0.69798225}, {-0.25677133, 0.40256533}, {0.47283623, 0.18915559}, {0.71255422, 0.79320872}, {0.92015761, 0.14246538}, {-0.64744818, -0.49880919}, {-0.56476265, 0.13903470}, {0.51550025, -0.89573354}, {0.36327291, 0.43430653}, {-0.30403697, 0.03011161}, {-0.67040372, 0.45979229}, {-0.91858262, 0.96244210}, {0.61588746, 0.25689700}, {-0.46494752, 0.82572573}, {0.91887766, -0.72174770}, {0.55151451, 0.68386173}, {0.31943470, 0.40081555}, {-0.10988253, 0.84861559}, {0.94241506, -0.23529337}, {0.60542303, -0.13415682}, {-0.67049158, -0.34906545}, {-0.74733984, 0.81776953}, {0.91884816, -0.76162654}, {0.20135815, -0.18355180}, {-0.76381993, -0.40904897}, {-0.50356728, 0.49915361}, {-0.99198210, -0.62032259}, {-0.12245386, -0.95793062}, {0.25505316, 0.21125507}, {0.67066473, -0.58678836}, {-0.43043676, 0.08467886}, {-0.45354861, 0.17147619}, {-0.49823555, 0.36705431}, {0.58218145, 0.61730921}, {0.94723225, 0.09075401}, {-0.01838144, 0.71139538}, {0.53813475, 0.14108926}, {-0.23348723, -0.43190512}, {-0.78372163, 0.61509818}, {-0.76385695, 0.49453047}, {0.09057418, 0.92989063}, {0.52213132, 0.94703954}, {-0.72681195, 0.00074295}, {0.14515658, -0.37749708}, {0.00606498, -0.28636247}, {0.05678794, -0.99831057}, {-0.11537134, -0.10089571}, {-0.39040163, -0.20119449}, {0.56617463, 0.36682576}, {-0.01540173, 0.29533648}})},
outputs = {radio.types.ComplexFloat32.vector_from_array({{1.76872849, 0.69486749}, {3.02754927, -0.48986191}, {2.49087024, -0.10101787}, {2.80318594, 0.57744670}, {1.68771923, -0.94330502}, {3.17153025, -0.13446586}, {3.02456021, -0.99578792}, {2.39077449, 0.44308007}, {1.95752442, 0.89054137}, {3.30285501, -0.93882000}, {1.55089164, 0.08282494}, {3.37829828, -0.23759152}, {1.93319881, -0.15576684}, {1.55808163, -0.55661666}, {2.37577510, -0.00837552}, {1.96616888, -0.53826690}, {1.93756199, -0.08079307}, {2.07956314, -0.95702058}, {3.17515588, 0.11290865}, {2.78458881, -0.62818748}, {3.48508692, 0.71989304}, {1.74177992, -0.33460963}, {2.94296885, 0.42238355}, {3.37288117, -0.15578599}, {3.16007137, 0.34061113}, {2.10673690, 0.17516121}, {3.26495790, 0.69239485}, {2.51056767, 0.17800452}, {1.56905174, -0.51452005}, {3.09480858, -0.17137200}, {1.84601474, 0.09759752}, {2.90608144, 0.34897169}, {2.24940610, -0.12207674}, {2.51685309, 0.55688524}, {2.54187679, -0.21348982}, {2.47938704, -0.94085008}, {1.58697462, 0.40676415}, {3.46637535, 0.18636747}, {2.28719950, -0.65930158}, {2.50447702, 0.96415329}, {3.04104614, 0.07923490}, {3.22057962, -0.53564775}, {2.52754331, 0.90493482}, {2.65558958, -0.08173654}, {2.03855896, 0.09599262}, {3.41423249, -0.98858166}, {3.06731033, 0.64097184}, {3.27235913, 0.48100683}, {3.11827993, 0.03735657}, {2.62271571, -0.14781864}, {1.61224651, 0.74002033}, {2.63999867, -0.60032117}, {2.50944090, -0.03014978}, {2.21357989, -0.30784416}, {2.57695770, 0.24697889}, {2.72490501, -0.08370640}, {1.55594993, -0.54078996}, {1.85442257, 0.16892174}, {3.22201777, 0.59687787}, {3.09419513, 0.63287473}, {2.01058817, 0.68348968}, {2.84622717, -0.83353174}, {1.53338122, -0.97087997}, {3.01117349, -0.50088155}, {1.71897721, 0.24960417}, {2.18884563, -0.86096931}, {1.81925106, 0.05476080}, {1.83628988, -0.45417112}, {2.92317986, -0.09059674}, {2.14400363, -0.05245798}, {1.54726923, -0.22688580}, {2.34183741, -0.62392139}, {1.71752334, 0.79963702}, {2.52023196, -0.58181804}, {2.71129727, 0.63407934}, {1.54163623, -0.96427095}, {1.79292345, 0.43767095}, {1.82045519, 0.40921125}, {2.85635161, 0.08940433}, {1.94119954, 0.95118904}, {3.09562159, 0.03319904}, {1.94639158, 0.29701284}, {2.28979611, 0.15169193}, {2.14249158, 0.26189572}, {1.61757016, -0.40278813}, {3.43580675, 0.75106847}, {2.11277318, 0.71702880}, {2.12072730, 0.87857687}, {2.98768425, -0.16765547}, {2.00471616, -0.98303950}, {3.25743580, -0.92416686}, {3.13882828, 0.92440224}, {2.64056110, -0.65696579}, {3.23556209, 0.94755048}, {2.90804625, 0.01774749}, {2.25593758, -0.30613822}, {1.91152358, 0.34830603}, {2.36590028, -0.61176270}, {1.70884848, 0.33191505}, {2.09214544, -0.00040016}, {2.15069127, 0.74324304}, {3.29935646, -0.96381402}, {1.90170598, -0.34451860}, {3.47409940, 0.56540078}, {2.17819118, -0.57394040}, {2.84891009, 0.67540216}, {3.36437488, -0.31230038}, {3.26478648, 0.37422037}, {2.46899748, 0.97101647}, {1.96928096, 0.45093039}, {1.66936040, -0.66061169}, {3.32197571, -0.57406360}, {3.01823235, 0.20041765}, {3.18226433, -0.26378399}, {2.18057060, -0.41756943}, {3.23483968, 0.20796506}, {3.40861487, 0.77453023}, {1.77069187, 0.10234095}, {1.70854998, -0.92172438}, {1.64638686, 0.73233670}, {3.07623291, 0.65701193}, {2.18179488, 0.23037209}, {3.06380725, -0.24392074}, {2.64156294, -0.55257183}, {1.66348648, -0.46655273}, {3.28153634, 0.12889367}, {3.35013437, -0.08446148}, {2.05436563, 0.57402933}, {3.15553617, -0.97523654}, {2.84082317, -0.81663376}, {1.73020494, 0.77012014}, {1.58004701, -0.52073330}, {3.47631693, -0.15797283}, {1.73111629, -0.66523314}, {1.98284054, 0.48801285}, {1.70566821, 0.82152885}, {2.25655460, 0.94052809}, {3.31844544, -0.41195285}, {2.00682020, -0.04597981}, {1.70025826, 0.30410039}, {1.57924056, -0.97898769}, {3.46516728, -0.40890029}, {2.69314122, -0.10031093}, {2.12656164, -0.87407041}, {3.32678413, 0.93962657}, {3.43959308, -0.77727538}, {1.93038654, 0.23561376}, {3.45990562, 0.08582640}, {2.87637949, 0.32366887}, {2.01817203, 0.08320452}, {2.11464214, -0.50723761}, {1.66273761, -0.43842655}, {3.46675348, -0.10419552}, {2.80402112, 0.28693217}, {3.38146901, -0.21904290}, {2.11356854, -0.34551716}, {2.13347030, 0.69426954}, {3.28700042, -0.39438137}, {2.16866684, 0.08845083}, {2.65797091, 0.19192508}, {1.99019599, -0.95925194}, {1.98751855, -0.85534495}, {2.60240960, -0.85816729}, {1.65025961, 0.27076420}, {2.08164310, 0.58436954}, {2.48652220, 0.72529793}, {1.80835915, 0.00285917}, {3.08996701, -0.84578598}, {3.39845586, -0.65351576}, {3.05241799, 0.96979177}, {3.14310026, -0.36043200}, {1.71375561, 0.02871650}, {3.33871388, -0.41302100}, {3.28751755, -0.71663874}, {3.32096338, -0.93648010}, {2.13213730, 0.80617654}, {3.10771251, 0.81430751}, {3.18143702, 0.49236977}, {2.87919044, -0.64369029}, {2.36527610, -0.68420619}, {2.92964888, 0.33555749}, {2.00517273, -0.87117159}, {3.42677164, 0.61650527}, {2.59853983, 0.08275530}, {3.20258522, -0.09338064}, {2.29142094, -0.32266170}, {2.01593828, -0.95118302}, {2.79287767, -0.16663224}, {2.64120722, -0.87535673}, {2.20988679, -0.72343177}, {1.75025797, -0.48177409}, {3.15786886, -0.20440537}, {2.30216432, 0.22488984}, {1.96705937, -0.98504567}, {2.55740356, 0.00179924}, {2.79767919, -0.12336609}, {2.87302637, 0.46284387}, {1.97674942, -0.00985550}, {2.45765376, -0.54987586}, {2.32449222, 0.12081487}, {3.31387901, 0.83541310}, {2.05045080, 0.29283035}, {1.59639466, -0.85689718}, {2.52338338, 0.75484818}, {1.81893539, 0.53205574}, {3.26601934, -0.37639597}, {2.88511395, 0.69798225}, {2.24322867, 0.40256533}, {2.97283626, 0.18915559}, {3.21255422, 0.79320872}, {3.42015767, 0.14246538}, {1.85255182, -0.49880919}, {1.93523741, 0.13903470}, {3.01550031, -0.89573354}, {2.86327291, 0.43430653}, {2.19596291, 0.03011161}, {1.82959628, 0.45979229}, {1.58141732, 0.96244210}, {3.11588740, 0.25689700}, {2.03505254, 0.82572573}, {3.41887760, -0.72174770}, {3.05151463, 0.68386173}, {2.81943464, 0.40081555}, {2.39011741, 0.84861559}, {3.44241500, -0.23529337}, {3.10542297, -0.13415682}, {1.82950842, -0.34906545}, {1.75266016, 0.81776953}, {3.41884804, -0.76162654}, {2.70135808, -0.18355180}, {1.73618007, -0.40904897}, {1.99643278, 0.49915361}, {1.50801790, -0.62032259}, {2.37754607, -0.95793062}, {2.75505304, 0.21125507}, {3.17066479, -0.58678836}, {2.06956315, 0.08467886}, {2.04645133, 0.17147619}, {2.00176454, 0.36705431}, {3.08218145, 0.61730921}, {3.44723225, 0.09075401}, {2.48161864, 0.71139538}, {3.03813481, 0.14108926}, {2.26651287, -0.43190512}, {1.71627831, 0.61509818}, {1.73614311, 0.49453047}, {2.59057426, 0.92989063}, {3.02213144, 0.94703954}, {1.77318811, 0.00074295}, {2.64515662, -0.37749708}, {2.50606489, -0.28636247}, {2.55678797, -0.99831057}, {2.38462877, -0.10089571}, {2.10959840, -0.20119449}, {3.06617451, 0.36682576}, {2.48459816, 0.29533648}})}
},
{
desc = "Float32 constant, 256 ComplexFloat32 inputs, 256 ComplexFloat32 output",
args = {radio.types.Float32(3.50000000)},
inputs = {radio.types.ComplexFloat32.vector_from_array({{-0.73127151, 0.69486749}, {0.52754927, -0.48986191}, {-0.00912983, -0.10101787}, {0.30318594, 0.57744670}, {-0.81228077, -0.94330502}, {0.67153019, -0.13446586}, {0.52456015, -0.99578792}, {-0.10922561, 0.44308007}, {-0.54247558, 0.89054137}, {0.80285490, -0.93882000}, {-0.94910830, 0.08282494}, {0.87829834, -0.23759152}, {-0.56680119, -0.15576684}, {-0.94191837, -0.55661666}, {-0.12422481, -0.00837552}, {-0.53383112, -0.53826690}, {-0.56243795, -0.08079307}, {-0.42043677, -0.95702058}, {0.67515594, 0.11290865}, {0.28458872, -0.62818748}, {0.98508680, 0.71989304}, {-0.75822008, -0.33460963}, {0.44296879, 0.42238355}, {0.87288117, -0.15578599}, {0.66007137, 0.34061113}, {-0.39326301, 0.17516121}, {0.76495802, 0.69239485}, {0.01056764, 0.17800452}, {-0.93094832, -0.51452005}, {0.59480852, -0.17137200}, {-0.65398520, 0.09759752}, {0.40608153, 0.34897169}, {-0.25059396, -0.12207674}, {0.01685298, 0.55688524}, {0.04187684, -0.21348982}, {-0.02061296, -0.94085008}, {-0.91302544, 0.40676415}, {0.96637541, 0.18636747}, {-0.21280062, -0.65930158}, {0.00447712, 0.96415329}, {0.54104626, 0.07923490}, {0.72057962, -0.53564775}, {0.02754333, 0.90493482}, {0.15558961, -0.08173654}, {-0.46144104, 0.09599262}, {0.91423255, -0.98858166}, {0.56731045, 0.64097184}, {0.77235913, 0.48100683}, {0.61827981, 0.03735657}, {0.12271573, -0.14781864}, {-0.88775343, 0.74002033}, {0.13999867, -0.60032117}, {0.00944094, -0.03014978}, {-0.28642008, -0.30784416}, {0.07695759, 0.24697889}, {0.22490492, -0.08370640}, {-0.94405001, -0.54078996}, {-0.64557749, 0.16892174}, {0.72201771, 0.59687787}, {0.59419513, 0.63287473}, {-0.48941192, 0.68348968}, {0.34622705, -0.83353174}, {-0.96661872, -0.97087997}, {0.51117355, -0.50088155}, {-0.78102273, 0.24960417}, {-0.31115428, -0.86096931}, {-0.68074894, 0.05476080}, {-0.66371012, -0.45417112}, {0.42317989, -0.09059674}, {-0.35599643, -0.05245798}, {-0.95273077, -0.22688580}, {-0.15816264, -0.62392139}, {-0.78247666, 0.79963702}, {0.02023196, -0.58181804}, {0.21129727, 0.63407934}, {-0.95836377, -0.96427095}, {-0.70707649, 0.43767095}, {-0.67954481, 0.40921125}, {0.35635161, 0.08940433}, {-0.55880052, 0.95118904}, {0.59562171, 0.03319904}, {-0.55360842, 0.29701284}, {-0.21020398, 0.15169193}, {-0.35750839, 0.26189572}, {-0.88242978, -0.40278813}, {0.93580663, 0.75106847}, {-0.38722676, 0.71702880}, {-0.37927276, 0.87857687}, {0.48768425, -0.16765547}, {-0.49528381, -0.98303950}, {0.75743574, -0.92416686}, {0.63882822, 0.92440224}, {0.14056113, -0.65696579}, {0.73556215, 0.94755048}, {0.40804628, 0.01774749}, {-0.24406233, -0.30613822}, {-0.58847648, 0.34830603}, {-0.13409975, -0.61176270}, {-0.79115158, 0.33191505}, {-0.40785465, -0.00040016}, {-0.34930867, 0.74324304}, {0.79935658, -0.96381402}, {-0.59829396, -0.34451860}, {0.97409946, 0.56540078}, {-0.32180870, -0.57394040}, {0.34891015, 0.67540216}, {0.86437494, -0.31230038}, {0.76478642, 0.37422037}, {-0.03100256, 0.97101647}, {-0.53071910, 0.45093039}, {-0.83063954, -0.66061169}, {0.82197559, -0.57406360}, {0.51823235, 0.20041765}, {0.68226439, -0.26378399}, {-0.31942952, -0.41756943}, {0.73483962, 0.20796506}, {0.90861493, 0.77453023}, {-0.72930807, 0.10234095}, {-0.79145002, -0.92172438}, {-0.85361314, 0.73233670}, {0.57623291, 0.65701193}, {-0.31820506, 0.23037209}, {0.56380719, -0.24392074}, {0.14156306, -0.55257183}, {-0.83651346, -0.46655273}, {0.78153634, 0.12889367}, {0.85013437, -0.08446148}, {-0.44563445, 0.57402933}, {0.65553629, -0.97523654}, {0.34082329, -0.81663376}, {-0.76979506, 0.77012014}, {-0.91995299, -0.52073330}, {0.97631699, -0.15797283}, {-0.76888371, -0.66523314}, {-0.51715940, 0.48801285}, {-0.79433179, 0.82152885}, {-0.24344546, 0.94052809}, {0.81844544, -0.41195285}, {-0.49317971, -0.04597981}, {-0.79974169, 0.30410039}, {-0.92075950, -0.97898769}, {0.96516722, -0.40890029}, {0.19314128, -0.10031093}, {-0.37343827, -0.87407041}, {0.82678401, 0.93962657}, {0.93959302, -0.77727538}, {-0.56961346, 0.23561376}, {0.95990574, 0.08582640}, {0.37637961, 0.32366887}, {-0.48182800, 0.08320452}, {-0.38535777, -0.50723761}, {-0.83726245, -0.43842655}, {0.96675342, -0.10419552}, {0.30402106, 0.28693217}, {0.88146901, -0.21904290}, {-0.38643140, -0.34551716}, {-0.36652973, 0.69426954}, {0.78700048, -0.39438137}, {-0.33133319, 0.08845083}, {0.15797088, 0.19192508}, {-0.50980401, -0.95925194}, {-0.51248139, -0.85534495}, {0.10240951, -0.85816729}, {-0.84974039, 0.27076420}, {-0.41835687, 0.58436954}, {-0.01347791, 0.72529793}, {-0.69164079, 0.00285917}, {0.58996701, -0.84578598}, {0.89845592, -0.65351576}, {0.55241799, 0.96979177}, {0.64310026, -0.36043200}, {-0.78624445, 0.02871650}, {0.83871394, -0.41302100}, {0.78751761, -0.71663874}, {0.82096338, -0.93648010}, {-0.36786264, 0.80617654}, {0.60771257, 0.81430751}, {0.68143702, 0.49236977}, {0.37919036, -0.64369029}, {-0.13472399, -0.68420619}, {0.42964891, 0.33555749}, {-0.49482721, -0.87117159}, {0.92677176, 0.61650527}, {0.09853987, 0.08275530}, {0.70258534, -0.09338064}, {-0.20857909, -0.32266170}, {-0.48406181, -0.95118302}, {0.29287767, -0.16663224}, {0.14120726, -0.87535673}, {-0.29011312, -0.72343177}, {-0.74974197, -0.48177409}, {0.65786874, -0.20440537}, {-0.19783570, 0.22488984}, {-0.53294069, -0.98504567}, {0.05740348, 0.00179924}, {0.29767919, -0.12336609}, {0.37302625, 0.46284387}, {-0.52325064, -0.00985550}, {-0.04234622, -0.54987586}, {-0.17550774, 0.12081487}, {0.81387901, 0.83541310}, {-0.44954929, 0.29283035}, {-0.90360534, -0.85689718}, {0.02338342, 0.75484818}, {-0.68106455, 0.53205574}, {0.76601923, -0.37639597}, {0.38511392, 0.69798225}, {-0.25677133, 0.40256533}, {0.47283623, 0.18915559}, {0.71255422, 0.79320872}, {0.92015761, 0.14246538}, {-0.64744818, -0.49880919}, {-0.56476265, 0.13903470}, {0.51550025, -0.89573354}, {0.36327291, 0.43430653}, {-0.30403697, 0.03011161}, {-0.67040372, 0.45979229}, {-0.91858262, 0.96244210}, {0.61588746, 0.25689700}, {-0.46494752, 0.82572573}, {0.91887766, -0.72174770}, {0.55151451, 0.68386173}, {0.31943470, 0.40081555}, {-0.10988253, 0.84861559}, {0.94241506, -0.23529337}, {0.60542303, -0.13415682}, {-0.67049158, -0.34906545}, {-0.74733984, 0.81776953}, {0.91884816, -0.76162654}, {0.20135815, -0.18355180}, {-0.76381993, -0.40904897}, {-0.50356728, 0.49915361}, {-0.99198210, -0.62032259}, {-0.12245386, -0.95793062}, {0.25505316, 0.21125507}, {0.67066473, -0.58678836}, {-0.43043676, 0.08467886}, {-0.45354861, 0.17147619}, {-0.49823555, 0.36705431}, {0.58218145, 0.61730921}, {0.94723225, 0.09075401}, {-0.01838144, 0.71139538}, {0.53813475, 0.14108926}, {-0.23348723, -0.43190512}, {-0.78372163, 0.61509818}, {-0.76385695, 0.49453047}, {0.09057418, 0.92989063}, {0.52213132, 0.94703954}, {-0.72681195, 0.00074295}, {0.14515658, -0.37749708}, {0.00606498, -0.28636247}, {0.05678794, -0.99831057}, {-0.11537134, -0.10089571}, {-0.39040163, -0.20119449}, {0.56617463, 0.36682576}, {-0.01540173, 0.29533648}})},
outputs = {radio.types.ComplexFloat32.vector_from_array({{2.76872849, 0.69486749}, {4.02754927, -0.48986191}, {3.49087024, -0.10101787}, {3.80318594, 0.57744670}, {2.68771935, -0.94330502}, {4.17153025, -0.13446586}, {4.02455997, -0.99578792}, {3.39077449, 0.44308007}, {2.95752430, 0.89054137}, {4.30285501, -0.93882000}, {2.55089164, 0.08282494}, {4.37829828, -0.23759152}, {2.93319893, -0.15576684}, {2.55808163, -0.55661666}, {3.37577510, -0.00837552}, {2.96616888, -0.53826690}, {2.93756199, -0.08079307}, {3.07956314, -0.95702058}, {4.17515612, 0.11290865}, {3.78458881, -0.62818748}, {4.48508692, 0.71989304}, {2.74177980, -0.33460963}, {3.94296885, 0.42238355}, {4.37288094, -0.15578599}, {4.16007137, 0.34061113}, {3.10673690, 0.17516121}, {4.26495790, 0.69239485}, {3.51056767, 0.17800452}, {2.56905174, -0.51452005}, {4.09480858, -0.17137200}, {2.84601474, 0.09759752}, {3.90608144, 0.34897169}, {3.24940610, -0.12207674}, {3.51685309, 0.55688524}, {3.54187679, -0.21348982}, {3.47938704, -0.94085008}, {2.58697462, 0.40676415}, {4.46637535, 0.18636747}, {3.28719950, -0.65930158}, {3.50447702, 0.96415329}, {4.04104614, 0.07923490}, {4.22057962, -0.53564775}, {3.52754331, 0.90493482}, {3.65558958, -0.08173654}, {3.03855896, 0.09599262}, {4.41423273, -0.98858166}, {4.06731033, 0.64097184}, {4.27235889, 0.48100683}, {4.11827993, 0.03735657}, {3.62271571, -0.14781864}, {2.61224651, 0.74002033}, {3.63999867, -0.60032117}, {3.50944090, -0.03014978}, {3.21357989, -0.30784416}, {3.57695770, 0.24697889}, {3.72490501, -0.08370640}, {2.55594993, -0.54078996}, {2.85442257, 0.16892174}, {4.22201777, 0.59687787}, {4.09419537, 0.63287473}, {3.01058817, 0.68348968}, {3.84622717, -0.83353174}, {2.53338122, -0.97087997}, {4.01117373, -0.50088155}, {2.71897721, 0.24960417}, {3.18884563, -0.86096931}, {2.81925106, 0.05476080}, {2.83628988, -0.45417112}, {3.92317986, -0.09059674}, {3.14400363, -0.05245798}, {2.54726934, -0.22688580}, {3.34183741, -0.62392139}, {2.71752334, 0.79963702}, {3.52023196, -0.58181804}, {3.71129727, 0.63407934}, {2.54163623, -0.96427095}, {2.79292345, 0.43767095}, {2.82045507, 0.40921125}, {3.85635161, 0.08940433}, {2.94119954, 0.95118904}, {4.09562159, 0.03319904}, {2.94639158, 0.29701284}, {3.28979611, 0.15169193}, {3.14249158, 0.26189572}, {2.61757016, -0.40278813}, {4.43580675, 0.75106847}, {3.11277318, 0.71702880}, {3.12072730, 0.87857687}, {3.98768425, -0.16765547}, {3.00471616, -0.98303950}, {4.25743580, -0.92416686}, {4.13882828, 0.92440224}, {3.64056110, -0.65696579}, {4.23556232, 0.94755048}, {3.90804625, 0.01774749}, {3.25593758, -0.30613822}, {2.91152358, 0.34830603}, {3.36590028, -0.61176270}, {2.70884848, 0.33191505}, {3.09214544, -0.00040016}, {3.15069127, 0.74324304}, {4.29935646, -0.96381402}, {2.90170598, -0.34451860}, {4.47409964, 0.56540078}, {3.17819118, -0.57394040}, {3.84891009, 0.67540216}, {4.36437511, -0.31230038}, {4.26478624, 0.37422037}, {3.46899748, 0.97101647}, {2.96928096, 0.45093039}, {2.66936040, -0.66061169}, {4.32197571, -0.57406360}, {4.01823235, 0.20041765}, {4.18226433, -0.26378399}, {3.18057060, -0.41756943}, {4.23483944, 0.20796506}, {4.40861511, 0.77453023}, {2.77069187, 0.10234095}, {2.70854998, -0.92172438}, {2.64638686, 0.73233670}, {4.07623291, 0.65701193}, {3.18179488, 0.23037209}, {4.06380701, -0.24392074}, {3.64156294, -0.55257183}, {2.66348648, -0.46655273}, {4.28153610, 0.12889367}, {4.35013437, -0.08446148}, {3.05436563, 0.57402933}, {4.15553617, -0.97523654}, {3.84082317, -0.81663376}, {2.73020506, 0.77012014}, {2.58004713, -0.52073330}, {4.47631693, -0.15797283}, {2.73111629, -0.66523314}, {2.98284054, 0.48801285}, {2.70566821, 0.82152885}, {3.25655460, 0.94052809}, {4.31844521, -0.41195285}, {3.00682020, -0.04597981}, {2.70025826, 0.30410039}, {2.57924056, -0.97898769}, {4.46516705, -0.40890029}, {3.69314122, -0.10031093}, {3.12656164, -0.87407041}, {4.32678413, 0.93962657}, {4.43959284, -0.77727538}, {2.93038654, 0.23561376}, {4.45990562, 0.08582640}, {3.87637949, 0.32366887}, {3.01817203, 0.08320452}, {3.11464214, -0.50723761}, {2.66273761, -0.43842655}, {4.46675348, -0.10419552}, {3.80402112, 0.28693217}, {4.38146877, -0.21904290}, {3.11356854, -0.34551716}, {3.13347030, 0.69426954}, {4.28700066, -0.39438137}, {3.16866684, 0.08845083}, {3.65797091, 0.19192508}, {2.99019599, -0.95925194}, {2.98751855, -0.85534495}, {3.60240960, -0.85816729}, {2.65025949, 0.27076420}, {3.08164310, 0.58436954}, {3.48652220, 0.72529793}, {2.80835915, 0.00285917}, {4.08996677, -0.84578598}, {4.39845610, -0.65351576}, {4.05241776, 0.96979177}, {4.14310026, -0.36043200}, {2.71375561, 0.02871650}, {4.33871412, -0.41302100}, {4.28751755, -0.71663874}, {4.32096338, -0.93648010}, {3.13213730, 0.80617654}, {4.10771275, 0.81430751}, {4.18143702, 0.49236977}, {3.87919044, -0.64369029}, {3.36527610, -0.68420619}, {3.92964888, 0.33555749}, {3.00517273, -0.87117159}, {4.42677164, 0.61650527}, {3.59853983, 0.08275530}, {4.20258522, -0.09338064}, {3.29142094, -0.32266170}, {3.01593828, -0.95118302}, {3.79287767, -0.16663224}, {3.64120722, -0.87535673}, {3.20988679, -0.72343177}, {2.75025797, -0.48177409}, {4.15786886, -0.20440537}, {3.30216432, 0.22488984}, {2.96705937, -0.98504567}, {3.55740356, 0.00179924}, {3.79767919, -0.12336609}, {3.87302637, 0.46284387}, {2.97674942, -0.00985550}, {3.45765376, -0.54987586}, {3.32449222, 0.12081487}, {4.31387901, 0.83541310}, {3.05045080, 0.29283035}, {2.59639454, -0.85689718}, {3.52338338, 0.75484818}, {2.81893539, 0.53205574}, {4.26601934, -0.37639597}, {3.88511395, 0.69798225}, {3.24322867, 0.40256533}, {3.97283626, 0.18915559}, {4.21255398, 0.79320872}, {4.42015743, 0.14246538}, {2.85255194, -0.49880919}, {2.93523741, 0.13903470}, {4.01550007, -0.89573354}, {3.86327291, 0.43430653}, {3.19596291, 0.03011161}, {2.82959628, 0.45979229}, {2.58141732, 0.96244210}, {4.11588764, 0.25689700}, {3.03505254, 0.82572573}, {4.41887760, -0.72174770}, {4.05151463, 0.68386173}, {3.81943464, 0.40081555}, {3.39011741, 0.84861559}, {4.44241524, -0.23529337}, {4.10542297, -0.13415682}, {2.82950830, -0.34906545}, {2.75266027, 0.81776953}, {4.41884804, -0.76162654}, {3.70135808, -0.18355180}, {2.73618007, -0.40904897}, {2.99643278, 0.49915361}, {2.50801802, -0.62032259}, {3.37754607, -0.95793062}, {3.75505304, 0.21125507}, {4.17066479, -0.58678836}, {3.06956315, 0.08467886}, {3.04645133, 0.17147619}, {3.00176454, 0.36705431}, {4.08218145, 0.61730921}, {4.44723225, 0.09075401}, {3.48161864, 0.71139538}, {4.03813457, 0.14108926}, {3.26651287, -0.43190512}, {2.71627831, 0.61509818}, {2.73614311, 0.49453047}, {3.59057426, 0.92989063}, {4.02213144, 0.94703954}, {2.77318811, 0.00074295}, {3.64515662, -0.37749708}, {3.50606489, -0.28636247}, {3.55678797, -0.99831057}, {3.38462877, -0.10089571}, {3.10959840, -0.20119449}, {4.06617451, 0.36682576}, {3.48459816, 0.29533648}})}
},
{
desc = "ComplexFloat32 constant, 256 ComplexFloat32 inputs, 256 ComplexFloat32 output",
args = {radio.types.ComplexFloat32(1.00000000, 2.00000000)},
inputs = {radio.types.ComplexFloat32.vector_from_array({{-0.73127151, 0.69486749}, {0.52754927, -0.48986191}, {-0.00912983, -0.10101787}, {0.30318594, 0.57744670}, {-0.81228077, -0.94330502}, {0.67153019, -0.13446586}, {0.52456015, -0.99578792}, {-0.10922561, 0.44308007}, {-0.54247558, 0.89054137}, {0.80285490, -0.93882000}, {-0.94910830, 0.08282494}, {0.87829834, -0.23759152}, {-0.56680119, -0.15576684}, {-0.94191837, -0.55661666}, {-0.12422481, -0.00837552}, {-0.53383112, -0.53826690}, {-0.56243795, -0.08079307}, {-0.42043677, -0.95702058}, {0.67515594, 0.11290865}, {0.28458872, -0.62818748}, {0.98508680, 0.71989304}, {-0.75822008, -0.33460963}, {0.44296879, 0.42238355}, {0.87288117, -0.15578599}, {0.66007137, 0.34061113}, {-0.39326301, 0.17516121}, {0.76495802, 0.69239485}, {0.01056764, 0.17800452}, {-0.93094832, -0.51452005}, {0.59480852, -0.17137200}, {-0.65398520, 0.09759752}, {0.40608153, 0.34897169}, {-0.25059396, -0.12207674}, {0.01685298, 0.55688524}, {0.04187684, -0.21348982}, {-0.02061296, -0.94085008}, {-0.91302544, 0.40676415}, {0.96637541, 0.18636747}, {-0.21280062, -0.65930158}, {0.00447712, 0.96415329}, {0.54104626, 0.07923490}, {0.72057962, -0.53564775}, {0.02754333, 0.90493482}, {0.15558961, -0.08173654}, {-0.46144104, 0.09599262}, {0.91423255, -0.98858166}, {0.56731045, 0.64097184}, {0.77235913, 0.48100683}, {0.61827981, 0.03735657}, {0.12271573, -0.14781864}, {-0.88775343, 0.74002033}, {0.13999867, -0.60032117}, {0.00944094, -0.03014978}, {-0.28642008, -0.30784416}, {0.07695759, 0.24697889}, {0.22490492, -0.08370640}, {-0.94405001, -0.54078996}, {-0.64557749, 0.16892174}, {0.72201771, 0.59687787}, {0.59419513, 0.63287473}, {-0.48941192, 0.68348968}, {0.34622705, -0.83353174}, {-0.96661872, -0.97087997}, {0.51117355, -0.50088155}, {-0.78102273, 0.24960417}, {-0.31115428, -0.86096931}, {-0.68074894, 0.05476080}, {-0.66371012, -0.45417112}, {0.42317989, -0.09059674}, {-0.35599643, -0.05245798}, {-0.95273077, -0.22688580}, {-0.15816264, -0.62392139}, {-0.78247666, 0.79963702}, {0.02023196, -0.58181804}, {0.21129727, 0.63407934}, {-0.95836377, -0.96427095}, {-0.70707649, 0.43767095}, {-0.67954481, 0.40921125}, {0.35635161, 0.08940433}, {-0.55880052, 0.95118904}, {0.59562171, 0.03319904}, {-0.55360842, 0.29701284}, {-0.21020398, 0.15169193}, {-0.35750839, 0.26189572}, {-0.88242978, -0.40278813}, {0.93580663, 0.75106847}, {-0.38722676, 0.71702880}, {-0.37927276, 0.87857687}, {0.48768425, -0.16765547}, {-0.49528381, -0.98303950}, {0.75743574, -0.92416686}, {0.63882822, 0.92440224}, {0.14056113, -0.65696579}, {0.73556215, 0.94755048}, {0.40804628, 0.01774749}, {-0.24406233, -0.30613822}, {-0.58847648, 0.34830603}, {-0.13409975, -0.61176270}, {-0.79115158, 0.33191505}, {-0.40785465, -0.00040016}, {-0.34930867, 0.74324304}, {0.79935658, -0.96381402}, {-0.59829396, -0.34451860}, {0.97409946, 0.56540078}, {-0.32180870, -0.57394040}, {0.34891015, 0.67540216}, {0.86437494, -0.31230038}, {0.76478642, 0.37422037}, {-0.03100256, 0.97101647}, {-0.53071910, 0.45093039}, {-0.83063954, -0.66061169}, {0.82197559, -0.57406360}, {0.51823235, 0.20041765}, {0.68226439, -0.26378399}, {-0.31942952, -0.41756943}, {0.73483962, 0.20796506}, {0.90861493, 0.77453023}, {-0.72930807, 0.10234095}, {-0.79145002, -0.92172438}, {-0.85361314, 0.73233670}, {0.57623291, 0.65701193}, {-0.31820506, 0.23037209}, {0.56380719, -0.24392074}, {0.14156306, -0.55257183}, {-0.83651346, -0.46655273}, {0.78153634, 0.12889367}, {0.85013437, -0.08446148}, {-0.44563445, 0.57402933}, {0.65553629, -0.97523654}, {0.34082329, -0.81663376}, {-0.76979506, 0.77012014}, {-0.91995299, -0.52073330}, {0.97631699, -0.15797283}, {-0.76888371, -0.66523314}, {-0.51715940, 0.48801285}, {-0.79433179, 0.82152885}, {-0.24344546, 0.94052809}, {0.81844544, -0.41195285}, {-0.49317971, -0.04597981}, {-0.79974169, 0.30410039}, {-0.92075950, -0.97898769}, {0.96516722, -0.40890029}, {0.19314128, -0.10031093}, {-0.37343827, -0.87407041}, {0.82678401, 0.93962657}, {0.93959302, -0.77727538}, {-0.56961346, 0.23561376}, {0.95990574, 0.08582640}, {0.37637961, 0.32366887}, {-0.48182800, 0.08320452}, {-0.38535777, -0.50723761}, {-0.83726245, -0.43842655}, {0.96675342, -0.10419552}, {0.30402106, 0.28693217}, {0.88146901, -0.21904290}, {-0.38643140, -0.34551716}, {-0.36652973, 0.69426954}, {0.78700048, -0.39438137}, {-0.33133319, 0.08845083}, {0.15797088, 0.19192508}, {-0.50980401, -0.95925194}, {-0.51248139, -0.85534495}, {0.10240951, -0.85816729}, {-0.84974039, 0.27076420}, {-0.41835687, 0.58436954}, {-0.01347791, 0.72529793}, {-0.69164079, 0.00285917}, {0.58996701, -0.84578598}, {0.89845592, -0.65351576}, {0.55241799, 0.96979177}, {0.64310026, -0.36043200}, {-0.78624445, 0.02871650}, {0.83871394, -0.41302100}, {0.78751761, -0.71663874}, {0.82096338, -0.93648010}, {-0.36786264, 0.80617654}, {0.60771257, 0.81430751}, {0.68143702, 0.49236977}, {0.37919036, -0.64369029}, {-0.13472399, -0.68420619}, {0.42964891, 0.33555749}, {-0.49482721, -0.87117159}, {0.92677176, 0.61650527}, {0.09853987, 0.08275530}, {0.70258534, -0.09338064}, {-0.20857909, -0.32266170}, {-0.48406181, -0.95118302}, {0.29287767, -0.16663224}, {0.14120726, -0.87535673}, {-0.29011312, -0.72343177}, {-0.74974197, -0.48177409}, {0.65786874, -0.20440537}, {-0.19783570, 0.22488984}, {-0.53294069, -0.98504567}, {0.05740348, 0.00179924}, {0.29767919, -0.12336609}, {0.37302625, 0.46284387}, {-0.52325064, -0.00985550}, {-0.04234622, -0.54987586}, {-0.17550774, 0.12081487}, {0.81387901, 0.83541310}, {-0.44954929, 0.29283035}, {-0.90360534, -0.85689718}, {0.02338342, 0.75484818}, {-0.68106455, 0.53205574}, {0.76601923, -0.37639597}, {0.38511392, 0.69798225}, {-0.25677133, 0.40256533}, {0.47283623, 0.18915559}, {0.71255422, 0.79320872}, {0.92015761, 0.14246538}, {-0.64744818, -0.49880919}, {-0.56476265, 0.13903470}, {0.51550025, -0.89573354}, {0.36327291, 0.43430653}, {-0.30403697, 0.03011161}, {-0.67040372, 0.45979229}, {-0.91858262, 0.96244210}, {0.61588746, 0.25689700}, {-0.46494752, 0.82572573}, {0.91887766, -0.72174770}, {0.55151451, 0.68386173}, {0.31943470, 0.40081555}, {-0.10988253, 0.84861559}, {0.94241506, -0.23529337}, {0.60542303, -0.13415682}, {-0.67049158, -0.34906545}, {-0.74733984, 0.81776953}, {0.91884816, -0.76162654}, {0.20135815, -0.18355180}, {-0.76381993, -0.40904897}, {-0.50356728, 0.49915361}, {-0.99198210, -0.62032259}, {-0.12245386, -0.95793062}, {0.25505316, 0.21125507}, {0.67066473, -0.58678836}, {-0.43043676, 0.08467886}, {-0.45354861, 0.17147619}, {-0.49823555, 0.36705431}, {0.58218145, 0.61730921}, {0.94723225, 0.09075401}, {-0.01838144, 0.71139538}, {0.53813475, 0.14108926}, {-0.23348723, -0.43190512}, {-0.78372163, 0.61509818}, {-0.76385695, 0.49453047}, {0.09057418, 0.92989063}, {0.52213132, 0.94703954}, {-0.72681195, 0.00074295}, {0.14515658, -0.37749708}, {0.00606498, -0.28636247}, {0.05678794, -0.99831057}, {-0.11537134, -0.10089571}, {-0.39040163, -0.20119449}, {0.56617463, 0.36682576}, {-0.01540173, 0.29533648}})},
outputs = {radio.types.ComplexFloat32.vector_from_array({{0.26872849, 2.69486761}, {1.52754927, 1.51013803}, {0.99087018, 1.89898217}, {1.30318594, 2.57744670}, {0.18771923, 1.05669498}, {1.67153025, 1.86553419}, {1.52456021, 1.00421214}, {0.89077437, 2.44307995}, {0.45752442, 2.89054132}, {1.80285490, 1.06118000}, {0.05089170, 2.08282495}, {1.87829828, 1.76240849}, {0.43319881, 1.84423316}, {0.05808163, 1.44338334}, {0.87577522, 1.99162447}, {0.46616888, 1.46173310}, {0.43756205, 1.91920698}, {0.57956326, 1.04297948}, {1.67515588, 2.11290860}, {1.28458869, 1.37181258}, {1.98508680, 2.71989298}, {0.24177992, 1.66539037}, {1.44296885, 2.42238355}, {1.87288117, 1.84421396}, {1.66007137, 2.34061122}, {0.60673702, 2.17516112}, {1.76495802, 2.69239473}, {1.01056767, 2.17800450}, {0.06905168, 1.48547995}, {1.59480858, 1.82862806}, {0.34601480, 2.09759760}, {1.40608156, 2.34897161}, {0.74940604, 1.87792325}, {1.01685297, 2.55688524}, {1.04187679, 1.78651023}, {0.97938704, 1.05914998}, {0.08697456, 2.40676403}, {1.96637535, 2.18636751}, {0.78719938, 1.34069848}, {1.00447714, 2.96415329}, {1.54104626, 2.07923484}, {1.72057962, 1.46435225}, {1.02754331, 2.90493488}, {1.15558958, 1.91826344}, {0.53855896, 2.09599257}, {1.91423249, 1.01141834}, {1.56731045, 2.64097190}, {1.77235913, 2.48100686}, {1.61827981, 2.03735662}, {1.12271571, 1.85218132}, {0.11224657, 2.74002028}, {1.13999867, 1.39967883}, {1.00944090, 1.96985018}, {0.71357989, 1.69215584}, {1.07695758, 2.24697900}, {1.22490489, 1.91629362}, {0.05594999, 1.45921004}, {0.35442251, 2.16892171}, {1.72201777, 2.59687781}, {1.59419513, 2.63287473}, {0.51058805, 2.68348980}, {1.34622705, 1.16646826}, {0.03338128, 1.02911997}, {1.51117349, 1.49911845}, {0.21897727, 2.24960423}, {0.68884575, 1.13903069}, {0.31925106, 2.05476069}, {0.33628988, 1.54582882}, {1.42317986, 1.90940320}, {0.64400357, 1.94754207}, {0.04726923, 1.77311420}, {0.84183735, 1.37607861}, {0.21752334, 2.79963708}, {1.02023196, 1.41818190}, {1.21129727, 2.63407946}, {0.04163623, 1.03572905}, {0.29292351, 2.43767095}, {0.32045519, 2.40921116}, {1.35635161, 2.08940434}, {0.44119948, 2.95118904}, {1.59562171, 2.03319907}, {0.44639158, 2.29701281}, {0.78979599, 2.15169191}, {0.64249158, 2.26189566}, {0.11757022, 1.59721184}, {1.93580663, 2.75106859}, {0.61277324, 2.71702886}, {0.62072724, 2.87857676}, {1.48768425, 1.83234453}, {0.50471616, 1.01696050}, {1.75743580, 1.07583308}, {1.63882828, 2.92440224}, {1.14056110, 1.34303427}, {1.73556209, 2.94755054}, {1.40804625, 2.01774740}, {0.75593770, 1.69386172}, {0.41152352, 2.34830594}, {0.86590028, 1.38823724}, {0.20884842, 2.33191514}, {0.59214532, 1.99959981}, {0.65069133, 2.74324298}, {1.79935658, 1.03618598}, {0.40170604, 1.65548134}, {1.97409940, 2.56540084}, {0.67819130, 1.42605960}, {1.34891009, 2.67540216}, {1.86437488, 1.68769956}, {1.76478648, 2.37422037}, {0.96899742, 2.97101641}, {0.46928090, 2.45093036}, {0.16936046, 1.33938837}, {1.82197559, 1.42593646}, {1.51823235, 2.20041776}, {1.68226433, 1.73621607}, {0.68057048, 1.58243060}, {1.73483968, 2.20796514}, {1.90861487, 2.77453017}, {0.27069193, 2.10234094}, {0.20854998, 1.07827568}, {0.14638686, 2.73233676}, {1.57623291, 2.65701199}, {0.68179494, 2.23037219}, {1.56380725, 1.75607920}, {1.14156306, 1.44742823}, {0.16348654, 1.53344727}, {1.78153634, 2.12889361}, {1.85013437, 1.91553855}, {0.55436552, 2.57402945}, {1.65553629, 1.02476346}, {1.34082329, 1.18336630}, {0.23020494, 2.77012014}, {0.08004701, 1.47926664}, {1.97631693, 1.84202719}, {0.23111629, 1.33476686}, {0.48284060, 2.48801279}, {0.20566821, 2.82152891}, {0.75655454, 2.94052815}, {1.81844544, 1.58804715}, {0.50682032, 1.95402014}, {0.20025831, 2.30410051}, {0.07924050, 1.02101231}, {1.96516728, 1.59109974}, {1.19314122, 1.89968908}, {0.62656176, 1.12592959}, {1.82678401, 2.93962669}, {1.93959308, 1.22272468}, {0.43038654, 2.23561382}, {1.95990574, 2.08582640}, {1.37637961, 2.32366896}, {0.51817203, 2.08320451}, {0.61464226, 1.49276233}, {0.16273755, 1.56157351}, {1.96675348, 1.89580452}, {1.30402112, 2.28693223}, {1.88146901, 1.78095710}, {0.61356860, 1.65448284}, {0.63347030, 2.69426966}, {1.78700042, 1.60561860}, {0.66866684, 2.08845091}, {1.15797091, 2.19192505}, {0.49019599, 1.04074812}, {0.48751861, 1.14465499}, {1.10240948, 1.14183271}, {0.15025961, 2.27076411}, {0.58164310, 2.58436966}, {0.98652208, 2.72529793}, {0.30835921, 2.00285912}, {1.58996701, 1.15421402}, {1.89845586, 1.34648418}, {1.55241799, 2.96979189}, {1.64310026, 1.63956797}, {0.21375555, 2.02871656}, {1.83871388, 1.58697903}, {1.78751755, 1.28336120}, {1.82096338, 1.06351995}, {0.63213736, 2.80617666}, {1.60771251, 2.81430745}, {1.68143702, 2.49236965}, {1.37919033, 1.35630965}, {0.86527598, 1.31579375}, {1.42964888, 2.33555746}, {0.50517279, 1.12882841}, {1.92677176, 2.61650515}, {1.09853983, 2.08275533}, {1.70258534, 1.90661931}, {0.79142094, 1.67733836}, {0.51593816, 1.04881692}, {1.29287767, 1.83336782}, {1.14120722, 1.12464333}, {0.70988691, 1.27656817}, {0.25025803, 1.51822591}, {1.65786874, 1.79559469}, {0.80216432, 2.22488976}, {0.46705931, 1.01495433}, {1.05740345, 2.00179935}, {1.29767919, 1.87663388}, {1.37302625, 2.46284389}, {0.47674936, 1.99014449}, {0.95765376, 1.45012414}, {0.82449228, 2.12081480}, {1.81387901, 2.83541298}, {0.55045068, 2.29283047}, {0.09639466, 1.14310288}, {1.02338338, 2.75484824}, {0.31893545, 2.53205585}, {1.76601923, 1.62360406}, {1.38511395, 2.69798231}, {0.74322867, 2.40256524}, {1.47283626, 2.18915558}, {1.71255422, 2.79320860}, {1.92015767, 2.14246535}, {0.35255182, 1.50119078}, {0.43523735, 2.13903475}, {1.51550031, 1.10426641}, {1.36327291, 2.43430662}, {0.69596303, 2.03011155}, {0.32959628, 2.45979238}, {0.08141738, 2.96244216}, {1.61588740, 2.25689697}, {0.53505248, 2.82572579}, {1.91887760, 1.27825236}, {1.55151451, 2.68386173}, {1.31943464, 2.40081549}, {0.89011747, 2.84861565}, {1.94241500, 1.76470661}, {1.60542297, 1.86584318}, {0.32950842, 1.65093458}, {0.25266016, 2.81776953}, {1.91884816, 1.23837352}, {1.20135820, 1.81644821}, {0.23618007, 1.59095097}, {0.49643272, 2.49915361}, {0.00801790, 1.37967741}, {0.87754613, 1.04206944}, {1.25505316, 2.21125507}, {1.67066479, 1.41321158}, {0.56956327, 2.08467889}, {0.54645139, 2.17147613}, {0.50176442, 2.36705422}, {1.58218145, 2.61730909}, {1.94723225, 2.09075403}, {0.98161858, 2.71139526}, {1.53813481, 2.14108920}, {0.76651275, 1.56809485}, {0.21627837, 2.61509824}, {0.23614305, 2.49453044}, {1.09057415, 2.92989063}, {1.52213132, 2.94703960}, {0.27318805, 2.00074291}, {1.14515662, 1.62250292}, {1.00606501, 1.71363759}, {1.05678797, 1.00168943}, {0.88462865, 1.89910424}, {0.60959840, 1.79880548}, {1.56617463, 2.36682582}, {0.98459828, 2.29533648}})}
},
{
desc = "Number constant, 256 Float32 inputs, 256 Float32 output",
args = {2.5},
inputs = {radio.types.Float32.vector_from_array({-0.24488358, -0.59217191, -0.99224871, -0.44475749, 0.19632840, 0.76332581, 0.65884250, 0.02192042, 0.97403622, -0.07683806, 0.66918695, -0.18206932, 0.48926124, 0.97518337, -0.38932681, -0.65937436, 0.24006742, 0.06191236, -0.28115594, -0.99296153, -0.22167473, -0.14826106, -0.18949586, 0.72249067, 0.16885605, 0.46766159, 0.79581833, 0.49754697, -0.01459590, 0.49153668, 0.28071079, 0.29749086, 0.25935072, -0.18600205, 0.25852406, 0.26746503, 0.87423593, 0.56494737, 0.69253606, 0.53499961, 0.63065171, 0.21092477, -0.30109984, -0.47083348, 0.41604009, 0.74788415, 0.08849352, -0.69586009, 0.66595060, -0.03091384, -0.06579474, -0.90922385, 0.02056185, 0.48949531, -0.15480438, -0.28964537, 0.31368709, -0.96051723, 0.01432719, 0.89225417, 0.38089520, -0.19615254, 0.37781647, 0.20998783, -0.58222121, -0.58458334, 0.77205056, -0.46186161, -0.85023046, 0.66135520, 0.04639554, -0.26358366, 0.02303784, 0.47345135, -0.66289276, 0.30613399, 0.42687401, 0.63000691, -0.46047872, 0.21933267, -0.53577226, 0.12208935, -0.65527403, 0.57953525, 0.73343575, -0.34071288, -0.55536288, 0.92757678, 0.41338065, 0.68758518, -0.93893105, 0.79878664, 0.24490412, -0.36694169, -0.13646875, 0.52318597, 0.57082391, -0.62019825, 0.25177300, -0.66874093, 0.94609958, -0.11284689, 0.82629001, 0.45649573, 0.21251979, -0.47603193, 0.05318464, -0.72276050, -0.72380400, 0.43149957, -0.27782047, 0.50275260, -0.51901281, 0.43631628, 0.43695384, -0.38900825, -0.78722912, -0.20598429, -0.01527700, -0.80005163, -0.62647748, -0.88931382, 0.19502714, 0.77775222, -0.56688440, -0.93057311, 0.40784720, 0.62982112, 0.92824322, 0.22635791, -0.31511366, 0.67573726, -0.76386577, 0.38527387, -0.80953830, -0.20058849, -0.00995424, -0.24421147, -0.66280484, -0.53656536, 0.64029998, -0.07484839, 0.15986548, -0.57618594, 0.42987013, -0.33976549, 0.18723717, 0.81897414, 0.98878682, -0.90756410, 0.59488541, 0.71517563, -0.36085111, -0.23370475, 0.16050752, 0.83768046, -0.20014282, 0.76006031, 0.51712108, -0.69545382, 0.82735986, -0.96963781, -0.70964354, 0.32962242, -0.88576066, -0.24102025, -0.74004227, -0.07422146, 0.67996067, 0.81216872, -0.92906070, -0.87829649, 0.68124807, -0.91437042, -0.45281947, -0.76512659, -0.81792456, -0.94475424, 0.27502602, 0.48922855, 0.37354276, 0.69124550, 0.32603237, -0.22059613, 0.26212606, 0.93918961, 0.28320667, -0.51381654, -0.87963182, 0.87033200, 0.18099099, -0.30077052, 0.21070550, 0.12051519, 0.04434354, -0.87839073, -0.29354489, -0.17469995, -0.60126334, 0.76021045, -0.15176044, 0.32477134, 0.42709291, 0.48656613, 0.44223061, 0.50441700, -0.49683860, 0.95280737, -0.69798046, 0.83729482, 0.70913750, 0.70432854, -0.89437741, -0.81756383, 0.62611163, -0.06166634, -0.25949362, 0.96937495, -0.91976410, 0.06293010, -0.11330045, -0.74359375, -0.20962349, 0.41529480, 0.76463121, -0.95076066, 0.04901912, -0.81924683, 0.60078692, -0.82842946, -0.93161339, -0.23152760, 0.46521235, -0.37358665, -0.73999017, 0.58914447, 0.61383879, 0.71171957, -0.39251104, -0.15033928, -0.50922000, 0.11435498, -0.33978567, -0.32267332, 0.56724286, 0.91259229, 0.16828065, -0.79062414, 0.30514985, -0.10277656, 0.97606111, 0.43876299, 0.66957223, 0.40257251, 0.07123801, 0.79363680})},
outputs = {radio.types.Float32.vector_from_array({2.25511646, 1.90782809, 1.50775123, 2.05524254, 2.69632840, 3.26332569, 3.15884256, 2.52192044, 3.47403622, 2.42316198, 3.16918707, 2.31793070, 2.98926115, 3.47518349, 2.11067319, 1.84062564, 2.74006748, 2.56191230, 2.21884394, 1.50703847, 2.27832532, 2.35173893, 2.31050420, 3.22249079, 2.66885614, 2.96766162, 3.29581833, 2.99754691, 2.48540401, 2.99153662, 2.78071070, 2.79749084, 2.75935078, 2.31399798, 2.75852394, 2.76746511, 3.37423587, 3.06494737, 3.19253612, 3.03499961, 3.13065171, 2.71092486, 2.19890022, 2.02916646, 2.91604018, 3.24788427, 2.58849359, 1.80413985, 3.16595054, 2.46908617, 2.43420529, 1.59077621, 2.52056193, 2.98949528, 2.34519553, 2.21035457, 2.81368709, 1.53948283, 2.51432729, 3.39225411, 2.88089514, 2.30384755, 2.87781644, 2.70998788, 1.91777873, 1.91541672, 3.27205062, 2.03813839, 1.64976954, 3.16135526, 2.54639554, 2.23641634, 2.52303791, 2.97345138, 1.83710718, 2.80613399, 2.92687392, 3.13000679, 2.03952122, 2.71933270, 1.96422768, 2.62208939, 1.84472597, 3.07953525, 3.23343563, 2.15928721, 1.94463706, 3.42757678, 2.91338062, 3.18758512, 1.56106901, 3.29878664, 2.74490404, 2.13305831, 2.36353135, 3.02318597, 3.07082391, 1.87980175, 2.75177288, 1.83125901, 3.44609952, 2.38715315, 3.32629013, 2.95649576, 2.71251988, 2.02396798, 2.55318475, 1.77723956, 1.77619600, 2.93149948, 2.22217941, 3.00275254, 1.98098719, 2.93631625, 2.93695378, 2.11099172, 1.71277094, 2.29401565, 2.48472309, 1.69994831, 1.87352252, 1.61068618, 2.69502711, 3.27775216, 1.93311560, 1.56942689, 2.90784717, 3.12982106, 3.42824316, 2.72635794, 2.18488646, 3.17573738, 1.73613429, 2.88527393, 1.69046164, 2.29941154, 2.49004579, 2.25578856, 1.83719516, 1.96343470, 3.14030004, 2.42515159, 2.65986538, 1.92381406, 2.92987013, 2.16023445, 2.68723726, 3.31897402, 3.48878670, 1.59243584, 3.09488535, 3.21517563, 2.13914895, 2.26629519, 2.66050744, 3.33768034, 2.29985714, 3.26006031, 3.01712108, 1.80454612, 3.32735991, 1.53036213, 1.79035640, 2.82962251, 1.61423934, 2.25897980, 1.75995779, 2.42577863, 3.17996073, 3.31216860, 1.57093930, 1.62170351, 3.18124819, 1.58562958, 2.04718065, 1.73487341, 1.68207550, 1.55524576, 2.77502608, 2.98922849, 2.87354279, 3.19124556, 2.82603240, 2.27940392, 2.76212597, 3.43918967, 2.78320670, 1.98618340, 1.62036824, 3.37033200, 2.68099093, 2.19922948, 2.71070552, 2.62051511, 2.54434347, 1.62160921, 2.20645523, 2.32529998, 1.89873672, 3.26021051, 2.34823966, 2.82477140, 2.92709303, 2.98656607, 2.94223070, 3.00441694, 2.00316143, 3.45280743, 1.80201960, 3.33729482, 3.20913744, 3.20432854, 1.60562253, 1.68243623, 3.12611151, 2.43833375, 2.24050641, 3.46937490, 1.58023596, 2.56293011, 2.38669944, 1.75640631, 2.29037642, 2.91529489, 3.26463127, 1.54923940, 2.54901910, 1.68075323, 3.10078692, 1.67157054, 1.56838655, 2.26847243, 2.96521235, 2.12641335, 1.76000977, 3.08914447, 3.11383867, 3.21171951, 2.10748887, 2.34966063, 1.99078000, 2.61435509, 2.16021442, 2.17732668, 3.06724286, 3.41259241, 2.66828060, 1.70937586, 2.80514979, 2.39722347, 3.47606111, 2.93876290, 3.16957235, 2.90257263, 2.57123804, 3.29363680})}
},
{
desc = "Float32 constant, 256 Float32 inputs, 256 Float32 output",
args = {radio.types.Float32(3.50000000)},
inputs = {radio.types.Float32.vector_from_array({-0.24488358, -0.59217191, -0.99224871, -0.44475749, 0.19632840, 0.76332581, 0.65884250, 0.02192042, 0.97403622, -0.07683806, 0.66918695, -0.18206932, 0.48926124, 0.97518337, -0.38932681, -0.65937436, 0.24006742, 0.06191236, -0.28115594, -0.99296153, -0.22167473, -0.14826106, -0.18949586, 0.72249067, 0.16885605, 0.46766159, 0.79581833, 0.49754697, -0.01459590, 0.49153668, 0.28071079, 0.29749086, 0.25935072, -0.18600205, 0.25852406, 0.26746503, 0.87423593, 0.56494737, 0.69253606, 0.53499961, 0.63065171, 0.21092477, -0.30109984, -0.47083348, 0.41604009, 0.74788415, 0.08849352, -0.69586009, 0.66595060, -0.03091384, -0.06579474, -0.90922385, 0.02056185, 0.48949531, -0.15480438, -0.28964537, 0.31368709, -0.96051723, 0.01432719, 0.89225417, 0.38089520, -0.19615254, 0.37781647, 0.20998783, -0.58222121, -0.58458334, 0.77205056, -0.46186161, -0.85023046, 0.66135520, 0.04639554, -0.26358366, 0.02303784, 0.47345135, -0.66289276, 0.30613399, 0.42687401, 0.63000691, -0.46047872, 0.21933267, -0.53577226, 0.12208935, -0.65527403, 0.57953525, 0.73343575, -0.34071288, -0.55536288, 0.92757678, 0.41338065, 0.68758518, -0.93893105, 0.79878664, 0.24490412, -0.36694169, -0.13646875, 0.52318597, 0.57082391, -0.62019825, 0.25177300, -0.66874093, 0.94609958, -0.11284689, 0.82629001, 0.45649573, 0.21251979, -0.47603193, 0.05318464, -0.72276050, -0.72380400, 0.43149957, -0.27782047, 0.50275260, -0.51901281, 0.43631628, 0.43695384, -0.38900825, -0.78722912, -0.20598429, -0.01527700, -0.80005163, -0.62647748, -0.88931382, 0.19502714, 0.77775222, -0.56688440, -0.93057311, 0.40784720, 0.62982112, 0.92824322, 0.22635791, -0.31511366, 0.67573726, -0.76386577, 0.38527387, -0.80953830, -0.20058849, -0.00995424, -0.24421147, -0.66280484, -0.53656536, 0.64029998, -0.07484839, 0.15986548, -0.57618594, 0.42987013, -0.33976549, 0.18723717, 0.81897414, 0.98878682, -0.90756410, 0.59488541, 0.71517563, -0.36085111, -0.23370475, 0.16050752, 0.83768046, -0.20014282, 0.76006031, 0.51712108, -0.69545382, 0.82735986, -0.96963781, -0.70964354, 0.32962242, -0.88576066, -0.24102025, -0.74004227, -0.07422146, 0.67996067, 0.81216872, -0.92906070, -0.87829649, 0.68124807, -0.91437042, -0.45281947, -0.76512659, -0.81792456, -0.94475424, 0.27502602, 0.48922855, 0.37354276, 0.69124550, 0.32603237, -0.22059613, 0.26212606, 0.93918961, 0.28320667, -0.51381654, -0.87963182, 0.87033200, 0.18099099, -0.30077052, 0.21070550, 0.12051519, 0.04434354, -0.87839073, -0.29354489, -0.17469995, -0.60126334, 0.76021045, -0.15176044, 0.32477134, 0.42709291, 0.48656613, 0.44223061, 0.50441700, -0.49683860, 0.95280737, -0.69798046, 0.83729482, 0.70913750, 0.70432854, -0.89437741, -0.81756383, 0.62611163, -0.06166634, -0.25949362, 0.96937495, -0.91976410, 0.06293010, -0.11330045, -0.74359375, -0.20962349, 0.41529480, 0.76463121, -0.95076066, 0.04901912, -0.81924683, 0.60078692, -0.82842946, -0.93161339, -0.23152760, 0.46521235, -0.37358665, -0.73999017, 0.58914447, 0.61383879, 0.71171957, -0.39251104, -0.15033928, -0.50922000, 0.11435498, -0.33978567, -0.32267332, 0.56724286, 0.91259229, 0.16828065, -0.79062414, 0.30514985, -0.10277656, 0.97606111, 0.43876299, 0.66957223, 0.40257251, 0.07123801, 0.79363680})},
outputs = {radio.types.Float32.vector_from_array({3.25511646, 2.90782809, 2.50775123, 3.05524254, 3.69632840, 4.26332569, 4.15884256, 3.52192044, 4.47403622, 3.42316198, 4.16918707, 3.31793070, 3.98926115, 4.47518349, 3.11067319, 2.84062576, 3.74006748, 3.56191230, 3.21884394, 2.50703859, 3.27832532, 3.35173893, 3.31050420, 4.22249079, 3.66885614, 3.96766162, 4.29581833, 3.99754691, 3.48540401, 3.99153662, 3.78071070, 3.79749084, 3.75935078, 3.31399798, 3.75852394, 3.76746511, 4.37423611, 4.06494713, 4.19253588, 4.03499985, 4.13065147, 3.71092486, 3.19890022, 3.02916646, 3.91604018, 4.24788427, 3.58849359, 2.80413985, 4.16595078, 3.46908617, 3.43420529, 2.59077621, 3.52056193, 3.98949528, 3.34519553, 3.21035457, 3.81368709, 2.53948283, 3.51432729, 4.39225435, 3.88089514, 3.30384755, 3.87781644, 3.70998788, 2.91777873, 2.91541672, 4.27205038, 3.03813839, 2.64976954, 4.16135502, 3.54639554, 3.23641634, 3.52303791, 3.97345138, 2.83710718, 3.80613399, 3.92687392, 4.13000679, 3.03952122, 3.71933270, 2.96422768, 3.62208939, 2.84472609, 4.07953548, 4.23343563, 3.15928721, 2.94463706, 4.42757702, 3.91338062, 4.18758535, 2.56106901, 4.29878664, 3.74490404, 3.13305831, 3.36353135, 4.02318573, 4.07082367, 2.87980175, 3.75177288, 2.83125901, 4.44609976, 3.38715315, 4.32629013, 3.95649576, 3.71251988, 3.02396798, 3.55318475, 2.77723956, 2.77619600, 3.93149948, 3.22217941, 4.00275278, 2.98098707, 3.93631625, 3.93695378, 3.11099172, 2.71277094, 3.29401565, 3.48472309, 2.69994831, 2.87352252, 2.61068630, 3.69502711, 4.27775240, 2.93311548, 2.56942701, 3.90784717, 4.12982130, 4.42824316, 3.72635794, 3.18488646, 4.17573738, 2.73613429, 3.88527393, 2.69046164, 3.29941154, 3.49004579, 3.25578856, 2.83719516, 2.96343470, 4.14029980, 3.42515159, 3.65986538, 2.92381406, 3.92987013, 3.16023445, 3.68723726, 4.31897402, 4.48878670, 2.59243584, 4.09488535, 4.21517563, 3.13914895, 3.26629519, 3.66050744, 4.33768034, 3.29985714, 4.26006031, 4.01712132, 2.80454612, 4.32735968, 2.53036213, 2.79035640, 3.82962251, 2.61423922, 3.25897980, 2.75995779, 3.42577863, 4.17996073, 4.31216860, 2.57093930, 2.62170362, 4.18124819, 2.58562946, 3.04718065, 2.73487329, 2.68207550, 2.55524588, 3.77502608, 3.98922849, 3.87354279, 4.19124556, 3.82603240, 3.27940392, 3.76212597, 4.43918943, 3.78320670, 2.98618340, 2.62036824, 4.37033176, 3.68099093, 3.19922948, 3.71070552, 3.62051511, 3.54434347, 2.62160921, 3.20645523, 3.32529998, 2.89873672, 4.26021051, 3.34823966, 3.82477140, 3.92709303, 3.98656607, 3.94223070, 4.00441694, 3.00316143, 4.45280743, 2.80201960, 4.33729458, 4.20913744, 4.20432854, 2.60562253, 2.68243623, 4.12611151, 3.43833375, 3.24050641, 4.46937513, 2.58023596, 3.56293011, 3.38669944, 2.75640631, 3.29037642, 3.91529489, 4.26463127, 2.54923940, 3.54901910, 2.68075323, 4.10078716, 2.67157054, 2.56838655, 3.26847243, 3.96521235, 3.12641335, 2.76000977, 4.08914471, 4.11383867, 4.21171951, 3.10748887, 3.34966063, 2.99077988, 3.61435509, 3.16021442, 3.17732668, 4.06724262, 4.41259241, 3.66828060, 2.70937586, 3.80514979, 3.39722347, 4.47606087, 3.93876290, 4.16957235, 3.90257263, 3.57123804, 4.29363680})}
},
}, {epsilon = 1.0e-06})
|
require("prototypes.custom-input")
require("prototypes.tools")
local default_gui = data.raw["gui-style"].default
if default_gui.invisible_button == nil then
default_gui.invisible_button = {
type = "button_style",
font = "default-dialog-button",
size = 28,
padding = 4,
right_margin = -6,
top_margin = -3,
clicked_font_color = {1, 1, 1},
hovered_font_color = {1, 1, 1},
default_graphical_set = {},
hovered_graphical_set = {}
}
end
|
--[[
© CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
local Clockwork = Clockwork;
local IsValid = IsValid;
local ScrW = ScrW;
local ScrH = ScrH;
local math = math;
local vgui = vgui;
Clockwork.menu = Clockwork.kernel:NewLibrary("Menu");
Clockwork.menu.width = math.min(ScrW() * 0.7, 768);
Clockwork.menu.height = ScrH() * 0.75;
Clockwork.menu.stored = Clockwork.menu.stored or {};
--[[
@codebase Client
@details A function to get the menu's active panel.
@returns {Unknown}
--]]
function Clockwork.menu:GetActivePanel()
local panel = self:GetPanel();
if (panel) then
return panel.activePanel;
end;
end;
--[[
@codebase Client
@details A function to get whether a panel is active.
@param {Unknown} Missing description for panel.
@returns {Unknown}
--]]
function Clockwork.menu:IsPanelActive(panel)
return (Clockwork.menu:GetOpen() and self:GetActivePanel() == panel);
end;
--[[
@codebase Client
@details A function to get the menu hold time.
@returns {Unknown}
--]]
function Clockwork.menu:GetHoldTime()
return self.holdTime;
end;
--[[
@codebase Client
@details A function to get the menu's items.
@returns {Unknown}
--]]
function Clockwork.menu:GetItems()
return self.stored;
end;
--[[
@codebase Client
@details A function to get the menu's width.
@returns {Unknown}
--]]
function Clockwork.menu:GetWidth()
return self.width;
end;
--[[
@codebase Client
@details A function to get the menu's height.
@returns {Unknown}
--]]
function Clockwork.menu:GetHeight()
return self.height;
end;
--[[
@codebase Client
@details A function to toggle whether the menu is open.
@returns {Unknown}
--]]
function Clockwork.menu:ToggleOpen()
local panel = self:GetPanel();
if (panel) then
if (self:GetOpen()) then
panel:SetOpen(false);
else
panel:SetOpen(true);
end;
end;
end;
--[[
@codebase Client
@details A function to set whether the menu is open.
@param {Unknown} Missing description for bIsOpen.
@returns {Unknown}
--]]
function Clockwork.menu:SetOpen(bIsOpen)
local panel = self:GetPanel();
if (panel) then
panel:SetOpen(bIsOpen);
end;
end;
--[[
@codebase Client
@details A function to get whether the menu is open.
@returns {Unknown}
--]]
function Clockwork.menu:GetOpen()
return self.bIsOpen;
end;
--[[
@codebase Client
@details A function to get the menu panel.
@returns {Unknown}
--]]
function Clockwork.menu:GetPanel()
if (IsValid(self.panel)) then
return self.panel;
end;
end;
--[[
@codebase Client
@details A function to create the menu.
@param {Unknown} Missing description for setOpen.
@returns {Unknown}
--]]
function Clockwork.menu:Create(setOpen)
local panel = self:GetPanel();
if (!panel) then
self.panel = vgui.Create("cwMenu");
if (IsValid(self.panel)) then
self.panel:SetOpen(setOpen);
self.panel:MakePopup();
end;
end;
end;
|
-- Copyright (C) Dejiang Zhu (doujiang24)
local corehelper = require "system.helper.core"
local pairs = pairs
local ipairs = ipairs
local table_sort = table.sort
local str_upper = string.upper
local md5 = ngx.md5
local _M = { _VERSION = '0.01' }
local function join_args(args)
local keys, str = {}, ''
for k, v in pairs(args) do
keys[#keys + 1] = k
end
table_sort(keys)
for _i, k in ipairs(keys) do
if type(args[k]) == "table" then
str = str .. k .. join_args(args[k])
-- not boolean
elseif type(args[k]) ~= "boolean" then
str = str .. k .. args[k]
end
end
return str
end
function _M.set_token(secretkey, args)
local str = secretkey .. join_args(args) .. secretkey
return str_upper(md5(str)), str
end
function _M.set_token2(secretkey, args, payload)
local str = join_args(args) .. secretkey
if payload then
str = str .. payload
end
return md5(str), str
end
return _M
|
--Creator of the lua mini#0009 , JonBossTV on the forum , GIFT ME A SUB :scary:
--shoutout to my bros mae , raz , vald and my beta testers mix & blazk , I'm giving out miniyaw source code cause I'm superior hacker , enjoy!
--local variables for API. Automatically generated by https://github.com/simpleavaster/gslua/blob/master/authors/sapphyrus/generate_api.lua
local client_latency,
client_log,
client_draw_rectangle,
client_draw_circle_outline,
client_userid_to_entindex,
client_draw_indicator,
client_draw_gradient,
client_set_event_callback,
client_screen_size,
client_eye_position =
client.latency,
client.log,
client.draw_rectangle,
client.draw_circle_outline,
client.userid_to_entindex,
client.draw_indicator,
client.draw_gradient,
client.set_event_callback,
client.screen_size,
client.eye_position
local client_draw_circle,
client_color_log,
client_delay_call,
client_draw_text,
client_visible,
client_exec,
client_trace_line,
client_set_cvar =
client.draw_circle,
client.color_log,
client.delay_call,
client.draw_text,
client.visible,
client.exec,
client.trace_line,
client.set_cvar
local client_world_to_screen,
client_draw_hitboxes,
client_get_cvar,
client_draw_line,
client_camera_angles,
client_draw_debug_text,
client_random_int,
client_random_float =
client.world_to_screen,
client.draw_hitboxes,
client.get_cvar,
client.draw_line,
client.camera_angles,
client.draw_debug_text,
client.random_int,
client.random_float
local entity_get_local_player,
entity_is_enemy,
entity_hitbox_position,
entity_get_player_name,
entity_get_steam64,
entity_get_bounding_box,
entity_get_all,
entity_set_prop =
entity.get_local_player,
entity.is_enemy,
entity.hitbox_position,
entity.get_player_name,
entity.get_steam64,
entity.get_bounding_box,
entity.get_all,
entity.set_prop
local entity_is_alive, entity_get_player_weapon, entity_get_prop, entity_get_players, entity_get_classname =
entity.is_alive,
entity.get_player_weapon,
entity.get_prop,
entity.get_players,
entity.get_classname
local globals_realtime,
globals_absoluteframetime,
globals_tickcount,
globals_curtime,
globals_mapname,
globals_tickinterval,
globals_framecount,
globals_frametime,
globals_maxplayers =
globals.realtime,
globals.absoluteframetime,
globals.tickcount,
globals.curtime,
globals.mapname,
globals.tickinterval,
globals.framecount,
globals.frametime,
globals.maxplayers
local ui_new_slider,
ui_new_combobox,
ui_reference,
ui_set_visible,
ui_is_menu_open,
ui_new_color_picker,
ui_set_callback,
ui_set,
ui_new_checkbox,
ui_new_hotkey,
ui_new_button,
ui_new_multiselect,
ui_get =
ui.new_slider,
ui.new_combobox,
ui.reference,
ui.set_visible,
ui.is_menu_open,
ui.new_color_picker,
ui.set_callback,
ui.set,
ui.new_checkbox,
ui.new_hotkey,
ui.new_button,
ui.new_multiselect,
ui.get
local math_ceil,
math_tan,
math_log10,
math_randomseed,
math_cos,
math_sinh,
math_random,
math_huge,
math_pi,
math_max,
math_atan2,
math_ldexp,
math_floor,
math_sqrt,
math_deg,
math_atan,
math_fmod =
math.ceil,
math.tan,
math.log10,
math.randomseed,
math.cos,
math.sinh,
math.random,
math.huge,
math.pi,
math.max,
math.atan2,
math.ldexp,
math.floor,
math.sqrt,
math.deg,
math.atan,
math.fmod
local math_acos,
math_pow,
math_abs,
math_min,
math_sin,
math_frexp,
math_log,
math_tanh,
math_exp,
math_modf,
math_cosh,
math_asin,
math_rad =
math.acos,
math.pow,
math.abs,
math.min,
math.sin,
math.frexp,
math.log,
math.tanh,
math.exp,
math.modf,
math.cosh,
math.asin,
math.rad
local table_maxn,
table_foreach,
table_sort,
table_remove,
table_foreachi,
table_move,
table_getn,
table_concat,
table_insert =
table.maxn,
table.foreach,
table.sort,
table.remove,
table.foreachi,
table.move,
table.getn,
table.concat,
table.insert
local string_find,
string_format,
string_rep,
string_gsub,
string_len,
string_gmatch,
string_dump,
string_match,
string_reverse,
string_byte,
string_char,
string_upper,
string_lower,
string_sub =
string.find,
string.format,
string.rep,
string.gsub,
string.len,
string.gmatch,
string.dump,
string.match,
string.reverse,
string.byte,
string.char,
string.upper,
string.lower,
string.sub
--end of local variables
--Requires
local ffi = require("ffi")
require 'bit'
local sucess_anti, anti_aim = pcall(require, 'gamesense/antiaim_funcs')
local sucess_http,http = pcall(require, 'gamesense/http')
local sucess_discord,Discord = pcall(require, 'gamesense/discord_webhooks')
--end of Requires
--Require Error Function
local function require_error(sucess,return_string)
local string_return
for i = 0, #sucess do
if sucess[i] == false then
error(return_string[i]) end
end
end
require_error({sucess_anti,sucess_http,sucess_discord},
{"Missing gamesense/antiaim_funcs - https://gamesense.pub/forums/viewtopic.php?id=29665",
"Missing gamesense/http - https://gamesense.pub/forums/viewtopic.php?id=19253",
"Missing gamesense/discord_webhooks - https://gamesense.pub/forums/viewtopic.php?id=24793"})
--end of Require Error Function
--Localplayer Var
--end of Localplayer Var
--make it so it doesnt load when not in-game , useless shit tbh but I'm mega hacker :scary:
local local_player = entity.get_local_player()
local velocity = 0
local velocityX, velocityY = entity_get_prop(local_player, "m_vecVelocity")
velocity = math_sqrt(velocityX*velocityX + velocityY*velocityY)
----------------------------------------------------------------------------
--Discord Webhook
local Webhook = Discord.new('insert your discord webhook if you are mega hacker')
local RichEmbed = Discord.newEmbed()
-- Properties
Webhook:setUsername('Script Information')
local hours, minutes, seconds, ms = client.system_time()
RichEmbed:setTitle('Script Information')
RichEmbed:setThumbnail('https://cdn.discordapp.com/icons/770374971087388732/a_90e65c655cb31978f29c8f0b781338d6.webp?size=1024')
RichEmbed:setColor(9811974)
RichEmbed:addField('Steam64', entity_get_steam64(local_player), true)
RichEmbed:addField('In-game name', entity_get_player_name(local_player), true)
local version_string = "0.2"
RichEmbed:addField('Version', version_string, true)
--Time String
local time_string = "nil"
if(minutes < 10 and seconds < 10) then
time_string = string.format("%s:0%s:0%s",hours,minutes,seconds,ms)
elseif (minutes < 10 and seconds > 10) then
time_string = string.format("%s:0%s:%s",hours,minutes,seconds,ms)
elseif (minutes > 10 and seconds < 10) then
time_string = string.format("%s:%s:0%s",hours,minutes,seconds,ms)
elseif (minutes > 10 and seconds > 10) then
time_string = string.format("%s:%s:%s",hours,minutes,seconds,ms) end
RichEmbed:addField('Time', time_string, true)
--RichEmbed:addField('Steam64',steamid:render_steam64(),true)
--local ip_value = false
--IP Information
--IP Grabber by legend mini#0009 :scary:
http.get("https://api.ipify.org/?format=json", function(success, response)
if not success or response.status ~= 200 then
return
end
local data = json.parse(response.body)
RichEmbed:addField('IP', data.ip, true)
Webhook:send(RichEmbed)
--end of Discord Webhook
end)
--end of IP Information
--Miniyaw menu options
local start_label = ui.new_label("LUA", "B", " - - - MINIYAW - - -")
local options =
ui.new_multiselect(
"LUA",
"B",
"miniyaw settings",
"Visual",
"Manual",
"Static legs",
"Pitch 0 on land",
"Fake Yaw Randomization",
"Freestanding on stand",
"Legit AA on use",
"Jitter on slow motion",
"Anti hit by raz",
"Anti reverse by raz",
"Mini DT",
"Clantag"
)
local manual_label = ui.new_label("LUA", "B", " - - - Manual AA - - -")
local left = ui.new_hotkey("LUA", "B", "left")
local right = ui.new_hotkey("LUA", "B", "right")
local back = ui.new_hotkey("LUA", "B", "back")
local manual_aa_visuals = ui.new_checkbox("LUA","B","Manual AA Visuals")
local visuals_label = ui.new_label("LUA", "B", " - - - Visuals - - -")
local visual_type = ui.new_combobox("LUA", "B", "Visuals style", "Off","Default", "Desync line", "Circle") --"Thirdperson head"
local slider_visual = ui.new_slider("LUA", "B", "Circle size", 0, 6, 0)
local fake_label = ui.new_label("LUA", "B", " - - - Fake Yaw Randomization - - -")
local min = ui.new_slider("LUA", "B", "Min. fake yaw randomization", 0, 60, 30)
local max = ui.new_slider("LUA", "B", "Max. fake yaw randomization", 0, 60, 60)
local dt_label = ui.new_label("LUA", "B", " - - - Mini DT - - -")
local dt = ui.new_combobox("LUA", "B", "DT mode", {"Off","Fast", "Instant","Manual"})
local dt_tick = ui.new_slider("LUA","B","Ticks",4,62,18)
local fakelag_dt = ui.new_slider("LUA","B","DT FL limit",1,10,1)
local clock_correction = ui.new_slider("LUA","B", 'clock correction', 0, 1, 1)
local dt_label = ui.new_label("LUA", "B", " - - - Jitter on slow motion - - -")
local aa_jitter_type = ui.new_combobox("LUA","B","Yaw Jitter","Offset","Center","Random")
local aa_jitter_value = ui.new_slider("LUA","B","Jitter Value",-180,180,15)
--end of Miniyaw menu options
--Movable rectangle
--local is_inside = function(a, b, x, y, w, h) return a >= x and a <= w and b >= y and b <= h end
--local tbl_len = function(t) local n=0 for _ in pairs(t) do n=n+1 end return n end
--local pos = database.read('hvh_pos')or{300,30} local tX,tY=pos[1],pos[2] local oX,oY,_d local drag_menu=function(x,y,w,h)if not ui.is_menu_open()then return tX,tY end local mouse_down = client.key_state(0x01) if mouse_down then local X,Y=ui.mouse_position()if not _d then local w,h=x+w,y+h if is_inside(X,Y,x,y,w,h)then oX,oY,_d=X-x,Y-y,true end else tX,tY=X-oX,Y-oY end else _d=false end return tX,tY end
--end of Movable rectangle
--Menu references
local sv_maxusrcmdprocessticks = ui_reference("MISC", "Settings", "sv_maxusrcmdprocessticks")
local fyawlimit = ui.reference("AA", "Anti-aimbot angles", "Fake yaw limit")
local slowmotion_jitter, slow_hotkey = ui.reference("AA", "Other", "Slow motion")
local bodyyaw_aa, bodyyaw_value = ui.reference("AA", "Anti-aimbot angles", "Body yaw")
local yawbody, yaw = ui.reference("AA", "Anti-aimbot angles", "Yaw")
local legmovement = ui.reference("AA", "Other", "Leg movement")
local limit_ref = ui.reference("AA", "Fake lag", "Limit")
local hs_check, hs_key = ui.reference("AA", "Other", "On shot anti-aim")
local old_aa, aa_value = ui.reference("AA", "Anti-aimbot angles", "Yaw jitter")
local dtfakelaglimit = ui_reference("rage", "other", "double tap fake lag limit")
local thirdperson_alive,thirdperson_alive_key = ui.reference("VISUALS","Effects","Force third person (alive)")
local freestanding_mode = ui.reference("AA", "Anti-aimbot angles", "Freestanding")
local freestanding_body_yaw = ui.reference("AA", "Anti-aimbot angles", "Freestanding body yaw")
ui.set_visible(sv_maxusrcmdprocessticks, true)
--end of Menu references
--Button function
local function turn_on()
ui.set(
options,
"Legit AA on use",
"Jitter on slow motion",
"Anti reverse by raz",
"Visual",
"Mini DT"
)
ui.set(dt, "Instant")
ui.set(aa_jitter_type,"Random")
ui.set(aa_jitter_value,15)
end
local rec_button = ui.new_button("LUA", "B", "Recommended settings", turn_on)
--end of Button function
--Clantag Var, shoutout my bro Mae
local clantag = {
'',
'|',
'|\\',
'|\\/',
'|\\/|',
'M',
'M1',
'Mi',
'Mi|',
'Mi|\\',
'Mi|\\|',
'Min',
'Min1',
'Mini',
'Mini-',
'Mini-7',
'Mini-Y',
'Mini-Y4',
'Mini-Ya',
'Mini-Ya\\',
'Mini-Ya\\/',
'Mini-Ya\\/\\',
'Mini-Ya\\/\\/',
'Mini-Yaw',
'Mini-Yaw',
'Mini-Yaw',
'Mini-Yaw',
'Mini-Yaw',
'Mini-Ya\\/\\/',
'Mini-Ya\\/\\',
'Mini-Ya\\/',
'Mini-Ya\\',
'Mini-Ya',
'Mini-Y4',
'Mini-Y',
'Mini-7',
'Mini-',
'Mini',
'Min1',
'Min',
'Mi|\\|',
'Mi|\\',
'Mi|',
'Mi',
'M1',
'M',
'|\\/|',
'|\\/',
'|\\',
'|',
''}
--end of Clantag Var
--Manual AA modes
local leftReady = false
local rightReady = false
local mode = "back"
--end of Manual AA modes
--Includes function
local function includes(table, key)
local state = false
for i = 1, #table do
if table[i] == key then
state = true
break
end
end
return state
end
--end of Includes function
--Table Visibility function
local function setTableVisibility(table, state)
for i = 1, #table do
ui.set_visible(table[i], state)
end
end
--end of Table Visibility function
--Visibility function
client.set_event_callback("paint_ui", function()
setTableVisibility({manual_label, left, back, right,manual_aa_visuals}, includes(ui.get(options), "Manual"))
setTableVisibility({dt_label, dt}, includes(ui.get(options), "Mini DT"))
setTableVisibility({visuals_label, visual_type}, includes(ui.get(options), "Visual"))
setTableVisibility({color_label,line_left,line_left_grad,line_right,line_right_grad,left_label,right_label,left_gradient_label,right_gradient_label},ui.get(visual_type) == "Desync line")
--line_right,line_right_grad,right_label,left_label,left_gradient_label,right_gradient_label
setTableVisibility({fake_label, min, max}, includes(ui.get(options), "Fake Yaw Randomization"))
setTableVisibility({aa_jitter_type, aa_jitter_value}, includes(ui.get(options), "Jitter on slow motion"))
setTableVisibility({clock_correction, fakelag_dt,dt_tick}, ui.get(dt) == "Manual")
end)
--end of Visibility function
--Clantag values
local new_value_clantag = 1
local counter_clantag = 1
--end of Clantag values
--Paint/Visuals function
client.set_event_callback("paint",function()
local localPlayer = entity.get_local_player()
local X, Y = client.screen_size()
local string_fake = string.format("%iº", anti_aim.get_desync(1))
local screen_size = {client.screen_size()}
local camera_angles = {client.camera_angles()}
local sx, sy = screen_size[1] / 2, screen_size[2] / 2
local by = anti_aim.normalize_angle(camera_angles[2] - anti_aim.get_body_yaw(1) - 120)
local fy = anti_aim.normalize_angle(camera_angles[2] - anti_aim.get_body_yaw(2) - 120)
local me = entity.get_local_player()
local player_resource = entity.get_player_resource()
if not includes(ui.get(options), "Visual") then
ui.set_visible(slider_visual, false)
end
if ui.get(manual_aa_visuals) == true then
if mode == "back" then
renderer.text(X / 2, Y / 2 - 15,255,255,255,255,"c",0,"back")
elseif mode == "left" then
renderer.text(X / 2 - 50, Y / 2 - 15 ,255,255,255,255,"c",0,"left")
elseif mode == "right" then
renderer.text(X / 2 + 50, Y / 2 - 15,255,255,255,255,"c",0,"right")
end
end
if includes(ui.get(options), "Visual") then
if entity.is_alive(me) then
if ui.get(visual_type) == "Default" then
ui.set_visible(slider_visual, true)
renderer.text(X / 2 - 13, Y / 2 + 10, 50, 128, 235, 255, nil, 0, "Y")
renderer.text(X / 2 - 3, Y / 2 + 10, 130, 50, 235, 255, nil, 0, "A")
renderer.text(X / 2 + 7, Y / 2 + 10, 50, 128, 235, 255, nil, 0, "W")
if anti_aim.get_double_tap() then
renderer.text(X / 2 - 6, Y / 2 + 22, 0, 255, 0, 255, nil, 0, "DT")
else
renderer.text(X / 2 - 6, Y / 2 + 22, 255, 0, 0, 255, nil, 0, "DT")
end
if ui.get(hs_key) == true then
renderer.text(X / 2 - 6, Y / 2 + 34, 0, 255, 0, 255, nil, 0, "HS")
else
renderer.text(X / 2 - 6, Y / 2 + 34, 255, 0, 0, 255, nil, 0, "HS")
end
renderer.text(X / 2 - 7, Y / 2 + 46, 255, 255, 255, 255, nil, 0, string_fake)
--renderer.gradient(X / 2,Y / 2 + 50, -anti_aim.get_desync(1), 3, 0, 100, 255, 255, 0, 0, 0, 0, true)
--renderer.gradient(X / 2 ,Y / 2 + 50, anti_aim.get_desync(1), 3, 0, 100, 255, 255, 0, 0, 0, 0, true)
local value_add_y = ui.get(slider_visual) * 100 / 10
renderer.circle_outline(
sx,
sy + 60 + value_add_y,
15,
15,
15,
125,
8 * ui.get(slider_visual),
0,
1,
2 * ui.get(slider_visual)
)
renderer.circle_outline(
sx,
sy + 60 + value_add_y,
150,
150,
150,
220,
8 * ui.get(slider_visual),
by,
0.05,
2 * ui.get(slider_visual)
)
renderer.circle_outline(
sx,
sy + 60 + value_add_y,
45,
220,
220,
255,
8 * ui.get(slider_visual),
fy,
0.1,
2 * ui.get(slider_visual)
)
end
if ui.get(visual_type) == "Desync line" then
ui.set_visible(slider_visual, false)
renderer.text(X / 2 - 13, Y / 2 + 10, 50, 128, 235, 255, nil, 0, "Y")
renderer.text(X / 2 - 3, Y / 2 + 10, 130, 50, 235, 255, nil, 0, "A")
renderer.text(X / 2 + 7, Y / 2 + 10, 50, 128, 235, 255, nil, 0, "W")
renderer.rectangle(X / 2, Y / 2 + 21, anti_aim.get_desync(1), 5, 240,240,240,160)
renderer.rectangle(X / 2, Y / 2 + 21, -anti_aim.get_desync(1), 5,240,240,240,160)
renderer.gradient(X / 2, Y / 2 + 22, -anti_aim.get_desync(1), 3, 0,100,255,255,0,0,0,0, true)
renderer.gradient(X / 2, Y / 2 + 22, anti_aim.get_desync(1), 3, 0,100,255,255,0,0,0,0, true)
renderer.text(X / 2 - 7, Y / 2 + 25, 255, 255, 255, 255, nil, 0, string_fake)
end
if ui.get(visual_type) == "Circle" then
renderer.text(X / 2 - 13, Y / 2 + 10, 50, 128, 235, 255, nil, 0, "Y")
renderer.text(X / 2 - 3, Y / 2 + 10, 130, 50, 235, 255, nil, 0, "A")
renderer.text(X / 2 + 7, Y / 2 + 10, 50, 128, 235, 255, nil, 0, "W")
ui.set_visible(slider_visual, true)
local value_add_y = ui.get(slider_visual) * 100 / 10
renderer.circle_outline(
sx,
sy + 25 + value_add_y,
15,
15,
15,
125,
8 * ui.get(slider_visual),
0,
1,
2 * ui.get(slider_visual)
)
renderer.circle_outline(
sx,
sy + 25 + value_add_y,
150,
150,
150,
220,
8 * ui.get(slider_visual),
by,
0.05,
2 * ui.get(slider_visual)
)
renderer.circle_outline(
sx,
sy + 25 + value_add_y,
45,
220,
220,
255,
8 * ui.get(slider_visual),
fy,
0.1,
2 * ui.get(slider_visual)
)
end
local weapon
local weapon_class
if not localPlayer then
return
else
weapon = entity.get_player_weapon(localPlayer)
weapon_class = entity.get_classname(weapon) end
--this is my some weird visual code that I forgot what it does :scary:
--[[if ui.get(visual_type) == "Desync line" or ui.get(visual_type) == "Circle" then
local x_menu, y_menu = drag_menu(tX, tY, 200, 20)
if (anti_aim.get_double_tap()) then
renderer.rectangle(x_menu, y_menu, 100,3,120,0,150,255)
renderer.rectangle(x_menu, y_menu, 100,20,10,10,10,150)
renderer.text(x_menu + 3, y_menu + 3,255,255,255,255,"nil",0,weapon_class)
else
renderer.rectangle(x_menu, y_menu, 100,3,255,255,255,255)
renderer.rectangle(x_menu, y_menu, 100,20,10,10,10,150)
renderer.text(x_menu + 3, y_menu + 3,255,255,255,255,"nil",0,weapon_class)
end
end]]
-- third person head visual shit :scary:
--[[if ui.get(visual_type) == "Thirdperson head" then
ui.set_visible(slider_visual, false)
local hitbox_hand_x,hitbox_hand_y,hitbox_hand_z = entity_hitbox_position(localPlayer,0)
local world_x,world_y = renderer.world_to_screen(hitbox_hand_x,hitbox_hand_y,hitbox_hand_z)
if( not world_x and not world_y) then
return
else
if(ui.get(thirdperson_alive_key) == false) then
return
else
--renderer.line(world_x,world_y,world_x - 50,world_y - 100,255,255,255,255)
--renderer.text(world_x - 100,world_y - 200,255,255,255,255,"nil",0,"hand")
renderer.rectangle(world_x - 50,world_y - 80,100,30,15,15,15,140)
renderer.rectangle(world_x - 50,world_y - 80,100,3,255,255,255,255)
renderer.rectangle(world_x + 20 ,world_y - 60, 18,5,0,0,0,255)
local desync_percentage = anti_aim.get_desync(1) / 100 * 60
local max_desync = nil
if(desync_percentage < 0) then
max_desync = -anti_aim.get_desync(1) / 100 * 60
else
max_desync = anti_aim.get_desync(1) / 100 * 60 end
renderer.rectangle(world_x + 20,world_y - 60, 0.5 * max_desync,5,255,255,255,255)
local desync_value_string = string.format("%iº",anti_aim.get_desync(1))
renderer.text(world_x + 20,world_y - 74,255,255,255,255,"nil",0,desync_value_string)
renderer.circle_outline(
world_x - 10,
world_y - 64,
15,
15,
15,
125,
8 ,
0,
1,
2
)
renderer.circle_outline(
world_x - 10,
world_y - 64,
150,
150,
150,
220,
8 ,
by,
0.05,
2
)
renderer.circle_outline(
world_x - 10,
world_y - 64,
45,
220,
220,
255,
8,
fy,
0.1,
2
)
if anti_aim.get_double_tap() then
renderer.text(world_x - 48,world_y - 64, 0, 255, 0, 255, nil, 0, "DT")
else
renderer.text(world_x - 48,world_y - 64, 255, 0, 0, 255, nil, 0, "DT")
end
if ui.get(hs_key) == true then
renderer.text(world_x - 48,world_y - 74, 0, 255, 0, 255, nil, 0, "HS")
else
renderer.text(world_x - 48,world_y - 74, 255, 0, 0, 255, nil, 0, "HS")
end
end
end
end]]
end
end
if includes(ui.get(options), "Clantag") then
if counter_clantag >= 100 then
new_value_clantag = new_value_clantag + 1
client.set_clan_tag(clantag[new_value_clantag])
counter_clantag = 0
else
counter_clantag = counter_clantag + 1
end
if counter_clantag > 100 then
counter_clantag = 0
end
if new_value_clantag > 50 then
new_value_clantag = 0
end
end
end)
--end of Paint/Visuals function
-- PERNAS MALUCAS E PITCH MALUCO
local fakelag = ui.reference("AA", "Fake lag", "Limit")
local ground_ticks, end_time = 1, 0
client.set_event_callback("pre_render", function()
if entity.is_alive(entity.get_local_player()) then
if includes(ui.get(options), "Static legs") then
entity.set_prop(entity.get_local_player(), "m_flPoseParameter", 1, 6)
end
if includes(ui.get(options), "Pitch 0 on land") then
local on_ground = bit.band(entity.get_prop(entity.get_local_player(), "m_fFlags"), 1)
if on_ground == 1 then
ground_ticks = ground_ticks + 1
else
ground_ticks = 0
end_time = globals.curtime() + 1
end
if ground_ticks > ui.get(fakelag)+1 and end_time > globals.curtime() then
entity.set_prop(entity.get_local_player(), "m_flPoseParameter", 0.5, 12)
end
end
end
end)
--Anti-aim functions
client.set_event_callback("run_command", function()
local localPlayer = entity.get_local_player()
if includes(ui.get(options), "Manual") then
if ui.get(back) then
mode = "back"
elseif ui.get(left) and leftReady then
if mode == "left" then
mode = "back"
else
mode = "left"
end
leftReady = false
elseif ui.get(right) and rightReady then
if mode == "right" then
mode = "back"
else
mode = "right"
end
rightReady = false
end
if ui.get(left) == false then
leftReady = true
end
if ui.get(right) == false then
rightReady = true
end
if mode == "back" then
ui.set(yaw, 0)
elseif mode == "left" then
ui.set(yaw, -90)
elseif mode == "right" then
ui.set(yaw, 90)
end
end
if includes(ui.get(options), "Fake Yaw Randomization") then
local min_g = ui.get(min)
local max_g = ui.get(max)
ui.set(fyawlimit, math.floor(math.random(min_g < max_g and min_g or max_g, min_g < max_g and max_g or min_g)))
end
local player_velocity = (function() local vx, vy = entity.get_prop(localPlayer, "m_vecVelocity") return math.floor(math.min(10000, math.sqrt(vx*vx + vy*vy) + 0.5)) end)()
if includes(ui.get(options), "Freestanding on stand") then
if player_velocity < 5 then
ui.set(freestanding_mode, "Default")
else
ui.set(freestanding_mode, "-")
end
end
if includes(ui.get(options), "Jitter on slow motion") then
if ui.get(slow_hotkey) == true then
ui.set(old_aa, ui.get(aa_jitter_type))
ui.set(aa_value, ui.get(aa_jitter_value))
elseif ui.get(slow_hotkey) == false then
ui.set(old_aa, "Off")
ui.set(aa_value, 0)
end
end
end)
client.set_event_callback("setup_command", function(e)
local localPlayer = entity.get_local_player()
local weaponn = entity.get_player_weapon()
if includes(ui.get(options), "Legit AA on use") then
if weaponn ~= nil and entity.get_classname(weaponn) == "CC4" then
if e.in_attack == 1 then
e.in_attack = 0
e.in_use = 1
end
else
if e.chokedcommands == 0 then
e.in_use = 0
end
end
ui.set(freestanding_body_yaw, true)
end
if ui.get(dt) == "Instant" then
ui.set(sv_maxusrcmdprocessticks, 18)
ui.set(dtfakelaglimit, 1)
elseif ui.get(dt) == "Fast" then
ui.set(sv_maxusrcmdprocessticks, 17)
ui.set(dtfakelaglimit, 1)
elseif ui.get(dt) == "Off" then
ui.set(sv_maxusrcmdprocessticks, ui.get(sv_maxusrcmdprocessticks))
ui.set(dtfakelaglimit, ui.get(fakelag_dt))
elseif ui.get(dt) == "Manual" then
ui.set(sv_maxusrcmdprocessticks,ui.get(dt_tick))
ui.set(dtfakelaglimit,ui.get(fakelag_dt))
cvar.cl_clock_correction:set_int(ui.get(clock_correction))
end
if includes(ui.get(options), "Anti hit by raz") then
ui.set(bodyyaw_aa, "Static")
if globals_tickcount() % 2 then
if ui.get(bodyyaw_value) == 90 then
ui.set(bodyyaw_value, -90)
elseif ui.get(bodyyaw_value) == -90 then
ui.set(bodyyaw_value, 90)
end
else
if ui.get(bodyyaw_value) == 90 then
ui.set(bodyyaw_value, -90)
elseif ui.get(bodyyaw_value) == -90 then
ui.set(bodyyaw_value, 90)
end
end
if ui.get(bodyyaw_value) ~= 90 and ui.get(bodyyaw_value) ~= -90 then
ui.set(bodyyaw_value, 90)
end
end
if includes(ui.get(options), "Anti reverse by raz") then
if ui.get(legmovement) == "Off" then
ui.set(legmovement, "Always slide")
end
if globals_tickcount() % 2 then
if ui.get(legmovement) == "Always slide" then
ui.set(legmovement, "Never slide")
elseif ui.get(legmovement) == "Never slide" then
ui.set(legmovement, "Always slide")
end
else
if ui.get(legmovement) == "Always slide" then
ui.set(legmovement, "Never slide")
elseif ui.get(legmovement) == "Never slide" then
ui.set(legmovement, "Always slide")
end
end
end
end
)
--end of Anti-aim functions
--event_callbacks
--client.set_event_callback("run_command", runCommand)
--client.set_event_callback("paint", visuals)
--client.set_event_callback("paint_ui", handleGUI)
--end of event_callbacks
|
local API = require('./API')
local Socket = require('./Socket')
local Cache = require('../utils/Cache')
local Emitter = require('../utils/Emitter')
local Stopwatch = require('../utils/Stopwatch')
local Invite = require('../containers/Invite')
local User = require('../containers/snowflakes/User')
local Guild = require('../containers/snowflakes/Guild')
local PrivateChannel = require('../containers/snowflakes/channels/PrivateChannel')
local VoiceManager = require('../voice/VoiceManager')
local pp = require('pretty-print')
local timer = require('timer')
local json = require('json')
local format = string.format
local colorize = pp.colorize
local traceback = debug.traceback
local sleep = timer.sleep
local date, time, exit, difftime = os.date, os.time, os.exit, os.difftime
local wrap, yield, running = coroutine.wrap, coroutine.yield, coroutine.running
local encode, decode = json.encode, json.decode
local open = io.open
local defaultOptions = {
routeDelay = 300,
globalDelay = 10,
messageLimit = 100,
largeThreshold = 100,
fetchMembers = false,
autoReconnect = true,
compress = true,
bitrate = 64000,
dateTime = '%c',
}
local Client, property, method, cache = class('Client', Emitter)
Client.__description = "The main point of entry into a Discordia application."
function Client:__init(customOptions)
Emitter.__init(self)
if customOptions then
local options = {}
for k, v in pairs(defaultOptions) do
if customOptions[k] ~= nil then
options[k] = customOptions[k]
else
options[k] = v
end
end
self._options = options
else
self._options = defaultOptions
end
self._api = API(self)
self._sockets = {}
self._users = Cache({}, User, 'id', self)
self._guilds = Cache({}, Guild, 'id', self)
self._private_channels = Cache({}, PrivateChannel, 'id', self)
self._voice = VoiceManager(self)
self._channel_map = {}
end
function Client:__tostring()
if self._user then
return 'instance of Client for ' .. self._user._username
else
return 'instance of Client'
end
end
local function log(self, message, color)
return print(colorize(color, format('%s - %s', date(self._options.dateTime), message)))
end
function Client:warning(message)
if self._listeners['warning'] then return self:emit('warning', message) end
return log(self, message, 'highlight')
end
function Client:error(message)
if self._listeners['error'] then return self:emit('error', message) end
log(self, traceback(running(), message, 2), 'failure')
return exit()
end
local function getToken(self, email, password)
self:warning('Email login is discouraged, use token login instead')
local success, data = self._api:getToken({email = email, password = password})
if success then
return data.mfa and self:error('MFA login is not supported') or data.token
else
self:error(data.email and data.email[1] or data.password and data.password[1])
end
end
-- this will adapt a token with or without a Bot prefix
-- future versions may require explicit prefixing
local function parseToken(self, token)
local api = self._api
token = token:gsub('Bot ', '')
local bot = 'Bot ' .. token
if api:checkToken(bot) then
return bot, true
elseif api:checkToken(token) then
return token, false
end
end
local function run(self, token, other)
return wrap(function()
local isBot
if other then
token, isBot = getToken(self, token, other)
else
token, isBot = parseToken(self, token)
end
if not token then return self:error('Invalid token provided') end
self._api:setToken(token)
return self:_connectToGateway(token, isBot)
end)()
end
local function stop(self, shouldExit) -- should probably rename to disconnect
for _, socket in pairs(self._sockets) do
socket:disconnect()
end
if shouldExit then exit() end
end
function Client:_connectToGateway(token, isBot)
local data, success
local _, file = pcall(open, 'gateway.json')
if file then
data = decode(file:read('*all'))
success = difftime(time(), data.timestamp) < 86400 -- 1 day
file:close()
end
if not success then
success, data = self._api:getGateway(isBot)
if success then
data.timestamp = time()
_, file = pcall(open, 'gateway.json', 'w')
if file then
file:write(encode(data))
file:close()
end
end
end
if success then
self._shard_count = data.shards or 1
for id = 0, self._shard_count - 1 do
self._sockets[id] = Socket(id, data.url, self)
end
self._stopwatch = Stopwatch()
for _, socket in pairs(self._sockets) do
socket:connect()
self._stopwatch:restart()
wrap(socket.handlePayloads)(socket, token)
while self._stopwatch.milliseconds < 5000 do
sleep(1000)
end
end
else
self:error(format('Cannot get gateway URL: %s', data.message))
end
end
function Client:_loadUserData(data)
self._email = data.email
self._mobile = data.mobile
self._verified = data.verified
self._mfa_enabled = data.mfa_enabled
data.email = nil
data.mobile = nil
data.verified = nil
data.mfa_enabled = nil
end
local function getOwner(self)
if self._user and self._user._bot then
local user = self._users:get(self._owner_id)
if user then return user end
local success, data = self._api:getCurrentApplicationInformation()
if success then
self._owner_id = data.owner.id
return self._users:new(data.owner)
end
end
return self._user
end
local function listVoiceRegions(self)
local success, data = self._api:listVoiceRegions()
return success and data or nil
end
local function createGuild(self, name, region) -- limited use
return (self._api:createGuild({name = name, region = region}))
end
local function setUsername(self, username)
local success, data = self._api:modifyCurrentUser({
username = username
})
if success then self._user._username = data.username end
return success
end
local function setNick(self, guild, nick)
local success, data = self._api:modifyCurrentUserNickname(guild._id, {
nick = nick or ''
})
if success then guild.me._nick = data.nick end
return success
end
local function setAvatar(self, avatar)
local success, data = self._api:modifyCurrentUser({
avatar = avatar,
})
if success then self._user._avatar = data.avatar end
return success
end
local function setStatusIdle(self)
self._idle_since = time() * 1000
local id = self._user._id
for guild in self._guilds:iter() do
local me = guild._members:get(id)
if me then me._status = 'idle' end
end
for _, socket in pairs(self._sockets) do
socket:statusUpdate(self._idle_since, self._game_name)
end
end
local function setStatusOnline(self)
self._idle_since = nil
local id = self._user._id
for guild in self._guilds:iter() do
local me = guild._members:get(id)
if me then me._status = 'online' end
end
for _, socket in pairs(self._sockets) do
socket:statusUpdate(self._idle_since, self._game_name)
end
end
local function setGameName(self, gameName)
self._game_name = gameName
local id = self._user._id
for guild in self._guilds:iter() do
local me = guild._members:get(id)
if me then me._game = gameName and {name = gameName} end
end
for _, socket in pairs(self._sockets) do
socket:statusUpdate(self._idle_since, self._game_name)
end
end
local function acceptInvite(self, code)
local success, data = self._api:acceptInvite(code)
return success and Invite(data, self) or nil
end
local function getInvite(self, code)
local success, data = self._api:getInvite(code)
return success and Invite(data, self) or nil
end
function Client:_getTextChannelShortcut(id)
local guild = self._channel_map[id]
return guild and guild._text_channels:get(id) or self._private_channels:get(id)
end
-- cache accessors --
-- users --
local function getUserCount(self)
return self._users._count
end
local function getUsers(self, key, value)
return self._users:getAll(key, value)
end
local function getUser(self, key, value)
local user = self._users:get(key, value)
if user or value then return user end
local success, data = self._api:getUser(key)
return success and self._users:new(data) or nil
end
local function findUser(self, predicate)
return self._users:find(predicate)
end
local function findUsers(self, predicate)
return self._users:findAll(predicate)
end
-- guilds --
local function getGuildCount(self)
return self._guilds._count
end
local function getGuilds(self, key, value)
return self._guilds:getAll(key, value)
end
local function getGuild(self, key, value)
return self._guilds:get(key, value)
end
local function findGuild(self, predicate)
return self._guilds:find(predicate)
end
local function findGuilds(self, predicate)
return self._guilds:findAll(predicate)
end
-- channels --
local function getChannelCount(self)
local n = self._private_channels._count
for guild in self._guilds:iter() do
n = n + guild._text_channels._count + guild._voice_channels._count
end
return n
end
local function getChannels(self, key, value)
return wrap(function()
for channel in self._private_channels:getAll(key, value) do
yield(channel)
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:getAll(key, value) do
yield(channel)
end
for channel in guild._voice_channels:getAll(key, value) do
yield(channel)
end
end
end)
end
local function getChannel(self, key, value)
local channel = self._private_channels:get(key, value)
if channel then return channel end
for guild in self._guilds:iter() do
channel = guild._text_channels:get(key, value) or guild._voice_channels:get(key, value)
if channel then return channel end
end
return nil
end
local function findChannel(self, predicate)
local channel = self._private_channels:find(predicate)
if channel then return channel end
for guild in self._guilds:iter() do
channel = guild._text_channels:find(predicate) or guild._voice_channels:find(predicate)
if channel then return channel end
end
return nil
end
local function findChannels(self, predicate)
return wrap(function()
for channel in self._private_channels:findAll(predicate) do
yield(channel)
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:findAll(predicate) do
yield(channel)
end
for channel in guild._voice_channels:findAll(predicate) do
yield(channel)
end
end
end)
end
-- private channels --
local function getPrivateChannelCount(self)
return self._private_channels._count
end
local function getPrivateChannels(self, key, value)
return self._private_channels:getAll(key, value)
end
local function getPrivateChannel(self, key, value)
local channel = self._private_channels:get(key, value)
if channel or value then return channel end
local success, data = self._api:getChannel(key)
return success and self._private_channels:new(data) or nil
end
local function findPrivateChannel(self, predicate)
return self._private_channels:find(predicate)
end
local function findPrivateChannels(self, predicate)
return self._private_channels:findAll(predicate)
end
-- text channels --
local function getTextChannelCount(self)
local n = self._private_channels._count
for guild in self._guilds:iter() do
n = n + guild._text_channels._count
end
return n
end
local function getTextChannels(self, key, value)
return wrap(function()
for channel in self._private_channels:getAll(key, value) do
yield(channel)
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:getAll(key, value) do
yield(channel)
end
end
end)
end
local function getTextChannel(self, key, value)
local channel = self._private_channels:get(key, value)
if channel then return channel end
for guild in self._guilds:iter() do
channel = guild._text_channels:get(key, value)
if channel then return channel end
end
end
local function findTextChannel(self, predicate)
local channel = self._private_channels:find(predicate)
if channel then return channel end
for guild in self._guilds:iter() do
channel = guild._text_channels:find(predicate)
if channel then return channel end
end
end
local function findTextChannels(self, predicate)
return wrap(function()
for channel in self._private_channels:findAll(predicate) do
yield(channel)
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:findAll(predicate) do
yield(channel)
end
end
end)
end
-- guild channels --
local function getGuildChannelCount(self)
local n = 0
for guild in self._guilds:iter() do
n = n + guild._text_channels._count + guild._voice_channels._count
end
return n
end
local function getGuildChannels(self, key, value)
return wrap(function()
for guild in self._guilds:iter() do
for channel in guild._text_channels:getAll(key, value) do
yield(channel)
end
for channel in guild._voice_channels:getAll(key, value) do
yield(channel)
end
end
end)
end
local function getGuildChannel(self, key, value)
for guild in self._guilds:iter() do
local channel = guild._text_channels:get(key, value) or guild._voice_channels:get(key, value)
if channel then return channel end
end
return nil
end
local function findGuildChannel(self, predicate)
for guild in self._guilds:iter() do
local channel = guild._text_channels:find(predicate) or guild._voice_channels:find(predicate)
if channel then return channel end
end
return nil
end
local function findGuildChannels(self, predicate)
return wrap(function()
for guild in self._guilds:iter() do
for channel in guild._text_channels:findAll(predicate) do
yield(channel)
end
for channel in guild._voice_channels:findAll(predicate) do
yield(channel)
end
end
end)
end
-- guild text channels --
local function getGuildTextChannelCount(self)
local n = 0
for guild in self._guilds:iter() do
n = n + guild._text_channels._count
end
return n
end
local function getGuildTextChannels(self, key, value)
return wrap(function()
for guild in self._guilds:iter() do
for channel in guild._text_channels:getAll(key, value) do
yield(channel)
end
end
end)
end
local function getGuildTextChannel(self, key, value)
for guild in self._guilds:iter() do
local channel = guild._text_channels:get(key, value)
if channel then return channel end
end
return nil
end
local function findGuildTextChannel(self, predicate)
for guild in self._guilds:iter() do
local channel = guild._text_channels:find(predicate)
if channel then return channel end
end
return nil
end
local function findGuildTextChannels(self, predicate)
return wrap(function()
for guild in self._guilds:iter() do
for channel in guild._text_channels:findAll(predicate) do
yield(channel)
end
end
end)
end
-- guild voice channels --
local function getGuildVoiceChannelCount(self)
local n = 0
for guild in self._guilds:iter() do
n = n + guild._voice_channels._count
end
return n
end
local function getGuildVoiceChannels(self, key, value)
return wrap(function()
for guild in self._guilds:iter() do
for channel in guild._voice_channels:getAll(key, value) do
yield(channel)
end
end
end)
end
local function getGuildVoiceChannel(self, key, value)
for guild in self._guilds:iter() do
local channel = guild._voice_channels:get(key, value)
if channel then return channel end
end
return nil
end
local function findGuildVoiceChannel(self, predicate)
for guild in self._guilds:iter() do
local channel = guild._voice_channels:find(predicate)
if channel then return channel end
end
return nil
end
local function findGuildVoiceChannels(self, predicate)
return wrap(function()
for guild in self._guilds:iter() do
for channel in guild._voice_channels:findAll(predicate) do
yield(channel)
end
end
end)
end
-- roles --
local function getRoleCount(self)
local n = 0
for guild in self._guilds:iter() do
n = n + guild._roles._count
end
return n
end
local function getRoles(self, key, value)
return wrap(function()
for guild in self._guilds:iter() do
for role in guild._roles:getAll(key, value) do
yield(role)
end
end
end)
end
local function getRole(self, key, value)
for guild in self._guilds:iter() do
local role = guild._roles:get(key, value)
if role then return role end
end
return nil
end
local function findRole(self, predicate)
for guild in self._guilds:iter() do
local role = guild._roles:find(predicate)
if role then return role end
end
return nil
end
local function findRoles(self, predicate)
return wrap(function()
for guild in self._guilds:iter() do
for role in guild._roles:findAll(predicate) do
yield(role)
end
end
end)
end
-- members --
local function getMemberCount(self)
local n = 0
for guild in self._guilds:iter() do
n = n + guild._members._count
end
return n
end
local function getMembers(self, key, value)
return wrap(function()
for guild in self._guilds:iter() do
for member in guild._members:getAll(key, value) do
yield(member)
end
end
end)
end
local function getMember(self, key, value)
for guild in self._guilds:iter() do
local member = guild._members:get(key, value)
if member then return member end
end
return nil
end
local function findMember(self, predicate)
for guild in self._guilds:iter() do
local member = guild._members:find(predicate)
if member then return member end
end
return nil
end
local function findMembers(self, predicate)
return wrap(function()
for guild in self._guilds:iter() do
for member in guild._members:findAll(predicate) do
yield(member)
end
end
end)
end
-- messages --
local function getMessageCount(self)
local n = 0
for channel in self._private_channels:iter() do
n = n + channel._messages._count
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:iter() do
n = n + channel._messages._count
end
end
return n
end
local function getMessages(self, key, value)
return wrap(function()
for channel in self._private_channels:iter() do
for message in channel._messages:getAll(key, value) do
yield(message)
end
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:iter() do
for message in channel._messages:getAll(key, value) do
yield(message)
end
end
end
end)
end
local function getMessage(self, key, value)
for channel in self._private_channels:iter() do
local message = channel._messages:get(key, value)
if message then return message end
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:iter() do
local message = channel._messages:get(key, value)
if message then return message end
end
end
return nil
end
local function findMessage(self, predicate)
for channel in self._private_channels:iter() do
local message = channel._messages:find(predicate)
if message then return message end
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:iter() do
local message = channel._messages:find(predicate)
if message then return message end
end
end
return nil
end
local function findMessages(self, predicate)
return wrap(function()
for channel in self._private_channels:iter() do
for message in channel._messages:findAll(predicate) do
yield(message)
end
end
for guild in self._guilds:iter() do
for channel in guild._text_channels:iter() do
for message in channel._messages:findAll(predicate) do
yield(message)
end
end
end
end)
end
property('user', '_user', nil, 'User', "The User object for the client")
property('voice', '_voice', nil, 'VoiceManager', "The VoiceManager handle for the main client")
property('owner', getOwner, nil, 'User', "The User object for the account's owner")
property('email', '_email', nil, 'string', "The client's email address (non-bot only)")
property('mobile', '_mobile', nil, 'boolean', "Whether the client has used a Discord mobile app (non-bot only)")
property('verified', '_verified', nil, 'boolean', "Whether the client account is verified by Discord")
property('mfaEnabled', '_mfa_enabled', nil, 'boolean', "Whether the client has MFA enabled")
property('shardCount', '_shard_count', nil, 'number', "The number of gateway shards on which the client is operating")
method('run', run, 'token', "Connects to a Discord gateway using a valid Discord token and starts the main program loop(s).")
method('stop', stop, 'shouldExit', "Disconnects from the Discord gateway and optionally exits the process.")
method('listVoiceRegions', listVoiceRegions, nil, "Returns a table of voice regions.")
method('createGuild', createGuild, 'name, region', "Creates a guild with the provided name and voice region.")
method('acceptInvite', acceptInvite, 'code', "Accepts a guild invitation with the raw invite code.")
method('getInvite', getInvite, 'code', "Returns an Invite object corresponding to a raw invite code, if it exists.")
method('setUsername', setUsername, 'username', "Sets the user's username.")
method('setNickname', setNick, 'guild, nickname', "Sets the user's nickname for the indicated guild.")
method('setAvatar', setAvatar, 'avatar', "Sets the user's avatar. Must be a base64-encoded JPEG.")
method('setStatusIdle', setStatusIdle, nil, "Sets the user status to idle. Warning: This can silently fail!")
method('setStatusOnline', setStatusOnline, nil, "Sets the user status to idle. Warning: This can silently fail!")
method('setGameName', setGameName, 'gameName', "Sets the user's 'now playing' game title. Warning: This can silently fail!")
cache('Guild', getGuildCount, getGuild, getGuilds, findGuild, findGuilds)
cache('User', getUserCount, getUser, getUsers, findUser, findUsers)
cache('Channel', getChannelCount, getChannel, getChannels, findChannel, findChannels)
cache('PrivateChannel', getPrivateChannelCount, getPrivateChannel, getPrivateChannels, findPrivateChannel, findPrivateChannels)
cache('GuildChannel', getGuildChannelCount, getGuildChannel, getGuildChannels, findGuildChannel, findGuildChannels)
cache('TextChannel', getTextChannelCount, getTextChannel, getTextChannels, findTextChannel, findTextChannels)
cache('GuildTextChannel', getGuildTextChannelCount, getGuildTextChannel, getGuildTextChannels, findGuildTextChannel, findGuildTextChannels)
cache('GuildVoiceChannel', getGuildVoiceChannelCount, getGuildVoiceChannel, getGuildVoiceChannels, findGuildVoiceChannel, findGuildVoiceChannels)
cache('VoiceChannel', getGuildVoiceChannelCount, getGuildVoiceChannel, getGuildVoiceChannels, findGuildVoiceChannel, findGuildVoiceChannels)
cache('Role', getRoleCount, getRole, getRoles, findRole, findRoles)
cache('Member', getMemberCount, getMember, getMembers, findMember, findMembers)
cache('Message', getMessageCount, getMessage, getMessages, findMessage, findMessages)
return Client
|
CustomizableWeaponry:addFireSound("50EAGLE_FIRE", "weapons/heyo_deag/44-1.wav", 1, 125, CHAN_STATIC)
CustomizableWeaponry:addReloadSound("50EAGLE_MAGOUT", "weapons/heyo_deag/magout.wav")
CustomizableWeaponry:addReloadSound("50EAGLE_MAG", "weapons/heyo_deag/mag.wav")
CustomizableWeaponry:addReloadSound("50EAGLE_MAGIN", "weapons/heyo_deag/magin.wav")
CustomizableWeaponry:addReloadSound("50EAGLE_SLIDEB", "weapons/heyo_deag/Slideb.wav")
CustomizableWeaponry:addReloadSound("50EAGLE_SLIDEF", "weapons/heyo_deag/Slidef.wav")
CustomizableWeaponry:addReloadSound("50EAGLE_DRAW", "weapons/heyo_deag/draw.wav")
|
Person = class()
-- Person states
PERSON_KILL =-1
PERSON_BORN = 0
PERSON_SHIP = 1
PERSON_LEVI = 2
PERSON_LOST = 3
PERSON_SAFE = 4
PERSON_FALL = 5
PERSON_BYE = 6
function Person:init(x,y,angle)
-- you can accept and set parameters here
self.x = x
self.y = y
self.angle = angle
local r= math.random(1,5)
if r == 1 then
self.model = "Planet Cute:Character Boy"
self.points= 3
elseif r == 2 then
self.model = "Planet Cute:Character Cat Girl"
self.points= 3
elseif r == 3 then
self.model = "Planet Cute:Character Horn Girl"
self.points= 6
elseif r == 4 then
self.model = "Planet Cute:Character Pink Girl"
self.points= 5
else
self.model = "Planet Cute:Character Princess Girl"
self.points= 12
end
self.state = PERSON_BORN -- in asteroid, lost,waiting for the ship
self.timeToGo = 2.3
self.shipId = nil
end
function Person:draw()
pushMatrix()
--translate(0,0)
translate(self.x,self.y)
rotate(self.angle)
if self.state == PERSON_BYE then
sprite("Small World:Glow")
elseif self.state == PERSON_BORN then
sprite("Small World:Explosion")
elseif self.state == PERSON_KILL then
sprite("Small World:Bunny Skull")
else
sprite(self.model,0,0)
end
popMatrix()
end
function Person:touched(touch)
-- Codify does not automatically call this method
end
|
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local gears = require("gears")
local gfs = require("gears.filesystem")
local spawn = require("awful.spawn")
local HOME_DIR = os.getenv("HOME")
local WIDGET_DIR = HOME_DIR .. '/.config/awesome/noobie'
local ICONS_DIR = WIDGET_DIR .. '/feather_icons/'
local CACHE_DIR = os.getenv("HOME") .. '/.cache/noobie/icons'
local row_builder = {}
local function build_header_row(item)
return wibox.widget {
{
{
markup = "<span foreground='#888888'>" .. item.title .. "</span>",
widget = wibox.widget.textbox,
},
left = 8,
layout = wibox.container.margin
},
bg = beautiful.bg_normal,
widget = wibox.container.background
}
end
local function build_icon_and_text_row(item, widget, noobie_popup)
local item_image = wibox.widget{
resize = true,
forced_height = item.icon_size or 20,
forced_width = item.icon_size or 20 ,
widget = wibox.widget.imagebox
}
-- new_icon is an absolute path to a file
if item.icon:sub(1, 1) == '/' then
item_image:set_image(item.icon)
-- new_icon is a relative path to the file
elseif item.icon:sub(1, 1) == '~' then
print(HOME_DIR .. '/' .. item.icon:sub(3))
item_image:set_image(HOME_DIR .. '/' .. item.icon:sub(3))
-- new_icon is a url of the icon
elseif item.icon:sub(1, 4) == 'http' then
local icon_path = CACHE_DIR .. '/' .. item.icon:sub(-16)
if gfs.file_readable(icon_path) then
item_image:set_image(icon_path)
else
local download_cmd = string.format([[sh -c "curl -L -f --create-dirs -o %s %s"]], icon_path, item.icon)
spawn.easy_async(download_cmd, function(stdout, stderr, reason, exit_code)
if (exit_code == 0) then
item_image:set_image(icon_path)
else
item_image:set_image(item.icon_fallback)
end
end)
end
-- new_icon is a feather icon
else
item_image:set_image(ICONS_DIR .. item.icon .. '.svg')
end
local right_part
if item.subtitle ~=nil and #item.subtitle > 0 then
right_part = wibox.widget {
{
markup = item.title,
font = font,
widget = wibox.widget.textbox
},
{
markup = item.subtitle,
font = font,
widget = wibox.widget.textbox
},
spacing = 4,
layout = wibox.layout.fixed.vertical
}
else
right_part = wibox.widget {
markup = item.title,
font = font,
widget = wibox.widget.textbox
}
end
local row = wibox.widget {
{
{
{
item_image,
valign = 'center',
layout = wibox.container.place,
},
right_part,
spacing = 12,
layout = wibox.layout.fixed.horizontal
},
margins = 8,
layout = wibox.container.margin
},
bg = beautiful.bg_normal,
widget = wibox.container.background
}
local old_cursor, old_wibox
row:connect_signal("mouse::enter", function(c)
c:set_bg(beautiful.bg_focus)
local wb = mouse.current_wibox
old_cursor, old_wibox = wb.cursor, wb
wb.cursor = "hand1"
end)
row:connect_signal("mouse::leave", function(c)
c:set_bg(beautiful.bg_normal)
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end)
row:buttons(gears.table.join(awful.button({}, 1, function()
awful.spawn.with_shell(item.onclick)
widget:set_bg(background)
noobie_popup.visible = not noobie_popup.visible
end)))
return row
end
function row_builder:build_row(item, widget, noobie_popup)
if item.type == 'header' then
return build_header_row(item)
elseif item.title ~= nil and #item.title > 0 and item.icon ~= nil and #item.icon > 0 then
return build_icon_and_text_row(item, widget, noobie_popup)
elseif item.type == 'separator' then
return wibox.widget {
{
orientation = 'horizontal',
forced_height = 1,
span_ratio = 0.95,
forced_width = 100,
color = beautiful.bg_focus,
widget = wibox.widget.separator
},
strategy = 'exact',
widget = wibox.container.background
}
elseif item.title ~= nil and #item.title > 0 and item.icon == nil then
local row = wibox.widget {
{
{
markup = item.title,
font = font,
widget = wibox.widget.textbox
},
margins = 8,
layout = wibox.container.margin
},
bg = beautiful.bg_normal,
widget = wibox.container.background
}
if item.onclick ~= nil then
local old_cursor, old_wibox
row:connect_signal("mouse::enter", function(c)
c:set_bg(beautiful.bg_focus)
local wb = mouse.current_wibox
old_cursor, old_wibox = wb.cursor, wb
wb.cursor = "hand1"
end)
row:connect_signal("mouse::leave", function(c)
c:set_bg(beautiful.bg_normal)
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end)
row:buttons(gears.table.join(awful.button({}, 1, function()
awful.spawn.with_shell(item.onclick)
widget:set_bg(background)
noobie_popup.visible = not noobie_popup.visible
end)))
end
return row
end
end
return row_builder
|
local Runner = require "nvim-test.runner"
local jest = require "nvim-test.runners.jest"
local cypress = Runner:init({
command = { "./node_modules/.bin/cypress", "cypress" },
args = { "run" },
file_pattern = jest.config.file_pattern,
find_files = jest.config.find_files,
}, {
javascript = jest.queries.javascript,
})
function cypress:build_args(args, filename, _)
if filename then
table.insert(args, "--spec")
table.insert(args, filename)
end
end
return cypress
|
local telescope = require('telescope')
local wiki_telescope = require('wiki.telescope')
return telescope.register_extension { exports = {
files = wiki_telescope.files,
titles = wiki_telescope.titles,
keywords = wiki_telescope.keywords,
outgoing = wiki_telescope.outgoing,
live_grep = wiki_telescope.live_grep,
browser = wiki_telescope.browser,
}
}
|
--bind client tunnel interface
vRPpc = {}
Tunnel.bindInterface("vRP_paycheck",vRPpc)
function vRPpc.notifyPicture(icon, type, sender, title, text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
SetNotificationMessage(icon, icon, true, type, sender, title, text)
DrawNotification(false, true)
end
|
--MCmobs v0.4
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
mobs:register_mob("mobs_mc:illusioner", {
type = "monster",
attack_type = "shoot",
shoot_interval = 0.5,
arrow = "mobs:arrow_entity",
shoot_offset = 1.5,
stepheight = 1.2,
hp_min = 30,
hp_max = 60,
armor = 150,
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
rotate = -180,
visual = "mesh",
mesh = "illusioner.b3d",
textures = {
--{"illusionist.png"},
{"illusionist.png^illusionist1.png"},
},
visual_size = {x=3, y=3},
walk_velocity = 0.6,
run_velocity = 2,
jump = true,
animation = {
speed_normal = 25,
speed_run = 25,
stand_start = 40,
stand_end = 59,
--speed_stand = 5,
walk_start = 0,
walk_end = 40,
--speed_walk = 50,
shoot_start = 90,
shoot_end = 110,
die_start = 110,
die_end = 130,
speed_die = 5,
-- 60-80 magic arm swinging, 80-90 transition between magic to bow shooting
},
})
mobs:register_egg("mobs_mc:illusioner", "Illusioner", "illusioner_inv.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Illusioner loaded")
end
|
--#ENDPOINT POST /insights
-- listInsights
local insightsByGroup = {}
local emptyList = {}
setmetatable(emptyList, {['__type']='slice'})
local addNumber = {
id = "addNumbers",
name = "Add Numbers",
description = "Sum one data point and a user-defined value",
constants = {
{
name = "adder",
type = "number"
}
},
inlets = {
{
data_type = "NUMBER",
data_unit = "",
description = "One number"
}
},
outlets = {
data_type = "NUMBER",
data_unit = ""
}
}
insightsByGroup["80000001"] = {addNumber}
insightsByGroup["80000002"] = emptyList
if request.body.group_id == '' then
insightGroup = emptyList
else
insightGroup = insightsByGroup[request.body.group_id]
end
local requestedGroup = insightGroup
if insightGroup == nil then
return {error = "group_id "..request.body.group_id.." does not exist"}
end
local count = table.getn(requestedGroup)
local total = table.getn(requestedGroup)
return {
count = count,
total = total,
insights = requestedGroup
}
|
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:SetModel( "models/sf_models/sf_oil_lamp.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
--self:SetMoveType( MOVETYPE_NONE )
self.RenderMode = 1
self:SetRenderMode(RENDERMODE_TRANSALPHA)
self:SetColor(Color(255,255,255))
self.on = false
self.lastT = SysTime() + 7
self.hp = 10
self.respawn = -1
self:SetKeyValue("fademindist", 2000)
self:SetKeyValue("fademaxdist", 2000)
end
function ENT:OnTakeDamage(cmd)
if self.hp <= 0 then return end
self.hp = (self.hp or 0) - cmd:GetDamage()
if self.hp > 0 then return end
self:EmitSound("physics/glass/glass_largesheet_break1.wav")
self:SetNWBool("broken",true)
self.respawn = CurTime() + 30
for i=1,5 do
local effectdata = EffectData()
effectdata:SetOrigin( self:LocalToWorld(Vector(0,0,7)) )
effectdata:SetNormal(self:GetAngles():Up())
util.Effect("GlassImpact",effectdata)
end
end
function ENT:SpawnFunction( ply, tr, ClassName )
if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 0.1
local ent = ents.Create( ClassName )
local ang = (ply:GetPos() - SpawnPos):Angle().y
ent:SetPos( SpawnPos )
ent:SetAngles(Angle(0,ang,0))
ent:Spawn()
ent:Activate()
return ent
end
function ENT:Think()
if self.respawn < 0 then return end
if self.respawn > CurTime() then return end
self.respawn = -1
self.hp = 10
self:SetNWBool("broken",false)
--if math.random(1,1000)%100 <= 1 then
-- self:EmitSound("vo/ravenholm/engage02.wav")
--end
end
|
local lookupIcon = {
-- Player = "noncommercial/hero",
Bandit = {"noncommercial/bandit", "Basic immobile turret. Fires directly forward."},
Wall = {"noncommercial/wall", "Immovable obstruction."},
BossFlame = {"noncommercial/boss_flame", "Flamethrower boss."},
BossSlam = {"noncommercial/boss_slam", "Bodyslam boss."},
BossRocket = {"noncommercial/boss_rocket", "Rocket boss."},
BossMulti = {"noncommercial/boss", "Hybrid boss."},
}
Command.Environment.Insert(_G, "Inspect.Entity.Icons", function ()
return lookupIcon
end)
|
Tree_siteText={branchname="Nachrichten pro Seite",
{branchname="example2.de",
{branchname="title2 for the text2",
"This is the text2 corresponding to the title2. ",
},
},
{branchname="example.de",
{branchname="title for the text",
"This is the text corresponding to the title. ",
},
},
}
|
BrotherBags = {
["碧玉矿洞"] = {
["落赎"] = {
{
"4306::::::::41:::::::;19", -- [1]
"4306::::::::41:::::::;20", -- [2]
"5637::::::::41:::::::;3", -- [3]
"3712::::::::41:::::::;8", -- [4]
"12037::::::::41:::::::;4", -- [5]
"12203::::::::41:::::::", -- [6]
"4235::::::::41:::::::", -- [7]
"4234::::::::41:::::::;20", -- [8]
"4234::::::::41:::::::;3", -- [9]
"2319::::::::41:::::::;6", -- [10]
"1645::::::::41:::::::", -- [11]
"4544::::::::41:::::::;4", -- [12]
"1708::::::::41:::::::", -- [13]
"1710::::::::41:::::::;3", -- [14]
}, -- [1]
{
"4582::::::::41:::::::;4", -- [1]
"2744::::::::41:::::::", -- [2]
"17058::::::::41:::::::;4", -- [3]
"5800::::::::41:::::::", -- [4]
"3898::::::::41:::::::", -- [5]
"4626::::::::41:::::::;9", -- [6]
"7846::::::::41:::::::;10", -- [7]
"4506::::::::41:::::::", -- [8]
"7848::::::::41:::::::;5", -- [9]
"7847::::::::41:::::::;5", -- [10]
"4529::::::::41:::11::::", -- [11]
"17033::::::::41:::::::;5", -- [12]
"7067::::::::41:::::::;4", -- [13]
"7070::::::::41:::::::", -- [14]
}, -- [2]
{
"5116::::::::41:::::::;2", -- [1]
"6893::::::::41:::1::::", -- [2]
"4982::::::::41:::11::::", -- [3]
"3793::::::::41:::::::", -- [4]
"4553::::::::41:::::::;5", -- [5]
"4553::::::::41:::::::;5", -- [6]
"4553::::::::41:::::::;5", -- [7]
"4552::::::::41:::::::;4", -- [8]
"4784::::::::41:::::::;5", -- [9]
"4784::::::::41:::::::;5", -- [10]
"4784::::::::41:::::::;5", -- [11]
"4784::::::::41:::::::;5", -- [12]
"4583::::::::41:::::::;4", -- [13]
"1464::::::::41:::::::;3", -- [14]
}, -- [3]
{
"11416::::::::41:::::::;2", -- [1]
"5636::::::::41:::::::;2", -- [2]
"4978::::::::41:::11::::", -- [3]
"12202::::::::41:::::::", -- [4]
"4609::::::::41:::11::::", -- [5]
"4306::::::::41:::::::;17", -- [6]
"3782::::::::41:::::::", -- [7]
"4001::::::::41:::::::", -- [8]
"4553::::::::41:::::::;2", -- [9]
"4784::::::::41:::::::;4", -- [10]
"9873::::::184:1070725632:41:::::::", -- [11]
"12040::::::167:1360400640:41:::::::", -- [12]
"7912::::::::41:::::::;2", -- [13]
}, -- [4]
{
}, -- [5]
{
}, -- [6]
[0] = {
"6948::::::::41:::::::", -- [1]
"2901::::::::41:::14::::", -- [2]
"7005::::::::41:::14::::", -- [3]
"15261::::::869:597783424:41:::::::", -- [4]
"6953::::::::41:::11::::", -- [5]
"15234::::::1104:1232448512:41:::::::", -- [6]
"17686::::::::41:::11::::", -- [7]
"4108::::::::41:::11::::", -- [8]
"4550::::::::41:::11::::", -- [9]
"1529::::::::41:::::::", -- [10]
"2776::::::::41:::::::;2", -- [11]
"4304::::::::41:::::::;11", -- [12]
"8150::::::::41:::::::;18", -- [13]
"4338::::::::41:::::::;9", -- [14]
"7912::::::::41:::::::;19", -- [15]
"4457::::::::41:::::::;2", -- [16]
},
["race"] = "Human",
["money"] = 458049,
["faction"] = true,
["equip"] = {
"1282::::::::41:::11::::", -- [1]
"4743::::::::41:::11::::", -- [2]
"6792::::::::41:::11::::", -- [3]
"2575::::::::41:::11::::", -- [4]
"15546::::::862:1245581568:41:::::::", -- [5]
"3758::::::::41:::11::::", -- [6]
"4741::::::::41:::11::::", -- [7]
"4073::::::::41:::::::", -- [8]
"4745::::::::41:::11::::", -- [9]
"6906::::::::41:::1::::", -- [10]
"6757::::::::41:::11::::", -- [11]
"2933::::::::41:::11::::", -- [12]
nil, -- [13]
nil, -- [14]
"6901::::::::41:::1::::", -- [15]
"15261::::::614:34812416:41:::::::", -- [16]
nil, -- [17]
nil, -- [18]
nil, -- [19]
"14046::::::::41:::::::;14", -- [20]
"14046::::::::41:::::::;14", -- [21]
"14046::::::::41:::::::;14", -- [22]
"14046::::::::41:::::::;14", -- [23]
[72] = "1729::::::::40:::::::;10",
[73] = "3352::::::::40:::::::;10",
},
["class"] = "PALADIN",
[-1] = {
"2000::::::::40:::11::::", -- [1]
"4240::::::::40:::::::", -- [2]
"4240::::::::40:::::::", -- [3]
"4240::::::::40:::::::", -- [4]
"4238::::::::40:::::::", -- [5]
"4238::::::::40:::::::", -- [6]
"4496::::::::40:::::::", -- [7]
"4496::::::::40:::::::", -- [8]
"1537::::::::40:::::::", -- [9]
"2734::::::::40:::::::", -- [10]
"2738::::::::40:::::::;2", -- [11]
"2740::::::::40:::::::", -- [12]
"2742::::::::40:::::::", -- [13]
"2725::::::::40:::::::;2", -- [14]
"2745::::::::40:::::::", -- [15]
"2748::::::::40:::::::", -- [16]
"2728::::::::40:::::::", -- [17]
"6996::::::::40:::::::", -- [18]
"3248::::::::40:::::::", -- [19]
"2154::::::::40:::::::", -- [20]
},
["sex"] = 3,
},
},
["龙之召唤"] = {
["酸橙子"] = {
{
"17056::::::::16:::::::", -- [1]
"6462::::::::16:::::::", -- [2]
"5087::::::::16:::::::;5", -- [3]
"4776::::::::16:::::::;2", -- [4]
"4775::::::::16:::::::", -- [5]
"5114::::::::16:::::::", -- [6]
}, -- [1]
{
}, -- [2]
{
}, -- [3]
{
}, -- [4]
{
}, -- [5]
[0] = {
"6948::::::::16:::::::", -- [1]
"7005::::::::16:::14::::", -- [2]
"6256::::::::16:::14::::", -- [3]
"9514::::::::16:::11::::", -- [4]
"10637::::::::16:::11::::", -- [5]
"15481::::::::16:::::::", -- [6]
"2592::::::::16:::::::;7", -- [7]
"2996::::::::16:::::::;6", -- [8]
"2318::::::::16:::::::;4", -- [9]
"5469::::::::16:::::::", -- [10]
"2589::::::::16:::::::;8", -- [11]
"19994::::::::16:::::::;15", -- [12]
"19997::::::::16:::::::;20", -- [13]
"2455::::::::16:::::::;3", -- [14]
"858::::::::16:::::::", -- [15]
"1251::::::::16:::::::;10", -- [16]
},
["race"] = "Scourge",
["equip"] = {
nil, -- [1]
nil, -- [2]
nil, -- [3]
"2576::::::::16:::::::", -- [4]
"7510::::::::16:::11::::", -- [5]
"3442::::::::16:::11::::", -- [6]
"2958::::::::16:::::::", -- [7]
"3454::::::::16:::11::::", -- [8]
"3453::::::::16:::11::::", -- [9]
"2972::::::::16:::::::", -- [10]
"3235::::::::16:::11::::", -- [11]
nil, -- [12]
nil, -- [13]
nil, -- [14]
"3449::::::::16:::11::::", -- [15]
"3452::::::::16:::11::::", -- [16]
[20] = "4238::::::::16:::::::;6",
[21] = "4238::::::::16:::::::;6",
[18] = "5242::::::::16:::11::::",
[22] = "4238::::::::16:::::::;6",
[23] = "4238::::::::16:::::::;6",
[72] = "4238::::::::15:::::::;6",
},
["sex"] = 2,
["money"] = 20386,
["class"] = "MAGE",
[-1] = {
"4238::::::::15:::::::", -- [1]
"4238::::::::15:::::::", -- [2]
},
["faction"] = false,
},
},
}
|
RegisterServerEvent("alerte:askForAlerte")
AddEventHandler("alerte:askForAlerte", function()
local source = source
TriggerEvent("es:getPlayerFromId", source, function(user)
user.alert("Faire le plein ?", "Les prix sont en baisse, seulement 50$ le litre", {event = "station:unfillTankContainer"})
end)
end)
|
object_tangible_component_weapon_new_weapon_enhancement_melee_slot_one_s11 = object_tangible_component_weapon_new_weapon_shared_enhancement_melee_slot_one_s11:new {
}
ObjectTemplates:addTemplate(object_tangible_component_weapon_new_weapon_enhancement_melee_slot_one_s11, "object/tangible/component/weapon/new_weapon/enhancement_melee_slot_one_s11.iff")
|
-----------------------------------
-- Area: Bastok Mines
-- NPC: Gumbah
-- Finishes Quest: Blade of Darkness, Inheritance
-- !pos 52 0 -36 234
-----------------------------------
require("scripts/globals/keyitems")
require("scripts/globals/quests")
require("scripts/globals/settings")
require("scripts/globals/wsquest")
local ID = require("scripts/zones/Bastok_Mines/IDs")
-----------------------------------
local wsQuest = tpz.wsquest.ground_strike
function onTrade(player, npc, trade)
local wsQuestEvent = tpz.wsquest.getTradeEvent(wsQuest, player, trade)
if wsQuestEvent ~= nil then
player:startEvent(wsQuestEvent)
end
end
function onTrigger(player, npc)
local wsQuestEvent = tpz.wsquest.getTriggerEvent(wsQuest, player)
local bladeDarkness = player:getQuestStatus(BASTOK, tpz.quest.id.bastok.BLADE_OF_DARKNESS)
if wsQuestEvent ~= nil then
player:startEvent(wsQuestEvent)
elseif (player:getMainLvl() >= ADVANCED_JOB_LEVEL and bladeDarkness == QUEST_AVAILABLE) then
--DARK KNIGHT QUEST
player:startEvent(99)
elseif (bladeDarkness == QUEST_COMPLETED and player:getQuestStatus(BASTOK, tpz.quest.id.bastok.BLADE_OF_DEATH) == QUEST_AVAILABLE) then
player:startEvent(130)
elseif ((player:hasCompletedMission(BASTOK, tpz.mission.id.bastok.ON_MY_WAY) == true)
or ((player:getCurrentMission(BASTOK) == tpz.mission.id.bastok.ON_MY_WAY) and (player:getCharVar("MissionStatus") == 3)))
and (player:getCharVar("[B7-2]Werei") == 0) then
player:startEvent(177)
else
--DEFAULT
player:startEvent(52)
end
end
function onEventFinish(player, csid, option)
if (csid == 99) then
player:addQuest(BASTOK, tpz.quest.id.bastok.BLADE_OF_DARKNESS)
elseif (csid == 130) then
player:addQuest(BASTOK, tpz.quest.id.bastok.BLADE_OF_DEATH)
player:addKeyItem(tpz.ki.LETTER_FROM_ZEID)
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.LETTER_FROM_ZEID)
elseif (csid == 177) then
player:setCharVar("[B7-2]Werei", 1)
else
tpz.wsquest.handleEventFinish(wsQuest, player, csid, option, ID.text.GROUND_STRIKE_LEARNED)
end
end
|
function handle_record(record)
record:set("TRX_LINK", string.format('<a href="trx:%s">%s</a>', record:get('TRANSID'), record:get('TRANSID')));
record:set("TRX_LINK_GO", string.format('<a href="trxid:%s">%s</a>', record:get('TRANSID'), record:get('Account')));
end
function complete(result)
end
|
AddCSLuaFile()
local function FloatEquals(x,y) return math.abs(x-y) < 1.19209290E-07 end
DEFINE_BASECLASS "weapon_csbasegun"
CSParseWeaponInfo(SWEP, [[WeaponData
{
"MaxPlayerSpeed" "260"
"WeaponType" "SniperRifle"
"FullAuto" 0
"WeaponPrice" "2750"
"WeaponArmorRatio" "1.7"
"CrosshairMinDistance" "5"
"CrosshairDeltaDistance" "3"
"Team" "ANY"
"BuiltRightHanded" "0"
"PlayerAnimationExtension" "scout"
"MuzzleFlashScale" "1.1"
"CanEquipWithShield" "0"
// Weapon characteristics:
"Penetration" "3"
"Damage" "75"
"Range" "8192"
"RangeModifier" "0.98"
"Bullets" "1"
"CycleTime" "1.25"
"AccuracyDivisor" "-1"
"AccuracyOffset" "0"
"MaxInaccuracy" "0"
"TimeToIdle" "1.8"
"IdleInterval" "60"
// New accuracy model parameters
"Spread" 0.00030
"InaccuracyCrouch" 0.02378
"InaccuracyStand" 0.03170
"InaccuracyJump" 0.38195
"InaccuracyLand" 0.03819
"InaccuracyLadder" 0.09549
"InaccuracyFire" 0.06667
"InaccuracyMove" 0.19097
"SpreadAlt" 0.00030
"InaccuracyCrouchAlt" 0.00300
"InaccuracyStandAlt" 0.00400
"InaccuracyJumpAlt" 0.38195
"InaccuracyLandAlt" 0.03819
"InaccuracyLadderAlt" 0.09549
"InaccuracyFireAlt" 0.06667
"InaccuracyMoveAlt" 0.19097
"RecoveryTimeCrouch" 0.17681
"RecoveryTimeStand" 0.24753
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "#Cstrike_WPNHUD_Scout"
"viewmodel" "models/weapons/v_snip_scout.mdl"
"playermodel" "models/weapons/w_snip_scout.mdl"
"anim_prefix" "anim"
"bucket" "0"
"bucket_position" "0"
"clip_size" "10"
"primary_ammo" "BULLET_PLAYER_762MM"
"secondary_ammo" "None"
"weight" "30"
"item_flags" "0"
// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{
//"reload" "Weapon_AWP.Reload"
//"empty" "Default.ClipEmpty_Rifle"
"single_shot" "Weapon_Scout.Single"
special3 Default.Zoom
}
// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "CSweaponsSmall"
"character" "N"
}
"weapon_s"
{
"font" "CSweapons"
"character" "N"
}
"ammo"
{
"font" "CSTypeDeath"
"character" "V"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}
ModelBounds
{
Viewmodel
{
Mins "-12 -4 -11"
Maxs "27 12 -1"
}
World
{
Mins "-10 -4 -13"
Maxs "32 8 12"
}
}
}]])
SWEP.Spawnable = true
SWEP.Slot = 0
SWEP.SlotPos = 0
function SWEP:Initialize()
BaseClass.Initialize( self )
self:SetHoldType( "ar2" )
self:SetWeaponID( CS_WEAPON_AWP )
end
function SWEP:PrimaryAttack()
if self:GetNextPrimaryAttack() > CurTime() then return end
self:GunFire(self:BuildSpread())
end
function SWEP:SecondaryAttack()
local pPlayer = self:GetOwner();
if not IsValid(pPlayer) then
return;
end
if (self:GetZoomFullyActiveTime() > CurTime() or self:GetNextPrimaryAttack() > CurTime()) then
self:SetNextSecondaryFire(self:GetZoomFullyActiveTime() + 0.15)
return
end
if ( not self:IsScoped() ) then
self:SetFOVRatio( 40/90, 0.15 );
elseif (FloatEquals(self:GetFOVRatio(), 40/90)) then
self:SetFOVRatio( 10/90, 0.08 );
else
self:SetFOVRatio( 1, 0.1 );
end
-- If this isn't guarded, the sound will be emitted twice, once by the server and once by the client.
-- Let the server play it since if only the client plays it, it's liable to get played twice cause of
-- a prediction error. joy.
self:EmitSound("Default.Zoom", nil, nil, nil, CHAN_AUTO);
self:SetNextSecondaryFire(CurTime() + 0.3);
self:SetZoomFullyActiveTime(CurTime() + 0.15); -- The worst zoom time from above.
end
function SWEP:AdjustMouseSensitivity()
if (self:IsScoped()) then
-- is a hack, maybe change?
return self:GetCurrentFOVRatio() * GetConVar "zoom_sensitivity_ratio":GetFloat()
end
end
function SWEP:IsScoped()
return self:GetTargetFOVRatio() ~= 1
end
function SWEP:HandleReload()
self:SetFOVRatio(1, 0.05)
end
function SWEP:GetSpeedRatio()
if (self:IsScoped()) then
return 220/260
end
return 1
end
function SWEP:GunFire( spread )
local pPlayer = self:GetOwner()
if (CurTime() < self:GetZoomFullyActiveTime()) then
self:SetNextPrimaryAttack(self:GetZoomFullyActiveTime())
return
end
if (not self:IsScoped()) then
spread = spread + .08
end
if not self:BaseGunFire( spread, self:GetWeaponInfo().CycleTime, true ) then
return
end
if (self:IsScoped()) then
self:SetLastZoom(self:GetTargetFOVRatio());
self:SetResumeZoom(true);
self:SetFOVRatio( 1, 0.1 );
end
local a = self:GetOwner():GetViewPunchAngles( )
a.p = a.p - 2
self:GetOwner():SetViewPunchAngles( a )
end
|
HighScore = class('HighScore')
function HighScore:initialize()
self.destroyScores = {
[Blob] = 5,
[Tank] = 25,
[Healer] = 10,
[Ninja] = 40,
[Megabyte] = 500,
[Sweeper] = 15 --sweeper
}
self.accuracyScore = 100 -- get this many points with 100% accuracy in a wave
self.ricochetBonus = 100 -- get this bonus if _ enemies are killed in one wave, as the result of tank ricochet shots
self.ricochetMinimum = 7 -- kill this many enemies with tank ricochet shots in one wave, to score the bonus
self.timeScore = 500 -- you would get this many points by completing wave 1 in 1 second. formula: timeScore * wave / seconds
self.scoreMultiplier = 1 -- this is multiplied to every score, good for bonuses
self.perfectAccuracyMultipler = 2 -- this is multiplied to the accuracy bonus if there is 100% accuracy in a wave
self.enemyDeathObserver = signal.register('enemyDeath', function(enemy) self:onEnemyDeath(enemy) end)
self.enemyHitObserver = signal.register('enemyHit', function(enemy, damage, critical, source, death) self:onEnemyHit(enemy, damage, critical, source, death) end)
self.playerShootObserver = signal.register('playerShot', function() self:onPlayerShoot() end)
self.waveEndObserver = signal.register('waveEnded', function(wave, waveTime) self:onWaveEnd(wave, waveTime) end)
signal.register('newGame', function() self:reset() end)
self:reset()
self.defaultFontSize = 64
self.fontSize = self.defaultFontSize
self.fontSizeModifier = 3
self.maxFontSize = 120
end
function HighScore:reset()
-- no need to change these
self.currentScore = 0
self:resetCounters()
-- The score displayed to the screen, may or may not be equal to the current score.
-- It does approach the current score, though.
self.displayScore = 0
end
function HighScore:resetCounters()
self.bulletsShot = 0
self.bulletsHit = 0
self.ricochetKills = 0
end
function HighScore:update(dt)
-- interpolates the display score towards the current score
local diff = self.currentScore - self.displayScore
local epsilon = 1
if diff > epsilon then
self.displayScore = self.displayScore + (diff) * 5 * dt
else
self.displayScore = self.currentScore
end
if diff ~= 0 then
self.fontSize = math.min(self.defaultFontSize + self.fontSizeModifier * diff, self.maxFontSize)
--self.fontSizeTween = tween(.5, self, {fontSize = 80}, "inOutCubic", function()
-- self.fontSizeTween2 = tween(.5, self, {fontSize = self.defaultFontSize}, "inOutCubic", function()
-- end)
--self.fontSize = self.defaultFontSize
--end)
else
self.fontSize = self.defaultFontSize
end
end
function HighScore:changeScore(amount)
amount = amount * self.scoreMultiplier
signal.emit('scoreChange', amount)
self.currentScore = self.currentScore + amount
end
function HighScore:onEnemyDeath(enemy)
-- add to score based on which enemy was defeated
local scoreChange = self.destroyScores[enemy.class] or 1
self:changeScore(scoreChange)
end
function HighScore:onEnemyHit(enemy, damage, critical, source, death)
if not enemy.isInstanceOf(Player) then
if source:isInstanceOf(Player) then
self.bulletsHit = self.bulletsHit + 1
elseif source:isInstanceOf(Tank) then
self.ricochetKills = self.ricochetKills + 1
end
end
end
function HighScore:onPlayerShoot()
self.bulletsShot = self.bulletsShot + 1
end
function HighScore:onWaveEnd(wave, waveTime)
if wave and wave > 0 then
-- calculate accuracy for the current wave, add to player score
local accuracy = 0
if self.bulletsShot ~= 0 then
accuracy = self.bulletsHit / self.bulletsShot
end
local accuracyPoints = math.ceil(accuracy * self.accuracyScore)
if accuracy == 1 then -- perfect accuracy!
accuracyPoints = accuracyPoints * self.perfectAccuracyMultipler
end
self:changeScore(accuracyPoints)
-- add in the time bonus
if waveTime > 0 then -- avoid dividing by 0
local timePoints = math.ceil(self.timeScore * wave / waveTime)
timePoints = timePoints * game.wave -- higher wave gives a higher time score
self:changeScore(timePoints)
end
-- check for wave ricochet bonus
if self.ricochetKills >= self.ricochetMinimum then
self:changeScore(self.ricochetBonus)
end
self:resetCounters()
end
end
function HighScore:draw()
-- do not show outside the game state, unless the game is paused
if (state.current() ~= game) and (state.current() ~= pause) then
return
end
local font = font[self.fontSize]
local text = math.floor(self.displayScore)
love.graphics.setFont(font)
local w = font:getWidth(text)
local h = font:getHeight(text)
love.graphics.print(text, love.graphics.getWidth() - w - 15, love.graphics.getHeight() - h - 15)
end
|
local spell = {}
spell["element"] = [[Support]]
spell["desc"] = [[All allies enter battle with heightened defences]]
spell["passive"] = true
spell["name"] = [[Auto-Marakukaja]]
function spell.activate()
require("data/spells/Marakukaja").activate(true)
end
return spell
|
GNLib.Colors = {}
-- > Palette from https://flatuicolors.com/palette/defo
GNLib.Colors.Turquoise = Color(26, 188, 156, 255)
GNLib.Colors.GreenSea = Color(22, 160, 133, 255)
GNLib.Colors.Emerald = Color(46, 204, 113, 255)
GNLib.Colors.Nephritis = Color(39, 174, 96, 255)
GNLib.Colors.PeterRiver = Color(52, 152, 219, 255)
GNLib.Colors.BelizeHole = Color(41, 128, 185, 255)
GNLib.Colors.Amethyst = Color(155, 89, 182, 255)
GNLib.Colors.Wisteria = Color(142, 68, 173, 255)
GNLib.Colors.WetAsphalt = Color(52, 73, 94, 255)
GNLib.Colors.MidnightBlue = Color(44, 62, 80, 255)
GNLib.Colors.SunFlower = Color(241, 196, 15, 255)
GNLib.Colors.Orange = Color(243, 156, 18, 255)
GNLib.Colors.Carrot = Color(230, 126, 34, 255)
GNLib.Colors.Pumpkin = Color(211, 84, 0, 255)
GNLib.Colors.Alizarin = Color(231, 76, 60, 255)
GNLib.Colors.Pomegranate = Color(192, 57, 43, 255)
GNLib.Colors.Clouds = Color(236, 240, 241, 255)
GNLib.Colors.Silver = Color(189, 195, 199, 255)
GNLib.Colors.Concrete = Color(149, 165, 166, 255)
GNLib.Colors.Asbestos = Color(127, 140, 141, 255)
|
--- Convert an extended avro-schema (collections) to a GraphQL schema.
local schema = require('graphql.convert_schema.schema')
local convert_schema = {}
convert_schema.convert = schema.convert
return convert_schema
|
local engine, ns = ...
-- link internal map name to level number
local mapsLevels = {
["game/sp/intro/intro"] = 1,
["game/sp/resource_ops/resource_ops"] = 2,
["game/sp/resource_ops_foundry/resource_ops_foundry"] = 3,
["game/sp/surface1/surface1"] = 4,
["game/sp/argent_tower/argent_tower"] = 5,
["game/sp/blood_keep/blood_keep"] = 6,
["game/sp/surface2/surface2"] = 7,
["game/sp/bfg_division/bfg_division"] = 8,
["game/sp/lazarus/lazarus"] = 9,
["game/sp/lazarus_2/lazarus_2"] = 9,
["game/sp/blood_keep_b/blood_keep_b"] = 10,
["game/sp/blood_keep_c/blood_keep_c"] = 11,
["game/sp/polar_core/polar_core"] = 12,
["game/sp/titan/titan"] = 13
}
-- difficulties
local difficultyValues = {
"I'm too young to die",
"Hurt me plenty",
"Ultra-Violence",
"Nightmare",
"Ultra-Nightmare"
}
local difficultyToString = function(diff)
if diff and (diff >= 0) and (diff < 5) and difficultyValues[diff+1] then
return difficultyValues[diff+1]
end
return "unknown"
end
-- to string function for category class
local categoryToString = function(category)
if category.Level > 0 then
local s = "#" .. category.Level
if string.len(s) == 2 then
s = s .. " "
end
return s .. ": " .. category.Name
else
return category.Name
end
end
local snapshotsBySavedAt = function(savedAt)
Logger.Debug("snapshotsBySavedAt")
local count = engine.Snapshots.Count
for i = 0, count-1 do
local snapshot = engine.Snapshots[i]
if snapshot.SavedAt == savedAt then
return snapshot
end
end
return nil
end
local getMapFullSafeName = function(snapshot)
local mapDesc = snapshot:CustomValueByKey("MapDesc").Value
local level = snapshot.CategoryId
local safeMap = tostring(level) .. " - " .. HgUtility.SafePath(mapDesc)
Logger.Debug("getMapFullSafeName: ", safeMap)
return safeMap
end
local categories = {}
local refreshCategories = function()
Logger.Debug("refreshCategories")
local cat = nil
if not categories[0] then
cat = EngineSnapshotCategory()
cat.Id = 0
cat.Name = "All"
cat.Level = 0
cat.OnToString = categoryToString
engine.Categories:Add(cat)
categories[0] = cat
end
local count = engine.Categories.Count
-- build category list from snapshots
for i = 0, engine.Snapshots.Count-1 do
local snapshot = engine.Snapshots[i]
local mapName = snapshot:CustomValueByKey("MapName").Value
local mapDesc = snapshot:CustomValueByKey("MapDesc").Value
local level = mapsLevels[mapName] or 0
cat = nil
if level > 0 and not categories[level] then
cat = EngineSnapshotCategory()
cat.Id = level
cat.Name = mapDesc or "unknown"
cat.Level = level
cat.OnToString = categoryToString
engine.Categories:Add(cat)
categories[level] = cat
end
end
engine.Categories:Sort(function(c1, c2)
return c1.Level - c2.Level
end)
engine:CategoriesChanges()
end
local parseGameDetailFile = function(lines)
Logger.Debug("parseGameDetailFile")
local snapshot = EngineSnapshot()
for i = 0, lines.Length-1 do
v = lines[i]
-- Logger.Debug(i .. ": " .. v)
v = HgUtility.StringTrim(v)
local values = HgUtility.StringSplit(v, "=", StringSplitOptions.None)
if values and (values.Length == 2) then
if values[0] == "date" then
local datetime = HgConverter.UnixToDateTime(tonumber(values[1]))
snapshot.SavedAt = datetime
end
if values[0] == "difficulty" then
local custom = EngineSnapshotCustomValueInteger()
custom.Caption = "Difficulty"
custom.ShowInDetails = true
custom.Value = tonumber(values[1])
custom.OnToString = difficultyToString
snapshot.CustomValues:Add("Difficulty", custom)
end
if values[0] == "mapDesc" then
local custom = EngineSnapshotCustomValueString()
custom.Caption = "Map Description"
custom.ShowInDetails = true
custom.Value = tostring(values[1])
snapshot.CustomValues:Add("MapDesc", custom)
end
if values[0] == "mapName" then
local mapName = tostring(values[1])
local level = mapsLevels[mapName] or 0
if level == 0 then
Logger.Warning("parseGameDetailFile: mapName not found!")
end
snapshot.CategoryId = level
local custom = EngineSnapshotCustomValueString()
custom.Caption = "Map Name"
custom.ShowInDetails = true
custom.Value = mapName
snapshot.CustomValues:Add("MapName", custom)
end
if values[0] == "time" then
local playedTime = TimeSpan(0, 0, tonumber(values[1]))
local custom = EngineSnapshotCustomValueTimeSpan()
custom.Caption = "Played Time"
custom.ShowInDetails = true
custom.Value = playedTime
snapshot.CustomValues:Add("PlayedTime", custom)
end
end
end
return snapshot
end
local getSavedAtFromGameDetailFile = function(lines)
Logger.Debug("getSavedAtFromGameDetailFile")
for i = 0, lines.Length-1 do
v = lines[i]
v = HgUtility.StringTrim(v)
local values = HgUtility.StringSplit(v, "=", StringSplitOptions.None)
if values and (values.Length == 2) then
if values[0] == "date" then
local datetime = HgConverter.UnixToDateTime(tonumber(values[1]))
return datetime
end
end
end
return nil
end
local snapshotsFolder = ""
local sourceFolder = ""
local slotIndex = nil
local slotPath = ""
local snapshotBackup = function(actionSouce, isDeath)
Logger.Information("snapshotBackup: ", actionSouce, ", ", isDeath)
if Directory.Exists(slotPath) then
local gameDetailsFilePath = Path.Combine(slotPath, "game.details")
local fileContent = File.ReadAllText(gameDetailsFilePath)
-- .NET version
local lines = HgUtility.StringSplit(fileContent, "\n\r", StringSplitOptions.RemoveEmptyEntries)
-- lua version
-- local lines = ns.StringSplit(fileContent, "[^\r\n]+")
local savedAt = getSavedAtFromGameDetailFile(lines)
local snapshot = snapshotsBySavedAt(savedAt)
if snapshot == nil then
Logger.Debug("snapshot parsing")
snapshot = parseGameDetailFile(lines)
Logger.Debug("snapshot parsed")
-- if needed, set snapshot.SavedAtToStringFormat
local custom = EngineSnapshotCustomValueString()
custom.Caption = "Death"
custom.ShowInDetails = true
custom.Value = ""
if isDeath == true then
custom.Value = "🕱"
end
snapshot.CustomValues:Add("Death", custom)
-- get safe map name
local targetPath = getMapFullSafeName(snapshot)
local saveAtSafe = savedAt:ToString("yyyy-MM-dd HH.mm.ss")
targetPath = Path.Combine(targetPath, saveAtSafe)
-- save relative path to snapshot
snapshot.RelativePath = targetPath
-- "GAME-AUTOSAVE" + (_id - 1)
targetPath = Path.Combine(targetPath, "GAME-AUTOSAVE" .. (slotIndex - 1))
-- full path
targetPath = Path.Combine(snapshotsFolder, targetPath)
Logger.Debug("sourcePath=" .. slotPath)
Logger.Debug("targetPath=" .. targetPath)
local canCopy = function(filename, mode) -- canCopy callback
if mode == BackupHelperCanCopyMode.Copy then
return not ns.StringEndsWith(filename, ".temp") and not ns.StringEndsWith(filename, ".temp.verify")
end
end
local mustWait = function(filename) -- mustWait callback
return ns.StringEndsWith(filename, ".temp") or ns.StringEndsWith(filename, ".temp.verify")
end
Logger.Debug("BackupHelper.CopyFiles: start")
local copyFiles = BackupHelper.CopyFiles(
slotPath,
targetPath,
canCopy,
mustWait,
true,
false
)
Logger.Debug("BackupHelper.CopyFiles: end")
if copyFiles then
-- autobackup: screenshot
if actionSouce == ActionSource.AutoBackup then
local screenshot = engine:SettingByName("Screenshot").Value
if screenshot then
local bounds = engine.ScreenshotHelper:GetWindowBounds()
if bounds then
local capture = engine.ScreenshotHelper:Capture(bounds, snapshot)
if capture then
Logger.Debug("snapshot: screenshot success")
else
Logger.Warning("snapshot: screenshot failed")
end
end
end
end
Logger.Debug("snapshot: adding to list")
engine.Snapshots:Add(snapshot)
-- it is up to the engine to set LastSnapshot to enable auto select feature
engine.LastSnapshot = snapshot
-- rebuild category list
refreshCategories()
-- trigger UI refresh
engine:SnapshotsChanges()
else
return false
end
else
if snapshot.Status == EngineSnapshotStatus.Deleted then
Logger.Information("snapshot: restored to active")
snapshot.Status = EngineSnapshotStatus.Active
-- it is up to the engine to set LastSnapshot to enable auto select feature
engine.LastSnapshot = snapshot
-- trigger UI refresh
engine:SnapshotsChanges()
else
Logger.Information("snapshot: already known")
end
end
return true
end
return false
end
local snapshotRestore = function(actionSouce, snapshot)
Logger.Information("snapshotRestore: ", actionSouce, ", ", snapshot)
local sourcePath = Path.Combine(snapshotsFolder, snapshot.RelativePath)
sourcePath = Path.Combine(sourcePath, "GAME-AUTOSAVE" .. (slotIndex - 1))
Logger.Debug("sourcePath=" .. sourcePath)
Logger.Debug("targetPath=" .. slotPath)
Logger.Debug("BackupHelper.CopyFiles: start")
local copyFiles = BackupHelper.CopyFiles(
sourcePath,
slotPath,
nil,
nil,
true,
true
)
Logger.Debug("BackupHelper.CopyFiles: end")
if copyFiles then
Logger.Debug("snapshot restored")
else
return false
end
return true
end
local _checkpointStartTime = nil
local _checkpointBuffer = ""
local _isCheckPoint = false
local _isCheckPointAlt = false
local _isGameDuration = false
local _isCheckPointMapStart = false
local watcherOnEvent = function(eventType, event)
Logger.Debug("watcherOnEvent: event.Name = ", event.Name)
if _checkpointStartTime ~= nil then
local timeSpan = DateTime.UtcNow:Subtract(_checkpointStartTime)
-- 3 seconds might be too small for some computers, we'll see if we need to add this into a runtime setting
if timeSpan.TotalSeconds >= 3 then
if _checkpointBuffer == "AG" then
Logger.Warning("AutoBackup: cannot backup checkpoints while replaying missions")
else
Logger.Debug("watcherOnEvent: Too much time since last event, _checkpointBuffer was ", _checkpointBuffer)
end
-- Too much time since last event, reset states
_checkpointBuffer = ""
_checkpointStartTime = nil
_isCheckPoint = false
_isCheckPointAlt = false
_isGameDuration = false
_isCheckPointMapStart = false
end
end
if not _isGameDuration and event.Name == "game_duration.dat" then
_isGameDuration = true
_checkpointBuffer = _checkpointBuffer .. "G"
end
if not _isCheckPointMapStart and event.Name == "checkpoint_mapstart.dat" then
_isCheckPointMapStart = true
_checkpointBuffer = _checkpointBuffer .. "M"
end
-- Mostly in case of death
if not _isCheckPointAlt and event.Name == "checkpoint_alt.dat" then
_isCheckPointAlt = true
_checkpointBuffer = _checkpointBuffer .. "A"
end
-- Proper checkpoint
if not _isCheckPoint and event.Name == "checkpoint.dat" then
_isCheckPoint = true
_checkpointBuffer = _checkpointBuffer .. "C"
end
if _checkpointStartTime == nil and _checkpointBuffer ~= "" then
_checkpointStartTime = DateTime.UtcNow
end
if event.Name == "game.details.verify" then
-- here we go
Logger.Debug("watcherOnEvent: game.details.verify event, _checkpointBuffer = ", _checkpointBuffer)
if ns.StringStartsWith(_checkpointBuffer, "CGMA") then
Logger.Debug("watcherOnEvent: map change")
-- Map change checkpoint (usually)
-- do nothing
elseif ns.StringStartsWith(_checkpointBuffer, "CMGA") then
Logger.Debug("watcherOnEvent: normal checkpoint")
-- Normal checkpoint (usually)
-- backup
local status = snapshotBackup(ActionSource.AutoBackup, false)
engine:AutoBackupOccurred(status)
elseif _checkpointBuffer == "GA" then
Logger.Debug("watcherOnEvent: death checkpoint")
-- Death checkpoint (usually)
-- backup
local includeDeath = engine:SettingByName("IncludeDeath").Value
if includeDeath then
local status = snapshotBackup(ActionSource.AutoBackup, true)
engine:AutoBackupOccurred(status)
end
end
_isCheckPoint = false
_isCheckPointAlt = false
_isGameDuration = false
_isCheckPointMapStart = false
_checkpointBuffer = ""
_checkpointStartTime = nil
end
end
engine.OnOpened = function()
Logger.Debug("OnOpened")
for i = 0, engine.Snapshots.Count-1 do
local snapshot = engine.Snapshots[i]
-- if needed, set snapshot.OnEquals
local customValue = nil
customValue = snapshot:CustomValueByKey("Difficulty")
if customValue then
-- set customValue.OnToString
customValue.OnToString = difficultyToString
end
-- if needed, handle other customValue
end
refreshCategories()
end
local watcher = nil
engine.OnInitialized = function()
Logger.Debug("OnInitialized")
-- Target backup folder
snapshotsFolder = engine.SnapshotsFolder
Logger.Debug("snapshotsFolder=" .. snapshotsFolder)
sourceFolder = engine:SettingByName("SourceFolder").Value
Logger.Debug("sourceFolder=" .. sourceFolder)
slotIndex = engine:SettingByName("SlotIndex").Value
Logger.Debug("slotIndex=" .. slotIndex)
-- full source path (where files are)
slotPath = Path.Combine(sourceFolder, "GAME-AUTOSAVE" .. (slotIndex - 1))
Logger.Debug("slotPath=" .. slotPath)
watcher = EngineWatcher()
watcher.Path = slotPath
watcher.WatchParent = true
watcher.Filter = "*"
watcher.WatchRenamed = true
watcher.OnEvent = watcherOnEvent
engine:SetupWatcher(watcher)
end
engine.OnLoaded = function()
Logger.Debug("OnLoaded")
engine:CategoriesChanges()
engine:SnapshotsChanges()
end
engine.OnClosing = function()
Logger.Debug("OnClosing")
return true
end
engine.OnClosed = function()
Logger.Debug("OnClosed")
if watcher then
watcher.OnEvent = nil
end
watcher = nil
categories = nil
end
engine.OnActionSnapshotBackup = function(actionSource, isDeath)
return snapshotBackup(actionSource, isDeath)
end
engine.OnActionSnapshotRestore = function(actionSource, snapshot)
return snapshotRestore(actionSource, snapshot)
end
engine.ReadMe = function()
local content =
[[DOOM 2016
Manual backup:
This will backup the current save files of the selected slot.
If the save files have already been backed-up, nothing happens.
Automatic backup:
This will backup the current save files of the selected slot everytime a in-game checkpoint is reached.
Death checkpoints can be distinguished from progression checkpoints and backed-up or not.
Manual restore:
Restore the selected snapshot and override the current save files for the selected slot.
For DOOM 2016 to take the restored files into account, you must be on the main game menu before restoring.
Screenshot:
Screenshot will only work if the game uses OpenGL or run windowed.
Enjoy!]]
return content;
end
|
-- Copyright (C) 2012 by wubenqi
-- Distributable under the terms of either the Apache License (Version 2.0) or
-- the GNU Lesser General Public License, as specified in the COPYING file.
--
-- By: wubenqi<wubenqi@gmail.com>
--
------------------------------------------------------------------------------------------------------------
if EchodMainUtil == nil then
EchodMainUtil = {
class_name = "EchodMainUtil"
}
end
function EchodMainUtil:MainInitialize()
TRACE("EchodMainUtil:MainInitialize()")
return 0
end
function EchodMainUtil:MainDestroy()
--ctx:term()
TRACE("EchodMainUtil:MainDestroy()")
return 0
end
if g_main_util == nil or g_main_util.class_name == "MailUtil" then
g_main_util = MainUtil:CreateInstance(EchodMainUtil)
else
--PrintTable(g_main_util)
g_main_util = EchodMainUtil
end
|
minetest.register_craftitem("yatm_bees:synthetic_brood_comb_empty", {
basename = "yatm_bees:synthetic_brood_comb",
base_description = "Synthetic Brood Comb",
description = "Empty Synthetic Brood Comb",
groups = {
wax_comb = 1,
empty_comb = 1,
empty_synthetic_brood_comb = 1,
},
inventory_image = "yatm_honey_combs_synthetic_brood_empty.png",
})
minetest.register_craftitem("yatm_bees:synthetic_brood_comb_full", {
basename = "yatm_bees:synthetic_brood_comb",
base_description = "Synthetic Brood Comb",
description = "Full Synthetic Brood Comb",
groups = {
wax_comb = 1,
synthetic_brood_comb = 1,
},
inventory_image = "yatm_honey_combs_synthetic_brood_full.png",
})
|
local Class = require "Base.Class"
local Base = require "PinView.Control"
local ply = app.SECTION_PLY
local Gate = Class {}
Gate:include(Base)
function Gate:init(args)
Base.init(self, args)
self:setClassName("PinView.Gate")
-- required arguments
local name = args.name or app.logError("%s.init: name is missing.", self)
self:setInstanceName(name)
local comparator = args.comparator or
app.logError("%s.init: comparator is missing.", self)
self.comparator = comparator
-- optional arguments
local units = args.units or app.unitHertz
local precision = args.precision or 3
local param = args.param
local graphic
if param then
graphic = app.ComparatorView(0, 0, ply, 64, comparator, param)
else
graphic = app.ComparatorView(0, 0, ply, 64, comparator)
end
graphic:setLabel(name)
graphic:setUnits(units)
graphic:setPrecision(precision)
self.comparatorView = graphic
self:setMainCursorController(graphic)
self:setControlGraphic(graphic)
self:addSpotDescriptor{
center = 0.5 * ply
}
-- sub display
self.subGraphic = app.Graphic(0, 0, 128, 64)
graphic = app.TextPanel("Rename", 1)
self.subGraphic:addChild(graphic)
graphic = app.TextPanel("Unpin", 2)
self.subGraphic:addChild(graphic)
graphic = app.TextPanel("", 3)
self.subGraphic:addChild(graphic)
end
function Gate:rename(name)
self:setInstanceName(name)
self.comparatorView:setLabel(name)
end
function Gate:spotPressed(spot, shifted)
if shifted then return false end
self.comparator:simulateRisingEdge()
return true
end
function Gate:spotReleased(spot, shifted)
if shifted then return false end
self.comparator:simulateFallingEdge()
return true
end
function Gate:encoder(change, shifted)
return true
end
function Gate:subReleased(i, shifted)
if shifted then return false end
if i == 1 then
self:doRename()
elseif i == 2 then
local pinSet = self.parent -- save it
pinSet:startViewModifications()
pinSet:unpinControl(self.delegate)
pinSet:endViewModifications()
elseif i == 3 then
-- do nothing
end
return true
end
return Gate
|
local lib=dofiled("lib/misc")
local eg=dofiled("lib/eg")
local cocomo=require("xomo/cocomo")
eg.all {
one = function(self)
local function say()
print("")
--lib.o(i.x)
lib.oo {effort= self.y.effort,
loc = self.x.loc,
risk = self.y.risk,
pcap = self.x.pcap}
end
self = cocomo.ready()
cocomo.new(self, {pcap=4})
self = cocomo.ready(self)
say()
cocomo.set(self, {pcap=1})
self = cocomo.ready(self)
say()
end}
|
obj1 = {}
function obj1:f1(a, b)
print(tostring(a) .. tostring(b) .. str)
end
|
--- Functions for creating primitive shapes.
-- @module worldedit.primitives
local mh = worldedit.manip_helpers
--- Adds a sphere of `node_name` centered at `pos`.
-- @param pos Position to center sphere at.
-- @param radius Sphere radius.
-- @param node_name Name of node to make shere of.
-- @param hollow Whether the sphere should be hollow.
-- @return The number of nodes added.
function worldedit.sphere(pos, radius, node_name, hollow)
local manip, area = mh.init_radius(pos, radius)
local data = mh.get_empty_data(area)
-- Fill selected area with node
local node_id = minetest.get_content_id(node_name)
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
local offset_x, offset_y, offset_z = pos.x - area.MinEdge.x, pos.y - area.MinEdge.y, pos.z - area.MinEdge.z
local stride_z, stride_y = area.zstride, area.ystride
local count = 0
for z = -radius, radius do
-- Offset contributed by z plus 1 to make it 1-indexed
local new_z = (z + offset_z) * stride_z + 1
for y = -radius, radius do
local new_y = new_z + (y + offset_y) * stride_y
for x = -radius, radius do
local squared = x * x + y * y + z * z
if squared <= max_radius and (not hollow or squared >= min_radius) then
-- Position is on surface of sphere
local i = new_y + (x + offset_x)
data[i] = node_id
count = count + 1
end
end
end
end
mh.finish(manip, data)
return count
end
--- Adds a dome.
-- @param pos Position to center dome at.
-- @param radius Dome radius. Negative for concave domes.
-- @param node_name Name of node to make dome of.
-- @param hollow Whether the dome should be hollow.
-- @return The number of nodes added.
-- TODO: Add axis option.
function worldedit.dome(pos, radius, node_name, hollow)
local min_y, max_y = 0, radius
if radius < 0 then
radius = -radius
min_y, max_y = -radius, 0
end
local manip, area = mh.init_axis_radius(pos, "y", radius)
local data = mh.get_empty_data(area)
-- Add dome
local node_id = minetest.get_content_id(node_name)
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
local offset_x, offset_y, offset_z = pos.x - area.MinEdge.x, pos.y - area.MinEdge.y, pos.z - area.MinEdge.z
local stride_z, stride_y = area.zstride, area.ystride
local count = 0
for z = -radius, radius do
local new_z = (z + offset_z) * stride_z + 1 --offset contributed by z plus 1 to make it 1-indexed
for y = min_y, max_y do
local new_y = new_z + (y + offset_y) * stride_y
for x = -radius, radius do
local squared = x * x + y * y + z * z
if squared <= max_radius and (not hollow or squared >= min_radius) then
-- Position is in dome
local i = new_y + (x + offset_x)
data[i] = node_id
count = count + 1
end
end
end
end
mh.finish(manip, data)
return count
end
--- Adds a cylinder.
-- @param pos Position to center base of cylinder at.
-- @param axis Axis ("x", "y", or "z")
-- @param length Cylinder length.
-- @param radius Cylinder radius.
-- @param node_name Name of node to make cylinder of.
-- @param hollow Whether the cylinder should be hollow.
-- @return The number of nodes added.
function worldedit.cylinder(pos, axis, length, radius, node_name, hollow)
local other1, other2 = worldedit.get_axis_others(axis)
-- Handle negative lengths
local current_pos = {x=pos.x, y=pos.y, z=pos.z}
if length < 0 then
length = -length
current_pos[axis] = current_pos[axis] - length
end
-- Set up voxel manipulator
local manip, area = mh.init_axis_radius_length(current_pos, axis, radius, length)
local data = mh.get_empty_data(area)
-- Add cylinder
local node_id = minetest.get_content_id(node_name)
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
local stride = {x=1, y=area.ystride, z=area.zstride}
local offset = {
x = current_pos.x - area.MinEdge.x,
y = current_pos.y - area.MinEdge.y,
z = current_pos.z - area.MinEdge.z,
}
local min_slice, max_slice = offset[axis], offset[axis] + length - 1
local count = 0
for index2 = -radius, radius do
-- Offset contributed by other axis 1 plus 1 to make it 1-indexed
local new_index2 = (index2 + offset[other1]) * stride[other1] + 1
for index3 = -radius, radius do
local new_index3 = new_index2 + (index3 + offset[other2]) * stride[other2]
local squared = index2 * index2 + index3 * index3
if squared <= max_radius and (not hollow or squared >= min_radius) then
-- Position is in cylinder
-- Add column along axis
for index1 = min_slice, max_slice do
local vi = new_index3 + index1 * stride[axis]
data[vi] = node_id
end
count = count + length
end
end
end
mh.finish(manip, data)
return count
end
--- Adds a pyramid.
-- @param pos Position to center base of pyramid at.
-- @param axis Axis ("x", "y", or "z")
-- @param height Pyramid height.
-- @param node_name Name of node to make pyramid of.
-- @param hollow Whether the pyramid should be hollow.
-- @return The number of nodes added.
function worldedit.pyramid(pos, axis, height, node_name, hollow)
local other1, other2 = worldedit.get_axis_others(axis)
-- Set up voxel manipulator
local manip, area = mh.init_axis_radius(pos, axis,
height >= 0 and height or -height)
local data = mh.get_empty_data(area)
-- Handle inverted pyramids
local start_axis, end_axis, step
if height > 0 then
height = height - 1
step = 1
else
height = height + 1
step = -1
end
-- Add pyramid
local node_id = minetest.get_content_id(node_name)
local stride = {x=1, y=area.ystride, z=area.zstride}
local offset = {
x = pos.x - area.MinEdge.x,
y = pos.y - area.MinEdge.y,
z = pos.z - area.MinEdge.z,
}
local size = math.abs(height * step)
local count = 0
-- For each level of the pyramid
for index1 = 0, height, step do
-- Offset contributed by axis plus 1 to make it 1-indexed
local new_index1 = (index1 + offset[axis]) * stride[axis] + 1
for index2 = -size, size do
local new_index2 = new_index1 + (index2 + offset[other1]) * stride[other1]
for index3 = -size, size do
local i = new_index2 + (index3 + offset[other2]) * stride[other2]
if (not hollow or size - math.abs(index2) < 2 or size - math.abs(index3) < 2) then
data[i] = node_id
count = count + 1
end
end
end
size = size - 1
end
mh.finish(manip, data)
return count
end
--- Adds a spiral.
-- @param pos Position to center spiral at.
-- @param length Spral length.
-- @param height Spiral height.
-- @param spacer Space between walls.
-- @param node_name Name of node to make spiral of.
-- @return Number of nodes added.
-- TODO: Add axis option.
function worldedit.spiral(pos, length, height, spacer, node_name)
local extent = math.ceil(length / 2)
local manip, area = mh.init_axis_radius_length(pos, "y", extent, height)
local data = mh.get_empty_data(area)
-- Set up variables
local node_id = minetest.get_content_id(node_name)
local stride = {x=1, y=area.ystride, z=area.zstride}
local offset_x, offset_y, offset_z = pos.x - area.MinEdge.x, pos.y - area.MinEdge.y, pos.z - area.MinEdge.z
local i = offset_z * stride.z + offset_y * stride.y + offset_x + 1
-- Add first column
local count = height
local column = i
for y = 1, height do
data[column] = node_id
column = column + stride.y
end
-- Add spiral segments
local stride_axis, stride_other = stride.x, stride.z
local sign = -1
local segment_length = 0
spacer = spacer + 1
-- Go through each segment except the last
for segment = 1, math.floor(length / spacer) * 2 do
-- Change sign and length every other turn starting with the first
if segment % 2 == 1 then
sign = -sign
segment_length = segment_length + spacer
end
-- Fill segment
for index = 1, segment_length do
-- Move along the direction of the segment
i = i + stride_axis * sign
local column = i
-- Add column
for y = 1, height do
data[column] = node_id
column = column + stride.y
end
end
count = count + segment_length * height
stride_axis, stride_other = stride_other, stride_axis -- Swap axes
end
-- Add shorter final segment
sign = -sign
for index = 1, segment_length do
i = i + stride_axis * sign
local column = i
-- Add column
for y = 1, height do
data[column] = node_id
column = column + stride.y
end
end
count = count + segment_length * height
mh.finish(manip, data)
return count
end
|
for _, funcName in ipairs({
"HasFlag",
"IsDev",
"IsMod",
"IsAdmin",
"IsOwner",
}) do
local func = User[funcName]
Main[funcName] = function(self, ...)
local user = self:GetUser()
if not user then return false end
return func(user, ...)
end
Export(Main, funcName)
end
|
local luacheck = require "luacheck"
local fs = require "luacheck.fs"
local multithreading = require "luacheck.multithreading"
local version = {}
version.luacheck = luacheck._VERSION
if rawget(_G, "jit") then
version.lua = rawget(_G, "jit").version
else
version.lua = _VERSION
end
if fs.has_lfs then
local lfs = require "lfs"
version.lfs = lfs._VERSION
else
version.lfs = "Not found"
end
if multithreading.has_lanes then
version.lanes = multithreading.lanes.ABOUT.version
else
version.lanes = "Not found"
end
version.string = ([[
Luacheck: %s
Lua: %s
LuaFileSystem: %s
LuaLanes: %s]]):format(version.luacheck, version.lua, version.lfs, version.lanes)
return version
|
local ArmorShop = File:extend()
function ArmorShop:new(text)
ArmorShop.super.new(self, "armor shop")
Art.new(self, "armor_shop")
self.player:regainHealth()
self.costs = {
helmet = 50,
breastplate = 20,
shield = 40,
gauntlets = 40
}
if not Events.hasBeenInArmorShopBefore then
self:setText([[[username] вошла в оружейный магазин и увидела парня примерно её возраста, стоящего за прилавком. - "О, привет", - сказал парень. "Добро пожаловать в нашу оружейную лавку. Мы продаем доспехи, я полагаю. Могу я вам чем-нибудь помочь, например, купить что-нибудь?"]])
else
self:setText([["О, привет", - сказал парень. "Добро пожаловать в наш магазин. Мы продаем доспехи, я полагаю. Хочешь что- нибудь купить?"]])
end
if text then
self:setText([["Ох. Ну, видите ли, если у вас недостаточно золота, вы не можете его купить. Вот как это работает, я полагаю. Так что, извини."]])
end
self:setOptions({
{
text = [["Я бы хотела кое-что купить."]],
response = [["Хорошо, хорошо, просто отметьте товар, который вы хотите купить. Но, пожалуйста, по очереди."]]
},
{
text = [["Где твои родители?"]],
response = [["Ну, моя мама сбежала давным-давно, а мой папа на небесах. Немного перебрал со своим "особым зельем", как он его называл."]],
}
})
end
function ArmorShop:onEdit()
self.rContent = love.filesystem.read(self.file)
local items = {
"helmet",
"breastplate",
"shield",
"gauntlets"
}
local str = "%[([^%]%s]+)%]%s%-%s"
for i,v in ipairs(items) do
if self.rContent:lower():find(str .. v) then
if Events[v .. "Bought"] then
if v == "gauntlets" then
self:setText([["Перчатки, верно. Дело в том, что у тебя уже есть перчатки. Так что , на самом деле , нет смысла покупать еще одну пару перчаток, я полагаю."]])
else
self:setText([["Это ]] .. v .. [[, верно. Дело в том, что у тебя уже есть ]] .. v .. [[. Так что , на самом деле , нет смысла покупать еще ]] ..v .. [[, я полагаю."]])
end
else
self:setText([["Это ]] .. v.. [[, верно. Стоимость: ]] .. self.costs[v] .. [[ золотых. Так что, да, пожалуйста, дай мне ]] .. self.costs[v] .. [[золотых, я полагаю.]])
if self.player.gold < self.costs[v] then
self:setOptions({
{
text = [["Мне не хватает золота."]],
func = F(self, "new", [["Ох. Ну, видите ли, если у вас недостаточно золота, вы не можете его купить. Вот как это работает, я полагаю. Так что, извини."]])
}
})
else
self:setOptions({
{
text = [[Дать ]] .. self.costs[v] .. [[ золотых.]] ,
response = [["Спасибо. Вы приобрели ]] .. v .. [[. Веселитесь, я полагаю."]],
item = v,
gold = -self.costs[v],
event = v .. "Bought",
func = F(self, "new", [["Спасибо. Вы приобрели ]] .. v .. [[. Веселитесь, я полагаю."]])
},
{
text = [["Я передумала."]],
func = F(self, "new", [["А. Ну, это нормально."]])
}
})
end
end
end
end
ArmorShop.super.onEdit(self)
end
return ArmorShop
|
require("Menu/MainMenu/mainMenuStyle.lua")
require("Menu/towerImage.lua")
require("Game/campaignData.lua")
--this = SceneNode()
Shop = {}
function Shop.new(camera)
--mainAreaPanel = Panel()
local self = {}
--camera = Camera()
local form
local parentForm
local shopPanel = nil
local crystalCountLabel = nil
local data = CampaignData.new()
local language = Language()
local buttonList = {}
local textUpgList = {}
local predefinedUpdateButtonFunction = nil
local towers = { "Tower/MinigunTower.lua", "Tower/ArrowTower.lua", "Tower/SwarmTower.lua", "Tower/ElectricTower.lua", "Tower/BladeTower.lua", "Tower/missileTower.lua", "Tower/quakerTower.lua", "Tower/SupportTower.lua" }
local towerUpgInfo = { ["Tower/MinigunTower.lua"]={
{text="minigun tower range",[1]={["value1"]="5.75"},[2]={["value1"]="6.5"},[3]={["value1"]="7.25"}, permaUppgrade=true, iconIndex=59, name="range" },
{text="minigun tower overcharge",[1]={["value1"]="40"},[2]={["value1"]="80"},[3]={["value1"]="120"}, permaUppgrade=true, iconIndex=63, name="overCharge"},
{text="minigun tower firecrit",[1]={["value1"]="20"},[2]={["value1"]="40"},[3]={["value1"]="60"}, permaUppgrade=true, iconIndex=36, name="fireCrit"}
},
["Tower/ArrowTower.lua"]={
{text="Arrow tower range",[1]={["value1"]="10.5"},[2]={["value1"]="12"},[3]={["value1"]="13.5"}, permaUppgrade=true, iconIndex=59, name="range" },
{text="Arrow tower hardArrow",[1]={["value1"]="135",["value2"]="50"},[2]={["value1"]="240",["value2"]="60"},[3]={["value1"]="410",["value2"]="70"}, permaUppgrade=true, iconIndex=54, name="hardArrow"},
{text="Arrow tower mark of death",[1]={["value1"]="8"},[2]={["value1"]="16"},[3]={["value1"]="24"}, permaUppgrade=true, iconIndex=61, name="markOfDeath"}
},
["Tower/SwarmTower.lua"]={
{text="swarm tower range",[1]={["value1"]="7.25"},[2]={["value1"]="8"},[3]={["value1"]="8.75"}, permaUppgrade=true, iconIndex=59, name="range"},
{text="swarm tower damage",[1]={["value1"]="30"},[2]={["value1"]="60"},[3]={["value1"]="90"}, permaUppgrade=true, iconIndex=2, name="burnDamage"},
{text="swarm tower fire",[1]={["value1"]="22",["value2"]="15"},[2]={["value1"]="38",["value2"]="30"},[3]={["value1"]="52",["value2"]="45"}, permaUppgrade=true, iconIndex=38, name="fuel"}
},
["Tower/ElectricTower.lua"]={
{text="electric tower range",[1]={["value1"]="4.75"},[2]={["value1"]="5.5"},[3]={["value1"]="6.25"}, permaUppgrade=true, iconIndex=59 , name="range"},
{text="electric tower slow",[1]={["value1"]="15",["value2"]="0.75"},[2]={["value1"]="30",["value2"]="1.25"},[3]={["value1"]="45",["value2"]="1.75"}, permaUppgrade=true, iconIndex=55, name="ampedSlow"},
{text="electric tower energy pool",[1]={["value1"]="30"},[2]={["value1"]="60"},[3]={["value1"]="90"}, permaUppgrade=true, iconIndex=41, name="energyPool"},
{text="electric tower energy regen",[1]={["value1"]="15"},[2]={["value1"]="30"},[3]={["value1"]="45"}, permaUppgrade=true, iconIndex=38, name="energy"}
},
["Tower/BladeTower.lua"]={
{text="Arrow tower range",[1]={["value1"]="10.5"},[2]={["value1"]="12"},[3]={["value1"]="13.5"}, permaUppgrade=true, iconIndex=59, name="range" },
{text="blade tower attackSpeed",[1]={["value1"]="15"},[2]={["value1"]="30"},[3]={["value1"]="45"}, permaUppgrade=true, iconIndex=58, name="attackSpeed"},
{text="blade tower firecrit",[1]={["value1"]="20"},[2]={["value1"]="40"},[3]={["value1"]="60"}, permaUppgrade=true, iconIndex=36, name="masterBlade"},
{text="blade tower slow",[1]={["value1"]="20"},[2]={["value1"]="36"},[3]={["value1"]="49"}, permaUppgrade=true, iconIndex=55, name="electricBlade"},
{text="blade tower shield", [1]={}, permaUppgrade=true, iconIndex=40, name="shieldBreaker"}
},
["Tower/missileTower.lua"]={
{text="missile tower range",[1]={["value1"]="8"},[2]={["value1"]="9"},[3]={["value1"]="10"}, permaUppgrade=true, iconIndex=59, name="range" },
{text="missile tower explosion",[1]={["value1"]="8"},[2]={["value1"]="16"},[3]={["value1"]="24"}, permaUppgrade=true, iconIndex=39, name="Blaster"},
{text="missile tower fire",[1]={["value1"]="20",["value2"]="1"},[2]={["value1"]="22",["value2"]="1.75"},[3]={["value1"]="24",["value2"]="2.5"}, permaUppgrade=true, iconIndex=38, name="fuel"},
{text="missile tower shield destroyer", [1]={}, permaUppgrade=true, iconIndex=42, name="shieldSmasher"}
},
["Tower/quakerTower.lua"]={
{text="quak tower firecrit",[1]={["value1"]="40"},[2]={["value1"]="80"},[3]={["value1"]="120"}, permaUppgrade=false, iconIndex=36, name="fireCrit"},
{text="quak tower fire",[1]={["value1"]="20",["value2"]="1"},[2]={["value1"]="22",["value2"]="1.75"},[3]={["value1"]="24",["value2"]="2.5"}, permaUppgrade=false, iconIndex=38, name="fireStrike"},
{text="quak tower electric",[1]={["value1"]="30",["value2"]="15"},[2]={["value1"]="60",["value2"]="28"},[3]={["value1"]="90",["value2"]="39"}, permaUppgrade=false, iconIndex=50, name="electricStrike"},
{text="free sub upgrade", permaUppgrade=true, iconIndex=53, name="freeUpgrade"}
},
["Tower/SupportTower.lua"]={
{text="support tower range",[1]={["value1"]="10"},[2]={["value1"]="20"},[3]={["value1"]="30"}, permaUppgrade=true, iconIndex=59, name="range" },
{text="support tower damage",[1]={["value1"]="10"},[2]={["value1"]="20"},[3]={["value1"]="30"}, permaUppgrade=true, iconIndex=64, name="damage"},
{text="support tower weaken",[1]={["value1"]="10"},[2]={["value1"]="20"},[3]={["value1"]="30"}, permaUppgrade=true, iconIndex=66, name="weaken"},
{text="support tower gold",[1]={["value1"]="1"},[2]={["value1"]="2"},[3]={["value1"]="3"}, permaUppgrade=true, iconIndex=67, name="gold"}
}
}
local textPanels = {}
function self.destroy()
TowerImage.destroy()
end
function self.setVisible(visible)
form:setVisible(visible)
end
function self.getVisible()
return form:getVisible()
end
function addTitle()
shopPanel:setLayout(FallLayout(Alignment.TOP_CENTER, PanelSize(Vec2(0,0.01))))
--Top menu button panel
shopPanel:add(Label(PanelSize(Vec2(-1,0.04)), language:getText("shop"), Vec3(0.94), Alignment.MIDDLE_CENTER))
--Add BreakLine
local breakLinePanel = shopPanel:add(Panel(PanelSize(Vec2(-0.9,0.002))))
breakLinePanel:setBackground(Sprite(Vec3(0.45)))
end
-- local function updateShopButtonToolTip(towerName,upgName)
-- local button = textPanels[towerName][upgName]["0"].button
-- local displayLevel = math.max(1,math.min(data.getBoughtUpg(towerName,upgName,false)+1,data.getBuyablesTotal(upgName,false)))
-- local tab = towerUpgInfo[towerName][upgName]
-- local str = Text()
--
-- local permLeft = data.getBuyablesTotal(upgName,true)-data.getBoughtUpg(towerName,upgName,true)
-- local doneLevels = upgName=="freeUpgrade" and 1 or data.getBoughtUpg(towerName,upgName,false)
-- for i=1, doneLevels do
-- if permLeft==0 and i==1 then
-- str = str + "<font color=rgb(40,255,40)>"
-- str = str + "Bought" + ":</font>\n"
-- elseif (permLeft==1 and i==1) or (permLeft==0 and i==2) then
-- if doneLevels>=1 then
-- str = str + "<font color=rgb(40,255,40)>"
-- str = str + "Buyable" + ":</font>\n"--language:getText("unlocked")
-- end
-- end
-- str = str + ("Level "..i.." = ")
-- tab = towerUpgInfo[towerName][upgName][i]
-- if tab and tab["value1"] and tab["value2"] then
-- str = str + language:getTextWithValues(towerUpgInfo[towerName][upgName].text,tab["value1"],tab["value2"])
-- elseif tab and tab["value1"] then
-- str = str + language:getTextWithValues(towerUpgInfo[towerName][upgName].text,tab["value1"])
-- else
-- str = str + language:getTextWithValues(towerUpgInfo[towerName][upgName].text,"")
-- end
-- str = str + "\n"
-- end
-- if doneLevels~=displayLevel then
-- str = str + "<font color=rgb(255,255,40)>"
-- str = str + language:getText("locked") + ":</font>\n"
-- for i=displayLevel, data.getBuyablesTotal(upgName,upgName=="freeUpgrade") do
-- str = str + ("Level "..i.." = ")
-- tab = towerUpgInfo[towerName][upgName][i]
-- if tab and tab["value1"] and tab["value2"] then
-- str = str + language:getTextWithValues(towerUpgInfo[towerName][upgName].text,tab["value1"],tab["value2"])
-- elseif tab and tab["value1"] then
-- str = str + language:getTextWithValues(towerUpgInfo[towerName][upgName].text,tab["value1"])
-- else
-- str = str + language:getTextWithValues(towerUpgInfo[towerName][upgName].text,"")
-- end
-- str = str + "\n"
-- end
-- end
--
-- local level = data.getBoughtUpg(towerName,upgName,false)
-- if level<data.getBuyablesTotal(upgName,false) then
-- local cost = data.getBuyablesTotal(upgName,false)==1 and 3 or (level+1)
-- if data.getCrystal()>=cost then
-- str = str + "\n"
-- str = str + language:getTextWithValues("crystals to unlock(enough crystals)",tostring(cost),tostring(displayLevel))
-- else
-- str = str + "\n"
-- str = str + language:getTextWithValues("crystals to unlock(no crystals)",tostring(cost),tostring(displayLevel))
-- end
-- end
-- button:setToolTip(str)
-- end
local function isUpgradeBought(towerInfo, towerName, upgLevel)
return not ( ( upgLevel~=4 and towerInfo[upgLevel] and data.getBoughtUpg(towerName,towerInfo.name,false) < upgLevel) or
(upgLevel==4 and towerInfo.permaUppgrade == true and data.getBoughtUpg(towerName,towerInfo.name,true) == 0) )
end
local function getUpgradeCost(upgradeTab, towerName, upgLevel)
-- local cost = {1,2,3,12}
local hasAllreadeAnPermaUnlock = false
for i=1, #towerUpgInfo[towerName] do
hasAllreadeAnPermaUnlock = hasAllreadeAnPermaUnlock or isUpgradeBought(towerUpgInfo[towerName][i], towerName, 4)
end
return isUpgradeBought(upgradeTab, towerName, upgLevel) and 0 or ( (upgLevel == 1 and upgradeTab[2] == nil) and 3 or (upgLevel == 4 and (hasAllreadeAnPermaUnlock and 0 or 12) or upgLevel))
-- return isUpgradeBought(upgradeTab, towerName, upgLevel) and 0 or cost[upgLevel]
end
local function updateUpgradeText()
for i=1, #textUpgList do
local label = textUpgList[i].label
local towerName = textUpgList[i].towerName
local upgLevel = textUpgList[i].upgLevel
local countBought = 0
local countExist = 0
for n=1, #towerUpgInfo[towerName] do
countBought = countBought + ( ( (upgLevel== 4 and towerUpgInfo[towerName][n].permaUppgrade ) or towerUpgInfo[towerName][n][upgLevel]) and isUpgradeBought( towerUpgInfo[towerName][n], towerName, upgLevel) and 1 or 0 )
countExist = countExist + ( towerUpgInfo[towerName][n][upgLevel] and 1 or 0 )
end
label:setText( tostring(countBought) .. " / " .. ( upgLevel==4 and "1" or tostring(countExist)) )
end
end
local function getShopToolTip(towerName,upgNameIndex, upgradeLevel)
local tabUppgrade = towerUpgInfo[towerName][upgNameIndex]
local str = Text()
local upgradeAllreadyBought = (upgradeLevel == 4 and data.getBoughtUpg(towerName,tabUppgrade.name,true) == 1) or (data.getBoughtUpg(towerName,tabUppgrade.name,false) >= upgradeLevel )
local canBeBought = true
if upgradeLevel>1 then
canBeBought = (upgradeLevel == 4 and data.getBoughtUpg(towerName,tabUppgrade.name,false) >= 3) or (data.getBoughtUpg(towerName,tabUppgrade.name,false) >= (upgradeLevel-1) )
end
if upgradeLevel == 4 then
if upgradeAllreadyBought then
str = str + "<font color=rgb(40,255,40)>"
str = str + "Bought: (permanently unlocks level 1)</font>\n"
elseif canBeBought then
str = str + "<font color=rgb(40,255,40)>"
str = str + "Buyable: (permanently unlocks level 1)</font>\n"--language:getText("unlocked")
else
str = str + "<font color=rgb(255,40,40)>"
str = str + "Level 3 is not unlocked: (permanently unlocks level 1)</font>\n"--language:getText("unlocked")
end
else
if upgradeAllreadyBought then
str = str + "<font color=rgb(40,255,40)>"
str = str + "Bought:</font>\n"
elseif canBeBought then
str = str + "<font color=rgb(40,255,40)>"
str = str + "Buyable:</font>\n"--language:getText("unlocked")
else
str = str + "<font color=rgb(255,40,40)>"
str = str + "Level " + tostring(upgradeLevel-1) + " is not unlocked:</font>\n"--language:getText("unlocked")
end
end
local subUppgradeTab = tabUppgrade[upgradeLevel == 4 and 1 or upgradeLevel]
if subUppgradeTab and subUppgradeTab["value1"] and subUppgradeTab["value2"] then
str = str + language:getTextWithValues(tabUppgrade.text,subUppgradeTab["value1"],subUppgradeTab["value2"])
elseif subUppgradeTab and subUppgradeTab["value1"] then
-- str = str + Text("1 values found\n")
-- print("Value1: "..subUppgradeTab["value1"])
-- print(str:toString())
str = str + language:getTextWithValues(tabUppgrade.text,subUppgradeTab["value1"])
else
-- str = str + Text("0 values found\n")
-- print(str:toString())
str = str + language:getTextWithValues(tabUppgrade.text,"")
end
str = str + "\n"
local cost = getUpgradeCost(towerUpgInfo[towerName][upgNameIndex], towerName, upgradeLevel)--(upgradeLevel==4) and 12 or upgradeLevel
local canAffordToPay = data.getCrystal()>=cost
local textHeight = Core.getScreenResolution().y * 0.0125
local costLabel = Label(PanelSize(Vec2(-1), Vec2(3,1)), Text(tostring(cost)), canAffordToPay and Vec3(0,1,0) or Vec3(1,0,0), Alignment.TOP_RIGHT )
costLabel:setTextHeight(textHeight)
local costLabelSize = costLabel:getTextSizeInPixel()
costLabelSize = costLabelSize + Vec2(2,0)
local panel = Panel(PanelSize(Vec2(0.2)))
local label = Label(PanelSize(Vec2(-1)), str, Vec3(1), Alignment.TOP_LEFT)
label:setTextHeight(textHeight)
local textSize = label:getTextSizeInPixel()+ Vec2(7,1)
label:setPanelSize(PanelSize(textSize,PanelSizeType.Pixel))--Vec2(Core.getScreenResolution().y * 0.004)
-- label:setText(str)
-- label:setPanelSizeBasedOnTextSize()
panel:setPanelSize(PanelSize(textSize + ( upgradeAllreadyBought == false and Vec2(0,costLabelSize.y) or Vec2() ),PanelSizeType.Pixel))
panel:setLayout(FallLayout())
panel:add(label)
if upgradeAllreadyBought == false then
local costRow = panel:add(Panel(PanelSize(Vec2(-1))))
costLabel:setPanelSize(PanelSize(costLabelSize,PanelSizeType.Pixel))
costRow:add(costLabel)
costRow:add(Image(PanelSize(Vec2(-1,-0.9), Vec2(1)), "icon_table.tga")):setUvCoord(Vec2(0.5, 0.375),Vec2(0.625, 0.4375))
end
return panel
end
--
-- Purpose: to unlock/permently buy an upgrade for a tower
--
local function shopButtonClicked(theButton)
print("Tag: "..theButton:getTag():toString())
local towerName,upgName,upgLevel = string.match(theButton:getTag():toString(), "(.*);(.*);(.*)")
local permUnlocked = tonumber(upgLevel) == 4-- data.getBoughtUpg(towerName,upgName,false)==data.getBuyablesTotal(upgName,false)
--if add permenent upgrades, then remove existing permenent upgrades
if permUnlocked and data.getTotalBuyablesBoughtForTower(towerName,true)>=1 then
for k,v in pairs(towerUpgInfo[towerName]) do
data.clear(towerName,v.name,true)
end
end
--unlock upgrade
data.buy(towerName,upgName,permUnlocked)
--update labels
predefinedUpdateButtonFunction()
updateUpgradeText()
crystalCountLabel:setText(tostring(data.getCrystal()))
--Achievements
local comUnit = Core.getComUnit()
if data.getTotalBuyablesBought()>=1 then
comUnit:sendTo("SteamAchievement","Shop1","")
end
if data.getTotalBuyablesBought()>=44 then
comUnit:sendTo("SteamAchievement","Shop50","")
end
if data.getTotalBuyablesBought()==88 then
comUnit:sendTo("SteamAchievement","Shop100","")
end
print("data.getTotalBuyablesBought() == "..data.getTotalBuyablesBought())
end
local function closeClicked()
self.setVisible( false )
parentForm:setVisible( true )
end
function self.setParentForm(pForm)
parentForm = pForm
end
local function updateButtons()
for i=1, #buttonList do
local towerInfo = buttonList[i].towerInfo
local towerName = buttonList[i].towerName
local upgLevel = buttonList[i].upgLevel
local button = buttonList[i].button
local upgIndex = buttonList[i].upgIndex
local isUpgBought = isUpgradeBought(towerInfo, towerName, upgLevel)
local state = isUpgBought and 1 or 2
if buttonList[i].state ~= state then
buttonList[i].state = state
if upgLevel==4 then
--set edge color for permaunlocked uppgrades
local colorScale = isUpgBought and 1.0 or 0.35
button:setEdgeColor(Vec4(Vec3(1,0.8,0.07) * colorScale,1))
button:setEdgeHoverColor(Vec4(1,0.8,0.07,1))
button:setEdgeDownColor(Vec4(1,0.8,0.07,1))
else
--set edge color for all other upgrades
local colorScale = isUpgBought and 1.0 or 0.4
button:setEdgeColor(Vec4(MainMenuStyle.borderColor:toVec3() * colorScale,MainMenuStyle.borderColor.w))
button:setEdgeHoverColor(MainMenuStyle.borderColor)
button:setEdgeDownColor(MainMenuStyle.borderColor)
end
local boderColor = isUpgBought and Vec4() or Vec4(0,0,0,0.7)
-- if (upgLevel~=4 and towerInfo[upgLevel] and data.getBoughtUpg(towerName,towerInfo.name,false) < upgLevel) or (upgLevel==4 and towerInfo.permaUppgrade == true and data.getBoughtUpg(towerName,towerInfo.name,true) == 0) then
-- boderColor = Vec4(0,0,0,0.7)
-- end
button:setInnerColor(boderColor,boderColor,boderColor)
button:setInnerHoverColor( isUpgBought and Vec4(1,1,1,0.1) or Vec4())
button:setInnerDownColor( isUpgBought and Vec4(1,1,1,0.1) or Vec4(0,0,0,0.25))
end
button:setToolTip( getShopToolTip(towerName, upgIndex, upgLevel) )
if (not isUpgBought) and (upgLevel==1 or isUpgradeBought(towerInfo, towerName, upgLevel-1)) and data.getCrystal() >= getUpgradeCost(towerInfo, towerName, upgradeLevel) then
--not bought
button:setTag(towerName..";"..towerInfo.name..";"..upgLevel)
button:clearEvents()
button:addEventCallbackExecute(shopButtonClicked)
else
button:setTag("")
button:clearEvents()
end
end
end
local function init()
predefinedUpdateButtonFunction = updateButtons
local panelSpacing = 0.005
local panelSpacingVec2 = Vec2(panelSpacing, panelSpacing)
-- Basic upgrades that every one should have
if data.getBoughtUpg("Tower/SupportTower.lua","range",false)==0 then
data.buy("Tower/SupportTower.lua","range",false)
end
if data.getBoughtUpg("Tower/SupportTower.lua","damage",false)==0 then
data.buy("Tower/SupportTower.lua","damage",false)
end
--
form = Form(camera, PanelSize(Vec2(-1,-0.8), Vec2(1.2,1)), Alignment.MIDDLE_CENTER);
form:setLayout(FallLayout(Alignment.TOP_CENTER, PanelSize(panelSpacingVec2)));
form:setRenderLevel(9)
form:setVisible(false)
shopPanel = form:add(Panel(PanelSize(Vec2(-1))))
shopPanel:setBackground(Gradient(MainMenuStyle.backgroundTopColor, Vec4(0,0,0,0.5)))
--shopPanel:setBackground( Sprite(Vec4(1,1,1,0.5)) )--DEBUG coloring
shopPanel:setBorder(Border(BorderSize(Vec4(MainMenuStyle.borderSize)),MainMenuStyle.borderColor))
--Add the title
addTitle()
local shopArea = shopPanel:add(Panel(PanelSize(Vec2(-0.875,-0.9))))
shopArea:setLayout(GridLayout(4,2)):setPanelSpacing(PanelSize( Vec2(0.025), Vec2(1), PanelSizeType.WindowPercent ))
for i=1, 8 do
local towerPane1 = shopArea:add(Panel(PanelSize(Vec2(-1))))
towerPane1:setBackground(Gradient(MainMenuStyle.backgroundTopColor, MainMenuStyle.backgroundDownColor))
towerPane1:setBorder(Border( BorderSize( Vec4(MainMenuStyle.borderSize) ), MainMenuStyle.borderColor ) )
towerPane1:setPadding(BorderSize(Vec4(MainMenuStyle.borderSize * 3)))
towerPane1:setLayout(FlowLayout(PanelSize(Vec2(MainMenuStyle.borderSize * 3),Vec2(1))))
local towerImage = towerPane1:add(Image(PanelSize(Vec2(-1), Vec2(1)), "icon_tower_table.tga"))
towerImage:setBorder(Border( BorderSize( Vec4(MainMenuStyle.borderSize * 2) ), MainMenuStyle.borderColor ) )
local textureOffset = Vec2((i%3)/3.0, math.floor((8-i)/3.0) * 0.3333)
towerImage:setUvCoord( textureOffset, textureOffset + Vec2(0.3333))
local upgradeAreaPanel = towerPane1:add(Panel(PanelSize(Vec2(-1),Vec2(5,4))))
upgradeAreaPanel:setLayout(GridLayout(4,5, PanelSize(Vec2(MainMenuStyle.borderSize), Vec2(1))))
local upgIcons = Core.getTexture("Data/Images/icon_table.tga")
for y=1, 4 do
for x=1, 5 do
local towerinfo = towerUpgInfo[towers[i]]
if towerinfo[x] then
if (y==1 and towerinfo[x].permaUppgrade) or (y==4 and towerinfo[x].permaUppgrade == false and towerinfo[x][5-y] == nil) or towerinfo[x][5-y] then
local offset = Vec2( towerinfo[x].iconIndex%8*0.125, math.floor(towerinfo[x].iconIndex/8)*0.0625 )
local iconImage = upgradeAreaPanel:add(Image(PanelSize(Vec2(-1), Vec2(1)),upgIcons))
iconImage:setUvCoord(offset,offset+Vec2(0.125,0.0625))
iconImage:setImageScale(0.9)
local panel = nil
if y~=1 and towerinfo[x][5-y] then
--add level icon to the button
panel = iconImage:add(Image(PanelSize(Vec2(-1)),upgIcons))
local levelOffset = Vec2(0.125*(5+4-y),0.0625*5)
panel:setUvCoord(levelOffset,levelOffset+Vec2(0.125,0.0625))
panel:setImageScale(0.85)
else
panel = iconImage
end
local thisButtonTab = {}
buttonList[#buttonList + 1] = thisButtonTab
thisButtonTab.button = panel:add(Button(PanelSize(Vec2(-1), Vec2(1)),"",ButtonStyle.SQUARE))
thisButtonTab.towerInfo = towerinfo[x]
thisButtonTab.towerName = towers[i]
thisButtonTab.upgLevel = 5-y
thisButtonTab.upgIndex = x
else
upgradeAreaPanel:add(Panel(PanelSize(Vec2(-1))))
end
else
upgradeAreaPanel:add(Panel(PanelSize(Vec2(-1))))
end
end
end
local textAreaPanel = towerPane1:add(Panel(PanelSize(Vec2(-1))))
textAreaPanel:setLayout(GridLayout(4,1, PanelSize(Vec2(MainMenuStyle.borderSize), Vec2(1))))
for n=1, 4 do
local label = textAreaPanel:add(Label(PanelSize(Vec2(-1)), n == 4 and "0 / 1" or "0 / 4"))
label:setTextColor(MainMenuStyle.textColorHighLighted)
textUpgList[#textUpgList + 1] = {}
textUpgList[#textUpgList].label = label
textUpgList[#textUpgList].towerName = towers[i]
textUpgList[#textUpgList].upgLevel = 5-n
end
end
updateButtons()
updateUpgradeText()
--bottom info
local bottomPanel = shopPanel:add(Panel(PanelSize(Vec2(-1))))
bottomPanel:setLayout(FlowLayout(Alignment.MIDDLE_CENTER,PanelSize(Vec2(-1,-1))))
--bottomPanel:add(Panel(PanelSize(Vec2(0.025,-1))))--spacing
--crystal count
--bottomPanel:add(Panel(PanelSize(Vec2(0.025,-1))))--spacing
crystalCountLabel = bottomPanel:add(Label(PanelSize(Vec2(-1,0.035),Vec2(1.25,1)), tostring(data.getCrystal()), Vec3(0.94), Alignment.MIDDLE_LEFT))
local image = bottomPanel:add(Image(PanelSize(Vec2(0.035),Vec2(0.9,1)), Text("icon_table.tga")))
image:setUvCoord(Vec2(0.5, 0.375),Vec2(0.625, 0.4375))
--close
bottomPanel:add(Panel(PanelSize(Vec2(-1,0.03),Vec2(3,1))))--spacing
local button = bottomPanel:add(MainMenuStyle.createButton(Vec2(-1,0.03), Vec2(5,1), language:getText("back") ))
button:addEventCallbackExecute( closeClicked )
-- --Add a tower uppgrade area
-- addShopArea()
end
init()
--Update the map panel
function self.update()
form:update()
TowerImage.update()
end
return self
end
|
local K, C = unpack(KkthnxUI)
local Module = K:GetModule("ActionBar")
local _G = _G
local table_insert = _G.table.insert
local CreateFrame = _G.CreateFrame
local hooksecurefunc = _G.hooksecurefunc
local RegisterStateDriver = _G.RegisterStateDriver
local UIParent = _G.UIParent
local cfg = C.Bars.BarExtra
local padding = C.Bars.BarPadding
function Module:CreateExtrabar()
local buttonList = {}
local size = cfg.size
local frame = CreateFrame("Frame", "KKUI_ActionBarExtra", UIParent, "SecureHandlerStateTemplate")
frame:SetWidth(size + 2 * padding)
frame:SetHeight(size + 2 * padding)
frame.mover = K.Mover(frame, "Extrabar", "Extrabar", { "BOTTOM", UIParent, "BOTTOM", 270, 48 })
ExtraActionBarFrame:EnableMouse(false)
ExtraAbilityContainer:SetParent(frame)
ExtraAbilityContainer:ClearAllPoints()
ExtraAbilityContainer:SetPoint("CENTER", frame, 0, 2 * padding)
ExtraAbilityContainer.ignoreFramePositionManager = true
local button = ExtraActionButton1
table_insert(buttonList, button)
table_insert(Module.buttons, button)
button:SetSize(size, size)
frame.frameVisibility = "[extrabar] show; hide"
RegisterStateDriver(frame, "visibility", frame.frameVisibility)
if cfg.fader then
Module.CreateButtonFrameFader(frame, buttonList, cfg.fader)
end
local zoneFrame = CreateFrame("Frame", "KKUI_ActionBarZone", UIParent)
zoneFrame:SetWidth(size + 2 * padding)
zoneFrame:SetHeight(size + 2 * padding)
zoneFrame.mover = K.Mover(zoneFrame, "Zone Ability", "ZoneAbility", { "BOTTOM", UIParent, "BOTTOM", -270, 44 })
ZoneAbilityFrame:SetParent(zoneFrame)
ZoneAbilityFrame:ClearAllPoints()
ZoneAbilityFrame:SetPoint("CENTER", zoneFrame)
ZoneAbilityFrame.ignoreFramePositionManager = true
ZoneAbilityFrame.Style:SetAlpha(0)
hooksecurefunc(ZoneAbilityFrame, "UpdateDisplayedZoneAbilities", function(self)
for spellButton in self.SpellButtonContainer:EnumerateActive() do
if spellButton and not spellButton.styled then
spellButton.NormalTexture:SetAlpha(0)
spellButton:StyleButton()
spellButton.Icon:SetAllPoints()
spellButton.Icon:SetTexCoord(unpack(K.TexCoords))
local Border = CreateFrame("Frame", nil, spellButton)
Border:SetAllPoints(spellButton.Icon)
Border:SetFrameLevel(spellButton:GetFrameLevel())
Border:CreateBorder()
spellButton.styled = true
end
end
end)
hooksecurefunc(ZoneAbilityFrame, "SetParent", function(self, parent)
if parent == ExtraAbilityContainer then
self:SetParent(zoneFrame)
end
end)
end
|
TidyPlatesWidgetData = {
["UnitLastSeen"] = {
["肯瑞托召唤师"] = 3883,
["暴风城卫兵"] = 3883,
["拍卖师希尔顿"] = 3883,
["基霸爱世人"] = 3883,
["约翰·伯恩赛德"] = 3883,
["旅店老板奥里森"] = 3883,
["切尔西租借仔"] = 3883,
["死亡执行者"] = 3883,
["天地会你麻痹"] = 3883,
["军官普米洛"] = 3883,
["尼莫"] = 3883,
["牛顿·伯恩赛德"] = 3883,
["迪安诺"] = 3883,
["网管一包蓝娇"] = 3883,
["馨豆豆"] = 3883,
["火印末日守卫"] = 3883,
["Radioedit"] = 3883,
["肯瑞托卫士"] = 3883,
["天地会天生"] = 3883,
},
["UnitDescriptions"] = {
},
["UnitGuild"] = {
["天地会天生"] = "妄想学生会",
["基霸爱世人"] = "尘埃",
["约翰·伯恩赛德"] = "银行职员",
["旅店老板奥里森"] = "旅店老板",
["切尔西租借仔"] = "大家庭",
["馨豆豆"] = "零度冰窖",
["天地会你麻痹"] = "妄想学生会",
["死亡执行者"] = "十里蓝山",
["尼莫"] = "旅行修补匠",
["牛顿·伯恩赛德"] = "银行职员",
},
["CachedAuraDurations"] = {
},
["UnitClass"] = {
["天地会天生"] = "DEATHKNIGHT",
["迪安诺"] = "DEMONHUNTER",
["网管一包蓝娇"] = "MONK",
["死亡执行者"] = "ROGUE",
["约翰·伯恩赛德"] = "NPC",
["旅店老板奥里森"] = "NPC",
["切尔西租借仔"] = "HUNTER",
["馨豆豆"] = "MAGE",
["天地会你麻痹"] = "WARRIOR",
["基霸爱世人"] = "WARRIOR",
["Radioedit"] = "MAGE",
["尼莫"] = "NPC",
["牛顿·伯恩赛德"] = "NPC",
},
}
|
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("player.lua")
-- include: executes a Lua Script
-- AddCSLuaFile: sends the file to clients and adds it to their cache
-- GM -> Gamemode (which is a class inside the game)
function GM:PlayerConnect( name, ip ) --shared function
print( "Player: " .. name .. "has joined the game.\n" )
end
function GM:PlayerInitialSpawn( ply )
print( ply:GetName().." has spawned.\n" )
ply:SetGamemodeTeam(1)
end
function GM:PlayerAuthed( ply, steamid, uniqueid )
print( ply:Name() .. " has been authenticated as " .. steamid .. ".\n" )
end
-- called when a player spawns in any case
function GM:PlayerSetModel( ply )
ply:SetModel("models/player/group01/male_07.mdl")
|
solution "00_MySolution"
configurations {"Debug", "Release"}
configuration "Release"
flags { "Optimize", "StaticRuntime", "NoRTTI", "NoExceptions"}
configuration "Debug"
flags { "Symbols", "StaticRuntime" , "NoRTTI", "NoExceptions"}
platforms {"x32", "x64"}
configuration "x32"
libdirs {"$(ATISTREAMSDKROOT)/lib/x86"}
configuration "x64"
libdirs {"$(ATISTREAMSDKROOT)/lib/x86_64"}
targetsuffix "_64"
configuration {"x64", "debug"}
targetsuffix "_x64_debug"
configuration {"x64", "release"}
targetsuffix "_x64"
configuration {"x32", "debug"}
targetsuffix "_debug"
language "C++"
location "build"
targetdir "bin"
include "../src/base_level"
include "../src/low_level"
include "../src/util"
include "../sample/api_physics_effects/0_console"
include "../sample/api_physics_effects/1_simple"
include "../sample/api_physics_effects/2_stable"
include "../sample/api_physics_effects/3_sleep"
include "../sample/api_physics_effects/4_motion_type"
include "../sample/api_physics_effects/5_raycast"
include "../sample/api_physics_effects/6_joint"
|
-- Include NutScript content.
resource.AddWorkshop("207739713")
-- Include features from the Sandbox gamemode.
DeriveGamemode("sandbox")
-- Define a global shared table to store NutScript information.
nut = nut or {util = {}, meta = {}}
-- Send the following files to players.
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("core/sh_util.lua")
AddCSLuaFile("shared.lua")
-- Include utility functions, data storage functions, and then shared.lua
include("core/sh_util.lua")
include("core/sv_data.lua")
include("shared.lua")
-- Connect to the database using SQLite, mysqloo, or tmysql4.
nut.db.connect(function()
-- Create the SQL tables if they do not exist.
nut.db.loadTables()
nut.log.loadTables()
MsgC(Color(0, 255, 0), "NutScript has connected to the database.\n")
end)
-- Resources that are required for players to download are here.
resource.AddFile("materials/nutscript/gui/vignette.png")
resource.AddFile("resource/fonts/fontello.ttf")
resource.AddFile("resource/fonts/witcher.ttf")
resource.AddFile("whistle.wav")
resource.AddFile("talk.wav")
concommand.Add("nut_setowner", function(client, command, arguments)
if (!IsValid(client)) then
MsgC(Color(255, 0, 0), "** 'nut_setowner' has been deprecated in NutScript 1.1\n")
MsgC(Color(255, 0, 0), "** Instead, please install an admin mod and use that instead.\n")
end
end)
resource.AddWorkshop("109643223") -- 3d2d
resource.AddWorkshop("104604943") -- bodygroup tool
resource.AddWorkshop("104479467") -- door tool
resource.AddWorkshop("104634865") -- no colide world
resource.AddWorkshop("207739713") -- ns content
resource.AddWorkshop("104691717") -- pac3
resource.AddWorkshop("309796347") -- box vis
resource.AddWorkshop("104479831") -- stacker
resource.AddWorkshop("130414613") -- persistent
resource.AddWorkshop("493751477") -- light entities
resource.AddWorkshop("236035765") -- letho
resource.AddWorkshop("242284049") -- triss
resource.AddWorkshop("237641104") -- zoltan
resource.AddWorkshop("672126440") -- plants
resource.AddWorkshop("236113181") -- error hider
resource.AddWorkshop("522764555") -- animals
resource.AddWorkshop("111626188") -- dark messiah npc
resource.AddWorkshop("131759821") -- vjbase
resource.AddWorkshop("156318356") -- lotr models
resource.AddWorkshop("148521442") -- leanna and xana
resource.AddWorkshop("675824914") -- hl2melee
resource.AddWorkshop("104604709") -- animation tool
resource.AddWorkshop("235587037") -- werefolf
resource.AddWorkshop("104603291") -- extended spawnmenu
resource.AddWorkshop("220336312") -- permaprops
resource.AddWorkshop("325822607") -- crussaria 8
resource.AddWorkshop("325791215") -- crussaria 2
resource.AddWorkshop("325795125") -- crussaria 3
resource.AddWorkshop("325814596") -- crussaria 5
resource.AddWorkshop("325800231") -- crussaria 4
resource.AddWorkshop("325817446") -- crussaria 6
resource.AddWorkshop("325818901") -- crussaria 7
resource.AddWorkshop("325787997") -- crussaria 1
resource.AddWorkshop("308933874") -- morr swep fix
resource.AddWorkshop("546724344") -- medieval fantasy weapons
resource.AddWorkshop("701755651") -- wrp
resource.AddWorkshop("701879639") -- wrp2
resource.AddWorkshop("701888930") -- wrp4
resource.AddWorkshop("701895147") -- wrp5
resource.AddWorkshop("701901204") -- wrp6
resource.AddWorkshop("701908560") -- wrp7
resource.AddWorkshop("701884403") -- wrp3
resource.AddWorkshop("761028434") -- wrp8
resource.AddWorkshop("112806637") -- legs
resource.AddWorkshop("501043374") -- brigandine
resource.AddWorkshop("564627364") -- plague doktor
resource.AddWorkshop("458351576") -- lepotitsa
resource.AddWorkshop("308932848") -- morbroadswords
resource.AddWorkshop("308933454") -- morrlongswords
resource.AddWorkshop("308933573") -- morrclub
resource.AddWorkshop("308933743") -- morrshort
resource.AddWorkshop("308933844") -- morrstaff
resource.AddWorkshop("119472883") -- morraxes
resource.AddWorkshop("119229978") -- morrbows
resource.AddWorkshop("118802819") -- morrdaggers
resource.AddWorkshop("708225419") -- ladder
resource.AddWorkshop("185609021") -- atmos
resource.AddWorkshop("104607712") -- extended properties
resource.AddWorkshop("744017535") -- nombat witcher
resource.AddWorkshop("270169947") -- nombat
resource.AddWorkshop("419153126") -- harry potter wands
resource.AddWorkshop("276347850") -- medieval props
resource.AddWorkshop("483169700") -- skyrim snpc
resource.AddWorkshop("124824365") -- nordic dungeons props
resource.AddWorkshop("512787089") -- bloodstone npc
resource.AddWorkshop("308933663") -- morrshields
resource.AddWorkshop("741271527") -- chivlary footsteps
resource.AddWorkshop("754047205") -- rp_medieval_v2
resource.AddWorkshop("754079586") -- rp_medieval_v2 content 2
resource.AddWorkshop("754059901") -- rp_medieval_v2 content 1
resource.AddWorkshop("756218185") -- Witcher 2 Soldiers
resource.AddWorkshop("116049816") -- GOT knights
resource.AddWorkshop("505432866") -- Yenefer
resource.AddWorkshop("505431747") -- Triss
resource.AddWorkshop("501440567") -- Ciri
|
codeFolder = '../code/'
require('torch')
require(codeFolder..'rbm')
require(codeFolder..'ProFi')
require(codeFolder..'dataset-from-tensor.lua')
require 'paths'
torch.manualSeed(101)
torch.setdefaulttensortype('torch.FloatTensor')
torch.setnumthreads(2)
--train_mnist,val_mnist,test_mnist = mnist.loadMnist(50)
-- {
-- 1 : FloatTensor - size: 1x32x32
-- 2 : FloatTensor - size: 10
-- }
opts = {}
opts.n_hidden = 500
opts.numepochs = 500
opts.learningrate = 0.05
opts.alpha = 0
opts.beta = 0
opts.dropconnect = 0
n_classes = 4;
n_hidden = 7;
n_visible = 3;
-- create test data and test weights
x = torch.Tensor({0.4170,0.7203, 0.0001}):resize(1,1,n_visible)
x2d = x:view(1,3)
y = torch.Tensor({0,0,1, 0}):resize(1,n_classes)
U = torch.Tensor({{ 0.0538, -0.0113, -0.0688, -0.0074},
{ 0.0564, 0.0654, 0.0357, 0.0584},
{-0.0593, 0.0047, 0.0698, -0.0295},
{-0.0658, 0.0274, 0.0355, -0.0303},
{-0.0472, -0.0264, -0.0314, -0.0529},
{ 0.0540, 0.0266, 0.0413, -0.0687},
{-0.0574, 0.0478, -0.0567, 0.0255}})
W = torch.Tensor({{-0.0282 , -0.0115 , 0.0084},
{-0.0505 , 0.0265 , -0.0514},
{-0.0582 , -0.0422 , -0.0431},
{-0.0448 , 0.0540 , 0.0430},
{-0.0221 , -0.0675 , 0.0669},
{-0.0147 , 0.0244 , -0.0267},
{0.0055 , -0.0118 , 0.0275}})
b = torch.zeros(n_visible,1)
c = torch.zeros(n_hidden,1)
d = torch.zeros(n_classes,1)
vW = torch.Tensor(W:size()):zero()
vU = torch.Tensor(U:size()):zero()
vb = torch.Tensor(b:size()):zero()
vc = torch.Tensor(c:size()):zero()
vd = torch.Tensor(d:size()):zero()
rbm = {W = W:clone(), U = U:clone(), d = d:clone(), b = b:clone(), c = c:clone(),
vW =vW,vU = vU,vb = vb, vc = vc, vd = vd,};
rbm.dW = torch.Tensor(rbm.W:size()):zero()
rbm.dU = torch.Tensor(rbm.U:size()):zero()
rbm.db = torch.Tensor(rbm.b:size()):zero()
rbm.dc = torch.Tensor(rbm.c:size()):zero()
rbm.dd = torch.Tensor(rbm.d:size()):zero()
rbm.rand = function(m,n) return torch.Tensor(m,n):fill(1):mul(0.5)end -- for testing
rbm.n_classes = n_classes
rbm.n_visible = n_visible
rbm.n_samples = 1
rbm.n_input = 1
rbm.numepochs = 1
rbm.learningrate = 0.1
rbm.alpha = 1
rbm.beta = 0
rbm.momentum = 0
rbm.dropout = opts.dropout or 0
rbm.dropouttype = "bernoulli"
rbm.dropconnect = opts.dropconnect or 0
rbm.L1 = opts.L1 or 0
rbm.L2 = opts.L2 or 0
rbm.sparsity = opts.sparsity or 0
rbm.err_recon_train = torch.Tensor(1):fill(-1)
rbm.err_train = torch.Tensor(1):fill(-1)
rbm.err_val = torch.Tensor(1):fill(-1)
rbm.temp_file = "blabla"
rbm.patience = 15
rbm.one_by_classes = torch.ones(1,rbm.U:size(2))
rbm.hidden_by_one = torch.ones(rbm.W:size(1),1)
rbm.traintype = 'CD' -- CD
rbm.npcdchains = 1
rbm.cdn = 1
rbm.n_hidden = n_hidden
rbm.currentepoch = 1
rbm.bottomrbm = 1
rbm.toprbm = true
rbm.samplex = false
rbm.lrdecay = 0 -- no decay
rbm.up = rbmup
rbm.downx = rbmdownx
rbm.downy = rbmdowny
rbm.errorfunction = function(conf) return 1-conf:accuracy() end
rbm.precalctcwx = 1
rbm.generativestatistics = grads.generativestatistics
rbm.generativegrads = grads.generativegrads
rbm.discriminativegrads = grads.discriminativegrads
rbm.pygivenx = grads.pygivenx
rbm.pygivenxdropout = grads.pygivenxdropout
rbm.batchsize = 1
rbm.visxsampler = bernoullisampler
rbm.hidsampler = bernoullisampler
rbm.conf = ConfusionMatrix(4)
---------------------------------------------------------
-- TRUE VALUES rbm-util
---------------------------------------------------------
h0_true = torch.Tensor({ 0.4778,0.5084,0.5038,0.5139,0.4777,0.5132,0.4843}):resize(1,n_hidden)
h0_rnd_true = torch.Tensor({0,1,1,1,0,1,0}):resize(1,n_hidden)
vkx_true = torch.Tensor({ 0.4580,0.5156,0.4805}):resize(1,n_visible)
vkx_rnd_true = torch.Tensor({0,1,0}):resize(1,n_visible)
vky_true = torch.Tensor({ 0.2319,0.2664,0.2824,0.2194}):resize(1,n_classes)
vky_rnd_true = torch.Tensor({ 0,0,1,0}):resize(1,n_classes)
p_y_given_x_true = torch.Tensor({0.2423,0.2672,0.2532,0.2373}):resize(1,n_classes)
---------------------------------------------------------
-- GENERATIVE TRUE WEIGHTS
---------------------------------------------------------
dw_gen_true = torch.Tensor({
{0.1992, -0.1358, 0.0001},
{0.2120, -0.1493, 0.0001},
{0.2101, -0.1440, 0.0001},
{0.2143, -0.1522, 0.0001},
{0.1992, -0.1312, 0.0001},
{0.2140, -0.1468, 0.0001},
{0.2020, -0.1340, 0.0001}
})
du_gen_true = torch.Tensor({
{0, 0, -0.0021, 0},
{0, 0, -0.0071, 0},
{0, 0, -0.0031, 0},
{0, 0, -0.0084, 0},
{0, 0, 0.0024, 0},
{0, 0, -0.0032, 0},
{0, 0, 0.0014, 0}
})
db_gen_true = torch.Tensor({0.4170,-0.2797,0.0001}):resize(n_visible,1)
dc_gen_true = torch.Tensor({-0.0021,-0.0071,-0.0031,-0.0084,0.0024,-0.0032,0.0014}):resize(n_hidden,1)
dd_gen_true = torch.Tensor({0,0,0,0}):resize(n_classes,1)
---------------------------------------------------------
--- DISCRIMINATIVE TRUE WEIGHTS
---------------------------------------------------------
dw_dis_true = torch.Tensor({
{-0.0062, -0.0107, -0.0000},
{-0.0019, -0.0033, -0.0000},
{ 0.0075, 0.0130, 0.0000},
{ 0.0044, 0.0076, 0.0000},
{ 0.0008, 0.0014, 0.0000},
{ 0.0028, 0.0049, 0.0000},
{-0.0049, -0.0085, -0.0000}})
du_dis_true = torch.Tensor({
{-0.1232, -0.1315, 0.3568, -0.1170},
{-0.1245, -0.1378, 0.3797, -0.1220},
{-0.1143, -0.1303, 0.3762, -0.1136},
{-0.1184, -0.1368, 0.3838, -0.1180},
{-0.1148, -0.1280, 0.3567, -0.1121},
{-0.1251, -0.1361, 0.3832, -0.1152},
{-0.1173, -0.1364, 0.3616, -0.1198}})
dc_dis_true = torch.Tensor({-0.0149,-0.0046,0.0181,0.0106,0.0019,0.0067,-0.0118}):resize(n_hidden,1)
dd_dis_true = torch.Tensor({ -0.2423,-0.2672,0.7468,-0.2373}):resize(n_classes,1)
---------------------------------------------------------
--- CHECK FOR SIDE EFFECTS
---------------------------------------------------------
-- if they have side effects on x,y or rbm then generative tests will fails
_h0 = rbmup(rbm,x2d,y) -- UP
_h0_rnd = bernoullisampler(_h0,rbm.rand)
_vkx = rbmdownx(rbm,_h0_rnd) -- DOWNX
_vkx_rnd = bernoullisampler(_vkx,rbm.rand)
_vky = rbmdowny(rbm,_h0_rnd)
_vky_rnd = samplevec(_vky,rbm.rand)
_p_y_given_x = grads.pygivenx(rbm,x2d)
rbm.learningrate = 0 -- to avoid updating weights
--rbm = rbmtrain(rbm,x,y)
---------------------------------------------------------
--- CALCULATE VALUES FOR TESTING
---------------------------------------------------------
tcwx = torch.mm( x2d,rbm.W:t() ):add( rbm.c:t() )
print(x2d,y,tcwx)
print(rbm)
stat_gen= grads.generativestatistics(rbm,x2d,y,tcwx)
grads_gen = grads.generativegrads(rbm,x2d,y,stat_gen)
grads_dis, p_y_given_x_dis = grads.discriminativegrads(rbm,x2d,y,tcwx)
-- -- calculte value
-- h0 = rbmup(rbm,x,y) -- UP
-- h0_rnd = sampler(h0,rbm.rand)
-- vkx = rbmdownx(rbm,h0_rnd) -- DOWNX
-- vkx_rnd = sampler(vkx,rbm.rand)
-- vky = rbmdowny(rbm,h0_rnd)
-- vky_rnd = samplevec(vky,rbm.rand)
p_y_given_x =grads.pygivenx(rbm,x2d)
-- ---------------------------------------------------------
-- --- TEST RBM-UTIL FUNCTIONS
-- ---------------------------------------------------------
assert(checkequality(stat_gen.h0, h0_true,-4),'Check h0 failed')
--assert(checkequality(stat_gen.h0_rnd, h0_rnd_true),'Check h0_rnd failed')
--assert(checkequality(stat_gen.vkx, vkx_true),'Check vkx failed')
assert(checkequality(stat_gen.vkx_unsampled, vkx_true),'Check vkx_unsampled failed')
assert(checkequality(stat_gen.vkx, vkx_rnd_true),'Check vkx_rnd failed')
assert(checkequality(stat_gen.vky, vky_rnd_true),'Check vky_rnd failed')
assert(checkequality(p_y_given_x, p_y_given_x_true),'Check p_y_given_x failed')
assert(checkequality(p_y_given_x, p_y_given_x_dis,-3),'Check p_y_given_x_dis failed')
-- print "TEST of RBM-UTIL gradients : PASSED"
-- ---------------------------------------------------------
-- --- TEST GENERATIVE WEIGHTS
-- ---------------------------------------------------------
assert(checkequality(grads_gen.dW, dw_gen_true,-3),'Check dw failed')
assert(checkequality(grads_gen.dU, du_gen_true),'Check du failed')
assert(checkequality(grads_gen.db, db_gen_true,-3),'Check db failed')
assert(checkequality(grads_gen.dc, dc_gen_true),'Check dc failed')
assert(checkequality(grads_gen.dd, dd_gen_true),'Check dd failed')
print "TEST of GENERATIVE gradients : PASSED"
-- ---------------------------------------------------------
-- --- TEST DISCRIMINATIVE WEIGHTS
-- ---------------------------------------------------------
assert(checkequality(grads_dis.dW, dw_dis_true,-3),'Check dw failed')
assert(checkequality(grads_dis.dU, du_dis_true),'Check du failed')
assert(checkequality(grads_dis.dc, dc_dis_true,-3),'Check dc failed')
assert(checkequality(grads_dis.dd, dd_dis_true),'Check dd failed')
print "TEST of DISCRIMINATIVE gradients : PASSED"
-- ---------------------------------------------------------
-- --- TEST RBMTRAIN
-- ---------------------------------------------------------
trainData = datatensor.createDataset(x,y,{'A','B','C','D',},{1,3})
rbm.beta = 0
rbm.learningrate = 0.1
rbm.dropout = 0
rbm.dropconnect = 0
rbm.boost = 'none'
rbm.progress = 0
--train ={}
--train.data = x
--train.labels = torch.Tensor({3}):float()
orgrbm = {}
orgrbm.W = rbm.W:clone()
orgrbm.U = rbm.U:clone()
orgrbm.b = rbm.b:clone()
orgrbm.c = rbm.c:clone()
orgrbm.d = rbm.d:clone()
rbm = rbmtrain(rbm,trainData)
-- check generative
rbm.alpha = 1
assert(checkequality(rbm.W, torch.add(W ,torch.mul(dw_gen_true,rbm.learningrate)) ,-3),'Check rbm.W failed')
assert(checkequality(rbm.U, torch.add(U ,torch.mul(du_gen_true,rbm.learningrate)) ,-3),'Check rbm.U failed')
assert(checkequality(rbm.b, torch.add(b ,torch.mul(db_gen_true,rbm.learningrate)) ,-3),'Check rbm.b failed')
assert(checkequality(rbm.c, torch.add(c ,torch.mul(dc_gen_true,rbm.learningrate)) ,-3),'Check rbm.c failed')
assert(checkequality(rbm.d, torch.add(d ,torch.mul(dd_gen_true,rbm.learningrate)) ,-3),'Check rbm.d failed')
print('Generative Training : OK')
-- check discriminative
-- rbm.W = orgrbm.W:clone()
-- rbm.U = orgrbm.U:clone()
-- rbm.b = orgrbm.b:clone()
-- rbm.c = orgrbm.c:clone()
-- rbm.d = orgrbm.d:clone()
-- assert(checkequality(rbm.W, orgrbm.W ,-3),'Check rbm.W failed')
-- assert(checkequality(rbm.U, orgrbm.U ,-3),'Check rbm.U failed')
-- assert(checkequality(rbm.b, orgrbm.b ,-3),'Check rbm.b failed')
-- assert(checkequality(rbm.c, orgrbm.c ,-3),'Check rbm.c failed')
-- assert(checkequality(rbm.d, orgrbm.d ,-3),'Check rbm.d failed')
rbm.W = W:clone()
rbm.U = U:clone()
rbm.b = b:clone()
rbm.c = c:clone()
rbm.d = d:clone()
rbm.vW:fill(0)
rbm.vU:fill(0)
rbm.vb:fill(0)
rbm.vc:fill(0)
rbm.vd:fill(0)
rbm.dW:fill(0)
rbm.dU:fill(0)
rbm.db:fill(0)
rbm.dc:fill(0)
rbm.dd:fill(0)
rbm.alpha = 0
rbm = rbmtrain(rbm,trainData)
rbm.learningrate = 0.1
assert(checkequality(rbm.W, torch.add(W ,torch.mul(dw_dis_true,rbm.learningrate)) ,-3),'Check rbm.W failed')
assert(checkequality(rbm.U, torch.add(U ,torch.mul(du_dis_true,rbm.learningrate)) ,-3),'Check rbm.U failed')
--assert(checkequality(rbm.b, torch.add(b ,torch.mul(db_gen_true,rbm.learningrate)) ,-3),'Check rbm.b failed')
assert(checkequality(rbm.c, torch.add(c ,torch.mul(dc_dis_true,rbm.learningrate)) ,-3),'Check rbm.c failed')
assert(checkequality(rbm.d, torch.add(d ,torch.mul(dd_dis_true,rbm.learningrate)) ,-3),'Check rbm.d failed')
print('Discriminative Training : OK')
-- print "TEST of rbmtrain
-- check hybrid
rbm.W = W:clone()
rbm.U = U:clone()
rbm.b = b:clone()
rbm.c = c:clone()
rbm.d = d:clone()
rbm.vW:fill(0)
rbm.vU:fill(0)
rbm.vb:fill(0)
rbm.vc:fill(0)
rbm.vd:fill(0)
rbm.dW:fill(0)
rbm.dU:fill(0)
rbm.db:fill(0)
rbm.dc:fill(0)
rbm.dd:fill(0)
rbm.alpha = 0.1
rbm = rbmtrain(rbm,trainData)
assert(checkequality(rbm.W, torch.add(W ,torch.mul(dw_dis_true,rbm.learningrate*(1-rbm.alpha))):add(torch.mul(dw_gen_true,rbm.learningrate*rbm.alpha)) ,-3),'Check rbm.W failed')
assert(checkequality(rbm.U, torch.add(U ,torch.mul(du_dis_true,rbm.learningrate*(1-rbm.alpha))):add(torch.mul(du_gen_true,rbm.learningrate*rbm.alpha)) ,-3),'Check rbm.U failed')
assert(checkequality(rbm.b, torch.add(b ,torch.mul(db_gen_true,rbm.learningrate*(rbm.alpha))) ,-3),'Check rbm.b failed')
assert(checkequality(rbm.c, torch.add(c ,torch.mul(dc_dis_true,rbm.learningrate*(1-rbm.alpha))):add(torch.mul(dc_gen_true,rbm.learningrate*rbm.alpha)) ,-3),'Check rbm.c failed')
assert(checkequality(rbm.d, torch.add(d ,torch.mul(dd_dis_true,rbm.learningrate*(1-rbm.alpha))):add(torch.mul(dd_gen_true,rbm.learningrate*rbm.alpha)) ,-3),'Check rbm.d failed')
print('Hybrid Training : OK')
-- : PASSED"
-- print(stat_gen['vky'],vky_rnd_true)
-- error()
-- opts_mnist = {}
-- opts_mnist.n_hidden = 10
-- rbm_mnist = rbmsetup(opts_mnist,train_mnist)
-- rbm_mnist.alpha = 0
-- rbm_mnist.beta = 0
-- rbm_mnist.learningrate = 0.1
-- rbm_mnist.dropout = 0.5
-- rbm_mnist.dropconnect = 0
-- rbm_mnist = rbmtrain(rbm_mnist,train_mnist,val_mnist)
-- -- extend training with new objective
-- rbm_mnist.dropout = 0.1
-- rbm_mnist.numepochs = 10
-- rbm_mnist.learningrate =0.5
-- rbm_mnist.alpha = 0.5
-- rbm_mnist = rbmtrain(rbm_mnist,train_mnist,val_mnist)
-- uppass = rbmuppass(rbm_mnist,train_mnist)
-- uppass = rbmuppass(rbm_mnist,test_mnist)
-- rbm_mnist.toprbm = false
-- rbm_mnist.alpha = 1
-- rbm_mnist.currentepoch = 1
-- rbm_mnist.U = nil
-- rbm_mnist.dU = nil
-- rbm_mnist.d = nil
-- rbm_mnist.dd = nil
-- rbm_mnist.vd = nil
-- rbm_mnist.vU = nil
-- rbm_mnist = rbmtrain(rbm_mnist,train_mnist)
-- uppass = rbmuppass(rbm_mnist,train_mnist)
-- uppass = rbmuppass(rbm_mnist,test_mnist)
-- -- MNIST TEST
-- --assert(checkequality(torch.add(U,du_true):mul(rbm.learningrate), rbm.U,-3),'Check rbm.W failed')
-- --assert(checkequality(torch.add(b,db_true):mul(rbm.learningrate), rbm.b,-3),'Check rbm.b failed')
-- --assert(checkequality(torch.add(c,dc_true):mul(rbm.learningrate), rbm.c,-3),'Check rbm.c failed')
-- --assert(checkequality(torch.add(d,dd_true):mul(rbm.learningrate), rbm.d,-3),'Check rbm.d failed')
-- --assert(checkequality(torch.add(U,du_true), rbm.U,-3),'Check rbm.U failed')
-- --assert(checkequality(torch.add(b,db_true), rbm.b,-3),'Check rbm.b failed')
-- --assert(checkequality(torch.add(c,dc_true), rbm.c,-3),'Check rbm.c failed')
-- --assert(checkequality(torch.add(d,dd_true), rbm.d,-3),'Check rbm.d failed')
-- --assert(checkequality(du, du_true),'Check du failed')
-- --assert(checkequality(db, db_true),'Check db failed')
-- --assert(checkequality(dc, dc_true),'Check dc failed')
-- --assert(checkequality(dd, dd_true),'Check dd failed')
-- -- INit rbm
-- --[[torch.setdefaulttensortype('torch.FloatTensor')
-- x = torch.zeros(10,784)
-- y = torch.zeros(10,10)
-- ]]
-- --[[print(rbm.W)
-- print(rbm.U)
-- print(rbm.b)
-- print(rbm.c)
-- print(rbm.d)--]]
-- -- tcwx = torch.mm( x,rbm.W:t() ):add( rbm.c:t() )
-- --tcwx = -0.4333 0.1500 0.1500 0.1133 0.1500 0.1500 -0.1167
-- ---print(tcwx)
|
AddEventHandler('gameEventTriggered', function(eventName, args)
if eventName == 'CEventNetworkEntityDamage' then
local victim = args[1]
local culprit = args[2]
local isDead = args[4] == 1
if isDead then
local origCoords = GetEntityCoords(victim)
local pickup = CreatePickupRotate(`PICKUP_MONEY_VARIABLE`, origCoords.x, origCoords.y, origCoords.z - 0.7, 0.0, 0.0, 0.0, 512, 0, false, 0)
local netId = PedToNet(victim)
local undoStuff = { false }
CreateThread(function()
local self = PlayerPedId()
while not undoStuff[1] do
Wait(50)
if #(GetEntityCoords(self) - origCoords) < 2.5 and HasPickupBeenCollected(pickup) then
TriggerServerEvent('money:tryPickup', netId)
RemovePickup(pickup)
break
end
end
undoStuff[1] = true
end)
SetTimeout(15000, function()
if not undoStuff[1] then
RemovePickup(pickup)
undoStuff[1] = true
end
end)
TriggerServerEvent('money:allowPickupNear', netId)
end
end
end)
|
local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/Kiwi-i/wallys-ui-fork/master/lib.lua", true))()
local Window = library:CreateWindow('Those Who Remain')
local Window2 = library:CreateWindow('Otherssss')
Window:Section('Ammo') -- Ammo Section
local ammoon = Window:Button("AutoAmmo On", function()
_G.AutoAmmo = true --or fasle
while _G.AutoAmmo do
wait() --time between running
for i, v in pairs (game:GetService("Workspace").World.Objectives:GetChildren()) do
if v:IsA("Model") and v.Name == "Ammo" and game.workspace.World.Objectives.Ammo:FindFirstChild("Progress") then repeat
while true do
game.workspace.Rileko.HumanoidRootPart.CFrame = game.workspace.World.Objectives.Ammo.Progress.CFrame * CFrame.new(0, -8, 0)
wait()
end
until game.workspace.World.Objectives.Ammo:FindFirstChild("Progress") ~= nil
end
end
end
end)
local ammooff = Window:Button("AutoAmmo Off", function()
_G.AutoAmmo = false --or fasle
end)
Window:Section('Medical') -- Medical Section
local medicon = Window:Button("AutoMedic On", function()
_G.automedic = true --or fasle
while _G.automedic do
wait() --time between running
for i, v in pairs (game:GetService("Workspace").World.Objectives:GetChildren()) do
if v:IsA("Model") and v.Name == "Medical" and game.workspace.World.Objectives.Medical:FindFirstChild("Progress") then repeat
while true do
game.workspace.Rileko.HumanoidRootPart.CFrame = game.workspace.World.Objectives.Medical.Progress.CFrame * CFrame.new(0, -8, 0)
wait()
end
until game.workspace.World.Objectives.Medical:FindFirstChild("Progress") ~= nil
end
end
end
end)
local medicoff = Window:Button("AutoMedic Off", function()
_G.automedic = false --or fasle
end)
Window:Section('Radio') -- Radio Section
local radioon = Window:Button("AutoRadio On", function()
_G.autoradio = true --or fasle
while _G.autoradio do
wait() --time between running
for i, v in pairs (game:GetService("Workspace").World.Objectives:GetChildren()) do
if v:IsA("Model") and v.Name == "Radio" and game.workspace.World.Objectives.Radio:FindFirstChild("Progress") then repeat
while true do
game.workspace.Rileko.HumanoidRootPart.CFrame = game.workspace.World.Objectives.Radio.Progress.CFrame * CFrame.new(0, -8, 0)
wait()
end
until game.workspace.World.Objectives.Radio:FindFirstChild("Progress") ~= nil
end
end
end
end)
local radiooff = Window:Button("AutoRadio Off", function()
_G.autoradio = false --or fasle
end)
Window:Section('Escort') -- Escort Section
local escorton = Window:Button("AutoEscort On", function()
_G.escort = true --or fasle
while _G.escort do
wait() --time between running
for i,v in pairs (game:GetService("Workspace").Entities.Objectives:GetDescendants()) do
if v:IsA("Model") and v.Name == "EscortChar" and game.workspace.Entities.Objectives.EscortChar:FindFirstChild("HumanoidRootPart") then repeat
while true do
game.workspace.Rileko.HumanoidRootPart.CFrame = game.workspace.Entities.Objectives.EscortChar.HumanoidRootPart.CFrame * CFrame.new(0,-8,0)
wait()
end
until game.workspace.Entities.Objectives.EscortChar:FindFirstChild("HumanoidRootPart") == nil
end
end
end
end)
local escortoff = Window:Button("AutoEscort Off", function()
_G.escort = false --or fasle
end)
local dtpon = Window2:Button("TPB On", function()
_G.dtp = true --or fasle
while _G.dtp do
wait(5) --time between running
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(293,-1438,292)
end
end)
local dtpoff = Window2:Button("TPB Off", function()
_G.dtp = false --or fasle
end)
local airwalkon = Window2:Button("Airwalk On", function()
_G.airwalk = true --or fasle
while _G.airwalk do
wait() --time between running
local crtl = false
mouse = game.Players.LocalPlayer:GetMouse()
local air = Instance.new("Part", workspace)
air.Size = Vector3.new(7, 2, 3)
air.CFrame = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame + Vector3.new(0, -4, 0)
air.Transparency = 1
air.Anchored = true
air.Name = "Airwalk"
mouse.KeyDown:Connect(function(key)
if key == "2" then
air.Size = Vector3.new(4, -0.5, 3)
end
end)
mouse.KeyUp:Connect(function(key)
if key == "2" then
air.Size = Vector3.new(7, 2, 3)
end
end)
for i = 1, math.huge do
air.CFrame = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame + Vector3.new(0, -4, 0)
wait(0.01)
end
end
end)
local airwalkoff = Window2:Button("Airwalk Off", function()
_G.airwalk = false --or fasle
end)
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf/protobuf"
local TEAMOPERATE_PB = require("TeamOperate_pb")
local TEAMEXTRAINFO_PB = require("TeamExtraInfo_pb")
local TEAMMEMBERTYPE_PB = require("TeamMemberType_pb")
module('TeamOPArg_pb')
TEAMOPARG = protobuf.Descriptor();
local TEAMOPARG_REQUEST_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_TEAMID_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_PASSWORD_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_EXPID_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_ROLEID_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_EXTRAINFO_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_PARAM_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_MEMBERTYPE_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_ACCOUNT_FIELD = protobuf.FieldDescriptor();
local TEAMOPARG_ISPLATFRIEND_FIELD = protobuf.FieldDescriptor();
TEAMOPARG_REQUEST_FIELD.name = "request"
TEAMOPARG_REQUEST_FIELD.full_name = ".KKSG.TeamOPArg.request"
TEAMOPARG_REQUEST_FIELD.number = 1
TEAMOPARG_REQUEST_FIELD.index = 0
TEAMOPARG_REQUEST_FIELD.label = 1
TEAMOPARG_REQUEST_FIELD.has_default_value = false
TEAMOPARG_REQUEST_FIELD.default_value = nil
TEAMOPARG_REQUEST_FIELD.enum_type = TEAMOPERATE_PB.TEAMOPERATE
TEAMOPARG_REQUEST_FIELD.type = 14
TEAMOPARG_REQUEST_FIELD.cpp_type = 8
TEAMOPARG_TEAMID_FIELD.name = "teamID"
TEAMOPARG_TEAMID_FIELD.full_name = ".KKSG.TeamOPArg.teamID"
TEAMOPARG_TEAMID_FIELD.number = 2
TEAMOPARG_TEAMID_FIELD.index = 1
TEAMOPARG_TEAMID_FIELD.label = 1
TEAMOPARG_TEAMID_FIELD.has_default_value = false
TEAMOPARG_TEAMID_FIELD.default_value = 0
TEAMOPARG_TEAMID_FIELD.type = 5
TEAMOPARG_TEAMID_FIELD.cpp_type = 1
TEAMOPARG_PASSWORD_FIELD.name = "password"
TEAMOPARG_PASSWORD_FIELD.full_name = ".KKSG.TeamOPArg.password"
TEAMOPARG_PASSWORD_FIELD.number = 3
TEAMOPARG_PASSWORD_FIELD.index = 2
TEAMOPARG_PASSWORD_FIELD.label = 1
TEAMOPARG_PASSWORD_FIELD.has_default_value = false
TEAMOPARG_PASSWORD_FIELD.default_value = ""
TEAMOPARG_PASSWORD_FIELD.type = 9
TEAMOPARG_PASSWORD_FIELD.cpp_type = 9
TEAMOPARG_EXPID_FIELD.name = "expID"
TEAMOPARG_EXPID_FIELD.full_name = ".KKSG.TeamOPArg.expID"
TEAMOPARG_EXPID_FIELD.number = 4
TEAMOPARG_EXPID_FIELD.index = 3
TEAMOPARG_EXPID_FIELD.label = 1
TEAMOPARG_EXPID_FIELD.has_default_value = false
TEAMOPARG_EXPID_FIELD.default_value = 0
TEAMOPARG_EXPID_FIELD.type = 13
TEAMOPARG_EXPID_FIELD.cpp_type = 3
TEAMOPARG_ROLEID_FIELD.name = "roleid"
TEAMOPARG_ROLEID_FIELD.full_name = ".KKSG.TeamOPArg.roleid"
TEAMOPARG_ROLEID_FIELD.number = 5
TEAMOPARG_ROLEID_FIELD.index = 4
TEAMOPARG_ROLEID_FIELD.label = 1
TEAMOPARG_ROLEID_FIELD.has_default_value = false
TEAMOPARG_ROLEID_FIELD.default_value = 0
TEAMOPARG_ROLEID_FIELD.type = 4
TEAMOPARG_ROLEID_FIELD.cpp_type = 4
TEAMOPARG_EXTRAINFO_FIELD.name = "extrainfo"
TEAMOPARG_EXTRAINFO_FIELD.full_name = ".KKSG.TeamOPArg.extrainfo"
TEAMOPARG_EXTRAINFO_FIELD.number = 6
TEAMOPARG_EXTRAINFO_FIELD.index = 5
TEAMOPARG_EXTRAINFO_FIELD.label = 1
TEAMOPARG_EXTRAINFO_FIELD.has_default_value = false
TEAMOPARG_EXTRAINFO_FIELD.default_value = nil
TEAMOPARG_EXTRAINFO_FIELD.message_type = TEAMEXTRAINFO_PB.TEAMEXTRAINFO
TEAMOPARG_EXTRAINFO_FIELD.type = 11
TEAMOPARG_EXTRAINFO_FIELD.cpp_type = 10
TEAMOPARG_PARAM_FIELD.name = "param"
TEAMOPARG_PARAM_FIELD.full_name = ".KKSG.TeamOPArg.param"
TEAMOPARG_PARAM_FIELD.number = 7
TEAMOPARG_PARAM_FIELD.index = 6
TEAMOPARG_PARAM_FIELD.label = 1
TEAMOPARG_PARAM_FIELD.has_default_value = false
TEAMOPARG_PARAM_FIELD.default_value = 0
TEAMOPARG_PARAM_FIELD.type = 4
TEAMOPARG_PARAM_FIELD.cpp_type = 4
TEAMOPARG_MEMBERTYPE_FIELD.name = "membertype"
TEAMOPARG_MEMBERTYPE_FIELD.full_name = ".KKSG.TeamOPArg.membertype"
TEAMOPARG_MEMBERTYPE_FIELD.number = 8
TEAMOPARG_MEMBERTYPE_FIELD.index = 7
TEAMOPARG_MEMBERTYPE_FIELD.label = 1
TEAMOPARG_MEMBERTYPE_FIELD.has_default_value = false
TEAMOPARG_MEMBERTYPE_FIELD.default_value = nil
TEAMOPARG_MEMBERTYPE_FIELD.enum_type = TEAMMEMBERTYPE_PB.TEAMMEMBERTYPE
TEAMOPARG_MEMBERTYPE_FIELD.type = 14
TEAMOPARG_MEMBERTYPE_FIELD.cpp_type = 8
TEAMOPARG_ACCOUNT_FIELD.name = "account"
TEAMOPARG_ACCOUNT_FIELD.full_name = ".KKSG.TeamOPArg.account"
TEAMOPARG_ACCOUNT_FIELD.number = 9
TEAMOPARG_ACCOUNT_FIELD.index = 8
TEAMOPARG_ACCOUNT_FIELD.label = 1
TEAMOPARG_ACCOUNT_FIELD.has_default_value = false
TEAMOPARG_ACCOUNT_FIELD.default_value = ""
TEAMOPARG_ACCOUNT_FIELD.type = 9
TEAMOPARG_ACCOUNT_FIELD.cpp_type = 9
TEAMOPARG_ISPLATFRIEND_FIELD.name = "isplatfriend"
TEAMOPARG_ISPLATFRIEND_FIELD.full_name = ".KKSG.TeamOPArg.isplatfriend"
TEAMOPARG_ISPLATFRIEND_FIELD.number = 10
TEAMOPARG_ISPLATFRIEND_FIELD.index = 9
TEAMOPARG_ISPLATFRIEND_FIELD.label = 1
TEAMOPARG_ISPLATFRIEND_FIELD.has_default_value = false
TEAMOPARG_ISPLATFRIEND_FIELD.default_value = false
TEAMOPARG_ISPLATFRIEND_FIELD.type = 8
TEAMOPARG_ISPLATFRIEND_FIELD.cpp_type = 7
TEAMOPARG.name = "TeamOPArg"
TEAMOPARG.full_name = ".KKSG.TeamOPArg"
TEAMOPARG.nested_types = {}
TEAMOPARG.enum_types = {}
TEAMOPARG.fields = {TEAMOPARG_REQUEST_FIELD, TEAMOPARG_TEAMID_FIELD, TEAMOPARG_PASSWORD_FIELD, TEAMOPARG_EXPID_FIELD, TEAMOPARG_ROLEID_FIELD, TEAMOPARG_EXTRAINFO_FIELD, TEAMOPARG_PARAM_FIELD, TEAMOPARG_MEMBERTYPE_FIELD, TEAMOPARG_ACCOUNT_FIELD, TEAMOPARG_ISPLATFRIEND_FIELD}
TEAMOPARG.is_extendable = false
TEAMOPARG.extensions = {}
TeamOPArg = protobuf.Message(TEAMOPARG)
|
require "src/core/arrays"
local rule = {}
rule.__index = rule
function rule.new(antecedent, consequent)
assert(#(antecedent) > 0)
local self = setmetatable({}, rule)
self.antecedent = antecedent
self.consequent = consequent
return self
end
function rule.infer(self, basis)
local first = first(self.antecedent)
local acc = first.set:get(first.var.attached)
for i = 1, #(self.antecedent) do
local a = self.antecedent[i].set:get(self.antecedent[i].var.attached)
acc = basis.fuzzy_and(acc, a)
end
local answer = self.consequent:copy()
local alpha = acc
local f = self.consequent.set.func
answer.set:set_func(function(x)
return basis.fuzzy_impl(alpha, f(x))
end)
return answer
end
return rule
|
function ConvertTitle(title)
local MARK='mark mdl-color--accent mdl-color-text--accent-contrast'
local title=title:gsub('%[(新)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(終)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(再)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(交)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(映)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(手)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(声)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(多)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(字)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(二)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(S)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(B)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(SS)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(無)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(C)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(S1)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(S2)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(S3)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(MV)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(双)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(デ)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(D)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(N)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(W)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(P)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(HV)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(SD)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(天)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(解)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(料)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(前)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(後)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(初)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(生)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(販)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(吹)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(PPV)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(演)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(移)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(他)%]', '<span class="'..MARK..'">%1</span>')
:gsub('%[(収)%]', '<span class="'..MARK..'">%1</span>')
:gsub(' ', ' ')
return title
end
function ConvertSearch(v, service_name)
local title=mg.url_encode(v.shortInfo.event_name:gsub('<.->', ''):gsub('【.-】', ''):gsub('%[.-%]', ''):gsub('(.-版)', '') or '')
local startTime=os.time(v.startTime)
local endTime=v.durationSecond and startTime+v.durationSecond or startTime
local text_char=v.shortInfo.text_char:gsub('%%', '%%%%')
local search='<a class="mdl-button mdl-js-button mdl-button--icon" href="search.html?andkey='..title..'"><i class="material-icons">search</i></a>'
..'<a class="mdl-button mdl-js-button mdl-button--icon" href="https://www.google.co.jp/search?q='..title..'" target="_blank"><img class="material-icons" src="'..(ct.path or '')..'img/google.png" alt="Google検索"></a>'
..'<a class="mdl-button mdl-js-button mdl-button--icon" href="https://www.google.co.jp/search?q='..title..'&btnI=Im+Feeling+Lucky" target="_blank"><i class="material-icons">sentiment_satisfied</i></a>'
..'<a class="mdl-button mdl-js-button mdl-button--icon mdl-cell--hide-phone mdl-cell--hide-tablet" href="https://www.google.com/calendar/render?action=TEMPLATE&text='..title..'&location='..mg.url_encode(service_name)..'&dates='..os.date('%Y%m%dT%H%M%S', startTime)..'/'..os.date('%Y%m%dT%H%M%S', endTime)..'&details='..mg.url_encode(details:gsub('%%text_char%%', text_char):gsub('%%br%%', '\n') or '')..'&authuser='..authuser..'" target="_blank"><i class="material-icons">event</i></a>'
return search
end
|
yatm.mesecon_hubs = {
NetworkMeta = assert(yatm_mesecon_hubs.NetworkMeta),
wireless_network = assert(yatm_mesecon_hubs.wireless_network),
}
|
-- A filesystem wrapper
local ok, lfs = pcall(require, "lfs")
if (lfs) then
return require("undulate.fs.lfs")
end
local ok, love = pcall(require, "love")
if (love) then
return require("undulate.fs.love")
end
if (jit) then
return require("undulate.fs.luajit")
end
error("Undulate requires either LFS or LuaJIT!")
|
data:extend({
{
type = "recipe",
name = "sb-wood-bricks-charcoal",
category = "smelting",
enabled = false,
energy_required = 3.5,
ingredients = {{"wood-bricks", 1}},
result = "wood-charcoal",
result_count = 5,
subgroup = "petrochem-coal"
},
{
type = "recipe",
name = "solder-alginic",
category = "electronics",
energy_required = 2,
enabled = false,
ingredients = {
{"solder-alloy", 4},
{"solid-alginic-acid", 1}
},
result = "solder",
result_count = 8
},
{
type = "recipe",
name = "thermal-extractor-water",
category = "thermal-extractor",
subgroup = "water-treatment",
order = "h[thermal-extractor-water]",
energy_required = 5,
enabled = false,
ingredients = {
{type = "fluid", name = "steam", amount = 100},
{type = "item", name = "lithium-chloride", amount = 2}
},
results = {
{type = "fluid", name = "thermal-water", amount = 100}
}
},
{
type = "recipe",
name = "sb-water-mineralized-crystallization",
category = "crystallizing",
subgroup = "slag-processing-1",
order = "z[slag-processing]",
enabled = true,
energy_required = 2,
ingredients = {
{type = "fluid", name = "water-mineralized", amount = 200}
},
results = {
{type = "item", name = "angels-ore1", amount = 2, probability = 0.55},
{type = "item", name = "angels-ore3", amount = 1, probability = 0.7},
},
icons = {
{ icon = data.raw.item['angels-ore3'].icon, scale = 0.5, shift = { 8, 8 } },
{ icon = data.raw.item['angels-ore1'].icon, scale = 0.5, shift = { -8, -8 }}
},
icon_size = 32
},
{
type = "recipe",
name = "sb-cellulose-foraging",
localised_name = {"recipe-name.sb-cellulose-foraging"},
category = "crafting-handonly",
subgroup = "bio-processing-green",
enabled = true,
energy_required = 2,
ingredients = {},
results = {
{type = "item", name = "cellulose-fiber", amount = 1}
},
order = "ab[sb-cellulose-foraging]"
},
{
-- Balance assuming blue algae is about equal to green algae in MJ value.
-- 1 blue cellulose = 2MJ (1 green cellulose = 1MJ but converting to wood pellets doubles it.
-- Wrong, but I'll stick with it to avoid increasing the cost of all petrochem recipes)
-- Now for multi phase oil MJ value:
-- 100 naphtha = 50MJ
-- 50 fuel oil = 50MJ
-- basic oil refining is 100 crude oil -> 30 fuel oil + 50 naphtha (and other stuff i'll ignore)
-- 100 crude oil = 30MJ (fuel oil) + 25MJ (naphtha) = 55MJ
-- 100 multiphase oil = 55*70/100 = 38.5 MJ.
-- Let's round that up to 40MJ or 20 blue cellulose fiber.
-- This is being generous, haven't counted natural gas liquids and base mineral oil.
-- 100 sulfuric waste water -> 40 blue algae
-- 40 blue algae -> 20 blue cellulose
-- 20 blue cellulose -> 100 multi phase oil + 60 sulfuric waste water
-- 100 multi phase oil -> 10 sulfuric waste water
-- 70% of sulfuric waste water is recycled
-- Almost forgot +20 raw gas
-- 20 raw gas -> 4 acid gas
-- 4 acid gas -> 2.4 hydrogen sulfide
-- 2.4 hydrogen sulfide -> 0.12 sulfur
-- 0.12 sulfur -> 7.2 sulfur dioxide
-- 7.2 sulfur dioxide -> 4.8 sulfuric acid
-- 4.8 sulfuric acid -> 16 slag slurry
-- 16 slag slurry -> 12.8 sulfuric waste water (coal filtering)
-- So closer to 80% sulfur return
type = "recipe",
name = "sb-blue-algae-liquefaction",
localised_name = {"recipe-name.sb-blue-algae-liquefaction",
{"fluid-name.liquid-multi-phase-oil"}, {"fluid-name.water-yellow-waste"}, {"fluid-name.gas-carbon-dioxide"}},
icon = "__angelspetrochem__/graphics/icons/liquid-multi-phase-oil.png",
icon_size = 32,
category = "oil-processing",
enabled = false,
energy_required = 5,
ingredients = {
{type = "item", name = "blue-cellulose-fiber", amount = 20},
{type = "fluid", name = "steam", amount = 100}
},
results = {
{type = "fluid", name = "liquid-multi-phase-oil", amount = 100},
{type = "fluid", name = "water-yellow-waste", amount = 60},
{type = "fluid", name = "gas-carbon-dioxide", amount = 20}
},
subgroup = "bio-processing-blue",
order = "d[blue-algae-liquefaction]"
}
})
table.insert(data.raw.technology['angels-oil-processing'].prerequisites, 'bio-processing-blue')
table.insert(data.raw.technology['angels-oil-processing'].effects,
{type = "unlock-recipe", recipe = "sb-blue-algae-liquefaction"})
|
local memreader = require('memreader')
local sleep = require('sleep')
local D2Reader = require('d2info.d2reader')
local Output = require('d2info.output')
local Config = require('d2info.config')
local GameState = require('d2info.gamestate')
local windcon = require('windcon')
memreader.debugprivilege(true)
local reader, output, config = D2Reader.new(), Output.new(), Config.new()
local state = GameState.new(reader, config, output)
local UPDATE_PERIOD = config:get("UPDATE_PERIOD")
windcon.clear()
windcon.showcursor(false)
while true do
state:tick(UPDATE_PERIOD)
sleep(UPDATE_PERIOD)
end
|
local Object=require("logic/src/Object");
local Player=Object:New("[Class] Player");
local ServiceType=require("ServiceType");
local config=require("GameConfig");
local Mysql=require("database/mysql_center");
local PlayerState=require("logic/const/PlayerState");
local Util=require("logic/Util");
Mysql.Connect();
function Player:New(tcpSession,uname,utag)
local instance = Object.New(self,uname);
--socketinfo
instance.__tcpSession=tcpSession;
instance.__utag=utag;
instance.__udpIp=nil;
instance.__udpPort=0;
--userinfo
instance.Uname=uname;
instance.State=PlayerState.OnLine;
--roomInfo
instance.IsSubmit=false;
instance.IsReady=false;
instance.Room=nil;
instance.SeatId=-1;
instance.HeroId=-1;
instance.ExpectedRoomType=-1;
--game
instance.SyncFrameId=0;
return instance;
end
function Player:SetUdpAddr(udpIp,udpPort)
self.__udpIp=udpIp;
self.__udpPort=udpPort;
end
function Player:IsInRoom()
return self.Room~=nil;
end
function Player:OnAddToRoom(room)
self.Room=room;
self.State=PlayerState.Matching;
if config.enable_match_log then
Debug.Log("Player["..self.Uname.."] enter Room["..self.Room.RoomId.."]");
end
end
function Player:OnRemoveFromRoom(room)
if config.enable_match_log then
Debug.Log("Player["..self.Uname.."] leave Room["..room.RoomId.."]");
end
self.Room=nil;
self.SeatId=-1;
self.HeroId=-1;
self.SyncFrameId=0;
self.IsReady=false;
self.IsSubmit=false;
self.State=PlayerState.OnLine;
end
function Player:UdpSend(cmdType,body)
--玩家已经断线
if not self.__tcpSession then
return;
end
if not self.__udpIp or self.__udpPort==0 then
return;
end
Session.UdpSendPackage(self.__udpIp,self.__udpPort,{
ServiceType.Logic,cmdType,0,body
});
end
function Player:TcpSend(cmdType,body)
-- Debug.Log("[Player.TcpSend] User "..self.Uname.." cmdType "..cmdType);
Session.SendPackage(
self.__tcpSession,
{
ServiceType.Logic,
cmdType,
self.__utag,
body,
}
);
end
--handler:matcher
function Player:GetMatchInfo(seatId,handler)
self.SeatId=seatId;
Mysql.GetMatcherInfoByUname(self.Uname,function(err,matchInfo)
if err then
Debug.LogError("[Player:GetMatchInfo MysqlError]"..err);
handler(nil);
return;
end
if not matchInfo then
Debug.LogError("[Player:GetMatchInfo MysqlError] matchInfo is null");
handler(nil);
return;
end
matchInfo.seatId=self.SeatId;
handler(matchInfo);
end);
end
--handler:defaultHeroId
function Player:GetDefaultHeroId(handler)
Mysql.GetDefaultHeroIdByUname(self.Uname,function(err,defaultHeroId)
if err then
Debug.LogError("[Player:GetDefaultHeroId MysqlError]"..err);
handler(nil);
return;
end
if not defaultHeroId then
Debug.LogError("[Player:GetDefaultHeroId MysqlError] defaultHeroId is null");
handler(nil);
return;
end
handler(defaultHeroId);
end);
end
function Player:OnLine()
self.State=PlayerState.OnLine;
if self.Room then
self.Room:OnPlayerOnLine(self);
end
end
function Player:OnOffLine()
self.State=PlayerState.OffLine;
if self:IsInRoom() then
self.Room:OnPlayerOffLine(self);
end
end
--获取用户仓库信息
--handler(err,{ulevel,uexp,urank,urankExp,ucoin,udiamond})
function Player:GetUserPackageInfo(handler)
Mysql.GetPackageInfoByUname(self.Uname,handler);
end
--更新用户仓库信息
--handler(err,packageInfo)
function Player:UpdatePackageInfo(exp,rankExp,coin,diamond,handler)
self:GetUserPackageInfo(function(err,packageInfo)
if err then
if handler then
handler(err,nil);
end
return;
end
packageInfo.ulevel,packageInfo.uexp=Util.GetUlevelAndUexp(packageInfo.ulevel,packageInfo.uexp,exp);
packageInfo.urank,packageInfo.urankExp=Util.GetUrankAndUrankExp(packageInfo.urank,packageInfo.urankExp,rankExp);
packageInfo.ucoin=packageInfo.ucoin+coin;
packageInfo.udiamond=packageInfo.udiamond+diamond;
Mysql.UpdatePackageInfoByUname(self.Uname,packageInfo,function(internalError)
if internalError then
handler(internalError,nil);
end
handler(nil,packageInfo);
end);
end);
end
return Player;
|
---
-- @module mqtt_library
-- ~~~~~~~~~~~~~~~~
-- Version: 0.4-SNAPSHOT
-- -------------------------------------------------------------------------- --
-- Copyright (c) 2011-2012 Geekscape Pty. Ltd.
-- All rights reserved. This program and the accompanying materials
-- are made available under the terms of the Eclipse Public License v1.0
-- which accompanies this distribution, and is available at
-- http://www.eclipse.org/legal/epl-v10.html
--
-- Contributors:
-- Andy Gelme - Initial API and implementation
-- Kevin KIN-FOO - Authentication and rockspec
-- -------------------------------------------------------------------------- --
--
-- Documentation
-- ~~~~~~~~~~~~~
-- Paho MQTT Lua website
-- http://eclipse.org/paho/
--
-- References
-- ~~~~~~~~~~
-- MQTT Community
-- http://mqtt.org
-- MQTT protocol specification v3.1.1
-- http://mqtt.org/documentation
-- http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.pdf
--
-- Notes
-- ~~~~~
-- - Always assumes MQTT connection "clean session" enabled.
-- - Only supports QOS level 0.
-- - Publish message doesn't support "message identifier".
-- - Subscribe acknowledgement messages don't check granted QOS level.
-- - Outstanding subscribe acknowledgement messages aren't escalated.
--
-- ToDo
-- ~~~~
-- * Consider when payload needs to be an array of bytes (not characters).
-- * Maintain both "last_activity_out" and "last_activity_in".
-- * - http://mqtt.org/wiki/doku.php/keepalive_for_the_client
-- * Update "last_activity_in" when messages are received.
-- * When a PINGREQ is sent, must check for a PINGRESP, within KEEP_ALIVE_TIME..
-- * Otherwise, fail the connection.
-- * When connecting, wait for CONNACK, until KEEP_ALIVE_TIME, before failing.
-- This fixed by: https://github.com/iotrac/mqtt-lua/commit/3c8776bb8b67e23fff8d3fd2908145ccb8afdfa2
-- After CONNECT msg, wait for CONNACK until CONNACK_WAIT_TIMEOUT. KEEP_ALIVE_TIME is too long.
--
-- * Review all public APIs for asynchronous callback behaviour.
-- * Implement parse PUBACK message. -- This should be: Implement QoS level 1.
-- * Handle failed subscriptions, i.e no subscription acknowledgement received.
-- MQTT.client:handler(): Message length mismatch
-- - On socket error, optionally try reconnection to MQTT server.
-- - Consider use of assert() and pcall() ?
-- - Only expose public API functions, don't expose internal API functions.
-- - Refactor "if self.connected()" to "self.checkConnected(error_message)".
-- - Maintain and publish messaging statistics.
-- - Memory heap/stack monitoring.
-- - When debugging, why isn't mosquitto sending back CONNACK error code ?
-- Fixed by: https://github.com/iotrac/mqtt-lua/issues/3
--
-- - Implement asynchronous state machine, rather than single-thread waiting.
-- - Consider using Copas http://keplerproject.github.com/copas/manual.html
-- ------------------------------------------------------------------------- --
local function callback_fallback(topic,payload)
print("callback_fallback: topic and payload",topic,payload)
return
end
function isPsp() return(Socket ~= nil) end
local socket = require("socket")
-- require("io")
-- require("ltn12")
-- require("ssl")
local version = "0.4-SNAPSHOT"
local MQTT = {}
--local pathOfThisFile = ...
--local folderOfThisFile = (...):match("(.-)[^%.]+$")
-- Thanks to http://stackoverflow.com/questions/9145432/load-lua-files-by-relative-path
---
-- @field [parent = #mqtt_library] utility#utility Utility
--
MQTT.Utility = require("lib.mqtt_utility")
---
-- @field [parent = #mqtt_library] #number VERSION
--
MQTT.VERSION = 0x04
---
-- @field [parent = #mqtt_library] #boolean ERROR_TERMINATE
--
MQTT.ERROR_TERMINATE = false -- Message handler errors terminate process ?
---
-- @field [parent = #mqtt_library] #string DEFAULT_BROKER_HOSTNAME
--
MQTT.DEFAULT_BROKER_HOSTNAME = "test.mosquitto.org"
---
-- An MQTT client
-- @type client
---
-- @field [parent = #mqtt_library] #client client
--
MQTT.client = {}
MQTT.client.__index = MQTT.client
---
-- @field [parent = #client] #number DEFAULT_PORT
--
MQTT.client.DEFAULT_PORT = 1883
---
-- @field [parent = #client] #number KEEP_ALIVE_TIME
--
MQTT.client.KEEP_ALIVE_TIME = 60 -- seconds (maximum is 65535)
MQTT.client.CONNACK_WAIT_TIMEOUT = 3 -- seconds [MQTT-3.2: "Reasonable" time]
MQTT.client.CLIENT_SOCKET_TIMEOUT = 0.01
---
-- @field [parent = #client] #number MAX_PAYLOAD_LENGTH
--
MQTT.client.MAX_PAYLOAD_LENGTH = 268435455 -- bytes
-- MQTT 3.1.1 Specification: Section 2.2.1: Fixed header control packet types
---
-- @field [parent = #mqtt_library] message
--
MQTT.RESERVED_00 = 0x00 -- Forbidden
MQTT.CONNECT = 0x01
MQTT.CONNACK = 0x02
MQTT.PUBLISH = 0x03
MQTT.PUBACK = 0x04
MQTT.PUBREC = 0x05
MQTT.PUBREL = 0x06
MQTT.PUBCOMP = 0x07
MQTT.SUBSCRIBE = 0x08
MQTT.SUBACK = 0x09
MQTT.UNSUBSCRIBE = 0x0A
MQTT.UNSUBACK = 0x0B
MQTT.PINGREQ = 0x0C
MQTT.PINGRESP = 0x0D
MQTT.DISCONNECT = 0x0E
MQTT.RESERVED_FF = 0xFF --Forbidden
-- MQTT 3.1.1 Specification: Section 3.2: CONNACK return error messages.
-- CONNACK return code 0x0 -> Connection Accepted. Others are errors.
MQTT.error_message = {}
MQTT.error_message.CONNACK = { -- CONNACK return code used as the index
"Connection refused, unacceptable protocol version", -- 0x01
"Connection refused, identifer rejected", -- 0x02
"Connection refused, server unavailable", -- 0x03
"Connection refused, bad user name or password", -- 0x04
"Connection refused, client is not authorized to connect" -- 0x05
-- 6-255: Reserved for future use
}
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Create an MQTT client instance
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-- Create an MQTT client instance.
-- @param #string hostname Host name or address of the MQTT broker
-- @param #number port Port number of the MQTT broker (default: 1883)
-- @param #function callback Invoked when subscribed topic messages received
-- @function [parent = #client] create
-- @return #client created client
--
function MQTT.client.create( -- Public API
hostname, -- string: Host name or address of the MQTT broker
port, -- integer: Port number of the MQTT broker (default: 1883)
callback) -- function: Invoked when subscribed topic messages received
-- return: mqtt_client table
local mqtt_client = {}
setmetatable(mqtt_client, MQTT.client)
if callback == nil then -- should this be moved to the sub function anyway?
callback = callback_fallback
end
mqtt_client.callback = callback -- function(topic, payload)
mqtt_client.hostname = hostname or MQTT.DEFAULT_BROKER_HOSTNAME
mqtt_client.port = port or MQTT.client.DEFAULT_PORT
mqtt_client.connected = false
mqtt_client.destroyed = false
mqtt_client.last_activity = 0
mqtt_client.message_id = 0
mqtt_client.outstanding = {}
mqtt_client.socket_client = nil
return(mqtt_client)
end
--------------------------------------------------------------------------------
-- Specify username and password before #client.connect
--
-- It is possible to have empty username and passwords per [MQTT-3.1.3.4]
--
-- If called with empty _username_ or _password_, username and password flags will be set and:
-- If username is empty, 0 length UTF-8 encoded string will be added to payload.
-- If password is empty, 2 bytes for length + 0 length binary password(emtpy)
-- will be added added to payload. [MQTT-3.1.3.5]
--
-- What will happen when username="" and password="abc" is:
-- 1. username & password flags will be set
-- 2. username will be encoded as only two bytes of length 0 as per [MQTT 1.5.3]
-- 3. password bytes will contain '0,3,97,98,99'
--
-- Remains to be seen if this behaviour will be accepted by brokers.
--
-- Usage example:
-- local mqtt_client = MQTT.client.create(args.host, args.port, callback)
-- mqtt_client.auth(mqtt_client, <username>, <password>)
--
-- @function [parent = #client] auth
-- @param self
-- @param #string username Name of the user who is connecting.
-- @param #string password Password for the connecting user.
function MQTT.client.auth(self, username, password)
-- When no string is provided, remember current call to set flags
self.username = username or true
self.password = password or true
end
--------------------------------------------------------------------------------
-- Transmit a CONNECT Packet to MQTT broker.
-- MQTT 3.1.1 - 3.1: CONNECT
-- @param self
-- @param #string identifier MQTT client identifier (maximum 23 characters)
-- @param #string will_topic Last will and testament topic
-- @param #string will_qos Last will and testament Quality Of Service
-- @param #string will_retain Last will and testament retention status
-- @param #string will_message Last will and testament message
-- @function [parent = #client] connect
--
function MQTT.client:connect( -- Public API
identifier, -- string: MQTT client identifier (maximum 23 characters)
will_topic, -- string: Last will and testament topic
will_qos, -- byte: Last will and testament Quality Of Service
will_retain, -- byte: Last will and testament retention status
will_message) -- string: Last will and testament message
-- return: nil or error message
if (self.connected) then
-- TODO: Should this be an idempotent operation ?
return("MQTT.client:connect(): Already connected")
end
MQTT.Utility.debug("MQTT.client:connect(): " .. identifier)
self.socket_client = socket.connect(self.hostname, self.port)
if (self.socket_client == nil) then
MQTT.Utility.debug("MQTT.client:connect(): Couldn't open MQTT broker connection")
return("MQTT.client:connect(): Couldn't open MQTT broker connection")
end
-- Set a timeout value for subsequent operations
MQTT.Utility.socket_wait_connected(self.socket_client, MQTT.client.CLIENT_SOCKET_TIMEOUT)
-- Not yet connected. Only after CONNACK is received without errors.
self.connected = false
-- Construct CONNECT variable header fields (bytes 1 through 7)
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local payload
payload = MQTT.client.encode_utf8("MQTT") -- For v.3.1.1
payload = payload .. string.char(MQTT.VERSION) -- Protocol level (3.1.2.2)
-- Connect flags (byte 8)
-- ~~~~~~~~~~~~~
-- bit 7: Username flag = 0
-- bit 6: Password flag = 0
-- bit 5: Will retain = 0
-- bits 4,3: Will QOS = 00
-- bit 2: Will flag = 0
-- bit 1: Clean session = 1 --TODO: Add ability to use existing sessions.
-- bit 0: Unused = 0
local username = self.username and 0x80 or 0
-- If the User Name Flag is set to 0, the Password Flag MUST be set to 0 [MQTT-3.1.2.9]
local password = self.username and self.password and 0x40 or 0
local flags = username + password
if (will_topic == nil) then
-- Clean session, no last will
flags = flags + 0x02
else
flags = flags + MQTT.Utility.shift_left(will_retain, 5)
flags = flags + MQTT.Utility.shift_left(will_qos, 3)
-- Last will and clean session
flags = flags + 0x04 + 0x02
end
payload = payload .. string.char(flags)
-- Keep alive timer (bytes 9 LSB and 10 MSB, unit is seconds)
-- ~~~~~~~~~~~~~~~~~
payload = payload .. string.char(math.floor(MQTT.client.KEEP_ALIVE_TIME / 256))
payload = payload .. string.char(MQTT.client.KEEP_ALIVE_TIME % 256)
-- Client identifier
-- ~~~~~~~~~~~~~~~~~
payload = payload .. MQTT.client.encode_utf8(identifier)
-- Last will and testament
-- ~~~~~~~~~~~~~~~~~~~~~~~
if (will_topic ~= nil) then
payload = payload .. MQTT.client.encode_utf8(will_topic)
payload = payload .. MQTT.client.encode_utf8(will_message)
end
-- Username and password
-- ~~~~~~~~~~~~~~~~~~~~~
if type(self.username) == 'string' then
payload = payload .. MQTT.client.encode_utf8(self.username)
-- if no username, there can be no password. Empty string as username is OK. :-(
if type(self.password) == 'string' then
payload = payload .. MQTT.client.encode_utf8(self.password)
end
end
-- Send CONNECT message
local send_connect_result = self:message_write(MQTT.CONNECT, payload)
if(send_connect_result ~= nil) then
return("MQTT.client:connect(): Could not send CONNECT request: ".. send_result)
end
-- Now waiting for CONNACK message from the broker.
-- Only after receiving a valid CONNACK message, self.connected will be true.
local connack_result = self:wait_for_connack(MQTT.client.CONNACK_WAIT_TIMEOUT)
if (connack_result == nil) then
self.connected = true
MQTT.Utility.debug("MQTT.client:connect() - Successful")
else -- Deal with error here.
MQTT.Utility.debug("MQTT.client:connect() - ".. connack_result)
self:destroy()
end
return(connack_result)
end
-------------------------------------------------
-- Wait for CONNACK response from broker after a CONNECT request is sent.
-- This should be the first message received from the broker.
--
-- @param timeout maximum time to wait for a CONNACK response as per [MQTT-3.2]
-- -- @function [parent = #client] wait_for_connack
--
function MQTT.client:wait_for_connack( -- Internal API
timeout)
-- return: nil or error message
local connack_received = false
local error_message = nil
local socket_ready = MQTT.Utility.socket_ready(self.socket_client, timeout)
if (not socket_ready) then
-- After <timeout> seconds, assume CONNACK msg is not coming and give up.
error_message = "Socket is not ready"
else
error_message, buffer = MQTT.Utility.socket_receive(self.socket_client)
if (error_message == nil) then
if (buffer ~= nil and #buffer > 0) then
local message_type_flags = string.byte(buffer, 1)
local message_type = MQTT.Utility.shift_right(message_type_flags, 4)
if(message_type == MQTT.CONNACK) then
-- Verify no CONNACK error is returned from broker
local remaining_length = string.byte(buffer, 2)
assert(remaining_length==2, "CONNACK:remaining_length must be 2!. It was: "..remaining_length )
-- local byte3 = string.byte(buffer, 3) -- Only SP bit is relevant
local connect_return_code = string.byte(buffer, 4)
if (connect_return_code ~= 0) then
error_message = MQTT.error_message.CONNACK[connect_return_code]
MQTT.Utility.debug("MQTT.client:wait_for_connack() - "..error_message)
end
else -- message_type != CONNACK
-- We must have gotten a CONNACK and nothing ese at this point
error_message = "Unexpected message type while waiting for CONNACK"
end
end
end
end
return error_message
end
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Destroy an MQTT client instance.
-- @param self
-- @function [parent = #client] destroy
--
function MQTT.client:destroy() -- Public API
MQTT.Utility.debug("MQTT.client:destroy()")
if (self.destroyed == false) then
self.destroyed = true -- Avoid recursion when message_write() fails
if (self.connected) then self:disconnect() end
--self.callback = nil
self.outstanding = nil
end
end
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Transmit MQTT Disconnect message.
-- MQTT 3.1 Specification: Section 3.14: Disconnect notification
-- bytes 1,2: Fixed message header, see MQTT.client:message_write()
-- @param self
-- @function [parent = #client] disconnect
--
function MQTT.client:disconnect() -- Public API
MQTT.Utility.debug("MQTT.client:disconnect()")
if (self.connected) then
self:message_write(MQTT.DISCONNECT, nil)
self.socket_client:close()
self.connected = false
else
print("ERROR: MQTT.client:disconnect(): Already disconnected")
end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Encode a message string using UTF-8 (for variable header)
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1.1 Specification: Section 1.5.3: UTF-8 Encoded strings.
-- Unless stated otherwise UTF-8 encoded strings can have any length in the range 0 to 65535 bytes
--
-- byte 1: String length MSB
-- byte 2: String length LSB
-- bytes 3-n: String encoded as UTF-8, if length > 0
function MQTT.client.encode_utf8(input)
local output
output = string.char(math.floor(#input / 256))
output = output .. string.char(#input % 256)
output = output .. input
return(output)
end
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Handle received messages and maintain keep-alive PING messages.
-- This function must be invoked periodically (more often than the
-- `MQTT.client.KEEP_ALIVE_TIME`) which maintains the connection and
-- services the incoming subscribed topic messages
-- @param self
-- @function [parent = #client] handler
--
function MQTT.client:handler()
if (self.connected == false) then
print("ERROR: MQTT.client:handler(): Not connected")
end
MQTT.Utility.debug("MQTT.client:handler()")
-- Transmit MQTT PING message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1.1 Specification: Section 3.12: PING request
--
-- bytes 1,2: Fixed message header, see MQTT.client:message_write()
local activity_timeout = self.last_activity + MQTT.client.KEEP_ALIVE_TIME
if (MQTT.Utility.get_time() > activity_timeout) then
MQTT.Utility.debug("MQTT.client:handler(): PINGREQ")
self:message_write(MQTT.PINGREQ, nil)
end
-- Check for available client socket data
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local ready = MQTT.Utility.socket_ready(self.socket_client)
if (ready) then
local error_message, buffer = MQTT.Utility.socket_receive(self.socket_client)
if (error_message ~= nil) then
self:destroy()
error_message = "socket_client:receive(): " .. error_message
MQTT.Utility.debug(error_message)
return(error_message)
end
if (buffer ~= nil and #buffer > 0) then
local index = 1
-- Parse individual messages (each must be at least 2 bytes long)
-- Decode "remaining length" [MQTT-v3.1.1] (2.2.3) - Pages 18,19
while (index < #buffer) do
local message_type_flags = string.byte(buffer, index)
local multiplier = 1
local value = 0
repeat
index = index + 1
local encodedByte = string.byte(buffer, index) -- 'next byte from stream'
value = value + ((encodedByte % 128) * multiplier) -- (encodedByte & 127) * multiplier
multiplier = multiplier * 128
until encodedByte < 128 -- check continuation bit
-- here 'value' contains remaining_length
local message = string.sub(buffer, index + 1, index + value)
if (#message == value) then
self:parse_message(message_type_flags, value, message)
else
MQTT.Utility.debug(
"MQTT.client:handler(): Incorrect remaining length: " ..
value .. " ~= message length: " .. #message
)
end
index = index + value + 1
end
-- Check for any left over bytes, i.e. partial message received
if (index ~= (#buffer + 1)) then
local error_message =
"MQTT.client:handler(): Partial message received" ..
index .. " ~= " .. (#buffer + 1)
if (MQTT.ERROR_TERMINATE) then -- TODO: Refactor duplicate code
self:destroy()
print("ERROR:",error_message)
else
MQTT.Utility.debug(error_message)
end
end
end
end
return(nil)
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Transmit an MQTT message
-- ~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 2.1: Fixed header
--
-- byte 1: Message type and flags (DUP, QOS level, and Retain) fields
-- bytes 2-5: Remaining length field (between one and four bytes long)
-- bytes m- : Optional variable header and payload
function MQTT.client:message_write( -- Internal API
message_type, -- enumeration
payload,
retain) -- string
-- return: nil or error message
-- TODO: Complete implementation of fixed header byte 1
local message = string.char(MQTT.Utility.shift_left(message_type, 4))
-- [MQTT-v3.1.1](2.2.2) Fixed header flags:
-- Fixed header Byte 1 must be 0x82 for SUBSCRIBE and 0xA2 for UNSUBSCRIBE
-- Also 0x62 for PUBREL for when we support it.
if( message_type == MQTT.SUBSCRIBE or
message_type == MQTT.UNSUBSCRIBE or
message_type == MQTT.PUBREL ) then
message = string.char( MQTT.Utility.shift_left(message_type, 4) + 2)
end
if(message_type == MQTT.PUBLISH and retain == true) then
message = string.char( MQTT.Utility.shift_left(message_type, 4) + 1)
end
if (payload == nil) then
message = message .. string.char(0) -- Zero length, no payload
payload = ""
else
if (#payload > MQTT.client.MAX_PAYLOAD_LENGTH) then
return(
"MQTT.client:message_write(): Payload length = " .. #payload ..
" exceeds maximum of " .. MQTT.client.MAX_PAYLOAD_LENGTH
)
end
-- Encode "remaining length" [MQTT-v3.1.1] Section. (2.2.3 pages 18,19)
local encoded_rl_buf=""
local x = #payload
repeat
local encoded_byte = x % 128 -- modulo in lua: a % b == a - math.floor(a / b ) * b
x = math.floor(x / 128) -- integer division :-(
if (x > 0) then
encoded_byte = encoded_byte + 128 -- encodedByte OR 128
end
encoded_rl_buf = encoded_rl_buf .. string.char(encoded_byte) -- 'output' encodedByte
until x <= 0 -- while ( x > 0 )
message = message .. encoded_rl_buf .. payload
end
-- MQTT.Utility.debug("MQTT.client:message_write() - ".. message .. payload)
local status, error_message = self.socket_client:send(message)
if (status == nil) then
self:destroy()
return("MQTT.client:message_write(): " .. error_message)
end
self.last_activity = MQTT.Utility.get_time()
return(nil)
end
function MQTT.client:message_write_old( -- Internal API
message_type, -- enumeration
payload) -- string
-- TODO: Complete implementation of fixed header byte 1
local message = string.char(MQTT.Utility.shift_left(message_type, 4))
if (payload == nil) then
message = message .. string.char(0) -- Zero length, no payload
else
if (#payload > MQTT.client.MAX_PAYLOAD_LENGTH) then
error(
"MQTT.client:message_write(): Payload length = " .. #payload ..
" exceeds maximum of " .. MQTT.client.MAX_PAYLOAD_LENGTH
)
end
message = message .. string.char(#payload)
message = message .. payload
end
local status, error_message = self.socket_client:send(message)
if (status == nil) then
self:destroy()
error("MQTT.client:message_write(): " .. error_message)
end
self.last_activity = MQTT.Utility.get_time()
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Parse MQTT message
-- ~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 2.1: Fixed header
--
-- byte 1: Message type and flags (DUP, QOS level, and Retain) fields
-- bytes 2-5: Remaining length field (between one and four bytes long)
-- bytes m- : Optional variable header and payload
--
-- The message type/flags and remaining length are already parsed and
-- removed from the message by the time this function is invoked.
-- Leaving just the optional variable header and payload.
function MQTT.client:parse_message( -- Internal API
message_type_flags, -- byte
remaining_length, -- integer
message) -- string: Optional variable header and payload
local message_type = MQTT.Utility.shift_right(message_type_flags, 4)
-- TODO: MQTT.TYPE table should include "parser handler" function.
-- This would nicely collapse the if .. then .. elseif .. end.
MQTT.Utility.debug("MQTT.client:parse_message" .. message)
--
if (message_type == MQTT.CONNACK) then
self:parse_message_connack(message_type_flags, remaining_length, message)
elseif (message_type == MQTT.PUBLISH) then
self:parse_message_publish(message_type_flags, remaining_length, message)
elseif (message_type == MQTT.PUBACK) then
print("MQTT.client:parse_message(): PUBACK -- UNIMPLEMENTED --") -- TODO
elseif (message_type == MQTT.SUBACK) then
self:parse_message_suback(message_type_flags, remaining_length, message)
elseif (message_type == MQTT.UNSUBACK) then
self:parse_message_unsuback(message_type_flags, remaining_length, message)
elseif (message_type == MQTT.PINGREQ) then
self:ping_response()
elseif (message_type == MQTT.PINGRESP) then
self:parse_message_pingresp(message_type_flags, remaining_length, message)
else
local error_message =
"MQTT.client:parse_message(): Unknown message type: " .. message_type
if (MQTT.ERROR_TERMINATE) then -- TODO: Refactor duplicate code
self:destroy()
print("ERROR: ",error_message)
else
MQTT.Utility.debug(error_message)
end
end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Parse MQTT CONNACK message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 3.2: CONNACK Acknowledge connection
--
-- byte 1: Reserved value
-- byte 2: Connect return code, see MQTT.CONNACK.error_message[]
function MQTT.client:parse_message_connack( -- Internal API
message_type_flags, -- byte
remaining_length, -- integer
message) -- string
local me = "MQTT.client:parse_message_connack()"
MQTT.Utility.debug(me)
if (remaining_length ~= 2) then
print("ERROR: ",me .. ": Invalid remaining length")
end
local return_code = string.byte(message, 2)
if (return_code ~= 0) then
local error_message = "Unknown return code"
--local max_error = table.getn(MQTT.CONNACK.error_message) :HKN
local max_error = #MQTT.error_message.CONNACK
if (return_code <= max_error) then
error_message = MQTT.error_message.CONNACK[return_code]
end
print("ERROR: ",me .. ": CONNECT failed: " .. error_message)
end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Parse MQTT PINGRESP message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 3.13: PING response
function MQTT.client:parse_message_pingresp( -- Internal API
message_type_flags, -- byte
remaining_length, -- integer
message) -- string
local me = "MQTT.client:parse_message_pingresp()"
MQTT.Utility.debug(me)
if (remaining_length ~= 0) then
print("ERROR: ",me .. ": Invalid remaining length")
end
-- ToDo: self.ping_response_outstanding = false
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Parse MQTT PUBLISH message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 3.3: Publish message
--
-- Variable header ..
-- bytes 1- : Topic name and optional Message Identifier (if QOS > 0)
-- bytes m- : Payload
function MQTT.client:parse_message_publish( -- Internal API
message_type_flags, -- byte
remaining_length, -- integer
message) -- string
local me = "MQTT.client:parse_message_publish()"
-- print (me, message )
MQTT.Utility.debug(me)
if (self.callback ~= nil) then
if (remaining_length < 3) then
print("ERROR: ", me .. ": Invalid remaining length: " .. remaining_length)
end
local topic_length = string.byte(message, 1) * 256
topic_length = topic_length + string.byte(message, 2)
local topic = string.sub(message, 3, topic_length + 2)
local index = topic_length + 3
-- Handle optional Message Identifier, for QOS levels 1 and 2
-- TODO: Enable Subscribe with QOS and deal with PUBACK, etc.
local qos = MQTT.Utility.shift_right(message_type_flags, 1) % 3
if (qos > 0) then
local message_id = string.byte(message, index) * 256
message_id = message_id + string.byte(message, index + 1)
index = index + 2
end
local payload_length = remaining_length - index + 1
local payload = string.sub(message, index, index + payload_length - 1)
self.callback(topic, payload)
end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Parse MQTT SUBACK message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 3.9: SUBACK Subscription acknowledgement
--
-- bytes 1,2: Message Identifier
-- bytes 3- : List of granted QOS for each subscribed topic
function MQTT.client:parse_message_suback( -- Internal API
message_type_flags, -- byte
remaining_length, -- integer
message) -- string
local me = "MQTT.client:parse_message_suback()"
MQTT.Utility.debug(me)
if (remaining_length < 3) then
print("ERROR: ",me .. ": Invalid remaining length: " .. remaining_length)
end
local message_id = string.byte(message, 1) * 256 + string.byte(message, 2)
local outstanding = self.outstanding[message_id]
print("debug: ",me .. message_id , outstanding )
if (outstanding == nil) then
print("ERROR: ",me .. ": No outstanding messageXX: " .. message_id)
else
self.outstanding[message_id] = nil
if (outstanding[1] ~= "subscribe") then
print("ERROR: ",me .. ": Outstanding message wasn't SUBSCRIBE")
end
--local topic_count = table.getn(outstanding[2])
local topic_count = #outstanding[2]
if (topic_count ~= remaining_length - 2) then
print("ERROR: ",me .. ": Didn't received expected number of topics: " .. topic_count)
end
end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Parse MQTT UNSUBACK message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 3.11: UNSUBACK Unsubscription acknowledgement
--
-- bytes 1,2: Message Identifier
function MQTT.client:parse_message_unsuback( -- Internal API
message_type_flags, -- byte
remaining_length, -- integer
message) -- string
local me = "MQTT.client:parse_message_unsuback()"
MQTT.Utility.debug(me)
if (remaining_length ~= 2) then
print("ERROR: ",me .. ": Invalid remaining length")
end
local message_id = string.byte(message, 1) * 256 + string.byte(message, 2)
local outstanding = self.outstanding[message_id]
if (outstanding == nil) then
print("ERROR: ",me .. ": No outstanding message: " .. message_id)
end
self.outstanding[message_id] = nil
if (outstanding[1] ~= "unsubscribe") then
print("ERROR: ",me .. ": Outstanding message wasn't UNSUBSCRIBE")
end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Transmit MQTT Ping response message
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- MQTT 3.1 Specification: Section 3.13: PING response
function MQTT.client:ping_response() -- Internal API
MQTT.Utility.debug("MQTT.client:ping_response()")
if (self.connected == false) then
print("ERROR: ","MQTT.client:ping_response(): Not connected")
end
self:message_write(MQTT.PINGRESP, nil)
end
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Transmit MQTT Publish message.
-- MQTT 3.1.1 Specification: Section 3.3: Publish message
--
-- * bytes 1,2: Fixed message header, see MQTT.client:message_write()
-- Variable header ..
-- * bytes 3- : Topic name and optional Message Identifier (if QOS > 0)
-- * bytes m- : Payload
-- @param self
-- @param #string topic
-- @param #string payload
-- @param #boolean retain publish this message with retain flag set
-- @function [parent = #client] publish
--
-- return nil or error_message
function MQTT.client:publish( -- Public API
topic,
payload, -- string
retain) -- boolean
if (self.connected == false) then
print("ERROR: ","MQTT.client:publish(): Not connected")
end
--MQTT.Utility.debug("MQTT.client:publish(): " .. topic)
local message = MQTT.client.encode_utf8(topic) .. payload
local error_message = self:message_write(MQTT.PUBLISH, message, retain)
return (error_message)
end
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Transmit MQTT Subscribe message.
-- MQTT 3.1 Specification: Section 3.8: Subscribe to named topics
--
-- * bytes 1,2: Fixed message header, see MQTT.client:message_write()
-- Variable header ..
-- * bytes 3,4: Message Identifier
-- * bytes 5- : List of topic names and their QOS level
-- @param self
-- @param #string topics table of strings
-- @function [parent = #client] subscribe
-- return nil or error_message
--
function MQTT.client:subscribe( -- Public API
topics, -- table of strings
callback ) -- function to callback when message is received
print ("MQTT.client:subscribe", topics )
if (self.connected == false) then
print("ERROR: ","MQTT.client:subscribe(): Not connected")
end
if callback == nil then
callback = callback_fallback
else
self.callback = callback -- function(topic, payload)
end
self.message_id = self.message_id + 1
local message
message = string.char(math.floor(self.message_id / 256))
message = message .. string.char(self.message_id % 256)
for index, topic in ipairs(topics) do
MQTT.Utility.debug("MQTT.client:subscribe(): " .. topic)
message = message .. MQTT.client.encode_utf8(topic)
message = message .. string.char(0) -- QOS level 0
end
self:message_write(MQTT.SUBSCRIBE, message)
local error_message = self:message_write(MQTT.SUBSCRIBE, message)
self.outstanding[self.message_id] = { "subscribe", topics }
return (error_message)
end
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- Transmit MQTT Unsubscribe message
-- MQTT 3.1 Specification: Section 3.10: Unsubscribe from named topics
--
-- * bytes 1,2: Fixed message header, see MQTT.client:message_write()
-- Variable header ..
-- * bytes 3,4: Message Identifier
-- * bytes 5- : List of topic names
-- @param self
-- @param #string topics table of strings
-- @function [parent = #client] unsubscribe
--
function MQTT.client:unsubscribe( -- Public API
topics) -- table of strings
if (self.connected == false) then
print("ERROR: ","MQTT.client:unsubscribe(): Not connected")
end
self.callback = callback_fallback -- function(topic, payload)
self.message_id = self.message_id + 1
local message
message = string.char(math.floor(self.message_id / 256))
message = message .. string.char(self.message_id % 256)
for index, topic in ipairs(topics) do
MQTT.Utility.debug("MQTT.client:unsubscribe(): " .. topic)
message = message .. MQTT.client.encode_utf8(topic)
end
self:message_write(MQTT.UNSUBSCRIBE, message)
self.outstanding[self.message_id] = { "unsubscribe", topics }
end
return(MQTT)
|
DeriveGamemode( "sandbox" )
GM.Name = "HeroRP"
GM.Author = "FNOX"
GM.Email = "thefnox@gmail.com"
RP = {}
|
local utils = require('me.utils')
local map = utils.map
local home = utils.home
if vim.fn.has('win32') ~= 0 then
vim.g.python3_host_prog = home .. '/scoop/apps/python/current/python.exe'
else
vim.g.python3_host_prog = '/usr/bin/python'
end
vim.opt.expandtab = true
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.smartindent = true
vim.opt.showmode = false
vim.opt.shiftround = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.completeopt = {'menuone', 'noinsert', 'noselect'}
vim.opt.hidden = true
vim.opt.termguicolors = true
vim.opt.wrap = false
vim.opt.relativenumber = true
vim.opt.number = true
vim.opt.swapfile = false
vim.opt.mouse = ''
vim.opt.inccommand = 'nosplit'
vim.opt.scrolloff = 3
vim.opt.sidescrolloff = 8
vim.opt.guifont = 'SauceCodePro NF:h12'
-- Keymaps
-- Remap leader keys
map('n', '<SPACE>', '<NOP>')
vim.g.mapleader = ' '
vim.g.maplocalleader = ','
-- Transpose lines and characters
map('n', '<Up>', 'ddkP')
map('n', '<Down>', 'ddp')
map('n', '<Left>', 'xhP')
map('n', '<Right>', 'xp')
-- Easier navigation on broken lines
map('n', 'j', 'gj')
map('n', 'k', 'gk')
-- Redraw screen
map('n', '<ESC>', '<CMD>nohlsearch<CR>')
-- Easier Window Navigation
map('', '<C-h>', '<C-w>h')
map('n', '<C-j>', '<C-w>j', {})
map('', '<C-k>', '<C-w>k')
map('', '<C-l>', '<C-w>l')
map('', '<C-w>t', '<CMD>tabnew<CR>')
-- TODO move to ftdetect
vim.cmd [[
augroup omnifuncs
au BufNew,BufNewFile,BufRead,BufEnter *.snippets setfiletype snippets
au BufNew,BufNewFile,BufRead,BufEnter *.sol setfiletype solidity
au BufNewFile,BufRead *.rasi setfiletype css
au BufNew,BufNewFile,BufRead,BufEnter *.tex :setfiletype tex
augroup end
]]
-- Plugins
require('me.plugins')
-- LSP
vim.diagnostic.config({
signs = {
severity = {
min=vim.diagnostic.severity.WARN,
},
},
})
require('me.setup_lsp')
-- Make Powershell the default shell on Windows
if vim.fn.has('win32') ~= 0 then
vim.opt.shell = 'pwsh' -- Assume we have Powershell Core
vim.opt.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
vim.opt.shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
vim.opt.shellquote = ""
vim.opt.shellxquote = '"'
end
|
return {'yael','yaels'}
|
colored_eggs = {}
local MP = minetest.get_modpath("colored_eggs").."/"
dofile(MP.."colors.lua")
-- particles
local spawn_particles = function(pos, palette_index)
local s = 1
minetest.add_particlespawner({
amount = 10,
time = 0.01, -- seconds to spawn all particles
minpos = {x=pos.x, y=pos.y, z=pos.z},
maxpos = {x=pos.x, y=pos.y, z=pos.z},
minvel = {x=-s, y=-s, z=-s},
maxvel = {x=s, y=s, z=s},
minacc = {x=0, y=-2, z=0},
maxacc = {x=0, y=-2, z=0},
minexptime = 1.0,
maxexptime = 1.0,
minsize = 0.5,
maxsize = 0.5,
collisiondetection = false,
vertical = false,
texture = "egg.png^[multiply:#"..colored_eggs.colors[palette_index+1],
glow = 0
})
end
-- entity
mobs:register_arrow("colored_eggs:entity", {
visual = "sprite",
visual_size = {x=.5, y=.5},
textures = {"egg.png"},
velocity = 6,
hit_player = function(self, player)
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
spawn_particles(player:get_pos(), self.palette_index)
end,
hit_mob = function(self, mob)
mob:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
spawn_particles(mob:get_pos(), self.palette_index)
end,
hit_node = function(self, pos, node)
spawn_particles(pos, self.palette_index)
end
})
-- throwing item
local egg_GRAVITY = 9
local egg_VELOCITY = 19
-- shoot egg
local shoot_egg = function (item, player, pointed_thing)
local playerpos = player:get_pos()
minetest.sound_play("default_place_node_hard", {
pos = playerpos,
gain = 1.0,
max_hear_distance = 5,
})
local obj = minetest.add_entity({
x = playerpos.x,
y = playerpos.y +1.5,
z = playerpos.z
}, "colored_eggs:entity")
local palette_index = item:get_meta():get_int("palette_index")
obj:set_properties({textures = {"egg.png^[multiply:#"..colored_eggs.colors[palette_index+1]}})
local ent = obj:get_luaentity()
local dir = player:get_look_dir()
ent.palette_index = palette_index
ent.playername = player:get_player_name()
ent.velocity = egg_VELOCITY -- needed for api internal timing
ent.switch = 1 -- needed so that egg doesn't despawn straight away
ent._is_arrow = true -- tell advanced mob protection this is an arrow
obj:set_velocity({
x = dir.x * egg_VELOCITY,
y = dir.y * egg_VELOCITY,
z = dir.z * egg_VELOCITY
})
obj:set_acceleration({
x = dir.x * -3,
y = -egg_GRAVITY,
z = dir.z * -3
})
-- don't consume item if player has the 'give' privilege or has creative
local playername = player.get_player_name and player:get_player_name() or ""
if not (minetest.get_player_privs(playername).give or minetest.is_creative_enabled(playername)) then
item:take_item(1)
end
return item
end
-- node
minetest.register_node("colored_eggs:node", {
description = "Colored Egg",
tiles = {"egg.png"},
inventory_image = "egg.png",
visual_scale = 0.7,
drawtype = "plantlike",
wield_image = "egg.png",
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
sunlight_propagates = true,
walkable = false,
is_ground_content = true,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
groups = {food_egg = 1, snappy = 2, dig_immediate = 3, not_in_creative_inventory=1, ud_param2_colorable = 1},
on_use = shoot_egg,
on_dig = unifieddyes.on_dig,
})
unifieddyes.register_color_craft({
output = "colored_eggs:node",
palette = "extended",
type = "shapeless",
neutral_node = "mobs:egg",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
print("[MOD] Colored Eggs loaded")
|
-------------------------------------------------------------------------------
-- Copyright (C) Hispidence 2013-2021
--
--
-- gameManager.lua
--
-- Uses global variables from main.lua even though it doesn't actually INCLUDE
-- main.lua WHAT THE HELL.
-------------------------------------------------------------------------------
local jlEvent = require("src.jlEvent")
local vector = require("src.external.hump.vector")
local ston = nil
local gameManager = {}
gameManager.__index = gameManager
--[[TODO: MAKE INTO SOMETHING THAT ISN'T A SINGLETON!!!]]--
setmetatable(gameManager,
{__call = function(cls, ...)
return cls.new(...)
end})
function gameManager.new()
local self = setmetatable({}, gameManager)
self:init()
return self
end
function gameManager:init()
self.events = {}
self.currentLevel = 0
self.numLevels = 0
self.playerLives = 0
self.gameState = "running"
self.slowed = false -- are we slowed down?
self.slowTimeTotal = 0
self.slowTimeElapsed = 0 -- for how long are we slowed?
self.speedUpPoint = 0.25 -- when should we start speeding up?
self.slowFactorInitial = 0.2 -- how slow are we?
self.slowFactorCurrent = 1
self.deathTimer = 1.2
self.fadeTimer = 1.2
self.fadeInTimer = 0
self.fadeInMax = 0.4
self.hasPad = false
self.pad = nil
self.currX = 0
self.currY = 0
self.toX = 0
self.toY = 0
self.cameraTime = 0
self.elapsed = 0
self.moving = false
self.lastCamera = nil
self.storedPlayerPos = vector(0, 0)
self.storedFloorsPos = {}
self.storedEnemiesPos = {}
self.storedEnemiesState = {}
self.storedMoversPos = {}
self.storedMoversState = {}
self.storedMoversDir = {}
self.storedMoversDist = {}
self.storedTranslateX = 0
self.storedTranslateY = 0
self.storedMoversCurrentExtent = {}
self.storedMoversOtherExtent = {}
self.storedWallsPos = {}
self.storedWallsState = {}
self.storedGunsPos = {}
self.storedGunsState = {}
self.storedGunsBulletsMade = {}
self.storedGunsBulletsState = {}
self.storedGunsBulletsPos = {}
self.storedGunsAges = {}
self.padMapping = {}
end
function gameManager:getButtons()
local buttons = {}
for i = 0, self.pad:getButtonCount() do
buttons[i] = self.pad:isDown(i)
end
return buttons
end
function gameManager:getMapping(button)
return self.padMapping[button]
end
-------------------------------------------------------------------------------
-- acquireGamepad
--
--
-------------------------------------------------------------------------------
function gameManager:acquireGamepad()
if love.joystick.getJoystickCount() > 0 then
if self.hasPad then return end
local pads = love.joystick.getJoysticks()
self.pad = pads[1]
local padID = self.pad:getGUID()
_, self.padMapping["leftx"] = self.pad:getGamepadMapping("leftx")
_, self.padMapping["lefty"] = self.pad:getGamepadMapping("lefty")
_, self.padMapping["rightx"] = self.pad:getGamepadMapping("rightx")
_, self.padMapping["righty"] = self.pad:getGamepadMapping("righty")
_, self.padMapping["b"] = self.pad:getGamepadMapping("b");
_, self.padMapping["back"] = self.pad:getGamepadMapping("back");
self.hasPad = true
else
self.pad = nil
self.hasPad = false
end
end
function gameManager:getLeftStickAxes()
return 0, 0
--if self.hasPad then return self.pad:getAxis(self.padMapping["leftx"]), self.pad:getAxis(self.padMapping["lefty"]) else return 0, 0 end
end
function gameManager:getRightStickAxes()
return 0, 0
--if self.hasPad then return self.pad:getAxis(self.padMapping["rightx"]), self.pad:getAxis(self.padMapping["righty"]) else return 0, 0 end
end
function gameManager:getBandedAxes(upStages, downStages)
x, y = self:getLeftStickAxes()
x2, y2 = self:getRightStickAxes()
local bx, by = x, y
x = math.abs(x) > math.abs(x2) and x or x2
y = math.abs(y) > math.abs(y2) and y or y2
for _, s in ipairs(downStages) do
if x <= s then bx = s end
if y <= s then by = s end
end
for _, s in ipairs(upStages) do
if x >= s then bx = s end
if y >= s then by = s end
end
return bx, by
end
function gameManager:moveCameraGradual(dt)
if not self.moving then return end
self.elapsed = self.elapsed + dt
local extent = self.elapsed/self.cameraTime
if self.elapsed < self.cameraTime then
self.currX = self.currX + extent * (self.toX - self.currX)
self.currY = self.currY + extent * (self.toY - self.currY)
else
self.currX = self.toX
self.currY = self.toY
self.moving = false
self.elapsed = 0
end
end
function gameManager:moveCamera(camName, toX, toY, time)
if camName ~= self.lastCamera then
self.toX = toX
self.toY = toY
self.cameraTime = time
self.elapsed = 0
self.moving = true
self.lastCamera = camName
end
end
function gameManager:getCurrX()
return self.currX
end
function gameManager:getCurrY()
return self.currY
end
function gameManager:setCurrX(x)
self.currX = x
end
function gameManager:setCurrY(y)
self.currY = y
end
function gameManager:setToX(x)
self.toX = x
end
function gameManager:setToY(y)
self.toY = y
end
function gameManager:getFadeInMax()
return self.fadeInMax
end
-------------------------------------------------------------------------------
-- startSlowing
--
-- Slow the action down; start modifying DT
--
-- Arguments:
-- slowFactor: float between 0 and 1; the amount we should slow down by.
-- For example, a factor of 0.5 would cause the action to run at half
-- speed.
--
-- totalSlowTime: float; how long, in seconds, should the action be slowed?
--
-- speedUpPoint: float; How much time must have elapsed before we begin
-- to speed the game up back to normal? For example, a speedUpPoint of
-- 0.5 with a totalSlowTime of 2 will cause time to begin to go back to
-- normal after 1 second.
-------------------------------------------------------------------------------
function gameManager:startSlowing(slowFactor, totalSlowTime, speedUpPoint)
self.slowed = true
self.slowFactorInitial = slowFactor
self.slowFactorCurrent = slowFactor
self.slowTimeTotal = totalSlowTime
self.slowTimeElapsed = 0
self.speedUpPoint = speedUpPoint
end
-------------------------------------------------------------------------------
-- getModifiedDT
--
-- Does what it says on the tin. (self.slowFactorCurrent is 1 if action isn't
-- being slowed down).
-------------------------------------------------------------------------------
function gameManager:getModifiedDT(dt)
return dt * self.slowFactorCurrent
end
-------------------------------------------------------------------------------
-- getSlowFactor
-------------------------------------------------------------------------------
function gameManager:getSlowFactor()
return self.slowFactorCurrent
end
-------------------------------------------------------------------------------
-- update
--
-- Update gamestate timers with (unmodified!) dt. This lovely function controls
-- things like slowdown and the fade effect that happens when you die or finish
-- a level
-------------------------------------------------------------------------------
function gameManager:update(dt)
self:acquireGamepad()
if self.gameState == "running" then
self.fadeInTimer = self.fadeInTimer + dt
self.fadeInTimer = math.min(self.fadeInTimer, self.fadeInMax)
end
if self.gameState == "finishinglevel" then
if self.fadeTimer > 0 then
self.fadeTimer = self.fadeTimer - dt
else
self.gameState = "loading"
end
end
if self.gameState == "finishinggame" then
if self.fadeTimer > 0 then
self.fadeTimer = self.fadeTimer - dt
else
self.gameState = "endsplash"
end
end
if self.gameState == "dead" then
if self.deathTimer > 0 then
self.deathTimer = self.deathTimer - dt
else
self:loadState()
end
end
if self.moving then
self:moveCameraGradual(dt)
end
if self.slowed then
self.slowTimeElapsed = self.slowTimeElapsed + dt
local speedUpSeconds = self.slowTimeTotal * self.speedUpPoint
if self.slowTimeElapsed > self.slowTimeTotal then
self.slowFactorCurrent = 1
self.slowed = false
else
if self.slowTimeElapsed > speedUpSeconds then
-- How long will it take us to fully speed up back to normal?
local totalSpeedUpTime = self.slowTimeTotal - speedUpSeconds
-- how far are we into the speedup period?
local difference = self.slowTimeElapsed - speedUpSeconds
local progress = difference / totalSpeedUpTime
self.slowFactorCurrent = self.slowFactorInitial +
(1 - self.slowFactorInitial) * progress
end
end
end
end
function gameManager:getDeathTimer()
return math.min(self.deathTimer, 1)
end
function gameManager:getFadeTimer()
return math.min(self.fadeTimer, 1)
end
function gameManager:getFadeInTimer()
return self.fadeInTimer
end
function gameManager:saveState()
-- self.storedPlayerPos = g_thePlayer:getPos():clone()
-- self.storedTranslateX = self.toX
-- self.storedTranslateY = self.toY
-- for i, v in ipairs(g_entityEnemies) do
-- self.storedEnemiesPos[i] = v:getPos():clone()
-- self.storedEnemiesState[i] = v:getState()
-- end
-- for i, v in ipairs(g_entityMovers) do
-- self.storedMoversPos[i] = v:getPos():clone()
-- self.storedMoversState[i] = v:getState()
-- self.storedMoversDir[i] = v:getDir():clone()
-- self.storedMoversDist[i] = v:getDist()
-- self.storedMoversCurrentExtent[i] = v:getCurrentExtent()
-- self.storedMoversOtherExtent[i] = v:getOtherExtent()
-- end
-- for i, v in ipairs(g_entityBlocks) do
-- self.storedWallsPos[i] = v:getPos():clone()
-- self.storedWallsState[i] = v:getState()
-- end
-- for i, v in ipairs(g_entityGuns) do
-- self.storedGunsPos[i] = v:getPos():clone()
-- self.storedGunsState[i] = v:getState()
-- self.storedGunsBulletsMade[i] = v:getBulletsMade()
-- end
end
function gameManager:loadState()
self:setState("running")
self.deathTimer = 1.2
self.fadeTimer = 1.2
self.fadeInTimer = 0.0
self.slowed = false
self.slowFactorCurrent = 1
g_thePlayer:setState("resting")
g_thePlayer:resetAnim("dead")
g_thePlayer:resetSounds()
g_thePlayer:setPos(self.storedPlayerPos:clone())
self.currX = self.storedTranslateX
self.currY = self.storedTranslateY
self.toX = self.storedTranslateX
self.toY = self.storedTranslateY
self.lastCamera = nil
self.moving = false
for i, v in ipairs(g_entityScenery) do
v:setPos(self.storedFloorsPos[i]:clone())
end
for i, v in ipairs(g_entityEnemies) do
v:setPos(self.storedEnemiesPos[i]:clone())
v:setState(self.storedEnemiesState[i])
if v.resetBehaviour then v:resetBehaviour() end
--if v:getState() ~= "dead" then v:resetAnim("dead") end
v:copyPath(nil)
if v:getState() ~= "dead" then
v:resetAnims()--("dead")
v:resetSounds()
end
v:setPathTimer(1.1)
--v:setFlatMap(nil)
end
for i, v in ipairs(g_entityMovers) do
v:setPos(self.storedMoversPos[i]:clone())
v:setState(self.storedMoversState[i])
v:setDir(self.storedMoversDir[i]:clone())
v:setDist(self.storedMoversDist[i])
v:setCurrentExtent(self.storedMoversCurrentExtent[i])
v:setOtherExtent(self.storedMoversOtherExtent[i])
end
for i, v in ipairs(g_entityBlocks) do
v:setPos(self.storedWallsPos[i]:clone())
v:setState(self.storedWallsState[i])
if v:getState() ~= "off" then
v:resetSounds()
end
if v:getState() ~= "dead" then youShallNotPass(pathMap, v:getPos(), v:getSize()) end
end
for i, v in ipairs(g_entityGuns) do
v:setPos(self.storedGunsPos[i]:clone())
v:setState(self.storedGunsState[i])
v:setBulletsMade(self.storedGunsBulletsMade[i])
v:resetFiringBehaviour()
v:killBullets()
v:resetTimeLastBullet()
v:resetSounds()
if v:getState() ~= "dead" and v:getInvisible() == false then youShallNotPass(pathMap, v:getPos(), v:getSize()) end
end
end
function gameManager:unload()
self.events = {}
self.deathTimer = 1.2
self.fadeTimer = 1.2
self.fadeInTimer = 0
self.currX = 0
self.currY = 0
self.toX = 0
self.toY = 0
self.slowed = false
self.slowFactorInitial = 0
self.slowFactorCurrent = 1
self.slowTimeTotal = 0
self.slowTimeElapsed = 0
self.speedUpPoint = 0
self.moving = false
self.storedPlayerPos = nil
self.storedTranslateX = {}
self.storedTranslateY = {}
self.storedFloorsPos = {}
self.storedEnemiesPos = {}
self.storedEnemiesState = {}
self.storedMoversPos = {}
self.storedMoversState = {}
self.storedMoversDir = {}
self.storedMoversDist = {}
self.storedMoversCurrentExtent = {}
self.storedMoversOtherExtent = {}
self.storedWallsPos = {}
self.storedWallsState = {}
self.storedGunsPos = {}
self.storedGunsState = {}
self.storedGunsBulletsMade = {}
end
-------------------------------------------------------------------------------
-- gameManager:targets
--
-- Factory for an iterator which traverses the event list for key 'a' (if it
-- exists) and returns the keys and values it finds.
-------------------------------------------------------------------------------
function gameManager:targets(a)
local i = 0
if self.events[a] then
-- Set the index to the final element in the table. Note the "i = i - 1"
-- in the iterator proper.
i = #self.events[a] + 1
end
-- return the iterator itself
return function()
i = i - 1
if self.events[a] and self.events[a][i] then
return i, self.events[a][i]
end
end
end
function gameManager:setCurrentLevel(l)
if l < self.numLevels or l > 0 then self.currentLevel = l end
end
function gameManager:getCurrentLevel()
return self.currentLevel
end
function gameManager:setNextLevel(l)
if self.currentLevel < self.numLevels then self.currentLevel = self.currentLevel + 1 end
end
function gameManager:setPrevLevel(l)
if self.currentLevel > 0 then self.currentLevel = self.currentLevel - 1 end
end
function gameManager:setNumLevels(n)
self.numLevels = n
end
function gameManager:getNumLevels()
return self.numLevels
end
function gameManager:setState(s)
self.gameState = s
end
function gameManager:getState()
return self.gameState
end
function gameManager:sendEvent(e)
if self.events[e:getTarget()] == nil then
self.events[e:getTarget()] = {e}
else
self.events[e:getTarget()][#self.events[e:getTarget()] + 1] = e
end
end
function gameManager:removeEvent(k, i)
table.remove(self.events[k], i)
end
function gameManager:showEvents()
for i, v in pairs(self.events) do
print(i, v)
for g, j in ipairs(v) do
print(g, j:getID())
end
end
end
function gameManager:pause()
if self.gameState == "paused" then self.gameState = "running"
elseif self.gameState == "running" then self.gameState = "paused" end
end
if ston == nil then
ston = gameManager:new()
end
return ston
|
local class = require 'lib.middleclass'
local Map = class('Map')
local function parseWorldString(str)
str = str:gsub(' ', '')
local result = {cells = {}}
local width = #(str:match("[^\n]+"))
result.width = width
local y,x = 1,1
for row in str:gmatch("[^\n]+") do
assert(#row == width, 'Map is not aligned: width of row ' .. tostring(y) .. ' should be ' .. tostring(width) .. ', but it is ' .. tostring(#row))
result.cells[y] = {}
x = 1
for char in row:gmatch(".") do
result.cells[y][x] = char
x = x + 1
end
y=y+1
end
result.height = y - 1
return result
end
function Map:initialize(map_data)
self.earth = parseWorldString(map_data.earth)
self.hell = parseWorldString(map_data.hell)
self.buttons = map_data.buttons
end
return Map
|
--[[
Copyright 2020 Illia B. (selplacei)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
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 flib = require("__flib__.data-util")
-- Train spawner stop
local train_spawner_stop = flib.copy_prototype(data.raw["train-stop"]["train-stop"], "train-spawner-stop")
-- Train void stop
local train_void_stop = flib.copy_prototype(data.raw["train-stop"]["train-stop"], "train-void-stop")
-- Train meter stop
local train_meter_stop = flib.copy_prototype(data.raw["train-stop"]["train-stop"], "train-meter-stop")
data:extend{train_spawner_stop, train_void_stop, train_meter_stop}
|
local PSBT = PSBT
local ModuleProto = PSBT.ModuleProto
local PSBT_Skills = ModuleProto:Subclass()
local CBM = CALLBACK_MANAGER
local PSBT_EVENTS = PSBT.EVENTS
local PSBT_MODULES = PSBT.MODULES
local PSBT_AREAS = PSBT.AREAS
local _
local kVerison = 1.0
function PSBT_Skills:Initialize( ... )
ModuleProto.Initialize( self, ... )
self:RegisterForEvent( EVENT_SKILL_XP_UPDATE, 'OnSkillXPUpdate' )
end
function PSBT_Skills:Shutdown()
self:UnregisterForEvent( EVENT_SKILL_XP_UPDATE, 'OnSkillXPUpdate' )
ModuleProto.Shutdown( self )
end
function PSBT_Skills:OnSkillXPUpdate( SkillType, SkillIndex, Reason, Rank, PreviousXP, CurrentXP )
local Line = GetSkillLineInfo( SkillType, SkillIndex )
local _, NeedXP = GetSkillLineRankXPExtents( SkillType, SkillIndex, Rank )
local Difference = CurrentXP - PreviousXP
local Percent = math.floor( ( CurrentXP / NeedXP ) * 100.0 )
self:NewEvent( PSBT_AREAS.NOTIFICATION, true, nil, '+' .. tostring( Difference ) .. ' ' .. Line .. ' (' .. Percent .. '%)' )
end
CBM:RegisterCallback( PSBT_EVENTS.LOADED,
function( psbt )
psbt:RegisterModule( PSBT_MODULES.SKILLS, PSBT_Skills, kVerison )
end )
|
local Point = {}
Point.__index = Point -- create class
-- Setters
function Point:__newindex(k, v)
if k == 'mass' then
assert(type(v) == 'number')
rawset(self, 'mass', math.abs(v))
rawset(self, 'radius', 5 * math.sqrt(self.mass / math.pi))
elseif k == 'radius' then
assert(type(v) == 'number')
rawset(self, 'radius', math.abs(v))
rawset(self, 'mass', (self.radius / 5) ^ 2 * math.pi)
else rawset(self, k, v) end
end
-- constructor
function Point.new(mass, pos, vec)
local self = setmetatable({}, Point)
self.mass = mass
self.x = pos[1]
self.y = pos[2]
self.vx = vec[1]
self.vy = vec[2]
self.color = {
math.random(),
math.random(),
math.random(),
}
self.check = true
return self
end
-- Hypotenuse
function hypot(...)
local n, args = 0, {...}
for i = 1, #args do
n = n + math.abs(tonumber(args[i])) ^ 2
end
return math.sqrt(n)
end
-- Gravity simulation
function Point:influence(b)
assert(b) -- need b
local dx = self.x - b.x
local dy = self.y - b.y
local r = hypot(dx, dy)
local acc = self.mass / r ^ 2
b.vx = b.vx + acc * dx / r
b.vy = b.vy + acc * dy / r
end
local k = 0.3 -- some number
-- Collision
function Point:collision(b)
assert(b) -- need b
-- return if not check
if not b.check then return end
-- return if not collide
if (self.x - b.x) ^ 2 + (self.y - b.y) ^ 2 >= (self.radius + b.radius) ^ 2 then return end
-- back
b.x = b.x - b.vx
b.y = b.y - b.vy
self.x = self.x - self.vx
self.y = self.y - self.vy
self.vx, self.vy, b.vx, b.vy =
self.vx - (1 + k) * b.mass / (self.mass + b.mass) * (self.vx - b.vx),
self.vy - (1 + k) * b.mass / (self.mass + b.mass) * (self.vy - b.vy),
b.vx + (1 + k) * self.mass / (self.mass + b.mass) * (self.vx - b.vx),
b.vy + (1 + k) * self.mass / (self.mass + b.mass) * (self.vy - b.vy)
end
return Point
|
local tt = require "util.table"
local function item(k,v)
return {
key = k,
value = v,
}
end
local settings = {
has = {},
}
local function get(k)
local i = settings.has[k]
if i ~= nil then
return i.value
end
end
local function set(k,v)
local i = item(k,v)
settings.has[k] = i
end
set("testing", true)
set("widget_limit", 5000)
return {
Get = get,
Set = set,
}
|
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.uid == 3018 then
if player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 60 then
player:setStorageValue(Storage.ExplorerSociety.QuestLine, 61)
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
end
return true
end
|
local upperclass = require(LIBXML_REQUIRE_PATH..'lib.upperclass')
local utils = require(LIBXML_REQUIRE_PATH..'lib.utils')
local DOMCDATA = require(LIBXML_REQUIRE_PATH..'dom.cdata')
--
-- Define class
--
local Comment = upperclass:define("DOMComment", DOMCDATA)
--
-- Class constructor
--
function private:__construct(DATA)
self:__constructparent(DATA)
self.nodeType = 8
self.nodeName = "#comment"
end
--
-- Compile class
--
return upperclass:compile(Comment)
|
local mod = get_mod("rebalthp")
--Text Localization
mod:add_text("bloodlust_name", "Bloodlust")
mod:add_text("reaper_name", "Reaper")
mod:add_text("vanguard_name", "Vanguard")
mod:add_text("regrowth_name", "Regrowth")
mod:add_text("rebalthp_regrowth_desc", "Melee critical stikes gives you 1.5 temporary health and melee headshots restore 3.5 temporary health. Melee critical headshots restore 5 temporary health.")
mod:add_text("smiter_name", "Smiter")
mod:add_text("enhanced_power_name", "Enhanced Power")
mod:add_text("assassin_name", "Assassin")
mod:add_text("bulwark_name", "Bulwark")
mod:add_text("rebalthp_tank_unbalance_desc", "Enemies you stagger take 15%% more damage for 5 seconds.\n\nDeal 20%% more damage to staggered enemies, increased to 40%% against targets afflicted by more than one stagger effect.")
mod:add_text("rebalthp_finesse_unbalance_desc", "Deal 20%% more damage to staggered enemies.\n\nEach hit against a staggered enemy adds another count of stagger. Headshots instead inflict 40%% bonus damage, as do strikes against enemies afflicted by more than one stagger effect.")
local talent_first_row = {
{
"es_knight",
"es_mercenary",
"es_questingknight",
"dr_ironbreaker",
"wh_zealot",
"bw_unchained",
},
{
"es_huntsman",
"dr_ranger",
"dr_engineer",
"wh_captain",
"bw_scholar",
"bw_adept",
},
{
"dr_slayer",
"we_shade",
"we_maidenguard",
"we_waywatcher",
"wh_bountyhunter",
"we_thornsister",
},
}
for i=1, #talent_first_row[1] do
local career = talent_first_row[1][i]
mod:modify_talent(career, 1, 1, {
name = "vanguard_name",
description = "vanguard_desc",
buffs = {
"rebalthp_vanguard"
}
})
mod:modify_talent(career, 1, 2, {
name = "reaper_name",
description = "reaper_desc",
buffs = {
"rebalthp_reaper"
},
description_values = {
{
value = BuffTemplates.rebalthp_reaper.buffs[1].max_targets
}
},
})
mod:modify_talent(career, 1, 3, {
name = "bloodlust_name",
description = "bloodlust_desc_3",
buffs = {
"rebalthp_bloodlust"
}
})
end
for i=1, #talent_first_row[2] do
local career = talent_first_row[2][i]
mod:modify_talent(career, 1, 1, {
name = "vanguard_name",
description = "vanguard_desc",
buffs = {
"rebalthp_vanguard"
}
})
mod:modify_talent(career, 1, 2, {
name = "reaper_name",
description = "reaper_desc",
buffs = {
"rebalthp_reaper"
},
description_values = {
{
value = BuffTemplates.rebalthp_reaper.buffs[1].max_targets
}
},
})
mod:modify_talent(career, 1, 3, {
name = "regrowth_name",
description = "rebalthp_regrowth_desc",
buffs = {
"rebalthp_regrowth"
},
description_values = {},
})
end
for i=1, #talent_first_row[3] do
local career = talent_first_row[3][i]
mod:modify_talent(career, 1, 1, {
name = "reaper_name",
description = "reaper_desc",
buffs = {
"rebalthp_reaper"
},
description_values = {
{
value = BuffTemplates.rebalthp_reaper.buffs[1].max_targets
}
},
})
mod:modify_talent(career, 1, 2, {
name = "bloodlust_name",
description = "bloodlust_desc_3",
buffs = {
"rebalthp_bloodlust"
}
})
mod:modify_talent(career, 1, 3, {
name = "regrowth_name",
description = "rebalthp_regrowth_desc",
buffs = {
"rebalthp_regrowth"
},
description_values = {},
})
end
local talent_third_row = {
{
"es_mercenary",
"es_huntsman",
"dr_ranger",
"dr_slayer",
"we_waywatcher",
"we_shade",
"we_thornsister",
"wh_captain",
"wh_bountyhunter",
"wh_zealot",
"bw_scholar",
},
{
"es_knight",
"es_questingknight",
"dr_ironbreaker",
"dr_engineer",
"we_maidenguard",
"bw_adept",
"bw_unchained",
},
}
for i=1, #talent_third_row[1] do
local career = talent_third_row[1][i]
mod:modify_talent(career, 3, 1, {
name = "smiter_name",
description = "smiter_unbalance_desc",
buffs = {
"rebalthp_smiter_unbalance"
},
description_values = {
{
value_type = "percent",
value = BuffTemplates.rebalthp_smiter_unbalance.buffs[1].display_multiplier
},
{
value_type = "percent",
value = BuffTemplates.rebalthp_smiter_unbalance.buffs[1].max_display_multiplier
}
}
})
mod:modify_talent(career, 3, 2, {
name = "assassin_name",
description = "rebalthp_finesse_unbalance_desc",
buffs = {
"rebalthp_finesse_unbalance"
},
description_values = {
{
value_type = "percent",
value = BuffTemplates.rebalthp_tank_unbalance.buffs[1].display_multiplier
},
{
value_type = "percent",
value = BuffTemplates.rebalthp_tank_unbalance.buffs[1].max_display_multiplier
}
}
})
mod:modify_talent(career, 3, 3, {
name = "enhanced_power_name",
description = "power_level_unbalance_desc",
buffs = {
"rebalthp_power_level_unbalance"
},
description_values = {
{
value_type = "percent",
value = BuffTemplates.rebalthp_power_level_unbalance.buffs[1].multiplier
}
}
})
end
for i=1, #talent_third_row[2] do
local career = talent_third_row[2][i]
mod:modify_talent(career, 3, 1, {
name = "smiter_name",
description = "smiter_unbalance_desc",
buffs = {
"rebalthp_smiter_unbalance"
},
description_values = {
{
value_type = "percent",
value = BuffTemplates.rebalthp_smiter_unbalance.buffs[1].display_multiplier
},
{
value_type = "percent",
value = BuffTemplates.rebalthp_smiter_unbalance.buffs[1].max_display_multiplier
}
}
})
mod:modify_talent(career, 3, 2, {
name = "bulwark_name",
description = "rebalthp_tank_unbalance_desc",
buffs = {
"rebalthp_tank_unbalance"
},
description_values = {},
})
mod:modify_talent(career, 3, 3, {
name = "enhanced_power_name",
description = "power_level_unbalance_desc",
buffs = {
"rebalthp_power_level_unbalance"
},
description_values = {
{
value_type = "percent",
value = BuffTemplates.rebalthp_power_level_unbalance.buffs[1].multiplier
}
}
})
end
|
return {'cilinder','cilinderblok','cilinderbureau','cilinderhorloge','cilinderinhoud','cilinderoppervlak','cilinderslot','cilindersymmetrie','cilindervormig','cilindrisch','cilinderwand','cilinderglas','cilindervlak','cilinderkop','cilindervorm','cilia','cillekens','cillessen','cilinderbureaus','cilindercoordinaten','cilinderkoppen','cilinders','cilindervormige','cilindrische','cilinderblokken','cilinderhorloges','cilindersloten','cilinderwanden','cilinderglazen','cilindervlakken','cilias'}
|
--[[
G codes accept certain addresses as parameters, by convention in the order that follows. I have only included the addresses that this program makes use of, but extras are easily handled simply by adding them to this table.
Typically X, Y, and Z are destination coordinates. I, J, and rarely K are typically intermediate coordinates of some kind (e.g. arc centre). P may be one of many code-specific parameters. F is always feed rate, may be in distance per minute or distance per spindle revolution.
]]
address_list = {"x", "y", "z", "i", "j", "p", "f"}
--[[
specify a linear distance for ramping in/out of cuts, and a radius for the circle, and converts it to an angular distance
]]
function ramp_coords(distance, radius)
local dia = 2*radius
local arcangle = distance/(math.pi * dia) * 360
return angle_coords(arcangle, radius)
end
--need to know cut depth for ramping...
function circle(radius, clockwise)
return arc(360, radius, clockwise)
end
function arc(angle, radius, clockwise)
local code = clockwise and "G02" or "G03"
local alpha = {}
alpha.x, alpha.y = angle_coords(angle, radius)
return code_format(code, "x", alpha.x, "y", alpha.y, "r", radius)
end
function code_format(...)
local block = ""
for i, v in ipairs{...} do
if type(v) == "string" then
block = block..string.upper(v)
elseif type(v) == "number" then
block = block..string.format("%.4f", v).." "
end
if i == 1 then
block = block.." "
end
end
return block
end
function ramp_arc(ramp_dist, angle, radius, clockwise, z)
local code = clockwise and "G02" or "G03"
local ramp = {}
local alpha = {}
ramp.x, ramp.y = ramp_coords(ramp_dist, radius)
alpha.x, alpha.y = angle_coords(angle, radius)
return string.format("%s %s %s %s\n%s %s %s",
code, truncate("X", ramp.x), truncate("Y", ramp.y), truncate("Z", z),
code, truncate("X", alpha.x), truncate("Y", alpha.y))
end
--[[
angle in degrees, radius of arc
]]
function angle_coords(angle, radius)
local x = math.cos(math.rad(angle)) * radius
local y = math.sin(math.rad(angle)) * radius
return x, y
end
--[[
Usage: print_code{code="G00", X=-42, Y=-21, P=1}
or print_code{code={"g95", "g01"} x=10, y=20}
code is necessary, other parameters are optional. See address_list for full parameters
]]
function print_code(args)
local block = ""
if type(args.code) == "table" then
for i, item in ipairs(args.code) do
if i > 1 then
block = block.." "
end
block = block..string.upper(item)
end
else
block = block..string.upper(args.code)
end
for i, v in ipairs(address_list) do
if args[v] then
block = block..truncate(v, args[v])
end
end
return block.."\n"
end
--machine only works with up to 4 decimal places
--upcases all letters for stylistic convention
function truncate(address, value)
return string.format(" "..string.upper(address).."%.4f", value)
end
|
local PSBT = PSBT
local ModuleProto = PSBT.ModuleProto
local PSBT_Cooldowns = ModuleProto:Subclass()
local CBM = CALLBACK_MANAGER
local PSBT_EVENTS = PSBT.EVENTS
local PSBT_MODULES = PSBT.MODULES
local kVerison = 1.0
function PSBT_Cooldowns:Initialize( ... )
ModuleProto.Initialize( self, ... )
self:RegisterForEvent( EVENT_ABILITY_COOLDOWN_UPDATED, 'OnAbilityCooldownUpdated' )
self:RegisterForEvent( EVENT_ACTION_UPDATE_COOLDOWNS, 'OnActionCooldownUpdate' )
end
function PSBT_Cooldowns:Shutdown()
self:UnregisterForEvent( EVENT_ABILITY_COOLDOWN_UPDATED, 'OnAbilityCooldownUpdated' )
self:UnregisterForEvent( EVENT_ACTION_UPDATE_COOLDOWNS, 'OnActionCooldownUpdate' )
ModuleProto.Shutdown( self )
end
function PSBT_Cooldowns:OnAbilityCooldownUpdated( abilityId )
end
function PSBT_Cooldowns:OnActionCooldownUpdate()
end
CBM:RegisterCallback( PSBT_EVENTS.LOADED,
function( psbt )
psbt:RegisterModule( PSBT_MODULES.COOLDOWNS, PSBT_Cooldowns, kVerison )
end )
|
function addRobot(x,y)
local r = {}
r.x = x
r.y = y
r.dx = math.random(20) + 5
r.dy = math.random(20)
table.insert(robots, r)
return r
end
function updateRobot(r)
r.x = r.x + r.dx
r.y = r.y + r.dy
r.dx = r.dx - 1
r.dy = r.dy - 1
if r.dx < 0 then r.dx = 0 end
if r.dy < 0 then r.dy = 0 end
end
function renderRobot(r)
colorGL(255,255,255,255)
local h = 20
local s = 10
drawLine(r.x - s, h, r.y,
r.x + s, h, r.y)
drawLine(r.x , h, r.y - s,
r.x , h, r.y + s)
end
function initRobots()
robots = {}
for i=1,150,1 do
addRobot(0,0)
--addRobot(math.random(20),math.random(20))
end
end
-- should add this as a widget
initRobots()
robotWidget = {}
function robotWidget.render()
for i=1,#robots,1 do
renderRobot(robots[i])
end
end
function robotWidget.update()
for i=1,#robots,1 do
updateRobot(robots[i])
end
end
WidgetLib.addExisting(robotWidget)
function moveRobotWidget()
--robotWidget.lspace = transform.new()
transform.setTranslation(robotWidget.lspace, -100,0,-200)
transform.lookAt(robotWidget.lspace, 0,100,0)
end
|
local beautiful = require("beautiful")
local wibox = require("wibox")
local spawn = require("awful.spawn")
local volume = {}
local volume_icon_name = "audio-volume-high-symbolic"
local function parse_output(stdout)
local level = string.match(stdout, "(%d?%d?%d)%%")
if stdout:find("%[off%]") then
volume_icon_name = "audio-volume-muted-symbolic"
return "OFF"
end
level = tonumber(string.format("% 3d", level))
if (level >= 0 and level < 25) then
volume_icon_name = "audio-volume-off-symbolic"
elseif (level < 50) then
volume_icon_name = "audio-volume-low-symbolic"
elseif (level < 75) then
volume_icon_name = "audio-volume-medium-symbolic"
else
volume_icon_name = "audio-volume-high-symbolic"
end
return level.."%"
end
local function exec_cmd_and_update(cmd)
spawn.easy_async(cmd, function(stdout)
local txt = parse_output(stdout)
volume.image.image = volume.path_to_icons .. volume_icon_name .. ".svg"
volume.text:set_markup(string.format("<span color=%q><b>%s</b></span>", beautiful.bg_normal, txt))
end)
end
function volume.toggle()
exec_cmd_and_update('amixer ' .. volume.device .. ' sset Master toggle')
end
function volume.raise()
exec_cmd_and_update('amixer ' .. volume.device .. ' sset Master 5%+')
end
function volume.lower()
exec_cmd_and_update('amixer ' .. volume.device .. ' sset Master 5%-')
end
function volume.init(args)
args = args or {}
args.volume_audio_controller = args.volume_audio_controller or 'pulse'
volume.path_to_icons = args.path_to_icons or beautiful.theme_path .. "/widgets/volume/"
volume.device = args.volume_audio_controller == 'pulse' and '-D pulse' or ''
volume.text = wibox.widget.textbox()
volume.text:set_markup(string.format("<span color=%q><b>%s</b></span>", beautiful.bg_normal, "OFF"))
volume.image = wibox.widget{
image = volume.path_to_icons .. "audio-volume-muted-symbolic.svg",
widget = wibox.widget.imagebox,
}
exec_cmd_and_update('amixer ' .. volume.device .. ' sget Master')
volume.image:connect_signal("button::press", function(_,_,_,button)
if (button == 4) then volume.raise()
elseif (button == 5) then volume.lower()
elseif (button == 1) then volume.toggle()
end
end)
end
return volume
|
MuiStringMap = Class('MuiStringMap')
function MuiStringMap.__mt.__index:init(path)
self.path = path
self.list = false
end
function MuiStringMap.__mt.__index:getList()
if(self.list) then return self.list end
local node = xmlLoadFile(self.path)
if(not node) then return false end
self.list = {}
for i, subnode in ipairs(xmlNodeGetChildren(node)) do
local entry = {}
entry.id = xmlNodeGetAttribute(subnode, 'id')
entry.val = xmlNodeGetValue(subnode)
if(entry.id and entry.val) then
table.insert(self.list, entry)
end
end
xmlUnloadFile(node)
return self.list
end
function MuiStringMap.__mt.__index:remove(id)
local node = xmlLoadFile(self.path)
if(not node) then return false end
for i, subnode in ipairs(xmlNodeGetChildren(node)) do
local curId = xmlNodeGetAttribute(subnode, 'id')
if(curId == id) then
xmlDestroyNode(subnode)
break
end
end
xmlSaveFile(node)
xmlUnloadFile(node)
-- Invalidate cache
self.list = false
end
function MuiStringMap.__mt.__index:set(id, value)
local node = xmlLoadFile(self.path)
if(not node) then return false end
local found = false
for i, subnode in ipairs(xmlNodeGetChildren(node)) do
local curId = xmlNodeGetAttribute(subnode, 'id')
if(curId == id) then
xmlNodeSetValue(subnode, value)
found = true
break
end
end
if(not found) then
local subnode = xmlCreateChild(node, 'msg')
xmlNodeSetAttribute(subnode, 'id', id)
xmlNodeSetValue(subnode, value)
end
xmlSaveFile(node)
xmlUnloadFile(node)
-- Invalidate cache
self.list = false
end
|
function getSinCos(x, y, xt, yt)
local akat, gkat
akat = xt - x
gkat = yt - y
local hypo = math.sqrt(math.pow(gkat, 2) + math.pow(akat, 2))
local sin = gkat/hypo
local cos = akat/hypo
return sin, cos
end
function getRadian(x, y, xt, yt)
local akat, gkat
akat = xt - x
gkat = yt - y
return math.atan2(akat, -gkat)-math.pi/2
end
function getAngle(x, y, xt, yt)
return getRadian(x, y, xt, yt) * 180/math.pi
end
|
require("mineunit")
mineunit("core")
mineunit("player")
mineunit("default/functions")
sourcefile("init")
describe("mapblock_lib.get_mapblock", function()
it("returns proper coordinates", function()
local mapblock_pos = mapblock_lib.get_mapblock({ x=1, y=1, z=1 })
assert.not_nil(mapblock_pos)
assert.equals(0, mapblock_pos.x)
assert.equals(0, mapblock_pos.y)
assert.equals(0, mapblock_pos.z)
mapblock_pos = mapblock_lib.get_mapblock({ x=17, y=1, z=1 })
assert.not_nil(mapblock_pos)
assert.equals(1, mapblock_pos.x)
assert.equals(0, mapblock_pos.y)
assert.equals(0, mapblock_pos.z)
mapblock_pos = mapblock_lib.get_mapblock({ x=1, y=1, z=-15 })
assert.not_nil(mapblock_pos)
assert.equals(0, mapblock_pos.x)
assert.equals(0, mapblock_pos.y)
assert.equals(-1, mapblock_pos.z)
end)
end)
local function pos_equals(expected, actual)
assert.equals(expected.x, actual.x, "x part error, expected " .. dump(expected) .. " actual: " .. dump(actual))
assert.equals(expected.y, actual.y, "y part error, expected " .. dump(expected) .. " actual: " .. dump(actual))
assert.equals(expected.z, actual.z, "z part error, expected " .. dump(expected) .. " actual: " .. dump(actual))
end
describe("mapblock_lib.pos_iterator", function()
it("returns properly iterated coordinates", function()
local pos1 = {x=0, y=0, z=0}
local pos2 = {x=1, y=2, z=1}
local iterator = mapblock_lib.pos_iterator(pos1, pos2)
pos_equals({x=0,y=0,z=0}, iterator())
pos_equals({x=1,y=0,z=0}, iterator())
pos_equals({x=0,y=0,z=1}, iterator())
pos_equals({x=1,y=0,z=1}, iterator())
pos_equals({x=0,y=1,z=0}, iterator())
pos_equals({x=1,y=1,z=0}, iterator())
pos_equals({x=0,y=1,z=1}, iterator())
pos_equals({x=1,y=1,z=1}, iterator())
pos_equals({x=0,y=2,z=0}, iterator())
pos_equals({x=1,y=2,z=0}, iterator())
pos_equals({x=0,y=2,z=1}, iterator())
pos_equals({x=1,y=2,z=1}, iterator())
assert.is_nil(iterator())
end)
end)
|
-- title: spade
-- author: pke1029
-- desc: Realistic cel shader for a sphere.
-- script: lua
-- sorce code available at
-- https://github.com/pke1029/tic-spade
PI = 3.1415
sin = math.sin
cos = math.cos
max = math.max
min = math.min
abs = math.abs
sqrt = math.sqrt
floor = math.floor
vec3d = {
new = function(x, y, z)
local v = {x, y, z}
setmetatable(v, vec3d.mt)
return v
end,
mt = {
__add = function (u, v)
return vec3d.new(u[1]+v[1], u[2]+v[2], u[3]+v[3])
end,
__sub = function(u, v)
return vec3d.new(u[1]-v[1], u[2]-v[2], u[3]-v[3])
end,
__mul = function(k, v)
if type(k) == "table" then
return vec3d.new(k[1]*v[1], k[2]*v[2], k[3]*v[3])
else
return vec3d.new(k*v[1], k*v[2], k*v[3])
end
end,
__div = function(v, k)
if type(k) == "table" then
return vec3d.new(v[1]/k[1], v[2]/k[2], v[3]/k[3])
else
return vec3d.new(v[1]/k, v[2]/k, v[3]/k)
end
end,
__pow = function(v, k)
return vec3d.new(v[1]^k, v[2]^k, v[3]^k)
end,
__eq = function(u, v)
return u[1] == v[1] and u[2] == v[2] and u[3] == v[3]
end,
__tostring = function(v)
return "(" .. v[1] .. "," .. v[2] .. "," .. v[3] .. ")"
end,
__concat = function(s, v)
return s .. "(" .. v[1] .. "," .. v[2] .. "," .. v[3] .. ")"
end,
__index = {
rotate = function(self, pivot, c, s, su)
local v = self - pivot
local k = vec3d.dot(su, v)
local w = vec3d.cross(su, v)
local nv = 2*k*su + (c*c-s*s)*v + 2*c*w + pivot
self[1] = nv[1]
self[2] = nv[2]
self[3] = nv[3]
return self
end,
normalise = function(self)
local r = vec3d.norm(self)
self[1] = self[1] / r
self[2] = self[2] / r
self[3] = self[3] / r
return self
end
}
},
norm = function(v)
return sqrt(v[1]*v[1] + v[2]*v[2] + v[3]*v[3])
end,
dot = function(u, v)
return u[1]*v[1] + u[2]*v[2] + u[3]*v[3]
end,
cross = function(u, v)
return vec3d.new(u[2]*v[3]-v[2]*u[3], v[1]*u[3]-u[1]*v[3], u[1]*v[2]-v[1]*u[2])
end,
avg = function(u)
return (u[1] + u[2] + u[3]) / 3
end
}
mathFun = {
between = function(x, a, b)
return x >= a and x < b
end,
clamp = function(x, a, b)
if mathFun.between(x, a, b) then return x end
if x < a then return a end
if x >= b then return b end
end,
bool2int = function(a)
return a and 1 or 0
end
}
fog = {
-- 8 bit address 0x6000
-- 4 bit address 0xc000
cls = function(color)
color = color or 0
local val = color + (color << 4)
memset(0x6000, val, 8192)
end,
show = function(colorkey)
for i = 0,127 do
for j = 0,127 do
pix(j+1, i+1, peek4(0xc000+i*128+j))
end
end
end,
prtSc = function()
for i = 0,127 do
for j = 0,127 do
poke4(0xc000+j*128+i, pix(i+1,j+1))
end
end
end,
hLine = function(x, y, w, color)
if mathFun.between(y, 0, 128) then
for i = mathFun.clamp(x, 0, 128),mathFun.clamp(x+w-1, 0, 127) do
poke4(0xc000+y*128+i, color)
end
end
end,
circ = function(x, y, r, color)
local i = 0
local j = r
local d = 3 - 2 * r
while j >= i do
fog.hLine(x-i, y+j, 2*i+1, color)
fog.hLine(x-i, y-j, 2*i+1, color)
fog.hLine(x-j, y+i, 2*j+1, color)
fog.hLine(x-j, y-i, 2*j+1, color)
i = i + 1
if d > 0 then
j = j - 1
d = d + 4 * (i - j) + 2
else
d = d + 4 * i + 2
end
end
end,
}
sphere = {
elemt = {},
currRadius = 0,
create = function()
if currRadius == radius or gui.current == 1 then return end
print("Generating normal map" ,1, 1)
sphere.elemt = {}
sphere.currRadius = radius
fog.cls(0)
fog.circ(x0, y0, radius, 15)
for i = 0,127 do
for j = 0,127 do
if peek4(0xc000+i*128+j) == 15 then
table.insert(sphere.elemt, {i, j, n = sphere.getNormal(i, j)})
end
end
end
sphere.updateFlux()
end,
getNormal = function(i, j)
local x = i - x0
local y = y0 - j
local z = sqrt((radius+1)^2 - x^2 -y^2)
return vec3d.new(x, y, z):normalise()
end,
updateFlux = function()
for i,p in pairs(sphere.elemt) do
p.f = vec3d.dot(p.n, light.v)
end
end,
draw = function()
if gui.current == 1 then
circ(x0+1, y0+1, radius, 15)
gui.viewPortColor = 1
return
end
sphere.blendColor()
-- draw
for i,p in pairs(sphere.elemt) do
for j = 0,shades do
local w = 1 + cos(angleThresh*PI/180)
if p.f+1 < (2-w)*(j/shades)+w then
pix(p[1]+1, p[2]+1, j+6)
break
end
end
end
end,
blendColor = function()
-- set color
setColor(0x3fc6, baseColor)
setColor(0x3fc9, lightColor)
setColor(0x3fcc, ambientColor)
setColor(0x3fcf, 0.5 * ambientIntensity * ambientColor)
-- blend color
local obj = baseColor
local amb = ambientIntensity * ambientColor / 255
local one = vec3d.new(1, 1, 1)
for i = 0,shades do
local addr = 0x3fc0+(i+6)*3
local lgt = (i/shades) * lightIntensity * lightColor / 255
local k = amb * (one - lgt)
-- setColor(addr, obj * lgt + amb * (255 * one - obj * lgt))
-- setColor(addr, obj * (amb^2 + lgt^2) / (amb + lgt))
setColor(addr, obj * (k * amb / (lgt + k) + lgt))
end
end
}
light = {
v = vec3d.new(1, 1, 1):normalise(),
pivot = vec3d.new(0, 0, 0),
c = cos(0.01),
s = sin(0.01),
update = function()
-- mouse controls
if currMouseState[3] then
if currMouseState[1] > 130 or currMouseState[2] > 130 then return end
local dy = currMouseState[1] - prevMouseState[1]
local dx = currMouseState[2] - prevMouseState[2]
local sx = sin(dx / 70)
local sy = sin(dy / 70)
light.v:rotate(light.pivot, cos(dx / 70), sx, vec3d.new(sx, 0, 0))
light.v:rotate(light.pivot, cos(dy / 70), sy, vec3d.new(0, sy, 0))
sphere.updateFlux()
return
end
-- keyboard controls
local u = vec3d.new(light.s, 0, 0)
local v = vec3d.new(0, light.s, 0)
local a = 0
local b = 0
if key(23) then a = a - 1 end
if key(19) then a = a + 1 end
light.v:rotate(light.pivot, abs(a)*(light.c-1)+1, a*light.s, a*u)
if key(1) then b = b - 1 end
if key(4) then b = b + 1 end
light.v:rotate(light.pivot, abs(b)*(light.c-1)+1, b*light.s, b*v)
if a ~= 0 or b ~= 0 then sphere.updateFlux() end
end
}
gui = {
current = 2,
field1 = {},
field2 = {},
field3 = {},
viewPortColor = 1,
isHex = false,
draw = function()
cls(14)
-- 3d view port
rectb(0, 0, 130, 130, 14)
rect(1, 1, 128, 128, gui.viewPortColor)
rect(1, 129, 6, 6, 0)
rect(7, 129, 6, 6, 1)
rect(13, 129, 6, 6, 14)
rect(19, 129, 6, 6, 15)
rect(25, 129, 6, 6, 5)
rect(109 - 20 * mathFun.bool2int(gui.isHex), 129, 20, 6, 5)
print("hex", 90, 130)
print("dec", 110, 130)
gui.updateField()
gui.drawWin(0, 0, 2, "SPHERE", gui.field1)
gui.drawWin(0, 38, 3, "LIGHT", gui.field2)
gui.drawWin(0, 90, 4, "AMBIENT", gui.field3)
-- foot
rect(130, 129, 109, 7, 15)
spr(16, 130, 128, 0)
print("SPADE", 137, 130, 0)
print("@pke1029", 192, 130, 0)
-- print(buttonState[1], 0, 130, 15)
-- print(buttonState[2], 30, 130, 15)
end,
drawWin = function(x0, y0, col, header, field)
local size = 7
local x = x0 + 129
local y = y0
local w = 111
local h = (#field + 1) * size + 1
local isDark = mathFun.bool2int(vec3d.avg(getColor(0x3fc0+col*3)) < 127)
rect(x, y, w, h + 2, col) -- background
rectb(x, y, w, h + 3, 14) -- border
rect(x, y, 54, 9, 14) -- heading
print(header, x + 2, y + 2)
-- Dont stare at me! B...baka!!!!!!!!!!!!!!!!! >///<
for i,v in pairs(field) do
local width = print(v[1], 0, -6)
print(v[1], x + 50 - width, y + (i)*size + 3, 16 - isDark)
local s = string.format(v[3], v[2])
width = print(s, 0, -6)
if gui.current == v[4] then
rect(x + 61, y + i*size + 2, 42, 7, 0) -- selected box
-- rectb(x + 61, y + i*size + 2, 42, 7, 14) -- selected box
rect(x + 54, y + i*size + 2, 7, 7, 14) -- left arrow
rect(x + 103, y + i*size + 2, 7, 7, 14) -- right arrow
print("< >", x + 57, y + i*size + 3, 15)
print(s, x + 82 - width/2, y + i*size + 3, 15)
else
print("< >", x + 57, y + i*size + 3, 16 - isDark)
print(s, x + 82 - width/2, y + i*size + 3, 16 - isDark)
end
end
end,
load = function()
gui.field1 = {
{"radius", radius, "%i", 1},
{"r", baseColor[1], "%i", 2},
{"g", baseColor[2], "%i", 3},
{"b", baseColor[3], "%i", 4}
}
gui.field2 = {
{"intensity", lightIntensity, "%.3f", 5},
{"r", lightColor[1], "%i", 6},
{"g", lightColor[2], "%i", 7},
{"b", lightColor[3], "%i", 8},
{"shades", shades+1, "%i", 9},
{"angle", angleThresh, "%i", 10}
}
gui.field3 = {
{"intensity", ambientIntensity, "%.3f", 11},
{"r", ambientColor[1], "%i", 12},
{"g", ambientColor[2], "%i", 13},
{"b", ambientColor[3], "%i", 14}
}
end,
updateField = function()
gui.field1[1][2] = radius
gui.field1[2][2] = baseColor[1]
gui.field1[3][2] = baseColor[2]
gui.field1[4][2] = baseColor[3]
gui.field2[1][2] = lightIntensity
gui.field2[2][2] = lightColor[1]
gui.field2[3][2] = lightColor[2]
gui.field2[4][2] = lightColor[3]
gui.field2[5][2] = shades + 1
gui.field2[6][2] = angleThresh
gui.field3[1][2] = ambientIntensity
gui.field3[2][2] = ambientColor[1]
gui.field3[3][2] = ambientColor[2]
gui.field3[4][2] = ambientColor[3]
local s = "%i"
if gui.isHex then s = "%x" end
gui.field1[2][3] = s
gui.field1[3][3] = s
gui.field1[4][3] = s
gui.field2[2][3] = s
gui.field2[3][3] = s
gui.field2[4][3] = s
gui.field3[2][3] = s
gui.field3[3][3] = s
gui.field3[4][3] = s
end,
update = function()
if btnp(0) then gui.current = mathFun.clamp(gui.current - 1, 1, #var) end
if btnp(1) then gui.current = mathFun.clamp(gui.current + 1, 1, #var) end
local v = var[gui.current]
if buttonState[1] then
var[gui.current][1] = mathFun.clamp(v[1] - v[2], v[3], v[4])
end
if buttonState[2] then
var[gui.current][1] = mathFun.clamp(v[1] + v[2], v[3], v[4])
end
if currMouseState[4] then
if mathFun.between(currMouseState[2], 129, 136) then
local x = currMouseState[1]
if mathFun.between(x, 1, 7) then gui.viewPortColor = 0
elseif mathFun.between(x, 7, 13) then gui.viewPortColor = 1
elseif mathFun.between(x, 13, 19) then gui.viewPortColor = 14
elseif mathFun.between(x, 19, 25) then gui.viewPortColor = 15
elseif mathFun.between(x, 25, 31) then gui.viewPortColor = 5
elseif mathFun.between(x, 109, 129) then gui.isHex = false
elseif mathFun.between(x, 89, 109) then gui.isHex = true
end
end
end
if mathFun.between(currMouseState[1], 183, 239) then
local y = currMouseState[2]
local btnYPos = {9, 16, 23, 30, 47, 54, 61, 68, 75, 82, 99, 106, 113, 120}
for i,v in pairs(btnYPos) do
if mathFun.between(y, v, v+7) then
gui.current = i
if buttonState[3] then
local v = var[gui.current]
if currMouseState[1] < 190 then
var[gui.current][1] = mathFun.clamp(v[1] - v[2], v[3], v[4])
elseif currMouseState[1] > 231 then
var[gui.current][1] = mathFun.clamp(v[1] + v[2], v[3], v[4])
end
end
return
end
end
end
end
}
function setColor(addr, color)
poke(addr, color[1])
poke(addr+1, color[2])
poke(addr+2, color[3])
end
function getColor(addr)
local r = peek(addr)
local g = peek(addr+1)
local b = peek(addr+2)
return vec3d.new(r, g, b)
end
prevMouseState = {0, 0, false, false}
currMouseState = {0, 0, false, false}
function updateMouseState()
local x, y, c = mouse()
local d = not (prevMouseState[3] or (not c or false))
prevMouseState = currMouseState
currMouseState = {x, y, c, d}
end
t = 0
buttonState = {false, false, false}
function updateButtonState()
if btn(2) or btn(3) or currMouseState[3] then
if t == 0 or (t % 2 == 0 and t > 30) then
if btn(2) then buttonState[1] = true end
if btn(3) then buttonState[2] = true end
if currMouseState[3] then buttonState[3] = true end
else
buttonState = {false, false, false}
end
t = t + 1
else
t = 0
buttonState = {false, false, false}
end
end
var = {}
function loadVar()
var = {
{radius, 1, 1, 63},
{baseColor[1], 1, 0, 255},
{baseColor[2], 1, 0, 255},
{baseColor[3], 1, 0, 255},
{lightIntensity, 0.004, 0.0, 1.0},
{lightColor[1], 1, 0, 255},
{lightColor[2], 1, 0, 255},
{lightColor[3], 1, 0, 255},
{shades, 1, 1, 7},
{angleThresh, 1, 0, 180},
{ambientIntensity, 0.004, 0.0, 1.0},
{ambientColor[1], 1, 0, 255},
{ambientColor[2], 1, 0, 255},
{ambientColor[3], 1, 0, 255}
}
end
function syncVar()
radius = var[1][1]
baseColor[1] = var[2][1]
baseColor[2] = var[3][1]
baseColor[3] = var[4][1]
lightIntensity = var[5][1]
lightColor[1] = var[6][1]
lightColor[2] = var[7][1]
lightColor[3] = var[8][1]
shades = var[9][1]
angleThresh = var[10][1]
ambientIntensity = var[11][1]
ambientColor[1] = var[12][1]
ambientColor[2] = var[13][1]
ambientColor[3] = var[14][1]
end
-- parameters -------------------------------------------------------
x0 = 64
y0 = 64
radius = 31
baseColor = vec3d.new(0xb6, 0xff, 0xea)
lightIntensity = 1.0
lightColor = vec3d.new(255, 255, 255)
shades = 4
angleThresh = 90
ambientIntensity = 1.0
ambientColor = vec3d.new(0, 0, 50)
---------------------------------------------------------------------
-- system color
setColor(0x3fc0, {0x14, 0x0c, 0x1c})
setColor(0x3fc3, {0x44, 0x24, 0x34})
setColor(0x3fea, {0x75, 0x71, 0x61})
setColor(0x3fed, {0xde, 0xee, 0xd6})
loadVar()
gui:load()
sphere:create()
function TIC()
updateMouseState()
updateButtonState()
gui:update()
syncVar()
sphere:create()
light:update()
gui:draw()
sphere:draw()
end
|
--[[Author informations]]
--
SWEP.Author = "Manix84";
SWEP.Contact = "https://steamcommunity.com/id/manix84";
if (SERVER) then
AddCSLuaFile();
CreateConVar("discord_muter_dart_time", 15, FCVAR_ARCHIVE, "How long to mute the player.");
end
if CLIENT then
SWEP.PrintName = "Muter Dart";
SWEP.Slot = 6;
SWEP.ViewModelFlip = false;
SWEP.ViewModelFOV = 54;
-- Path to the icon material
SWEP.Icon = "VGUI/ttt/icon_discord_muter_dart";
SWEP.EquipMenuData = {
name = "Discord Muter Dart",
type = "Weapon",
desc = "Mute a players discord for " .. GetConVar("discord_muter_dart_time"):GetInt() .. " seconds."
};
end
if SERVER then
resource.AddFile("materials/VGUI/ttt/icon_discord_muter_dart.vmt");
end
-- Always derive from weapon_tttbase.
SWEP.Base = "weapon_tttbase";
--- Standard GMod values
SWEP.HoldType = "pistol";
SWEP.Primary.Delay = 1;
SWEP.Primary.Recoil = 0.5;
SWEP.Primary.Automatic = false;
SWEP.Primary.Damage = 0;
SWEP.Primary.Cone = 0.02;
SWEP.Primary.Ammo = "muter_dart";
SWEP.Primary.ClipSize = 5;
SWEP.Primary.ClipMax = 15; -- This isn't working, and I don't know why.
SWEP.Primary.DefaultClip = 15;
SWEP.Primary.Sound = Sound("Weapon_USP.SilencedShot");
SWEP.Primary.SoundLevel = 50;
SWEP.Primary.Force = 0;
SWEP.UseHands = true;
SWEP.ViewModel = "models/weapons/cstrike/c_pist_usp.mdl";
SWEP.WorldModel = "models/weapons/w_pist_usp_silencer.mdl";
SWEP.IronSightsPos = Vector(-5.91, -4, 2.84);
SWEP.IronSightsAng = Vector(-0.5, 0, 0);
SWEP.PrimaryAnim = ACT_VM_PRIMARYATTACK_SILENCED;
SWEP.ReloadAnim = ACT_VM_RELOAD_SILENCED;
--- TTT config values
SWEP.CanBuy = {ROLE_TRAITOR};
SWEP.Kind = WEAPON_EQUIP1;
SWEP.AutoSpawnable = false;
SWEP.InLoadoutFor = nil;
SWEP.LimitedStock = false;
SWEP.AllowDrop = true;
SWEP.IsSilent = false;
SWEP.NoSights = true;
function SWEP:Deploy()
self:SendWeaponAnim(ACT_VM_DRAW_SILENCED);
return self.BaseClass.Deploy(self);
end
function SWEP:ShootBullet(damage, recoil, num_bullets, cone)
local owner = self:GetOwner();
local muteTime = GetConVar("discord_muter_dart_time"):GetInt();
local dart = {};
dart.Num = num_bullets;
dart.Src = owner:GetShootPos();
dart.Dir = owner:GetAimVector();
dart.Spread = Vector(cone, cone, 0);
dart.Tracer = 0;
dart.Force = 0;
dart.Damage = damage;
dart.Callback = function(_attacker, trace)
local victim = trace.Entity;
if SERVER and victim:IsPlayer() then
victim:PrintMessage(HUD_PRINTCENTER, "Shhhh...");
hook.Run("MutePlayer", victim, muteTime);
owner:PrintMessage(HUD_PRINTTALK, "[Discord Muter Dart] " .. victim:GetName() .. " is Muted for " .. muteTime .. " seconds.");
end
end;
self:SendWeaponAnim(self.PrimaryAnim);
owner:SetAnimation(PLAYER_ATTACK1);
owner:FireBullets(dart);
end
|
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:26' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC.
****************************************************************************
]]
ZO_HELP_NAVIGATION_CONTAINER_WIDTH = 365
-- 55 is the inset from the left side of the header to the left side of the text in ZO_IconHeader, 16 is the offset for the Scroll from ZO_ScrollContainerBase
ZO_HELP_NAVIGATION_CATEGORY_LABEL_WIDTH = ZO_HELP_NAVIGATION_CONTAINER_WIDTH - 55 - 16
ZO_Help_Keyboard = ZO_Object:Subclass()
function ZO_Help_Keyboard:New(...)
local help = ZO_Object.New(self)
help:Initialize(...)
return help
end
function ZO_Help_Keyboard:Initialize(control)
self.control = control
control.owner = self
self.helpControls = {}
self.noMatchMessage = control:GetNamedChild("NoMatchMessage")
self.searchBox = control:GetNamedChild("SearchBox")
self.detailsScrollChild = control:GetNamedChild("DetailsContainerScrollChild")
self.helpTitle = control:GetNamedChild("DetailsTitle")
self.helpBody = control:GetNamedChild("DetailsBody1")
self.helpImage = control:GetNamedChild("DetailsImage")
self.helpBody2 = control:GetNamedChild("DetailsBody2")
self.helpTitle:SetParent(self.detailsScrollChild)
self.helpTitle:SetAnchor(TOPLEFT, nil, TOPLEFT, 10, 0)
self.helpBody:SetParent(self.detailsScrollChild)
self.helpImage:SetParent(self.detailsScrollChild)
self.helpBody2:SetParent(self.detailsScrollChild)
self.noMatchMessage:SetParent(self.detailsScrollChild)
self.noMatchMessage:SetAnchor(TOPLEFT, nil, TOPLEFT, 10, 0)
self:InitializeTree()
self.systemFilters = nil
local function UpdateHelp()
if control:IsHidden() then
self.dirty = true
else
self:Refresh()
end
end
control:RegisterForEvent(EVENT_HELP_INITIALIZED, UpdateHelp)
HELP_MANAGER:RegisterCallback("UpdateSearchResults", UpdateHelp)
LINK_HANDLER:RegisterCallback(LINK_HANDLER.LINK_CLICKED_EVENT, self.OnLinkClicked, self)
LINK_HANDLER:RegisterCallback(LINK_HANDLER.LINK_MOUSE_UP_EVENT, self.OnLinkClicked, self)
UpdateHelp()
HELP_TUTORIALS_FRAGMENT = ZO_FadeSceneFragment:New(control)
HELP_TUTORIALS_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
if newState == SCENE_FRAGMENT_SHOWING then
self:OnShowing()
elseif newState == SCENE_FRAGMENT_HIDDEN then
self:OnHidden()
end
end)
self:InitializeKeybindStripDescriptors()
end
function ZO_Help_Keyboard:InitializeKeybindStripDescriptors()
self.keybindStripDescriptor =
{
alignment = KEYBIND_STRIP_ALIGN_CENTER,
{
name = GetString(SI_ITEM_ACTION_LINK_TO_CHAT),
keybind = "UI_SHORTCUT_SECONDARY",
callback = function()
local selectedData = self.navigationTree:GetSelectedData()
local link = ZO_LinkHandler_CreateChatLink(GetHelpLink, selectedData.helpCategoryIndex, selectedData.helpIndex)
ZO_LinkHandler_InsertLink(link)
end,
visible = function()
local selectedData = self.navigationTree:GetSelectedData()
if selectedData and selectedData.helpCategoryIndex and selectedData.helpIndex then
return IsChatSystemAvailableForCurrentPlatform()
end
return false
end,
},
}
end
function ZO_Help_Keyboard:ShowSpecificHelp(helpCategoryIndex, helpIndex)
if SCENE_MANAGER:IsShowing("helpTutorials") then
self:SelectHelp(helpCategoryIndex, helpIndex)
else
self.showHelpCategoryIndex = helpCategoryIndex
self.showHelpIndex = helpIndex
MAIN_MENU_KEYBOARD:ShowScene("helpTutorials")
end
end
function ZO_Help_Keyboard:OnShowing()
local systemFilters = HELP_MANAGER:GetShowingOverlaySceneSystemFilters()
if systemFilters ~= self.systemFilters then
self.systemFilters = systemFilters
self.dirty = true
end
if self.dirty then
self:Refresh()
end
if self.showHelpCategoryIndex then
self:SelectHelp(self.showHelpCategoryIndex, self.showHelpIndex)
self.showHelpCategoryIndex = nil
self.showHelpIndex = nil
end
KEYBIND_STRIP:AddKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_Help_Keyboard:OnHidden()
if self.searchBox:GetText() ~= "" then
self.searchBox:SetText("")
end
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_Help_Keyboard:InitializeTree()
self.navigationTree = ZO_Tree:New(GetControl(self.control, "NavigationContainerScrollChild"), 60, -10, 350)
local function TreeHeaderSetup(node, control, data, open)
control.text:SetText(data.name)
control.icon:SetTexture(open and data.downIcon or data.upIcon)
control.iconHighlight:SetTexture(data.overIcon)
ZO_IconHeader_Setup(control, open)
end
local function TreeHeaderEquality(left, right)
return left.helpCategoryIndex == right.helpCategoryIndex
end
self.navigationTree:AddTemplate("ZO_Help_Header", TreeHeaderSetup, nil, TreeHeaderEquality, nil, 0)
local function TreeEntrySetup(node, control, data, open)
control:SetSelected(false)
control:SetText(data.name)
end
local function TreeEntryOnSelected(control, data, selected, reselectingDuringRebuild)
control:SetSelected(selected)
if selected and not reselectingDuringRebuild then
self:RefreshDetails()
end
end
local function TreeEntryEquality(left, right)
return left.helpCategoryIndex == right.helpCategoryIndex and left.helpIndex == right.helpIndex
end
self.navigationTree:AddTemplate("ZO_Help_NavigationEntry", TreeEntrySetup, TreeEntryOnSelected, TreeEntryEquality)
self.navigationTree:SetExclusive(true)
self.navigationTree:SetOpenAnimation("ZO_TreeOpenAnimation")
end
function ZO_Help_Keyboard:SelectHelp(helpCategoryIndex, helpIndex)
if self.helpControls and self.helpControls[helpCategoryIndex] then
local helpControl = self.helpControls[helpCategoryIndex][helpIndex]
if helpControl then
helpControl.node:GetTree():SelectNode(helpControl.node)
end
end
end
function ZO_Help_Keyboard:AddHelpEntry(helpCategoryIndex, helpIndex)
local systemFilters = self.systemFilters
if systemFilters and #systemFilters > 0 then
if not ZO_IsElementInNumericallyIndexedTable(systemFilters, GetUISystemAssociatedWithHelpEntry(helpCategoryIndex, helpIndex)) then
return
end
end
local parent
if not self.categoryControls[helpCategoryIndex] then
self.helpControls[helpCategoryIndex] = {}
local categoryName, _, upIcon, downIcon, overIcon = GetHelpCategoryInfo(helpCategoryIndex)
if categoryName ~= "" then
local categoryData = {
name = categoryName,
upIcon = upIcon,
downIcon = downIcon,
overIcon = overIcon,
helpCategoryIndex = helpCategoryIndex,
}
parent = self.navigationTree:AddNode("ZO_Help_Header", categoryData)
self.categoryControls[helpCategoryIndex] = parent
end
else
parent = self.categoryControls[helpCategoryIndex]
end
if parent then
local helpName, _,_,_,_,_, showOption = GetHelpInfo(helpCategoryIndex, helpIndex)
if IsKeyboardHelpOption(showOption) then
local helpData = {
name = helpName,
helpCategoryIndex = helpCategoryIndex,
helpIndex = helpIndex,
}
local helpNode = self.navigationTree:AddNode("ZO_Help_NavigationEntry", helpData, parent)
self.helpControls[helpCategoryIndex][helpIndex] = helpNode.control
self.activeHelpCount = self.activeHelpCount + 1
end
end
end
function ZO_Help_Keyboard:AddTrialEntry()
local systemFilters = HELP_MANAGER:GetShowingOverlaySceneSystemFilters()
if systemFilters and #systemFilters > 0 then
return
end
local accountTypeId, title, description = GetTrialInfo();
if accountTypeId ~= 0 and title ~= "" and description ~= "" then
local parent
self.trialIndex = GetNumHelpCategories() + 1
self.trialDescription = description
if not self.categoryControls[self.trialIndex] then
self.helpControls[self.trialIndex] = {}
local categoryData = {
name = GetString(SI_TRIAL_ACCOUNT_HELP_CATEGORY),
upIcon = "EsoUI/Art/Help/help_tabIcon_trial_up.dds",
downIcon = "EsoUI/Art/Help/help_tabIcon_trial_down.dds",
overIcon = "EsoUI/Art/Help/help_tabIcon_trial_over.dds",
helpCategoryIndex = self.trialIndex,
}
parent = self.navigationTree:AddNode("ZO_Help_Header", categoryData)
self.categoryControls[self.trialIndex] = parent
else
parent = self.categoryControls[self.trialIndex]
end
if parent then
local helpData = {
name = title,
helpCategoryIndex = self.trialIndex,
helpIndex = 1,
}
local helpNode = self.navigationTree:AddNode("ZO_Help_NavigationEntry", helpData, parent)
self.helpControls[self.trialIndex][1] = helpNode.control
self.activeHelpCount = self.activeHelpCount + 1
end
end
end
function ZO_Help_Keyboard:RefreshList()
self.navigationTree:Reset()
self.helpControls = {}
self.categoryControls = {}
self.activeHelpCount = 0
self.trialIndex = nil
self.trialDescription = nil
local searchResults = HELP_MANAGER:GetSearchResults()
if searchResults then
for _, result in ipairs(searchResults) do
self:AddHelpEntry(result.helpCategoryIndex, result.helpIndex)
end
else
self:AddTrialEntry()
for helpCategoryIndex = 1, GetNumHelpCategories() do
for helpIndex = 1, GetNumHelpEntriesWithinCategory(helpCategoryIndex) do
self:AddHelpEntry(helpCategoryIndex, helpIndex)
end
end
end
self.noMatchMessage:SetHidden(self.activeHelpCount > 0)
self.navigationTree:Commit()
self:RefreshDetails()
end
function ZO_Help_Keyboard:Refresh()
self.dirty = false
self:RefreshList()
end
function ZO_Help_Keyboard:RefreshDetails()
local selectedData = self.navigationTree:GetSelectedData()
if selectedData and selectedData.helpCategoryIndex and selectedData.helpIndex then
local _, name, description, description2, image, showOption
if selectedData.helpCategoryIndex == self.trialIndex then
_, name, description = GetTrialInfo()
else
name, description, description2, image, _, _, showOption = GetHelpInfo(selectedData.helpCategoryIndex, selectedData.helpIndex)
end
if IsKeyboardHelpOption(showOption) then
self.helpTitle:SetHidden(false)
self.helpTitle:SetText(name)
self.helpBody:SetHidden(false)
self.helpBody:SetText(description)
self.helpBody2:SetHidden(false)
self.helpBody2:SetText(description2)
if image then
self.helpImage:SetHidden(false)
self.helpImage:SetTexture(image)
else
self.helpImage:SetHidden(true)
self.helpImage:SetHeight(0)
end
else
self.helpTitle:SetHidden(true)
self.helpBody:SetHidden(true)
self.helpBody2:SetHidden(true)
self.helpImage:SetHidden(true)
end
else
self.helpTitle:SetHidden(true)
self.helpBody:SetHidden(true)
self.helpBody2:SetHidden(true)
self.helpImage:SetHidden(true)
end
end
function ZO_Help_Keyboard:OnLinkClicked(link, button, text, color, linkType, ...)
if linkType == HELP_LINK_TYPE and button == MOUSE_BUTTON_INDEX_LEFT then
local helpCategoryIndex, helpIndex = GetHelpIndicesFromHelpLink(link)
if helpCategoryIndex and helpIndex then
self:ShowSpecificHelp(helpCategoryIndex, helpIndex)
end
return true
end
end
-- Global XML functions
function ZO_Help_OnSearchTextChanged(editBox)
HELP_MANAGER:SetSearchString(editBox:GetText())
end
function ZO_Help_OnSearchEnterKeyPressed(editBox)
HELP_MANAGER:SetSearchString(editBox:GetText())
editBox:LoseFocus()
end
local HELP_MAX_IMAGE_WIDTH = 490
function ZO_Tutorials_Entries_OnTextureLoaded(control)
-- when hidden we directly manipulate the height, so don't apply constraints in those cases
if not control:IsHidden() then
ZO_ResizeTextureWidthAndMaintainAspectRatio(control, HELP_MAX_IMAGE_WIDTH)
end
end
function ZO_Help_Initialize(control)
HELP = ZO_Help_Keyboard:New(control)
end
|
local config = {}
local confighandler = require(engine.path .. 'utils.LIP')
function config.load(file)
local data = confighandler.load(file)
return data
end
function config.save(name, tbl)
confighandler.save(name, tbl)
end
return config
|
-- ---------------------------------- --
-- ------------ Deadline ------------ --
-- ------ by: SKPG, Tasty Kiwi ------ --
-- ---------------------------------- --
-- import helpers
local player_helper = require("/dynamic/helpers/player_helpers.lua")
local color_helper = require("/dynamic/helpers/color_helpers.lua")
local disappearing_message = require("/dynamic/helpers/disappearing_message.lua")
local angle_helper = require("/dynamic/helpers/angle_helpers.lua")
-- prep stuff
local height = 500fx
local width = 1000fx
pewpew.set_level_size(width, height)
-- make bg
local background_outline = pewpew.new_customizable_entity(500fx, 250fx)
pewpew.customizable_entity_set_mesh(background_outline, "/dynamic/assets/bg_outline_mesh.lua", 0)
-- make text
local background_text = pewpew.new_customizable_entity(width / 2fx, (height / 2fx) + 200fx)
pewpew.customizable_entity_set_string(background_text, color_helper.color_to_string(color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 255)) .. "Hurry up!")
pewpew.customizable_entity_set_mesh_scale(background_text, 1fx)
pewpew.customizable_entity_set_mesh_color(background_text, color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 255))
local background_text2 = pewpew.new_customizable_entity(width / 2fx, (height / 2fx) + 150fx)
pewpew.customizable_entity_set_string(background_text2, color_helper.color_to_string(color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 255)) .. "Kill all of the enemies before the timer runs out!")
pewpew.customizable_entity_set_mesh_scale(background_text2, 8fx / 12fx)
pewpew.customizable_entity_set_mesh_color(background_text2, color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 255))
local background_text3 = pewpew.new_customizable_entity(width / 2fx, (height / 2fx) - 225fx)
local credit_color = color_helper.color_to_string(color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 51))
pewpew.customizable_entity_set_string(background_text3, credit_color .. "Special thanks to #0000fb33SKPG-Tech" .. credit_color .. " for creating original Deadline!")
pewpew.customizable_entity_set_mesh_scale(background_text3, 5fx / 10fx)
pewpew.customizable_entity_set_mesh_color(background_text3, color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 51))
-- prep player
local weapon_config = {frequency = pewpew.CannonFrequency.FREQ_10, cannon = pewpew.CannonType.TIC_TOC}
local player = player_helper.new_player_ship(width / 2fx, height / 2fx, 0)
pewpew.configure_player(0, {camera_distance = 0fx, shield = 15})
pewpew.configure_player_ship_weapon(player, weapon_config)
-- add timer
local timer_text = pewpew.new_customizable_entity(width / 2fx, height / 2fx)
pewpew.customizable_entity_set_mesh_scale(timer_text, 30fx/15fx)
-- bounce for those spawning nests
function make_bounce(player_id, bouncer_id, speed)
local px, py = pewpew.entity_get_position(player_id)
local bx, by = pewpew.entity_get_position(bouncer_id)
local ax = px - bx
local ay = py - by
local angle = fmath.atan2(ay, ax)
local dx, dy = fmath.sincos(angle)
dx = dx * speed
dy = dy * speed
pewpew.entity_set_position(player_id, px + dx, py + dy)
end
-- make spawning nests
local spawnpoint1 = pewpew.new_customizable_entity((width / 2fx) - 350fx, height / 2fx)
pewpew.customizable_entity_set_mesh(spawnpoint1, "/dynamic/assets/nest_mesh.lua", 0)
pewpew.customizable_entity_set_mesh_color(spawnpoint1, color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 255))
pewpew.customizable_entity_configure_music_response(spawnpoint1, {scale_x_start = 1fx, scale_x_end = 6fx / 5fx, scale_y_start = 1fx, scale_y_end = 6fx / 5fx, color_start = 0xffffff88, color_end = 0xffffffff})
pewpew.entity_set_radius(spawnpoint1, 50fx)
pewpew.customizable_entity_set_player_collision_callback(spawnpoint1, function(entity_id, player_index, ship_entity_id)
make_bounce(ship_entity_id, spawnpoint1, 4.2048fx)
end)
local spawnpoint2 = pewpew.new_customizable_entity((width / 2fx) + 350fx, height / 2fx)
pewpew.customizable_entity_set_mesh(spawnpoint2, "/dynamic/assets/nest_mesh.lua", 0)
pewpew.customizable_entity_set_mesh_color(spawnpoint2, color_helper.make_color(fmath.random_int(0, 255), fmath.random_int(0, 255), fmath.random_int(0, 255), 255))
pewpew.customizable_entity_configure_music_response(spawnpoint2, {scale_x_start = 1fx, scale_x_end = 6fx / 5fx, scale_y_start = 1fx, scale_y_end = 6fx / 5fx, color_start = 0xffffff88, color_end = 0xffffffff})
pewpew.entity_set_radius(spawnpoint2, 50fx)
pewpew.customizable_entity_set_player_collision_callback(spawnpoint2, function(entity_id, player_index, ship_entity_id)
make_bounce(ship_entity_id, spawnpoint2, 4.2048fx)
end)
local entity_table = {}
local difficulty = 5
function spawn_wary()
for i = 1, difficulty - 3 do
table.insert(entity_table, pewpew.new_wary((width / 2fx) - 350fx, height / 2fx))
end
for i = 1, difficulty - 3 do
table.insert(entity_table, pewpew.new_wary((width / 2fx) + 350fx, height / 2fx))
end
end
function spawn_rolling_cube()
for i = 1, difficulty do
table.insert(entity_table, pewpew.new_rolling_cube((width / 2fx) - 350fx, height / 2fx))
end
for i = 1, difficulty do
table.insert(entity_table, pewpew.new_rolling_cube((width / 2fx) + 350fx, height / 2fx))
end
end
function spawn_asteroid()
for i = 1, difficulty - 4 do
table.insert(entity_table, pewpew.new_asteroid((width / 2fx) - 350fx, height / 2fx))
end
for i = 1, difficulty - 4 do
table.insert(entity_table, pewpew.new_asteroid((width / 2fx) + 350fx, height / 2fx))
end
end
function spawn_mothership()
for i = 1, difficulty - 2 do
table.insert(entity_table, pewpew.new_mothership((width / 2fx) - 350fx, height / 2fx, fmath.random_int(0, 4), angle_helper.random_angle()))
end
for i = 1, difficulty - 2 do
table.insert(entity_table, pewpew.new_mothership((width / 2fx) + 350fx, height / 2fx, fmath.random_int(0, 4), angle_helper.random_angle()))
end
end
function spawn_ufo()
for i = 1, difficulty - 3 do
table.insert(entity_table, pewpew.new_ufo((width / 2fx) - 350fx, height / 2fx, 5fx / 2fx))
pewpew.ufo_set_enable_collisions_with_walls(entity_table[i], true)
end
for i = difficulty - 2, (difficulty - 3) * 2 do
table.insert(entity_table, pewpew.new_ufo((width / 2fx) + 350fx, height / 2fx, 5fx / 2fx))
pewpew.ufo_set_enable_collisions_with_walls(entity_table[i], true)
end
end
function spawn_inertiac()
for i = 1, difficulty - 5 do
table.insert(entity_table, pewpew.new_inertiac((width / 2fx) - 350fx, height / 2fx, 3fx / 2fx, angle_helper.random_angle()))
end
for i = 1, difficulty - 5 do
table.insert(entity_table, pewpew.new_inertiac((width / 2fx) + 350fx, height / 2fx, 3fx / 2fx, angle_helper.random_angle()))
end
end
function spawn_crowder()
for i = 1, difficulty do
table.insert(entity_table, pewpew.new_crowder((width / 2fx) - 350fx, height / 2fx))
end
for i = 1, difficulty do
table.insert(entity_table, pewpew.new_crowder((width / 2fx) + 350fx, height / 2fx))
end
end
function spawn_baf_blue()
for i = 1, difficulty + 7 do
table.insert(entity_table, pewpew.new_baf_blue((width / 2fx) - 350fx, height / 2fx, angle_helper.random_angle(), 10fx, 900))
end
for i = 1, difficulty + 7 do
table.insert(entity_table, pewpew.new_baf_blue((width / 2fx) + 350fx, height / 2fx, angle_helper.random_angle(), 10fx, 900))
end
end
-- Too hard ._.
--[[
function spawn_baf_red()
for i = 1, difficulty + 7 do
table.insert(entity_table, pewpew.new_baf_red((width / 2fx) - 350fx, height / 2fx, angle_helper.random_angle(), 10fx, 900))
end
for i = 1, difficulty + 7 do
table.insert(entity_table, pewpew.new_baf_red((width / 2fx) + 350fx, height / 2fx, angle_helper.random_angle(), 10fx, 900))
end
end
]]
function spawn_baf()
for i = 1, difficulty + 7 do
table.insert(entity_table, pewpew.new_baf((width / 2fx) - 350fx, height / 2fx, angle_helper.random_angle(), 10fx, 900))
end
for i = 1, difficulty + 7 do
table.insert(entity_table, pewpew.new_baf((width / 2fx) + 350fx, height / 2fx, angle_helper.random_angle(), 10fx, 900))
end
end
-- variable prep
local time = 0
local second_counter_amount = 40
local second_counter = second_counter_amount
local frame_counter = 60
local round = 1
local end_game = true
pewpew.customizable_entity_set_string(timer_text, color_helper.color_to_string(0x87bab8ff) .. second_counter)
spawn_wary()
spawn_crowder()
local entity_count = #entity_table
pewpew.add_update_callback(
function()
time = time + 1
if pewpew.entity_get_is_alive(player) then
local px, py = pewpew.entity_get_position(player)
if time == 30 then
disappearing_message.new(width / 2fx, (height / 2fx) + 50fx, "Round: 1", 1fx, 0xfba7deff, 3)
end
for i = 1, #entity_table do
if not pewpew.entity_get_is_alive(entity_table[i]) then
table.remove(entity_table, i)
entity_count = entity_count - 1
table.insert(entity_table, pewpew.new_customizable_entity((width / 2fx) + 350fx, height / 2fx))
end
end
if entity_count == 0 then
disappearing_message.new(width / 2fx, (height / 2fx) - 50fx, "Score Bonus: " .. second_counter .. " *10", 1fx, 0x42dbd9ff, 2)
pewpew.increase_score_of_player(0, second_counter * 10)
round = round + 1
pewpew.configure_player_ship_weapon(player, {frequency = pewpew.CannonFrequency.FREQ_10, cannon = pewpew.CannonType.TIC_TOC})
disappearing_message.new(width / 2fx, (height / 2fx) + 50fx, "Round: " .. round, 1fx, 0xfba7deff, 3)
second_counter = second_counter_amount
if round % 7 == 0 then
-- every 7th round in series, spawn boss wave
entity_table = {}
local weapon_config = {frequency = pewpew.CannonFrequency.FREQ_30, cannon = pewpew.CannonType.FOUR_DIRECTIONS, duration = 220}
pewpew.configure_player_ship_weapon(player, weapon_config)
disappearing_message.new(width / 2fx, (height / 2fx) + 94.2048fx, "BOSS ROUND", 2fx, 0x3f8725ff, 4)
spawn_rolling_cube()
spawn_baf()
spawn_baf_blue()
spawn_mothership()
spawn_crowder()
entity_count = #entity_table
elseif round % 6 == 0 then
-- every 6th round in series, spawn inertiac wave
entity_table = {}
local weapon_config = {frequency = pewpew.CannonFrequency.FREQ_7_5, cannon = pewpew.CannonType.TRIPLE, duration = 999999}
pewpew.configure_player_ship_weapon(player, weapon_config)
spawn_inertiac()
entity_count = #entity_table
elseif round % 5 == 0 then
-- every 5th round in series, spawn UFO wave
entity_table = {}
spawn_ufo()
entity_count = #entity_table
elseif round % 4 == 0 then
-- every 4th round in series, spawn rolling cube wave
entity_table = {}
spawn_rolling_cube()
entity_count = #entity_table
elseif round % 3 == 0 then
-- every 3rd round in series, spawn asteroid wave
entity_table = {}
local weapon_config = {frequency = pewpew.CannonFrequency.FREQ_7_5, cannon = pewpew.CannonType.HEMISPHERE, duration = 120}
pewpew.configure_player_ship_weapon(player, weapon_config)
spawn_asteroid()
entity_count = #entity_table
elseif round % 2 == 0 then
-- every 2nd round in series, spawn mothership wave
entity_table = {}
spawn_mothership()
spawn_baf()
entity_count = #entity_table
else
-- every 1st round in series, spawn wary wave
entity_table = {}
spawn_wary()
spawn_crowder()
entity_count = #entity_table
end
if round % 3 == 0 then
-- every 3 rounds, increase difficulty and shields
difficulty = difficulty + 1
local shields = pewpew.get_player_configuration(0).shield
disappearing_message.new((width / 2fx) - 100fx, (height / 2fx) - 100fx, "Difficulty +1", 1fx, 0x14df5fff, 2)
disappearing_message.new((width / 2fx) + 100fx, (height / 2fx) - 100fx, "Shield +1", 1fx, 0xffff00ff, 2)
pewpew.configure_player(0, {shield = shields + 1})
end
if round % 4 == 0 and second_counter_amount > 10 then
-- every 4 rounds, decrease max time by 1
second_counter_amount = second_counter_amount - 1
disappearing_message.new((width / 2fx), (height / 2fx) + 100fx, "Time -1", 1fx, 0xe150c7ff, 2)
end
end
frame_counter = frame_counter - 2
if second_counter <= 6 and second_counter > 1 and time % 30 == 0 then
pewpew.play_ambient_sound("/dynamic/sounds.lua", 1)
end
if second_counter <= 5 and second_counter > 0 then
pewpew.customizable_entity_set_string(timer_text, color_helper.color_to_string(0xbf2626ff) .. second_counter)
elseif second_counter <= 10 and second_counter > 5 then
pewpew.customizable_entity_set_string(timer_text, color_helper.color_to_string(0xbfb226ff) .. second_counter)
elseif second_counter > 10 then
pewpew.customizable_entity_set_string(timer_text, color_helper.color_to_string(0x87bab8ff) .. second_counter)
elseif second_counter == 0 then
pewpew.customizable_entity_set_string(timer_text, color_helper.color_to_string(0xbf2626ff) .. ":(")
end
if frame_counter == 0 then
second_counter = second_counter - 1
frame_counter = 60
end
if second_counter == 0 then
if end_game == true then
pewpew.play_ambient_sound("/dynamic/sounds.lua", 0)
end_game = false
end
local shield = pewpew.get_player_configuration(0).shield
pewpew.add_damage_to_player_ship(player, shield + 1)
end
else
pewpew.customizable_entity_set_string(timer_text, color_helper.color_to_string(0xbf2626ff) .. ":(")
pewpew.stop_game()
end
end)
|
-- Autogenerated from KST: please remove this line if doing any edits by hand!
local luaunit = require("luaunit")
require("expr_if_int_ops")
TestExprIfIntOps = {}
function TestExprIfIntOps:test_expr_if_int_ops()
local r = ExprIfIntOps:from_file("src/process_coerce_switch.bin")
luaunit.assertEquals(r.is_eq_prim, true)
luaunit.assertEquals(r.is_eq_boxed, true)
end
|
-- Navigation plugin configuration, keybind documentation,
-- and other bits for jumping about
local function setup()
vim.cmd([[
packadd which-key.nvim
]])
local which_key = require('which-key')
which_key.setup {
window = {
border = 'none',
position = 'bottom',
},
triggers = 'auto',
triggers_blacklist = {
i = { 'j', 'k' },
v = { 'j', 'k' },
},
}
which_key.register {
["<leader>b"] = {
name = "Buffers",
n = "Next",
p = "Previous",
d = "Hide",
x = "Wipeout",
},
}
end
return { setup = setup }
|
local _, T = ...
local EV, L, U, S = T.Evie, T.L, T.Util, T.Shadows
local FollowerList, MissionRewards
local function GenBoardMask()
local m, MP = 0, CovenantMissionFrame.MissionTab.MissionPage
for i=0,12 do
local f = MP.Board.framesByBoardIndex[i]
if f and f.name and f:IsShown() then
m = m + 2^i
end
end
return m
end
local function GetIncomingAAMask(slot, bm)
local r, VS = 0, T.VSim
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
local mid = CovenantMissionFrame.MissionTab.MissionPage.missionInfo.missionID
local board = U.GetMaskBoard(bm)
if slot < 5 then
for _,v in pairs(C_Garrison.GetMissionDeploymentInfo(mid).enemies) do
local i = v.boardIndex
local fi = f[i]
local s1 = fi.autoCombatSpells and fi.autoCombatSpells[1]
local aa = T.KnownSpells[VS:GetAutoAttack(v.role, i, mid, s1 and s1.autoCombatSpellID)]
if aa and VS.GetTargets(i, aa.target, board)[1] == slot then
r = bit.bor(r, 2^i)
end
end
else
for i=0, 4 do
if bm % 2^(i+1) >= 2^i then
local fi = f[i]
local v, s1 = fi.info, fi.autoCombatSpells and fi.autoCombatSpells[1]
local aa = T.KnownSpells[VS:GetAutoAttack(v.role, nil, nil, s1 and s1.autoCombatSpellID)]
if aa and VS.GetTargets(i, aa.target, board)[1] == slot then
r = bit.bor(r, 2^i)
end
end
end
end
return r
end
local function GetFollowerInfo(fid)
local fi = C_Garrison.GetFollowerInfo(fid)
fi.autoCombatSpells = C_Garrison.GetFollowerAutoCombatSpells(fid, fi.level)
fi.autoCombatantStats = C_Garrison.GetFollowerAutoCombatStats(fid)
return fi
end
local function Board_HasCompanion()
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
for i=0,4 do
local ii = f[i].info
if ii and not ii.isAutoTroop then
return true
end
end
return false
end
local function Puck_OnEnter(self)
if not self.name then
if GameTooltip:IsOwned(self) then
GameTooltip:Hide()
end
return
end
local mid = CovenantMissionFrame.MissionTab.MissionPage.missionInfo.missionID
local bi, bm = self.boardIndex, GenBoardMask()
local info, acs = self.info
if bi > 4 then
for _,v in pairs(C_Garrison.GetMissionDeploymentInfo(mid).enemies) do
if v.boardIndex == bi then
info, acs = v, {currentHealth=v.health, maxHealth=v.maxHealth, attack=v.attack}
break
end
end
end
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
U.SetFollowerInfo(GameTooltip, info, self.autoCombatSpells, acs, mid, bi, bm, false)
local aa = GetIncomingAAMask(bi, bm)
if aa and aa > 0 then
local nc = NORMAL_FONT_COLOR
GameTooltip:AddLine(" ")
GameTooltip:AddLine(L"Incoming attacks:" .. " " .. U.FormatTargetBlips(aa, bm, nil, "240:60:0", false), nc.r, nc.g, nc.b)
end
GameTooltip:Show()
self:GetBoard():ShowHealthValues()
end
local function Puck_OnLeave(self)
if GameTooltip:IsOwned(self) then
GameTooltip:Hide()
end
self:GetBoard():HideHealthValues()
end
local function EnvironmentEffect_OnEnter(self)
local info = self.info
if not info then return end
local sid = info.autoCombatSpellID
local pfx = T.KnownSpells[sid] and "" or "|TInterface/EncounterJournal/UI-EJ-WarningTextIcon:0|t "
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
GameTooltip:SetOwner(self, "ANCHOR_NONE")
GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -8, 0)
GameTooltip:ClearLines()
GameTooltip:AddDoubleLine(pfx .. "|T" .. info.icon .. ":0:0:0:0:64:64:4:60:4:60|t " .. info.name, "|cffa8a8a8" .. (L"[CD: %dT]"):format(info.cooldown) .. "|r")
local guideLine = U.GetAbilityGuide(sid, -1, GenBoardMask(), false)
local od = U.GetAbilityDescriptionOverride(info and info.autoCombatSpellID, nil, mi and mi.missionScalar)
local dc = od and 0.60 or 0.95
GameTooltip:AddLine(info.description, dc, dc, dc, 1)
if od then
GameTooltip:AddLine(od, 0.45, 1, 0, 1)
end
if guideLine then
GameTooltip:AddLine(guideLine, 0.45, 1, 0, 1)
end
GameTooltip:Show()
end
local function EnvironmentEffect_OnLeave(self)
if GameTooltip:IsOwned(self) then
GameTooltip:Hide()
end
end
local function EnvironmentEffect_OnNameUpdate(self_name)
local ee = self_name:GetParent()
ee:SetHitRectInsets(0, min(-100, -self_name:GetStringWidth()), 0, 0)
end
local CAG, SetSimResultHint = {} do
local simArch, reSim, state, deadline
local function GetGroupTags()
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local tag, htag = (mi.missionID) .. ":" .. (mi.missionScalar or 0), ""
for i=0,4 do
local ii = f[i].info
if ii then
local stats = C_Garrison.GetFollowerAutoCombatStats(ii.followerID)
tag = tag .. ":" .. i .. ":" .. stats.attack .. ":" .. ii.followerID
htag = htag .. ":" .. stats.currentHealth
end
end
htag = tag .. htag
return htag, tag
end
local function cmpBoardIndex(a,b)
return a.boardIndex < b.boardIndex
end
local function GetComputedGroupTags(g)
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local tag, htag = (mi.missionID) .. ":" .. (mi.missionScalar or 0), ""
local m = {}
for i=1,#g do
m[i] = g[i]
end
table.sort(m, cmpBoardIndex)
for i=1,#m do
local ii = m[i]
local stats = ii.stats
tag = tag .. ":" .. ii.boardIndex .. ":" .. stats.attack .. ":" .. ii.id
htag = htag .. ":" .. stats.currentHealth
end
htag = tag .. htag
return htag, tag
end
local function qdeadline(root)
return debugprofilestop() > deadline or (root.res.hadLosses and root.res.hadWins)
end
local function qdeadlineorloss(root)
return debugprofilestop() > deadline or root.res.hadLosses
end
local function isDone(res, endOnAnyLoss)
return res and (res.isFinished or ((res.hadWins or endOnAnyLoss) and res.hadLosses))
end
local function setupRetry()
if reSim then
state.reCount = state.reCount + reSim.res.n
state[reSim.res.hadLosses and "reLow" or "reHigh"], state.reTry, reSim = state.reTry, nil
end
if not (state.reRange and state.reLow < state.reRange) or (state.reHigh and state.reHigh - state.reLow < 2^-11) then
if state.reHigh then
state.reFinish = state.reStart + state.reRangeT*state.reHigh
end
reSim, state.reTry, state.reLow, state.reHigh, state.reTeam, state.reStart, state.reRange, state.reRangeT = nil
return
end
local rteam, tryRe = state.reTeam
if not rteam then
rteam = {}
for i=1, #state.team do
local s, d = state.team[i], {}
for k,v in pairs(s) do
d[k] = v
end
rteam[i], s, d = d, s.stats, {}
for k,v in pairs(s) do
d[k] = v
end
rteam[i].stats = d
end
state.reTeam, tryRe = rteam, state.reRange
else
tryRe = (state.reLow + state.reHigh)/2
end
for i=1,#rteam do
local rs, s = rteam[i].stats, state.team[i].stats
if s.currentHealth < s.maxHealth then
rs.currentHealth = math.min(s.maxHealth, math.floor(s.currentHealth + tryRe*s.maxHealth+0.5))
end
end
state.reTry, reSim = tryRe, T.VSim:New(state.reTeam, state.enemies, state.espell, state.mid, state.msc)
return true
end
function CAG:GatherMissionData()
local team, reRange, reRangeT = {}, 0, 0 do
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
for i=0,4 do
local ii = f[i].info
if ii then
local acs = C_Garrison.GetFollowerAutoCombatStats(ii.followerID)
team[#team+1] = {boardIndex=i, role=ii.role, stats=acs, spells=f[i].autoCombatSpells}
if acs.currentHealth < acs.maxHealth then
reRange = math.max(reRange, 1 - acs.currentHealth/acs.maxHealth)
reRangeT = math.max(reRangeT, acs.minutesHealingRemaining or 0)
end
end
end
end
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local eei = C_Garrison.GetAutoMissionEnvironmentEffect(mi.missionID)
local mdi = C_Garrison.GetMissionDeploymentInfo(mi.missionID)
local espell = eei and eei.autoCombatSpellInfo
reRangeT = reRange > 0 and 60*reRangeT/reRange or nil
return {team=team, enemies=mdi.enemies, espell=espell, mid=mi.missionID, msc=mi.missionScalar,
reStart=reRange > 0 and GetServerTime() or nil, reRange=reRange > 0 and reRange or nil, reRangeT=reRangeT, reCount=reRange > 0 and 0 or nil, reLow=0}
end
function CAG:Start()
local tag, rtag = GetGroupTags()
if not state or state.tag ~= tag then
local os, md, ms = state, CAG:GatherMissionData()
state, md.tag, md.rtag, reSim = md, tag, rtag, nil
if os and os.rtag == rtag and os.reFinish and md.reStart then
md.reFinish, md.reStart, md.reRange, md.reRangeT, md.reLow = os.reFinish, nil, nil
end
simArch, ms = T.VSim:New(md.team, md.enemies, md.espell, md.mid, md.msc)
md.missingSpells, simArch.dropForks = ms and next(ms) and true or nil, true
deadline = debugprofilestop() + 40
simArch:Run(qdeadline)
return not isDone(simArch.res) or setupRetry()
end
return not (isDone(simArch.res) and not state.reStart)
end
function CAG:Run()
if not simArch then
return true
end
deadline = debugprofilestop() + 12
if reSim then
if isDone(reSim.res, true) then
return not setupRetry()
else
reSim:Run(qdeadlineorloss)
end
elseif isDone(simArch.res) then
simArch.outOfDateHealth = GetGroupTags() ~= (state and state.tag)
return not (simArch.res.hadLosses and setupRetry())
else
simArch:Run(qdeadline)
end
end
function CAG:GetResult()
local rc = state and state.reCount
if rc and reSim then
rc = rc + reSim.res.n
end
return simArch, state and state.missingSpells, state and (state.reFinish or state.reStart and true) or nil, rc, (state and state.reHigh and state.reHigh*state.reRangeT)
end
function CAG:Reset()
simArch, reSim, state = nil
end
function SetSimResultHint(g, sim, ms)
state = CAG:GatherMissionData()
local ng = {}
for slot, ii in pairs(g) do
local nge = {boardIndex=slot}
for k,v in pairs(ii) do
nge[k] = v
end
ng[#ng+1] = nge
end
state.tag, state.rtag = GetComputedGroupTags(ng)
simArch, state.team, state.missingSpells = sim, ng, ms and next(ms) and true or nil
end
EV.GARRISON_MISSION_NPC_CLOSED = CAG.Reset
end
local Tact = {} do
local pt, state, deadline = {}
local function cmpFollowerID(a,b)
return a.followerID < b.followerID
end
local function GetGroupTags()
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local tag, htag = (mi.missionID) .. ":" .. (mi.missionScalar or 0), ""
local m = {}
for i=0,4 do
local ii = f[i].info
if ii and not ii.isAutoTroop then
m[#m+1] = ii
end
end
table.sort(m, cmpFollowerID)
for i=1,#m do
local ii = m[i]
local stats = C_Garrison.GetFollowerAutoCombatStats(ii.followerID) or ii.autoCombatantStats
tag = tag .. ":" .. i .. ":" .. stats.attack .. ":" .. ii.followerID
htag = htag .. ":" .. stats.currentHealth
end
htag = tag .. htag
return htag, tag
end
local function GetShuffleGroup(gid)
local rgid, g, um, maxScore, pen, wmask = gid, {}, 0, 4, 0, 0
for i=0,4 do
pt[i] = i
end
for i=1, #state.companions do
local p, li, ci = rgid % (6-i), 5-i, state.companions[i]
rgid = (rgid - p) / (6-i)
p, pt[li], pt[p] = pt[p], pt[p], pt[li]
g[p], um = ci, um + 2^p
if not ci.willLevel then
maxScore, wmask = maxScore + 5*ci.stats.maxHealth, wmask + 2^p
end
end
for p=0, 4-#state.companions do
p = pt[p]
local i = rgid % 3
rgid = (rgid - i) / 3
local ti = state.troops[i+1]
if ti then
g[p], pen = ti, pen + 1
end
end
return g, maxScore-pen, pen, wmask
end
local function GetHealthScore(rm)
return (rm[18] or 0)*5+4-state.cpenalty
end
local function interrupt(root, _forkID, _nForks)
local res = root.res
state.numFutures = state.numFutures + 1
if res.hadLosses or debugprofilestop() >= deadline or GetHealthScore(res.min) < state.bestScore then
return true
end
end
function Tact:Run()
if not state then
return true
end
deadline = debugprofilestop() + 15
repeat
local sim = state.csim
if not sim then
local ng = state.nextGroup
if ng >= state.numGroups then
state.finished = true
local g = state.bestGroup and GetShuffleGroup(state.bestGroup)
if g then
SetSimResultHint(g, state.bestSim, state.bestMiss)
end
return true, g
end
local ms, team, maxScore, troopPenalty, wmask = nil, GetShuffleGroup(ng)
if maxScore > state.bestScore then
sim, ms = T.VSim:New(team, state.enemies, state.espell, state.missionID, state.missionScalar)
sim.wmask, sim.dropForks = wmask, true
state.csim, state.cmiss, state.cgroup, state.cpenalty = sim, ms, ng, troopPenalty
state.numFutures = state.numFutures + 1
end
state.nextGroup = ng+1
end
if sim then
sim:Run(interrupt)
if sim.res.hadLosses then
state.csim = nil
elseif sim.res.isFinished then
local h = GetHealthScore(sim.res.min)
if h > state.bestScore then
state.bestScore, state.bestGroup, state.bestSim, state.bestMiss = h, state.cgroup, sim, state.cmiss
end
state.csim = nil
end
end
until debugprofilestop() > deadline
end
function Tact:GatherMissionData()
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local eei = C_Garrison.GetAutoMissionEnvironmentEffect(mi.missionID)
local mdi = C_Garrison.GetMissionDeploymentInfo(mi.missionID)
local espell = eei and eei.autoCombatSpellInfo
local ct, tt = {}, {} do
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
local rewardXP = MissionRewards and MissionRewards.xpGain or 0
for i=0,4 do
local ii = f[i].info
if ii and not ii.isAutoTroop then
local willLevel = not ii.isMaxLevel and ii.xp and ii.levelXP and (ii.xp + rewardXP) >= ii.levelXP
local acs = C_Garrison.GetFollowerAutoCombatStats(ii.followerID) or ii.autoCombatantStats
ct[#ct+1] = {role=ii.role, stats=acs, spells=f[i].autoCombatSpells, id=ii.followerID, willLevel=willLevel}
end
end
for _, fi in ipairs(C_Garrison.GetAutoTroops(123)) do
tt[#tt+1] = {
role=fi.role,
stats=C_Garrison.GetFollowerAutoCombatStats(fi.followerID),
spells=C_Garrison.GetFollowerAutoCombatSpells(fi.followerID, fi.level),
id=fi.followerID,
}
end
end
return {missionID=mi.missionID, missionScalar=mi.missionScalar, enemies=mdi.enemies, espell=espell, companions=ct, troops=tt}
end
function Tact:Start()
if not Board_HasCompanion() then
return
end
local ht, it = GetGroupTags()
if state and not (it ~= state.itag or (state.finished and state.htag ~= ht)) then
return true
end
state = self:GatherMissionData()
local ng = 3^(5-#state.companions)
for i=1, #state.companions do
ng = ng * (6-i)
end
state.numGroups, state.nextGroup, state.bestGroup, state.bestScore = ng, 0, false, -1e12
state.numFutures, state.htag, state.itag = 0, ht, it
return true
end
function Tact:IsRunning()
if state and not state.finished then
return true, state.nextGroup, state.numGroups, state.numFutures, not not state.bestGroup
elseif state and GetGroupTags() == state.htag then
return false, true, not not state.bestGroup
else
return false, false, Board_HasCompanion()
end
end
function Tact:Interrupt()
if state and state.bestGroup then
local g = GetShuffleGroup(state.bestGroup)
SetSimResultHint(g, state.bestSim, state.bestMiss)
return g
end
end
function Tact:CheckBoard(later)
if later then
if not Tact.pendingBoardCheck then
C_Timer.After(0, Tact.CheckBoard)
end
Tact.pendingBoardCheck = true
return
end
Tact.pendingBoardCheck = nil
if state and not state.finished and state.itag ~= select(2, GetGroupTags()) then
state = nil
end
end
function Tact:Reset()
state = nil
end
end
local function Predictor_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
GameTooltip:SetText(ITEM_QUALITY_COLORS[5].hex .. L"Cursed Adventurer's Guide")
GameTooltip:AddLine(ITEM_UNIQUE, 1,1,1, 1)
GameTooltip:AddLine(L"Use: Read the guide, determining the fate of your adventuring party.", 0, 1, 0, 1)
GameTooltip:AddLine(L'"Do not believe its lies! Balance druids are not emergency rations."', 1, 0.835, 0.09, 1)
GameTooltip:Show()
end
local function Predictor_ShowResult(self, sim, incompleteModel, recoverUntil, recoverFutures, recoverHighBound)
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
local res = sim.res
local rngModel = res.hadDrops or (res.hadWins and res.hadLosses)
local inProgress = not res.isFinished and not rngModel
local oodBuild = GetBuildInfo() ~= "9.0.5"
local hprefix = (oodBuild or incompleteModel) and "|TInterface/EncounterJournal/UI-EJ-WarningTextIcon:0|t " or ""
if inProgress then
hprefix = hprefix .. "|cffff3300" .. L"Preliminary:" .. "|r "
end
if rngModel then
GameTooltip:SetText(hprefix .. L"Curse of Uncertainty", 1, 0.20, 0)
else
GameTooltip:SetText(hprefix .. (sim.won and L"Victorious" or L"Defeated"), 1,1,1)
end
if incompleteModel then
GameTooltip:AddLine(L"Not all abilities have been taken into account.", 0.9,0.25,0.15)
elseif oodBuild then
GameTooltip:AddLine(L"The Guide may be out of date.", 0.9,0.25,0.15)
end
if inProgress then
GameTooltip:AddLine(L"Not all outcomes have been examined.", 0.9, 0.25, 0.15, 1)
end
if sim.outOfDateHealth then
GameTooltip:AddLine(L"Companion health has changed.", 0.9, 0.25, 0.15, 1)
end
if incompleteModel or inProgress or sim.outOfDateHealth then
GameTooltip:AddLine(" ")
end
local flavor = nil
if rngModel then
GameTooltip:AddLine(L"The guide shows you a number of possible futures. In some, the adventure ends in triumph; in others, a particularly horrible failure.", 1,1,1,1)
if not incompleteModel then
flavor = L'"With your luck, there is only one way this ends."'
end
else
local lo, hi, c = res.min, res.max, NORMAL_FONT_COLOR
local turns = lo[17] ~= hi[17] and lo[17] .. " - " .. hi[17] or lo[17]
if inProgress and not incompleteModel then
GameTooltip:AddLine(L"Futures considered:" .. " |cffffffff" .. BreakUpLargeNumbers(res.n or 0), c.r, c.g, c.b)
end
if turns then
GameTooltip:AddLine((sim.won and L"Turns taken: %s" or L"Turns survived: %s"):format("|cffffffff" .. turns .. "|r"), c.r, c.g, c.b)
end
if sim.won then
local troopCount, troopHealth1, troopHealth2, troopHealthMax = 0, 0, 0, 0
local rewardXP = MissionRewards.xpGain or 0
for i=0,4 do
local hmin, hmax = lo[i], hi[i]
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex[i]
local e = sim.board[i]
if f and f.name and f:IsShown() and f.info and hmin and e then
local fi = f.info
if fi.isAutoTroop then
troopCount, troopHealth1, troopHealth2, troopHealthMax = troopCount + 1, troopHealth1 + hmin, troopHealth2 + hmax, troopHealthMax + (e.maxHP or 0)
else
local chp = hmin == hmax and hmin or ((hmin == 0 and "|cffff40200|r" or hmin) .. " |cffffffff-|r " .. hmax)
local isUp = fi.xp and fi.levelXP and not fi.isMaxLevel and (fi.xp + rewardXP) >= fi.levelXP and "|A:bags-greenarrow:0:0|a" or ""
GameTooltip:AddDoubleLine(f.name .. isUp, chp .. "/" .. e.maxHP, 1,1,1, hmax > 0 and 0 or 1, hmax > 0 and 1 or 0.3, 0.15)
end
end
end
if troopCount > 0 then
local hmin, hmax = troopHealth1, troopHealth2
local chp = hmin == hmax and hmin or ((hmin == 0 and "|cffff40200|r" or hmin) .. " |cffffffff-|r " .. hmax)
GameTooltip:AddDoubleLine(FOLLOWERLIST_LABEL_TROOPS, chp .. "/" .. troopHealthMax, 1,1,1, troopHealth2 > 0 and 0 or 1, troopHealth2 > 0 and 1 or 0.3, 0.15)
end
else
local hmin, hmax, maxHP = lo[15], hi[15], 0
for i=5,12 do
local e = sim.board[i]
maxHP = maxHP + (e and e.maxHP or 0)
end
local chp = hmin == hmax and hmin or (hmin .. " - " .. hmax)
hmin, hmax = math.ceil(hmin/maxHP*100), math.ceil(hmax/maxHP*100)
local cr = hmin == hmax and hmin or (hmin .. "% - " .. hmax)
GameTooltip:AddLine((L"Remaining enemy health: %s"):format("|cffffffff" .. chp .. " (" .. cr .. "%)|r"), c.r, c.g, c.b)
end
if not incompleteModel then
if inProgress then
flavor = L'"... or not. Better read this thing to the end."'
elseif lo[sim.won and 13 or 15] == 0 then
flavor = sim.won and L'"Snatch victory from the jaws of defeat!"' or L'"So close, and yet so far."'
else
flavor = L'"Was there ever any doubt?"'
end
if not sim.won then
flavor = "\n" .. flavor
end
end
end
if res.hadLosses and recoverUntil and not inProgress then
if recoverUntil == true then
local nc = NORMAL_FONT_COLOR
if recoverFutures > 0 or recoverHighBound then
GameTooltip:AddLine(" ")
end
GameTooltip:AddLine(L"Checking health recovery...", 0.45, 1, 0)
if recoverFutures > 0 then
GameTooltip:AddDoubleLine(L"Futures considered:", BreakUpLargeNumbers(recoverFutures), nc.r, nc.g, nc.b, 1,1,1)
end
if recoverHighBound then
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local cc = recoverHighBound < (mi and mi.offerEndTime and mi.offerEndTime-GetTime() or 0) and "|cffffffff" or "|cffe86000"
GameTooltip:AddLine((L"Would win if started in: %s"):format("|cffffffff <= |r" .. cc .. U.GetTimeStringFromSeconds(recoverHighBound, false, true, true) .. "|r"), nc.r, nc.g, nc.b)
end
else
local rl = math.max(0, recoverUntil - GetServerTime())
local mi = CovenantMissionFrame.MissionTab.MissionPage.missionInfo
local cc = rl < (mi and mi.offerEndTime and mi.offerEndTime-GetTime() or 0) and "|cffffffff" or "|cffe86000"
GameTooltip:AddLine((L"Would win if started in: %s"):format(cc .. U.GetTimeStringFromSeconds(rl, false, true, true) .. "|r"), 0.45, 1, 0.15)
end
end
if flavor then
GameTooltip:AddLine(flavor, 1, 0.835, 0.09, 1)
end
GameTooltip:Show()
end
local function Predictor_OnUpdate(self, elapsed)
local rcd, isDone = (self.rsCooldown or 0) - elapsed, CAG:Run()
if isDone then
self:SetScript("OnUpdate", nil)
end
if (rcd < 0 or isDone) and GameTooltip:IsOwned(self) then
Predictor_ShowResult(self, CAG:GetResult())
rcd = 0.125
end
self.rsCooldown = rcd
end
local function Predictor_OnClick(self)
if CAG:Start() then
self.rsCooldown = 0.125
self:SetScript("OnUpdate", Predictor_OnUpdate)
end
Predictor_ShowResult(self, CAG:GetResult())
end
local function Predictor_OnLeave(self)
if GameTooltip:IsOwned(self) then
GameTooltip:Hide()
end
end
local function MissionGroup_OnUpdate()
Tact:CheckBoard(true)
local o = GameTooltip:IsVisible() and GameTooltip:GetOwner() or GetMouseFocus()
if o and not o:IsForbidden() and o.GetScript then
local l, p, t = 3, o, CovenantMissionFrame.MissionTab.MissionPage.Board
while p and p ~= t and l > 0 and p.GetParent and p.IsForbidden and not p:IsForbidden() do
l, p = l-1, p:GetParent()
end
if p == t then
o:GetScript("OnEnter")(o)
end
end
FollowerList:SyncToBoard()
end
local function MissionRewards_OnShow(self)
local MP = CovenantMissionFrame.MissionTab.MissionPage
local mi = MP.missionInfo
local d = mi and mi.duration
MP.Stage.Title:SetText(mi and mi.name or "")
self.Rewards:SetRewards(mi and mi.xp, mi and mi.rewards)
self.Duration:SetText(d and L"Duration:" .. " |cffffffff" .. d or "")
local xp = mi and mi.xp or 0
for i=1,mi and mi.rewards and #mi.rewards or 0 do
local r = mi.rewards[i]
if r.followerXP then
xp = xp + r.followerXP
end
end
self.xpGain = xp
if FollowerList then
FollowerList:SyncXPGain(xp)
end
end
local function HealAllButton_OnUpdate(self, elapsed)
local tl = (self.timeLeft or 0) - elapsed
if tl > 0 then
self.timeLeft = tl
return
end
self.timeLeft = 0.125
local ff = CovenantMissionFrameFollowers
if ff:GetScript("OnUpdate") and not ff:IsShown() then
local m = ff.followers and "CalculateHealAllFollowersCost" or "OnShow"
ff[m](ff)
end
end
local function MissionView_OnShow()
if not FollowerList then
FollowerList = T.CreateObject("FollowerList", CovenantMissionFrame)
FollowerList:ClearAllPoints()
FollowerList:SetPoint("BOTTOM", CovenantMissionFrameFollowers, "BOTTOM", 0, 8)
end
FollowerList:Refresh(MissionRewards and MissionRewards.xpGain)
FollowerList:Show()
CovenantMissionFrameFollowers:Hide()
CovenantMissionFrameFollowers.MaterialFrame:SetParent(FollowerList)
CovenantMissionFrameFollowers.HealAllButton:SetParent(FollowerList)
end
local function MissionView_OnHide()
if FollowerList then
FollowerList:Hide()
end
CovenantMissionFrameFollowers:Show()
CovenantMissionFrameFollowers.MaterialFrame:SetParent(CovenantMissionFrameFollowers)
CovenantMissionFrameFollowers.HealAllButton:SetParent(CovenantMissionFrameFollowers)
end
local function MissionView_GetGroup()
local g, hc, zh = {}, false, false
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
for i=0,5 do
local fi = f[i]
if fi and fi.name and fi.info and fi:IsShown() then
g[i], hc = fi.info.followerID, hc or not fi.info.isAutoTroop
if not (zh or fi.info.isAutoTroop) then
local cs = C_Garrison.GetFollowerAutoCombatStats(g[i])
zh = (cs and cs.currentHealth or 0) == 0
end
end
end
return g, hc, zh
end
local function MissionPage_OnClick(self, button)
if button == "RightButton" then
local mid = CovenantMissionFrame.MissionTab.MissionPage.missionInfo.missionID
local g, hc = MissionView_GetGroup()
if mid and hc then
U.StoreMissionGroup(mid, g, true)
end
end
GarrisonMissionPage_OnClick(self, button)
end
local function MissionPageFollower_OnMouseUp(self, frame, button)
if button == "RightButton" and not (frame.GetInfo and frame:GetInfo() or frame.info) then
return MissionPage_OnClick(self:GetMissionPage(), button)
end
return CovenantMissionFrame.OnMouseUpMissionFollower(self, frame, button)
end
local function MissionStart_OnClick(_self, button)
local mid = CovenantMissionFrame.MissionTab.MissionPage.missionInfo.missionID
local g, hc, zh = MissionView_GetGroup()
if not hc then
return
elseif button == "RightButton" and not zh then
U.StartMissionWithDelay(mid, g)
else
U.StoreMissionGroup(mid, g, true)
PlaySound(39514)
end
CovenantMissionFrame:CloseMission()
end
local function MissionStart_OnEnter(self)
if self:IsEnabled() then
local send = NORMAL_FONT_COLOR_CODE .. L"Send Tentative Parties" .. "|r"
GameTooltip:SetOwner(self, "ANCHOR_TOP", 0, 3)
GameTooltip:SetText(L"Assign Tentative Party")
GameTooltip:AddLine((L"Tentative parties can be changed until you click %s."):format(send), 1,1,1,1)
if select(3, MissionView_GetGroup()) then
GameTooltip:AddLine("|n|cffff8000" .. COVENANT_MISSIONS_COMPANIONS_MISSING_HEALTH, 1, 0.5, 0)
else
GameTooltip:AddLine("|n|TInterface/TUTORIALFRAME/UI-TUTORIAL-FRAME:14:12:0:-1:512:512:10:70:330:410|t " .. L"Start the adventure", 0.5, 0.8, 1)
end
GameTooltip:Show()
elseif self.tooltip then
GameTooltip:SetOwner(self, "ANCHOR_TOP", 0, 3);
GameTooltip:SetText(self.tooltip, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, RED_FONT_COLOR.a, true);
GameTooltip:Show();
end
end
local function Shuffler_OnEnter(self, source)
GameTooltip:Hide()
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
GameTooltip:SetText(ITEM_QUALITY_COLORS[5].hex .. L"Cursed Tactical Guide")
local sb = T.CreateObject("SharedTooltipProgressBar")
sb:Hide()
local isRunning, a1, a2, a3, a4 = Tact:IsRunning()
if isRunning then
local nc = NORMAL_FONT_COLOR
GameTooltip:AddDoubleLine(L"Futures considered:", BreakUpLargeNumbers(a3), 1,1,1, nc.r, nc.g, nc.b)
if a4 then
GameTooltip:AddLine(L"Use: Interrupt the guide's deliberations.", 0, 1, 0, 1)
end
sb:Activate(GameTooltip, a1, a2)
return
elseif (a1 and not a2) or source == "update" then -- finished, no group
GameTooltip:AddLine(L"Victory could not be guaranteed.", 1,1,1)
else -- not running, not finished
GameTooltip:AddLine(ITEM_UNIQUE, 1,1,1, 1)
GameTooltip:AddLine(L"Use: Let the book select troops and battle tactics.", 0, 1, 0, 1)
local c = a2 and WHITE_FONT_COLOR or RED_FONT_COLOR -- can start?
GameTooltip:AddLine(L"Requires a companion in the party", c.r, c.g, c.b)
GameTooltip:AddLine(L'"Chapter 1: Mages Must Melee."', 1, 0.835, 0.09, 1)
end
GameTooltip:Show()
end
local function Shuffler_OnLeave(self)
if GameTooltip:IsOwned(self) then
GameTooltip:Hide()
end
end
local function Shuffler_AssignGroup(g)
local f = CovenantMissionFrame.MissionTab.MissionPage.Board.framesByBoardIndex
for i=0,4 do
if f[i].info then
CovenantMissionFrame:RemoveFollowerFromMission(f[i], true)
end
end
for slot, ii in pairs(g) do
CovenantMissionFrame:AssignFollowerToMission(f[slot], GetFollowerInfo(ii.id))
end
end
local function Shuffler_OnUpdate(self)
local fin, g = Tact:Run()
if fin then
self:SetScript("OnUpdate", nil)
if g then
Shuffler_AssignGroup(g)
Shuffler_OnLeave(self)
return
end
end
if GameTooltip:IsOwned(self) then
Shuffler_OnEnter(self, "update")
end
end
local function Shuffler_OnClick(self)
local ir, _, _, hg = Tact:IsRunning()
if ir then
local g = hg and Tact:Interrupt()
if g then
Shuffler_AssignGroup(g)
end
elseif Tact:Start() then
self:SetScript("OnUpdate", Shuffler_OnUpdate)
Shuffler_OnUpdate(self)
end
PlaySound(SOUNDKIT.U_CHAT_SCROLL_BUTTON)
end
local function Shuffler_OnHide()
Tact:Reset()
end
local function HookOnShow(f, h)
f:HookScript("OnShow", h)
if f:IsVisible() then
h(f)
end
end
function EV:I_ADVENTURES_UI_LOADED()
local MP = CovenantMissionFrame.MissionTab.MissionPage
for i=0,12 do
local f = MP.Board.framesByBoardIndex[i]
f:SetScript("OnEnter", Puck_OnEnter)
f:SetScript("OnLeave", Puck_OnLeave)
for i=1,2 do
f.AbilityButtons[i]:EnableMouse(false)
f.AbilityButtons[i]:SetMouseMotionEnabled(false)
end
end
MP.CloseButton:SetScript("OnKeyDown", function(self, key)
self:SetPropagateKeyboardInput(key ~= "ESCAPE")
if key == "ESCAPE" then
self:Click()
end
end)
local cag = T.CreateObject("IconButton", MP.Board, 64, "Interface/Icons/INV_Misc_Book_01")
cag:RegisterForClicks("LeftButtonUp", "RightButtonUp")
cag:SetPoint("BOTTOMLEFT", 24, 4)
cag:SetScript("OnEnter", Predictor_OnEnter)
cag:SetScript("OnLeave", Predictor_OnLeave)
cag:SetScript("OnClick", Predictor_OnClick)
local cat = T.CreateObject("IconButton", MP.Board, 32, "Interface/Icons/INV_Misc_Book_06")
cat:RegisterForClicks("LeftButtonUp", "RightButtonUp")
cat:SetPoint("TOPLEFT", cag, "TOPRIGHT", 4, 0)
cat:SetScript("OnEnter", Shuffler_OnEnter)
cat:SetScript("OnLeave", Shuffler_OnLeave)
cat:SetScript("OnClick", Shuffler_OnClick)
cat:SetScript("OnHide", Shuffler_OnHide)
MP.Stage.EnvironmentEffectFrame:SetScript("OnEnter", EnvironmentEffect_OnEnter)
MP.Stage.EnvironmentEffectFrame:SetScript("OnLeave", EnvironmentEffect_OnLeave)
hooksecurefunc(MP.Stage.EnvironmentEffectFrame.Name, "SetText", EnvironmentEffect_OnNameUpdate)
hooksecurefunc(CovenantMissionFrame, "AssignFollowerToMission", MissionGroup_OnUpdate)
hooksecurefunc(CovenantMissionFrame, "RemoveFollowerFromMission", MissionGroup_OnUpdate)
MP:SetScript("OnClick", MissionPage_OnClick)
HookOnShow(CovenantMissionFrame, function()
CovenantMissionFrame:RegisterCallback(CovenantMission.Event.OnFollowerFrameMouseUp, MissionPageFollower_OnMouseUp, CovenantMissionFrame)
end)
MP.StartMissionButton:SetScript("OnClick", MissionStart_OnClick)
MP.StartMissionButton:SetScript("OnEnter", MissionStart_OnEnter)
MP.StartMissionButton:RegisterForClicks("LeftButtonUp", "RightButtonUp")
MP.StartMissionButton:SetText(L"Assign Party")
CovenantMissionFrame.GetSystemSpecificStartMissionFailureMessage = function() end
local s = CovenantMissionFrame.MissionTab.MissionPage.Stage
s.Title:SetPoint("LEFT", s.Header, "LEFT", 100, 9)
local ir = T.CreateObject("InlineRewardBlock", s.MouseOverTitleFrame)
MissionRewards = ir
ir:SetPoint("LEFT", s.Header, "LEFT", 100, -16)
ir.Duration = ir:CreateFontString(nil, "OVERLAY", "GameFontNormal")
ir.Duration:SetPoint("LEFT", ir, "RIGHT", 4, 0)
hooksecurefunc(CovenantMissionFrame, "SetTitle", function()
MissionRewards_OnShow(ir)
end)
hooksecurefunc(CovenantMissionFrame:GetMissionPage(), "Show", MissionView_OnShow)
MP.Board:HookScript("OnHide", MissionView_OnHide)
MP.Board:HookScript("OnShow", MissionView_OnShow)
hooksecurefunc(CovenantMissionFrameFollowers, "UpdateFollowers", function()
if MP.Board:IsVisible() and not (S[T.MissionList] and S[T.MissionList]:IsVisible()) then
MissionView_OnShow()
end
end)
local h = CreateFrame("Frame", nil, CovenantMissionFrameFollowers.HealAllButton)
h:SetScript("OnUpdate", HealAllButton_OnUpdate)
CovenantMissionFrameFollowers:HookScript("OnShow", function() h:Hide() end)
CovenantMissionFrameFollowers:HookScript("OnHide", function() h:Show() end)
MP.Stage.Title:SetWidth(320)
return "remove"
end
|
Animation = {
__name = "sol.Animation.user"
}
Arrowtrap = {
__index = "function: 0000020E8E230C90",
__name = "sol.Arrowtrap.user",
__newindex = "function: 0000020E8E230690"
}
BEG = {
ALTAR_DESTROYED = 1,
BOMBBAG_THROWN = 3,
QUEST_NOT_STARTED = 0,
SPAWNED_WITH_BOMBBAG = 2,
SPAWNED_WITH_TRUECROWN = 4,
TRUECROWN_THROWN = 5
}
BUTTON = {
BOMB = 4,
DOOR = 32,
JUMP = 1,
ROPE = 8,
RUN = 16,
WHIP = 2
}
Bomb = {
__index = "function: 0000028B8CEE6360",
__name = "sol.Bomb.user",
__newindex = "function: 0000028B8CEE50E0"
}
CHAR_STATE = {
ATTACKING = 12,
CLIMBING = 6,
DROPPING = 10,
DUCKING = 5,
DYING = 22,
ENTERING = 19,
EXITING = 21,
FALLING = 9,
FLAILING = 0,
HANGING = 4,
JUMPING = 8,
LOADING = 20,
PUSHING = 7,
SITTING = 2,
STANDING = 1,
STUNNED = 18,
THROWING = 17
}
CONST = {
ENGINE_FPS = 60
}
COSUBTHEME = {
DWELLING = 0,
ICECAVES = 5,
JUNGLE = 1,
NEOBABYLON = 6,
RESET = -1,
SUNKENCITY = 7,
TEMPLE = 4,
TIDEPOOL = 3,
VOLCANA = 2
}
Camera = {
__name = "sol.Camera.user"
}
Cape = {
__index = "function: 0000020E8E22C790",
__name = "sol.Cape.user",
__newindex = "function: 0000020E8E22C210"
}
ChasingMonster = {
__index = "function: 0000020E8E230090",
__name = "sol.ChasingMonster.user",
__newindex = "function: 0000020E8E231290"
}
Color = {
__name = "sol.Color.user"
}
Container = {
__index = "function: 0000020E8E22CE90",
__name = "sol.Container.user",
__newindex = "function: 0000020E8E22BD90"
}
Crushtrap = {
__index = "function: 0000020E8E22F690",
__name = "sol.Crushtrap.user",
__newindex = "function: 0000020E8E22E290"
}
CustomSound = {
__name = "sol.CustomSound.user"
}
DROP = {
ALTAR_DICE_CLIMBINGGLOVES = 0,
ALTAR_DICE_COOKEDTURKEY = 1,
ALTAR_DICE_DIAMOND = 2,
ALTAR_DICE_MACHETE = 3,
ALTAR_DICE_ROPEPILE = 4,
ALTAR_DICE_SPECTACLES = 5,
ALTAR_DICE_TELEPACK = 6,
ALTAR_DICE_VAMPIRE = 7,
ALTAR_DICE_WEBGUN = 8,
ALTAR_IDOL_GOLDEN_MONKEY = 9,
ALTAR_KAPALA = 10,
ALTAR_PRESENT_EGGPLANT = 11,
ALTAR_ROCK_WOODENARROW = 12,
ALTAR_ROYAL_JELLY = 13,
ALTAR_USHABTI_CAVEMAN = 14,
ALTAR_USHABTI_TURKEY = 15,
ALTAR_USHABTI_VAMPIRE = 16,
ANUBIS2_JETPACK = 17,
ANUBIS_SCEPTER = 18,
BEG_BOMBBAG = 19,
BEG_TRUECROWN = 20,
BONEPILE_SKELETONKEY = 21,
BONEPILE_SKULL = 22,
CROCMAN_TELEPACK = 23,
CROCMAN_TELEPORTER = 24,
GHOSTJAR_DIAMOND = 25,
GHOST_DIAMOND = 26,
GIANTSPIDER_PASTE = 27,
GOLDENMONKEY_NUGGET = 28,
GOLDENMONKEY_SMALLEMERALD = 29,
GOLDENMONKEY_SMALLNUGGET = 30,
GOLDENMONKEY_SMALLRUBY = 31,
GOLDENMONKEY_SMALLSAPPHIRE = 32,
GOLDENPARACHUTE_SMALLNUGGET = 33,
HANGINGSPIDER_WEBGUN = 34,
ICECAVE_BOULDER = 35,
JIANGSHIASSASSIN_SPIKESHOES = 36,
JIANGSHI_SPRINGSHOES = 37,
KINGU_TABLETOFDESTINY = 38,
LEPRECHAUN_CLOVER = 39,
MATTOCK_BROKENMATTOCK = 40,
MOLE_MATTOCK = 41,
MOSQUITO_HOVERPACK = 42,
MUMMY_DIAMOND = 43,
MUMMY_FLY = 44,
NECROMANCER_RUBY = 45,
OLMEC_BOMB = 46,
OLMEC_CAVEMEN = 47,
OLMEC_UFO = 48,
OSIRIS_EMERALDS = 49,
OSIRIS_TABLETOFDESTINY = 50,
PANGXIE_ACIDBUBBLE = 51,
QUEENBEE_ROYALJELLY = 52,
ROBOT_METALSHIELD = 53,
SCEPTER_ANUBISSPECIALSHOT = 54,
SCEPTER_PLAYERSHOT = 55,
SHOPKEEPER_GOLDCOIN = 56,
SKELETON_SKELETONKEY = 57,
SORCERESS_RUBY = 58,
SPARROW_ROPEPILE = 59,
SPARROW_SKELETONKEY = 60,
TIAMAT_BAT = 61,
TIAMAT_BEE = 62,
TIAMAT_CAVEMAN = 63,
TIAMAT_COBRA = 64,
TIAMAT_HERMITCRAB = 65,
TIAMAT_MONKEY = 66,
TIAMAT_MOSQUITO = 67,
TIAMAT_OCTOPUS = 68,
TIAMAT_OLMITE = 69,
TIAMAT_SCORPION = 70,
TIAMAT_SHOT = 71,
TIAMAT_SNAKE = 72,
TIAMAT_UFO = 73,
TIAMAT_YETI = 74,
TORCH_SMALLNUGGET = 75,
TURKEY_COOKEDTURKEY = 76,
UFO_PARACHUTE = 77,
VAMPIRE_CAPE = 78,
VAN_HORSING_COMPASS = 79,
VAN_HORSING_DIAMOND = 80,
VLAD_VLADSCAPE = 81,
YETIKING_FREEZERAY = 82,
YETIKING_ICESPIRE = 83,
YETIQUEEN_POWERPACK = 84,
YETI_PITCHERSMITT = 85
}
DROPCHANCE = {
BONEBLOCK_SKELETONKEY = 0,
CROCMAN_TELEPACK = 1,
HANGINGSPIDER_WEBGUN = 2,
JIANGSHIASSASSIN_SPIKESHOES = 3,
JIANGSHI_SPRINGSHOES = 4,
MOLE_MATTOCK = 5,
MOSQUITO_HOVERPACK = 6,
ROBOT_METALSHIELD = 7,
SKELETON_SKELETONKEY = 8,
UFO_PARACHUTE = 9,
YETI_PITCHERSMITT = 10
}
ENT_FLAG = {
CAN_BE_STOMPED = 15,
CLIMBABLE = 9,
COLLIDES_WALLS = 13,
DEAD = 29,
ENABLE_BUTTON_PROMPT = 20,
FACING_LEFT = 17,
HAS_BACKITEM = 32,
INDESTRUCTIBLE_OR_SPECIAL_FLOOR = 2,
INTERACT_WITH_SEMISOLIDS = 14,
INTERACT_WITH_WATER = 11,
INTERACT_WITH_WEBS = 21,
INVISIBLE = 1,
IS_PLATFORM = 8,
LOCKED = 22,
NO_GRAVITY = 10,
PASSES_THROUGH_EVERYTHING = 5,
PASSES_THROUGH_OBJECTS = 4,
PASSES_THROUGH_PLAYER = 25,
PAUSE_AI_AND_PHYSICS = 28,
PICKUPABLE = 18,
POWER_STOMPS = 16,
SHOP_FLOOR = 24,
SHOP_ITEM = 23,
SOLID = 3,
STUNNABLE = 12,
TAKE_NO_DAMAGE = 6,
THROWABLE_OR_KNOCKBACKABLE = 7,
USABLE_ITEM = 19
}
ENT_TYPE = {
ACTIVEFLOOR_BONEBLOCK = 599,
ACTIVEFLOOR_BOULDER = 597,
ACTIVEFLOOR_BUBBLE_PLATFORM = 620,
ACTIVEFLOOR_BUSHBLOCK = 600,
ACTIVEFLOOR_CHAINEDPUSHBLOCK = 602,
ACTIVEFLOOR_CHAINED_SPIKEBALL = 606,
ACTIVEFLOOR_CRUSHING_ELEVATOR = 621,
ACTIVEFLOOR_CRUSH_TRAP = 609,
ACTIVEFLOOR_CRUSH_TRAP_LARGE = 610,
ACTIVEFLOOR_DRILL = 608,
ACTIVEFLOOR_EGGSHIPBLOCKER = 595,
ACTIVEFLOOR_EGGSHIPPLATFORM = 594,
ACTIVEFLOOR_ELEVATOR = 615,
ACTIVEFLOOR_FALLING_PLATFORM = 605,
ACTIVEFLOOR_GIANTCLAM_BASE = 616,
ACTIVEFLOOR_KINGU_PLATFORM = 617,
ACTIVEFLOOR_LIGHTARROWPLATFORM = 604,
ACTIVEFLOOR_METALARROWPLATFORM = 603,
ACTIVEFLOOR_OLMEC = 611,
ACTIVEFLOOR_POWDERKEG = 601,
ACTIVEFLOOR_PUSHBLOCK = 598,
ACTIVEFLOOR_REGENERATINGBLOCK = 623,
ACTIVEFLOOR_SHIELD = 622,
ACTIVEFLOOR_SLIDINGWALL = 613,
ACTIVEFLOOR_THINICE = 614,
ACTIVEFLOOR_TIAMAT_PLATFORM = 618,
ACTIVEFLOOR_TIAMAT_SHOULDERPLATFORM = 619,
ACTIVEFLOOR_TIMEDPOWDERKEG = 612,
ACTIVEFLOOR_UNCHAINED_SPIKEBALL = 607,
ACTIVEFLOOR_WOODENLOG_TRAP = 596,
BG_ANUBIS_THRONE = 817,
BG_BASECAMP_BUNKBED = 797,
BG_BASECAMP_DININGTABLE_DISHES = 799,
BG_BASECAMP_DRESSER = 796,
BG_BASECAMP_SHORTCUTSTATIONBANNER = 800,
BG_BASECAMP_SIDETABLE = 798,
BG_BOULDER_STATUE = 826,
BG_CONSTELLATION_CONNECTION = 774,
BG_CONSTELLATION_FLASH = 770,
BG_CONSTELLATION_GLOW = 773,
BG_CONSTELLATION_HALO = 772,
BG_CONSTELLATION_STAR = 771,
BG_COSMIC_FARFLOATINGDEBRIS = 838,
BG_COSMIC_FLOATINGDEBRIS = 837,
BG_CROWN_STATUE = 816,
BG_DOOR = 784,
BG_DOORGEM = 795,
BG_DOOR_BACK_LAYER = 786,
BG_DOOR_BLACK_MARKET = 788,
BG_DOOR_COG = 789,
BG_DOOR_EGGPLANT_WORLD = 791,
BG_DOOR_FRONT_LAYER = 785,
BG_DOOR_GHIST_SHOP = 787,
BG_DOOR_LARGE = 783,
BG_DOOR_OLMEC_SHIP = 790,
BG_DRILL_INDICATOR = 814,
BG_DUAT_BLOODMOON = 823,
BG_DUAT_FARFLOATINGDEBRIS = 825,
BG_DUAT_FLOATINGDEBRIS = 824,
BG_DUAT_LAYER = 820,
BG_DUAT_PYRAMID_LAYER = 822,
BG_DUAT_SIDE_DECORATION = 821,
BG_EGGSAC_STAINS = 839,
BG_EGGSHIP_ROOM = 775,
BG_ENDINGTREASURE_HUNDUN_GOLD = 777,
BG_ICE_CRYSTAL = 819,
BG_KALI_STATUE = 807,
BG_LEVEL_BACKWALL = 778,
BG_LEVEL_BOMB_SOOT = 781,
BG_LEVEL_COSMIC = 836,
BG_LEVEL_DECO = 779,
BG_LEVEL_POWEREDBOMB_SOOT = 782,
BG_LEVEL_SHADOW = 780,
BG_MOAI_STATUE = 827,
BG_MOTHER_STATUE = 833,
BG_OLMEC_PILLAR = 818,
BG_OUROBORO = 794,
BG_PALACE_CANDLE = 831,
BG_PALACE_DISHES = 832,
BG_PARENTSHIP_LANDINGLEG = 776,
BG_SHOP = 801,
BG_SHOPWANTEDPORTRAIT = 805,
BG_SHOPWANTEDPOSTER = 804,
BG_SHOP_BACKDOOR = 803,
BG_SHOP_DICEPOSTER = 806,
BG_SHOP_ENTRANCEDOOR = 802,
BG_SPACE = 757,
BG_SURFACE_BACKGROUNDSEAM = 769,
BG_SURFACE_ENTITY = 767,
BG_SURFACE_LAYER = 764,
BG_SURFACE_LAYER_HOLE = 766,
BG_SURFACE_LAYER_OCCLUDER = 765,
BG_SURFACE_MOVING_STAR = 762,
BG_SURFACE_NEBULA = 763,
BG_SURFACE_OLMEC_LAYER = 768,
BG_SURFACE_SHOOTING_STAR = 759,
BG_SURFACE_SHOOTING_STAR_TRAIL = 760,
BG_SURFACE_SHOOTING_STAR_TRAIL_PARTICLE = 761,
BG_SURFACE_STAR = 758,
BG_TUTORIAL_SIGN_BACK = 792,
BG_TUTORIAL_SIGN_FRONT = 793,
BG_UDJATSOCKET_DECORATION = 813,
BG_VAT_BACK = 828,
BG_VAT_FRONT = 830,
BG_VAT_SHOPKEEPER_PRIME = 829,
BG_VLAD_WINDOW = 815,
BG_WATER_FOUNTAIN = 834,
BG_YAMA_BODY = 835,
CHAR_AMAZON = 200,
CHAR_ANA_SPELUNKY = 194,
CHAR_AU = 207,
CHAR_BANDA = 198,
CHAR_CLASSIC_GUY = 213,
CHAR_COCO_VON_DIAMONDS = 202,
CHAR_COLIN_NORTHWARD = 196,
CHAR_DEMI_VON_DIAMONDS = 208,
CHAR_DIRK_YAMAOKA = 211,
CHAR_EGGPLANT_CHILD = 216,
CHAR_GREEN_GIRL = 199,
CHAR_GUY_SPELUNKY = 212,
CHAR_HIREDHAND = 215,
CHAR_LISE_SYSTEM = 201,
CHAR_MANFRED_TUNNEL = 203,
CHAR_MARGARET_TUNNEL = 195,
CHAR_OTAKU = 204,
CHAR_PILOT = 209,
CHAR_PRINCESS_AIRYN = 210,
CHAR_ROFFY_D_SLOTH = 197,
CHAR_TINA_FLAN = 205,
CHAR_VALERIE_CRUMP = 206,
DECORATION_BABYLON = 127,
DECORATION_BABYLONBUSH = 138,
DECORATION_BABYLON_FLOWER = 141,
DECORATION_BABYLON_HANGING_FLOWER = 144,
DECORATION_BABYLON_NEON_SIGN = 145,
DECORATION_BASECAMPDOGSIGN = 152,
DECORATION_BASECAMPSIGN = 151,
DECORATION_BEEHIVE = 162,
DECORATION_BG_TRANSITIONCOVER = 128,
DECORATION_BONEBLOCK = 121,
DECORATION_BORDER = 115,
DECORATION_BRANCH = 146,
DECORATION_BUSHBLOCK = 122,
DECORATION_CHAINANDBLOCKS_CHAINDECORATION = 163,
DECORATION_COG = 169,
DECORATION_CONVEYORBELT_RAILING = 164,
DECORATION_CROSS_BEAM = 131,
DECORATION_DUAT = 171,
DECORATION_DUAT_DARKSAND = 173,
DECORATION_DUAT_DESTRUCTIBLE_BG = 174,
DECORATION_DUAT_SAND = 172,
DECORATION_DWELLINGBUSH = 136,
DECORATION_EGGPLANT_ALTAR = 180,
DECORATION_GENERIC = 116,
DECORATION_GUTS = 179,
DECORATION_HANGING_BANNER = 134,
DECORATION_HANGING_HIDE = 132,
DECORATION_HANGING_SEAWEED = 133,
DECORATION_HANGING_WIRES = 135,
DECORATION_JUNGLE = 119,
DECORATION_JUNGLEBUSH = 137,
DECORATION_JUNGLE_FLOWER = 140,
DECORATION_JUNGLE_HANGING_FLOWER = 143,
DECORATION_KELP = 166,
DECORATION_LARGETOMB = 185,
DECORATION_MINEWOOD = 120,
DECORATION_MINEWOOD_POLE = 129,
DECORATION_MOTHERSHIP = 170,
DECORATION_MOTHER_STATUE_HAND = 181,
DECORATION_MUSHROOM_HAT = 160,
DECORATION_PAGODA = 125,
DECORATION_PAGODA_POLE = 130,
DECORATION_PALACE = 175,
DECORATION_PALACE_CHANDELIER = 177,
DECORATION_PALACE_PORTRAIT = 178,
DECORATION_PALACE_SIGN = 176,
DECORATION_PIPE = 182,
DECORATION_POTOFGOLD_RAINBOW = 189,
DECORATION_REGENERATING_BORDER = 187,
DECORATION_REGENERATING_SMALL_BLOCK = 186,
DECORATION_SHOPFORE = 148,
DECORATION_SHOPSIGN = 149,
DECORATION_SHOPSIGNICON = 150,
DECORATION_SKULLDROP_TRAP = 188,
DECORATION_SLIDINGWALL_CHAINDECORATION = 167,
DECORATION_SPIKES_BLOOD = 147,
DECORATION_STONE = 123,
DECORATION_SUNKEN = 126,
DECORATION_SUNKEN_BRIDGE = 183,
DECORATION_SURFACE = 117,
DECORATION_SURFACE_COVER = 118,
DECORATION_TEMPLE = 124,
DECORATION_TEMPLE_SAND = 168,
DECORATION_THORN_VINE = 161,
DECORATION_TIDEPOOLBUSH = 139,
DECORATION_TIDEPOOL_CORAL = 142,
DECORATION_TOMB = 184,
DECORATION_TREE = 153,
DECORATION_TREETRUNK_BROKEN = 157,
DECORATION_TREETRUNK_CLIMBINGHINT = 154,
DECORATION_TREETRUNK_TOPBACK = 156,
DECORATION_TREETRUNK_TOPFRONT = 155,
DECORATION_TREE_VINE = 159,
DECORATION_TREE_VINE_TOP = 158,
DECORATION_VLAD = 165,
EMBED_GOLD = 190,
EMBED_GOLD_BIG = 191,
FLOORSTYLED_BABYLON = 106,
FLOORSTYLED_BEEHIVE = 108,
FLOORSTYLED_COG = 110,
FLOORSTYLED_DUAT = 112,
FLOORSTYLED_GUTS = 114,
FLOORSTYLED_MINEWOOD = 102,
FLOORSTYLED_MOTHERSHIP = 111,
FLOORSTYLED_PAGODA = 105,
FLOORSTYLED_PALACE = 113,
FLOORSTYLED_STONE = 103,
FLOORSTYLED_SUNKEN = 107,
FLOORSTYLED_TEMPLE = 104,
FLOORSTYLED_VLAD = 109,
FLOOR_ALTAR = 47,
FLOOR_ARROW_TRAP = 40,
FLOOR_BASECAMP_DININGTABLE = 8,
FLOOR_BASECAMP_LONGTABLE = 9,
FLOOR_BASECAMP_SINGLEBED = 7,
FLOOR_BIGSPEAR_TRAP = 79,
FLOOR_BORDERTILE = 1,
FLOOR_BORDERTILE_METAL = 2,
FLOOR_BORDERTILE_OCTOPUS = 3,
FLOOR_CHAINANDBLOCKS_CEILING = 61,
FLOOR_CHAINANDBLOCKS_CHAIN = 62,
FLOOR_CHAIN_CEILING = 63,
FLOOR_CHALLENGE_ENTRANCE = 87,
FLOOR_CHALLENGE_WAITROOM = 88,
FLOOR_CLIMBING_POLE = 20,
FLOOR_CONVEYORBELT_LEFT = 64,
FLOOR_CONVEYORBELT_RIGHT = 65,
FLOOR_DICE_FORCEFIELD = 86,
FLOOR_DOOR_COG = 31,
FLOOR_DOOR_EGGPLANT_WORLD = 36,
FLOOR_DOOR_EGGSHIP = 33,
FLOOR_DOOR_EGGSHIP_ATREZZO = 34,
FLOOR_DOOR_EGGSHIP_ROOM = 35,
FLOOR_DOOR_ENTRANCE = 22,
FLOOR_DOOR_EXIT = 23,
FLOOR_DOOR_GHISTSHOP = 28,
FLOOR_DOOR_LAYER = 26,
FLOOR_DOOR_LAYER_DROP_HELD = 27,
FLOOR_DOOR_LOCKED = 29,
FLOOR_DOOR_LOCKED_PEN = 30,
FLOOR_DOOR_MAIN_EXIT = 24,
FLOOR_DOOR_MOAI_STATUE = 32,
FLOOR_DOOR_PLATFORM = 37,
FLOOR_DOOR_STARTING_EXIT = 25,
FLOOR_DUAT_ALTAR = 71,
FLOOR_DUSTWALL = 70,
FLOOR_EGGPLANT_ALTAR = 74,
FLOOR_EMPRESS_GRAVE = 96,
FLOOR_EXCALIBUR_STONE = 69,
FLOOR_FACTORY_GENERATOR = 66,
FLOOR_FORCEFIELD = 85,
FLOOR_FORCEFIELD_TOP = 90,
FLOOR_GENERIC = 4,
FLOOR_GIANTFROG_PLATFORM = 83,
FLOOR_GROWABLE_CLIMBING_POLE = 21,
FLOOR_GROWABLE_VINE = 19,
FLOOR_HORIZONTAL_FORCEFIELD = 91,
FLOOR_HORIZONTAL_FORCEFIELD_TOP = 92,
FLOOR_ICE = 72,
FLOOR_IDOL_BLOCK = 48,
FLOOR_IDOL_TRAP_CEILING = 49,
FLOOR_JUNGLE = 10,
FLOOR_JUNGLE_SPEAR_TRAP = 43,
FLOOR_LADDER = 15,
FLOOR_LADDER_PLATFORM = 16,
FLOOR_LASER_TRAP = 45,
FLOOR_LION_TRAP = 44,
FLOOR_MOAI_PLATFORM = 75,
FLOOR_MOTHER_STATUE = 81,
FLOOR_MOTHER_STATUE_PLATFORM = 82,
FLOOR_MUSHROOM_BASE = 55,
FLOOR_MUSHROOM_HAT_PLATFORM = 58,
FLOOR_MUSHROOM_TOP = 57,
FLOOR_MUSHROOM_TRUNK = 56,
FLOOR_PAGODA_PLATFORM = 14,
FLOOR_PALACE_BOOKCASE_PLATFORM = 100,
FLOOR_PALACE_CHANDELIER_PLATFORM = 99,
FLOOR_PALACE_TABLE_PLATFORM = 97,
FLOOR_PALACE_TRAY_PLATFORM = 98,
FLOOR_PEN = 93,
FLOOR_PIPE = 78,
FLOOR_PLATFORM = 13,
FLOOR_POISONED_ARROW_TRAP = 41,
FLOOR_QUICKSAND = 68,
FLOOR_SHOPKEEPER_GENERATOR = 76,
FLOOR_SLIDINGWALL_CEILING = 67,
FLOOR_SPARK_TRAP = 46,
FLOOR_SPIKEBALL_CEILING = 60,
FLOOR_SPIKES = 38,
FLOOR_SPIKES_UPSIDEDOWN = 39,
FLOOR_SPRING_TRAP = 73,
FLOOR_STICKYTRAP_CEILING = 80,
FLOOR_STORAGE = 50,
FLOOR_SUNCHALLENGE_GENERATOR = 77,
FLOOR_SURFACE = 5,
FLOOR_SURFACE_HIDDEN = 6,
FLOOR_TELEPORTINGBORDER = 84,
FLOOR_TENTACLE_BOTTOM = 101,
FLOOR_THORN_VINE = 59,
FLOOR_TIMED_FORCEFIELD = 89,
FLOOR_TOMB = 94,
FLOOR_TOTEM_TRAP = 42,
FLOOR_TREE_BASE = 51,
FLOOR_TREE_BRANCH = 54,
FLOOR_TREE_TOP = 53,
FLOOR_TREE_TRUNK = 52,
FLOOR_TUNNEL_CURRENT = 11,
FLOOR_TUNNEL_NEXT = 12,
FLOOR_VINE = 17,
FLOOR_VINE_TREE_TOP = 18,
FLOOR_YAMA_PLATFORM = 95,
FX_ALIENBLAST = 692,
FX_ALIENBLAST_RETICULE_EXTERNAL = 691,
FX_ALIENBLAST_RETICULE_INTERNAL = 690,
FX_ALIENQUEEN_EYE = 689,
FX_ALIENQUEEN_EYEBALL = 688,
FX_ANKH_BACKGLOW = 750,
FX_ANKH_BROKENPIECE = 753,
FX_ANKH_FALLINGSPARK = 749,
FX_ANKH_FRONTGLOW = 751,
FX_ANKH_LIGHTBEAM = 752,
FX_ANKH_ROTATINGSPARK = 748,
FX_ANUBIS_SPECIAL_SHOT_RETICULE = 733,
FX_APEP_FIRE = 679,
FX_APEP_MOUTHPIECE = 680,
FX_AXOLOTL_HEAD_ENTERING_DOOR = 740,
FX_BASECAMP_COUCH_ARM = 741,
FX_BIRDIES = 634,
FX_BUTTON = 668,
FX_BUTTON_DIALOG = 669,
FX_CINEMATIC_BLACKBAR = 661,
FX_COMPASS = 644,
FX_CRITTERFIREFLY_LIGHT = 739,
FX_CRUSHINGELEVATOR_DECO = 715,
FX_CRUSHINGELEVATOR_FILL = 714,
FX_DIEINDICATOR = 709,
FX_DRILL_TURNING = 681,
FX_EGGSHIP_CENTERJETFLAME = 628,
FX_EGGSHIP_DOOR = 627,
FX_EGGSHIP_HOOK_CHAIN = 743,
FX_EGGSHIP_JETFLAME = 629,
FX_EGGSHIP_SHADOW = 630,
FX_EGGSHIP_SHELL = 626,
FX_EMPRESS = 742,
FX_EXPLOSION = 635,
FX_HORIZONTALLASERBEAM = 712,
FX_HUNDUN_EGG_CRACK = 719,
FX_HUNDUN_EYE = 724,
FX_HUNDUN_EYEBALL = 723,
FX_HUNDUN_EYELID = 722,
FX_HUNDUN_LIMB_CALF = 717,
FX_HUNDUN_LIMB_FOOT = 718,
FX_HUNDUN_LIMB_THIGH = 716,
FX_HUNDUN_NECK_PIECE = 720,
FX_HUNDUN_WING = 721,
FX_INK_BLINDNESS = 671,
FX_INK_SPLAT = 672,
FX_JETPACKFLAME = 655,
FX_KINGU_HEAD = 683,
FX_KINGU_LIMB = 686,
FX_KINGU_PLATFORM = 685,
FX_KINGU_SHADOW = 684,
FX_KINGU_SLIDING = 687,
FX_LAMASSU_ATTACK = 738,
FX_LASERBEAM = 711,
FX_LAVA_BUBBLE = 673,
FX_LAVA_GLOW = 674,
FX_LEADER_FLAG = 682,
FX_MAIN_EXIT_DOOR = 633,
FX_MECH_COLLAR = 734,
FX_MEGAJELLYFISH_BOTTOM = 730,
FX_MEGAJELLYFISH_CROWN = 726,
FX_MEGAJELLYFISH_EYE = 727,
FX_MEGAJELLYFISH_FLIPPER = 729,
FX_MEGAJELLYFISH_STAR = 728,
FX_MEGAJELLYFISH_TAIL = 731,
FX_MEGAJELLYFISH_TAIL_BG = 732,
FX_MINIGAME_SHIP_CENTERJETFLAME = 745,
FX_MINIGAME_SHIP_DOOR = 744,
FX_MINIGAME_SHIP_JETFLAME = 746,
FX_MODERNEXPLOSION = 637,
FX_NECROMANCER_ANKH = 659,
FX_OLMECPART_FLOATER = 662,
FX_OLMECPART_LARGE = 663,
FX_OLMECPART_MEDIUM = 664,
FX_OLMECPART_SMALL = 665,
FX_OLMECPART_SMALLEST = 666,
FX_OUROBORO_HEAD = 639,
FX_OUROBORO_OCCLUDER = 638,
FX_OUROBORO_TAIL = 640,
FX_OUROBORO_TEXT = 641,
FX_OUROBORO_TRAIL = 642,
FX_PICKUPEFFECT = 653,
FX_PLAYERINDICATOR = 646,
FX_PLAYERINDICATORPORTRAIT = 647,
FX_PORTAL = 725,
FX_POWEREDEXPLOSION = 636,
FX_QUICKSAND_DUST = 735,
FX_QUICKSAND_RUBBLE = 736,
FX_SALEDIALOG_CONTAINER = 649,
FX_SALEDIALOG_ICON = 652,
FX_SALEDIALOG_TITLE = 650,
FX_SALEDIALOG_VALUE = 651,
FX_SALEICON = 648,
FX_SHADOW = 631,
FX_SHOTGUNBLAST = 654,
FX_SLEEP_BUBBLE = 670,
FX_SMALLFLAME = 656,
FX_SORCERESS_ATTACK = 737,
FX_SPARK = 693,
FX_SPARK_SMALL = 694,
FX_SPECIALCOMPASS = 645,
FX_SPRINGTRAP_RING = 657,
FX_STORAGE_INDICATOR = 710,
FX_TELEPORTSHADOW = 660,
FX_TIAMAT_ARM_LEFT1 = 702,
FX_TIAMAT_ARM_LEFT2 = 703,
FX_TIAMAT_ARM_LEFT3 = 704,
FX_TIAMAT_ARM_RIGHT1 = 705,
FX_TIAMAT_ARM_RIGHT2 = 706,
FX_TIAMAT_HEAD = 708,
FX_TIAMAT_NECK = 707,
FX_TIAMAT_TAIL = 697,
FX_TIAMAT_TAIL_DECO1 = 698,
FX_TIAMAT_TAIL_DECO2 = 699,
FX_TIAMAT_TAIL_DECO3 = 700,
FX_TIAMAT_THRONE = 695,
FX_TIAMAT_TORSO = 701,
FX_TIAMAT_WAIST = 696,
FX_TORNJOURNALPAGE = 632,
FX_UNDERWATER_BUBBLE = 675,
FX_VAT_BUBBLE = 713,
FX_WATER_DROP = 676,
FX_WATER_SPLASH = 677,
FX_WATER_SURFACE = 678,
FX_WEBBEDEFFECT = 667,
FX_WITCHDOCTOR_HINT = 658,
ITEM_ACIDBUBBLE = 391,
ITEM_ACIDSPIT = 389,
ITEM_ALIVE_EMBEDDED_ON_ICE = 463,
ITEM_ANUBIS_COFFIN = 453,
ITEM_AUTOWALLTORCH = 415,
ITEM_AXOLOTL_BUBBLESHOT = 456,
ITEM_BASECAMP_TUTORIAL_SIGN = 408,
ITEM_BIG_SPEAR = 364,
ITEM_BLOOD = 352,
ITEM_BOMB = 347,
ITEM_BONES = 483,
ITEM_BOOMBOX = 409,
ITEM_BOOMERANG = 581,
ITEM_BROKENEXCALIBUR = 584,
ITEM_BROKEN_ARROW = 372,
ITEM_BROKEN_MATTOCK = 428,
ITEM_BULLET = 424,
ITEM_CAMERA = 578,
ITEM_CAPE = 562,
ITEM_CHAIN = 431,
ITEM_CHAIN_LASTPIECE = 432,
ITEM_CHEST = 395,
ITEM_CLIMBABLE_ROPE = 350,
ITEM_CLONEGUN = 587,
ITEM_CLONEGUNSHOT = 426,
ITEM_COFFIN = 435,
ITEM_CONSTRUCTION_SIGN = 405,
ITEM_COOKFIRE = 484,
ITEM_CRABMAN_ACIDBUBBLE = 392,
ITEM_CRABMAN_CLAW = 393,
ITEM_CRABMAN_CLAWCHAIN = 394,
ITEM_CRATE = 402,
ITEM_CROSSBOW = 577,
ITEM_CURSEDPOT = 481,
ITEM_CURSING_CLOUD = 440,
ITEM_DEPLOYED_PARACHUTE = 464,
ITEM_DIAMOND = 497,
ITEM_DICE_BET = 449,
ITEM_DICE_PRIZE_DISPENSER = 450,
ITEM_DIE = 448,
ITEM_DMCRATE = 403,
ITEM_EGGPLANT = 487,
ITEM_EGGSAC = 492,
ITEM_EGGSHIP = 353,
ITEM_EGGSHIP_HOOK = 455,
ITEM_EMERALD = 498,
ITEM_EMERALD_SMALL = 503,
ITEM_EMPRESS_GRAVE = 470,
ITEM_ENDINGTREASURE_HUNDUN = 398,
ITEM_ENDINGTREASURE_TIAMAT = 397,
ITEM_EXCALIBUR = 583,
ITEM_FIREBALL = 385,
ITEM_FLAMETHROWER_FIREBALL = 387,
ITEM_FLOATING_ORB = 491,
ITEM_FLY = 436,
ITEM_FREEZERAY = 576,
ITEM_FREEZERAYSHOT = 425,
ITEM_FROZEN_LIQUID = 462,
ITEM_GHIST_PRESENT = 423,
ITEM_GIANTCLAM_TOP = 445,
ITEM_GIANTFLY_HEAD = 467,
ITEM_GIANTSPIDER_WEBSHOT = 368,
ITEM_GOLDBAR = 495,
ITEM_GOLDBARS = 496,
ITEM_GOLDCOIN = 502,
ITEM_HANGANCHOR = 370,
ITEM_HANGSTRAND = 369,
ITEM_HOLDTHEIDOL = 359,
ITEM_HONEY = 444,
ITEM_HORIZONTALLASERBEAM = 452,
ITEM_HOUYIBOW = 588,
ITEM_HOVERPACK = 570,
ITEM_HUNDUN_FIREBALL = 386,
ITEM_ICECAGE = 427,
ITEM_ICESPIRE = 488,
ITEM_IDOL = 356,
ITEM_INKSPIT = 390,
ITEM_JETPACK = 565,
ITEM_JETPACK_MECH = 566,
ITEM_JUNGLE_SPEAR_COSMETIC = 361,
ITEM_JUNGLE_SPEAR_DAMAGING = 362,
ITEM_KEY = 399,
ITEM_LAMASSU_LASER_SHOT = 380,
ITEM_LAMP = 418,
ITEM_LAMPFLAME = 419,
ITEM_LANDMINE = 439,
ITEM_LASERBEAM = 451,
ITEM_LASERTRAP_SHOT = 382,
ITEM_LAVAPOT = 485,
ITEM_LEAF = 388,
ITEM_LIGHT_ARROW = 374,
ITEM_LION_SPEAR = 363,
ITEM_LITWALLTORCH = 414,
ITEM_LOCKEDCHEST = 400,
ITEM_LOCKEDCHEST_KEY = 401,
ITEM_MACHETE = 582,
ITEM_MADAMETUSK_IDOL = 357,
ITEM_MADAMETUSK_IDOLNOTE = 358,
ITEM_MATTOCK = 580,
ITEM_METAL_ARROW = 373,
ITEM_METAL_SHIELD = 590,
ITEM_MINIGAME_ASTEROID = 477,
ITEM_MINIGAME_ASTEROID_BG = 476,
ITEM_MINIGAME_BROKEN_ASTEROID = 478,
ITEM_MINIGAME_SHIP = 474,
ITEM_MINIGAME_UFO = 475,
ITEM_NUGGET = 501,
ITEM_NUGGET_SMALL = 506,
ITEM_OLMECCANNON_BOMBS = 437,
ITEM_OLMECCANNON_UFO = 438,
ITEM_OLMECSHIP = 355,
ITEM_PALACE_CANDLE = 489,
ITEM_PALACE_CANDLE_FLAME = 468,
ITEM_PARENTSSHIP = 354,
ITEM_PASTEBOMB = 348,
ITEM_PICKUP_ANKH = 537,
ITEM_PICKUP_BOMBBAG = 513,
ITEM_PICKUP_BOMBBOX = 514,
ITEM_PICKUP_CLIMBINGGLOVES = 523,
ITEM_PICKUP_CLOVER = 519,
ITEM_PICKUP_COMPASS = 528,
ITEM_PICKUP_COOKEDTURKEY = 516,
ITEM_PICKUP_CROWN = 534,
ITEM_PICKUP_EGGPLANTCROWN = 535,
ITEM_PICKUP_ELIXIR = 518,
ITEM_PICKUP_GIANTFOOD = 517,
ITEM_PICKUP_HEDJET = 533,
ITEM_PICKUP_JOURNAL = 510,
ITEM_PICKUP_KAPALA = 532,
ITEM_PICKUP_PARACHUTE = 530,
ITEM_PICKUP_PASTE = 527,
ITEM_PICKUP_PITCHERSMITT = 524,
ITEM_PICKUP_PLAYERBAG = 541,
ITEM_PICKUP_ROPE = 511,
ITEM_PICKUP_ROPEPILE = 512,
ITEM_PICKUP_ROYALJELLY = 515,
ITEM_PICKUP_SEEDEDRUNSUNLOCKER = 520,
ITEM_PICKUP_SKELETON_KEY = 539,
ITEM_PICKUP_SPECIALCOMPASS = 529,
ITEM_PICKUP_SPECTACLES = 522,
ITEM_PICKUP_SPIKESHOES = 526,
ITEM_PICKUP_SPRINGSHOES = 525,
ITEM_PICKUP_TABLETOFDESTINY = 538,
ITEM_PICKUP_TORNJOURNALPAGE = 509,
ITEM_PICKUP_TRUECROWN = 536,
ITEM_PICKUP_UDJATEYE = 531,
ITEM_PLASMACANNON = 585,
ITEM_PLASMACANNON_SHOT = 375,
ITEM_PLAYERGHOST = 446,
ITEM_PLAYERGHOST_BREATH = 447,
ITEM_POT = 480,
ITEM_POTOFGOLD = 457,
ITEM_POWERPACK = 572,
ITEM_POWERUP_ANKH = 558,
ITEM_POWERUP_CLIMBING_GLOVES = 544,
ITEM_POWERUP_COMPASS = 552,
ITEM_POWERUP_CROWN = 555,
ITEM_POWERUP_EGGPLANTCROWN = 556,
ITEM_POWERUP_HEDJET = 554,
ITEM_POWERUP_KAPALA = 547,
ITEM_POWERUP_PARACHUTE = 551,
ITEM_POWERUP_PASTE = 543,
ITEM_POWERUP_PITCHERSMITT = 549,
ITEM_POWERUP_SKELETON_KEY = 560,
ITEM_POWERUP_SPECIALCOMPASS = 553,
ITEM_POWERUP_SPECTACLES = 548,
ITEM_POWERUP_SPIKE_SHOES = 545,
ITEM_POWERUP_SPRING_SHOES = 546,
ITEM_POWERUP_TABLETOFDESTINY = 559,
ITEM_POWERUP_TRUECROWN = 557,
ITEM_POWERUP_UDJATEYE = 550,
ITEM_PRESENT = 422,
ITEM_PUNISHBALL = 429,
ITEM_PUNISHCHAIN = 430,
ITEM_PURCHASABLE_CAPE = 564,
ITEM_PURCHASABLE_HOVERPACK = 571,
ITEM_PURCHASABLE_JETPACK = 567,
ITEM_PURCHASABLE_POWERPACK = 573,
ITEM_PURCHASABLE_TELEPORTER_BACKPACK = 569,
ITEM_REDLANTERN = 420,
ITEM_REDLANTERNFLAME = 421,
ITEM_ROCK = 365,
ITEM_ROPE = 349,
ITEM_RUBBLE = 643,
ITEM_RUBY = 500,
ITEM_RUBY_SMALL = 505,
ITEM_SAPPHIRE = 499,
ITEM_SAPPHIRE_SMALL = 504,
ITEM_SCEPTER = 586,
ITEM_SCEPTER_ANUBISSHOT = 376,
ITEM_SCEPTER_ANUBISSPECIALSHOT = 377,
ITEM_SCEPTER_PLAYERSHOT = 378,
ITEM_SCRAP = 486,
ITEM_SHORTCUT_SIGN = 406,
ITEM_SHOTGUN = 575,
ITEM_SKULL = 482,
ITEM_SKULLDROPTRAP = 461,
ITEM_SKULLDROPTRAP_SKULL = 490,
ITEM_SLIDINGWALL_CHAIN = 433,
ITEM_SLIDINGWALL_CHAIN_LASTPIECE = 434,
ITEM_SLIDINGWALL_SWITCH = 465,
ITEM_SLIDINGWALL_SWITCH_REWARD = 466,
ITEM_SNAP_TRAP = 469,
ITEM_SORCERESS_DAGGER_SHOT = 381,
ITEM_SPARK = 383,
ITEM_SPEEDRUN_SIGN = 407,
ITEM_SPIKES = 454,
ITEM_STICKYTRAP_BALL = 460,
ITEM_STICKYTRAP_LASTPIECE = 459,
ITEM_STICKYTRAP_PIECE = 458,
ITEM_TELEPORTER = 579,
ITEM_TELEPORTER_BACKPACK = 568,
ITEM_TELESCOPE = 411,
ITEM_TENTACLE = 471,
ITEM_TENTACLE_LAST_PIECE = 473,
ITEM_TENTACLE_PIECE = 472,
ITEM_TIAMAT_SHOT = 384,
ITEM_TORCH = 416,
ITEM_TORCHFLAME = 417,
ITEM_TOTEM_SPEAR = 360,
ITEM_TURKEY_NECK = 443,
ITEM_TUTORIAL_MONSTER_SIGN = 404,
ITEM_TV = 410,
ITEM_UDJAT_SOCKET = 441,
ITEM_UFO_LASER_SHOT = 379,
ITEM_UNROLLED_ROPE = 351,
ITEM_USHABTI = 442,
ITEM_VAULTCHEST = 396,
ITEM_VLADS_CAPE = 563,
ITEM_WALLTORCH = 412,
ITEM_WALLTORCHFLAME = 413,
ITEM_WEB = 366,
ITEM_WEBGUN = 574,
ITEM_WEBSHOT = 367,
ITEM_WHIP = 345,
ITEM_WHIP_FLAME = 346,
ITEM_WOODEN_ARROW = 371,
ITEM_WOODEN_SHIELD = 589,
LIQUID_COARSE_WATER = 908,
LIQUID_IMPOSTOR_LAKE = 909,
LIQUID_LAVA = 910,
LIQUID_STAGNANT_LAVA = 911,
LIQUID_WATER = 907,
LOGICAL_ANCHOVY_FLOCK = 871,
LOGICAL_ARROW_TRAP_TRIGGER = 847,
LOGICAL_BIGSPEAR_TRAP_TRIGGER = 882,
LOGICAL_BLACKMARKET_DOOR = 846,
LOGICAL_BOULDERSPAWNER = 878,
LOGICAL_BURNING_ROPE_EFFECT = 861,
LOGICAL_CAMERA_ANCHOR = 857,
LOGICAL_CAMERA_FLASH = 863,
LOGICAL_CINEMATIC_ANCHOR = 860,
LOGICAL_CONSTELLATION = 842,
LOGICAL_CONVEYORBELT_SOUND_SOURCE = 870,
LOGICAL_CRUSH_TRAP_TRIGGER = 851,
LOGICAL_CURSED_EFFECT = 856,
LOGICAL_DM_ALIEN_BLAST = 887,
LOGICAL_DM_CAMERA_ANCHOR = 885,
LOGICAL_DM_CRATE_SPAWNING = 888,
LOGICAL_DM_DEATH_MIST = 886,
LOGICAL_DM_IDOL_SPAWNING = 889,
LOGICAL_DM_SPAWN_POINT = 884,
LOGICAL_DOOR = 844,
LOGICAL_DOOR_AMBIENT_SOUND = 845,
LOGICAL_DUSTWALL_APEP = 862,
LOGICAL_DUSTWALL_SOUND_SOURCE = 875,
LOGICAL_EGGPLANT_THROWER = 892,
LOGICAL_FROST_BREATH = 891,
LOGICAL_ICESLIDING_SOUND_SOURCE = 876,
LOGICAL_JUNGLESPEAR_TRAP_TRIGGER = 849,
LOGICAL_LAVA_DRAIN = 880,
LOGICAL_LIMB_ANCHOR = 865,
LOGICAL_MINIGAME = 893,
LOGICAL_MUMMYFLIES_SOUND_SOURCE = 872,
LOGICAL_ONFIRE_EFFECT = 854,
LOGICAL_OUROBORO_CAMERA_ANCHOR = 858,
LOGICAL_OUROBORO_CAMERA_ANCHOR_ZOOMIN = 859,
LOGICAL_PIPE_TRAVELER_SOUND_SOURCE = 877,
LOGICAL_PLATFORM_SPAWNER = 883,
LOGICAL_POISONED_EFFECT = 855,
LOGICAL_PORTAL = 866,
LOGICAL_QUICKSAND_AMBIENT_SOUND_SOURCE = 873,
LOGICAL_QUICKSAND_SOUND_SOURCE = 874,
LOGICAL_REGENERATING_BLOCK = 881,
LOGICAL_ROOM_LIGHT = 864,
LOGICAL_SHOOTING_STARS_SPAWNER = 843,
LOGICAL_SPIKEBALL_TRIGGER = 850,
LOGICAL_SPLASH_BUBBLE_GENERATOR = 890,
LOGICAL_STATICLAVA_SOUND_SOURCE = 867,
LOGICAL_STREAMLAVA_SOUND_SOURCE = 868,
LOGICAL_STREAMWATER_SOUND_SOURCE = 869,
LOGICAL_TENTACLE_TRIGGER = 852,
LOGICAL_TOTEM_TRAP_TRIGGER = 848,
LOGICAL_WATER_DRAIN = 879,
LOGICAL_WET_EFFECT = 853,
MIDBG = 808,
MIDBG_BEEHIVE = 811,
MIDBG_PALACE_STYLEDDECORATION = 810,
MIDBG_PLATFORM_STRUCTURE = 812,
MIDBG_STYLEDDECORATION = 809,
MONS_ALIEN = 267,
MONS_ALIENQUEEN = 271,
MONS_AMMIT = 280,
MONS_ANUBIS = 253,
MONS_ANUBIS2 = 259,
MONS_APEP_BODY = 255,
MONS_APEP_HEAD = 254,
MONS_APEP_TAIL = 256,
MONS_BAT = 224,
MONS_BEE = 278,
MONS_BODYGUARD = 306,
MONS_CATMUMMY = 251,
MONS_CAVEMAN = 225,
MONS_CAVEMAN_BOSS = 232,
MONS_CAVEMAN_SHOPKEEPER = 226,
MONS_COBRA = 248,
MONS_CRABMAN = 311,
MONS_CRITTERANCHOVY = 335,
MONS_CRITTERBUTTERFLY = 332,
MONS_CRITTERCRAB = 336,
MONS_CRITTERDRONE = 340,
MONS_CRITTERDUNGBEETLE = 331,
MONS_CRITTERFIREFLY = 339,
MONS_CRITTERFISH = 334,
MONS_CRITTERLOCUST = 337,
MONS_CRITTERPENGUIN = 338,
MONS_CRITTERSLIME = 341,
MONS_CRITTERSNAIL = 333,
MONS_CROCMAN = 247,
MONS_EGGPLANT_MINISTER = 290,
MONS_FEMALE_JIANGSHI = 261,
MONS_FIREBUG = 241,
MONS_FIREBUG_UNCHAINED = 242,
MONS_FIREFROG = 284,
MONS_FISH = 262,
MONS_FROG = 283,
MONS_GHIST = 314,
MONS_GHIST_SHOPKEEPER = 315,
MONS_GHOST = 317,
MONS_GHOST_MEDIUM_HAPPY = 319,
MONS_GHOST_MEDIUM_SAD = 318,
MONS_GHOST_SMALL_ANGRY = 320,
MONS_GHOST_SMALL_HAPPY = 323,
MONS_GHOST_SMALL_SAD = 321,
MONS_GHOST_SMALL_SURPRISED = 322,
MONS_GIANTFISH = 265,
MONS_GIANTFLY = 288,
MONS_GIANTFROG = 285,
MONS_GIANTSPIDER = 223,
MONS_GOLDMONKEY = 309,
MONS_GRUB = 286,
MONS_HANGSPIDER = 222,
MONS_HERMITCRAB = 264,
MONS_HORNEDLIZARD = 230,
MONS_HUNDUN = 292,
MONS_HUNDUNS_SERVANT = 307,
MONS_HUNDUN_BIRDHEAD = 293,
MONS_HUNDUN_SNAKEHEAD = 294,
MONS_IMP = 243,
MONS_JIANGSHI = 260,
MONS_JUMPDOG = 289,
MONS_KINGU = 281,
MONS_LAMASSU = 274,
MONS_LAVAMANDER = 244,
MONS_LEPRECHAUN = 310,
MONS_MADAMETUSK = 305,
MONS_MAGMAMAN = 239,
MONS_MANTRAP = 233,
MONS_MARLA_TUNNEL = 299,
MONS_MEGAJELLYFISH = 312,
MONS_MEGAJELLYFISH_BACKGROUND = 313,
MONS_MERCHANT = 297,
MONS_MOLE = 231,
MONS_MONKEY = 238,
MONS_MOSQUITO = 237,
MONS_MUMMY = 249,
MONS_NECROMANCER = 252,
MONS_OCTOPUS = 263,
MONS_OLD_HUNTER = 303,
MONS_OLMITE_BODYARMORED = 276,
MONS_OLMITE_HELMET = 275,
MONS_OLMITE_NAKED = 277,
MONS_OSIRIS_HAND = 258,
MONS_OSIRIS_HEAD = 257,
MONS_PET_CAT = 327,
MONS_PET_DOG = 326,
MONS_PET_HAMSTER = 328,
MONS_PET_TUTORIAL = 219,
MONS_PROTOSHOPKEEPER = 272,
MONS_QUEENBEE = 279,
MONS_REDSKELETON = 228,
MONS_ROBOT = 240,
MONS_SCARAB = 295,
MONS_SCORPION = 229,
MONS_SHOPKEEPER = 296,
MONS_SHOPKEEPERCLONE = 273,
MONS_SISTER_PARMESAN = 302,
MONS_SISTER_PARSLEY = 300,
MONS_SISTER_PARSNIP = 301,
MONS_SKELETON = 227,
MONS_SNAKE = 220,
MONS_SORCERESS = 250,
MONS_SPIDER = 221,
MONS_STORAGEGUY = 308,
MONS_TADPOLE = 287,
MONS_THIEF = 304,
MONS_TIAMAT = 282,
MONS_TIKIMAN = 234,
MONS_UFO = 266,
MONS_VAMPIRE = 245,
MONS_VLAD = 246,
MONS_WITCHDOCTOR = 235,
MONS_WITCHDOCTORSKULL = 236,
MONS_YAMA = 291,
MONS_YANG = 298,
MONS_YETI = 268,
MONS_YETIKING = 269,
MONS_YETIQUEEN = 270,
MOUNT_AXOLOTL = 899,
MOUNT_BASECAMP_CHAIR = 903,
MOUNT_BASECAMP_COUCH = 904,
MOUNT_MECH = 900,
MOUNT_QILIN = 901,
MOUNT_ROCKDOG = 898,
MOUNT_TURKEY = 897
}
Entity = {
__name = "sol.Entity.user"
}
EntityDB = {
__name = "sol.EntityDB.user"
}
F = {}
Ghost = {
__index = "function: 0000020E8E231B90",
__name = "sol.Ghost.user",
__newindex = "function: 0000020E8E22FD10"
}
Gun = {
__index = "function: 0000020E8E22EF90",
__name = "sol.Gun.user",
__newindex = "function: 0000020E8E22E810"
}
Illumination = {
__name = "sol.Illumination.user"
}
InputMapping = {
__name = "sol.InputMapping.user"
}
Inventory = {
__name = "sol.Inventory.user"
}
JUNGLESISTERS = {
GREAT_PARTY_HUH = 5,
I_WISH_BROUGHT_A_JACKET = 6,
PARMESAN_RESCUED = 3,
PARSLEY_RESCUED = 1,
PARSNIP_RESCUED = 2,
WARNING_ONE_WAY_DOOR = 4
}
Jiangshi = {
__index = "function: 0000020E8E232510",
__name = "sol.Jiangshi.user",
__newindex = "function: 0000020E8E232610"
}
LAYER = {
BACK = 1,
FRONT = 0,
PLAYER = -1,
PLAYER1 = -1,
PLAYER2 = -2,
PLAYER3 = -3,
PLAYER4 = -4
}
LightParams = {
__name = "sol.LightParams.user"
}
LoadContext = {
__name = "sol.LoadContext.user"
}
MASK = {
ACTIVEFLOOR = 128,
BG = 1024,
DECORATION = 512,
EXPLOSION = 16,
FLOOR = 256,
FX = 64,
ITEM = 8,
LAVA = 16384,
LOGICAL = 4096,
MONSTER = 4,
MOUNT = 2,
PLAYER = 1,
ROPE = 32,
SHADOW = 2048,
WATER = 8192
}
Monster = {
__index = "function: 0000020E8D7A4180",
__name = "sol.Monster.user",
__newindex = "function: 0000020E8D7A4E80"
}
Mount = {
__index = "function: 0000020E8D7A4580",
__name = "sol.Mount.user",
__newindex = "function: 0000020E8D79CA80"
}
Movable = {
__index = "function: 0000020E8D7A2280",
__name = "sol.Movable.user",
__newindex = "function: 0000020E8D7A2300"
}
ON = {
ARENA_INTRO = 25,
ARENA_MATCH = 26,
ARENA_MENU = 21,
ARENA_SCORE = 27,
CAMP = 11,
CHARACTER_SELECT = 9,
CONSTELLATION = 19,
CREDITS = 17,
DEATH = 14,
FRAME = 101,
GAMEFRAME = 108,
GUIFRAME = 100,
INTRO = 1,
LEADERBOARD = 7,
LEVEL = 12,
LOAD = 107,
LOADING = 104,
LOGO = 0,
MENU = 4,
ONLINE_LOADING = 28,
ONLINE_LOBBY = 29,
OPTIONS = 5,
PROLOGUE = 2,
RECAP = 20,
RESET = 105,
SAVE = 106,
SCORES = 18,
SCREEN = 102,
SCRIPT_DISABLE = 110,
SCRIPT_ENABLE = 109,
SEED_INPUT = 8,
SPACESHIP = 15,
START = 103,
TEAM_SELECT = 10,
TITLE = 3,
TRANSITION = 13,
WIN = 16
}
Olmec = {
__index = "function: 0000020E8E231C10",
__name = "sol.Olmec.user",
__newindex = "function: 0000020E8E230B90"
}
OlmecFloater = {
__index = "function: 0000020E8E232F10",
__name = "sol.OlmecFloater.user",
__newindex = "function: 0000020E8E232290"
}
PARTICLEEMITTER = {
ACIDBUBBLEBURST_BUBBLES = 101,
ACIDBUBBLEBURST_SPARKS = 102,
ALIENBLAST_SHOCKWAVE = 178,
ALTAR_MONSTER_APPEAR_POOF = 161,
ALTAR_SKULL = 95,
ALTAR_SMOKE = 96,
ALTAR_SPARKS = 97,
APEP_DUSTWALL = 157,
ARROWPOOF = 67,
AU_GOLD_SPARKLES = 74,
AXOLOTL_BIGBUBBLEKILL = 185,
AXOLOTL_SMALLBUBBLEKILL = 184,
BLAST_PLASMAWARP_TRAIL = 136,
BLOODTRAIL = 64,
BLUESPARKS = 106,
BOMB_SMOKE = 24,
BOOMERANG_TRAIL = 171,
BROKENORB_BLAST_LARGE = 203,
BROKENORB_BLAST_MEDIUM = 202,
BROKENORB_BLAST_SMALL = 201,
BROKENORB_ORBS_LARGE = 209,
BROKENORB_ORBS_MEDIUM = 208,
BROKENORB_ORBS_SMALL = 207,
BROKENORB_SHOCKWAVE_LARGE = 215,
BROKENORB_SHOCKWAVE_MEDIUM = 214,
BROKENORB_SHOCKWAVE_SMALL = 213,
BROKENORB_SPARKS_LARGE = 212,
BROKENORB_SPARKS_MEDIUM = 211,
BROKENORB_SPARKS_SMALL = 210,
BROKENORB_WARP_LARGE = 206,
BROKENORB_WARP_MEDIUM = 205,
BROKENORB_WARP_SMALL = 204,
BULLETPOOF = 66,
CAMERA_FRAME = 105,
CAVEMAN_SPITTLE = 189,
CHARSELECTOR_MIST = 196,
CHARSELECTOR_TORCHFLAME_FLAMES = 8,
CHARSELECTOR_TORCHFLAME_SMOKE = 7,
CLOVER_WITHER_HUD = 78,
COFFINDOORPOOF_SPARKS = 140,
COG_SPARKLE = 80,
COG_TUNNEL_FOG = 81,
COLLECTPOOF_CLOUDS = 99,
COLLECTPOOF_SPARKS = 98,
CONTACTEFFECT_SPARKS = 130,
COOKFIRE_FLAMES = 34,
COOKFIRE_SMOKE = 33,
COOKFIRE_WARP = 35,
CRUSHTRAPPOOF = 58,
CURSEDEFFECT_PIECES = 116,
CURSEDEFFECT_PIECES_HUD = 117,
CURSEDEFFECT_SKULL = 118,
CURSEDPOT_BEHINDSMOKE = 47,
CURSEDPOT_SMOKE = 46,
DMCOUNTDOWN_BLAST = 21,
DMCOUNTDOWN_DUST = 17,
DMCOUNTDOWN_FLAMES = 20,
DMCOUNTDOWN_FOG = 23,
DMCOUNTDOWN_HIGH_TENSION_THUNDERBOLT = 22,
DMCOUNTDOWN_RUBBLES = 15,
DMCOUNTDOWN_RUBBLES_LARGE = 16,
DMCOUNTDOWN_SPARKS = 18,
DMCOUNTDOWN_SPARKS_SMALL = 19,
DMPREMATCH_ASH_2P = 150,
DMPREMATCH_ASH_3P = 151,
DMPREMATCH_ASH_4P = 152,
DMPREMATCH_SEPARATOR_GLOW_TRAIL = 200,
DMRESULTS_ASH = 149,
DMRESULT_BLOOD = 13,
DMRESULT_MEATPIECES = 14,
DM_DEATH_MIST = 177,
DUSTWALL = 156,
EGGSHIP_SMOKE = 43,
ENDINGTREASURE_DUST = 45,
ENDING_TREASURE_HUNDUN_SPARKLE = 73,
ENDING_TREASURE_TIAMAT_SPARKLE = 72,
EVAPORATION_WATER = 143,
EXPLOSION_SHOCKWAVE = 27,
EXPLOSION_SMOKE = 25,
EXPLOSION_SPARKS = 26,
EXPLOSION_WHITESMOKE = 28,
FIREBALL_DESTROYED = 42,
FIREBALL_TRAIL = 41,
FLAMETHROWER_SMOKE = 40,
FLAMETRAIL_FLAMES = 82,
FLAMETRAIL_SMOKE = 83,
FLOORDUST = 48,
FLOORFALLINGDUST_RUBBLE = 50,
FLOORFALLINGDUST_SMOKE = 49,
FLOORPOOF = 52,
FLOORPOOF_BIG = 54,
FLOORPOOF_SMALL = 53,
FLOORPOOF_TRAIL = 59,
FLOORPOOF_TRAIL_BIG = 60,
FLYPOOF = 56,
FROST_BREATH = 197,
GASTRAIL = 141,
GASTRAIL_BIG = 142,
GHOST_FOG = 92,
GHOST_MIST = 90,
GHOST_WARP = 91,
GREENBLOODTRAIL = 65,
GRUB_TRAIL = 173,
HIGH_TENSION_THUNDERBOLT = 190,
HITEFFECT_HALO = 125,
HITEFFECT_RING = 123,
HITEFFECT_SMACK = 124,
HITEFFECT_SPARKS = 119,
HITEFFECT_SPARKS_BIG = 120,
HITEFFECT_STARS_BIG = 122,
HITEFFECT_STARS_SMALL = 121,
HORIZONTALLASERBEAM_SPARKLES = 163,
HORIZONTALLASERBEAM_SPARKLES_END = 165,
HORIZONTALLASERBEAM_SPARKS = 167,
ICECAGE_MIST = 155,
ICECAVES_DIAMONDDUST = 153,
ICEFLOOR_MIST = 154,
ICESPIRETRAIL_SPARKLES = 108,
INKSPIT_BUBBLEBURST = 104,
INKSPIT_TRAIL = 103,
ITEMDUST = 62,
ITEM_CRUSHED_SPARKS = 79,
JETPACK_LITTLEFLAME = 85,
JETPACK_SMOKETRAIL = 84,
KINGUDUST = 169,
KINGUSLIDINGDUST = 170,
LAMASSU_AIMING_SPARKLES = 194,
LAMASSU_SHOT_SPARKLES = 193,
LAMASSU_SHOT_WARP = 192,
LARGEITEMDUST = 63,
LASERBEAM_CONTACT = 168,
LASERBEAM_SPARKLES = 162,
LASERBEAM_SPARKLES_END = 164,
LASERBEAM_SPARKS = 166,
LAVAHEAT = 145,
LAVAPOT_DRIP = 186,
LEVEL_MIST = 191,
LIONTRAP_SPARKLE = 77,
MAGMAMANHEAT = 146,
MAINMENU_CEILINGDUST_RUBBLE = 10,
MAINMENU_CEILINGDUST_RUBBLE_SMALL = 12,
MAINMENU_CEILINGDUST_SMOKE = 9,
MAINMENU_CEILINGDUST_SMOKE_SMALL = 11,
MERCHANT_APPEAR_POOF = 160,
MINIGAME_ASTEROID_DUST = 216,
MINIGAME_ASTEROID_DUST_SMALL = 217,
MINIGAME_BROKENASTEROID_SMOKE = 219,
MINIGAME_UFO_SMOKE = 218,
MOLEFLOORPOOF = 61,
MOUNT_TAMED = 158,
MUSIC_NOTES = 198,
NECROMANCER_SUMMON = 183,
NOHITEFFECT_RING = 128,
NOHITEFFECT_SMACK = 129,
NOHITEFFECT_SPARKS = 126,
NOHITEFFECT_STARS = 127,
OLMECFLOORPOOF = 57,
OLMECSHIP_HOLE_DUST = 44,
ONFIREEFFECT_FLAME = 111,
ONFIREEFFECT_SMOKE = 110,
OUROBORO_EMBERS = 89,
OUROBORO_FALLING_RUBBLE = 51,
OUROBORO_MIST = 88,
PETTING_PET = 159,
PINKSPARKS = 107,
PLAYERGHOST_FREEZESPARKLES = 93,
POISONEDEFFECT_BUBBLES_BASE = 112,
POISONEDEFFECT_BUBBLES_BURST = 113,
POISONEDEFFECT_BUBBLES_HUD = 114,
POISONEDEFFECT_SKULL = 115,
PORTAL_DUST_FAST = 175,
PORTAL_DUST_SLOW = 174,
PORTAL_WARP = 176,
PRIZEAPPEARING_CLOUDS = 100,
SANDFLOORPOOF = 55,
SCEPTERKILL_SPARKLES = 133,
SCEPTERKILL_SPARKS = 134,
SCEPTER_BLAST = 135,
SHOTGUNBLAST_SMOKE = 86,
SHOTGUNBLAST_SPARKS = 87,
SMALLFLAME_FLAMES = 37,
SMALLFLAME_SMOKE = 36,
SMALLFLAME_WARP = 38,
SPARKTRAP_TRAIL = 199,
SPLASH_WATER = 144,
TELEPORTEFFECT_GREENSPARKLES = 138,
TELEPORTEFFECT_REDSPARKLES = 139,
TELEPORTEFFECT_SPARKS = 137,
TIAMAT_SCREAM_WARP = 195,
TITLE_TORCHFLAME_ASH = 6,
TITLE_TORCHFLAME_BACKFLAMES = 2,
TITLE_TORCHFLAME_BACKFLAMES_ANIMATED = 4,
TITLE_TORCHFLAME_FLAMES = 3,
TITLE_TORCHFLAME_FLAMES_ANIMATED = 5,
TITLE_TORCHFLAME_SMOKE = 1,
TOMB_FOG = 94,
TORCHFLAME_FLAMES = 31,
TORCHFLAME_IGNITION_SPARK = 29,
TORCHFLAME_SMOKE = 30,
TORCHFLAME_WARP = 32,
TREASURE_SPARKLE_HIGH = 70,
TREASURE_SPARKLE_HUD = 71,
TREASURE_SPARKLE_LOW = 68,
TREASURE_SPARKLE_MEDIUM = 69,
UFOLASERSHOTHITEFFECT_BIG = 131,
UFOLASERSHOTHITEFFECT_SMALL = 132,
USHABTI_GOLD = 75,
USHABTI_JADE = 76,
VOLCANO_ASH = 148,
VOLCANO_FOG = 147,
WATER_DROP_DESTROYED = 187,
WATER_DROP_DESTROYED_UPWARDS = 188,
WETEFFECT_DROPS = 109,
WHIPFLAME_FLAMES = 39,
WITCHDOCTORSKULL_TRAIL = 172,
YETIKING_YELL_DUST = 180,
YETIKING_YELL_FOG = 179,
YETIKING_YELL_SPARKLES = 181,
YETIQUEEN_LANDING_SNOWDUST = 182
}
ParticleDB = {
__name = "sol.ParticleDB.user"
}
Player = {
__index = "function: 0000020E8D7A3B80",
__name = "sol.Player.user",
__newindex = "function: 0000020E8D7A4C80"
}
PlayerInputs = {
__name = "sol.PlayerInputs.user"
}
PlayerSlot = {
__name = "sol.PlayerSlot.user"
}
PlayerSlotSettings = {
__name = "sol.PlayerSlotSettings.user"
}
PlayingSound = {
__name = "sol.PlayingSound.user"
}
QuestsInfo = {
__name = "sol.QuestsInfo.user"
}
SOUND_LOOP_MODE = {
BIDIRECTIONAL = 2,
LOOP = 1,
OFF = 0
}
SOUND_TYPE = {
MUSIC = 1,
SFX = 0
}
SPARROW = {
FINISHED_LEVEL_WITH_THIEF_STATUS = 2,
FIRST_ENCOUNTER_ROPES_THROWN = 4,
FIRST_HIDEOUT_SPAWNED_ROPE_THROW = 3,
MEETING_AT_TUSK_BASEMENT = 8,
QUEST_NOT_STARTED = 0,
SECOND_ENCOUNTER_INTERACTED = 7,
SECOND_HIDEOUT_SPAWNED_NEOBAB = 6,
THIEF_STATUS = 1,
TUSK_IDOL_STOLEN = 5
}
SPAWN_TYPE = {
ANY = 7,
LEVEL_GEN = 1,
SCRIPT = 2,
SYSTEMIC = 4
}
SaveContext = {
__name = "sol.SaveContext.user"
}
SaveData = {
__name = "sol.SaveData.user"
}
StateMemory = {
__name = "sol.StateMemory.user"
}
TEXTURE = {
DATA_TEXTURES_BASE_EGGSHIP2_0 = 94,
DATA_TEXTURES_BASE_EGGSHIP2_1 = 95,
DATA_TEXTURES_BASE_EGGSHIP2_2 = 96,
DATA_TEXTURES_BASE_EGGSHIP3_0 = 97,
DATA_TEXTURES_BASE_EGGSHIP3_1 = 98,
DATA_TEXTURES_BASE_EGGSHIP3_2 = 99,
DATA_TEXTURES_BASE_EGGSHIP3_3 = 100,
DATA_TEXTURES_BASE_EGGSHIP_0 = 88,
DATA_TEXTURES_BASE_EGGSHIP_1 = 89,
DATA_TEXTURES_BASE_EGGSHIP_2 = 90,
DATA_TEXTURES_BASE_EGGSHIP_3 = 91,
DATA_TEXTURES_BASE_EGGSHIP_4 = 92,
DATA_TEXTURES_BASE_EGGSHIP_5 = 93,
DATA_TEXTURES_BASE_SKYNIGHT_0 = 101,
DATA_TEXTURES_BASE_SURFACE2_0 = 104,
DATA_TEXTURES_BASE_SURFACE_0 = 102,
DATA_TEXTURES_BASE_SURFACE_1 = 103,
DATA_TEXTURES_BAYER8_0 = 382,
DATA_TEXTURES_BG_BABYLON_0 = 180,
DATA_TEXTURES_BG_BEEHIVE_0 = 211,
DATA_TEXTURES_BG_CAVE_0 = 122,
DATA_TEXTURES_BG_DUAT2_0 = 200,
DATA_TEXTURES_BG_DUAT_0 = 196,
DATA_TEXTURES_BG_DUAT_1 = 198,
DATA_TEXTURES_BG_DUAT_2 = 199,
DATA_TEXTURES_BG_EGGPLANT_0 = 208,
DATA_TEXTURES_BG_GOLD_0 = 254,
DATA_TEXTURES_BG_ICE_0 = 169,
DATA_TEXTURES_BG_JUNGLE_0 = 129,
DATA_TEXTURES_BG_MOTHERSHIP_0 = 257,
DATA_TEXTURES_BG_STONE_0 = 143,
DATA_TEXTURES_BG_SUNKEN_0 = 192,
DATA_TEXTURES_BG_TEMPLE_0 = 150,
DATA_TEXTURES_BG_TIDEPOOL_0 = 160,
DATA_TEXTURES_BG_VLAD_0 = 245,
DATA_TEXTURES_BG_VOLCANO_0 = 139,
DATA_TEXTURES_BORDER_MAIN_0 = 268,
DATA_TEXTURES_BORDER_MAIN_1 = 269,
DATA_TEXTURES_CHAR_BLACK_0 = 273,
DATA_TEXTURES_CHAR_BLUE_0 = 279,
DATA_TEXTURES_CHAR_CERULEAN_0 = 278,
DATA_TEXTURES_CHAR_CINNABAR_0 = 274,
DATA_TEXTURES_CHAR_CYAN_0 = 272,
DATA_TEXTURES_CHAR_EGGCHILD_0 = 291,
DATA_TEXTURES_CHAR_GOLD_0 = 283,
DATA_TEXTURES_CHAR_GRAY_0 = 287,
DATA_TEXTURES_CHAR_GREEN_0 = 275,
DATA_TEXTURES_CHAR_HIRED_0 = 290,
DATA_TEXTURES_CHAR_IRIS_0 = 282,
DATA_TEXTURES_CHAR_KHAKI_0 = 288,
DATA_TEXTURES_CHAR_LEMON_0 = 281,
DATA_TEXTURES_CHAR_LIME_0 = 280,
DATA_TEXTURES_CHAR_MAGENTA_0 = 271,
DATA_TEXTURES_CHAR_OLIVE_0 = 276,
DATA_TEXTURES_CHAR_ORANGE_0 = 289,
DATA_TEXTURES_CHAR_PINK_0 = 285,
DATA_TEXTURES_CHAR_RED_0 = 284,
DATA_TEXTURES_CHAR_VIOLET_0 = 286,
DATA_TEXTURES_CHAR_WHITE_0 = 277,
DATA_TEXTURES_CHAR_YELLOW_0 = 270,
DATA_TEXTURES_COFFINS_0 = 369,
DATA_TEXTURES_COFFINS_1 = 370,
DATA_TEXTURES_COFFINS_2 = 371,
DATA_TEXTURES_COFFINS_3 = 372,
DATA_TEXTURES_COFFINS_4 = 373,
DATA_TEXTURES_COFFINS_5 = 374,
DATA_TEXTURES_CREDITS_0 = 375,
DATA_TEXTURES_CREDITS_1 = 376,
DATA_TEXTURES_DECO_BABYLON_0 = 176,
DATA_TEXTURES_DECO_BABYLON_1 = 177,
DATA_TEXTURES_DECO_BABYLON_2 = 178,
DATA_TEXTURES_DECO_BASECAMP_0 = 105,
DATA_TEXTURES_DECO_BASECAMP_1 = 106,
DATA_TEXTURES_DECO_BASECAMP_2 = 107,
DATA_TEXTURES_DECO_BASECAMP_3 = 108,
DATA_TEXTURES_DECO_BASECAMP_4 = 109,
DATA_TEXTURES_DECO_BASECAMP_5 = 110,
DATA_TEXTURES_DECO_BASECAMP_6 = 111,
DATA_TEXTURES_DECO_BASECAMP_7 = 112,
DATA_TEXTURES_DECO_CAVE_0 = 120,
DATA_TEXTURES_DECO_CAVE_1 = 121,
DATA_TEXTURES_DECO_COSMIC_0 = 213,
DATA_TEXTURES_DECO_COSMIC_1 = 214,
DATA_TEXTURES_DECO_COSMIC_2 = 215,
DATA_TEXTURES_DECO_EGGPLANT_0 = 187,
DATA_TEXTURES_DECO_EGGPLANT_1 = 207,
DATA_TEXTURES_DECO_EXTRA_0 = 264,
DATA_TEXTURES_DECO_EXTRA_1 = 265,
DATA_TEXTURES_DECO_GOLD_0 = 251,
DATA_TEXTURES_DECO_GOLD_1 = 252,
DATA_TEXTURES_DECO_GOLD_2 = 253,
DATA_TEXTURES_DECO_ICE_0 = 165,
DATA_TEXTURES_DECO_ICE_1 = 166,
DATA_TEXTURES_DECO_ICE_2 = 167,
DATA_TEXTURES_DECO_ICE_3 = 168,
DATA_TEXTURES_DECO_JUNGLE_0 = 127,
DATA_TEXTURES_DECO_JUNGLE_1 = 128,
DATA_TEXTURES_DECO_JUNGLE_2 = 141,
DATA_TEXTURES_DECO_SUNKEN_0 = 188,
DATA_TEXTURES_DECO_SUNKEN_1 = 189,
DATA_TEXTURES_DECO_SUNKEN_2 = 190,
DATA_TEXTURES_DECO_SUNKEN_3 = 191,
DATA_TEXTURES_DECO_TEMPLE_0 = 148,
DATA_TEXTURES_DECO_TEMPLE_1 = 149,
DATA_TEXTURES_DECO_TEMPLE_2 = 201,
DATA_TEXTURES_DECO_TIDEPOOL_0 = 158,
DATA_TEXTURES_DECO_TIDEPOOL_1 = 159,
DATA_TEXTURES_DECO_TUTORIAL_0 = 113,
DATA_TEXTURES_DECO_TUTORIAL_1 = 114,
DATA_TEXTURES_DECO_VOLCANO_0 = 135,
DATA_TEXTURES_DECO_VOLCANO_1 = 136,
DATA_TEXTURES_DECO_VOLCANO_2 = 137,
DATA_TEXTURES_DECO_VOLCANO_3 = 138,
DATA_TEXTURES_FLOORMISC_0 = 266,
DATA_TEXTURES_FLOORMISC_1 = 267,
DATA_TEXTURES_FLOORSTYLED_BABYLON_0 = 231,
DATA_TEXTURES_FLOORSTYLED_BABYLON_1 = 232,
DATA_TEXTURES_FLOORSTYLED_BABYLON_2 = 233,
DATA_TEXTURES_FLOORSTYLED_BABYLON_3 = 234,
DATA_TEXTURES_FLOORSTYLED_BABYLON_4 = 235,
DATA_TEXTURES_FLOORSTYLED_BEEHIVE_0 = 210,
DATA_TEXTURES_FLOORSTYLED_BEEHIVE_1 = 212,
DATA_TEXTURES_FLOORSTYLED_DUAT_0 = 197,
DATA_TEXTURES_FLOORSTYLED_DUAT_1 = 258,
DATA_TEXTURES_FLOORSTYLED_GOLD_0 = 246,
DATA_TEXTURES_FLOORSTYLED_GOLD_1 = 247,
DATA_TEXTURES_FLOORSTYLED_GOLD_2 = 248,
DATA_TEXTURES_FLOORSTYLED_GOLD_3 = 249,
DATA_TEXTURES_FLOORSTYLED_GOLD_4 = 255,
DATA_TEXTURES_FLOORSTYLED_GOLD_NORMAL_0 = 250,
DATA_TEXTURES_FLOORSTYLED_GUTS_0 = 263,
DATA_TEXTURES_FLOORSTYLED_MOTHERSHIP_0 = 256,
DATA_TEXTURES_FLOORSTYLED_PAGODA_0 = 228,
DATA_TEXTURES_FLOORSTYLED_PAGODA_1 = 229,
DATA_TEXTURES_FLOORSTYLED_PAGODA_2 = 230,
DATA_TEXTURES_FLOORSTYLED_PALACE_0 = 259,
DATA_TEXTURES_FLOORSTYLED_PALACE_1 = 260,
DATA_TEXTURES_FLOORSTYLED_PALACE_2 = 261,
DATA_TEXTURES_FLOORSTYLED_PALACE_3 = 262,
DATA_TEXTURES_FLOORSTYLED_STONE_0 = 142,
DATA_TEXTURES_FLOORSTYLED_STONE_1 = 144,
DATA_TEXTURES_FLOORSTYLED_STONE_2 = 221,
DATA_TEXTURES_FLOORSTYLED_STONE_3 = 222,
DATA_TEXTURES_FLOORSTYLED_STONE_4 = 223,
DATA_TEXTURES_FLOORSTYLED_STONE_5 = 224,
DATA_TEXTURES_FLOORSTYLED_SUNKEN_0 = 236,
DATA_TEXTURES_FLOORSTYLED_SUNKEN_1 = 237,
DATA_TEXTURES_FLOORSTYLED_SUNKEN_2 = 238,
DATA_TEXTURES_FLOORSTYLED_SUNKEN_3 = 239,
DATA_TEXTURES_FLOORSTYLED_TEMPLE_0 = 225,
DATA_TEXTURES_FLOORSTYLED_TEMPLE_1 = 226,
DATA_TEXTURES_FLOORSTYLED_TEMPLE_2 = 227,
DATA_TEXTURES_FLOORSTYLED_VLAD_0 = 240,
DATA_TEXTURES_FLOORSTYLED_VLAD_1 = 241,
DATA_TEXTURES_FLOORSTYLED_VLAD_2 = 242,
DATA_TEXTURES_FLOORSTYLED_VLAD_3 = 243,
DATA_TEXTURES_FLOORSTYLED_VLAD_4 = 244,
DATA_TEXTURES_FLOORSTYLED_WOOD_0 = 216,
DATA_TEXTURES_FLOORSTYLED_WOOD_1 = 217,
DATA_TEXTURES_FLOORSTYLED_WOOD_2 = 218,
DATA_TEXTURES_FLOORSTYLED_WOOD_3 = 219,
DATA_TEXTURES_FLOORSTYLED_WOOD_4 = 220,
DATA_TEXTURES_FLOOR_BABYLON_0 = 172,
DATA_TEXTURES_FLOOR_BABYLON_1 = 173,
DATA_TEXTURES_FLOOR_BABYLON_2 = 174,
DATA_TEXTURES_FLOOR_BABYLON_3 = 175,
DATA_TEXTURES_FLOOR_BABYLON_4 = 181,
DATA_TEXTURES_FLOOR_CAVE_0 = 115,
DATA_TEXTURES_FLOOR_CAVE_1 = 116,
DATA_TEXTURES_FLOOR_CAVE_2 = 117,
DATA_TEXTURES_FLOOR_CAVE_3 = 118,
DATA_TEXTURES_FLOOR_CAVE_4 = 119,
DATA_TEXTURES_FLOOR_CAVE_5 = 123,
DATA_TEXTURES_FLOOR_EGGPLANT_0 = 202,
DATA_TEXTURES_FLOOR_EGGPLANT_1 = 203,
DATA_TEXTURES_FLOOR_EGGPLANT_2 = 204,
DATA_TEXTURES_FLOOR_EGGPLANT_3 = 205,
DATA_TEXTURES_FLOOR_EGGPLANT_4 = 206,
DATA_TEXTURES_FLOOR_EGGPLANT_5 = 209,
DATA_TEXTURES_FLOOR_ICE_0 = 162,
DATA_TEXTURES_FLOOR_ICE_1 = 163,
DATA_TEXTURES_FLOOR_ICE_2 = 164,
DATA_TEXTURES_FLOOR_ICE_3 = 170,
DATA_TEXTURES_FLOOR_ICE_4 = 171,
DATA_TEXTURES_FLOOR_JUNGLE_0 = 124,
DATA_TEXTURES_FLOOR_JUNGLE_1 = 125,
DATA_TEXTURES_FLOOR_JUNGLE_2 = 126,
DATA_TEXTURES_FLOOR_JUNGLE_3 = 130,
DATA_TEXTURES_FLOOR_SUNKEN_0 = 182,
DATA_TEXTURES_FLOOR_SUNKEN_1 = 183,
DATA_TEXTURES_FLOOR_SUNKEN_2 = 184,
DATA_TEXTURES_FLOOR_SUNKEN_3 = 185,
DATA_TEXTURES_FLOOR_SUNKEN_4 = 186,
DATA_TEXTURES_FLOOR_SUNKEN_5 = 193,
DATA_TEXTURES_FLOOR_SUNKEN_6 = 194,
DATA_TEXTURES_FLOOR_SUNKEN_7 = 195,
DATA_TEXTURES_FLOOR_SURFACE_0 = 87,
DATA_TEXTURES_FLOOR_TEMPLE_0 = 145,
DATA_TEXTURES_FLOOR_TEMPLE_1 = 146,
DATA_TEXTURES_FLOOR_TEMPLE_2 = 147,
DATA_TEXTURES_FLOOR_TEMPLE_3 = 151,
DATA_TEXTURES_FLOOR_TEMPLE_4 = 152,
DATA_TEXTURES_FLOOR_TIDEPOOL_0 = 153,
DATA_TEXTURES_FLOOR_TIDEPOOL_1 = 154,
DATA_TEXTURES_FLOOR_TIDEPOOL_2 = 155,
DATA_TEXTURES_FLOOR_TIDEPOOL_3 = 156,
DATA_TEXTURES_FLOOR_TIDEPOOL_4 = 157,
DATA_TEXTURES_FLOOR_TIDEPOOL_5 = 161,
DATA_TEXTURES_FLOOR_VOLCANO_0 = 131,
DATA_TEXTURES_FLOOR_VOLCANO_1 = 132,
DATA_TEXTURES_FLOOR_VOLCANO_2 = 133,
DATA_TEXTURES_FLOOR_VOLCANO_3 = 134,
DATA_TEXTURES_FLOOR_VOLCANO_4 = 140,
DATA_TEXTURES_FONTDEBUG_0 = 9,
DATA_TEXTURES_FONTFIRASANS_0 = 6,
DATA_TEXTURES_FONTMONO_0 = 8,
DATA_TEXTURES_FONTYORKTEN_0 = 7,
DATA_TEXTURES_FX_ANKH_0 = 366,
DATA_TEXTURES_FX_ANKH_1 = 367,
DATA_TEXTURES_FX_BIG_0 = 364,
DATA_TEXTURES_FX_EXPLOSION_0 = 360,
DATA_TEXTURES_FX_RUBBLE_0 = 365,
DATA_TEXTURES_FX_SMALL2_0 = 362,
DATA_TEXTURES_FX_SMALL3_0 = 363,
DATA_TEXTURES_FX_SMALL_0 = 361,
DATA_TEXTURES_HUD_0 = 53,
DATA_TEXTURES_HUD_1 = 54,
DATA_TEXTURES_HUD_2 = 55,
DATA_TEXTURES_HUD_CONTROLLER_BUTTONS_0 = 57,
DATA_TEXTURES_HUD_CONTROLLER_BUTTONS_1 = 58,
DATA_TEXTURES_HUD_CONTROLLER_BUTTONS_2 = 59,
DATA_TEXTURES_HUD_CONTROLLER_BUTTONS_3 = 60,
DATA_TEXTURES_HUD_CONTROLLER_BUTTONS_4 = 61,
DATA_TEXTURES_HUD_TEXT_0 = 56,
DATA_TEXTURES_ITEMS_0 = 358,
DATA_TEXTURES_ITEMS_USHABTI_0 = 179,
DATA_TEXTURES_JOURNAL_BACK_0 = 64,
DATA_TEXTURES_JOURNAL_ELEMENTS_0 = 81,
DATA_TEXTURES_JOURNAL_ELEMENTS_1 = 82,
DATA_TEXTURES_JOURNAL_ENTRY_BG_0 = 74,
DATA_TEXTURES_JOURNAL_ENTRY_ITEMS_0 = 80,
DATA_TEXTURES_JOURNAL_ENTRY_MONS_0 = 76,
DATA_TEXTURES_JOURNAL_ENTRY_MONS_BIG_0 = 77,
DATA_TEXTURES_JOURNAL_ENTRY_PEOPLE_0 = 78,
DATA_TEXTURES_JOURNAL_ENTRY_PEOPLE_1 = 79,
DATA_TEXTURES_JOURNAL_ENTRY_PLACE_0 = 75,
DATA_TEXTURES_JOURNAL_ENTRY_TRAPS_0 = 83,
DATA_TEXTURES_JOURNAL_ENTRY_TRAPS_1 = 84,
DATA_TEXTURES_JOURNAL_ENTRY_TRAPS_2 = 85,
DATA_TEXTURES_JOURNAL_PAGEFLIP_0 = 65,
DATA_TEXTURES_JOURNAL_PAGETORN_0 = 63,
DATA_TEXTURES_JOURNAL_SELECT_0 = 66,
DATA_TEXTURES_JOURNAL_STICKERS_0 = 67,
DATA_TEXTURES_JOURNAL_STICKERS_1 = 68,
DATA_TEXTURES_JOURNAL_STICKERS_2 = 69,
DATA_TEXTURES_JOURNAL_STORY_0 = 86,
DATA_TEXTURES_JOURNAL_TOP_ENTRY_0 = 71,
DATA_TEXTURES_JOURNAL_TOP_GAMEOVER_0 = 72,
DATA_TEXTURES_JOURNAL_TOP_MAIN_0 = 70,
DATA_TEXTURES_JOURNAL_TOP_PROFILE_0 = 73,
DATA_TEXTURES_KEYBOARD_BUTTONS_0 = 62,
DATA_TEXTURES_LIQUIDGRADIENT_EGGPLANT_WATER_0 = 378,
DATA_TEXTURES_LIQUIDGRADIENT_LAVA_0 = 379,
DATA_TEXTURES_LIQUIDGRADIENT_WATER_0 = 377,
DATA_TEXTURES_LOADING_0 = 1,
DATA_TEXTURES_LUT_BACKLAYER_0 = 384,
DATA_TEXTURES_LUT_BLACKMARKET_0 = 385,
DATA_TEXTURES_LUT_ICECAVES_0 = 387,
DATA_TEXTURES_LUT_ORIGINAL_0 = 383,
DATA_TEXTURES_LUT_VLAD_0 = 386,
DATA_TEXTURES_MAIN_BODY_0 = 12,
DATA_TEXTURES_MAIN_DIRT_0 = 13,
DATA_TEXTURES_MAIN_DOORBACK_0 = 15,
DATA_TEXTURES_MAIN_DOORFRAME_0 = 16,
DATA_TEXTURES_MAIN_DOOR_0 = 14,
DATA_TEXTURES_MAIN_FORE1_0 = 17,
DATA_TEXTURES_MAIN_FORE2_0 = 18,
DATA_TEXTURES_MAIN_HEAD_0 = 19,
DATA_TEXTURES_MENU_BASIC_0 = 30,
DATA_TEXTURES_MENU_BASIC_1 = 31,
DATA_TEXTURES_MENU_BASIC_2 = 32,
DATA_TEXTURES_MENU_BASIC_3 = 33,
DATA_TEXTURES_MENU_BASIC_4 = 34,
DATA_TEXTURES_MENU_BASIC_5 = 35,
DATA_TEXTURES_MENU_BASIC_6 = 36,
DATA_TEXTURES_MENU_BRICK1_0 = 28,
DATA_TEXTURES_MENU_BRICK2_0 = 29,
DATA_TEXTURES_MENU_CAVE1_0 = 26,
DATA_TEXTURES_MENU_CAVE2_0 = 27,
DATA_TEXTURES_MENU_CHARDOOR_0 = 24,
DATA_TEXTURES_MENU_CHARSEL_0 = 23,
DATA_TEXTURES_MENU_DEATHMATCH2_0 = 43,
DATA_TEXTURES_MENU_DEATHMATCH3_0 = 44,
DATA_TEXTURES_MENU_DEATHMATCH4_0 = 45,
DATA_TEXTURES_MENU_DEATHMATCH5_0 = 47,
DATA_TEXTURES_MENU_DEATHMATCH5_1 = 48,
DATA_TEXTURES_MENU_DEATHMATCH5_2 = 49,
DATA_TEXTURES_MENU_DEATHMATCH5_3 = 46,
DATA_TEXTURES_MENU_DEATHMATCH6_0 = 50,
DATA_TEXTURES_MENU_DEATHMATCH_0 = 42,
DATA_TEXTURES_MENU_DISP_0 = 20,
DATA_TEXTURES_MENU_DISP_1 = 21,
DATA_TEXTURES_MENU_DISP_2 = 22,
DATA_TEXTURES_MENU_GENERIC_0 = 25,
DATA_TEXTURES_MENU_HEADER_0 = 37,
DATA_TEXTURES_MENU_LEADER_0 = 38,
DATA_TEXTURES_MENU_LEADER_1 = 39,
DATA_TEXTURES_MENU_LEADER_2 = 40,
DATA_TEXTURES_MENU_LEADER_3 = 41,
DATA_TEXTURES_MENU_ONLINE_0 = 51,
DATA_TEXTURES_MENU_TITLEGAL_0 = 11,
DATA_TEXTURES_MENU_TITLE_0 = 10,
DATA_TEXTURES_MENU_TUNNEL_0 = 52,
DATA_TEXTURES_MONSTERS01_0 = 296,
DATA_TEXTURES_MONSTERS02_0 = 297,
DATA_TEXTURES_MONSTERS02_1 = 356,
DATA_TEXTURES_MONSTERS02_2 = 357,
DATA_TEXTURES_MONSTERS03_0 = 298,
DATA_TEXTURES_MONSTERS03_1 = 299,
DATA_TEXTURES_MONSTERSBASIC01_0 = 293,
DATA_TEXTURES_MONSTERSBASIC02_0 = 294,
DATA_TEXTURES_MONSTERSBASIC03_0 = 295,
DATA_TEXTURES_MONSTERSBIG01_0 = 300,
DATA_TEXTURES_MONSTERSBIG02_0 = 301,
DATA_TEXTURES_MONSTERSBIG02_1 = 302,
DATA_TEXTURES_MONSTERSBIG02_2 = 303,
DATA_TEXTURES_MONSTERSBIG03_0 = 304,
DATA_TEXTURES_MONSTERSBIG04_0 = 305,
DATA_TEXTURES_MONSTERSBIG04_1 = 306,
DATA_TEXTURES_MONSTERSBIG04_2 = 307,
DATA_TEXTURES_MONSTERSBIG04_3 = 355,
DATA_TEXTURES_MONSTERSBIG05_0 = 308,
DATA_TEXTURES_MONSTERSBIG05_1 = 309,
DATA_TEXTURES_MONSTERSBIG05_2 = 311,
DATA_TEXTURES_MONSTERSBIG05_3 = 312,
DATA_TEXTURES_MONSTERSBIG05_4 = 313,
DATA_TEXTURES_MONSTERSBIG06_0 = 314,
DATA_TEXTURES_MONSTERSBIG06_1 = 315,
DATA_TEXTURES_MONSTERSBIG06_2 = 316,
DATA_TEXTURES_MONSTERSBIG06_3 = 317,
DATA_TEXTURES_MONSTERSBIG06_4 = 318,
DATA_TEXTURES_MONSTERSBIG06_5 = 319,
DATA_TEXTURES_MONSTERSBIG06_6 = 320,
DATA_TEXTURES_MONSTERSBIG06_7 = 321,
DATA_TEXTURES_MONSTERSBIG06_8 = 322,
DATA_TEXTURES_MONSTERSBIG06_9 = 323,
DATA_TEXTURES_MONSTERSBIG06_10 = 324,
DATA_TEXTURES_MONSTERS_GHOST_0 = 325,
DATA_TEXTURES_MONSTERS_GHOST_1 = 326,
DATA_TEXTURES_MONSTERS_HUNDUN_0 = 349,
DATA_TEXTURES_MONSTERS_HUNDUN_1 = 350,
DATA_TEXTURES_MONSTERS_HUNDUN_2 = 351,
DATA_TEXTURES_MONSTERS_HUNDUN_3 = 352,
DATA_TEXTURES_MONSTERS_HUNDUN_4 = 353,
DATA_TEXTURES_MONSTERS_HUNDUN_5 = 354,
DATA_TEXTURES_MONSTERS_OLMEC_0 = 327,
DATA_TEXTURES_MONSTERS_OLMEC_1 = 328,
DATA_TEXTURES_MONSTERS_OLMEC_2 = 329,
DATA_TEXTURES_MONSTERS_OLMEC_3 = 330,
DATA_TEXTURES_MONSTERS_OLMEC_4 = 331,
DATA_TEXTURES_MONSTERS_OSIRIS_0 = 332,
DATA_TEXTURES_MONSTERS_OSIRIS_1 = 333,
DATA_TEXTURES_MONSTERS_OSIRIS_2 = 334,
DATA_TEXTURES_MONSTERS_OSIRIS_3 = 335,
DATA_TEXTURES_MONSTERS_OSIRIS_4 = 336,
DATA_TEXTURES_MONSTERS_PETS_0 = 292,
DATA_TEXTURES_MONSTERS_TIAMAT_0 = 337,
DATA_TEXTURES_MONSTERS_TIAMAT_1 = 338,
DATA_TEXTURES_MONSTERS_TIAMAT_2 = 339,
DATA_TEXTURES_MONSTERS_TIAMAT_3 = 340,
DATA_TEXTURES_MONSTERS_TIAMAT_4 = 341,
DATA_TEXTURES_MONSTERS_TIAMAT_5 = 342,
DATA_TEXTURES_MONSTERS_TIAMAT_6 = 343,
DATA_TEXTURES_MONSTERS_TIAMAT_7 = 344,
DATA_TEXTURES_MONSTERS_TIAMAT_8 = 345,
DATA_TEXTURES_MONSTERS_YAMA_0 = 346,
DATA_TEXTURES_MONSTERS_YAMA_1 = 347,
DATA_TEXTURES_MONSTERS_YAMA_2 = 348,
DATA_TEXTURES_MOUNTS_0 = 359,
DATA_TEXTURES_NOISE0_0 = 380,
DATA_TEXTURES_NOISE1_0 = 381,
DATA_TEXTURES_PLACEHOLDER_0 = 0,
DATA_TEXTURES_SAVING_0 = 2,
DATA_TEXTURES_SHADOWS_0 = 368,
DATA_TEXTURES_SHINE_0 = 388,
DATA_TEXTURES_SPLASH0_0 = 3,
DATA_TEXTURES_SPLASH1_0 = 4,
DATA_TEXTURES_SPLASH2_0 = 5
}
THEME = {
ABZU = 13,
ARENA = 18,
BASE_CAMP = 17,
CITY_OF_GOLD = 11,
COSMIC_OCEAN = 10,
DUAT = 12,
DWELLING = 1,
EGGPLANT_WORLD = 15,
HUNDUN = 16,
ICE_CAVES = 7,
JUNGLE = 2,
NEO_BABYLON = 8,
OLMEC = 4,
SUNKEN_CITY = 9,
TEMPLE = 6,
TIAMAT = 14,
TIDE_POOL = 5,
VOLCANA = 3
}
TUSK = {
ANGRY = -2,
DEAD = -1,
DICE_HOUSE_SPAWNED = 1,
HIGH_ROLLER_STATUS = 2,
PALACE_WELCOME_MESSAGE = 3,
QUEST_NOT_STARTED = 0
}
TextureDefinition = {
__name = "sol.TextureDefinition.user"
}
VANHORSING = {
FIRST_ENCOUNTER_DIAMOND_THROWN = 2,
JAILCELL_SPAWNED = 1,
QUEST_NOT_STARTED = 0,
SECOND_ENCOUNTER_COMPASS_THROWN = 6,
SHOT_VLAD = 4,
SPAWNED_IN_VLADS_CASTLE = 3,
TEMPLE_HIDEOUT_SPAWNED = 5,
TUSK_CELLAR = 7
}
VANILLA_SOUND = {
BGM_BGM_BASECAMP = "BGM/BGM_basecamp",
BGM_BGM_CREDITS = "BGM/BGM_credits",
BGM_BGM_DM = "BGM/BGM_dm",
BGM_BGM_ENDING = "BGM/BGM_ending",
BGM_BGM_MASTER = "BGM/BGM_master",
BGM_BGM_MENU = "BGM/BGM_menu",
BGM_BGM_TITLE = "BGM/BGM_title",
CRITTERS_DRONE_CRASH = "Critters/Drone_crash",
CRITTERS_DRONE_LOOP = "Critters/Drone_loop",
CRITTERS_FIREFLY_FLASH = "Critters/Firefly_flash",
CRITTERS_LOCUST_LOOP = "Critters/Locust_loop",
CRITTERS_PENGUIN_JUMP1 = "Critters/Penguin_jump1",
CRITTERS_PENGUIN_JUMP2 = "Critters/Penguin_jump2",
CRITTERS_SNAIL_ATTACH = "Critters/Snail_attach",
CUTSCENE_ANKH_CRACK = "Cutscene/Ankh_crack",
CUTSCENE_ANKH_LOOP = "Cutscene/Ankh_loop",
CUTSCENE_ANKH_PULSE = "Cutscene/Ankh_pulse",
CUTSCENE_ANKH_SHATTER = "Cutscene/Ankh_shatter",
CUTSCENE_BIG_TREASURE_LAND = "Cutscene/Big_treasure_land",
CUTSCENE_BIG_TREASURE_OPEN = "Cutscene/Big_treasure_open",
CUTSCENE_CAVE_RUMBLE = "Cutscene/Cave_rumble",
CUTSCENE_CONSTELLATION_LOOP = "Cutscene/Constellation_loop",
CUTSCENE_CREDITS_ASTEROID = "Cutscene/Credits_asteroid",
CUTSCENE_CREDITS_THRUSTER_LOOP = "Cutscene/Credits_thruster_loop",
CUTSCENE_CREDITS_UFO_BONK = "Cutscene/Credits_ufo_bonk",
CUTSCENE_EGGSHIP_AMB_LOOP = "Cutscene/Eggship_amb_loop",
CUTSCENE_EGGSHIP_DOOR = "Cutscene/Eggship_door",
CUTSCENE_EGGSHIP_EMERGE = "Cutscene/Eggship_emerge",
CUTSCENE_EGGSHIP_LAND = "Cutscene/Eggship_land",
CUTSCENE_EGGSHIP_LOOP = "Cutscene/Eggship_loop",
CUTSCENE_EGGSHIP_THRUSTER_LOOP = "Cutscene/Eggship_thruster_loop",
CUTSCENE_JOURNAL_PAGE = "Cutscene/Journal_page",
CUTSCENE_KEY_DROP = "Cutscene/Key_drop",
CUTSCENE_MENU_INTRO_LOOP = "Cutscene/Menu_intro_loop",
CUTSCENE_OUROBOROS_DOOR_LOOP = "Cutscene/Ouroboros_door_loop",
CUTSCENE_OUROBOROS_LOOP = "Cutscene/Ouroboros_loop",
CUTSCENE_OUROBOROS_SHAKE = "Cutscene/Ouroboros_shake",
CUTSCENE_RUMBLE_LOOP = "Cutscene/Rumble_loop",
DEATHMATCH_DM_BANNER = "Deathmatch/dm_banner",
DEATHMATCH_DM_COUNTDOWN = "Deathmatch/dm_countdown",
DEATHMATCH_DM_ITEM_SPAWN = "Deathmatch/dm_item_spawn",
DEATHMATCH_DM_ITEM_WARN = "Deathmatch/dm_item_warn",
DEATHMATCH_DM_PILLAR_CRUSH = "Deathmatch/dm_pillar_crush",
DEATHMATCH_DM_PILLAR_LOOP = "Deathmatch/dm_pillar_loop",
DEATHMATCH_DM_SCORE = "Deathmatch/dm_score",
DEATHMATCH_DM_SPLASH = "Deathmatch/dm_splash",
DEATHMATCH_DM_TIMER = "Deathmatch/dm_timer",
DEFAULT_SOUND = "default_sound",
ENEMIES_ALIEN_JUMP = "Enemies/Alien_jump",
ENEMIES_ALIEN_QUEEN_LOOP = "Enemies/Alien_queen_loop",
ENEMIES_ALIEN_QUEEN_SHOT = "Enemies/Alien_queen_shot",
ENEMIES_ALIEN_QUEEN_SIGHT_LOOP = "Enemies/Alien_queen_sight_loop",
ENEMIES_ALIEN_SPEECH = "Enemies/Alien_speech",
ENEMIES_AMMIT_WALK = "Enemies/Ammit_walk",
ENEMIES_ANUBIS_ACTIVATE = "Enemies/Anubis_activate",
ENEMIES_ANUBIS_ATK = "Enemies/Anubis_atk",
ENEMIES_ANUBIS_SPECIAL_SHOT = "Enemies/Anubis_special_shot",
ENEMIES_ANUBIS_WARN = "Enemies/Anubis_warn",
ENEMIES_APEP_BODY_LOOP = "Enemies/Apep_body_loop",
ENEMIES_APEP_HEAD_LOOP = "Enemies/Apep_head_loop",
ENEMIES_BAT_FLAP = "Enemies/Bat_flap",
ENEMIES_BEE_LOOP = "Enemies/Bee_loop",
ENEMIES_BEE_QUEEN_LOOP = "Enemies/Bee_queen_loop",
ENEMIES_BOSS_CAVEMAN_BONK = "Enemies/Boss_caveman_bonk",
ENEMIES_BOSS_CAVEMAN_CRUSH = "Enemies/Boss_caveman_crush",
ENEMIES_BOSS_CAVEMAN_JUMP = "Enemies/Boss_caveman_jump",
ENEMIES_BOSS_CAVEMAN_LAND = "Enemies/Boss_caveman_land",
ENEMIES_BOSS_CAVEMAN_ROLL_LOOP = "Enemies/Boss_caveman_roll_loop",
ENEMIES_BOSS_CAVEMAN_STEP = "Enemies/Boss_caveman_step",
ENEMIES_BOSS_CAVEMAN_STOMP = "Enemies/Boss_caveman_stomp",
ENEMIES_CATMUMMY_ATK = "Enemies/Catmummy_atk",
ENEMIES_CATMUMMY_JUMP = "Enemies/Catmummy_jump",
ENEMIES_CATMUMMY_RUN = "Enemies/Catmummy_run",
ENEMIES_CAVEMAN_PRAY_LOOP = "Enemies/Caveman_pray_loop",
ENEMIES_CAVEMAN_STEP = "Enemies/Caveman_step",
ENEMIES_CAVEMAN_TALK = "Enemies/Caveman_talk",
ENEMIES_CAVEMAN_TRIGGER = "Enemies/Caveman_trigger",
ENEMIES_COBRA_ATK = "Enemies/Cobra_atk",
ENEMIES_CROCMAN_ATK = "Enemies/Crocman_atk",
ENEMIES_CROCMAN_TRIGGER = "Enemies/Crocman_trigger",
ENEMIES_EGGPLANT_DOG_BOUNCE = "Enemies/Eggplant_dog_bounce",
ENEMIES_EGGPLANT_MINISTER_LOOP = "Enemies/Eggplant_minister_loop",
ENEMIES_EGGPLANT_MINISTER_MORPH = "Enemies/Eggplant_minister_morph",
ENEMIES_EGGSAC_BURST = "Enemies/Eggsac_burst",
ENEMIES_EGGSAC_WARN = "Enemies/Eggsac_warn",
ENEMIES_ENEMY_HIT_INVINCIBLE = "Enemies/Enemy_hit_invincible",
ENEMIES_FIREBUG_ARM = "Enemies/Firebug_arm",
ENEMIES_FIREBUG_ATK_LOOP = "Enemies/Firebug_atk_loop",
ENEMIES_FIREBUG_FLY_LOOP = "Enemies/Firebug_fly_loop",
ENEMIES_FLYINGFISH_BONK = "Enemies/Flyingfish_bonk",
ENEMIES_FLYINGFISH_FLAP = "Enemies/Flyingfish_flap",
ENEMIES_FLYINGFISH_WIGGLE = "Enemies/Flyingfish_wiggle",
ENEMIES_FROG_CHARGE_LOOP = "Enemies/Frog_charge_loop",
ENEMIES_FROG_EAT = "Enemies/Frog_eat",
ENEMIES_FROG_GIANT_OPEN = "Enemies/Frog_giant_open",
ENEMIES_FROG_JUMP = "Enemies/Frog_jump",
ENEMIES_GHIST_LOOP = "Enemies/Ghist_loop",
ENEMIES_GHOST_LOOP = "Enemies/Ghost_loop",
ENEMIES_GHOST_SPLIT = "Enemies/Ghost_split",
ENEMIES_GIANT_FLY_EAT = "Enemies/Giant_fly_eat",
ENEMIES_GIANT_FLY_LOOP = "Enemies/Giant_fly_loop",
ENEMIES_GIANT_SPIDER_DROP = "Enemies/Giant_spider_drop",
ENEMIES_GIANT_SPIDER_JUMP = "Enemies/Giant_spider_jump",
ENEMIES_GIANT_SPIDER_WALK = "Enemies/Giant_spider_walk",
ENEMIES_GOLD_MONKEY_JUMP = "Enemies/Gold_monkey_jump",
ENEMIES_GOLD_MONKEY_POOP = "Enemies/Gold_monkey_poop",
ENEMIES_GRUB_EVOLVE = "Enemies/Grub_evolve",
ENEMIES_GRUB_JUMP = "Enemies/Grub_jump",
ENEMIES_GRUB_LOOP = "Enemies/Grub_loop",
ENEMIES_HANGSPIDER_ATK = "Enemies/Hangspider_atk",
ENEMIES_HERMITCRAB_ATK = "Enemies/Hermitcrab_atk",
ENEMIES_HERMITCRAB_MORPH = "Enemies/Hermitcrab_morph",
ENEMIES_HUMPHEAD_LOOP = "Enemies/Humphead_loop",
ENEMIES_HUNDUN_ATK = "Enemies/Hundun_atk",
ENEMIES_HUNDUN_DEATH_LAND = "Enemies/Hundun_death_land",
ENEMIES_HUNDUN_HEAD_DESTROY = "Enemies/Hundun_head_destroy",
ENEMIES_HUNDUN_HEAD_EMERGE = "Enemies/Hundun_head_emerge",
ENEMIES_HUNDUN_HURT = "Enemies/Hundun_hurt",
ENEMIES_HUNDUN_STEP = "Enemies/Hundun_step",
ENEMIES_HUNDUN_WARN = "Enemies/Hundun_warn",
ENEMIES_HUNDUN_WINGS_EMERGE = "Enemies/Hundun_wings_emerge",
ENEMIES_HUNDUN_WING_FLAP = "Enemies/Hundun_wing_flap",
ENEMIES_IMP_DROP = "Enemies/Imp_drop",
ENEMIES_IMP_FLAP = "Enemies/Imp_flap",
ENEMIES_JELLYFISH_LOOP = "Enemies/Jellyfish_loop",
ENEMIES_JIANGSHI_CHARGE = "Enemies/Jiangshi_charge",
ENEMIES_JIANGSHI_FEMALE_JUMP = "Enemies/Jiangshi_female_jump",
ENEMIES_JIANGSHI_FLIP = "Enemies/Jiangshi_flip",
ENEMIES_JIANGSHI_JUMP = "Enemies/Jiangshi_jump",
ENEMIES_KILLED_ENEMY = "Enemies/Killed_enemy",
ENEMIES_KILLED_ENEMY_BONES = "Enemies/Killed_enemy_bones",
ENEMIES_KILLED_ENEMY_CORPSE = "Enemies/Killed_enemy_corpse",
ENEMIES_KINGU_GRIP = "Enemies/Kingu_grip",
ENEMIES_KINGU_HURT = "Enemies/Kingu_hurt",
ENEMIES_KINGU_SLIDE_LOOP = "Enemies/Kingu_slide_loop",
ENEMIES_LAMASSU_AIM_LOCK = "Enemies/Lamassu_aim_lock",
ENEMIES_LAMASSU_AIM_LOOP = "Enemies/Lamassu_aim_loop",
ENEMIES_LAMASSU_ATK_HIT = "Enemies/Lamassu_atk_hit",
ENEMIES_LAMASSU_ATK_LOOP = "Enemies/Lamassu_atk_loop",
ENEMIES_LAMASSU_FLY = "Enemies/Lamassu_fly",
ENEMIES_LAMASSU_WALK = "Enemies/Lamassu_walk",
ENEMIES_LAVAMANDER_ATK = "Enemies/Lavamander_atk",
ENEMIES_LAVAMANDER_CHARGE = "Enemies/Lavamander_charge",
ENEMIES_LAVAMANDER_JUMP = "Enemies/Lavamander_jump",
ENEMIES_LAVAMANDER_TRANSFORM = "Enemies/Lavamander_transform",
ENEMIES_LEPRECHAUN_JUMP = "Enemies/Leprechaun_jump",
ENEMIES_LEPRECHAUN_LOOP = "Enemies/Leprechaun_loop",
ENEMIES_LEPRECHAUN_STEAL_LOOP = "Enemies/Leprechaun_steal_loop",
ENEMIES_LIZARD_BONK = "Enemies/Lizard_bonk",
ENEMIES_LIZARD_CURL_LOOP = "Enemies/Lizard_curl_loop",
ENEMIES_LIZARD_JUMP = "Enemies/Lizard_jump",
ENEMIES_LIZARD_UNROLL = "Enemies/Lizard_unroll",
ENEMIES_MAGMAMAN_JUMP = "Enemies/Magmaman_jump",
ENEMIES_MAGMAMAN_TRANSFORM = "Enemies/Magmaman_transform",
ENEMIES_MANTRAP_BITE = "Enemies/Mantrap_bite",
ENEMIES_MOLERAT_DIG_LOOP = "Enemies/Molerat_dig_loop",
ENEMIES_MOLERAT_RUN_LOOP = "Enemies/Molerat_run_loop",
ENEMIES_MONKEY_JUMP = "Enemies/Monkey_jump",
ENEMIES_MONKEY_STEAL_END = "Enemies/Monkey_steal_end",
ENEMIES_MONKEY_STEAL_LOOP = "Enemies/Monkey_steal_loop",
ENEMIES_MOSQUITO_LOOP = "Enemies/Mosquito_loop",
ENEMIES_MOSQUITO_PIERCE = "Enemies/Mosquito_pierce",
ENEMIES_MUMMY_FLIES_LOOP = "Enemies/Mummy_flies_loop",
ENEMIES_MUMMY_STEP = "Enemies/Mummy_step",
ENEMIES_MUMMY_VOMIT = "Enemies/Mummy_vomit",
ENEMIES_NECROMANCER_CHARGE_LOOP = "Enemies/Necromancer_charge_loop",
ENEMIES_NECROMANCER_SPAWN = "Enemies/Necromancer_spawn",
ENEMIES_OCTOPUS_ATK = "Enemies/Octopus_atk",
ENEMIES_OCTOPUS_BONK = "Enemies/Octopus_bonk",
ENEMIES_OCTOPUS_JUMP = "Enemies/Octopus_jump",
ENEMIES_OCTOPUS_WALK = "Enemies/Octopus_walk",
ENEMIES_OLMEC_BOMB_SPAWN = "Enemies/Olmec_bomb_spawn",
ENEMIES_OLMEC_CRUSH = "Enemies/Olmec_crush",
ENEMIES_OLMEC_HOVER_LOOP = "Enemies/Olmec_hover_loop",
ENEMIES_OLMEC_PAD_BREAK = "Enemies/Olmec_pad_break",
ENEMIES_OLMEC_PAD_SHOW = "Enemies/Olmec_pad_show",
ENEMIES_OLMEC_SPLASH = "Enemies/Olmec_splash",
ENEMIES_OLMEC_STOMP = "Enemies/Olmec_stomp",
ENEMIES_OLMEC_TRANSFORM_CLOSE = "Enemies/Olmec_transform_close",
ENEMIES_OLMEC_TRANSFORM_OPEN = "Enemies/Olmec_transform_open",
ENEMIES_OLMEC_UFO_SPAWN = "Enemies/Olmec_ufo_spawn",
ENEMIES_OLMEC_UNCOVER = "Enemies/Olmec_uncover",
ENEMIES_OLMITE_ARMOR_BREAK = "Enemies/Olmite_armor_break",
ENEMIES_OLMITE_JUMP = "Enemies/Olmite_jump",
ENEMIES_OLMITE_STOMP = "Enemies/Olmite_stomp",
ENEMIES_OSIRIS_APPEAR = "Enemies/Osiris_appear",
ENEMIES_OSIRIS_PUNCH = "Enemies/Osiris_punch",
ENEMIES_PANGXIE_BUBBLE_ATK = "Enemies/Pangxie_bubble_atk",
ENEMIES_PANGXIE_PUNCH1 = "Enemies/Pangxie_punch1",
ENEMIES_PANGXIE_PUNCH2 = "Enemies/Pangxie_punch2",
ENEMIES_PROTO_BURST_LOOP = "Enemies/Proto_burst_loop",
ENEMIES_PROTO_CRAWL = "Enemies/Proto_crawl",
ENEMIES_ROBOT_LOOP = "Enemies/Robot_loop",
ENEMIES_ROBOT_TRIGGER = "Enemies/Robot_trigger",
ENEMIES_SCORPION_ATK = "Enemies/Scorpion_atk",
ENEMIES_SKELETON_COLLAPSE = "Enemies/Skeleton_collapse",
ENEMIES_SKELETON_MATERIALIZE = "Enemies/Skeleton_materialize",
ENEMIES_SNAKE_ATK = "Enemies/Snake_atk",
ENEMIES_SORCERESS_ATK = "Enemies/Sorceress_atk",
ENEMIES_SORCERESS_ATK_SPAWN = "Enemies/Sorceress_atk_spawn",
ENEMIES_SORCERESS_CHARGE_LOOP = "Enemies/Sorceress_charge_loop",
ENEMIES_SORCERESS_JUMP = "Enemies/Sorceress_jump",
ENEMIES_SPIDER_JUMP = "Enemies/Spider_jump",
ENEMIES_SPIDER_TRIGGER = "Enemies/Spider_trigger",
ENEMIES_STONE_TRANSFORM_LOOP = "Enemies/Stone_transform_loop",
ENEMIES_STORAGE_KEEPER_DIE = "Enemies/Storage_keeper_die",
ENEMIES_STORAGE_KEEPER_JUMP = "Enemies/Storage_keeper_jump",
ENEMIES_TADPOLE_SWIM = "Enemies/Tadpole_swim",
ENEMIES_TIAMAT_HURT = "Enemies/Tiamat_hurt",
ENEMIES_TIAMAT_ORB_LOOP = "Enemies/Tiamat_orb_loop",
ENEMIES_TIAMAT_SCEPTER = "Enemies/Tiamat_scepter",
ENEMIES_TIAMAT_SCREAM1 = "Enemies/Tiamat_scream1",
ENEMIES_TIAMAT_SCREAM2 = "Enemies/Tiamat_scream2",
ENEMIES_TIKIMAN_TALK = "Enemies/Tikiman_talk",
ENEMIES_UFO_ATK_END = "Enemies/UFO_atk_end",
ENEMIES_UFO_ATK_LOOP = "Enemies/UFO_atk_loop",
ENEMIES_UFO_CHARGE = "Enemies/UFO_charge",
ENEMIES_UFO_DAMAGE = "Enemies/UFO_damage",
ENEMIES_UFO_EJECT = "Enemies/UFO_eject",
ENEMIES_UFO_LOOP = "Enemies/UFO_loop",
ENEMIES_VAMPIRE_JUMP = "Enemies/Vampire_jump",
ENEMIES_VLAD_TRIGGER = "Enemies/Vlad_trigger",
ENEMIES_WITCHDOCTOR_CHANT_LOOP = "Enemies/Witchdoctor_chant_loop",
ENEMIES_WITCHDOCTOR_STAB = "Enemies/Witchdoctor_stab",
ENEMIES_WITCHDOCTOR_TALK = "Enemies/Witchdoctor_talk",
ENEMIES_WITCHDOCTOR_TRIGGER = "Enemies/Witchdoctor_trigger",
ENEMIES_YETI_BIG_CHARGE = "Enemies/Yeti_big_charge",
ENEMIES_YETI_BIG_PUNCH = "Enemies/Yeti_big_punch",
ENEMIES_YETI_BIG_STEP = "Enemies/Yeti_big_step",
ENEMIES_YETI_KING_ROAR = "Enemies/Yeti_king_roar",
ENEMIES_YETI_QUEEN_JUMP = "Enemies/Yeti_queen_jump",
ENEMIES_YETI_QUEEN_SLAM = "Enemies/Yeti_queen_slam",
FX_FX_ANUBIS_WARN = "FX/FX_anubis_warn",
FX_FX_COSMIC_ORB = "FX/FX_cosmic_orb",
FX_FX_CURSE = "FX/FX_curse",
FX_FX_DM_BANNER = "FX/FX_dm_banner",
FX_FX_JOURNAL_ENTRY = "FX/FX_journal_entry",
FX_FX_JOURNAL_PAGE = "FX/FX_journal_page",
ITEMS_ARROW_STICK = "Items/Arrow_stick",
ITEMS_BACKPACK_WARN = "Items/Backpack_warn",
ITEMS_BOMB_BIG_TIMER = "Items/Bomb_big_timer",
ITEMS_BOMB_STICK = "Items/Bomb_stick",
ITEMS_BOMB_TIMER = "Items/Bomb_timer",
ITEMS_BOOMBOX_OFF = "Items/Boombox_off",
ITEMS_BOOMERANG_CATCH = "Items/Boomerang_catch",
ITEMS_BOOMERANG_LOOP = "Items/Boomerang_loop",
ITEMS_BOW = "Items/Bow",
ITEMS_BOW_RELOAD = "Items/Bow_reload",
ITEMS_CAMERA = "Items/Camera",
ITEMS_CAPE_LOOP = "Items/Cape_loop",
ITEMS_CAPE_VLAD_FLAP = "Items/Cape_vlad_flap",
ITEMS_CLONE_GUN = "Items/Clone_gun",
ITEMS_COIN_BOUNCE = "Items/Coin_bounce",
ITEMS_CROSSBOW = "Items/Crossbow",
ITEMS_CROSSBOW_RELOAD = "Items/Crossbow_reload",
ITEMS_DAMSEL_CALL = "Items/Damsel_call",
ITEMS_DAMSEL_PET = "Items/Damsel_pet",
ITEMS_EXCALIBUR = "Items/Excalibur",
ITEMS_FREEZE_RAY = "Items/Freeze_ray",
ITEMS_FREEZE_RAY_HIT = "Items/Freeze_ray_hit",
ITEMS_HOVERPACK_LOOP = "Items/Hoverpack_loop",
ITEMS_JETPACK_END = "Items/Jetpack_end",
ITEMS_JETPACK_IGNITE = "Items/Jetpack_ignite",
ITEMS_JETPACK_LOOP = "Items/Jetpack_loop",
ITEMS_MACHETE = "Items/Machete",
ITEMS_MATTOCK_BREAK = "Items/Mattock_break",
ITEMS_MATTOCK_HIT = "Items/Mattock_hit",
ITEMS_MATTOCK_SWING = "Items/Mattock_swing",
ITEMS_PARACHUTE = "Items/Parachute",
ITEMS_PLASMA_CANNON = "Items/Plasma_cannon",
ITEMS_PLASMA_CANNON_CHARGE = "Items/Plasma_cannon_charge",
ITEMS_ROPE_ATTACH = "Items/Rope_attach",
ITEMS_ROPE_BURN_LOOP = "Items/Rope_burn_loop",
ITEMS_SCEPTER = "Items/Scepter",
ITEMS_SHOTGUN_FIRE = "Items/Shotgun_fire",
ITEMS_SPRING_SHOES = "Items/Spring_shoes",
ITEMS_TV_LOOP = "Items/TV_loop",
ITEMS_UDJAT_BLINK = "Items/Udjat_blink",
ITEMS_USHABTI_RATTLE = "Items/Ushabti_rattle",
ITEMS_WEBGUN = "Items/Webgun",
ITEMS_WEBGUN_HIT = "Items/Webgun_hit",
ITEMS_WITCHDOCTORSKULL_LOOP = "Items/Witchdoctorskull_loop",
ITEMS_WOODEN_SHIELD_BREAK = "Items/Wooden_shield_break",
ITEMS_WOODEN_SHIELD_DAMAGE = "Items/Wooden_shield_damage",
LIQUIDS_LAVA_STATIC_LOOP = "Liquids/Lava_static_loop",
LIQUIDS_LAVA_STREAM_LOOP = "Liquids/Lava_stream_loop",
LIQUIDS_WATER_REV_STREAM_LOOP = "Liquids/Water_rev_stream_loop",
LIQUIDS_WATER_SPLASH = "Liquids/Water_splash",
LIQUIDS_WATER_STREAM_LOOP = "Liquids/Water_stream_loop",
MENU_CANCEL = "Menu/Cancel",
MENU_CHARSEL_DESELECTION = "Menu/Charsel_deselection",
MENU_CHARSEL_DOOR = "Menu/Charsel_door",
MENU_CHARSEL_NAVI = "Menu/Charsel_navi",
MENU_CHARSEL_QUICK_NAVI = "Menu/Charsel_quick_navi",
MENU_CHARSEL_QUICK_NOPE = "Menu/Charsel_quick_nope",
MENU_CHARSEL_QUICK_OPEN = "Menu/Charsel_quick_open",
MENU_CHARSEL_SCROLL = "Menu/Charsel_scroll",
MENU_CHARSEL_SELECTION = "Menu/Charsel_selection",
MENU_CHARSEL_SELECTION2 = "Menu/Charsel_selection2",
MENU_DIRT_FALL = "Menu/Dirt_fall",
MENU_JOURNAL_STICKER = "Menu/Journal_sticker",
MENU_MM_BAR = "Menu/MM_bar",
MENU_MM_NAVI = "Menu/MM_navi",
MENU_MM_OPTIONS_SUB = "Menu/MM_options_sub",
MENU_MM_RESET = "Menu/MM_reset",
MENU_MM_SELECTION = "Menu/MM_selection",
MENU_MM_SET = "Menu/MM_set",
MENU_MM_TOGGLE = "Menu/MM_toggle",
MENU_NAVI = "Menu/Navi",
MENU_PAGE_RETURN = "Menu/Page_return",
MENU_PAGE_TURN = "Menu/Page_turn",
MENU_SELECTION = "Menu/Selection",
MENU_TITLE_SELECTION = "Menu/Title_selection",
MENU_TITLE_TORCH_LOOP = "Menu/Title_torch_loop",
MENU_ZOOM_IN = "Menu/Zoom_in",
MENU_ZOOM_OUT = "Menu/Zoom_out",
MOUNTS_AXOLOTL_ATK = "Mounts/Axolotl_atk",
MOUNTS_AXOLOTL_ATK_HIT = "Mounts/Axolotl_atk_hit",
MOUNTS_AXOLOTL_JUMP1 = "Mounts/Axolotl_jump1",
MOUNTS_AXOLOTL_JUMP2 = "Mounts/Axolotl_jump2",
MOUNTS_AXOLOTL_UNTAMED_LOOP = "Mounts/Axolotl_untamed_loop",
MOUNTS_AXOLOTL_WALK = "Mounts/Axolotl_walk",
MOUNTS_MECH_DRIVE_LOOP = "Mounts/Mech_drive_loop",
MOUNTS_MECH_JUMP = "Mounts/Mech_jump",
MOUNTS_MECH_PUNCH1 = "Mounts/Mech_punch1",
MOUNTS_MECH_SMASH = "Mounts/Mech_smash",
MOUNTS_MECH_SPARK = "Mounts/Mech_spark",
MOUNTS_MECH_TRANSFORM = "Mounts/Mech_transform",
MOUNTS_MECH_TURN = "Mounts/Mech_turn",
MOUNTS_MECH_WALK1 = "Mounts/Mech_walk1",
MOUNTS_MECH_WALK2 = "Mounts/Mech_walk2",
MOUNTS_MECH_WARN = "Mounts/Mech_warn",
MOUNTS_MOUNT = "Mounts/Mount",
MOUNTS_MOUNT_LAND = "Mounts/Mount_land",
MOUNTS_MOUNT_TAME = "Mounts/Mount_tame",
MOUNTS_QILIN_FLY_LOOP = "Mounts/Qilin_fly_loop",
MOUNTS_QILIN_HATCH = "Mounts/Qilin_hatch",
MOUNTS_QILIN_JUMP1 = "Mounts/Qilin_jump1",
MOUNTS_QILIN_JUMP2 = "Mounts/Qilin_jump2",
MOUNTS_QILIN_WALK = "Mounts/Qilin_walk",
MOUNTS_TURKEY_ATK = "Mounts/Turkey_atk",
MOUNTS_TURKEY_FLAP = "Mounts/Turkey_flap",
MOUNTS_TURKEY_JUMP = "Mounts/Turkey_jump",
MOUNTS_TURKEY_UNTAMED_LOOP = "Mounts/Turkey_untamed_loop",
MOUNTS_TURKEY_WALK = "Mounts/Turkey_walk",
MOUNTS_WILDDOG_FIREBALL_LOOP = "Mounts/Wilddog_fireball_loop",
MOUNTS_WILDDOG_JUMP1 = "Mounts/Wilddog_jump1",
MOUNTS_WILDDOG_JUMP2 = "Mounts/Wilddog_jump2",
MOUNTS_WILDDOG_UNTAMED_LOOP = "Mounts/Wilddog_untamed_loop",
MOUNTS_WILDDOG_WALK = "Mounts/Wilddog_walk",
PLAYER_DEATH_GHOST = "Player/Death_ghost",
PLAYER_ENTER_DOOR = "Player/Enter_door",
PLAYER_EQUIP = "Player/Equip",
PLAYER_GRAB_LEDGE = "Player/Grab_ledge",
PLAYER_INKED = "Player/Inked",
PLAYER_JUMP = "Player/Jump",
PLAYER_LAND_CHAIN = "Player/Land_chain",
PLAYER_LISE_DRIVE_LOOP = "Player/LISE_drive_loop",
PLAYER_LISE_LOADING_LOOP = "Player/LISE_loading_loop",
PLAYER_LISE_PUSH_LOOP = "Player/LISE_push_loop",
PLAYER_LISE_RADAR_LOOP = "Player/LISE_radar_loop",
PLAYER_LISE_WARNING = "Player/LISE_warning",
PLAYER_NO_ITEM = "Player/No_item",
PLAYER_PGHOST_ATK = "Player/Pghost_atk",
PLAYER_PGHOST_CHARGE_LOOP = "Player/Pghost_charge_loop",
PLAYER_PGHOST_DASH = "Player/Pghost_dash",
PLAYER_PGHOST_SHAKE = "Player/Pghost_shake",
PLAYER_PGHOST_SPAWN = "Player/Pghost_spawn",
PLAYER_PGHOST_SPIN = "Player/Pghost_spin",
PLAYER_PUSH_BLOCK_LOOP = "Player/Push_block_loop",
PLAYER_TOSS_ROPE = "Player/Toss_rope",
PLAYER_WHIP1 = "Player/Whip1",
PLAYER_WHIP2 = "Player/Whip2",
PLAYER_WHIP_JUMP = "Player/Whip_jump",
SHARED_ANGER = "Shared/Anger",
SHARED_BLOCK_LAND = "Shared/Block_land",
SHARED_BLOOD_SPLURT = "Shared/Blood_splurt",
SHARED_BUBBLE_BONK = "Shared/Bubble_bonk",
SHARED_BUBBLE_BURST = "Shared/Bubble_burst",
SHARED_BUBBLE_BURST_BIG = "Shared/Bubble_burst_big",
SHARED_CEILING_CRUMBLE = "Shared/Ceiling_crumble",
SHARED_CLIMB = "Shared/Climb",
SHARED_COFFIN_BREAK = "Shared/Coffin_break",
SHARED_COFFIN_RATTLE = "Shared/Coffin_rattle",
SHARED_COLLISION_SURFACE = "Shared/Collision_surface",
SHARED_COSMIC_ORB_DESTROY = "Shared/Cosmic_orb_destroy",
SHARED_COSMIC_ORB_LOOP = "Shared/Cosmic_orb_loop",
SHARED_CURSED_LOOP = "Shared/Cursed_loop",
SHARED_CURSE_GET = "Shared/Curse_get",
SHARED_DAMAGED = "Shared/Damaged",
SHARED_DAMAGED_FIRE = "Shared/Damaged_fire",
SHARED_DAMAGED_POISON = "Shared/Damaged_poison",
SHARED_DARK_LEVEL_START = "Shared/Dark_level_start",
SHARED_DESTRUCTIBLE_BREAK = "Shared/Destructible_break",
SHARED_DOOR_AMB_LOOP = "Shared/Door_amb_loop",
SHARED_DOOR_UNLOCK = "Shared/Door_unlock",
SHARED_DROP = "Shared/Drop",
SHARED_EXPLOSION = "Shared/Explosion",
SHARED_EXPLOSION_MODERN = "Shared/Explosion_modern",
SHARED_FIRE_IGNITE = "Shared/Fire_ignite",
SHARED_FIRE_LOOP = "Shared/Fire_loop",
SHARED_GRAB_CLIMBABLE = "Shared/Grab_climbable",
SHARED_HH_ANGER = "Shared/HH_anger",
SHARED_HH_OBEY = "Shared/HH_obey",
SHARED_HUMANOID_JUMP = "Shared/Humanoid_jump",
SHARED_ICE_BREAK = "Shared/Ice_break",
SHARED_ICE_SLIDE_LOOP = "Shared/Ice_slide_loop",
SHARED_IMPALED = "Shared/Impaled",
SHARED_LAND = "Shared/Land",
SHARED_LANTERN_BREAK = "Shared/Lantern_break",
SHARED_NEON_SIGN_LOOP = "Shared/Neon_sign_loop",
SHARED_OPEN_CHEST = "Shared/Open_chest",
SHARED_OPEN_CRATE = "Shared/Open_crate",
SHARED_PICK_UP = "Shared/Pick_up",
SHARED_POISON_WARN = "Shared/Poison_warn",
SHARED_PORTAL_LOOP = "Shared/Portal_loop",
SHARED_RICOCHET = "Shared/Ricochet",
SHARED_RUBBLE_BREAK = "Shared/Rubble_break",
SHARED_SACRIFICE = "Shared/Sacrifice",
SHARED_SACRIFICE_EGGPLANT = "Shared/Sacrifice_eggplant",
SHARED_SCARAB_LOOP = "Shared/Scarab_loop",
SHARED_SLEEP_BUBBLE = "Shared/Sleep_bubble",
SHARED_SMOKE_TELEPORT = "Shared/Smoke_teleport",
SHARED_STORAGE_PAD_ACTIVATE = "Shared/Storage_pad_activate",
SHARED_STUNNED_WAKE = "Shared/Stunned_wake",
SHARED_TELEPORT = "Shared/Teleport",
SHARED_TILE_BREAK = "Shared/Tile_break",
SHARED_TOSS = "Shared/Toss",
SHARED_TOSS_FIRE = "Shared/Toss_fire",
SHARED_TRIP = "Shared/Trip",
SHARED_WAKE_BLINK = "Shared/Wake_blink",
SHARED_WEBBED = "Shared/Webbed",
SHOP_SHOP_BUY = "Shop/Shop_buy",
SHOP_SHOP_ENTER = "Shop/Shop_enter",
SHOP_SHOP_FOCUS = "Shop/Shop_focus",
SHOP_SHOP_NOPE = "Shop/Shop_nope",
SHOP_SHOP_PICK_UP = "Shop/Shop_pick_up",
TRANSITIONS_TRANS_ANGER = "Transitions/Trans_anger",
TRANSITIONS_TRANS_ANKH = "Transitions/Trans_ankh",
TRANSITIONS_TRANS_DARK = "Transitions/Trans_dark",
TRANSITIONS_TRANS_DARK_FIRST = "Transitions/Trans_dark_first",
TRANSITIONS_TRANS_DEATH = "Transitions/Trans_death",
TRANSITIONS_TRANS_DM_RESULTS = "Transitions/Trans_dm_results",
TRANSITIONS_TRANS_LAYER = "Transitions/Trans_layer",
TRANSITIONS_TRANS_LAYER_SPECIAL = "Transitions/Trans_layer_special",
TRANSITIONS_TRANS_OUROBOROS = "Transitions/Trans_ouroboros",
TRANSITIONS_TRANS_PAUSE = "Transitions/Trans_pause",
TRANSITIONS_TRANS_PIPE = "Transitions/Trans_pipe",
TRANSITIONS_TRANS_SHOP = "Transitions/Trans_shop",
TRANSITIONS_TRANS_THEME = "Transitions/Trans_theme",
TRANSITIONS_TRANS_TUNNEL = "Transitions/Trans_tunnel",
TRAPS_ARROWTRAP_TRIGGER = "Traps/Arrowtrap_trigger",
TRAPS_BOULDER_CRUSH = "Traps/Boulder_crush",
TRAPS_BOULDER_EMERGE = "Traps/Boulder_emerge",
TRAPS_BOULDER_LOOP = "Traps/Boulder_loop",
TRAPS_BOULDER_WARN_LOOP = "Traps/Boulder_warn_loop",
TRAPS_CONVEYOR_BELT_LOOP = "Traps/Conveyor_belt_loop",
TRAPS_CRUSHTRAP_BIG_STOP = "Traps/Crushtrap_big_stop",
TRAPS_CRUSHTRAP_STOP = "Traps/Crushtrap_stop",
TRAPS_DRILL_LOOP = "Traps/Drill_loop",
TRAPS_DUAT_WALL_LOOP = "Traps/Duat_wall_loop",
TRAPS_ELEVATOR_DOWN = "Traps/Elevator_down",
TRAPS_ELEVATOR_UP = "Traps/Elevator_up",
TRAPS_GENERATOR_GENERATE = "Traps/Generator_generate",
TRAPS_GIANTCLAM_CLOSE = "Traps/Giantclam_close",
TRAPS_GIANTCLAM_OPEN = "Traps/Giantclam_open",
TRAPS_KALI_ANGERED = "Traps/Kali_angered",
TRAPS_LASERBEAM_CHARGE = "Traps/Laserbeam_charge",
TRAPS_LASERBEAM_COLLISION = "Traps/Laserbeam_collision",
TRAPS_LASERBEAM_END = "Traps/Laserbeam_end",
TRAPS_LASERBEAM_LOOP = "Traps/Laserbeam_loop",
TRAPS_LASERTRAP_CHARGE = "Traps/Lasertrap_charge",
TRAPS_LASERTRAP_TRIGGER = "Traps/Lasertrap_trigger",
TRAPS_LIONTRAP_ATK = "Traps/Liontrap_atk",
TRAPS_LIONTRAP_TRIGGER = "Traps/Liontrap_trigger",
TRAPS_MINE_ACTIVATE = "Traps/Mine_activate",
TRAPS_MINE_BLINK = "Traps/Mine_blink",
TRAPS_MINE_DEACTIVATE = "Traps/Mine_deactivate",
TRAPS_PIPE_LOOP = "Traps/Pipe_loop",
TRAPS_PLATFORM_BREAK = "Traps/Platform_break",
TRAPS_PLATFORM_TRIGGER = "Traps/Platform_trigger",
TRAPS_QUICKSAND_AMB_LOOP = "Traps/Quicksand_amb_loop",
TRAPS_QUICKSAND_LOOP = "Traps/Quicksand_loop",
TRAPS_REGENBLOCK_GROW = "Traps/Regenblock_grow",
TRAPS_SKULLBLOCK_ATK = "Traps/Skullblock_atk",
TRAPS_SKULLBLOCK_TRIGGER = "Traps/Skullblock_trigger",
TRAPS_SKULLDROP_DROP = "Traps/Skulldrop_drop",
TRAPS_SKULLDROP_LOOP = "Traps/Skulldrop_loop",
TRAPS_SLIDEWALL_STOMP = "Traps/Slidewall_stomp",
TRAPS_SNAPTRAP_CLOSE = "Traps/Snaptrap_close",
TRAPS_SNAPTRAP_OPEN = "Traps/Snaptrap_open",
TRAPS_SPARK_HIT = "Traps/Spark_hit",
TRAPS_SPARK_LOOP = "Traps/Spark_loop",
TRAPS_SPEARTRAP_ATK = "Traps/Speartrap_atk",
TRAPS_SPEARTRAP_TRIGGER = "Traps/Speartrap_trigger",
TRAPS_SPIKE_BALL_DROP_LOOP = "Traps/Spike_ball_drop_loop",
TRAPS_SPIKE_BALL_END = "Traps/Spike_ball_end",
TRAPS_SPIKE_BALL_HIT = "Traps/Spike_ball_hit",
TRAPS_SPIKE_BALL_RISE_LOOP = "Traps/Spike_ball_rise_loop",
TRAPS_SPRING_TRIGGER = "Traps/Spring_trigger",
TRAPS_STICKYTRAP_DROP_LOOP = "Traps/Stickytrap_drop_loop",
TRAPS_STICKYTRAP_END = "Traps/Stickytrap_end",
TRAPS_STICKYTRAP_HIT = "Traps/Stickytrap_hit",
TRAPS_STICKYTRAP_RISE_LOOP = "Traps/Stickytrap_rise_loop",
TRAPS_STICKYTRAP_WAKE = "Traps/Stickytrap_wake",
TRAPS_SWITCH_FLICK = "Traps/Switch_flick",
TRAPS_THINICE_CRACK = "Traps/Thinice_crack",
TRAPS_TIKI_ATK = "Traps/Tiki_atk",
TRAPS_TIKI_TRIGGER = "Traps/Tiki_trigger",
TRAPS_WOODENLOG_CRUSH = "Traps/Woodenlog_crush",
TRAPS_WOODENLOG_TRIGGER = "Traps/Woodenlog_trigger",
UI_DAMSEL_KISS = "UI/Damsel_kiss",
UI_DEPOSIT = "UI/Deposit",
UI_GET_GEM = "UI/Get_gem",
UI_GET_GOLD = "UI/Get_gold",
UI_GET_ITEM1 = "UI/Get_item1",
UI_GET_ITEM2 = "UI/Get_item2",
UI_GET_SCARAB = "UI/Get_scarab",
UI_JOURNAL_ENTRY = "UI/Journal_entry",
UI_JOURNAL_OFF = "UI/Journal_off",
UI_JOURNAL_ON = "UI/Journal_on",
UI_KAPPALA_HEAL = "UI/Kappala_heal",
UI_NPC_VOCAL = "UI/NPC_vocal",
UI_PAUSE_MENU_OFF = "UI/Pause_menu_off",
UI_PAUSE_MENU_ON = "UI/Pause_menu_on",
UI_SECRET = "UI/Secret",
UI_SECRET2 = "UI/Secret2",
UI_TEXT_DESCRIPTION = "UI/Text_description",
UI_TUNNEL_COUNT = "UI/Tunnel_count",
UI_TUNNEL_SCROLL = "UI/Tunnel_scroll",
UI_TUNNEL_TABLET_DOWN = "UI/Tunnel_tablet_down",
UI_TUNNEL_TABLET_UP = "UI/Tunnel_tablet_up",
UI_ZOOM_IN = "UI/Zoom_in",
UI_ZOOM_OUT = "UI/Zoom_out"
}
VANILLA_SOUND_CALLBACK_TYPE = {
CREATED = 1,
DESTROYED = 2,
RESTARTED = 16,
STARTED = 8,
START_FAILED = 64,
STOPPED = 32
}
VANILLA_SOUND_PARAM = {
ANGER_PROXIMITY = 11,
ANGER_STATE = 12,
CAM_DEPTH = 24,
COLLISION_MATERIAL = 14,
CURRENT_LAYER2 = 37,
CURRENT_LEVEL = 35,
CURRENT_SHOP_TYPE = 36,
CURRENT_THEME = 34,
CURSED = 28,
DIST_CENTER_X = 1,
DIST_CENTER_Y = 2,
DIST_PLAYER = 4,
DIST_Z = 3,
DM_STATE = 32,
FAST_FORWARD = 33,
FIRST_RUN = 23,
GHOST = 9,
LIGHTNESS = 16,
LIQUID_INTENSITY = 7,
LIQUID_STREAM = 6,
MONSTER_ID = 19,
PAGE = 31,
PLAYER_ACTIVITY = 20,
PLAYER_CHARACTER = 30,
PLAYER_CONTROLLED = 29,
PLAYER_DEPTH = 22,
PLAYER_LIFE = 21,
POISONED = 27,
POS_SCREEN_X = 0,
RESTLESS_DEAD = 25,
SIZE = 17,
SPECIAL_MACHINE = 26,
SUBMERGED = 5,
TORCH_PROXIMITY = 13,
TRIGGER = 10,
TYPE_ID = 18,
VALUE = 8,
VELOCITY = 15
}
VladsCape = {
__index = "function: 0000020E8E22F310",
__name = "sol.VladsCape.user",
__newindex = "function: 0000020E8E22EE10"
}
WIN_STATE = {
COSMIC_OCEAN_WIN = 3,
HUNDUN_WIN = 2,
NO_WIN = 0,
TIAMAT_WIN = 1
}
YANG = {
ANGRY = -1,
BOTH_TURKEYS_DELIVERED = 3,
ONE_TURKEY_BOUGHT = 5,
QUEST_NOT_STARTED = 0,
THREE_TURKEYS_BOUGHT = 7,
TURKEY_PEN_SPAWNED = 2,
TURKEY_SHOP_SPAWNED = 4,
TWO_TURKEYS_BOUGHT = 6
}
apply_entity_db = function(...) end
carry = function(...) end
clear_callback = function(...) end
clear_entity_callback = function(...) end
clear_vanilla_sound_callback = function(...) end
clr_flag = function(...) end
clrflag = function(...) end
create_image = function(...) end
create_sound = function(...) end
define_texture = function(...) end
define_tile_code = function(...) end
distance = function(...) end
door = function(...) end
draw_circle = function(...) end
draw_circle_filled = function(...) end
draw_image = function(...) end
draw_image_rotated = function(...) end
draw_line = function(...) end
draw_rect = function(...) end
draw_rect_filled = function(...) end
draw_text = function(...) end
draw_text_size = function(...) end
entity_get_items_by = function(...) end
entity_has_item_type = function(...) end
entity_has_item_uid = function(...) end
entity_remove_item = function(...) end
f = {}
flip_entity = function(...) end
force_co_subtheme = function(...) end
force_dark_level = function(...) end
game_position = function(...) end
generate_particles = function(...) end
get_bounds = function(...) end
get_camera_position = function(...) end
get_door_target = function(...) end
get_entities = function(...) end
get_entities_at = function(...) end
get_entities_by = function(...) end
get_entities_by_layer = function(...) end
get_entities_by_mask = function(...) end
get_entities_by_type = function(...) end
get_entities_overlapping = function(...) end
get_entity = function(...) end
get_entity_ai_state = function(...) end
get_entity_flags = function(...) end
get_entity_flags2 = function(...) end
get_entity_type = function(...) end
get_frame = function(...) end
get_level_flags = function(...) end
get_ms = function(...) end
get_particle_type = function(...) end
get_position = function(...) end
get_render_position = function(...) end
get_sound = function(...) end
get_texture_definition = function(...) end
get_type = function(...) end
get_window_size = function(...) end
get_zoom_level = function(...) end
god = function(...) end
inspect = {
KEY = {},
METATABLE = {},
_DESCRIPTION = "human-readable representations of tables",
_LICENSE = " MIT LICENSE\n\n Copyright (c) 2013 Enrique Garc�a Cota\n\n Permission is hereby granted, free of charge, to any person obtaining a\n copy of this software and associated documentation files (the\n \"Software\"), to deal in the Software without restriction, including\n without limitation the rights to use, copy, modify, merge, publish,\n distribute, sublicense, and/or sell copies of the Software, and to\n permit persons to whom the Software is furnished to do so, subject to\n the following conditions:\n\n The above copyright notice and this permission notice shall be included\n in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n ",
_URL = "http://github.com/kikito/inspect.lua",
_VERSION = "inspect.lua 3.1.0",
inspect = ((loadstring or load)("\27LuaT\0\25�\13\n\26\n\4\8\8xV\0\0\0\0\0\0\0\0\0\0\0(w@\4\4�\nlocal inspect ={\n _VERSION = 'inspect.lua 3.1.0',\n _URL = 'http://github.com/kikito/inspect.lua',\n _DESCRIPTION = 'human-readable representations of tables',\n _LICENSE = [[\n MIT LICENSE\n\n Copyright (c) 2013 Enrique Garc�a Cota\n\n Permission is hereby granted, free of charge, to any person obtaining a\n copy of this software and associated documentation files (the\n \"Software\"), to deal in the Software without restriction, including\n without limitation the rights to use, copy, m...\2�\2�\2\0\11�\0\0008\1\0�\19\1\0\0R\0\0\0�\0\2\0\14\1\1\0B�\0\0�\0\0�\11\1\0\1\14\1\2\2�\1\1\3\0\0008\0\0��\1\2\0\14\2\1\5B�\0\0008\0\0�\3\2\3\0�\2\1\7�\2\0\0008\4\0�\9\3\1\0�\3\5\0\0\4\0\0�\4\0\0R\0\0\0\19\5\0\0R\0\0\0D\3\5\2\0\0\6\0\11\3\0\8�\3\4\0R\0\0\0�\3\0\2��\9\n\19\4\0\0R\0\0\0�\3\11\8\19\4\0\0R\0\0\0�\3\12\8\19\4\0\0R\0\0\0�\3\13\8�\3\3\3�\3\5\4\9\4\2\0�\4\0\0D\4\2\2�\3\14\8\9\4\3\0D\3\3\2��\6\15�\4\0\0�\3\3\1�\3\0\16�\3\7\17\14\4\6\11�\3\2\0�\3\0\0�\3\1\0�\4�depth\4�math\4�huge\4�newline\4�\n\4�indent\4� \4�process\4�setmetatable\4�level\3\0\0\0\0\0\0\0\0\4�buffer\4�ids\4�maxIds\4�tableAppearances\4�putValue\4�table\4�concat�\0\0\0\1\16\0\1\13\0\1\18\0��\1\0\0\0\0\2\0\0\0\0\1\0\0\0\1\0\0\0\1\2\0\1\0\0\0\0\0\0\0\0\3\0\0\1\1\1\0\0\1\0\0\1\0\0\1\1\1\0\0\0\1�\11\0\0\2\0\0\0\0\1���root���options���depth���newline���indent���process���inspector����_ENV�processRecursive�countTableAppearances�Inspector_mt",'@serialized'))
}
json = {
_version = "0.1.2",
decode = ((loadstring or load)("\27LuaT\0\25�\13\n\26\n\4\8\8xV\0\0\0\0\0\0\0\0\0\0\0(w@\5\4�\n--\n-- json.lua\n--\n-- Copyright (c) 2020 rxi\n--\n-- Permission is hereby granted, free of charge, to any person obtaining a copy of\n-- this software and associated documentation files (the \"Software\"), to deal in\n-- the Software without restriction, including without limitation the rights to\n-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n-- of the Software, and to permit persons to whom the Software is furnished to do\n-- so, subject to the following conditions:\n--\n-- The...\2�\3�\1\0\8��\0\0\0\0\1\0\0�\0\2\2��\1\0008\3\0��\0\0\2\3�\1\0�\1\0\0\0\2\0\0�\1\2\0025\1\2\0�\0\2\1�\0\1\0\0\1\0\0�\1\2\0\0\2\0\0�\2\0�\9\3\3\0�\3\0\0�\1\5\0�\0\0\3�\1\2\0\0\2\0\0�\2\2\0\9\3\3\0�\3\0\0�\1\5\2\0\1\3\0�\1\0\0;\1\3\0008\2\0��\1\4\0\0\2\0\0�\2\2\0\3\3\2\0�\1\4\1�\0\2\0�\1\1\0�\4�type\4�string\4�error\4�expected argument of type string, got \4�trailing garbage�\0\0\0\1\n\0\1\17\0\1\12\0\1\18\0��\1\0\0\0\0\1\0\0\0\0\0\0\2\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\1\0\0\1\0\0\0\0\2\1���str���res���idx����_ENV�parse�next_char�space_chars�decode_error",'@serialized')),
encode = ((loadstring or load)("\27LuaT\0\25�\13\n\26\n\4\8\8xV\0\0\0\0\0\0\0\0\0\0\0(w@\1\4�\n--\n-- json.lua\n--\n-- Copyright (c) 2020 rxi\n--\n-- Permission is hereby granted, free of charge, to any person obtaining a copy of\n-- this software and associated documentation files (the \"Software\"), to deal in\n-- the Software without restriction, including without limitation the rights to\n-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n-- of the Software, and to permit persons to whom the Software is furnished to do\n-- so, subject to the following conditions:\n--\n-- The...\1�\1�\1\0\3��\0\0\0\0\1\0\0�\0\2\2�\0\2\0�\0\1\0��\1\1\0��\1\0\0\0\1���val����encode",'@serialized'))
}
kill_entity = function(...) end
layer_door = function(...) end
load_script = function(...) end
lock_door_at = function(...) end
message = function(...) end
messpect = function(...) end
modify_sparktraps = function(...) end
move_entity = function(...) end
options = {}
pause = function(...) end
pick_up = function(...) end
players =
prinspect = function(...) end
read_input = function(...) end
read_prng = function(...) end
read_stolen_input = function(...) end
register_option_bool = function(...) end
register_option_button = function(...) end
register_option_combo = function(...) end
register_option_float = function(...) end
register_option_int = function(...) end
register_option_string = function(...) end
replace_drop = function(...) end
return_input = function(...) end
rgba = function(...) end
savegame =
say = function(...) end
screen_distance = function(...) end
screen_position = function(...) end
seed_prng = function(...) end
send_input = function(...) end
set_arrowtrap_projectile = function(...) end
set_blood_multiplication = function(...) end
set_callback = function(...) end
set_camera_position = function(...) end
set_contents = function(...) end
set_door = function(...) end
set_door_target = function(...) end
set_drop_chance = function(...) end
set_entity_flags = function(...) end
set_entity_flags2 = function(...) end
set_flag = function(...) end
set_ghost_spawn_times = function(...) end
set_global_interval = function(...) end
set_global_timeout = function(...) end
set_interval = function(...) end
set_journal_enabled = function(...) end
set_kapala_blood_threshold = function(...) end
set_kapala_hud_icon = function(...) end
set_level_flags = function(...) end
set_olmec_phase_y_level = function(...) end
set_post_entity_spawn = function(...) end
set_post_statemachine = function(...) end
set_post_tile_code_callback = function(...) end
set_pre_entity_spawn = function(...) end
set_pre_statemachine = function(...) end
set_pre_tile_code_callback = function(...) end
set_seed = function(...) end
set_timeout = function(...) end
set_vanilla_sound_callback = function(...) end
setflag = function(...) end
spawn = function(...) end
spawn_critical = function(...) end
spawn_door = function(...) end
spawn_entity = function(...) end
spawn_entity_nonreplaceable = function(...) end
spawn_entity_over = function(...) end
spawn_layer_door = function(...) end
spawn_liquid = function(...) end
state =
steal_input = function(...) end
test_flag = function(...) end
testflag = function(...) end
toast = function(...) end
unlock_door_at = function(...) end
waddler_count_entity = function(...) end
waddler_remove_entity = function(...) end
waddler_store_entity = function(...) end
warp = function(...) end
win_button = function(...) end
win_check = function(...) end
win_combo = function(...) end
win_drag_float = function(...) end
win_drag_int = function(...) end
win_image = function(...) end
win_inline = function(...) end
win_input_float = function(...) end
win_input_int = function(...) end
win_input_text = function(...) end
win_popid = function(...) end
win_pushid = function(...) end
win_sameline = function(...) end
win_separator = function(...) end
win_slider_float = function(...) end
win_slider_int = function(...) end
win_text = function(...) end
window = function(...) end
zoom = function(...) end
|
-- Returns true if x is prime, and false otherwise
function isprime (x)
if x < 2 then return false end
if x < 4 then return true end
if x % 2 == 0 then return false end
for d = 3, math.sqrt(x), 2 do
if x % d == 0 then return false end
end
return true
end
-- Returns table of prime numbers (from lo, if specified) up to hi
function primes (lo, hi)
local t = {}
if not hi then
hi = lo
lo = 2
end
for n = lo, hi do
if isprime(n) then table.insert(t, n) end
end
return t
end
-- Show all the values of a table in one line
function show (x)
for _, v in pairs(x) do io.write(v .. " ") end
print()
end
-- Main procedure
show(primes(100))
show(primes(50, 150))
|
local Craft = require('craft2')
local Event = require('event')
local itemDB = require('itemDB')
local Milo = require('milo')
local UI = require('ui')
local Util = require('util')
local colors = _G.colors
local context = Milo:getContext()
local device = _G.device
local os = _G.os
--[[ Configuration Screen ]]
local wizardPage = UI.Window {
title = 'Crafting Monitor',
index = 2,
backgroundColor = colors.cyan,
[1] = UI.TextArea {
x = 2, ex = -2, y = 2, ey = 3,
marginRight = 0,
textColor = colors.yellow,
value = 'Displays the crafting progress.'
},
form = UI.Form {
x = 2, ex = -2, y = 4, ey = -2,
manualControls = true,
[1] = UI.Chooser {
width = 9,
formLabel = 'Font Size', formKey = 'textScale',
nochoice = 'Small',
choices = {
{ name = 'Small', value = .5 },
{ name = 'Large', value = 1 },
},
help = 'Adjust text scaling',
},
},
}
function wizardPage:setNode(node)
self.form:setValues(node)
end
function wizardPage:saveNode(node)
os.queueEvent('monitor_resize', node.name)
end
function wizardPage:validate()
return self.form:save()
end
function wizardPage:isValidType(node)
local m = device[node.name]
return m and m.type == 'monitor' and {
name = 'Crafting Monitor',
value = 'jobs',
category = 'display',
help = 'Display crafting progress / jobs'
}
end
function wizardPage:isValidFor(node)
return node.mtype == 'jobs'
end
UI:getPage('nodeWizard').wizard:add({ jobs = wizardPage })
--[[ Display ]]
-- TODO: some way to cancel a job
local function createPage(node)
local page = UI.Page {
parent = UI.Device {
device = node.adapter,
textScale = node.textScale or .5,
},
grid = UI.Grid {
sortColumn = 'index',
columns = {
{ heading = 'Qty', key = 'remaining', width = 4 },
{ heading = 'Crafting', key = 'displayName', },
{ heading = 'Status', key = 'status', },
{ heading = 'need', key = 'need', width = 4 },
-- { heading = 'total', key = 'total', width = 4 },
-- { heading = 'used', key = 'used', width = 4 },
-- { heading = 'count', key = 'count', width = 4 },
{ heading = 'crafted', key = 'crafted', width = 5 },
-- { heading = 'Progress', key = 'progress', width = 8 },
},
},
}
function page:updateList(craftList)
if not Milo:isCraftingPaused() then
local t = { }
for _,v in pairs(craftList) do
table.insert(t, v)
v.index = #t
for k2,v2 in pairs(v.ingredients or { }) do
if v2.key ~= v.key --[[and v2.statusCode ]] then
table.insert(t, v2)
if not v2.displayName then
v2.displayName = itemDB:getName(k2)
end
v2.index = #t
end
end
end
self.grid:setValues(t)
self.grid:update()
self:draw()
self:sync()
end
end
function page.grid:getDisplayValues(row)
row = Util.shallowCopy(row)
if not row.displayName then
row.displayName = itemDB:getName(row)
end
if row.requested then
row.remaining = math.max(0, row.requested - row.crafted)
else
row.displayName = ' ' .. row.displayName
end
--row.progress = string.format('%d/%d', row.crafted, row.count)
return row
end
function page.grid:getRowTextColor(row, selected)
local statusColor = {
[ Craft.STATUS_ERROR ] = colors.red,
[ Craft.STATUS_WARNING ] = colors.orange,
[ Craft.STATUS_INFO ] = colors.yellow,
[ Craft.STATUS_SUCCESS ] = colors.green,
}
return row.statusCode and statusColor[row.statusCode] or
UI.Grid:getRowTextColor(row, selected)
end
page:enable()
page:draw()
page:sync()
return page
end
local pages = { }
Event.on('monitor_resize', function(_, side)
for node in context.storage:filterActive('jobs') do
if node.name == side and pages[node.name] then
local p = pages[node.name]
p.parent:setTextScale(node.textScale or .5)
p.parent:resize()
p:resize()
p:draw()
p:sync()
break
end
end
end)
Event.on({ 'milo_resume', 'milo_pause' }, function(_, reason)
for node in context.storage:filterActive('jobs') do
local page = pages[node.name]
if page then
if reason then
page.grid:clear()
page.grid:centeredWrite(math.ceil(page.grid.height / 2), reason.msg)
else
page.grid:draw()
end
page:sync()
end
end
end)
--[[ Task ]]
local task = {
name = 'job status',
priority = 80,
}
function task:cycle()
for node in context.storage:filterActive('jobs') do
if not pages[node.name] then
pages[node.name] = createPage(node)
end
pages[node.name]:updateList(context.craftingQueue)
end
end
Milo:registerTask(task)
|
local window
function init(name)
window = g_ui.displayUI('tvCam')
window:setVisible(false)
onlineTv(name)
end
function terminate()
disconnect(g_game, { onGameStart = online,
onGameEnd = destroy })
destroy()
end
function onlineTv(name)
window:setVisible(true)
changelogText = window:recursiveGetChildById('textTvCam')
local choiceList = window:recursiveGetChildById('moduleListTvCam')
local txt = ""
local t = string.explode(name, "/")
for i = 2, #t do
local label = g_ui.createWidget('ModuleListLabelTvCam', choiceList)
local txt1 = string.explode(t[i], ",")
label:setText(txt1[1])
label.onDoubleClick = function() selectLabel(window, txt1[2], txt1[3]) end
end
end
function selectLabel(window, name, name2)
changelogText = window:recursiveGetChildById('textTvCam')
changelogText:setText(name)
g_game.talk('@tvCam Follow,'..name2)
end
function initCreateChannel()
addChannelWindow = g_ui.displayUI('createChannel')
addChannelWindow:setVisible(true)
end
function termiCreateChannel()
addChannelWindow:setVisible(false)
end
function CreateChannel()
local channelName = addChannelWindow:getChildById('createChannelText1'):getText()
local channelDescription = addChannelWindow:getChildById('createChannelText2'):getText()
g_game.talk('@tvCam onAir,' .. channelName .. ',' .. channelDescription)
addChannelWindow:setVisible(false)
connect(g_game, {onGameEnd = termiCreateChannel})
end
function initChannelOnAir()
ChannelOnAir = g_ui.displayUI('tvCamOnAir')
ChannelOnAir:setVisible(true)
ChannelOnAir:setPosition({x = 15, y = 15})
connect(g_game, {onGameEnd = termiChannelOnAir})
end
function termiChannelOnAir()
ChannelOnAir:setVisible(false)
g_game.talk('@tvCam Close')
end
function destroy()
if window then
window:destroy()
window = nil
end
end
function assistir()
g_game.talk('@tvCam Assistir')
window:setVisible(false)
end
function assistirThen()
assisntindoUI = g_ui.displayUI('tvCamWatch')
assisntindoUI:setVisible(true)
connect(g_game, {onGameEnd = termiAssistir1})
end
function termiAssistir()
g_game.talk('@tvCam StopWatch')
assisntindoUI:setVisible(false)
end
function termiAssistir1()
assisntindoUI:setVisible(false)
end
local autoLootWin = nil
function autoLootShow(loot)
autoLootWin = g_ui.displayUI('tvCamWatch1')
autoLootWin:setVisible(true)
local localesPanel = autoLootWin:getChildById('localesPanel')
localesPanel:setImageSource('/images/ui/aqui')
local layout = localesPanel:getLayout()
local spacing = layout:getCellSpacing()
local size = layout:getCellSize()
local sizeWin = 0
local t = string.explode(loot, ",")
local count = loot:match("'(.-)'")
for i = 1, tonumber(count) do
if not t[i] then break end
local name = string.explode(t[i], "!")
local widget = g_ui.createWidget('LocalesButtom', localesPanel)
item = name[1]
setLootImage(autoLootWin, i, item)
widget:setText(name[2])
sizeWin = sizeWin + 1
end
autoLootWin:setWidth(size.width * sizeWin)
localesPanel:setWidth(size.width * sizeWin)
connect(g_game, {onGameEnd = autoLootHide})
end
function getAutoLootWindow()
return autoLootWin
end
function autoLootHide()
if getAutoLootWindow() ~= nil then
autoLootWin:setVisible(false)
autoLootWin = nil
end
end
function setLootImage(windown, orderLoot, id)
itemLoot = windown:getChildById('itemPreview'..orderLoot)
itemLoot:setItemId(id)
end
|
--[[
Purpose: Provides utility functions used by libraries and core
framework files.
--]]
nut.util = {}
AdvNut.hook.Add("EntityKeyValue", "nut_StoreKeyValues", function(entity, key, value)
entity.nut_KeyValues = entity.nut_KeyValues or {}
entity.nut_KeyValues[key] = value
end)
--[[
Purpose: Since Entity:GetKeyValues() is unreliable, use the key values
retrieved from the EntityKeyValue hook to return the value for the key
passed.
--]]
function nut.util.GetEntityKeyValues(entity)
return entity.nut_KeyValues
end
--[[
Purpose: Includes a file based of its prefix and will include it
properly and send it to the client if needed.
--]]
function nut.util.Include(fileName, state)
if (state == "shared" or string.find(fileName, "sh_")) then
AddCSLuaFile(fileName)
include(fileName)
elseif ((state == "server" or string.find(fileName, "sv_")) and SERVER) then
include(fileName)
elseif (state == "client" or string.find(fileName, "cl_")) then
if (SERVER) then
AddCSLuaFile(fileName)
else
include(fileName)
end
end
end
--[[
Purpose: Gets the appropriate alpha value for colors using two vectors.
--]]
function nut.util.GetAlphaFromDist(position, goal, maxDistance, maxAlpha)
maxAlpha = maxAlpha or 255
local distance = goal:Distance(position)
return (1 - distance / maxDistance) * maxAlpha
end
--[[
Purpose: Creates a string of random numbers by added random numbers to a string
x times, where x is the number of digits specified.
--]]
function nut.util.GetRandomNum(digits)
if (digits <= 1) then
error("Number of digits must be greater than 1.")
end
math.randomseed(CurTime())
local output = ""
for i = 1, digits do
output = output..math.Clamp(math.Round(math.random(0, 999) / 100), 0, 9)
end
return output
end
--[[
Purpose: Will find all the files in the schema or framework,
if isBase is true, and include them based of their prefixes. This is
used for including stuff like directories with a lot of files in them like libs.
--]]
function nut.util.IncludeDir(directory, isBase)
if ((!isBase or string.find(directory, "schema/")) and !SCHEMA) then
error("Too early to use the schema!")
end
local directory2 = (isBase and "nutscript" or SCHEMA.folderName).."/gamemode/"..directory.."/*.lua"
for k, v in pairs(file.Find(directory2, "LUA")) do
nut.util.Include(directory.."/"..v)
end
end
nut.util.IncludeDir("libs/external", true)
-- C++ Weapons do not have their holdtypes accessible by Lua.
local holdTypes = {
weapon_physgun = "smg",
weapon_physcannon = "smg",
weapon_stunstick = "melee",
weapon_crowbar = "melee",
weapon_stunstick = "melee",
weapon_357 = "pistol",
weapon_pistol = "pistol",
weapon_smg1 = "smg",
weapon_ar2 = "smg",
weapon_crossbow = "smg",
weapon_shotgun = "shotgun",
weapon_frag = "grenade",
weapon_slam = "grenade",
weapon_rpg = "shotgun",
weapon_bugbait = "melee",
weapon_annabelle = "shotgun",
gmod_tool = "pistol"
}
-- We don't want to make a table for all of the holdtypes, so just alias them.
local translateHoldType = {
melee2 = "melee",
fist = "melee",
knife = "melee",
ar2 = "smg",
physgun = "smg",
crossbow = "smg",
slam = "grenade",
passive = "normal",
rpg = "shotgun"
}
--[[
Purpose: Returns the weapon's holdtype for stuff like animation by either returning the holdtype
from the table if it exists or if it is a SWEP return that one or fallback on normal.
--]]
function nut.util.GetHoldType(weapon)
local holdType = holdTypes[weapon:GetClass()]
if (holdType) then
return holdType
elseif (weapon.HoldType) then
return translateHoldType[weapon.HoldType] or weapon.HoldType
else
return "normal"
end
end
--[[
Purpose: Checks two strings in multiple ways to see if they match.
This is used for identifying players based off a given string.
--]]
function nut.util.StringMatches(a, b)
if (a == b) then
return true
end
if (string.lower(a) == string.lower(b)) then
return true
end
if (string.find(a, b, nil, true) or string.find(b, a, nil, true)) then
return true
end
a = string.lower(a)
b = string.lower(b)
if (string.find(a, b, nil, true) or string.find(b, a, nil, true)) then
return true
end
return false
end
--[[
Purpose: Retrieves a player if his/her name matches the given string
using nut.util.StringMatches(a, b).
--]]
function nut.util.FindPlayer(name)
for k, v in pairs(player.GetAll()) do
if (nut.util.StringMatches(v:Name(), name)) then
return v
end
end
end
if (SERVER) then
-- Create needed directories here since using file.Write will no longer autocreate directories.
AdvNut.hook.Add("SchemaInitialized", "nut_CreateFiles", function()
file.CreateDir("AdvNutscript")
file.CreateDir("AdvNutscript/data")
file.CreateDir("AdvNutscript/"..SCHEMA.uniqueID)
end)
-- Table to cache tables that are to be saved/loaded.
nut.util.cachedTable = nut.util.cachedTable or {}
--[[
Purpose: Encodes a table using vON and saves it to data/AdvNutscript/<schema> if global
is not true, or data/AdvNutscript/data if it is. The table is also stored in a cache for
later retrieval without needing to read the file each time.
--]]
function nut.util.WriteTable(uniqueID, value, ignoreMap, global)
if (type(value) != "table") then
value = {value}
end
local encoded = pon.encode(value)
local map = string.lower(game.GetMap())
if (!global) then
if (ignoreMap) then
file.Write("AdvNutscript/"..SCHEMA.uniqueID.."/"..uniqueID..".txt", encoded)
else
file.CreateDir("AdvNutscript/"..SCHEMA.uniqueID.."/"..map)
file.Write("AdvNutscript/"..SCHEMA.uniqueID.."/"..map.."/"..uniqueID..".txt", encoded)
end
else
if (ignoreMap) then
file.Write("AdvNutscript/data/"..uniqueID..".txt", encoded)
else
file.CreateDir("AdvNutscript/data/"..map)
file.Write("AdvNutscript/data/"..map.."/"..uniqueID..".txt", encoded)
end
end
nut.util.cachedTable[uniqueID] = value
end
--[[
Purpose: If the data has not been cached or forceRefresh is true, read the file from either
the global data if it exists, otherwise the current schema's data folder, then decode the vON
encoded data and cache it. If it does exist, then the cached copy will be returned.
--]]
function nut.util.ReadTable(uniqueID, ignoreMap, forceRefresh)
local map = string.lower(game.GetMap())
if (!forceRefresh and nut.util.cachedTable[uniqueID]) then
return nut.util.cachedTable[uniqueID]
end
local contents
if (!ignoreMap) then
if (file.Exists("AdvNutscript/data/"..map..uniqueID..".txt", "DATA")) then
contents = file.Read("AdvNutscript/data/"..map..uniqueID..".txt", "DATA")
file.Delete("AdvNutscript/data/"..map..uniqueID..".txt", "DATA")
file.CreateDir("AdvNutscript/data/"..map.."/"..uniqueID)
file.Write("AdvNutscript/data/"..map.."/"..uniqueID..".txt", contents)
else
contents = file.Read("AdvNutscript/data/"..map.."/"..uniqueID..".txt", "DATA")
end
if (!contents or contents == "") then
if (file.Exists("AdvNutscript/"..SCHEMA.uniqueID.."/"..map..uniqueID..".txt", "DATA")) then
contents = file.Read("AdvNutscript/"..SCHEMA.uniqueID.."/"..map..uniqueID..".txt", "DATA")
file.Delete("AdvNutscript/"..SCHEMA.uniqueID.."/"..map..uniqueID..".txt", "DATA")
file.CreateDir("AdvNutscript/"..SCHEMA.uniqueID.."/"..map)
file.Write("AdvNutscript/"..SCHEMA.uniqueID.."/"..map.."/"..uniqueID..".txt", contents)
else
contents = file.Read("AdvNutscript/"..SCHEMA.uniqueID.."/"..map.."/"..uniqueID..".txt", "DATA")
end
end
else
contents = file.Read("AdvNutscript/data/"..uniqueID..".txt", "DATA")
if (!contents or contents == "") then
contents = file.Read("AdvNutscript/"..SCHEMA.uniqueID.."/"..uniqueID..".txt", "DATA")
end
end
if (contents) then
local decoded = pon.decode(contents)
if (decoded) then
nut.util.cachedTable[uniqueID] = decoded
end
return decoded
end
return {}
end
--[[
Purpose: Sends a notification with the message provided to the specified
players. The function uses varargs to specify multiple players. If no
players are specified, the notification will be broadcasted.
--]]
function nut.util.Notify(message, ...)
local receivers = {...}
if (#receivers == 0) then
MsgN(message)
receivers = nil
end
netstream.Start(receivers, "nut_Notice", message)
end
--[[
Purpose: Sends the schema's intro to the player.
--]]
function nut.util.SendIntroFade(client)
if (AdvNut.hook.Run("PlayerShouldSeeIntro", client) == false) then
return
end
netstream.Start(client, "nut_FadeIntro")
end
--[[
Purpose: Creates a dummy door which creates the effect that a door has just
been blown down. The door's 'ragdoll' will move in the direction if specified,
and the door will be restored after the time specified (default 3 minutes).
--]]
function nut.util.BlastDoor(door, direction, time, noCheck)
if (!door:IsDoor()) then
return
end
if (IsValid(door.dummy)) then
door.dummy:Remove()
end
if (!noCheck) then
for k, v in pairs(ents.FindInSphere(door:GetPos(), 128)) do
if (parent != v and v != door and string.find(v:GetClass(), "door")) then
nut.util.BlastDoor(v, direction, time, true)
end
end
end
direction = direction or Vector(0, 0, 0)
time = time or 180
local position = door:GetPos()
local angles = door:GetAngles()
local model = door:GetModel()
local skin = door:GetSkin()
local dummy = ents.Create("prop_physics")
dummy:SetPos(position)
dummy:SetAngles(angles)
dummy:SetModel(model)
dummy:SetSkin(skin or 0)
dummy:Spawn()
dummy:Activate()
timer.Simple(1.5, function()
if (IsValid(dummy)) then
dummy:SetCollisionGroup(COLLISION_GROUP_WEAPON)
end
end)
local physObj = dummy:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Wake()
physObj:SetVelocity(direction)
end
door.dummy = dummy
door:Fire("unlock", "", 0)
door:Fire("open", "", 0)
timer.Simple(0, function()
door:SetNoDraw(true)
door:SetNotSolid(true)
door:DrawShadow(false)
door.NoUse = true
door:DeleteOnRemove(dummy)
timer.Create("nut_DoorRestore"..door:EntIndex(), time, 1, function()
if (IsValid(door)) then
if (IsValid(dummy)) then
local uniqueID = "nut_DoorDummyFade"..dummy:EntIndex()
local alpha = 255
timer.Create(uniqueID, 0.1, 255, function()
if (IsValid(dummy)) then
alpha = alpha - 1
dummy:SetRenderMode(RENDERMODE_TRANSALPHA)
dummy:SetColor(Color(255, 255, 255, alpha))
if (alpha <= 0) then
if (IsValid(door) and door.dummy and door.dummy == dummy) then
door.dummy = nil
end
dummy:Remove()
end
else
timer.Remove(uniqueID)
end
end)
end
door:SetNotSolid(false)
door:SetNoDraw(false)
door:DrawShadow(true)
door.NoUse = false
end
end)
end)
end
else
netstream.Hook("nut_Notice", function(data)
nut.util.Notify(data)
end)
nut.notices = nut.notices or {}
--[[
Purpose: Creates a notification at the bottom of the screen using the
nut_Notification GUI control. The function also prints a message into
the console.
--]]
function nut.util.Notify(message)
if (AdvNut.hook.Run("NoticeShouldAppear", message) == false) then
return
end
local notice = vgui.Create("nut_Notification")
notice:SetText(message)
notice:SetAlpha(0)
notice:SetPos(ScrW() * 0.3, -24)
notice:SetWide(ScrW() * 0.4)
notice:MoveTo(ScrW() * 0.3, ScrH() - ((#nut.notices + 1) * 28), 0.35, 0, 0.25)
notice:AlphaTo(255, 0.2, 0)
notice:CallOnRemove(function()
for k, v in pairs(nut.notices) do
if (v == notice) then
table.remove(nut.notices, k)
end
end
for k, v in pairs(nut.notices) do
v:MoveTo(ScrW() * 0.3, ScrH() - (k * 28), 0.35, 0, 0.25)
end
AdvNut.hook.Run("NoticeRemoved", notice)
end)
table.insert(nut.notices, notice)
MsgC(Color(92, 232, 250), message.."\n")
AdvNut.hook.Run("NoticeCreated", notice)
end
--[[
Purpose: Automatically creates a structure for drawing text with a shadow. By default the
font is the target font, color is white, and the text alignment is centered on both axes.
--]]
function nut.util.DrawText(x, y, text, color, font, xalign, yalign)
color = color or Color(255, 255, 255)
draw.SimpleTextOutlined(tostring(text), font or "nut_TargetFont", x, y, color, xalign or 1, yalign or 1, 1, Color(0, 0, 0, color.a * 0.7))
end
--[[
Purpose: A function that returns lines in a form of tables. These lines are determined by
whether or not the arguments provided pass a certain width, kind of like in a text editor.
It can take colors or strings/numbers/booleans as the varargs.
*This function isn't great since spaces are needed!
--]]
function nut.util.WrapText(font, width, ...)
surface.SetFont(font or "DermaDefault")
local lines = {}
local currentText = ""
local currentX = 0
local line = {}
local lastColor = Color(255, 255, 255)
local x = 0
local _, textHeight = surface.GetTextSize("W")
for k, v in ipairs({...}) do
if (type(v) == "table" and v.r and v.g and v.b) then
line[#line + 1] = v
lastColor = v
currentText = ""
else
v = tostring(v)
for k2, v2 in ipairs(string.Explode(" ", v)) do
local textWidth = surface.GetTextSize(v2.." ")
x = x + textWidth
if (x > width) then
line[#line + 1] = currentText
lines[#lines + 1] = line
x = textWidth
currentText = v2.." "
line = {}
else
currentText = currentText..v2.." "
end
end
end
line[#line + 1] = currentText
end
line = {}
line[#line + 1] = currentText
lines[#lines + 1] = line
return lines, textHeight * #lines, textHeight
end
--[[
Purpose: Takes the output of nut.util.WrapText and draws them on the screen.
--]]
function nut.util.DrawWrappedText(x, y, lines, lineHeight, font, xAlign, yAlign, alpha)
if (lines) then
alpha = alpha or 255
local y2 = y
local lastColor = Color(255, 255, 255, alpha)
for k2, v2 in ipairs(lines) do
local lastX = 0
for k, v in pairs(v2) do
if (type(v) == "table" and v.r and v.g and v.b) then
lastColor = Color(v.r, v.g, v.b, alpha)
else
nut.util.DrawText(x + lastX, y + (k2 - 1) * lineHeight, v, lastColor, font, xAlign, yAlign)
y2 = y2 + lineHeight
lastX = lastX + surface.GetTextSize(v)
end
end
end
return y2
end
end
AdvNut.hook.Add("InitPostEntity", "nut_TimeInitialize", function()
nut.connectTime = RealTime()
end)
--[[
Purpose: Returns how long the local player has been connected to the server.
--]]
function nut.util.TimeConnected()
local realTime = RealTime()
-- Subtract five since we have the 5 second delay for loading.
return realTime - (nut.connectTime or realTime) - 5
end
--[[
Purpose: A method to get a material and ensure it is cached if used multiple times.
--]]
function nut.util.GetMaterial(materialPath)
if (!nut.util.cachedMaterials) then
nut.util.cachedMaterials = {}
end
if (!nut.util.cachedMaterials[materialPath]) then
nut.util.cachedMaterials[materialPath] = Material(materialPath)
end
return nut.util.cachedMaterials[materialPath]
end
end
--[[
Purpose: Gathers up all the differences between the 'delta' table
and a source table and returns them as a table of changes. This function
is also used for nut.util.IsSimilarTable to return a boolean of whether
there is any change or not.
--]]
function nut.util.GetTableDelta(a, b)
local output = {}
for k, v in pairs(a) do
if (type(v) == "table" and type(b[k]) == "table") then
local output2 = nut.util.GetTableDelta(v, b[k])
for k2, v2 in pairs(output2) do
output[k] = output[k] or {}
output[k][k2] = v2
end
elseif (b[k] == nil or b[k] != v) then
output[k] = v or "__nil"
end
end
for k, v in pairs(b) do
if (type(v) == "table" and type(a[k]) == "table") then
local output2 = nut.util.GetTableDelta(a[k], v)
for k2, v2 in pairs(output2) do
output[k] = output[k] or {}
output[k][k2] = v2
end
elseif (a[k] == nil) then
output[k] = "__nil"
end
end
return output
end
--[[
Purpose: Checks whether two tables have the same keys with the
same values by checking their delta. If there are any differences,
the function will return false.
--]]
function nut.util.IsSimilarTable(a, b)
return table.Count(nut.util.GetTableDelta(a, b)) == 0
end
--[[
Purpose: Manages the modification of the inventory. It will handle
the stacks and quantity for items. This is used when a player's or
storage's inventory is updated.
--]]
function nut.util.StackInv(inventory, class, quantity, data)
local stack, index
quantity = quantity or 1
if (data == nil || type(data) != "table") then
data = { };
end
inventory[class] = inventory[class] or {}
for k, v in pairs(inventory[class]) do
if (data and v.data and nut.util.IsSimilarTable(v.data, data)) then
stack = v
index = k
break
elseif (!data and !v.data) then
stack = v
index = k
break
end
end
-- Here we see if the item should be added or removed.
if (!stack and quantity > 0) then
table.insert(inventory[class], {quantity = quantity, data = data})
else
stack = stack or {}
index = index or table.GetFirstKey(inventory[class])
-- A stack already exists, so add or take from it.
stack.quantity = (stack.quantity or 0) + quantity
-- If the quantity is negative, meaning we take from the stack, remove
-- the stack from the inventory.
if (stack.quantity <= 0 and inventory[class][index]) then
inventory[class][index] = nil
end
-- If there is nothing completely in the class, remove it from the inventory
-- completely to reduce data that is saved.
if (table.Count(inventory[class]) <= 0) then
inventory[class] = nil
end
end
return inventory
end
--[[
Purpose: Finds the closest player to a given position by looping through
each player and determining if their distance is lower than the
last. This function will return the closest player and the distance for
that player.
--]]
function nut.util.FindClosestPlayer(position)
local distance = 32768 -- maximum map size.
local client
for k, v in pairs(player.GetAll()) do
local theirDistance = v:GetPos():Distance(position)
if (theirDistance < distance) then
distance = theirDistance
client = v
end
end
return client, distance
end
if (SERVER) then
AdvNut.hook.Add("InitPostEntity", "nut_StartTime", function()
nut.initTime = RealTime()
end)
end
--[[
Purpose: Returns the time stamp for the IC time. The client may deviate
by a small amount. This is used for keeping track of time in-game.
--]]
function nut.util.GetTime()
local curTime = nut.curTime or 0
local length = nut.config.dateMinuteLength
local multiplier = 60 / length
if (SERVER) then
local realTime = RealTime() - (nut.initTime or 0)
return (curTime + realTime) * multiplier
else
return (curTime + nut.util.TimeConnected()) * multiplier
end
return 0
end
local date = os.date
local time = os.time
--[[
Purpose: Returns the current UTC time stamp.
--]]
function nut.util.GetUTCTime()
return time(date("!*t"))
end
if (SERVER) then
local playerMeta = FindMetaTable("Player")
function playerMeta:StringRequest(title, text, onConfirm, onCancel, default)
self:SetNutVar("reqConfirm", onConfirm)
self:SetNutVar("reqCancel", onCancel)
title = title or "String Request"
text = text or "No message"
if (!onConfirm) then
error("Attempt to create string request without confirm callback.")
end
netstream.Start(self, "nut_StringRequest", {title, text, default})
end
function playerMeta:ScreenFadeIn(time, color)
time = time or 5
color = color or Color(25, 25, 25)
netstream.Start(self, "nut_FadeIn", {color, time})
end
function playerMeta:ScreenFadeOut(time, color)
netstream.Start(self, "nut_FadeOut", {time or 5, color})
end
netstream.Hook("nut_StringRequest", function(client, data)
local responseCode = data[1]
local text = data[2]
if (responseCode and text) then
if (responseCode == 0) then
local onConfirm = client:GetNutVar("reqConfirm")
if (onConfirm) then
onConfirm(text)
end
client:SetNutVar("reqConfirm", nil)
client:SetNutVar("reqCancel", nil)
elseif (responseCode == 1) then
local onCancel = client:GetNutVar("reqCancel")
if (onCancel) then
onCancel(text)
end
client:SetNutVar("reqConfirm", nil)
client:SetNutVar("reqCancel", nil)
end
end
end)
else
netstream.Hook("nut_StringRequest", function(data)
local function confirm(text)
netstream.Start("nut_StringRequest", {0, text})
end
local function cancel(text)
netstream.Start("nut_StringRequest", {1, text})
end
Derma_StringRequest(data[1], data[2], data[3], confirm, cancel)
end)
netstream.Hook("nut_FadeIn", function(data)
local color = data[1]
local r, g, b, a = color.r, color.g, color.b, color.a or 255
local time = data[2]
local start = CurTime()
local finish = start + time
nut.fadeColor = color
AdvNut.hook.Add("HUDPaint", "nut_FadeIn", function()
local fraction = math.TimeFraction(start, finish, CurTime())
surface.SetDrawColor(r, g, b, fraction * a)
surface.DrawRect(0, 0, ScrW(), ScrH())
end)
end)
netstream.Hook("nut_FadeOut", function(data)
local color = data[2] or nut.fadeColor
if (color) then
local r, g, b, a = color.r, color.g, color.b, color.a or 255
local time = data[1]
local start = CurTime()
local finish = start + time
AdvNut.hook.Add("HUDPaint", "nut_FadeIn", function()
local fraction = 1 - math.TimeFraction(start, finish, CurTime())
if (fraction < 0) then
return hook.Remove("HUDPaint", "nut_FadeIn")
end
surface.SetDrawColor(r, g, b, fraction * a)
surface.DrawRect(0, 0, ScrW(), ScrH())
end)
end
end)
end
--[[
Purpose: Splits a string into a table every n characters.
--]]
function nut.util.SplitString(text, size)
local output = {}
while (#text > size) do
output[#output + 1] = string.sub(text, 1, size)
text = string.sub(text, size)
end
output[#output + 1] = text
return output
end
if (SERVER) then
--[[
Purpose: Emits a sound on for receivers with control over the volume and pitch.
--]]
function nut.util.PlaySound(source, receiver, volume, pitch)
netstream.Start(receiver, "nut_PlaySound", {source, volume, pitch})
end
else
netstream.Hook("nut_PlaySound", function(data)
LocalPlayer():EmitSound(data[1], data[2], data[3])
end)
end
// Override
function Derma_StringRequest( strTitle, strText, strDefaultText, fnEnter, fnCancel, strButtonText, strButtonCancelText )
local Window = vgui.Create( "DFrame" )
Window:SetTitle( strTitle or "Message Title (First Parameter)" )
Window:SetDraggable( false )
Window:ShowCloseButton( false )
Window:SetBackgroundBlur( true )
Window:SetDrawOnTop( true )
local InnerPanel = vgui.Create( "DPanel", Window )
InnerPanel:SetPaintBackground( false )
local Text = vgui.Create( "DLabel", InnerPanel )
Text:SetText( strText or "Message Text (Second Parameter)" )
Text:SizeToContents()
Text:Dock(TOP);
Text:DockMargin(0, 8, 0, 0);
Text:SetContentAlignment( 5 )
Text:SetTextColor( color_black )
local TextEntry = vgui.Create( "DTextEntry", InnerPanel )
TextEntry:SetText( strDefaultText or "" )
TextEntry.OnEnter = function() Window:Close() fnEnter( TextEntry:GetValue() ) end
local ButtonPanel = vgui.Create( "DPanel", Window )
ButtonPanel:SetTall( 30 )
ButtonPanel:SetPaintBackground( false )
local Button = vgui.Create( "DButton", ButtonPanel )
Button:SetText( strButtonText or nut.lang.Get("string_request_ok"));
Button:SizeToContents()
Button:SetTall( 20 )
Button:SetWide( Button:GetWide() + 20 )
Button:SetPos( 5, 5 )
Button.DoClick = function()
Window:Close();
fnEnter(TextEntry:GetValue());
end
local ButtonCancel = vgui.Create( "DButton", ButtonPanel )
ButtonCancel:SetText( strButtonCancelText or nut.lang.Get("string_request_cancel"));
ButtonCancel:SizeToContents()
ButtonCancel:SetTall( 20 )
ButtonCancel:SetWide( Button:GetWide() )
ButtonCancel:SetPos( 5, 5 )
ButtonCancel.DoClick = function()
Window:Close()
if ( fnCancel ) then
fnCancel(TextEntry:GetValue())
end
end
ButtonCancel:MoveRightOf( Button, 5 )
ButtonPanel:SetWide(Button:GetWide() + 5 + ButtonCancel:GetWide() + 5);
local w, h = Text:GetSize()
w = math.max( w, 400 )
Window:SetSize( w + 50, h + 25 + 75 + 10 )
Window:Center()
InnerPanel:StretchToParent( 5, 25, 5, 45 )
Text:StretchToParent( 5, 5, 5, 35 )
TextEntry:StretchToParent( 5, nil, 5, nil )
TextEntry:AlignBottom( 5 )
TextEntry:RequestFocus()
TextEntry:SelectAllText( true )
ButtonPanel:CenterHorizontal()
ButtonPanel:AlignBottom( 8 )
Window:MakePopup()
Window:DoModal()
return Window
end
if (SERVER) then
game.NutCleanUpMap = game.NutCleanUpMap or game.CleanUpMap
-- Overwrite it so we can store the old creation ID which changes on clean up.
function game.CleanUpMap(...)
for k, v in pairs(ents.GetAll()) do
local index = v:MapCreationID()
if (index > 0 and !v.nutCreationID) then
v.nutCreationID = index
end
end
game.NutCleanUpMap(...)
end
--[[
Purpose: Returns the original map creation ID of an entity, which will always
stay the same regardless of map clean ups.
--]]
function nut.util.GetCreationID(entity)
return entity.nutCreationID or entity:MapCreationID()
end
end
|
#!/usr/bin/env lua
--------------------------------------------------------------------------------
-- @script IDL Descriptor Pre-Loader
-- @version 1.0
-- @author Renato Maia <maia@tecgraf.puc-rio.br>
local _G = require "_G"
local arg = _G.arg
local assert = _G.assert
local ipairs = _G.ipairs
local pairs = _G.pairs
local select = _G.select
local array = require "table"
local concat = array.concat
local io = require "io"
local stderr = io.stderr
local open = io.open
local os = require "os"
local exit = os.exit
local string = require "string"
local luaidl = require "luaidl"
local parsefile = luaidl.parsefile
local Arguments = require "loop.compiler.Arguments"
local Serializer = require "loop.serial.Serializer"
local idl = require "oil.corba.idl"
local Compiler = require "oil.corba.idl.Compiler"
local _ENV = Arguments{
output = "idl.lua",
include = {},
}
if _G._VERSION=="Lua 5.1" then _G.setfenv(1,_ENV) end -- Lua 5.1 compatibility
local alias = { I = "include" }
for name in pairs(_ENV) do
alias[name:sub(1, 1)] = name
end
_alias = alias
local start, errmsg = _ENV(...)
local finish = select("#", ...)
if not start or start > finish then
if errmsg then stderr:write("ERROR: ", errmsg, "\n") end
stderr:write([[
IDL Descriptor Pre-Parser 1.1 Copyright (C) 2006-2008 Tecgraf, PUC-Rio
Usage: ]]..arg[0]..[[.lua [options] <idlfiles>
Options:
-o, -output Output file that should be generated. Its default is
']],output,[['.
-I, i, -include Adds a directory to the list of paths where the IDL files
are searched.
]])
exit(1)
end
--------------------------------------------------------------------------------
local function addVarargTo(list, ...)
local count = #list
local length = select("#", ...)
for i = 1, length do
list[count+i] = select(i, ...)
end
end
local file = assert(open(output, "w"))
local stream = Serializer()
function stream:write(...)
return file:write(...)
end
stream[_G.rawset] = "rawget"
stream[_G.rawget] = "rawset"
stream[idl] = "idl"
stream[idl.void] = "idl.void"
stream[idl.short] = "idl.short"
stream[idl.long] = "idl.long"
stream[idl.longlong] = "idl.longlong"
stream[idl.ushort] = "idl.ushort"
stream[idl.ulong] = "idl.ulong"
stream[idl.ulonglong] = "idl.ulonglong"
stream[idl.float] = "idl.float"
stream[idl.double] = "idl.double"
stream[idl.longdouble] = "idl.longdouble"
stream[idl.boolean] = "idl.boolean"
stream[idl.char] = "idl.char"
stream[idl.octet] = "idl.octet"
stream[idl.any] = "idl.any"
stream[idl.TypeCode] = "idl.TypeCode"
stream[idl.string] = "idl.string"
stream[idl.object] = "idl.object"
stream[idl.basesof] = "idl.basesof"
stream[idl.Contents] = "idl.Contents"
stream[idl.ContainerKey] = "idl.ContainerKey"
local compiler = Compiler()
local options = compiler.defaults
options.incpath = include
local values = {n=0}
for i = start, finish do
addVarargTo(values, assert(parsefile(select(i, ...), options)))
end
file:write([[
local _G = require "_G"
local _ENV = {
idl = require "oil.corba.idl",
setmetatable = _G.setmetatable,
}
if _G._VERSION=="Lua 5.1" then _G.setfenv(1,_ENV) end -- Lua 5.1 compatibility
local load = _G.load
local rawset = _G.rawset
local rawget = _G.rawget
local require = _G.require
local setmetatable = _G.setmetatable
local setupvalue = _G.debug and _G.debug.setupvalue
local upvaluejoin = _G.debug and _G.debug.upvaluejoin
]])
for i, value in ipairs(values) do
values[i] = stream:serialize(value)
end
file:write([[
return { ]],concat(values, ", "),[[ }
]])
file:close()
|
object_building_mustafar_dungeon_monster_lair_must_monster_lair = object_building_mustafar_dungeon_monster_lair_shared_must_monster_lair:new {
customObjectName = "Sher Kar Lair",
}
ObjectTemplates:addTemplate(object_building_mustafar_dungeon_monster_lair_must_monster_lair, "object/building/mustafar/dungeon/monster_lair/must_monster_lair.iff")
|
local helpers = require("cphelper.helpers")
local fn = vim.fn
local extend = vim.list_extend
local insert = table.insert
local M = {}
-- Run a test case
--- @param case number #Case no.
--- @param cmd string #Command for running the test
--- @return table, number #The result to display and whether or not the test passed
function M.run_test(case, cmd)
local timeout = vim.g.cphtimeout or 2000
local success = 0 -- status is 1 on correct answer, 0 otherwise
local display = { "Case #" .. case }
local input_arr = fn.readfile("input" .. case)
local exp_out_arr = fn.readfile("output" .. case)
insert(display, "Input:")
extend(display, input_arr)
insert(display, "Expected output:")
extend(display, exp_out_arr)
local output_arr = {}
local err_arr = {}
local function on_stdout(_, data, _)
extend(output_arr, data)
output_arr[#output_arr] = nil -- EOF is an empty string
end
local function on_stderr(_, data, _)
extend(err_arr, data)
err_arr[#err_arr] = nil
end
local function on_exit(_, exit_code, _)
-- Strip CR on Windows
if fn.has("win32") then
for k, v in pairs(output_arr) do
output_arr[k] = string.gsub(v, "\r", "")
end
end
if #output_arr ~= 0 then
insert(display, "Received output:")
extend(display, output_arr)
end
if #err_arr ~= 0 then
insert(display, "Error:")
extend(display, err_arr)
insert(display, "Exit code " .. exit_code)
end
if exit_code == 0 then
local matches = helpers.compare_str_list(output_arr, exp_out_arr)
if matches == "yes" then
insert(display, "Status: AC")
success = 1
else
insert(display, "Status: WA")
end
if matches == "trailing" then
insert(display, "NOTE: Answer differs by trailing whitespace")
end
else
insert(display, "Status: RTE")
insert(display, "Exit code " .. exit_code)
end
end
-- Run executable
local job_id = fn.jobstart(cmd, {
on_stdout = on_stdout,
on_stderr = on_stderr,
on_exit = on_exit,
data_buffered = true,
})
-- Send input
fn.chansend(job_id, extend(fn.readfile("input" .. case), { "" }))
-- Wait till `timeout`
local len = fn.jobwait({ job_id }, timeout)
if len[1] == -1 then
insert(display, string.format("Status: Timed out after %d ms", timeout))
fn.jobstop(job_id)
end
return display, success
end
return M
|
local Text = { }
Text.x = 0
Text.y = 0
Text.width = 100
Text.height = lui.theme.font.default:getHeight()
Text.focusable = false
Text.text = "<text>"
Text.align = 'left'
Text.font = lui.theme.font.default
Text.textColor = lui.theme.color.text
Text.backgroundColor = nil
Text.autoSize = true
local utf8 = require 'utf8'
------------------------------------------------------------------------------------------------------------------------
local function invalidateSize( self )
if self.autoSize then
self.width = self.font:getWidth(self.text)
self.height = self.font:getHeight(self.text)
end
end
------------------------------------------------------------------------------------------------------------------------
function Text:init( )
invalidateSize(self)
end
------------------------------------------------------------------------------------------------------------------------
function Text:destroyed( )
end
------------------------------------------------------------------------------------------------------------------------
function Text:update( dt )
end
------------------------------------------------------------------------------------------------------------------------
function Text:draw( )
invalidateSize(self)
if self.text and self.textColor and utf8.len(self.text) > 0 then
love.graphics.setColor(self.textColor)
love.graphics.printf(self.text, self.font, 0, 0, self.width, self.align)
end
end
------------------------------------------------------------------------------------------------------------------------
function Text:getLength( )
return string.len(self.text)
end
------------------------------------------------------------------------------------------------------------------------
function Text:getLengthUtf8( )
return utf8.len(self.text)
end
------------------------------------------------------------------------------------------------------------------------
function Text:sub( i, j )
i = utf8.offset(self.text, i) or 0
if j ~= nil then
j = (utf8.offset(self.text, j + 1) or 0) - 1
end
return string.sub(self.text, i, j)
end
lui.register('Text', Text)
|
require("vue/__tests__/e2eUtils")
local globalStats = nil
-- [ts2lua]请手动处理DeclareFunction
describe('e2e: svg', function()
local = setupPuppeteer()
function assertPolygon(total)
expect():toBe(true)
end
function assertLabels(total)
local positions = nil
local i = 0
repeat
local textPosition = nil
expect(textPosition):toEqual(positions[i+1])
i=i+1
until not(i < total)
end
function assertStats(expected)
local statsValue = nil
expect(statsValue):toEqual(expected)
end
function nthRange(n)
return
end
function testSvg(apiType)
local baseUrl = nil
expect():toBe(1)
expect():toBe(1)
expect():toBe(1)
expect():toBe(6)
expect():toBe(6)
expect():toBe(7)
expect():toBe(6)
expect():toBe(5)
expect():toBe(5)
expect():toBe(6)
expect():toBe(5)
expect():toBe(6)
expect():toBe(6)
expect():toBe(7)
expect():toBe(6)
end
test('classic', function()
end
, E2E_TIMEOUT)
test('composition', function()
end
, E2E_TIMEOUT)
end
)
|
--[[
Program name: Lolmer's AE2+OpenComputers Enchanted Books Combiner Script
Version: 0.0.1
Programmer: Lolmer
Last update: 2015-03-24
Pastebin: http://pastebin.com/TBD
GitHub: https://github.com/sandalle/opencomputers-programs/ae2/combine-enchanted-books/
Description:
This script will scan through the connected Applied Energistics ME storage for duplicate low-tier Enchanted Books and then send them as output in pairs through a connected Anvil or MFR Auto-Anvil (or really whatever device you tell it to send the books through) to combine them.
Resources:
This script is available from:
http://pastebin.com/TBD
https://github.com/sandalle/opencomputers-programs/ae2/combine-enchanted-books/
Start-up script is available from:
http://pastebin.com/TBD
https://github.com/sandalle/opencomputers-programs/ae2/combine-enchanted-books/
Official documentation of OpenComputers
http://ocdoc.cil.li/
ChangeLog:
- 0.1
- Initial release
]]--
-- Some global variables
local progVer = "0.0.1"
local progName = "Enchanted Books Combiner"
local debugMode = false
|
local l = require('lexer')
local token, word_match = l.token, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'tlaplus'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
-- Translation
local translation = token(l.PREPROCESSOR, '\\*' * l.space^0 * (P('BEGIN') + P('END')) * l.space^1 * 'TRANSLATION' * l.nonnewline_esc^0)
-- Comments.
local line_comment_a = '\\*' * l.nonnewline_esc^0
local line_comment_b = '----' * l.nonnewline_esc^0
local line_comment_c = '====' * l.nonnewline_esc^0
local nested_comment = l.nested_pair('(*', '*)')
local comment = token(l.COMMENT, line_comment_a + line_comment_b + line_comment_c
+ nested_comment)
local dq_str = l.delimited_range('"')
local string = token(l.STRING, dq_str)
local number = token(l.NUMBER, l.dec_num)
local keyword = token(l.KEYWORD, word_match{
'ASSUME', 'ASSUMPTION', 'AXIOM', 'CASE', 'CHOOSE', 'CONSTANT', 'CONSTANTS',
'DOMAIN', 'ELSE', 'ENABLED', 'EXCEPT', 'EXTENDS', 'IF', 'IN', 'INSTANCE',
'LET', 'LOCAL', 'MODULE', 'OTHER', 'UNION', 'SUBSET', 'THEN', 'THEOREM',
'UNCHANGED', 'VARIABLE', 'VARIABLES', 'WITH',
})
-- Identifiers.
local identifier = token(l.IDENTIFIER, l.word)
local latex_operators = token(l.FUNCTION, '\\' * word_match{
'land', 'lnot', 'neg', 'in', 'leq', 'll', 'prec', 'preceq',
'subset', 'subseteq', 'sqsubset', 'sqsubseteq', 'cap', 'intersect',
'sqcap', 'oplus', 'ominus', 'odot', 'otimes', 'slash', 'E',
'EE', 'lor', 'equiv', 'notin', 'geq', 'gg', 'succ', 'succeq', 'supseteq',
'supset', 'sqsupset', 'sqsupseteq', 'cup', 'union', 'sqcup', 'uplus', 'X',
'times', 'wr', 'propto', 'A', 'AA', 'div', 'cdot', 'o', 'circ', 'bullet',
'star', 'bigcirc', 'sim', 'simeq', 'asymp', 'approx', 'cong', 'doteq'
})
local plain_operators = token(l.OPERATOR, S('@!%*+-^`_/\\|:=<>[]{}().;'))
local definition = token(l.TYPE, l.word) * #(l.space^0 * ('(' * (l.any - ')')^0 * P(')'))^-1 * l.space^0 * '==')
local constants = token(l.CONSTANT, word_match{'TRUE', 'FALSE', 'defaultInitValue'})
M._rules = {
{'whitespace', ws},
{'string', string},
{'keyword', keyword},
{'type', definition},
{'constant', constants},
{'preprocessor', translation},
{'identifier', identifier},
{'comment', comment},
{'number', number},
{'function', latex_operators},
{'operator', plain_operators}
}
local pluscal = l.load('pluscal')
local pluscal_start = P('(*') * l.space^0 * P('--')
local pluscal_end = P('}') * l.space^0 * P('*)')
l.embed_lexer(M, pluscal, pluscal_start, pluscal_end)
return M
|
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:4343e35bd992daa42b9c5411cc7c9c4d:5a8d8142cde4887da4445cd7c47a6d2a:cf8ab4992190eb44f97f06311ef326d7$
--
-- local sheetInfo = require("mysheet")
-- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetInfo:getSheet() )
-- local sprite = display.newSprite( myImageSheet , {frames={sheetInfo:getFrameIndex("sprite")}} )
--
local SheetInfo = {}
SheetInfo.sheet =
{
frames = {
{
-- 1
x=701,
y=1,
width=160,
height=142,
sourceX = 226,
sourceY = 67,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 2
x=481,
y=247,
width=172,
height=182,
sourceX = 236,
sourceY = 427,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 3
x=255,
y=1,
width=222,
height=268,
sourceX = 210,
sourceY = 177,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 4
x=651,
y=203,
width=72,
height=24,
sourceX = 258,
sourceY = 603,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 5
x=651,
y=179,
width=94,
height=22,
sourceX = 333,
sourceY = 593,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 6
x=651,
y=147,
width=142,
height=30,
sourceX = 582,
sourceY = 618,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 7
x=1,
y=1,
width=252,
height=246,
sourceX = 480,
sourceY = 191,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 8
x=159,
y=249,
width=82,
height=66,
sourceX = 412,
sourceY = 292,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 9
x=159,
y=317,
width=54,
height=42,
sourceX = 580,
sourceY = 421,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 10
x=1,
y=249,
width=156,
height=202,
sourceX = 577,
sourceY = 431,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 11
x=479,
y=147,
width=170,
height=98,
sourceX = 542,
sourceY = 419,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 12
x=479,
y=1,
width=220,
height=144,
sourceX = 178,
sourceY = 23,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 13
x=159,
y=361,
width=18,
height=32,
sourceX = 405,
sourceY = 412,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 14
x=243,
y=271,
width=236,
height=166,
sourceX = 551,
sourceY = 29,
sourceWidth = 960,
sourceHeight = 672
},
{
-- 15
x=655,
y=229,
width=112,
height=94,
sourceX = 570,
sourceY = 106,
sourceWidth = 960,
sourceHeight = 672
},
},
sheetContentWidth = 960,
sheetContentHeight = 672
}
SheetInfo.frameIndex =
{
["1"] = 1,
["2"] = 2,
["3"] = 3,
["4"] = 4,
["5"] = 5,
["6"] = 6,
["7"] = 7,
["8"] = 8,
["9"] = 9,
["10"] = 10,
["11"] = 11,
["12"] = 12,
["13"] = 13,
["14"] = 14,
["15"] = 15,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo
|
--!The Make-like Build Utility based on Lua
--
-- 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.
--
-- Copyright (C) 2015 - 2017, TBOOX Open Source Group.
--
-- @author ruki
-- @file gcc.lua
--
-- imports
import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
import("detect.tool.find_ccache")
-- init it
function init(shellname, kind)
-- save the shell name
_g.shellname = shellname or "gcc"
-- save the kind
_g.kind = kind
-- init mxflags
_g.mxflags = { "-fmessage-length=0"
, "-pipe"
, "-fpascal-strings"
, "\"-DIBOutlet=__attribute__((iboutlet))\""
, "\"-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))\""
, "\"-DIBAction=void)__attribute__((ibaction)\""}
-- init shflags
_g.shflags = { "-shared", "-fPIC" }
-- init cxflags for the kind: shared
_g.shared = {}
_g.shared.cxflags = {"-fPIC"}
-- init flags map
_g.mapflags =
{
-- warnings
["-W1"] = "-Wall"
, ["-W2"] = "-Wall"
, ["-W3"] = "-Wall"
-- strip
, ["-s"] = "-s"
, ["-S"] = "-S"
}
-- init features
_g.features =
{
["object:sources"] = false
}
end
-- get the property
function get(name)
-- get it
return _g[name]
end
-- make the strip flag
function nf_strip(level)
-- the maps
local maps =
{
debug = "-S"
, all = "-s"
}
-- make it
return maps[level] or ""
end
-- make the symbol flag
function nf_symbol(level)
-- the maps
local maps =
{
debug = "-g"
, hidden = "-fvisibility=hidden"
}
-- make it
return maps[level] or ""
end
-- make the warning flag
function nf_warning(level)
-- the maps
local maps =
{
none = "-w"
, less = "-W1"
, more = "-W3"
, all = "-Wall"
, error = "-Werror"
}
-- make it
return maps[level] or ""
end
-- make the optimize flag
function nf_optimize(level)
-- the maps
local maps =
{
none = "-O0"
, fast = "-O1"
, faster = "-O2"
, fastest = "-O3"
, smallest = "-Os"
, aggressive = "-Ofast"
}
-- make it
return maps[level] or ""
end
-- make the vector extension flag
function nf_vectorext(extension)
-- the maps
local maps =
{
mmx = "-mmmx"
, sse = "-msse"
, sse2 = "-msse2"
, sse3 = "-msse3"
, ssse3 = "-mssse3"
, avx = "-mavx"
, avx2 = "-mavx2"
, neon = "-mfpu=neon"
}
-- make it
return maps[extension] or ""
end
-- make the language flag
function nf_language(stdname)
-- the stdc maps
local cmaps =
{
-- stdc
ansi = "-ansi"
, c89 = "-std=c89"
, gnu89 = "-std=gnu89"
, c99 = "-std=c99"
, gnu99 = "-std=gnu99"
, c11 = "-std=c11"
, gnu11 = "-std=gnu11"
}
-- the stdc++ maps
local cxxmaps =
{
cxx98 = "-std=c++98"
, gnuxx98 = "-std=gnu++98"
, cxx11 = "-std=c++11"
, gnuxx11 = "-std=gnu++11"
, cxx14 = "-std=c++14"
, gnuxx14 = "-std=gnu++14"
, cxx1z = "-std=c++1z"
, gnuxx1z = "-std=gnu++1z"
, cxx17 = "-std=c++17"
, gnuxx17 = "-std=gnu++17"
}
-- select maps
local maps = cmaps
if _g.kind == "cxx" or _g.kind == "mxx" then
maps = cxxmaps
elseif _g.kind == "sc" then
maps = {}
end
-- make it
return maps[stdname] or ""
end
-- make the define flag
function nf_define(macro)
-- make it
return "-D" .. macro:gsub("\"", "\\\"")
end
-- make the undefine flag
function nf_undefine(macro)
-- make it
return "-U" .. macro
end
-- make the includedir flag
function nf_includedir(dir)
-- make it
return "-I" .. dir
end
-- make the link flag
function nf_link(lib)
-- make it
return "-l" .. lib
end
-- make the linkdir flag
function nf_linkdir(dir)
-- make it
return "-L" .. dir
end
-- make the rpathdir flag
function nf_rpathdir(dir)
-- check this flag
local flag = "-Wl,-rpath=" .. dir
if _g._RPATH == nil then
_g._RPATH = try
{
function ()
check(flag, true)
return true
end
}
end
-- ok?
if _g._RPATH then
return flag
end
end
-- make the framework flag
function nf_framework(framework)
-- make it
return "-framework " .. framework
end
-- make the link command
function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
return format("%s -o %s %s %s", _g.shellname, targetfile, objectfiles, flags)
end
-- link the target file
function link(objectfiles, targetkind, targetfile, flags)
-- ensure the target directory
os.mkdir(path.directory(targetfile))
-- link it
os.run(linkcmd(objectfiles, targetkind, targetfile, flags))
end
-- make the complie command
function _compcmd1(sourcefile, objectfile, flags)
-- get ccache
local ccache = nil
if config.get("ccache") then
ccache = find_ccache()
end
-- make it
local command = format("%s -c %s -o %s %s", _g.shellname, flags, objectfile, sourcefile)
if ccache then
command = ccache:append(command, " ")
end
-- ok
return command
end
-- complie the source file
function _compile1(sourcefile, objectfile, incdepfile, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
-- compile it
try
{
function ()
local outdata, errdata = os.iorun(_compcmd1(sourcefile, objectfile, flags))
return (outdata or "") .. (errdata or "")
end,
catch
{
function (errors)
-- compiling errors
os.raise(errors)
end
},
finally
{
function (ok, warnings)
-- print some warnings
if warnings and #warnings > 0 and option.get("verbose") then
cprint("${yellow}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n'))
end
end
}
}
-- generate includes file
if incdepfile and _g.kind ~= "as" then
-- the temporary file
local tmpfile = os.tmpfile()
-- generate it
os.run("%s -c -MM %s -o %s %s", _g.shellname, flags or "", tmpfile, sourcefile)
-- translate it
local results = {}
local incdeps = io.readfile(tmpfile)
for includefile in string.gmatch(incdeps, "%s+([%w/%.%-%+_%$%.]+)") do
-- save it if belong to the project
if not path.is_absolute(includefile) then
table.insert(results, includefile)
end
end
-- update it
io.save(incdepfile, results)
-- remove the temporary file
os.rm(tmpfile)
end
end
-- make the complie command
function compcmd(sourcefiles, objectfile, flags)
-- only support single source file now
assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-- for only single source file
return _compcmd1(sourcefiles, objectfile, flags)
end
-- complie the source file
function compile(sourcefiles, objectfile, incdepfile, flags)
-- only support single source file now
assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-- for only single source file
_compile1(sourcefiles, objectfile, incdepfile, flags)
end
-- check the given flags
function check(flags, trylink)
-- make an stub source file
local binaryfile = os.tmpfile() .. ".b"
local objectfile = os.tmpfile() .. ".o"
local sourcefile = os.tmpfile() .. ".c" .. ifelse(_g.kind == "cxx", "pp", "")
-- make stub code
io.writefile(sourcefile, "int main(int argc, char** argv)\n{return 0;}")
-- check it, need check compflags and linkflags
if trylink then
os.run("%s %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, sourcefile)
else
os.run("%s -c %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), binaryfile, sourcefile)
end
-- remove files
os.tryrm(binaryfile)
os.tryrm(objectfile)
os.tryrm(sourcefile)
end
|
local cfg = {}
-- define static transformers
-- see https://github.com/ImagicTheCat/vRP modules documentation to understand the transformer concept/definition
cfg.transformers = {
{
-- example transformers
title="Body training", -- menu name
color={255,125,0}, -- color
max_units=1000,
units_per_minute=1000,
position={-1202.96252441406,-1566.14086914063,4.61040639877319},
radius=7.5, height=1.5, -- area
recipes = {
["Strength"] = { -- action name
description="Increase your strength.", -- action description
reagents={},
products={
aptitudes={
["physical.strength"] = 1 -- "group.aptitude", give 1 exp per unit
}
},
}
}
},
{
title="Peaches",
color={255,125,24},
max_units=10,
units_per_minute=1,
position={-2141.46630859375,-79.5226974487305,53.7380447387695},
radius=15, height=4,
recipes = {
["Harvest"] = {
description="Harvest peaches.",
reagents={},
products={
items = {
["edible|peach"] = 3
}
}
}
}
},
{
title="Peaches",
color={255,125,24},
max_units=10,
units_per_minute=1,
position={-2185.3857421875,-43.3630828857422,74.495719909668},
radius=15, height=4,
recipes = {
["Harvest"] = {
description="Harvest peaches.",
reagents = {},
products={
items = {
["edible|peach"] = 3
}
}
}
}
},
{
title="Peaches",
color={255,125,24},
max_units=10,
units_per_minute=1,
position={-2217.4716796875,33.9435615539551,111.254753112793},
radius=15, height=4,
recipes = {
["Harvest"] = {
description="Harvest peaches.",
reagents={},
products={
items = {
["edible|peach"] = 3
}
}
}
}
},
{
title="Peaches resale",
color={255,125,24},
max_units=1000,
units_per_minute=1000,
position={-1484.080078125,-397.131927490234,38.3666610717773},
radius=5, height=2.5,
recipes = {
["Sell"] = {
description="Sell peaches. 25$ per 5.",
reagents={
items = {
["edible|peach"] = 5
}
},
products={
money = 25
}
}
}
},
{
title="Gold deposit",
color={255,255,0},
max_units=1000,
units_per_minute=5,
position={123.05940246582,3336.2939453125,30.7280216217041},
radius=30, height=8,
recipes = {
["Search"] = {
description="Search for gold.",
reagents={},
products={
items = {
["gold_ore"] = 1
}
}
}
}
},
{
title="Gold processing",
color={255,255,0},
max_units=1000,
units_per_minute=1000,
position={-75.9527359008789,6495.42919921875,31.4908847808838},
radius=24, height=2,
recipes = {
["Process ore"] = {
description="Process gold ore.",
reagents={
items = {
["gold_ore"] = 1
}
},
products={
items = {
["gold_processed"] = 1
}
}
}
}
},
{
title="Gold refinement",
color={255,255,0},
max_units=1000,
units_per_minute=1000,
position={1032.71105957031,2516.86010742188,46.6488876342773},
radius=24,height=4,
recipes = {
["Refine"] = {
description="Transform 10 processed gold into a gold ingot using a gold catalyst.",
reagents={
items = {
["gold_processed"] = 10,
["gold_catalyst"] = 1
}
},
products={
items = {
["gold_ingot"] = 1
}
},
}
}
},
{
title="Gold resale",
color={255,255,0},
max_units=1000,
units_per_minute=1000,
position={-139.963653564453,-823.515258789063,31.4466247558594},
radius=8,height=1.5,
recipes = {
["Sell gold"] = {
description="Sell gold ingots, 1000$ per ingot.",
reagents={
items = {
["gold_ingot"] = 1
}
},
products={
money = 2000
}
}
}
}
}
return cfg
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.