content
stringlengths 5
1.05M
|
|---|
module('http', package.seeall)
http.request = {
method = os.getenv('REQUEST_METHOD'),
query = os.getenv('QUERY_STRING'),
uri = os.getenv('REQUEST_URI'),
headers = {
contentLength = tonumber(os.getenv('CONTENT_LENGTH')),
contentType = os.getenv('CONTENT_TYPE'),
host = os.getenv('HTTP_HOST'),
userAgent = os.getenv('HTTP_USER_AGENT'),
accept = os.getenv('HTTP_ACCEPT'),
},
remoteAddr = os.getenv('REMOTE_ADDR'),
remotePort = os.getenv('REMOTE_PORT'),
}
if http.request.headers.contentLength ~= nil then
http.request.body = io.read(http.request.headers.contentLength)
end
http.response = {}
function http.response.status(code, reason)
reason = reason or ''
io.write('Status: ' .. code .. ' ' .. reason .. '\n')
end
function http.response.header(key, value)
io.write(key .. ': ' .. value .. '\n')
end
function http.response.send(str)
io.write('\n')
return io.write(str)
end
|
local Packages = script:FindFirstAncestor("CmdrAdditions").Packages
local UI = script:FindFirstAncestor("UI")
local Roact = require(Packages.Roact)
local CmdrContext = require(UI.CmdrContext)
local EventController = require(script.EventController)
local EventTypes = require(script.EventTypes)
local EventManager = Roact.Component:extend("EventManager")
function EventManager:render()
return Roact.createElement(CmdrContext.Consumer, {
render = function(cmdr)
local eventControllers = {}
for eventType, component in pairs(EventTypes) do
eventControllers[eventType] = Roact.createElement(EventController, {
Component = component,
ListenTo = component.listenTo,
MaxQuantity = component.maxQuantity,
Cmdr = cmdr
})
end
return Roact.createFragment(eventControllers)
end
})
end
return EventManager
|
local formatter = require'irc-formatter'
describe('irc-formatter', function()
it('should allow creating a formatter with empty defaults', function()
assert.is_table(formatter.new())
assert.is_table(formatter.new({}))
end)
it('should allow creating a formatter with invalid defaults', function()
assert.is_table(formatter.new({
command = '001',
params = { 'this is', 'invalid' },
}))
end)
it('should have a custom type representing missing values', function()
local t = formatter.new({})
assert.is_table(formatter.missing)
assert.is_table(t.missing)
assert.is_same(t.missing,formatter.missing)
end)
it('should validate without throwing errors', function()
local f = formatter.new({})
local ok, err = f:validate()
assert.is_nil(ok)
assert.is_string(err)
end)
it('should error when serializing with no command', function()
local f = formatter.new({})
assert.has_error(function() f:serialize() end)
end)
it('should not error with __tostring', function()
local f = formatter.new({})
assert.not_has_error(function() tostring(f) end)
end)
it('should error when serializing with invalid params', function()
local f = formatter.new({
command = '001',
params = { 'this is', 'invalid' },
})
assert.has_error(function() f:serialize() end)
end)
it('should support a host alone', function()
local f = formatter.new({
source = {
host = '127.0.0.1',
},
command = '001',
})
assert.is_equal(':127.0.0.1 001',f:serialize())
end)
it('should support a nick alone', function()
local f = formatter.new({
source = {
nick = 'nick',
},
command = '001',
})
assert.is_equal(':nick 001',f:serialize())
end)
it('should support a nick with user', function()
local f = formatter.new({
source = {
nick = 'nick',
user = 'user',
},
command = '001',
})
assert.is_equal(':nick!user 001',f:serialize())
end)
it('should support a nick with host', function()
local f = formatter.new({
source = {
nick = 'nick',
host = '127.0.0.1',
},
command = '001',
})
assert.is_equal(':nick@127.0.0.1 001',f:serialize())
end)
it('should support a nick with user and host', function()
local f = formatter.new({
source = {
nick = 'nick',
user = 'user',
host = '127.0.0.1',
},
command = '001',
})
assert.is_equal(':nick!user@127.0.0.1 001',f:serialize())
end)
it('should error with a user and no nick', function()
local f = formatter.new({
source = {
user = 'user',
},
command = '001',
})
assert.has_error(function() f:serialize() end)
end)
it('should serialize messages', function()
local result = '@a=:-)\\sHi\\sthere\\:\\r\\n\\\\s;b=false;c;d=1234 :nick!user@127.0.0.1 PRIVMSG #some-room ::-)Hello there!'
assert.is_equal(
formatter.new({
tags = {
a = ':-) Hi there;\r\n\\s',
b = false,
c = formatter.missing,
d = 1234,
},
source = {
nick = 'nick',
user = 'user',
host = '127.0.0.1',
},
command = 'PRIVMSG',
params = { '#some-room', ':-)Hello there!' },
}):serialize(),result)
end)
it('should allow setting and merging defaults', function()
local result = '@a=:-)\\sHi\\sthere\\:\\r\\n\\\\s;b=false;c;d=1234 :nick!user@127.0.0.1 PRIVMSG #some-room ::-)Hello there!\r\n'
local f = formatter.new({
tags = {
a = ':-) Hi there;\r\n\\s',
},
source = {
host = '127.0.0.1',
},
command = 'PRIVMSG',
params = { '#some-room' },
eol = '\r\n',
})
assert.is_equal(f:serialize({
tags = {
b = false,
c = formatter.missing,
d = 1234,
},
source = {
nick = 'nick',
user = 'user',
host = '127.0.0.1',
},
params = {
':-)Hello there!',
},
}),result)
end)
it('should handle empty strings in params', function()
local f = formatter.new({
command = '001',
params = { '' },
})
assert.is_equal('001 :',f:serialize())
end)
it('should convert non-strings commands to strings', function()
local f = formatter.new({
command = 300,
})
assert.is_equal('300',f:serialize())
end)
it('should convert commands < 100 to 3-digit strings', function()
local f = formatter.new({
command = 1,
})
assert.is_equal('001',f:serialize())
end)
it('should convert commands > 999 to 4-digit strings', function()
local f = formatter.new({
command = 1000,
})
assert.is_equal('1000',f:serialize())
end)
it('should reject non-integer, non-string commands', function()
local f = formatter.new({
command = true,
})
assert.has_error(function() f:serialize() end)
end)
it('should convert non-strings params to strings', function()
local f = formatter.new({
command = '001',
params = { true },
})
assert.is_equal('001 true',f:serialize())
end)
it('should allow forcing a final colon when not required', function()
local f = formatter.new({
command = '001',
params = { 'simple' },
})
assert.is_equal('001 :simple',f:serialize(nil,true))
end)
it('should only force a colon on the last param', function()
local f = formatter.new({
command = '001',
params = { 'simple', 'hello' },
})
assert.is_equal('001 simple :hello',f:serialize(nil,true))
end)
end)
|
-- Routine for NPC "Inina" in the sewers
velocity = 40
loadRoutine = function(R, W)
if (not W:isConditionFulfilled("npc_inina2","talked")) then
R:setTilePosition(6,17)
R:setFacingDown()
R:setLooped(false)
R:setReloadEnabled(true)
return
end
R:setTilePosition(3,15)
R:setReloadEnabled(false)
R:setFacingUp()
R:wait(4000)
R:goToTile(6,15)
R:goToTile(6,25)
R:goToTile(2,25)
R:setFacingUp()
R:wait(4000)
R:goToTile(6,25)
R:goToTile(6,15)
R:goToTile(7,15)
R:goToTile(7,10)
R:setFacingLeft()
R:wait(6000)
R:goToTile(7,15)
R:goToTile(3,15)
end
|
nyagos.alias.open = function(args)
local count=0
for i=1,#args do
local list=nyagos.glob(args[i])
if list and #list >= 1 then
for j=1,#list do
if nyagos.access(list[j],0) then
assert(nyagos.shellexecute("open",list[j]))
else
print(args[i] .. ": can not get status")
end
end
else
if nyagos.access(args[i],0) then
assert(nyagos.shellexecute("open",args[i]))
else
print(args[i] .. ": can not get status")
end
end
count = count +1
end
if count <= 0 then
if nyagos.access(".\\open.cmd",0) then
nyagos.exec("open.cmd")
else
assert(nyagos.shellexecute("open","."))
end
end
end
|
local button = {
x = 1,
y = 1,
w = 11,
h = 2,
text = "A button",
backColour = colours.cyan,
foreColour = colours.white,
selected = false,
visible = true,
type = "button",
marginleft = 0,
margintop = 0,
automl = "",
automt = "",
autow = "perc:50",
wrap = "left",
autoh = true,
}
button.__index = button
function button:getPercentages()
if type(self.w) == "string" then
self.w = cobalt.getPercentage( self.w )
self.autow = self.w
else
self.autow = "none"
end
if type(self.h) == "string" then
self.h = cobalt.getPercentage( self.h )
self.autoh = self.h
else
self.autoh = "none"
end
if type(self.marginleft) == "string" then
self.marginleft = cobalt.getPercentage( self.marginleft )
self.automl = self.marginleft
end
if type(self.margintop) == "string" then
self.margintop = cobalt.getPercentage( self.margintop )
self.automt = self.margintop
end
if type(self.x) == "string" then
self.x = cobalt.getPercentage( self.x )
self.autox = self.x
end
if type(self.y) == "string" then
self.y = cobalt.getPercentage( self.y )
self.autoy = self.y
end
end
function button.new( data, parent )
data = data or { }
if data.style then
local t = data.style
for k, v in pairs( t ) do
if not data[k] then
data[k] = v
end
end
data.style = nil
end
local self = setmetatable(data,button)
self.parent = parent
self:getPercentages()
self:resize()
self.state = data.state or parent.state
table.insert( parent.children, self )
return self
end
function button:setMargins( t, l )
if t then
self.margintop = t or self.margintop
if type(t) == "string" then
self:getPercentages()
else
self.automt = "none"
end
end
if l then
self.marginleft = l or self.marginleft
if type(l) == "string" then
self:getPercentages()
else
self.automl = "none"
end
end
self:resize()
end
function button:resize( w, h )
if w then
self.w = w or self.w
if type( self.w ) == "string" then
self:getPercentages()
else
self.autow = "none"
end
end
if h then
self.h = h or self.h
if type( self.h ) == "string" then
self:getPercentages()
else
self.autoh = "none"
end
end
if type( self.autow ) == "number" then
self.w = math.floor( self.parent.w * self.autow )
end
if type( self.autoh ) == "number" then
self.h = math.floor( self.parent.w * self.autow )
end
if type( self.automl ) == "number" then
self.marginleft = math.floor( self.parent.w * self.automl )
end
if type( self.automt ) == "number" then
self.margintop = math.floor( self.parent.h * self.automt )
end
if self.autox and type( self.autox ) == "number" then
self.x = math.ceil( self.parent.w * self.autox )
end
if self.autoy and type( self.autoy ) == "number" then
self.y = math.ceil( self.parent.h * self.autoy )
end
end
function button:getAbsX()
return math.floor(self.x + self.parent:getAbsX() + self.marginleft)-1
end
function button:getAbsY()
return math.floor(self.y + self.parent:getAbsY() + self.margintop)-1
end
function button:draw()
if self.state == cobalt.state or self.state == "_ALL" and self.visible then
local colour = self.backColour
if self.wrap == "center" then
self.x = math.ceil( (self.parent.w/2)-self.w/2 + self.marginleft )
end
if self.selected then
colour = cobalt.g.lighten( self.backColour )
end
if self.h == 1 then
self.parent.surf:drawLine( self.x + self.marginleft, self.y + self.margintop, self.x + self.w+self.marginleft, self.y, " ", colour, self.foreColour )
self.parent.surf:drawText( self.x+math.ceil((self.w/2)-#self.text/2 + self.marginleft),self.y+ self.margintop, self.text, colour, self.foreColour )
else
self.parent.surf:fillRect( self.x + self.marginleft, self.y + self.margintop, self.x + self.w+self.marginleft, self.y + self.h, " ", colour, self.foreColour )
self.parent.surf:drawText( self.x+math.ceil((self.w/2)-#self.text/2 + self.marginleft), math.ceil(self.y+self.h/2)+ self.margintop, self.text, colour, self.foreColour )
end
end
end
function button:mousepressed( x, y, button )
if self.state == cobalt.state or self.state == "_ALL" and self.visible then
if button == 1 then
local h = self.h
if self.h == 1 then h = 0 end
if x >= self:getAbsX() and x <= self:getAbsX() + self.w and y >= self:getAbsY() and y <= self:getAbsY() + h then
self.selected = true
end
end
end
end
function button:mousereleased( x, y, button )
if self.state == cobalt.state or self.state == "_ALL" and self.visible then
local h = self.h
if self.h == 1 then h = 0 end
if button == 1 and x >= self:getAbsX() and x <= self:getAbsX() + self.w and y >= self:getAbsY() and y <= self:getAbsY() + h then
if self.selected then
if self.onclick then
self.onclick()
end
self.selected = false
end
else
self.selected = false
end
end
end
return button
|
-- // Militan tarafından yeniden kodlandı.
mysql = exports.mrp_mysql
local streams = {}
function fetchStation()
streams = {
[0] = { "Radio Off", "" },
}
local count = 0
dbQuery(
function(qh)
local res, rows, err = dbPoll(qh, 0)
if rows > 0 then
for index, row in ipairs(res) do
table.insert(streams, {row["station_name"], row["source"] } )
end
end
end,
mysql:getConnection(), "SELECT * FROM `radio_stations` WHERE `enabled`='1' ORDER BY `id` ASC")
end
function resourceStart()
fetchStation()
setTimer(fetchStation, RADIO_SERVER_REFRESHRATE, 0)
end
addEventHandler("onResourceStart", resourceRoot, resourceStart)
function getStreams()
return streams
end
function sendStationsToClient()
if streams and #streams > 0 then
outputDebugString("Server: sending "..(#streams).." stations to client.")
triggerClientEvent(source, "getStationsFromServer", source, streams)
end
end
addEvent("sendStationsToClient", true)
addEventHandler("sendStationsToClient", root, sendStationsToClient)
function forceSyncStationsToAllclients()
local stations = fetchStation()
local syncedClients, failedClients = 0, 0
if stations and tonumber(stations) and tonumber(stations) > 0 then
for i, player in pairs(getElementsByType("player")) do
if triggerClientEvent(player, "getStationsFromServer", player, streams) then
syncedClients = syncedClients + 1
else
failedClients = failedClients + 1
end
end
exports.mrp_hud:sendBottomNotification(client, "Radio Station Manager", stations.." radio station(s) have been successfully synced to "..syncedClients.." online clients ("..failedClients.." failed).")
else
exports.mrp_hud:sendBottomNotification(client, "Radio Station Manager", "Could not synced any radio stations.")
end
end
addEvent("forceSyncStationsToAllclients", true)
addEventHandler("forceSyncStationsToAllclients", root, forceSyncStationsToAllclients)
|
-- Copyright (C) by Jianhao Dai (Toruneko)
local averager = require "resty.influx.metrics.averager"
local context = require "resty.influx.metrics.timer.context"
local setmetatable = setmetatable
local _M = { _VERSION = '0.0.1' }
local mt = { __index = _M }
function _M.new(key, name)
return setmetatable({
avg = averager.new(key, name),
}, mt)
end
function _M.time(self)
return context.new(self)
end
function _M.update(self, num)
self.avg:update(num)
end
function _M.has_value(self)
return self.avg:has_value()
end
function _M.get_value(self)
return self.avg:get_value()
end
function _M.get_values(self)
return self.avg:get_values()
end
function _M.clear(self)
self.avg:clear()
end
return _M
|
MusicWheelSort = {}
function MusicWheelSort.by_difficulty(a, b)
if (a.level == b.level and a.title == b.title) then
-- For rare cases where stepfile author has set the same difficulty to multiple
-- stepcharts, make sure they are in difficulty order at least
return DifficultyIndex[a.difficulty] < DifficultyIndex[b.difficulty]
elseif a.level == b.level then
-- If the levels are same, sort by title
return a.title < b.title
else
-- Otherwise, sort on level
return a.level < b.level
end
end
|
local class = require 'middleclass'
local index = require 'hisdb.index'
local object = require 'hisdb.object'
local poll = require 'hisdb.poll'
local info = require 'hisdb.info'
local hisdb = class('hisdb.hisdb')
function hisdb:initialize(folder, durations, default_duration)
self._durations = durations
self._index_db = index:new(folder, default_duration)
self._objects = {}
self._version_check = {}
end
function hisdb:open()
return self._index_db:open()
end
function hisdb:close()
return self._index_db:close()
end
function hisdb:index_db()
return self._index_db
end
local function index_key(group, key, cate)
return string.format('%s/%s/%s', group, key, cate)
end
function hisdb:create_object(group, key, cate, meta, version)
assert(key ~= nil, "Key missing")
assert(cate ~= nil, "Cate missing")
assert(meta ~= nil, "Meta missing")
local duration = self._durations[group]
local ikey = index_key(group, key, cate)
if not self._version_check[ikey] then
self._version_check[ikey] = version
else
assert(self._version_check[ikey] == version)
end
local obj, err = object:new(self, group, key, cate, meta, version, duration)
table.insert(self._objects, obj)
return obj
end
function hisdb:create_store(obj, start_time)
assert(obj, 'Object missing')
assert(start_time, 'Start time missing')
local start_time = start_time or os.time()
local db = self._index_db
return db:create(obj:group(), obj:key(), obj:duration(), start_time)
end
function hisdb:find_store(obj, timestamp)
assert(obj and timestamp)
local db = self._index_db
return db:find(obj:group(), obj:key(), obj:duration(), timestamp)
end
function hisdb:list_store(obj, start_time, end_time)
assert(obj and start_time and end_time)
local db = self._index_db
return db:list(obj:group(), obj:key(), obj:duration(), start_time, end_time)
end
function hisdb:retain_check()
--- Purge db files each minute
self._index_db:retain_check()
end
function hisdb:purge_all()
return self._index_db:purge_all()
end
function hisdb:create_poll(...)
return poll:new(self, ...)
end
function hisdb:create_info(...)
return info:new(self, ...)
end
return hisdb
|
Locales['en'] = {
['blanchisseurblip'] = 'Launderer',
['press_menu'] = 'Press on ~INPUT_CONTEXT~ to whiten your ~y~Dirty money',
['Nothere'] = 'Come back later ...',
['Whitening'] = 'Whitening in progress ...',
['Nocash'] = 'You do not have enough money to launder, minimum : $',
['cash'] = 'You received : ~r~$ ',
['cash1'] = ' clean money',
['Notification'] = 'Launderer',
['wash'] = 'Blanch your dirty money',
['wash_money_amount'] = 'Amount to be laundered',
['invalid_amount'] = 'Invalid amount',
}
|
function Structures:CreateShops()
for _,v in ipairs(Entities:FindAllByName("target_mark_containers_shop_duel")) do
local DuelShop = CreateItemOnPositionSync(v:GetAbsOrigin(), nil)
DuelShop:SetModel("models/heroes/shopkeeper/shopkeeper.vmdl")
DuelShop:SetForwardVector(Vector(0, -1, 0))
DuelShop:SetModelScale(1.6)
Structures:CreateShop(DuelShop, ShopsData.Duel, "#containers_shop_duel_name", 192, {3})
end
end
function Structures:CreateShop(baseUnit, itemTable, shopName, radius, customItemGrid)
local sItems, prices, stocks, grid = Structures:_CreateShopTable(itemTable)
itemShop = Containers:CreateShop({
layout = customItemGrid or grid,
skins = {},
headerText = shopName,
pids = {},
position = "entity",
entity = baseUnit,
items = sItems,
prices = prices,
stocks = stocks,
closeOnOrder= true,
range = radius,
OnEntityOrder=function(playerId, container, unit, target)
if unit and unit:IsAlive() and unit:IsTrueHero() then
container:Open(playerId)
unit:Stop()
end
end,
})
end
function Structures:_CreateShopTable(ii)
local sItems = {}
local prices = {}
local stocks = {}
for _,i in ipairs(ii) do
if type(i) == "table" then
item = CreateItem(i.item, unit, unit)
local index = item:GetEntityIndex()
sItems[#sItems+1] = item
prices[index] = i.cost or item:GetCost()
else
item = CreateItem(i, unit, unit)
local index = item:GetEntityIndex()
sItems[#sItems+1] = item
prices[index] = item:GetCost()
--if i[3] ~= nil then stocks[index] = i[3] end
end
end
local grid = {}
local gridSize = math.ceil(math.sqrt(#ii))
for i = 1, gridSize do
if gridSize * #grid < #ii then
table.insert(grid, gridSize)
end
end
return sItems, prices, stocks, grid
end
|
local json = require "json"
local param = require "param"
local util = require "util"
local database = require "database"
local types = require "types"
local id = param.id
local typeName = param.type
if util.isNotEmpty(typeName) then
if types[typeName] then
local db = database.connect()
local op = db:operators()
local status, res = pcall(db.find, db, {[typeName] = {id = op.equal(id)}})
if status then
if #res == 1 then
local type = types[typeName]
-- sort property names --
local propertyNames = {}
for k,v in pairs(type) do propertyNames[#propertyNames + 1] = k end
table.sort(propertyNames)
-- wrap everything up --
local arr = {}
for i=1,#propertyNames do
local k = propertyNames[i]
local v = type[k]
arr[#arr + 1] = {name = k, value = res[1][k], type = v}
end
arr[#arr + 1] = typeName -- last element is type name
ngx.say(json.encode(arr))
else
ngx.say("Can't edit 0 or more then 1 results!")
end
else
ngx.say(json.encode(res))
end
db:close()
else
ngx.say(typeName .. " does not exist!")
end
else
ngx.say("Select type!")
end
|
local Prop = {}
Prop.Name = "Subs Apartment 103"
Prop.Cat = "Apartments"
Prop.Price = 750
Prop.Doors = {
Vector( -3469, 9537, 758 ),
Vector( -3515, 9191, 758 ),
Vector( -3257, 9229, 758 ),
Vector( -3257, 9413, 758 ),
}
GM.Property:Register( Prop )
|
return setmetatable({}, {
-- map any name to itself to silence warnings
__index = function(_, k)
return k
end
})
|
dofile("table_show.lua")
dofile("urlcode.lua")
JSON = (loadfile "JSON.lua")()
local urlparse = require("socket.url")
local http = require("socket.http")
local item_value = os.getenv('item_value')
local item_type = os.getenv('item_type')
local item_dir = os.getenv('item_dir')
local warc_file_base = os.getenv('warc_file_base')
local item_value_normalized = string.lower(urlparse.unescape(item_value))
local url_count = 0
local tries = 0
local downloaded = {}
local addedtolist = {}
local abortgrab = false
local done_tags = false
local discovered = {}
discovered[item_type .. ":" .. item_value] = true
local post_ids = {}
for ignore in io.open("ignore-list", "r"):lines() do
downloaded[ignore] = true
end
for ignore in io.open("ignore-item-list", "r"):lines() do
discovered[ignore] = true
end
load_json_file = function(file)
if file then
return JSON:decode(file)
else
return nil
end
end
discover_item = function(type_, name, tries)
if tries == nil then
tries = 0
end
name = urlparse.escape(urlparse.unescape(name)) -- normalize
item = type_ .. ':' .. name
if discovered[item] then
return true
end
io.stdout:write("Discovered item " .. item .. ".\n")
io.stdout:flush()
local body, code, headers, status = http.request(
"http://blackbird-amqp.meo.ws:23038/navermatome-np2bf5h0b8xhv7s8gplh/",
item
)
if code == 200 or code == 409 then
discovered[item] = true
return true
elseif code == 404 then
io.stdout:write("Project key not found.\n")
io.stdout:flush()
elseif code == 400 then
io.stdout:write("Bad format.\n")
io.stdout:flush()
else
io.stdout:write("Could not queue discovered item. Retrying...\n")
io.stdout:flush()
if tries == 10 then
io.stdout:write("Maximum retries reached for sending discovered item.\n")
io.stdout:flush()
else
os.execute("sleep " .. math.pow(2, tries))
return discover_item(type_, name, tries + 1)
end
end
abortgrab = true
return false
end
read_file = function(file)
if file then
local f = assert(io.open(file))
local data = f:read("*all")
f:close()
return data
else
return ""
end
end
allowed = function(url, parenturl)
if string.match(urlparse.unescape(url), "[<>\\%*%$;%^%[%],%(%){}]")
or string.match(url, "^https?://matome%.naver%.jp/report/abuse")
or not string.match(url, "^https?://[^/]*naver%.jp/") then
return false
end
local tested = {}
for s in string.gmatch(url, "([^/]+)") do
if tested[s] == nil then
tested[s] = 0
end
if tested[s] == 6 then
return false
end
tested[s] = tested[s] + 1
end
if string.match(url, "^https?://[^/]*img%.naver%.jp/")
and item_type ~= "topic" then
return true
end
local match = string.match(url, "^https?://matome%.naver%.jp/topic/([^/%?&]+)$")
if match then
discover_item("topic", match)
end
match = string.match(url, "^https?://matome%.naver%.jp/mymatome/([^/%?&]+)$")
if not match then
match = string.match(url, "^https?://matome%.naver%.jp/profile/([^/%?&]+)$")
end
if match then
discover_item("profile", match)
end
if (
string.match(url, "^https?://matome%.naver%.jp/odai/[0-9]+$")
or string.match(url, "^https?://matome%.naver%.jp/feed/mymatome/[a-zA-Z0-9]+$")
)
and item_type == "profile"
and parenturl
and not string.match(parenturl, "^https?://matome%.naver%.jp/odai/[0-9]+") then
post_ids[string.match(url, "([a-zA-Z0-9]+)$")] = true
end
for s in string.gmatch(url, "([^/%?&]+)") do
if string.lower(urlparse.unescape(s)) == item_value_normalized then
return true
end
end
if url == "https://matome.naver.jp/api/user/tag/list" then
return true
end
for s in string.gmatch(url, "([a-zA-Z0-9]+)") do
if post_ids[s] then
return true
end
end
return false
end
wget.callbacks.download_child_p = function(urlpos, parent, depth, start_url_parsed, iri, verdict, reason)
local url = urlpos["url"]["url"]
local html = urlpos["link_expect_html"]
if item_type == "topic"
or string.match(url, "^https?://static%.line%-scdn%.net/") then
return false
end
if (downloaded[url] ~= true and addedtolist[url] ~= true)
and (allowed(url, parent["url"]) or html == 0) then
addedtolist[url] = true
return true
end
return false
end
wget.callbacks.get_urls = function(file, url, is_css, iri)
local urls = {}
local html = nil
downloaded[url] = true
local function check(urla)
local origurl = url
local url = string.match(urla, "^([^#]+)")
local url_ = string.match(url, "^(.-)%.?$")
url_ = string.gsub(url_, "&", "&")
url_ = string.match(url_, "^(.-)%s*$")
url_ = string.match(url_, "^(.-)%??$")
url_ = string.match(url_, "^(.-)&?$")
if (downloaded[url_] ~= true and addedtolist[url_] ~= true)
and allowed(url_, origurl) then
table.insert(urls, { url=url_ })
addedtolist[url_] = true
addedtolist[url] = true
end
end
local function checknewurl(newurl)
if string.match(newurl, "^https?:////") then
check(string.gsub(newurl, ":////", "://"))
elseif string.match(newurl, "^https?://") then
check(newurl)
elseif string.match(newurl, "^https?:\\/\\?/") then
check(string.gsub(newurl, "\\", ""))
elseif string.match(newurl, "^\\/") then
checknewurl(string.gsub(newurl, "\\", ""))
elseif string.match(newurl, "^//") then
check(urlparse.absolute(url, newurl))
elseif string.match(newurl, "^/") then
check(urlparse.absolute(url, newurl))
elseif string.match(newurl, "^%.%./") then
if string.match(url, "^https?://[^/]+/[^/]+/") then
check(urlparse.absolute(url, newurl))
else
checknewurl(string.match(newurl, "^%.%.(/.+)$"))
end
elseif string.match(newurl, "^%./") then
check(urlparse.absolute(url, newurl))
end
end
local function checknewshorturl(newurl)
if string.match(newurl, "^%?") then
check(urlparse.absolute(url, newurl))
elseif not (string.match(newurl, "^https?:\\?/\\?//?/?")
or string.match(newurl, "^[/\\]")
or string.match(newurl, "^%./")
or string.match(newurl, "^[jJ]ava[sS]cript:")
or string.match(newurl, "^[mM]ail[tT]o:")
or string.match(newurl, "^vine:")
or string.match(newurl, "^android%-app:")
or string.match(newurl, "^ios%-app:")
or string.match(newurl, "^%${")) then
check(urlparse.absolute(url, newurl))
end
end
local function apitags(post_data)
table.insert(urls, {
url="https://matome.naver.jp/api/user/tag/list",
post_data=post_data,
headers={
["X-Requested-With"]="XMLHttpRequest",
["Accept"]="application/json, text/javascript, */*; q=0.01",
["Content-Type"]="application/json;charset=utf-8",
["Content-Length"]=tostring(string.len(post_data))
}
})
end
if allowed(url, nil) and status_code == 200
and not string.match(url, "^https?://[^/]*img%.naver%.jp/") then
html = read_file(file)
if url == "https://matome.naver.jp/api/user/tag/list" then
local data = load_json_file(html)
if not data or not data["result"] then
io.stdout:write("Could not extract API tags list.\n")
io.stdout:flush()
abortgrab = true
end
html = data["result"]
end
if string.match(html, "go[pP]age%s*%([0-9]+%)") then
local match = string.match(html, '<form%s+name="form"%s+action="[^"]+"%s+method="get">(.-)</form>')
local params = ""
if match then
for key, value in string.gmatch(match, '<input%s+type="[^"]+"%s+name="([^"]+)"%s+value="([^"]*)"%s*/>') do
params = params .. key .. "=" .. value .. "&"
end
end
for page in string.gmatch(html, "goPage%(([0-9]+)%)") do
if not string.find(params, "page=") then
params = params .. "page=" .. page .. "&"
else
params = string.gsub(params, "page=[0-9]+", "page=" .. page)
end
params = string.match(params, "^(.-)&?$")
checknewshorturl("?" .. params)
end
end
if string.match(url, "/mymatome/") then
check(string.gsub(url, "/mymatome/", "/profile/"))
end
for s in string.gmatch(html, "<dc:creator>%s*([^%s<]+)%s*</dc:creator>") do
check(urlparse.absolute("https://matome.naver.jp/profile/", s))
end
if not done_tags then
local match = string.match(html, '<ul%s+data%-pageData="([^"]+)"[^>]+>')
if match then
match = string.gsub(match, """, '"')
local data = load_json_file(match)
if not data["fetch"] or not data["totalPage"] or not data["userHash"]
or not data["total"] then
io.stdout:write("Could not extract some user data.\n")
io.stdout:flush()
abortgrab = true
end
for page=1,data["totalPage"] do
apitags('{' ..
'"page":' .. tostring(page) ..
',"fetch":' .. data["fetch"] ..
',"userHash":"' .. data["userHash"] .. '"' ..
'}')
end
apitags('{' ..
'"page":1' ..
',"fetch":' .. data["total"] ..
',"userHash":"' .. data["userHash"] .. '"' ..
'}')
done_tags = true
end
end
for newurl in string.gmatch(string.gsub(html, """, '"'), '([^"]+)') do
checknewurl(newurl)
end
for newurl in string.gmatch(string.gsub(html, "'", "'"), "([^']+)") do
checknewurl(newurl)
end
for newurl in string.gmatch(html, ">%s*([^<%s]+)") do
checknewurl(newurl)
end
for newurl in string.gmatch(html, "href='([^']+)'") do
checknewshorturl(newurl)
end
for newurl in string.gmatch(html, "[^%-]href='([^']+)'") do
checknewshorturl(newurl)
end
for newurl in string.gmatch(html, '[^%-]href="([^"]+)"') do
checknewshorturl(newurl)
end
for newurl in string.gmatch(html, ":%s*url%(([^%)]+)%)") do
checknewurl(newurl)
end
end
return urls
end
wget.callbacks.httploop_result = function(url, err, http_stat)
status_code = http_stat["statcode"]
url_count = url_count + 1
io.stdout:write(url_count .. "=" .. status_code .. " " .. url["url"] .. " \n")
io.stdout:flush()
if status_code >= 300 and status_code <= 399
and not current_response_retry then
local newloc = urlparse.absolute(url["url"], http_stat["newloc"])
if downloaded[newloc] == true or addedtolist[newloc] == true
or not allowed(newloc, url["url"]) then
tries = 0
return wget.actions.EXIT
end
end
if status_code >= 200 and status_code <= 399 then
downloaded[url["url"]] = true
end
if abortgrab == true then
io.stdout:write("ABORTING...\n")
io.stdout:flush()
return wget.actions.ABORT
end
if status_code >= 500
or (
status_code >= 400
and status_code ~= 404
)
or status_code == 0 then
io.stdout:write("Server returned " .. http_stat.statcode .. " (" .. err .. "). Sleeping.\n")
io.stdout:flush()
local maxtries = 12
if not allowed(url["url"], nil)
or string.match(url["url"], "^https?://rr%.img%.naver%.jp/mig%?.*src=") then
maxtries = 1
end
if tries >= maxtries then
io.stdout:write("I give up...\n")
io.stdout:flush()
tries = 0
if maxtries == 1 then
return wget.actions.EXIT
else
return wget.actions.ABORT
end
else
os.execute("sleep " .. math.floor(math.pow(2, tries)))
tries = tries + 1
return wget.actions.CONTINUE
end
end
tries = 0
local sleep_time = 0
if sleep_time > 0.001 then
os.execute("sleep " .. sleep_time)
end
return wget.actions.NOTHING
end
wget.callbacks.before_exit = function(exit_status, exit_status_string)
if abortgrab == true then
return wget.exits.IO_FAIL
end
return exit_status
end
|
local meta = FindMetaTable( "Player" )
if ( !meta ) then return end
-- In this file we're adding functions to the player meta table.
-- This means you'll be able to call functions here straight from the player object
-- You can even override already existing functions.
--[[---------------------------------------------------------
Name: AddFrozenPhysicsObject
Desc: For the Physgun, adds a frozen object to the player's list
-----------------------------------------------------------]]
function meta:AddFrozenPhysicsObject( ent, phys )
-- Get the player's table
local tab = self:GetTable()
-- Make sure the physics objects table exists
tab.FrozenPhysicsObjects = tab.FrozenPhysicsObjects or {}
-- Make a new table that contains the info
local entry = {}
entry.ent = ent
entry.phys = phys
table.insert( tab.FrozenPhysicsObjects, entry )
gamemode.Call( "PlayerFrozeObject", self, ent, phys )
end
local function PlayerUnfreezeObject( ply, ent, object )
-- Not frozen!
if ( object:IsMoveable() ) then return 0 end
-- Unfreezable means it can't be frozen or unfrozen.
-- This prevents the player unfreezing the gmod_anchor entity.
if ( ent:GetUnFreezable() ) then return 0 end
-- NOTE: IF YOU'RE MAKING SOME KIND OF PROP PROTECTOR THEN HOOK "CanPlayerUnfreeze"
if ( !gamemode.Call( "CanPlayerUnfreeze", ply, ent, object ) ) then return 0 end
object:EnableMotion( true )
object:Wake()
gamemode.Call( "PlayerUnfrozeObject", ply, ent, object )
return 1
end
--[[---------------------------------------------------------
Name: UnfreezePhysicsObjects
Desc: For the Physgun, unfreezes all frozen physics objects
-----------------------------------------------------------]]
function meta:PhysgunUnfreeze()
-- Get the player's table
local tab = self:GetTable()
if ( !tab.FrozenPhysicsObjects ) then return 0 end
-- Detect double click. Unfreeze all objects on double click.
if ( tab.LastPhysUnfreeze && CurTime() - tab.LastPhysUnfreeze < 0.25 ) then
return self:UnfreezePhysicsObjects()
end
local tr = self:GetEyeTrace()
if ( tr.HitNonWorld && IsValid( tr.Entity ) ) then
local Ents = constraint.GetAllConstrainedEntities( tr.Entity )
local UnfrozenObjects = 0
for k, ent in pairs( Ents ) do
local objects = ent:GetPhysicsObjectCount()
for i = 1, objects do
local physobject = ent:GetPhysicsObjectNum( i - 1 )
UnfrozenObjects = UnfrozenObjects + PlayerUnfreezeObject( self, ent, physobject )
end
end
return UnfrozenObjects
end
tab.LastPhysUnfreeze = CurTime()
return 0
end
--[[---------------------------------------------------------
Name: UnfreezePhysicsObjects
Desc: For the Physgun, unfreezes all frozen physics objects
-----------------------------------------------------------]]
function meta:UnfreezePhysicsObjects()
-- Get the player's table
local tab = self:GetTable()
-- If the table doesn't exist then quit here
if ( !tab.FrozenPhysicsObjects ) then return 0 end
local Count = 0
-- Loop through each table in our table
for k, v in pairs( tab.FrozenPhysicsObjects ) do
-- Make sure the entity to which the physics object
-- is attached is still valid (still exists)
if ( isentity( v.ent ) && IsValid( v.ent ) ) then
-- We can't directly test to see if EnableMotion is false right now
-- but IsMovable seems to do the job just fine.
-- We only test so the count isn't wrong
if ( IsValid( v.phys ) && !v.phys:IsMoveable() ) then
-- We need to freeze/unfreeze all physobj's in jeeps to stop it spazzing
if ( v.ent:GetClass() == "prop_vehicle_jeep" ) then
-- How many physics objects we have
local objects = v.ent:GetPhysicsObjectCount()
-- Loop through each one
for i = 0, objects - 1 do
local physobject = v.ent:GetPhysicsObjectNum( i )
PlayerUnfreezeObject( self, v.ent, physobject )
end
end
Count = Count + PlayerUnfreezeObject( self, v.ent, v.phys )
end
end
end
-- Remove the table
tab.FrozenPhysicsObjects = nil
return Count
end
local g_UniqueIDTable = {}
--[[---------------------------------------------------------
This table will persist between client deaths and reconnects
-----------------------------------------------------------]]
function meta:UniqueIDTable( key )
local id = 0
if ( SERVER ) then id = self:UniqueID() end
g_UniqueIDTable[ id ] = g_UniqueIDTable[ id ] or {}
g_UniqueIDTable[ id ][ key ] = g_UniqueIDTable[ id ][ key ] or {}
return g_UniqueIDTable[ id ][ key ]
end
--[[---------------------------------------------------------
Player Eye Trace
-----------------------------------------------------------]]
function meta:GetEyeTrace()
if ( CLIENT ) then
local framenum = FrameNumber()
-- Cache the trace results for the current frame, unless we're serverside
-- in which case it wouldn't play well with lag compensation at all
if ( self.LastPlayerTrace == framenum ) then
return self.PlayerTrace
end
self.LastPlayerTrace = framenum
end
local tr = util.TraceLine( util.GetPlayerTrace( self ) )
self.PlayerTrace = tr
return tr
end
--[[---------------------------------------------------------
GetEyeTraceIgnoreCursor
Like GetEyeTrace but doesn't use the cursor aim vector..
-----------------------------------------------------------]]
function meta:GetEyeTraceNoCursor()
if ( CLIENT ) then
local framenum = FrameNumber()
if ( self.LastPlayerAimTrace == framenum ) then
return self.PlayerAimTrace
end
self.LastPlayerAimTrace = framenum
end
local tr = util.TraceLine( util.GetPlayerTrace( self, self:EyeAngles():Forward() ) )
self.PlayerAimTrace = tr
return tr
end
|
return {
Inventory = {
-- CS-1 TAIPAN / Mod / Muzzle / Common
-- 2x Damage Multiplier when attacked from stealth, Reduces base damge by 30%.
{ id = "Items.w_silencer_01" },
-- XC-10 ALECTO / Mod / Muzzle / Rare
-- 2.5x Damage Multiplier when attacked from stealth, 15% Reduced damage.
{ id = "Items.w_silencer_04" },
-- XC-10 CETUS / Mod / Muzzle / Uncommon
-- 2.5x Damage Multiplier when attacked from stealth, Silencer, Increases Crit Chance by 5%, Reduces base damge by 25%.
{ id = "Items.w_silencer_03" },
-- XC-10 STRIX / Mod / Muzzle / Uncommon
-- 2.5x Damage Multiplier when attacked from stealth, Silencer, Increases Crit Chance by 10%, Reduces base damge by 30%.
{ id = "Items.w_silencer_02" },
-- ADD-VANTAGE / Mod / Scope
{ id = "Items.w_att_scope_short_03" },
-- CQO MK.72 KANONE MINI / Mod / Scope
{ id = "Items.w_att_scope_short_04" },
-- E255 PERCIPIENT / Mod / Scope
{ id = "Items.w_att_scope_long_02" },
-- E305 PROSPECTA / Mod / Scope
{ id = "Items.w_att_scope_sniper_02" },
-- HPO MK.77 KANONE MAX / Mod / Scope
{ id = "Items.w_att_scope_sniper_01" },
-- HYAKUME / Mod / Scope
{ id = "Items.w_att_scope_short_02" },
-- MK.2X GRANDSTAND / Mod / Scope
{ id = "Items.w_att_scope_long_01" },
-- MK.8 CLEARVUE / Mod / Scope
{ id = "Items.w_att_scope_long_03" },
-- OS-1 GIMLETEYE / Mod / Scope
{ id = "Items.w_att_scope_short_01" },
-- SO-21 SAIKA / Mod / Scope
{ id = "Items.w_att_scope_long_04" },
-- TYPE 2067 / Mod / Scope
{ id = "Items.w_att_scope_short_05" },
},
}
|
do --- debug.* smoke tests
assert(not pcall(debug.getinfo, 1, '>S'))
assert(not pcall(debug.getinfo, 1, '>f', 'boo'))
end
|
config = {
pool_id = "mongodb_test",
size = 1,
database="admin",
auth_source="core",
login="vmq_auth_source_test_user",
password="vmq_auth_source_test_password",
w_mode = "safe"
}
assert(mongodb.ensure_pool(config))
assert(mongodb.delete("mongodb_test", "users", {}))
doc1 = {_id = 'test-id',
first_name = 'Jules',
last_name = 'Verne',
protocol = 'MQTT',
broker = 'VerneMQ'}
-- insert one document
ret = mongodb.insert("mongodb_test", "users", doc1)
assert(ret._id == 'test-id')
|
require("sqlite3")
local _dbPath
print(BASE_DOCUMENT_PATH)
local _db
local _shouldCacheStatements = true;
local _cacheStmts = {};
local _cacheIndexColumNameMap = {};
local DB = {}
function DB.init(path)
_dbPath = BASE_DOCUMENT_PATH.."/"..path;
_db = sqlite3.open(_dbPath);
end
local function _getColumIndex(sql,stmt,name)
if (not name) or (not stmt) then
return nil
end
if _cacheIndexColumNameMap[sql] then
return _cacheIndexColumNameMap[sql][name]
else
local names = stmt:get_names()
local cache = {}
for i,v in ipairs(names) do
cache[v] = i-1
end
_cacheIndexColumNameMap[sql] = cache
return _cacheIndexColumNameMap[sql][name]
end
return nil
end
local function _databaseExists()
if _db then
return true;
else
return false;
end
end
function DB.query(sql,params,columName)
if not _databaseExists() then
return nil;
end
local stmt;
if _shouldCacheStatements then
stmt = _cacheStmts[sql];
if stmt then
stmt:reset();
end
end
if not stmt then
local ret, code = _db:prepare(sql);
if not ret then
error("db:prepare error code = ".. code..sql)
else
stmt = ret;
end
end
local bindCount = stmt:bind_parameter_count();
local idx = 0;
local obj;
while (idx < bindCount)
do
if params and idx < #params then
obj = params[idx + 1];
else
break;
end
idx = idx+1;
local ret = stmt:bind(idx,obj);
assert(ret == sqlite3.OK);
end
if idx ~= bindCount then
stmt:finalize();
return nil;
end
if _shouldCacheStatements and sql then
_cacheStmts[sql] = stmt;
end
local r = stmt:step()
local result = {};
while (r == sqlite3.ROW) do
local tem
if columName then
local index = _getColumIndex(sql,stmt,columName)
if index ~= nil then
tem = stmt:get_value(index)
else
error("query columName not exist")
end
else
tem = {stmt:get_uvalues()};
end
table.insert(result,tem);
r = stmt:step()
end
assert(r == sqlite3.DONE)
if not _shouldCacheStatements then
assert(stmt:finalize() == sqlite3.OK)
end
return result;
end
function DB.update(sql,params,needLastInsertId)
if not _databaseExists() then
return nil;
end
local stmt;
if _shouldCacheStatements then
stmt = _cacheStmts[sql];
if stmt then
stmt:reset();
end
end
if not stmt then
local ret, code = _db:prepare(sql);
if not ret then
error("db:prepare error code = ".. "unknon error " .. sql,2)
else
stmt = ret;
end
end
local bindCount = stmt:bind_parameter_count();
local idx = 0;
local obj;
while (idx < bindCount)
do
if params and idx < #params then
obj = params[idx + 1];
else
break;
end
idx = idx+1;
local ret = stmt:bind(idx,obj);
assert(ret == sqlite3.OK);
end
if idx ~= bindCount then
stmt:finalize();
return nil;
end
local r = stmt:step();
if r == sqlite3.DONE then
else
error("update error errorcode:"..sql.." code"..r);
end
local lastInsertId
if needLastInsertId then
lastInsertId = stmt:last_insert_rowid()
if lastInsertId then
lastInsertId = tonumber(lastInsertId)
end
end
local closeCode;
if _shouldCacheStatements and r == sqlite3.DONE then
_cacheStmts[sql] = stmt;
closeCode = stmt:reset();
else
closeCode = stmt:finalize();
_cacheStmts[sql] = nil;
end
if closeCode ~= sqlite3.OK then
error("Unknown error finalizing or resetting statement"..sql.."("..closeErrorCode..")");
end
return r == sqlite3.DONE,lastInsertId
end
function DB.close()
if _cacheStmts then
for k, v in pairs(_cacheStmts) do
if v then
v:finalize();
end
end
end
if _db then
_db:close();
end
_cacheStmts = {};
_db = nil;
end
return DB;
|
__ENV_ID = __OBJECT_TYPE .. "." .. __OBJECT_ID;
Object = {type = __OBJECT_TYPE, id = __OBJECT_ID};
__INIT_ARG_TABLE = {};
Local = {};
local ArgMirror = require('obe://Lib/Internal/ArgMirror');
function ObjectInit()
local Lua_Func_ArgList = ArgMirror.GetArgs(Local.Init);
local Lua_Func_CallArgs = {};
for _, i in pairs(Lua_Func_ArgList) do
if (__INIT_ARG_TABLE[i]) then
table.insert(Lua_Func_CallArgs, __INIT_ARG_TABLE[i]);
else
table.insert(Lua_Func_CallArgs, __nil_table);
end
end
if Local.Init then Local.Init(ArgMirror.Unpack(Lua_Func_CallArgs)); end
end
-- Engine Events
Event = LuaCore.EventNamespaceHooks(Object.type .. "." .. Object.id, "Event");
function ObjectInitFromLua(argtable)
argtable = argtable or {};
__INIT_ARG_TABLE = argtable;
This:initialize();
return Object;
end
local __ENV_SCHEDULERS = {};
function Schedule()
local scheduler = Engine.Events:schedule();
table.insert(__ENV_SCHEDULERS, scheduler);
return scheduler;
end
function ObjectDelete()
getmetatable(Event).__clean(Event);
for _, scheduler in pairs(__ENV_SCHEDULERS) do scheduler:stop(); end
if Local.Delete then Local.Delete(); end
end
|
local defconfig={uart.getconfig(0)}
do
local initTO=tmr.create()
initTO:alarm(300,tmr.ALARM_SINGLE,function(timer)
uart.on("data")
uart.alt(0)
uart.setup(0,unpack(defconfig))
print("AA response timeout");
initTO=nil
end)
uart.alt(1)
uart.on("data","\n",function(data)
uart.on("data")
uart.alt(0)
uart.setup(0,unpack(defconfig))
initTO:unregister()
initTO=nil;
print("AA response: "..data);
end,0);
uart.setup(0,38400,8,uart.PARITY_NONE,uart.STOPBITS_1,0)
uart.write(0,"off\r\n")
end
M_RUN=1
M_ERROR=2
M_SUCCESS=3
do
local blinker
function setmled (newstate)
--wifistate=newstate
local r,g,b=1,1,1
if newstate==M_RUN then
-- blink blue led
if blinker==nil then
blinker=tmr.create()
blinker:alarm(300,tmr.ALARM_AUTO,function ()
b=1-b
gpio.write(P_MEAS_B,b)
end);
end
elseif newstate==M_ERROR then r=0
elseif newstate==M_SUCCESS then g=0
end
if newstate ~= M_RUN and blinker ~= nil then
blinker:unregister()
blinker=nil
end
gpio.write(P_MEAS_R,r)
gpio.write(P_MEAS_G,g)
gpio.write(P_MEAS_B,b)
end
end
do
local cnt=-1
local fn
local comTO
local greens={gpio.HIGH,gpio.LOW}
local inputcnt=0
function new_mfile()
local file_exists=file.exists
repeat cnt=cnt+1; fn="m/aa-"..cnt..".txt"
until not file_exists(fn)
return file.open(fn,"w")
end
local cmdi;
function m_start()
if cmdi then return end-- measurement already in progress
local uart_on,uart_alt,uart_setup,uart_write = uart.on,uart.alt,uart.setup,uart.write
local string_byte,string_sub = string.byte,string.sub
local f
local cmds={"VER\r\n","fq15000000\r\n","sw30000000\r\n","frx1000\r\n"}
cmdi=1
uart_alt(1)
inputcnt=0
uart_on("data","\n",function(data)
if not cmdi then return end -- no measurement in progress. probably aborted by a timeout
-- reset the comTO timer
comTO:stop()
comTO:start()
-- invert the green led
inputcnt=inputcnt+1
gpio.write(P_MEAS_G,greens[1+bit.band(inputcnt,1)])
f:write("<"..data)
if string_byte(data)==13 then data=string_sub(data,2) end
if string_byte(data,-2)==13 then data=string_sub(data,1,-3)
else data=string_sub(data,1,-2) end
-- end of respone if:
-- command is VER
-- or data=="OK"
if (cmds[cmdi]=="VER\r\n" or data=="OK") then
cmdi=cmdi+1
if cmdi > #cmds then
-- we executed all commands
uart_on("data")
uart_alt(0)
uart_setup(0,unpack(defconfig))
comTO:unregister()
comTO=nil;
cmdi=nil
f:close()
f=nil
-- set led
setmled(M_SUCCESS)
print("AA measurement finished. file: "..fn);
return
end
f:write(">"..cmds[cmdi])
uart_write(0,cmds[cmdi])
end
end,0)
f=new_mfile()
f:write(">"..cmds[cmdi])
f:flush()
-- start blinking blue
setmled(M_RUN)
comTO=tmr.create()
comTO:alarm(500,tmr.ALARM_SINGLE,function(timer)
cmdi=nil
uart.on("data")
uart.alt(0)
uart.setup(0,unpack(defconfig))
f:close()
f=nil
print("AA response timeout during measurement");
comTO=nil
-- set led
setmled(M_ERROR)
gpio.write(P_WIFI_B,0)
gpio.write(P_WIFI_G,1)
gpio.write(P_WIFI_B,1)
end)
uart_setup(0,38400,8,uart.PARITY_NONE,uart.STOPBITS_1,0)
uart_write(0,cmds[cmdi])
end
end
-- ATTENTION do not print anything below this line except in callbacks that do not run now
buttonsetup(P_MEAS_BTN,
function ()
print("measurement butt short")
m_start()
end
);
|
return Component.create("Angel", {})
|
-- Copyright (c) 2015 — 2016, Aapo Talvensaari
-- Copyright 2016 The Charon Platform Authors.
-- All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
local json = require 'charon.json'
json.pretty = function(dt, lf, id, ac, ec)
local s, e = (ec or json.encode)(dt)
if not s then return s, e end
lf, id, ac = lf or "\n", id or " ", ac or " "
local i, j, k, n, r, p, q = 1, 0, 0, #s, {}, nil, nil
local al = string.sub(ac, -1) == "\n"
for x = 1, n do
local c = string.sub(s, x, x)
if not q and (c == "{" or c == "[") then
r[i] = p == ":" and table.concat{ c, lf } or table.concat{ string.rep(id, j), c, lf }
j = j + 1
elseif not q and (c == "}" or c == "]") then
j = j - 1
-- if p == "{" or p == "[" then
-- i = i - 1
-- r[i] = table.concat{ string.rep(id, j), p, c }
-- else
r[i] = table.concat{ lf, string.rep(id, j), c }
-- end
elseif not q and c == "," then
r[i] = table.concat{ c, lf }
k = -1
elseif not q and c == ":" then
r[i] = table.concat{ c, ac }
-- if al then
-- i = i + 1
-- r[i] = string.rep(id, j)
-- end
else
if c == '"' and p ~= "\\" then
q = not q and true or nil
end
if j ~= k then
r[i] = string.rep(id, j)
i, k = i + 1, j
end
r[i] = c
end
p, i = c, i + 1
end
local t1 = {
id = '1',
name = 'teste'
}
local t2 = [[
este é um teste
]]
return table.concat(r)
end
return json
|
--[[
Name: sv_economy.lua
-----------------------------------------------------------------
-- @package VrZn - Custom Gamemode (SRP BASE)
-- @author Nodge
-- @build Beta 1
-----------------------------------------------------------------
]]--
hook.Add( "GamemodePlayerSelectCharacter", "NetworkEconData", function( pPlayer )
timer.Simple( 30, function()
if not IsValid( pPlayer ) then return end
GAMEMODE.Net:SendPlayerBills( pPlayer )
GAMEMODE.Net:SendTaxFullUpdate( pPlayer )
end )
timer.Simple( 5, function()
if not IsValid( pPlayer ) then return end
for k, v in pairs( GAMEMODE.Econ.m_tblBills ) do
if GAMEMODE.Econ:PlayerHasUnpaidBillsOfType( pPlayer, k ) then
pPlayer:AddNote( "Você tem contas a pagar! Visite o banco.", NOTIFY_ERROR, 20 )
break
end
end
end )
end )
-- Taxes
-- ----------------------------------------------------------------
function GM.Econ:SetTaxRate( strTaxID, intRate, bNoNetwork )
local data = self.m_tblTaxes[strTaxID]
if not data then return false end
intRate = math.Clamp( intRate, data.MinValue, data.MaxValue )
local oldValue = data.Value or 0
data.Value = intRate
if not bNoNetwork then
GAMEMODE.Net:SendTaxUpdate( nil, strTaxID )
self:CommitTaxData()
end
self:OnTaxRateChanged( strTaxID, oldValue, data.Value )
return true
end
function GM.Econ:OnTaxRateChanged( strTaxID, intOldValue, intNewValue )
hook.Call( "GamemodeOnTaxRateChanged", GAMEMODE, strTaxID, intOldValue, intNewValue )
end
function GM.Econ:CommitTaxData()
local num, done = table.Count( self.m_tblTaxes ), 0
local callback = function( tblData, q )
done = done +1
if done == num then
GAMEMODE.ServerNet:BroadcastTaxesChanged()
end
end
for k, v in pairs( self.m_tblTaxes ) do
GAMEMODE.SQL:PooledQueryWrite( 2, ([[INSERT INTO gamemode_taxes (`key`, value) VALUES ('%s', %1.2f) ON DUPLICATE KEY UPDATE value=%1.2f]]):format(
k,
v.Value,
v.Value
), callback )
end
end
function GM.Econ:LoadSavedTaxData()
GAMEMODE.SQL:QueryReadOnly( [[SELECT * FROM gamemode_taxes]], function( tblData, q )
for k, row in pairs( tblData ) do
GAMEMODE.Econ:SetTaxRate( row.key, row.value, true )
end
GAMEMODE.Net:SendTaxFullUpdate()
end )
end
-- Bills
-- ----------------------------------------------------------------
--intTimeToPay = 0 for a bill that never expires
GM.Econ.m_tblAutoBills = (GAMEMODE or GM).Econ.m_tblAutoBills or {}
function GM.Econ:RegisterAutoBill( strUID, intDuration, funcBillPlayer )
self.m_tblAutoBills[strUID] = { Length = intDuration, BillPlayer = funcBillPlayer }
end
function GM.Econ:LoadAutoBills()
self:RegisterAutoBill( "bill_cars", GM.Config.CarInsuranceTaxInterval, function( pPlayer )
if not pPlayer:GetCharacter() then return end
local bill = false
for k, v in pairs( pPlayer:GetCharacter().Vehicles ) do
local data = GAMEMODE.Cars:GetCarByUID( k )
if not data then continue end
local billCost = math.ceil( GAMEMODE.CarShop:GetRepairCost(data.Price, 0, 100) *GAMEMODE.Config.CarInsuranceBillScale )
self:IssuePlayerBill(
pPlayer,
"car_insurance",
"Vehicle Insurance: ".. data.Name,
billCost,
GAMEMODE.Config.CarInsuranceBillTime,
{ Shared = {CarID = k} }
)
bill = true
end
if bill then pPlayer:AddNote( "Você precisa pagar seu IPVA no banco." ) end
end )
self:RegisterAutoBill( "bill_property", GM.Config.PropertyTaxInterval, function( pPlayer )
if not pPlayer:GetCharacter() then return end
local bill = false
for k, v in pairs( GAMEMODE.Property:GetPropertiesByOwner(pPlayer) ) do
local data = GAMEMODE.Property.m_tblRegister[GAMEMODE.Property:GetPropertyByName(v).ID]
if not data or not data.Price or not data.Cat then continue end
local billCost = GAMEMODE.Econ:ApplyTaxToSum( "prop_".. data.Cat, data.Price *GAMEMODE.Config.PropertyTaxScale )
self:IssuePlayerBill(
pPlayer,
"Propriedade",
"Taxa: ".. data.Name,
billCost,
0,
{ Shared = {PropertyID = v} }
)
bill = true
end
if bill then pPlayer:AddNote( "Pague a taxa de aluguel no banco." ) end
end )
end
function GM.Econ:IssuePlayerBill( pPlayer, strBillID, strBillName, intBillCost, intTimeToPay, tblMetaData )
local saveTable = GAMEMODE.Char:GetCurrentSaveTable( pPlayer )
if not saveTable then return false end
saveTable.Bills = saveTable.Bills or {}
local bill = {
Type = strBillID,
Name = strBillName,
Cost = intBillCost,
LifeTime = intTimeToPay,
IssueTime = os.time(),
MetaData = tblMetaData
}
local billUID = table.insert( saveTable.Bills, bill )
GAMEMODE.SQL:MarkDiffDirty( pPlayer, "data_store", "Bills" )
GAMEMODE.Net:SendPlayerBills( pPlayer )
return billUID
end
function GM.Econ:PlayerPayBill( pPlayer, intBillIDX )
--intBillIDX is the key of the bill being paid in the save table
local saveTable = GAMEMODE.Char:GetCurrentSaveTable( pPlayer )
if not saveTable or not saveTable.Bills then return false end
local billData = saveTable.Bills[intBillIDX]
if not billData then return false end
local typeData = self:GetBillData( billData.Type )
if not typeData then return false end
if not pPlayer:CanAfford( billData.Cost ) then
pPlayer:AddNote( "Você não pode pagar essa conta!" )
return false
end
pPlayer:TakeMoney( billData.Cost )
typeData.OnPay( pPlayer, billData, billData.MetaData, intBillIDX )
table.remove( saveTable.Bills, intBillIDX )
GAMEMODE.SQL:MarkDiffDirty( pPlayer, "data_store", "Bills" )
GAMEMODE.Net:SendPlayerBills( pPlayer )
pPlayer:AddNote( "Você pagou uma conta de R$".. string.Comma(billData.Cost).. "!" )
return true
end
function GM.Econ:PlayerPayAllBills( pPlayer )
local saveTable = GAMEMODE.Char:GetCurrentSaveTable( pPlayer )
if not saveTable or not saveTable.Bills then return false end
local total = 0
for k, v in pairs( saveTable.Bills ) do
total = total +v.Cost
end
if total <= 0 then return end
if not pPlayer:CanAfford( total ) then
pPlayer:AddNote( "Você não consegue pagar por isso!" )
return false
end
pPlayer:TakeMoney( total )
for k, v in pairs( saveTable.Bills ) do
if not self:GetBillData( v.Type ) then continue end
self:GetBillData( v.Type ).OnPay( pPlayer, v, v.MetaData, k )
end
saveTable.Bills = {}
GAMEMODE.SQL:MarkDiffDirty( pPlayer, "data_store", "Bills" )
GAMEMODE.Net:SendPlayerBills( pPlayer )
pPlayer:AddNote( "Você pagou tudo por R$".. string.Comma(total).. "!" )
return true
end
function GM.Econ:OnPlayerBillExpired( pPlayer, intBillIDX )
local saveTable = GAMEMODE.Char:GetCurrentSaveTable( pPlayer )
if not saveTable or not saveTable.Bills then return false end
local billData = saveTable.Bills[intBillIDX]
if not billData then return false end
local typeData = self:GetBillData( billData.Type )
if not typeData then return false end
typeData.OnDefault( pPlayer, billData, billData.MetaData, intBillIDX )
table.remove( saveTable.Bills, intBillIDX )
GAMEMODE.SQL:MarkDiffDirty( pPlayer, "data_store", "Bills" )
GAMEMODE.Net:SendPlayerBills( pPlayer )
return true
end
function GM.Econ:TickPlayerBills( pPlayer )
local saveTable = GAMEMODE.Char:GetCurrentSaveTable( pPlayer )
if not saveTable or not saveTable.Bills then return end
local time = os.time()
for uid, billData in pairs( saveTable.Bills ) do
local data = self.m_tblBills[billData.Type]
if not data then continue end
if data.Update then
if time > (billData.LastUpdate or 0) then
billData.LastUpdate = time +5
data.Update( pPlayer, billData, billData.MetaData, uid )
end
end
if billData.LifeTime <= 0 then continue end --This bill never expires until paid
if time > (billData.IssueTime +billData.LifeTime) then --This bill has passed the expiry point!
self:OnPlayerBillExpired( pPlayer, uid )
end
end
end
function GM.Econ:TickAutoBills( pPlayer )
local saveTable = GAMEMODE.Char:GetCurrentSaveTable( pPlayer )
if not saveTable then return end
local dirty = not saveTable.AutoBills
saveTable.AutoBills = saveTable.AutoBills or {}
local playTime = GAMEMODE.Jobs:GetTotalSavedPlayTime( pPlayer )
for billID, v in pairs( self.m_tblAutoBills ) do
if not saveTable.AutoBills[billID] then
saveTable.AutoBills[billID] = playTime
dirty = true
continue
end
if playTime >= saveTable.AutoBills[billID] +v.Length then
saveTable.AutoBills[billID] = playTime
dirty = true
v.BillPlayer( pPlayer )
end
end
if dirty then
GAMEMODE.SQL:MarkDiffDirty( pPlayer, "data_store", "AutoBills" )
end
end
hook.Add( "GamemodeCanPlayerBuyProperty", "Bills_UnpiadBlockPurchase", function( pPlayer, strPropName )
if GAMEMODE.Econ:PlayerHasUnpaidBillsOfType( pPlayer, "property" ) then
pPlayer:AddNote( "Você tem contas a pagar no banco!" )
pPlayer:AddNote( "Você precisa pagar suas contas no banco antes de fazer isso." )
return false
end
end )
hook.Add( "GamemodeInitSQLTables", "DefineLoadEconData", function()
GAMEMODE.SQL:PooledQueryWrite( 1, [[CREATE TABLE IF NOT EXISTS `gamemode_taxes` (
`key` VARCHAR(255) NOT NULL,
`value` FLOAT NULL,
UNIQUE INDEX `key` (`key`)
) ENGINE=InnoDB;]], function()
GAMEMODE.Econ:LoadSavedTaxData()
end )
end )
|
-------------------------------------------------------------------------------
-- Module Declaration
--
local plugin = BigWigs:NewPlugin("Super Emphasize")
if not plugin then return end
-------------------------------------------------------------------------------
-- Locals
--
local media = LibStub("LibSharedMedia-3.0")
local FONT = media.MediaType and media.MediaType.FONT or "font"
local L = BigWigsAPI:GetLocale("BigWigs: Plugins")
plugin.displayName = L.superEmphasize
local PlaySoundFile = PlaySoundFile
local temporaryEmphasizes = {}
-------------------------------------------------------------------------------
-- Options
--
local function voiceList() -- select values
return BigWigsAPI:GetCountdownList()
end
local voiceMap = {
deDE = "Deutsch: Heroes of the Storm",
esES = "Español: Heroes of the Storm",
esMX = "Español: Heroes of the Storm",
frFR = "Français: Heroes of the Storm",
ruRU = "Русский: Heroes of the Storm",
koKR = "한국어: Heroes of the Storm",
itIT = "Italiano: Heroes of the Storm",
ptBR = "Português: Heroes of the Storm",
zhCN = "简体中文: Heroes of the Storm",
zhTW = "繁體中文: Heroes of the Storm",
}
plugin.defaultDB = {
upper = true,
countdown = true,
fontName = plugin:GetDefaultFont(),
outline = "THICKOUTLINE",
fontSize = 48,
fontColor = { r = 1, g = 0, b = 0 },
voice = voiceMap[GetLocale()] or "English: Amy",
countdownTime = 5,
Countdown = {},
}
local function createOptions()
local get = function(info) return plugin.db.profile[info[#info]] end
local set = function(info, value)
plugin.db.profile[info[#info]] = value
end
local mModule = BigWigs:GetPlugin("Messages", true)
if mModule then
local tempSet = function(info, value)
set(info, value)
mModule.updateProfile()
end
mModule.pluginOptions.args.emphasize = {
type = "group",
name = L.emphasizedMessages,
order = 1.5,
get = get,
set = set,
args = {
countdownTime = {
name = L.countdownAt,
type = "range", min = 5, max = 10, step = 1,
order = 0.5,
},
countdown = {
type = "toggle",
name = L.textCountdown,
desc = L.textCountdownDesc,
order = 0.6,
},
fontColor = {
type = "color",
name = L.countdownColor,
get = function(info)
return plugin.db.profile[info[#info]].r, plugin.db.profile[info[#info]].g, plugin.db.profile[info[#info]].b
end,
set = function(info, r, g, b)
plugin.db.profile[info[#info]].r, plugin.db.profile[info[#info]].g, plugin.db.profile[info[#info]].b = r, g, b
mModule.updateProfile()
end,
order = 0.7,
disabled = function() return not plugin.db.profile.countdown end,
},
font = {
type = "select",
name = L.font,
order = 1,
values = media:List(FONT),
itemControl = "DDI-Font",
get = function()
for i, v in next, media:List(FONT) do
if v == plugin.db.profile.fontName then return i end
end
end,
set = function(_, value)
local list = media:List(FONT)
plugin.db.profile.fontName = list[value]
mModule.updateProfile()
end,
},
outline = {
type = "select",
name = L.outline,
order = 2,
values = {
NONE = L.none,
OUTLINE = L.thin,
THICKOUTLINE = L.thick,
},
set = tempSet,
},
fontSize = {
type = "range",
name = L.fontSize,
order = 3,
softMax = 72, max = 200, min = 1, step = 1,
set = tempSet,
},
upper = {
type = "toggle",
name = L.uppercase,
desc = L.uppercaseDesc,
order = 4,
},
monochrome = {
type = "toggle",
name = L.monochrome,
desc = L.monochromeDesc,
order = 5,
set = tempSet,
},
},
}
end
local sModule = BigWigs:GetPlugin("Sounds", true)
if sModule then
-- main options
sModule.pluginOptions.args.separator1 = {
name = "",
type = "description",
order = 4,
}
sModule.pluginOptions.args.voice = {
name = L.countdownVoice,
type = "select",
values = voiceList,
get = get,
set = set,
order = 5,
width = "full",
}
sModule.pluginOptions.args.voiceTest = {
name = L.countdownTest,
type = "execute",
handler = plugin,
func = "TestEmphasize",
order = 6,
}
-- ability options
sModule.soundOptions.args.separator1 = {
name = "",
type = "description",
order = 3,
}
sModule.soundOptions.args.countdown = {
name = "Countdown",
type = "select",
values = voiceList,
get = function(info)
local name, key = unpack(info.arg)
return plugin.db.profile.Countdown[name] and plugin.db.profile.Countdown[name][key] or plugin.db.profile.voice
end,
set = function(info, value)
local name, key = unpack(info.arg)
if value ~= plugin.db.profile.voice then
if not plugin.db.profile.Countdown[name] then plugin.db.profile.Countdown[name] = {} end
plugin.db.profile.Countdown[name][key] = value
else -- clean up
if plugin.db.profile.Countdown[name] then
plugin.db.profile.Countdown[name][key] = nil
end
if not next(plugin.db.profile.Countdown[name]) then
plugin.db.profile.Countdown[name] = nil
end
end
end,
order = 4,
width = "full",
}
end
end
local function updateProfile()
-- Reset invalid voice selections
if not BigWigsAPI:HasCountdown(plugin.db.profile.voice) then
plugin.db.profile.voice = voiceMap[GetLocale()] or "English: Amy"
end
for boss, tbl in next, plugin.db.profile.Countdown do
for ability, chosenVoice in next, tbl do
if not BigWigsAPI:HasCountdown(chosenVoice) then
plugin.db.profile.Countdown[boss][ability] = nil
end
end
end
end
-------------------------------------------------------------------------------
-- Initialization
--
function plugin:OnRegister()
BigWigsAPI:RegisterCountdown(L.none, { false, false, false, false, false })
BigWigsAPI:RegisterCountdown("English: Amy", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\5.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\6.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\7.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\8.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\9.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Amy\\10.ogg",
})
BigWigsAPI:RegisterCountdown("English: David", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\5.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\6.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\7.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\8.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\9.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\David\\10.ogg",
})
BigWigsAPI:RegisterCountdown("English: Jim", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\5.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\6.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\7.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\8.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\9.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Jim\\10.ogg",
})
BigWigsAPI:RegisterCountdown("English: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\enUS\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\enUS\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\enUS\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\enUS\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\enUS\\5.ogg",
})
BigWigsAPI:RegisterCountdown("Deutsch: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\deDE\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\deDE\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\deDE\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\deDE\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\deDE\\5.ogg",
})
BigWigsAPI:RegisterCountdown("Español: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\esES\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\esES\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\esES\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\esES\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\esES\\5.ogg",
})
BigWigsAPI:RegisterCountdown("Français: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\frFR\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\frFR\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\frFR\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\frFR\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\frFR\\5.ogg",
})
BigWigsAPI:RegisterCountdown("Русский: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ruRU\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ruRU\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ruRU\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ruRU\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ruRU\\5.ogg",
})
BigWigsAPI:RegisterCountdown("한국어: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\koKR\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\koKR\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\koKR\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\koKR\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\koKR\\5.ogg",
})
BigWigsAPI:RegisterCountdown("Italiano: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\itIT\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\itIT\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\itIT\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\itIT\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\itIT\\5.ogg",
})
BigWigsAPI:RegisterCountdown("Português: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ptBR\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ptBR\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ptBR\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ptBR\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\ptBR\\5.ogg",
})
BigWigsAPI:RegisterCountdown("简体中文: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhCN\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhCN\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhCN\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhCN\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhCN\\5.ogg",
})
BigWigsAPI:RegisterCountdown("繁體中文: Heroes of the Storm", {
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhTW\\1.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhTW\\2.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhTW\\3.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhTW\\4.ogg",
"Interface\\AddOns\\BigWigs\\Media\\Sounds\\Heroes\\zhTW\\5.ogg",
})
end
function plugin:OnPluginEnable()
self:RegisterMessage("BigWigs_StartEmphasize")
self:RegisterMessage("BigWigs_StopEmphasize")
self:RegisterMessage("BigWigs_TempSuperEmphasize")
self:RegisterMessage("BigWigs_PlayCountdownNumber")
self:RegisterMessage("BigWigs_ProfileUpdate", updateProfile)
updateProfile()
createOptions()
end
do
local timers = {}
local wipe = wipe
local function printEmph(num, name, key, text)
local voice = plugin.db.profile.Countdown[name] and plugin.db.profile.Countdown[name][key] or plugin.db.profile.voice
local sound = BigWigsAPI:GetCountdownSound(voice, num)
if sound then
PlaySoundFile(sound, "Master")
end
if plugin.db.profile.countdown then
plugin:SendMessage("BigWigs_EmphasizedCountdownMessage", num)
end
if text and timers[text] then wipe(timers[text]) end
end
function plugin:BigWigs_StartEmphasize(_, module, key, text, time)
if (key and temporaryEmphasizes[key]) or (module and module:CheckOption(key, "COUNTDOWN")) then
self:BigWigs_StopEmphasize(nil, module, text)
if time > 1.3 then
if not timers[text] then timers[text] = {} end
timers[text][1] = module:ScheduleTimer(printEmph, time-1.3, 1, module.name, key, text)
for i = 2, self.db.profile.countdownTime do
local t = i + 0.3
if time <= t then break end
timers[text][i] = module:ScheduleTimer(printEmph, time-t, i, module.name, key)
end
end
end
end
function plugin:BigWigs_StopEmphasize(_, module, text)
if text and timers[text] and #timers[text] > 0 then
for i = 1, #timers[text] do
module:CancelTimer(timers[text][i])
end
wipe(timers[text])
end
end
function plugin:TestEmphasize()
local text = "test"
self:BigWigs_StopEmphasize(nil, self, text)
if not timers[text] then timers[text] = {} end
local num = self.db.profile.countdownTime
for i = 1, num do
timers[text][i] = self:ScheduleTimer(printEmph, num-i, i, nil, nil, i == 1 and text)
end
end
end
function plugin:IsSuperEmphasized(module, key)
if not module or not key then return end
if temporaryEmphasizes[key] and temporaryEmphasizes[key] > GetTime() then return true else temporaryEmphasizes[key] = nil end
if module == BigWigs then -- test bars
return math.random(1,3) == 2
end
return module.CheckOption and module:CheckOption(key, "EMPHASIZE")
end
function plugin:BigWigs_TempSuperEmphasize(_, module, key, text, time)
if not module or not key or text == "" then return end
temporaryEmphasizes[key] = GetTime() + time
self:BigWigs_StartEmphasize(nil, module, key, text, time)
end
function plugin:BigWigs_PlayCountdownNumber(_, _, num, voice)
local sound = BigWigsAPI:GetCountdownSound(voice or self.db.profile.voice, num)
if sound then
PlaySoundFile(sound, "Master")
end
end
|
local ffi = require'ffi'
if ffi.os == 'Windows' then
return require'jit.vmdef_windows'
elseif ffi.os == 'Linux' then
return require'jit.vmdef_linux'
elseif ffi.os == 'OSX' then
return require'jit.vmdef_osx'
else
error('jit.vmdef_'..ffi.os:lower()..' missing')
end
|
modifier_spectre_ultimate = class({})
function modifier_spectre_ultimate:OnCreated(params)
self.bonus_damage = self:GetAbility():GetSpecialValueFor("bonus_damage")
if IsServer() then
if self:GetCaster() == self:GetParent() then
self:GetParent():AddNewModifier(self:GetParent(), self:GetAbility(), 'modifier_spectre_special_attack_buff', {})
self:SetStackCount(1)
else
self.damage_table = {
victim = self:GetParent(),
attacker = self:GetCaster(),
damage = self:GetAbility():GetSpecialValueFor("ability_damage"),
damage_type = DAMAGE_TYPE_PURE
}
self:SetStackCount(2)
end
end
end
function modifier_spectre_ultimate:OnDestroy()
if IsServer() then
if self:IsDebuff() then
if self:GetStackCount() == 2 then
EmitSoundOn("Hero_Spectre.DaggerImpact", self:GetParent())
self:GetParent():AddNewModifier(self:GetCaster(), self:GetAbility(), "modifier_spectre_special_attack_debuff", {
duration = 5.0
})
self:GetParent():AddNewModifier(self:GetCaster(), self:GetAbility(), "modifier_generic_fading_slow", {
duration = 5.0,
max_slow_pct = 50
})
if IsServer() then
ApplyDamage(self.damage_table)
end
end
else
self:GetParent():RemoveModifierByName('modifier_spectre_special_attack_buff')
end
end
end
function modifier_spectre_ultimate:IsDebuff()
if IsServer() then
return self:GetStackCount() == 2 and not CustomEntitiesLegacy:Allies(self:GetCaster(), self:GetParent())
end
end
function modifier_spectre_ultimate:DeclareFunctions()
return {
MODIFIER_PROPERTY_BONUS_VISION_PERCENTAGE,
MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE,
}
end
function modifier_spectre_ultimate:GetBonusVisionPercentage()
if self:IsDebuff() then
return -80
end
return 0
end
function modifier_spectre_ultimate:GetModifierPreAttack_BonusDamage()
if not self:IsDebuff() then
return self.bonus_damage
end
end
|
----
-- Teleport submenu.
--
-- Extends `menu.Submenu`.
--
-- **Source Code:** [https://github.com/dstmodders/mod-dev-tools](https://github.com/dstmodders/mod-dev-tools)
--
-- @classmod submenus.TeleportSubmenu
-- @see menu.Submenu
--
-- @author [Depressed DST Modders](https://github.com/dstmodders)
-- @copyright 2020
-- @license MIT
-- @release 0.8.0-alpha
----
local SDK = require "devtools/sdk/sdk/sdk"
local Submenu = require "devtools/menu/submenu"
--- Lifecycle
-- @section lifecycle
--- Constructor.
-- @function _ctor
-- @tparam DevTools devtools
-- @tparam Widget root
-- @usage local teleportsubmenu = TeleportSubmenu(devtools, root)
local TeleportSubmenu = Class(Submenu, function(self, devtools, root)
Submenu._ctor(
self,
devtools,
root,
"Teleport",
"TeleportSubmenu",
MOD_DEV_TOOLS.DATA_SIDEBAR.SELECTED
)
-- options
if self.world and self.player and self.screen and SDK.Player.IsAdmin() then
self:AddSelectedPlayerLabelPrefix(devtools, self.player)
self:AddOptions()
self:AddToRoot()
end
end)
--- General
-- @section general
--- Adds gather players option.
function TeleportSubmenu:AddGatherPlayersOption()
self:AddActionOption({
label = "Gather Players",
on_accept_fn = function()
SDK.Remote.Player.GatherPlayers()
self:UpdateScreen()
end,
})
end
--- Adds go next option.
-- @tparam table|string label
-- @tparam string prefab
function TeleportSubmenu:AddGoNextOption(label, prefab)
self:AddActionOption({
label = label,
on_accept_fn = function()
SDK.Remote.Player.GoNext(type(prefab) == "table"
and prefab[math.random(#prefab)]
or prefab)
self:UpdateScreen()
end,
})
end
--- Adds teleport options.
function TeleportSubmenu:AddTeleportOptions()
if not SDK.World.IsCave() then
local livingtree = IsSpecialEventActive(SPECIAL_EVENTS.HALLOWED_NIGHTS)
and "livingtree_halloween"
or "livingtree"
self:AddGoNextOption("Antlion Nest", "antlion_spawner")
self:AddGoNextOption("Beefalo", "beefalo")
self:AddGoNextOption("Catcoon", "catcoon")
self:AddGoNextOption("Cave Entrance", "cave_entrance")
self:AddGoNextOption("Deer", "deer")
self:AddGoNextOption("Desert Oasis", "oasislake")
self:AddGoNextOption("Eyebone (Chester)", "chester_eyebone")
self:AddGoNextOption("Glommer Statue", "statueglommer")
self:AddGoNextOption("Gravestone", "gravestone")
self:AddGoNextOption("Leaky Shack", "mermhouse")
self:AddGoNextOption("Mandrake", "mandrake_planted")
self:AddGoNextOption("Moon Stone", "moonbase")
self:AddGoNextOption("Pig Head", "pighead")
self:AddGoNextOption("Pig House", "pighouse")
self:AddGoNextOption("Pig King", "pigking")
self:AddGoNextOption("Pond", "pond")
self:AddGoNextOption("Spawn Portal", "multiplayer_portal")
self:AddGoNextOption("Spider Den", "spiderden")
self:AddGoNextOption("Stagehand", "stagehand")
self:AddGoNextOption("Totally Normal Tree", livingtree)
self:AddGoNextOption("Touch Stone", "resurrectionstone")
self:AddGoNextOption("Walrus Camp", "walrus_camp")
self:AddGoNextOption("Worm Hole", "wormhole")
self:AddDividerOption()
self:AddGoNextOption("Bearger", "bearger")
self:AddGoNextOption("Deerclops", "deerclops")
self:AddGoNextOption("Dragonfly", "dragonfly")
self:AddGoNextOption("Gigantic Beehive", "beequeenhive")
self:AddGoNextOption("Klaus Sack", "klaus_sack")
self:AddGoNextOption("Malbatross", "malbatross")
self:AddDividerOption()
self:AddGoNextOption("Marble Sculpture (Bishop Body)", "sculpture_bishopbody")
self:AddGoNextOption("Marble Sculpture (Knight Body)", "sculpture_knightbody")
self:AddGoNextOption("Marble Sculpture (Rook Body)", "sculpture_rookbody")
self:AddGoNextOption("Suspicious Marble (Bishop Head)", "sculpture_bishophead")
self:AddGoNextOption("Suspicious Marble (Knight Head)", "sculpture_knighthead")
self:AddGoNextOption("Suspicious Marble (Rook Nose)", "sculpture_rooknose")
self:AddDividerOption()
self:AddGoNextOption("Hot Spring", "hotspring")
self:AddGoNextOption("Inviting Formation (Base)", "moon_altar_rock_glass")
self:AddGoNextOption("Inviting Formation (Idol)", "moon_altar_rock_idol")
self:AddGoNextOption("Inviting Formation (Orb)", "moon_altar_rock_seed")
self:AddGoNextOption("Stone Fruit Bush", "rock_avocado_bush")
else
local statues = {
"ruins_statue_mage",
"ruins_statue_head",
}
self:AddGoNextOption("Ancient Pseudoscience Station (Broken)", "ancient_altar_broken")
self:AddGoNextOption("Ancient Pseudoscience Station", "ancient_altar")
self:AddGoNextOption("Ancient Statue", statues)
self:AddGoNextOption("Bat Cave", "batcave")
self:AddGoNextOption("Big Tentacle", "tentacle_pillar")
self:AddGoNextOption("Broken Clockworks", "chessjunk_ruinsrespawner_inst")
self:AddGoNextOption("Cave Exit", "cave_exit")
self:AddGoNextOption("Cave Hole", "cave_hole")
self:AddGoNextOption("Gravestone", "gravestone")
self:AddGoNextOption("Light Flower", "flower_cave_triple")
self:AddGoNextOption("Ornate Chest", "pandoraschest")
self:AddGoNextOption("Pond (Cave)", "pond_cave")
self:AddGoNextOption("Pond", "pond")
self:AddGoNextOption("Rock Lobster", "rocky")
self:AddGoNextOption("Slurper", "slurper")
self:AddGoNextOption("Slurtle Mound", "slurtlehole")
self:AddGoNextOption("Spider Den", "spiderden")
self:AddGoNextOption("Splumonkey Pod", "monkeybarrel")
self:AddGoNextOption("Star-sky (Hutch)", "hutch_fishbowl")
self:AddGoNextOption("Touch Stone", "resurrectionstone")
self:AddDividerOption()
self:AddGoNextOption("Ancient Gateway", "atrium_gate")
self:AddGoNextOption("Ancient Guardian", "minotaur")
self:AddGoNextOption("Toadstool Cap", "toadstool_cap")
end
end
--- Adds options.
function TeleportSubmenu:AddOptions()
self:AddGatherPlayersOption()
self:AddDividerOption()
self:AddTeleportOptions()
end
return TeleportSubmenu
|
--
-- bluetooth.lua
-- bluetooth daemon
--
-- Dependencies:
-- bluez
-- bluez-utils
--
-- Signals:
-- daemon::bluetooth::status
-- active (boolean)
--
local awful = require("awful")
local helpers = require("helpers")
-- ========================================
-- Config
-- ========================================
-- script to check bluetooth status
local check_script = "bluetoothctl list"
-- script to monitor bluetooth status
local monitor_script = "bluetoothctl --monitor list"
-- ========================================
-- Logic
-- ========================================
-- Main script
local check_bluetooth = function (stdout)
local active = stdout:match("Controller") ~= nil
awesome.emit_signal("daemon::bluetooth::status", active)
end
-- ========================================
-- Initialization
-- ========================================
-- Run once to initialize widgets
awful.spawn.easy_async_with_shell(check_script, function (stdout)
check_bluetooth(stdout)
end)
-- Start monitoring process
helpers.start_monitor(monitor_script, { stdout = check_bluetooth })
|
dofile("common.inc");
Button = {};
Button[0] = makePoint(45, 60); --NW
Button[1] = makePoint(75, 62); --NE
Button[2] = makePoint(45, 87); --SW
Button[3] = makePoint(75, 91); --SE
Button[4] = makePoint(59, 51); --N
Button[5] = makePoint(60, 98); --S
Button[6] = makePoint(84, 74); --E
Button[7] = makePoint(37, 75); --W
BuildButton = makePoint(31, 135);
dropdown_values = {"Shift Key", "Ctrl Key", "Alt Key", "Mouse Wheel Click"};
dropdown_cur_value = 1;
waterImage = "WaterThese.png";
harvestImage = "HarvestThese.png";
thisIs = "This is";
water_req = 1; -- How many times to click the Water button per onion seed. Most are 1, some variations might need 2 per click.
useWinManager = true;
plantCloser = false;
autoWater = true;
pauseAfterHarvest = true;
delayAfterHarvestPerPlant = 2000;
function doit()
askForWindow("This macro does nothing except plant veggie seeds.\n\nIt will assist you by watering and harvesting your pinned windows when you click the trigger key. You must manually pin (or use Windows Manager) them yourself!\n\nBe in F8F8, zoomed in. Must have 'Plant all crops where you stand' turned OFF! Probably want to have chat minimized as well. Right click pins/unpins should be checked to properly close old windows\n\nPress Shift on ATITD window to continue.");
wmText = "Tap control over planted veggies to open/pin.";
chooseMethod();
config();
while 1 do
if autoWater then
drawWater();
end
main();
if useWinManager then
windowManager("Plant Setup", wmText, false, true, 215, 288);
firstWater = 1;
else
firstWater = 0;
end
waterThese();
if pauseAfterHarvest then
waitForShift();
else
refreshWindows();
sleepWithStatus(delayAfterHarvestPerPlant*#tops, "Harvesting vegetables ...");
end
closeAllWindows(); -- This won't close the plant window, only the veggy windows
end
end
function waterThese()
local was_shifted = lsShiftHeld();
if (dropdown_cur_value == 1) then
was_shifted = lsShiftHeld();
key = "tap Shift";
elseif (dropdown_cur_value == 2) then
was_shifted = lsControlHeld();
key = "tap Ctrl";
elseif (dropdown_cur_value == 3) then
was_shifted = lsAltHeld();
key = "tap Alt";
elseif (dropdown_cur_value == 4) then
was_shifted = lsMouseIsDown(2); --Button 3, which is middle mouse or mouse wheel
key = "click MWheel ";
end
local is_done = false;
while not is_done do
sleepWithStatus(100, key .. " to water/harvest pinned plants");
local is_shifted = lsShiftHeld();
if (dropdown_cur_value == 1) then
is_shifted = lsShiftHeld();
elseif (dropdown_cur_value == 2) then
is_shifted = lsControlHeld();
elseif (dropdown_cur_value == 3) then
is_shifted = lsAltHeld();
elseif (dropdown_cur_value == 4) then
is_shifted = lsMouseIsDown(2); --Button 3, which is middle mouse or mouse wheel
end
if (is_shifted and not was_shifted) or (firstWater == 1) then
firstWater = 0;
refreshWindows();
lsSleep(200);
srReadScreen();
local waters = findAllImages(waterImage);
local harvest = findAllImages(harvestImage);
if #harvest >= 1 then
for i=#harvest,1,-1 do
safeClick(harvest[i][0] + 5, harvest[i][1]);
lsSleep(click_delay);
end
break; -- Break the loop after Harvest found and clicked
else
for i=#waters,1,-1 do
for water=1,water_req do
safeClick(waters[i][0] + 5, waters[i][1] + 5);
lsSleep(click_delay);
end
end
end
end
was_shifted = is_shifted;
end
end
function config()
clickList = {};
local was_shifted = lsShiftHeld();
if (dropdown_cur_value == 1) then
was_shifted = lsShiftHeld();
key = "tap Shift";
elseif (dropdown_cur_value == 2) then
was_shifted = lsControlHeld();
key = "tap Ctrl";
elseif (dropdown_cur_value == 3) then
was_shifted = lsAltHeld();
key = "tap Alt";
elseif (dropdown_cur_value == 4) then
was_shifted = lsMouseIsDown(2); --Button 3, which is middle mouse or mouse wheel
key = "click MWheel ";
end
local is_done = false;
local mx = 0;
local my = 0;
local z = 0;
while not is_done do
sleepWithStatus(100, key .. " over plant window to record location and start planting");
mx, my = srMousePos();
local is_shifted = lsShiftHeld();
if (dropdown_cur_value == 1) then
is_shifted = lsShiftHeld();
elseif (dropdown_cur_value == 2) then
is_shifted = lsControlHeld();
elseif (dropdown_cur_value == 3) then
is_shifted = lsAltHeld();
elseif (dropdown_cur_value == 4) then
is_shifted = lsMouseIsDown(2); --Button 3, which is middle mouse or mouse wheel
end
if is_shifted and not was_shifted then
clickList[#clickList + 1] = {mx, my};
break;
end
was_shifted = is_shifted;
end
end
function waitForShift()
local was_shifted = lsShiftHeld();
if (dropdown_cur_value == 1) then
was_shifted = lsShiftHeld();
key = "tap Shift";
elseif (dropdown_cur_value == 2) then
was_shifted = lsControlHeld();
key = "tap Ctrl";
elseif (dropdown_cur_value == 3) then
was_shifted = lsAltHeld();
key = "tap Alt";
elseif (dropdown_cur_value == 4) then
was_shifted = lsMouseIsDown(2); --Button 3, which is middle mouse or mouse wheel
key = "click MWheel ";
end
local is_done = false;
while not is_done do
sleepWithStatus(100, "When done harvesting " .. key .. " to unpin old veggie windows.\n\nIf you need a break, do so now before you " .. key .. "\n\nIf you're tired, now is a good time to Ctrl+Shift to quit ...");
local is_shifted = lsShiftHeld();
if (dropdown_cur_value == 1) then
is_shifted = lsShiftHeld();
elseif (dropdown_cur_value == 2) then
is_shifted = lsControlHeld();
elseif (dropdown_cur_value == 3) then
is_shifted = lsAltHeld();
elseif (dropdown_cur_value == 4) then
is_shifted = lsMouseIsDown(2); --Button 3, which is middle mouse or mouse wheel
end
if is_shifted and not was_shifted then
break;
end
was_shifted = is_shifted;
end
end
function main()
srReadScreen();
lsSleep(click_delay);
for i = 0, count-1 do
for i=1,#clickList do
checkBreak();
safeClick(clickList[i][1], clickList[i][2]);
lsSleep(click_delay);
end
safeClick(Button[i][0], Button[i][1]);
lsSleep(click_delay);
if not plantCloser then
safeClick(Button[i][0], Button[i][1]);
lsSleep(click_delay);
end
safeClick(BuildButton[0], BuildButton[1]);
lsSleep(click_delay);
end
end
function chooseMethod()
local is_done = false;
count = 1;
while not is_done do
checkBreak();
local y = 10;
lsPrint(5, y, 0, 0.7, 0.7, 0xffffffff,
"Key or Mouse to Trigger Watering/Harvest:");
y = y + 35;
lsSetCamera(0,0,lsScreenX*1.3,lsScreenY*1.3);
dropdown_cur_value = lsDropdown("ArrangerDropDown", 10, y, 0, 200, dropdown_cur_value, dropdown_values);
lsSetCamera(0,0,lsScreenX*1.0,lsScreenY*1.0);
y = y + 30;
lsPrint(10, y, 0, 0.8, 0.8, 0xffffffff, "How many plants (1-8)?");
is_done, count = lsEditBox("count", 210, y, 0, 50, 30, 0.8, 0.8, 0x000000ff, 6);
count = tonumber(count);
if not count then
is_done = false;
lsPrint(10, y+22, 10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
count = 6;
end
y = y + 40;
lsPrint(10, y, 0, 0.8, 0.8, 0xffffffff, "Water per plant:");
is_done, water_req = lsEditBox("water_req", 210, y, 0, 50, 30, 0.8, 0.8, 0x000000ff, 3);
water_req = tonumber(water_req);
if not water_req then
is_done = false;
lsPrint(10, y+22, 10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
water_req = 3;
end
y = y + 40;
lsPrint(10, y, 0, 0.8, 0.8, 0xffffffff, "Click Delay (ms):");
is_done, click_delay = lsEditBox("click_delay", 210, y, 0, 50, 30, 0.8, 0.8, 0x000000ff, 50);
click_delay = tonumber(click_delay);
if not click_delay then
is_done = false;
lsPrint(10, y+22, 10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
click_delay = 50;
end
y = y + 120;
lsSetCamera(0,0,lsScreenX*1.4,lsScreenY*1.4);
plantCloser = lsCheckBox(15, y, z, 0xffffffff, " Plant Veggies closer together", plantCloser);
y = y + 25;
useWinManager = lsCheckBox(15, y, z, 0xffffffff, " Use Windows Manager to pin", useWinManager);
y = y + 25;
autoWater = lsCheckBox(15, y, z, 0xffffffff, " Auto gather water", autoWater);
y = y + 25;
pauseAfterHarvest = lsCheckBox(15, y, z, 0xffffffff, " Pause/Wait for Hotkey after Harvest", pauseAfterHarvest);
lsSetCamera(0,0,lsScreenX*1.0,lsScreenY*1.0);
y = y - 75;
lsPrint(10, y, 0, 0.6, 0.6, 0xffffffff, "Click Delay: Pause between clicking each plant");
y = y + 15;
lsPrint(10, y, 0, 0.6, 0.6, 0xffffffff, "Plant closer: Not for large veggies, like cabbage");
if lsButtonText(10, lsScreenY - 30, 0, 100, 0xFFFFFFff, "Next") then
is_done = 1;
end
if lsButtonText(lsScreenX - 110, lsScreenY - 30, 0, 100, 0xFFFFFFff,
"End script") then
error(quitMessage);
end
lsDoFrame();
lsSleep(50);
end
return count;
end
function closeAllWindows(x, y, width, height)
if not x then
x = 0;
end
if not y then
y = 0;
end
if not width then
width = srGetWindowSize()[0];
end
if not height then
height = srGetWindowSize()[1];
end
local closeImages = {"ThisIs.png", "Ok.png"};
local closeRight = {1, 1, nil};
local found = true;
while found do
found = false;
for i=1,#closeImages do
local image = closeImages[i];
local right = closeRight[i];
srReadScreen();
local images = findAllImagesInRange(image, x, y, width, height);
while #images >= 1 do
done = true;
safeClick(images[#images][0], images[#images][1], right);
sleepWithStatus(200, "Closing Windows");
srReadScreen();
images = findAllImagesInRange(image, x, y, width, height);
end
end
end
end
function refreshWindows()
srReadScreen();
tops = findAllText(thisIs);
for i=1,#tops do
safeClick(tops[i][0], tops[i][1]);
lsSleep(10);
end
end
|
---------------------------------- DATA STORAGE ---------------------------
-- Entity --
local dsE = {}
dsE.type = "container"
dsE.name = "DataStorage"
dsE.icon = "__Mobile_Factory_Graphics__/graphics/matter-serialization/DataStorageI.png"
dsE.icon_size = 64
dsE.flags = {"placeable-neutral", "player-creation"}
dsE.minable = {mining_time = 0.2, result = "DataStorage"}
dsE.max_health = 100
dsE.corpse = "small-remnants"
dsE.render_not_in_network_icon = false
dsE.collision_box = {{-0.8, -0.5}, {0.8, 0.9}}
dsE.selection_box = {{-0.8, -0.5}, {0.8, 1}}
dsE.inventory_size = 0
dsE.open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" }
dsE.close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" }
dsE.vehicle_impact_sound = { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 }
dsE.picture =
{
layers =
{
{
filename = "__Mobile_Factory_Graphics__/graphics/matter-serialization/DataStorageE.png",
priority = "extra-high",
width = 400,
height = 400,
-- shift = {-0.5,-1},
scale = 1/200*30
},
{
filename = "__Mobile_Factory_Graphics__/graphics/matter-serialization/DataStorageS.png",
priority = "high",
width = 400,
height = 400,
shift = {0.5,0.7},
draw_as_shadow = true,
scale = 1/200*45
}
}
}
dsE.circuit_wire_connection_point =
{
wire = {red={-0.05,-0.1}, green={0.05,-0.1}},
shadow = {red={-0.05,0}, green={0.05,0}}
}
dsE.circuit_connector_sprites = nil
dsE.circuit_wire_max_distance = 20
data:extend{dsE}
-- Item --
local dsI = {}
dsI.type = "item"
dsI.name = "DataStorage"
dsI.icon = "__Mobile_Factory_Graphics__/graphics/matter-serialization/DataStorageI.png"
dsI.icon_size = 64
dsI.place_result = "DataStorage"
dsI.subgroup = "DataSerialization"
dsI.order = "b"
dsI.stack_size = 20
data:extend{dsI}
-- Recipe --
local dsR = {}
dsR.type = "recipe"
dsR.name = "DataStorage"
dsR.energy_required = 4
dsR.enabled = false
dsR.ingredients =
{
{"CrystalizedCircuit", 20},
{"MachineFrame3", 5}
}
dsR.result = "DataStorage"
data:extend{dsR}
-- Animation --
local sdA = {}
sdA.name = "DataStorageA"
sdA.type = "animation"
sdA.frame_count = 120
sdA.filename = "__Mobile_Factory_Graphics__/graphics/matter-serialization/DataStorageAn.png"
sdA.size = 200
sdA.line_length = 10
sdA.animation_speed = 1/4
sdA.scale = 1/5
sdA.flags = {"terrain"}
data:extend{sdA}
|
---------------------------------------------
-- Cannibal Blade
---------------------------------------------
require("scripts/globals/automatonweaponskills")
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/msg")
---------------------------------------------
function onMobSkillCheck(target, automaton, skill)
local master = automaton:getMaster()
return master:countEffect(tpz.effect.DARK_MANEUVER)
end
function onPetAbility(target, automaton, skill, master, action)
local params = {
numHits = 1,
atkmulti = 20.0,
accBonus = 1000,
weaponDamage = automaton:getSkillLevel(tpz.skill.AUTOMATON_MELEE),
weaponType = tpz.skill.SWORD,
ftp100 = 0.25,
ftp200 = 0.4,
ftp300 = 0.6,
acc100 = 0.0,
acc200 = 0.0,
acc300 = 0.0,
ignoresDef = true,
ignored100 = 0.5,
ignored200 = 0.5,
ignored300 = 0.5,
str_wsc = 0.0,
dex_wsc = 0.0,
vit_wsc = 0.0,
agi_wsc = 0.0,
int_wsc = 0.0,
mnd_wsc = 0.0,
chr_wsc = 0.0
}
if USE_ADOULIN_WEAPON_SKILL_CHANGES then
params.weaponDamage = nil
params.mnd_wsc = 1.0
params.ftp100 = 16.0
params.ftp200 = 23.5
params.ftp300 = 31.5
end
if automaton:checkDistance(target) > 7 then
if params.weaponDamage then
params.weaponDamage = params.weaponDamage/4
else
params.ftp100 = params.ftp100/4
params.ftp200 = params.ftp200/4
params.ftp300 = params.ftp300/4
end
end
local damage = doAutoPhysicalWeaponskill(automaton, target, 0, skill:getTP(), true, action, false, params, skill, action)
if damage > 0 then
if not target:isUndead() then
automaton:addHP(damage)
skill:setMsg(tpz.msg.basic.SKILL_DRAIN_HP)
end
end
return damage
end
|
require('torch')
nn = {} -- define the global nn table
require('nn.THNN')
require('nn.utils')
require('nn.ErrorMessages')
require('nn.Module')
require('nn.Container')
require('nn.Concat')
require('nn.Parallel')
require('nn.Sequential')
require('nn.DepthConcat')
require('nn.Linear')
require('nn.Bilinear')
require('nn.PartialLinear')
require('nn.SparseLinear')
require('nn.Reshape')
require('nn.View')
require('nn.Contiguous')
require('nn.Select')
require('nn.Narrow')
require('nn.Index')
require('nn.Squeeze')
require('nn.Unsqueeze')
require('nn.Replicate')
require('nn.Transpose')
require('nn.BatchNormalization')
require('nn.Padding')
require('nn.GradientReversal')
require('nn.MaskedSelect')
require('nn.Copy')
require('nn.Min')
require('nn.Max')
require('nn.Sum')
require('nn.Mean')
require('nn.CMul')
require('nn.Mul')
require('nn.MulConstant')
require('nn.Add')
require('nn.AddConstant')
require('nn.Dropout')
require('nn.SpatialDropout')
require('nn.VolumetricDropout')
require('nn.CAddTable')
require('nn.CDivTable')
require('nn.CMulTable')
require('nn.CSubTable')
require('nn.Euclidean')
require('nn.WeightedEuclidean')
require('nn.PairwiseDistance')
require('nn.CosineDistance')
require('nn.DotProduct')
require('nn.Normalize')
require('nn.Cosine')
require('nn.Exp')
require('nn.Log')
require('nn.HardTanh')
require('nn.Clamp')
require('nn.LogSigmoid')
require('nn.LogSoftMax')
require('nn.Sigmoid')
require('nn.SoftMax')
require('nn.SoftMin')
require('nn.SoftPlus')
require('nn.SoftSign')
require('nn.Tanh')
require('nn.TanhShrink')
require('nn.Abs')
require('nn.Power')
require('nn.Square')
require('nn.Sqrt')
require('nn.HardShrink')
require('nn.SoftShrink')
require('nn.Threshold')
require('nn.ReLU')
require('nn.ReLU6')
require('nn.PReLU')
require('nn.LeakyReLU')
require('nn.SpatialSoftMax')
require('nn.RReLU')
require('nn.ELU')
require('nn.LookupTable')
require('nn.SpatialConvolution')
require('nn.SpatialConvolutionLocal')
require('nn.SpatialFullConvolution')
require('nn.SpatialFullConvolutionMap')
require('nn.SpatialConvolutionMM')
require('nn.SpatialConvolutionMap')
require('nn.SpatialDilatedConvolution')
require('nn.SpatialSubSampling')
require('nn.SpatialMaxPooling')
require('nn.SpatialMaxUnpooling')
require('nn.SpatialFractionalMaxPooling')
require('nn.SpatialLPPooling')
require('nn.SpatialAveragePooling')
require('nn.SpatialAdaptiveMaxPooling')
require('nn.TemporalConvolution')
require('nn.TemporalSubSampling')
require('nn.TemporalMaxPooling')
require('nn.SpatialSubtractiveNormalization')
require('nn.SpatialDivisiveNormalization')
require('nn.SpatialContrastiveNormalization')
require('nn.SpatialCrossMapLRN')
require('nn.SpatialZeroPadding')
require('nn.SpatialReflectionPadding')
require('nn.SpatialReplicationPadding')
require('nn.SpatialUpSamplingNearest')
require('nn.SpatialBatchNormalization')
require('nn.VolumetricConvolution')
require('nn.VolumetricFullConvolution')
require('nn.VolumetricMaxPooling')
require('nn.VolumetricMaxUnpooling')
require('nn.VolumetricAveragePooling')
require('nn.VolumetricBatchNormalization')
require('nn.VolumetricReplicationPadding')
require('nn.GPU')
require('nn.ParallelTable')
require('nn.Identity')
require('nn.ConcatTable')
require('nn.SplitTable')
require('nn.JoinTable')
require('nn.SelectTable')
require('nn.MixtureTable')
require('nn.CriterionTable')
require('nn.FlattenTable')
require('nn.NarrowTable')
require('nn.Criterion')
require('nn.MSECriterion')
require('nn.SmoothL1Criterion')
require('nn.MarginCriterion')
require('nn.SoftMarginCriterion')
require('nn.AbsCriterion')
require('nn.ClassNLLCriterion')
require('nn.SpatialClassNLLCriterion')
require('nn.ClassSimplexCriterion')
require('nn.DistKLDivCriterion')
require('nn.MultiCriterion')
require('nn.L1HingeEmbeddingCriterion')
require('nn.HingeEmbeddingCriterion')
require('nn.CosineEmbeddingCriterion')
require('nn.MarginRankingCriterion')
require('nn.MultiMarginCriterion')
require('nn.MultiLabelMarginCriterion')
require('nn.MultiLabelSoftMarginCriterion')
require('nn.L1Cost')
require('nn.L1Penalty')
require('nn.WeightedMSECriterion')
require('nn.BCECriterion')
require('nn.CrossEntropyCriterion')
require('nn.ParallelCriterion')
require('nn.StochasticGradient')
require('nn.MM')
require('nn.MV')
require('nn.Jacobian')
require('nn.SparseJacobian')
require('nn.hessian')
require('nn.test')
return nn
|
-- NetHack 3.7 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
--
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel");
des.map([[
... ...
..........................................................................
... + ...
. ............ ....... . ....... .
. ............................. . ........ .........S.. .
. ............ . ...... . . . ....... .. .
. ......... . .... + . ... . .. .
. S . ......... .S. .S............... .
. ... . ... . ......... . .
. ........ .....S.+.......+....\....+........+. .
. ... ... S ......... .. ..... .
. .. ......... .. ...... .
. ....... ... + .... .... .......... .
. .............. .. . ...... .. ............. .
. ............. . .......... ...... .
... + ...
..........................................................................
... ...
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "lit")
-- Stairs
des.stair("up", 19,10)
-- Non diggable walls
des.non_diggable(selection.area(00,00,75,19))
-- Objects
if (u.race == "gnome") then
des.object({ id = "crossbow", x=37, y=10, buc="blessed", spe=0, name="The Arbalest of Artemis" })
else
des.object({ id = "bow", x=37, y=10, buc="blessed", spe=0, name="The Longbow of Diana" })
end
des.object("chest", 37, 10)
des.object({ coord = { 36, 09 } })
des.object({ coord = { 36, 10 } })
des.object({ coord = { 36, 11 } })
des.object({ coord = { 37, 09 } })
des.object({ coord = { 37, 11 } })
des.object({ coord = { 38, 09 } })
des.object({ coord = { 38, 10 } })
des.object({ coord = { 38, 11 } })
des.object()
des.object()
des.object()
des.object()
des.object()
-- Random traps
des.trap()
des.trap()
des.trap()
des.trap()
des.trap()
des.trap()
-- doors
des.door("locked",12,08)
des.door("closed",22,10)
des.door("locked",24,10)
des.door("closed",25,11)
des.door("closed",32,10)
des.door("closed",37,03)
des.door("closed",37,07)
des.door("closed",37,13)
des.door("closed",37,16)
des.door("closed",42,10)
des.door("locked",46,08)
des.door("closed",51,10)
des.door("locked",53,08)
des.door("closed",65,05)
-- Random monsters.
des.monster({ id = "Scorpius", x=37, y=10, peaceful=0 })
des.monster({ id = "forest centaur", x=36, y=09, peaceful=0 })
des.monster({ id = "forest centaur", x=36, y=10, peaceful=0 })
des.monster({ id = "forest centaur", x=36, y=11, peaceful=0 })
des.monster({ id = "forest centaur", x=37, y=09, peaceful=0 })
des.monster({ id = "forest centaur", x=37, y=11, peaceful=0 })
des.monster({ id = "forest centaur", x=38, y=09, peaceful=0 })
des.monster({ id = "mountain centaur", x=38, y=10, peaceful=0 })
des.monster({ id = "mountain centaur", x=38, y=11, peaceful=0 })
des.monster({ id = "mountain centaur", x=02, y=02, peaceful=0 })
des.monster({ id = "mountain centaur", x=71, y=02, peaceful=0 })
des.monster({ id = "mountain centaur", x=02, y=16, peaceful=0 })
des.monster({ id = "mountain centaur", x=71, y=16, peaceful=0 })
des.monster({ id = "forest centaur", peaceful=0 })
des.monster({ id = "forest centaur", peaceful=0 })
des.monster({ id = "mountain centaur", peaceful=0 })
des.monster({ id = "mountain centaur", peaceful=0 })
des.monster({ class = "C", peaceful=0 })
des.monster({ class = "C", peaceful=0 })
des.monster({ id = "scorpion", x=03, y=02, peaceful=0 })
des.monster({ id = "scorpion", x=72, y=02, peaceful=0 })
des.monster({ id = "scorpion", x=03, y=17, peaceful=0 })
des.monster({ id = "scorpion", x=72, y=17, peaceful=0 })
des.monster({ id = "scorpion", x=41, y=10, peaceful=0 })
des.monster({ id = "scorpion", x=33, y=09, peaceful=0 })
des.monster({ id = "scorpion", peaceful=0 })
des.monster({ id = "scorpion", peaceful=0 })
des.monster({ class = "s", peaceful=0 })
des.wallify()
|
local lib={}
lib.internal={}
function lib.internal.range_adjust(f,l,s)
checkArg(1,f,'number','nil')
checkArg(2,l,'number','nil')
checkArg(3,s,'number')
if f==nil then f=1 elseif f<0 then f=s+f+1 end
if l==nil then l=s elseif l<0 then l=s+l+1 end
return f,l
end
function lib.internal.table_view(tbl,f,l)
return setmetatable({},
{
__index=function(b,k)return(type(k)~='number'or(k>=f and k<=l))and tbl[k]or nil end,
__len=function(b)return#tbl end,
})
end
local adjust=lib.internal.range_adjust
local view=lib.internal.table_view
-- works like string.sub but on elements of an indexed table
function lib.sub(tbl,f,l)
checkArg(1,tbl,'table')
local r,s={},#tbl
f,l=adjust(f,l,s)
l=math.min(l,s)
for i=math.max(f,1),l do
r[#r+1]=tbl[i]
end
return r
end
-- first(p1,p2) searches for the first range in p1 that satisfies p2
function lib.first(tbl,pred,f,l)
checkArg(1,tbl,'table')
checkArg(2,pred,'function','table')
if type(pred)=='table'then
local set;set,pred=pred,function(e,fi,tbl)
for vi=1,#set do
local v=set[vi]
if lib.begins(tbl,v,fi) then return true,#v end
end
end
end
local s=#tbl
f,l=adjust(f,l,s)
tbl=view(tbl,f,l)
for i=f,l do
local si,ei=pred(tbl[i],i,tbl)
if si then
return i,i+(ei or 1)-1
end
end
end
-- if value was made by lib.sub then find can find from whence
function --[[@delayloaded-start@]] lib.find(tbl, sub, first, last)
checkArg(1, tbl, 'table')
checkArg(2, sub, 'table')
local sub_len = #sub
return lib.first(tbl, function(element, index, projected_table)
for n=0,sub_len-1 do
if projected_table[n + index] ~= sub[n + 1] then return nil end
end
return 1, sub_len
end, first, last)
end --[[@delayloaded-end@]]
-- Returns a list of subsets of tbl where partitioner acts as a delimiter.
function --[[@delayloaded-start@]] lib.partition(tbl,partitioner,dropEnds,f,l)
checkArg(1,tbl,'table')
checkArg(2,partitioner,'function','table')
checkArg(3,dropEnds,'boolean','nil')
if type(partitioner)=='table'then
return lib.partition(tbl,function(e,i,tbl)
return lib.first(tbl,partitioner,i)
end,dropEnds,f,l)
end
local s=#tbl
f,l=adjust(f,l,s)
local cut=view(tbl,f,l)
local result={}
local need=true
local exp=function()if need then result[#result+1]={}need=false end end
local i=f
while i<=l do
local e=cut[i]
local ds,de=partitioner(e,i,cut)
-- true==partition here
if ds==true then ds,de=i,i
elseif ds==false then ds,de=nil,nil end
if ds~=nil then
ds,de=adjust(ds,de,l)
ds=ds>=i and ds--no more
end
if not ds then -- false or nil
exp()
table.insert(result[#result],e)
else
local sub=lib.sub(cut,i,not dropEnds and de or (ds-1))
if #sub>0 then
exp()
result[#result+math.min(#result[#result],1)]=sub
end
-- ensure i moves forward
local ensured=math.max(math.max(de or ds,ds),i)
if de and ds and de<ds and ensured==i then
if #result==0 then result[1]={} end
table.insert(result[#result],e)
end
i=ensured
need=true
end
i=i+1
end
return result
end --[[@delayloaded-end@]]
-- returns true if p1 at first p3 equals element for element p2
function lib.begins(tbl,v,f,l)
checkArg(1,tbl,'table')
checkArg(2,v,'table')
local vs=#v
f,l=adjust(f,l,#tbl)
if vs>(l-f+1)then return end
for i=1,vs do
if tbl[f+i-1]~=v[i] then return end
end
return true
end
-- calls callback(e,i,tbl) for each ith element e in table tbl from first
function lib.foreach(tbl,c,f,l)
checkArg(1,tbl,'table')
checkArg(2,c,'function','string')
local ck=c
c=type(c)=="string" and function(e) return e[ck] end or c
local s=#tbl
f,l=adjust(f,l,s)
tbl=view(tbl,f,l)
local r={}
for i=f,l do
local n,k=c(tbl[i],i,tbl)
if n~=nil then
if k then r[k]=n
else r[#r+1]=n end
end
end
return r
end
lib.select=lib.foreach
function --[[@delayloaded-start@]] lib.where(tbl,p,f,l)
return lib.foreach(tbl,
function(e,i,tbl)
return p(e,i,tbl)and e or nil
end,f,l)
end --[[@delayloaded-end@]]
function lib.concat(...)
local r,rn,k={},0
for _,tbl in ipairs({...})do
if type(tbl)~='table'then
return nil,'parameter '..tostring(_)..' to concat is not a table'
end
local n=tbl.n or #tbl
k=k or tbl.n
for i=1,n do
rn=rn+1;r[rn]=tbl[i]
end
end
r.n=k and rn or nil
return r
end
-- works with pairs on tables
-- returns the kv pair, or nil and the number of pairs iterated
function --[[@delayloaded-start@]] lib.at(tbl, index)
checkArg(1, tbl, "table")
checkArg(2, index, "number", "nil")
local current_index = 1
for k,v in pairs(tbl) do
if current_index == index then
return k,v
end
current_index = current_index + 1
end
return nil, current_index - 1 -- went one too far
end --[[@delayloaded-end@]]
return lib,{adjust=adjust,view=view}
|
local wibox = require('wibox')
local beautiful = require('beautiful')
local naughty = require('naughty')
local gears = require('gears')
local dpi = beautiful.xresources.apply_dpi
local helpers = require('helpers')
local button_container = require('ui.widgets.button')
local ui_notif_builder = {}
-- Notification icon container
ui_notif_builder.notifbox_icon = function(ico_image)
local noti_icon = wibox.widget {
{
id = 'icon',
resize = true,
forced_height = dpi(25),
forced_width = dpi(25),
widget = wibox.widget.imagebox
},
layout = wibox.layout.fixed.horizontal
}
noti_icon.icon:set_image(ico_image)
return noti_icon
end
-- Notification title container
ui_notif_builder.notifbox_title = function(title)
return wibox.widget {
markup = title,
font = beautiful.font_name .. 'Bold 12',
align = 'left',
valign = 'center',
widget = wibox.widget.textbox
}
end
-- Notification message container
ui_notif_builder.notifbox_message = function(msg)
return wibox.widget {
markup = msg,
font = beautiful.font_name .. 'medium 10',
align = 'left',
valign = 'center',
widget = wibox.widget.textbox
}
end
-- Notification app name container
ui_notif_builder.notifbox_appname = function(app)
return wibox.widget {
markup = app,
font = beautiful.font_name .. 'Bold 12',
align = 'left',
valign = 'center',
widget = wibox.widget.textbox
}
end
-- Notification actions container
ui_notif_builder.notifbox_actions = function(n)
actions_template = wibox.widget {
notification = n,
base_layout = wibox.widget {
spacing = dpi(0),
layout = wibox.layout.flex.horizontal
},
widget_template = {
{
{
{
{
id = 'text_role',
font = beautiful.font_name .. 'medium 10',
widget = wibox.widget.textbox
},
widget = wibox.container.place
},
widget = button_container
},
bg = beautiful.lighter_bg,
shape = gears.shape.rounded_rect,
forced_height = dpi(30),
widget = wibox.container.background
},
margins = dpi(4),
widget = wibox.container.margin
},
style = { underline_normal = false, underline_selected = true },
widget = naughty.list.actions,
}
return actions_template
end
-- Notification dismiss button
ui_notif_builder.notifbox_dismiss = function()
local dismiss_icon = wibox.widget {
{
id = 'dismiss_icon',
markup = helpers.colorize_text("", beautiful.xcolor1),
font = beautiful.icon_font_name .. "Round 10",
align = "center",
valign = "center",
widget = wibox.widget.textbox
},
layout = wibox.layout.fixed.horizontal
}
local dismiss_button = wibox.widget {
{
dismiss_icon,
margins = dpi(5),
widget = wibox.container.margin
},
widget = button_container
}
local notifbox_dismiss = wibox.widget {
dismiss_button,
visible = false,
bg = beautiful.lighter_bg,
shape = gears.shape.circle,
widget = wibox.container.background
}
return notifbox_dismiss
end
return ui_notif_builder
|
-- Setup Colors {{{
local status_ok, theme = pcall(require, "lualine.themes.tokyonight")
if not status_ok then
return
end
lvim.builtin.lualine.options.theme = theme
--- Set colorscheme for a lualine section
-- @param section Name of section
-- @param conifg Configuration table
local function lualine_color(section)
return function(config)
for mode, cfg in pairs(config) do
for _, m in pairs(mode == "all" and { "normal", "insert", "command", "replace", "visual" } or { mode }) do
lvim.builtin.lualine.options.theme[m][section] = cfg
end
end
end
end
local colors = {
fg = "#C0CAF5",
black = "#000000",
white = "#FFFFFF",
gray = "#292E42",
blue = "#7AA2F7",
cyan = "#008080",
darkblue = "#081633",
green = "#9ECE6A",
magenta = "#C678DD",
orange = "#FF8800",
red = "#EC5F67",
violet = "#A9A1E1",
yellow = "#ECBE7B",
}
-- Lualine colors
lualine_color "a" {
normal = { fg = colors.black, bg = colors.blue, gui = "bold" } ,
insert = { fg = colors.black, bg = colors.green, gui = "bold" } ,
visual = { fg = colors.black, bg = colors.orange, gui = "bold" } ,
replace = { fg = colors.black, bg = colors.magenta, gui = "bold" } ,
command = { fg = colors.black, bg = colors.red, gui = "bold" } ,
inactive = { fg = colors.black, bg = colors.violet, gui = "bold" } ,
}
lualine_color "b" {
all = { fg = colors.fg, bg = colors.gray },
inactive = { fg = colors.violet, bg = colors.black },
}
lualine_color "c" {
inactive = { fg = colors.violet, bg = colors.black }
}
-- }}}
-- Setup Sections {{{
--- Setup contents of lualine sections
-- @param section Name of the section
-- @param config Table of components
local function lualine(section)
return function(config)
local cfg_active = {}
local cfg_inactive = {}
for _, v in pairs(config) do
if v.active == nil or v.active then
table.insert(cfg_active, v)
end
if v.inactive then
table.insert(cfg_inactive, v)
end
end
lvim.builtin.lualine.sections["lualine_" .. section] = cfg_active
lvim.builtin.lualine.inactive_sections["lualine_" .. section] = cfg_inactive
end
end
local function resize_condition(size)
return function()
return vim.fn.winwidth(0) > size
end
end
-- Setup components
local components = require("lvim.core.lualine.components")
components.diagnostics.cond = nil
components.diff.cond = nil
components.lsp.cond = resize_condition(120)
components.spaces.cond = resize_condition(120)
components.treesitter.cond = resize_condition(120)
-- Section A
lualine "a" {
{ "mode", icon = "" },
{ function() return vim.fn.winnr() end, icon = "", inactive = true },
}
-- Section B
lualine "b" {
{ "filename", color = {}, inactive = true },
{ "b:gitsigns_head", icon = "", color = {}, cond = resize_condition(80), inactive = true },
}
-- Section C
lualine "c" {
components.diff,
}
-- Section X
lualine "x" {
components.diagnostics,
components.treesitter,
components.lsp
}
-- Section Y
lualine "y" {
{ "filetype", color = {}, cond = resize_condition(80) },
{ "fileformat", color = { gui = "bold" }, cond = resize_condition(120) },
{ "o:encoding", fmt = string.upper, color = {}, cond = resize_condition(120) },
components.spaces,
-- Inactive sections
{ "location", icon = "", color = {}, active = false, inactive = true },
{ "progress", icon = "𥳐" , color = {}, active = false, inactive = true },
}
-- Section Z
lualine "z" {
{ "location", icon = "", color = {} },
{ "progress", icon = "𥳐" , color = {}, cond = resize_condition(80) },
}
lvim.builtin.lualine.extensions = {
-- Quickfix
{
sections = {
lualine_a = {
{ function() return vim.fn.winnr() end, icon = "", inactive = true },
{
function()
return " " .. (vim.fn.getloclist(0, { filewinid = 1 }).filewinid ~= 0 and "Loc List" or "QF List")
end,
color = { gui = "bold" },
}
},
lualine_b = {
function()
return vim.fn.getloclist(0, { filewinid = 1 }).filewinid ~= 0 and
vim.fn.getloclist(0, { title = 0 }).title or
vim.fn.getqflist({ title = 0 }).title
end,
},
},
filetypes = { "qf" },
init = function() vim.g.qf_disable_statusline = true end
},
}
-- }}}
lvim.builtin.lualine.options.section_separators = { left = "", right = "" }
lvim.builtin.lualine.options.component_separators = { left = "", right = "" }
-- vim:set fdm=marker:
|
local M = {}
--- a benchmark current statusline. it need plenary.nvim
M.benchmark = function()
local Comp = require('windline.component')
local windline = require('windline')
local api = vim.api
local num = 1e4
local bench = require('plenary.profile').benchmark
local statusline = ''
local bufnr = api.nvim_get_current_buf()
local winid = api.nvim_get_current_win()
local width = api.nvim_win_get_width(0)
local time = bench(num, function()
vim.g.statusline_winid = winid
statusline = WindLine.show(bufnr, winid)
end)
local popup = require('plenary.popup')
local result = {}
table.insert(result,'Status:')
table.insert(result, statusline)
table.insert(result, 'Time:')
table.insert(result, string.format('render %s time : *%s*', num, time))
table.insert(result, 'Comp:')
local line = windline.get_statusline_ft(vim.bo.filetype) or windline.default_line
table.insert(result, string.format('%s %12s %12s %s %s', ' ', 'time', 'name', 'num ', 'text'))
for index, comp in pairs(line.active) do
local item = ''
time = bench(num, function()
Comp.reset()
item = comp:render(bufnr, winid, width)
end)
table.insert(result, string.format('%02d *%10s* %12s %s - %s', index, time, comp.name or ' ', num, item))
end
local vim_width = math.floor(vim.o.columns / 1.5)
local col = math.floor((vim.o.columns - vim_width) / 2)
popup.create(result, {
border = {},
minheight = 30,
maxwidth=vim_width,
col = col,
line = 10,
width = vim_width,
})
vim.bo.filetype = 'help'
end
return M
|
-- =========================================
-- VmkachBot, a Lua Telegram bot for chats
-- Copyright (c) 2019 Evgeny Shulgin, MIT License
-- =========================================
-- Library includies
local requests = require("requests")
local inspect = require("inspect")
local json = require("cjson")
local stringy = require("stringy")
-- Project module includies
local emoji = require("emoji")
-- Local variables
local owner = os.getenv("OWNER")
local token = os.getenv("WEATHER_TOKEN")
local template = "http://api.openweathermap.org/data/2.5/"
local query_time_table = {}
local query_results = {}
local EXPIRATION_TIME = 1200 -- cache time for queries in seconds
local args = {
["id"] = 524901, -- city id of Moscow, Russia
["lang"] = "ru",
["APPID"] = token,
["units"] = "metric",
["cnt"] = 8
}
-- Dict to return
local weather = {}
--------------------------------------------
-- Builds a query to Open Weather API
-- @param mode Either "forecast" (future weather)
-- or "weather" (current weather)
--------------------------------------------
local function build_query(mode)
res = template .. mode .. "?"
for key, value in pairs(args) do
res = res .. key .. "=" .. value .. "&"
end
res = res:sub(1, #res - 1)
return res
end
--------------------------------------------
-- Gets a query using caching
-- @param query Query to complete
--------------------------------------------
local function get_query_results(query)
cur_time = os.time()
if not query_time_table[query]
or cur_time > query_time_table[query] + EXPIRATION_TIME then
query_time_table[query] = cur_time
query_results[query] = requests.get(query)
end
return query_results[query]
end
--------------------------------------------
-- Returns emoji name based on the weather code
-- @param code Open Weather API code
--------------------------------------------
local function get_emoji_name_by_weather(code)
local sw = stringy.startswith
code = tostring(code)
-- codes below taken from https://openweathermap.org/weather-conditions
if sw(code, "2") then -- 2xx - thunderstorm
return "cloud_with_lightning_and_rain"
elseif sw(code, "3") then -- 3xx - drizzle
return "umbrella_with_rain_drops"
elseif sw(code, "5") then -- 5xx - rain
return "cloud_with_rain"
elseif sw(code, "6") then -- 6xx - snow
return "snowflake"
elseif sw(code, "701") or sw(code, "711") or sw(code, "721")
or sw(code, "741") then -- 7xx - atmosphere
return "fog"
elseif sw(code, "762") then
return "volcano"
elseif sw(code, "771") then
return "dashing_away"
elseif sw(code, "781") then
return "tornado"
elseif sw(code, "731") or sw(code, "751") or sw(code, "761") then
return "comet"
elseif sw(code, "800") then -- 800 - clear
return "sun"
elseif sw(code, "80") then -- 80x - clouds
return "cloud"
end
end
--------------------------------------------
-- Generates a string with info about current weather
-- @param api Telegram API object
--------------------------------------------
function weather.get_current_weather()
query = build_query("weather")
results = get_query_results(query)
res = ""
if results.status_code == 200 then
t = json.decode(results.text)
datetime = os.date("!*t", t["dt"])
-- Time of the last dump
res = res .. string.format("Информация о погоде на %.2d:%.2d\n",
datetime.hour, datetime.min)
-- Temperature info
res = res .. string.format("Температура %.1f градусов\n", t["main"]["temp"])
-- Weather description info
weather_object = t["weather"][1]
res = res .. "Сейчас " .. weather_object["description"]
res = res .. " " .. emoji.emoji_unicode[get_emoji_name_by_weather(weather_object["id"])]
else
-- Failed to get weather info
res = "Не удалось получить информацию о погоде"
end
return res
end
return weather
|
-- Toggle display of water depth
--[====[
twaterlvl
=========
Toggle between displaying/not displaying liquid depth as numbers.
]====]
df.global.d_init.flags1.SHOW_FLOW_AMOUNTS = not df.global.d_init.flags1.SHOW_FLOW_AMOUNTS
print('Water level display toggled.')
|
local Players = game:GetService("Players")
local Modules = Players.LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local SearchesInCatalog = require(Modules.AvatarExperience.Catalog.Reducers.SearchesInCatalog)
-- local SearchesInLibrary = require(Modules.LuaApp.Reducers.SearchesInLibrary)
return function(state, action)
state = state or {}
return {
SearchesInCatalog = SearchesInCatalog(state.SearchesInCatalog, action),
}
end
|
--[[ file meta info
@file Cache.lua
@brief Cache functions to build table with data from client
--]]
--[[
@brief Accessing the addons private table
@var _ addonName, thrown away
@var wt Global addonTable
--]]
local _, wt = ...
--[[
@brief Tables for Spell Cache
@var wt.spellInfoCache Global table for spell cache
@param spell The Spell ID to cache
@param level The level the spell is learned at
@param done If already cached, set to true and return
--]]
wt.spellInfoCache = {} -- Table init
function wt:CacheSpell(spell, level, done)
if (self.spellInfoCache[spell.id] ~= nil) then -- If cache for spell id already exists
done(true) -- Set done to true and return
return
end
local subText = select(2, GetSpellInfo(spell.id)) -- Get spell rank/subtext
local formattedSubText = (subText and subText ~= "") and format(PARENS_TEMPLATE, subText) -- If subtext is not empty, format string
or "" -- If subtext is empty, set as empty string
self.spellInfoCache[spell.id] = { -- Getting spell info and set into cache table
id = spell.id, -- Id
name = select(1, GetSpellInfo(spell.id)), -- Name
subText = subText, -- Rank/subtext
formattedSubText = formattedSubText, -- Formatted subtext
icon = select(3, GetSpellInfo(spell.id)), -- Icon path
cost = spell.cost, -- Cost
formattedCost = GetCoinTextureString(spell.cost), -- Formatted cost
level = level, -- Level
formattedLevel = format(wt.L.LEVEL_FORMAT, level) -- Formatted level
}
done(false) -- When done, set done as false
end
-- @brief Function to easier use the spell info function
function wt:SpellInfo(spellId)
return self.spellInfoCache[spellId]
end
|
-- Localize
local cwd = (...):gsub("%.[^%.]+$", "") .. "."
local dhcpd = require(cwd .. "dhcp.server")
local _M = {
_VERSION = "1.0.0.1",
_DESCRIPTION = "It is the app entry ..."
}
local function dhcpd_callback(op, packet, options)
return {
yiaddr = "10.10.0.5",
options = {
subnet_mask = "255.255.255.0",
broadcast_address = "10.10.10.255",
router = {
"10.10.10.1",
"10.10.10.2"
},
domain_name = "openresty.com",
hostname = "agentzh.openresty.com",
address_lease_time = 86400,
renewal_time = 3600,
ipxe = {
no_proxydhcp = 1
}
}
}
end
--
function _M.serve()
local ok, err = dhcpd.serve(dhcpd_callback)
if not ok then
ngx.log(ngx.ERR, err)
end
end
return _M
|
UIMenuStatsItem = setmetatable({}, UIMenuStatsItem)
UIMenuStatsItem.__index = UIMenuStatsItem
UIMenuStatsItem.__call = function() return "UIMenuItem", "UIMenuStatsItem" end
---New
---@param Text string
---@param Items table
---@param Index number
---@param Description string
---@param Counter boolean
function UIMenuStatsItem.New(Text, Description, Index, barColor, type, mainColor, highlightColor, textColor, highlightedTextColor)
local _UIMenuStatsItem = {
Base = UIMenuItem.New(Text or "", Description or "", mainColor or 117, highlightColor or 1, textColor or 1, highlightedTextColor or 2),
_Index = Index or 0,
Panels = {},
SidePanel = nil,
_Color = barColor or 116,
_Type = type or 0,
ItemId = 5,
OnStatsChanged = function(menu, item, newindex) end,
OnStatsSelected = function(menu, item, newindex) end,
}
return setmetatable(_UIMenuStatsItem, UIMenuStatsItem)
end
---SetParentMenu
---@param Menu table
function UIMenuStatsItem:SetParentMenu(Menu)
if Menu() == "UIMenu" then
self.Base.ParentMenu = Menu
else
return self.Base.ParentMenu
end
end
function UIMenuStatsItem:AddSidePanel(sidePanel)
if sidePanel() == "UIMissionDetailsPanel" then
sidePanel:SetParentItem(self)
self.SidePanel = sidePanel
if self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible() then
ScaleformUI.Scaleforms._ui:CallFunction("ADD_SIDE_PANEL_TO_ITEM", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, 0, sidePanel.PanelSide, sidePanel.TitleType, sidePanel.Title, sidePanel.TitleColor, sidePanel.TextureDict, sidePanel.TextureName)
end
elseif sidePanel() == "UIVehicleColorPickerPanel" then
sidePanel:SetParentItem(self)
self.SidePanel = sidePanel
if self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible() then
ScaleformUI.Scaleforms._ui:CallFunction("ADD_SIDE_PANEL_TO_ITEM", false, IndexOf(self.ParentMenu.Items, self) - 1, 1, sidePanel.PanelSide, sidePanel.TitleType, sidePanel.Title, sidePanel.TitleColor)
end
end
end
---Selected
---@param bool number
function UIMenuStatsItem:Selected(bool)
if bool ~= nil then
self.Base:Selected(tobool(bool), self)
else
return self.Base._Selected
end
end
---Hovered
---@param bool boolean
function UIMenuStatsItem:Hovered(bool)
if bool ~= nil then
self.Base._Hovered = tobool(bool)
else
return self.Base._Hovered
end
end
---Enabled
---@param bool boolean
function UIMenuStatsItem:Enabled(bool)
if bool ~= nil then
self.Base:Enabled(bool, self)
else
return self.Base._Enabled
end
end
---Description
---@param str string
function UIMenuStatsItem:Description(str)
if tostring(str) and str ~= nil then
self.Base:Description(tostring(str), self)
else
return self.Base._Description
end
end
---Text
---@param Text string
function UIMenuStatsItem:Label(Text)
if tostring(Text) and Text ~= nil then
self.Base:Label(tostring(Text), self)
else
return self.Base:Label()
end
end
function UIMenuStatsItem:MainColor(color)
if(color)then
self.Base._mainColor = color
if(self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible()) then
ScaleformUI.Scaleforms._ui:CallFunction("UPDATE_COLORS", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, self.Base._mainColor, self.Base._highlightColor, self.Base._textColor, self.Base._highlightedTextColor)
end
else
return self.Base._mainColor
end
end
function UIMenuStatsItem:TextColor(color)
if(color)then
self.Base._textColor = color
if(self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible()) then
ScaleformUI.Scaleforms._ui:CallFunction("UPDATE_COLORS", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, self.Base._mainColor, self.Base._highlightColor, self.Base._textColor, self.Base._highlightedTextColor)
end
else
return self.Base._textColor
end
end
function UIMenuStatsItem:HighlightColor(color)
if(color)then
self.Base._highlightColor = color
if(self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible()) then
ScaleformUI.Scaleforms._ui:CallFunction("UPDATE_COLORS", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, self.Base._mainColor, self.Base._highlightColor, self.Base._textColor, self.Base._highlightedTextColor)
end
else
return self.Base._highlightColor
end
end
function UIMenuStatsItem:HighlightedTextColor(color)
if(color)then
self.Base._highlightedTextColor = color
if(self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible()) then
ScaleformUI.Scaleforms._ui:CallFunction("UPDATE_COLORS", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, self.Base._mainColor, self.Base._highlightColor, self.Base._textColor, self.Base._highlightedTextColor)
end
else
return self.Base._highlightedTextColor
end
end
function UIMenuStatsItem:SliderColor(color)
if(color)then
self._Color = color
if(self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible()) then
ScaleformUI.Scaleforms._ui:CallFunction("UPDATE_COLORS", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, self.Base._mainColor, self.Base._highlightColor, self.Base._textColor, self.Base._highlightedTextColor, self._Color)
end
else
return self._Color
end
end
function UIMenuStatsItem:BlinkDescription(bool)
if bool ~= nil then
self.Base:BlinkDescription(bool, self)
else
return self.Base:BlinkDescription()
end
end
---Index
---@param Index table
function UIMenuStatsItem:Index(Index)
if tonumber(Index) then
if Index > 100 then
self._Index = 100
elseif Index < 0 then
self._Index = 0
else
self._Index = Index
end
self.OnStatsChanged(self._Index)
if (self.Base.ParentMenu ~= nil and self.Base.ParentMenu:Visible()) then
ScaleformUI.Scaleforms._ui:CallFunction("SET_ITEM_VALUE", false, IndexOf(self.Base.ParentMenu.Items, self) - 1, self._Index)
end
else
return self._Index
end
end
---LeftBadge
function UIMenuStatsItem:LeftBadge()
error("This item does not support badges")
end
---RightBadge
function UIMenuStatsItem:RightBadge()
error("This item does not support badges")
end
---RightLabel
function UIMenuStatsItem:RightLabel()
error("This item does not support a right label")
end
|
Missions = Missions or {}
--- Disable a ship by destroying its engines and force it to stop.
---
--- Assuming the ship has it, the Impulse Drive, Warp Drive and Jump Drive have to be destroyed.
---
--- @param self
--- @param target CpuShip|function
--- @param config table
--- @field approachDistance (default: `10000`)
--- @field onApproach function(mission)
--- @field damageThreshold number (default: `-0.2`) How far the systems need to be destroyed to count as success. (`1` = full health, `0` = disabled, `-1` = severely damaged)
--- @field distanceToFinish number (default: `1000`) How close the players need to be to the ship so they surrender
--- @field onSurrender function(mission)
--- @field onDestruction function(mission)
--- @return Mission
Missions.disable = function(self, target, config)
local cronId = Util.randomUuid()
if not isEeShip(target) and not isFunction(target) then error("Expected target to be a ship or a funcition, but got " .. typeInspect(target), 2) end
config = config or {}
if not isTable(config) then error("Expected config to be a table, but " .. typeInspect(config) .. " given.", 2) end
local approachDistance = config.approachDistance or 10000
if not isNumber(approachDistance) or approachDistance < 0 then error("Eypected approachDistance to be a positive number, but got " .. typeInspect(approachDistance), 2) end
local onApproachTriggered = false
if not isFunction(config.onApproach) then onApproachTriggered = true end
config.damageThreshold = config.damageThreshold or -0.2
if not isNumber(config.damageThreshold) or config.damageThreshold < -1 or config.damageThreshold > 1 then error("Eypected damageThreshold to be a number between -1..1, but got " .. typeInspect(config.damageThreshold), 2) end
-- the distance the player should have tops when the ship is disabled. If they are too far away the ship might not see a reason to surrender.
config.distanceToFinish = config.distanceToFinish or 1000
if not isNumber(config.distanceToFinish) or config.distanceToFinish < 0 then error("Eypected distanceToFinish to be a positive number, but got " .. typeInspect(config.distanceToFinish), 2) end
local isTargetDisabled = function()
return
isEeShip(target) and
target:getSystemHealth("impulse") <= config.damageThreshold and
(not target:hasJumpDrive() or target:getSystemHealth("jumpdrive") <= config.damageThreshold) and
(not target:hasWarpDrive() or target:getSystemHealth("warp") <= config.damageThreshold)
end
local mission
mission = Mission:new({
acceptCondition = config.acceptCondition,
onAccept = config.onAccept,
onDecline = config.onDecline,
onStart = function(self)
if isFunction(target) then
if isFunction(target) then
target = target(self)
if not isEeShip(target) then error("Expected function to return a target ship, but got " .. typeInspect(target), 2) end
end
end
if isFunction(config.onStart) then config.onStart(self) end
Cron.regular(cronId, function()
if not target:isValid() then
userCallback(config.onDestruction, mission)
mission:fail()
elseif onApproachTriggered == false and distance(target, self:getPlayer()) < approachDistance then
userCallback(config.onApproach, mission)
onApproachTriggered = true
elseif isTargetDisabled() and distance(target, self:getPlayer()) <= config.distanceToFinish then
userCallback(config.onSurrender, mission)
mission:success()
end
end, 0.2)
end,
onSuccess = config.onSuccess,
onFailure = config.onFailure,
onEnd = function(self)
Cron.abort(cronId)
if isFunction(config.onEnd) then config.onEnd(self) end
end,
})
Mission:forPlayer(mission)
--- @param self
--- @return nil|CpuShip
mission.getTarget = function(self)
if isEeShip(target) and target:isValid() then return target end
end
return mission
end
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf/protobuf"
module('MilitaryRecord_pb')
MILITARYRECORD = protobuf.Descriptor();
local MILITARYRECORD_MILITARY_RANK_FIELD = protobuf.FieldDescriptor();
local MILITARYRECORD_MILITARY_RANK_HIS_FIELD = protobuf.FieldDescriptor();
local MILITARYRECORD_MILITARY_EXPLOIT_FIELD = protobuf.FieldDescriptor();
local MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD = protobuf.FieldDescriptor();
local MILITARYRECORD_LAST_UPDATE_TIME_FIELD = protobuf.FieldDescriptor();
local MILITARYRECORD_ACHIEVE_RANK_FIELD = protobuf.FieldDescriptor();
MILITARYRECORD_MILITARY_RANK_FIELD.name = "military_rank"
MILITARYRECORD_MILITARY_RANK_FIELD.full_name = ".KKSG.MilitaryRecord.military_rank"
MILITARYRECORD_MILITARY_RANK_FIELD.number = 1
MILITARYRECORD_MILITARY_RANK_FIELD.index = 0
MILITARYRECORD_MILITARY_RANK_FIELD.label = 1
MILITARYRECORD_MILITARY_RANK_FIELD.has_default_value = false
MILITARYRECORD_MILITARY_RANK_FIELD.default_value = 0
MILITARYRECORD_MILITARY_RANK_FIELD.type = 13
MILITARYRECORD_MILITARY_RANK_FIELD.cpp_type = 3
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.name = "military_rank_his"
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.full_name = ".KKSG.MilitaryRecord.military_rank_his"
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.number = 2
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.index = 1
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.label = 1
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.has_default_value = false
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.default_value = 0
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.type = 13
MILITARYRECORD_MILITARY_RANK_HIS_FIELD.cpp_type = 3
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.name = "military_exploit"
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.full_name = ".KKSG.MilitaryRecord.military_exploit"
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.number = 3
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.index = 2
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.label = 1
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.has_default_value = false
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.default_value = 0
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.type = 13
MILITARYRECORD_MILITARY_EXPLOIT_FIELD.cpp_type = 3
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.name = "military_exploit_his"
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.full_name = ".KKSG.MilitaryRecord.military_exploit_his"
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.number = 4
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.index = 3
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.label = 1
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.has_default_value = false
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.default_value = 0
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.type = 13
MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD.cpp_type = 3
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.name = "last_update_time"
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.full_name = ".KKSG.MilitaryRecord.last_update_time"
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.number = 5
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.index = 4
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.label = 1
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.has_default_value = false
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.default_value = 0
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.type = 13
MILITARYRECORD_LAST_UPDATE_TIME_FIELD.cpp_type = 3
MILITARYRECORD_ACHIEVE_RANK_FIELD.name = "achieve_rank"
MILITARYRECORD_ACHIEVE_RANK_FIELD.full_name = ".KKSG.MilitaryRecord.achieve_rank"
MILITARYRECORD_ACHIEVE_RANK_FIELD.number = 6
MILITARYRECORD_ACHIEVE_RANK_FIELD.index = 5
MILITARYRECORD_ACHIEVE_RANK_FIELD.label = 3
MILITARYRECORD_ACHIEVE_RANK_FIELD.has_default_value = false
MILITARYRECORD_ACHIEVE_RANK_FIELD.default_value = {}
MILITARYRECORD_ACHIEVE_RANK_FIELD.type = 13
MILITARYRECORD_ACHIEVE_RANK_FIELD.cpp_type = 3
MILITARYRECORD.name = "MilitaryRecord"
MILITARYRECORD.full_name = ".KKSG.MilitaryRecord"
MILITARYRECORD.nested_types = {}
MILITARYRECORD.enum_types = {}
MILITARYRECORD.fields = {MILITARYRECORD_MILITARY_RANK_FIELD, MILITARYRECORD_MILITARY_RANK_HIS_FIELD, MILITARYRECORD_MILITARY_EXPLOIT_FIELD, MILITARYRECORD_MILITARY_EXPLOIT_HIS_FIELD, MILITARYRECORD_LAST_UPDATE_TIME_FIELD, MILITARYRECORD_ACHIEVE_RANK_FIELD}
MILITARYRECORD.is_extendable = false
MILITARYRECORD.extensions = {}
MilitaryRecord = protobuf.Message(MILITARYRECORD)
|
package.path = "../?.lua;"..package.path;
--[[
A program to iterate the Windows/fonts directory, looking
for .ttf files, and putting them into a table.
]]
local ffi = require("ffi")
local C = ffi.C
local blapi = require("blend2d.blend2d")
local errors = require("blerror")
local fsys = require("filesystem")
local FileSystem = fsys.FileSystem;
local FileSystemItem = fsys.FileSystemItem;
local fontDir = "c:\\windows\\fonts\\"
-- simple predicate to determine whether a file is
-- truetype or not
local function passTTF(item)
local name = item.Name:lower()
return name:find(".ttf", 1, true);
end
local fontStyle = {
[0] = "NORMAL",
"OBLIQUE",
"ITALIC",
}
fontStretch = {
[1] = "ULTRA_CONDENSED";
"EXTRA_CONDENSED";
"CONDENSED";
"SEMI_CONDENSED";
"NORMAL";
"SEMI_EXPANDED";
"EXPANDED";
"EXTRA_EXPANDED";
"ULTRA_EXPANDED";
};
fontWeight = {
[100] = "THIN",
[200] = "EXTRA_LIGHT",
[300] = "LIGHT",
[350] = "SEMI_LIGHT",
[400] = "NORMAL",
[500] = "MEDIUM",
[600] = "SEMI_BOLD",
[700] = "BOLD",
[800] = "EXTRA_BOLD",
[900] = "BLACK",
[950] = "EXTRA_BLACK"
};
local function printFontFaceInfo(face, fileName, filePath)
if not face then return false end
local dmetrics = face:designMetrics()
io.write("{")
io.write(string.format("%s = '%s'; ", "fileName", fileName))
io.write(string.format("%s = '%s'; ", "family", face:familyName()))
io.write(string.format("%s = '%s'; ", "subFamilyName", face:subfamilyName()))
io.write(string.format("%s = '%s'; ", "fullName", face:fullName()))
io.write(string.format("%s = '%s'; ", "postscriptName", face:postScriptName()))
io.write(string.format("%s = '%s'; ", "style", fontStyle[face:style()]))
--io.write(string.format("%s = '%s'; ", "filePath", filePath))
io.write(string.format("%s = '%s'; ", "stretch", fontStretch[face:stretch()]))
io.write(string.format("%s = '%s'; ", "weight", fontWeight[face:weight()]))
--[[
print("stretch: ", face:stretch());
print("weight: ", face:weight());
print("== dmetrics ==")
print("unitsPerEm: ", dmetrics.unitsPerEm);
print(" lineGap: ", dmetrics.lineGap);
print(" xHeight: ", dmetrics.xHeight);
print(" capHeight: ", dmetrics.capHeight);
print(" ascent: ", dmetrics.ascent);
print(" descent: ", dmetrics.descent);
--]]
print("};")
end
local function printFileItems(startat, filterfunc)
print("{")
for item in startat:itemsRecursive() do
if filterfunc then
if filterfunc(item) then
local fullPath = item:getFullPath()
local face, err = BLFontFace:createFromFile(fullPath)
printFontFaceInfo(face, item.Name, fullPath)
end
else
print(item.Name);
end
end
print("};")
end
printFileItems(FileSystemItem({Name=fontDir}), passTTF)
|
local View = {}
local mazeConfig = require "config.mazeConfig"
local UserDefault = require "utils.UserDefault"
local LeftMapX;
local LeftMapY;
local MiniMapWidth = 210;
local MiniMapHeight = 330;
local MapCenter;
local scaleWidth
local scaleHeight
function View:Start(data )
-- Minimap
self.view = CS.SGK.UIReference.Setup(self.gameObject)
local id = module.playerModule.Get().id;
self.MapSceneController = UnityEngine.GameObject.FindObjectOfType(typeof(SGK.MapSceneController));
local character = self.MapSceneController:Get(id)
self.character = character
local mig_1 = UnityEngine.GameObject.Find("mig_1")
self.miniMap_Obj_parent = mig_1
local pos = CS.SGK.UIReference.Setup(mig_1)
self.point1 = pos.point_1
self.point2 = pos.point_2
local pos1 = self.point1.gameObject.transform.localPosition
local pos2 = self.point2.gameObject.transform.localPosition
local center_pos = (pos1+pos2)/2
MapCenter = {x = center_pos.x,y = center_pos.y,z = center_pos.z }
LeftMapX = pos1.x
LeftMapY = pos2.z
-- ERROR_LOG("存档数据",sprinttb(self.miniMap_data));
self.today = math.floor(module.Time.now()/3600/24)
scaleWidth = MiniMapWidth/2/(MapCenter.x - LeftMapX);
scaleHeight = MiniMapHeight / 2 / (MapCenter.z - LeftMapY);
self.miniMap = self.view.MiniMap.mask.miniMap;
-- print(string.format( "MapCenter:%s scaleWidth : %s scaleHeight: %s LeftMapY: %s LeftMapX: %s",MapCenter,scaleWidth ,scaleHeight,LeftMapX,LeftMapY))
self:ClickEvent();
self.updateNpcList = {};
self:InitTexture();
self.eventQuest = mazeConfig.GetTypeInfo(10)
for k,v in pairs(self.eventQuest) do
if v.fight_id and v.fight_id ~=0 then
self:FreshDoneQuest(v.fight_id);
end
end
DispatchEvent("SCENE_READY_LOCAL");
self:PlayScreenEffect(0.1,SGK.Localize:getInstance():getValue("migong_kaishi"));
self.black_mask = self.view.black_mask.gameObject.transform.localScale
end
function View:FreshDoneQuest( quest_id ,playerEffect)
local index = 0;
for i=1,#self.eventQuest do
if self.eventQuest[i].fight_id == quest_id then
index = i;
break;
end
end
if index == 0 then
return;
end
local npc_id = self.eventQuest[index].id
local npc_info = module.TreasureMapModule.GetNPCOBJ(npc_id)
-- npc_info.obj.gameObject.transform.position
-- print(index,"============>>>>")
self.allMap = self.allMap or {}
if not module.QuestModule.Get(quest_id) or module.QuestModule.Get(quest_id).status ~= 1 then
self.view.MapRoot["Map"..index]:SetActive(false);
self.allMap[index] = nil
else
self.allMap[index] = true
SGK.Action.DelayTime.Create(1):OnComplete(function()
self.view.MapRoot["Map"..index]:SetActive(true);
end)
end
self:CheckAllMap()
end
function View:CheckAllMap( ... )
for i=1,4 do
if not self.allMap[i] then
-- self.view.Root.AllMap:SetActive(false);
-- self.view.Root.MapRoot:SetActive(true);
return
end
end
local openMap = mazeConfig.GetTypeInfo(100)
if not module.QuestModule.Get(openMap[1].fight_id) or module.QuestModule.Get(openMap[1].fight_id).status ~= 1 then
if not DialogStack.GetPref_list("treasure/TreasureMap") then
DialogStack.Push("treasure/TreasureMap",true);
SGK.Action.DelayTime.Create(3):OnComplete(function()
local npc_data = module.TreasureMapModule.GetNPCOBJ(openMap[1].id);
if npc_data and npc_data.obj then
npc_data.obj.gameObject.transform.position = self.character.gameObject.transform.position
self:CreateNPC(openMap[1].id);
end
end)
end
else
end
-- self.view.Root.AllMap:SetActive(true);
-- self.view.Root.MapRoot:SetActive(false);
end
local scale = 5
function View:InitTexture( )
self.pid = math.floor(module.playerModule.Get().id)
self.path =UnityEngine.Application.persistentDataPath .."/"..tostring(self.pid)..tostring(self.today)..".png";
-- path
self.texture_fow_bytes = CS.MinimapSystem.GetTexture(self.path );
ERROR_LOG("===========",self.texture_fow_bytes);
self.texture_fow = UnityEngine.Texture2D(math.floor( MiniMapWidth )/scale,math.floor(MiniMapHeight)/scale,UnityEngine.TextureFormat.ARGB32,true);
if not self.texture_fow_bytes then
for x=0,math.floor(MiniMapWidth)/scale-1 do
for y=0,math.floor(MiniMapHeight)/scale-1 do
self.texture_fow:SetPixel(x, y, UnityEngine.Color.black);
end
end
self.texture_fow:Apply();
self.view.MiniMap.mask.fow[UI.Image].sprite = UnityEngine.Sprite.Create(self.texture_fow,UnityEngine.Rect(0,0,math.floor(MiniMapWidth)/scale,math.floor(MiniMapHeight)/scale),UnityEngine.Vector2(0.5,0.5));
else
CS.MinimapSystem.LoadImage(self.texture_fow,self.texture_fow_bytes);
self.texture_fow:Apply();
self.view.MiniMap.mask.fow[UI.Image].sprite = UnityEngine.Sprite.Create(self.texture_fow,UnityEngine.Rect(0,0,math.floor(MiniMapWidth)/scale,math.floor(MiniMapHeight)/scale),UnityEngine.Vector2(0.5,0.5));
end
end
function View:OnDestroy( ... )
-- print("存档")
CS.MinimapSystem.SaveTexture(self.texture_fow,self.path)
end
function View:ClickEvent( ... )
CS.UGUIClickEventListener.Get(self.view.MapRoot.gameObject).onClick = function ( ... )
-- TreasureMap
-- print("============>>>>")
DialogStack.Push("treasure/TreasureMap");
end
self.view.black_mask:SetActive(true);
self.view.OpenFow[CS.UGUISpriteSelector].index = 0
CS.UGUIClickEventListener.Get(self.view.OpenFow.gameObject).onClick = function ( ... )
-- TreasureMap
-- index
if self.view.OpenFow[CS.UGUISpriteSelector].index == 1 then
self.view.OpenFow[CS.UGUISpriteSelector].index = 0
self.view.black_mask[UI.RawImage].raycastTarget = false
DispatchEvent("LOCAL_GAME3_CHANGE");
else
DispatchEvent("LOCAL_GAME3_CHANGE",true);
self.view.OpenFow[CS.UGUISpriteSelector].index = 1
self.view.black_mask[UI.RawImage].raycastTarget = true
end
end
self:SelectBtn();
-- CS.UGUIClickEventListener.Get(self.view.OpenFow.gameObject).onClick();
end
function View:SelectBtn( ... )
self.view.leave[CS.UGUISpriteSelector].index = self.isFollow and 1 or 0
CS.UGUIClickEventListener.Get(self.view.leave.gameObject).onClick = function ( ... )
if not self.isFollow then
SceneStack.EnterMap(1);
else
module.TreasureMapModule.ExitSmallGame();
end
end
end
function View:SetMiniMapPos( character ,minimap )
local local_chararor = self.miniMap_Obj_parent.transform:InverseTransformPoint(character.gameObject.transform.position)
local offest = local_chararor - UnityEngine.Vector3(MapCenter.x,MapCenter.y,MapCenter.z);
if minimap then
minimap[UnityEngine.RectTransform].anchoredPosition = UnityEngine.Vector2(- offest.x * scaleWidth, - offest.z * scaleHeight)
end
end
function View:GetFowPOS( character )
local local_chararor = self.miniMap_Obj_parent.transform:InverseTransformPoint(character.gameObject.transform.position)
local offest = local_chararor - UnityEngine.Vector3(MapCenter.x,MapCenter.y,MapCenter.z) - UnityEngine.Vector3(LeftMapX,0,LeftMapY);
return UnityEngine.Vector2(offest.x * scaleWidth, offest.z * scaleHeight);
end
function View:SetDone( x,y )
if self.texture_fow:GetPixel(x, y) == UnityEngine.Color.clear then
return;
end
-- if x < self.texture_fow.width or y < self.texture_fow.height then
-- return
-- end
self.texture_fow:SetPixel(x, y, UnityEngine.Color.clear);
end
local radius = 5
function View:SetPixels( ... )
local pos = self:GetFowPOS(self.character);
-- print(math.floor( pos.x/scale ), math.floor(pos.y/scale))
local _posx = math.floor( pos.x/scale )-1
local _posy = math.floor( pos.y/scale )-3
self:SetDone(_posx,_posy);
for x=-radius,radius do
for y=-radius,radius do
self:SetDone(_posx+x,_posy+y);
end
end
self.texture_fow:Apply();
end
function View:CreateNPC(id)
self.icons = self.icons or {}
if not self.updateNpcList[id] then
if self.icons[id] then
self:UpdateNPCPos(id);
self.icons[id].obj:SetActive(true);
else
self.icons[id] = self.icons[id] or {}
self.icons[id].obj = UnityEngine.GameObject.Instantiate((self.view.MiniMap.mask.miniMap.npcRoot.npc_icon.gameObject),self.view.MiniMap.mask.miniMap.npcRoot.gameObject.transform);
local info = mazeConfig.GetInfo(id);
self.icons[id].obj:GetComponent(typeof(CS.UGUISpriteSelector)).index = tonumber(info.icon) - 1
self:UpdateNPCPos(id);
self.icons[id].obj:SetActive(true);
end
else
if self.icons[id] then
self.icons[id].obj:SetActive(false);
end
end
end
function View:UpdateNPCPos( id )
local npc_obj = module.TreasureMapModule.GetNPCOBJ(id);
-- print("更新NPC位置",id)
if npc_obj and npc_obj.obj then
local local_chararor = self.miniMap_Obj_parent.transform:InverseTransformPoint(npc_obj.obj.transform.position)
local offest = local_chararor - UnityEngine.Vector3(MapCenter.x,MapCenter.y,MapCenter.z);
if self.icons[id] and self.icons[id].obj then
self.icons[id].obj:GetComponent(typeof(UnityEngine.RectTransform)).anchoredPosition = UnityEngine.Vector2(offest.x * scaleWidth, offest.z * scaleHeight)
end
end
end
function View:Update( ... )
self.time = self.time or 0
if not self.offest_time then
self.offest_time = self.offest_time or self.time
return;
end
self.offest_time = self.offest_time + UnityEngine.Time.deltaTime
if self.offest_time - self.time >10 then
self.offest_time = self.time
print("自动存档",self.path)
CS.MinimapSystem.SaveTexture(self.texture_fow,self.path)
end
if not self.isFollow then
-- print("===========")
self:SetMiniMapPos(self.character,self.miniMap);
self:SetMiniMapPos(self.character,self.view.MiniMap.mask.fow);
-- self:UpdateAllNPC();
self:SetPixels();
end
end
function View:UpdateAllNPC( ... )
-- if self.updateNpcList then
-- for k,v in pairs(self.updateNpcList) do
-- if v == 1 then
-- self:UpdateNPCPos(k);
-- end
-- end
-- end
end
function View:onEvent(event,data)
if event == "PLAYER_FILED_CUT" then
if data then
self.view.black_mask.gameObject.transform.localScale = self.black_mask
else
self.view.black_mask.gameObject.transform.localScale = self.view.black_mask.gameObject.transform.localScale - UnityEngine.Vector3(0.1,0.1,0.1)
end
elseif event == "PLAYSCREENEFFECT" then
local time,content,callback,tips = table.unpack(data)
print("PLAYSCREENEFFECT",sprinttb(data))
self:PlayScreenEffect(time,content,callback,tips);
elseif event =="LOCAL_UPDATE_NPC" then
if data then
self.updateNpcList = self.updateNpcList or {}
if self.updateNpcList then
self.updateNpcList[data.id] = data.status == true and 1 or nil
end
print("=====>>>更新小地图状态",self.updateNpcList[data.id] )
self:CreateNPC(data.id);
end
elseif event == "MOVE_TO_SMALL_GAME" then
-- print("========>>",event,data)
self.view.OpenFow.gameObject:SetActive(module.TreasureMapModule.GetGameStatus() and module.TreasureMapModule.GetGameStatus() == 3);
self.isFollow = data
if data then
self:CloseMiniMap(false);
else
self.view.tips:SetActive(false);
self:CloseMiniMap(true);
end
if DialogStack.GetPref_list("treasure/TreasureSmall4") then
DialogStack.Pop();
end
self:SelectBtn()
elseif event == "QUEST_INFO_CHANGE" then
if data and data.npc_id then
local info = mazeConfig.GetInfo(data.npc_id);
-- print("任务",sprinttb(info))
if not info or info.type ~= 10 then
return
end
self:FreshDoneQuest(info.fight_id,true);
end
elseif event == "LOCAL_CLOSE_MINIMAP" then
self.isFollow = true
self:CloseMiniMap(false);
self.view.tips:SetActive(false);
self:SelectBtn()
elseif event == "LOCAL_PLAY_FLY" then
self:PlayerFly(data);
elseif event == "CLEAR_ALL_ROAD" then
self.view.OpenFow.gameObject:SetActive(false)
end
end
function View:CloseMiniMap( status )
self.view.MiniMap.gameObject:SetActive(status)
self.view.MapRoot.gameObject:SetActive(status)
self.view.mini_mask.gameObject:SetActive(status)
end
function View:PlayScreenEffect(time,content,callback,status)
utils.SGKTools.StopPlayerMove()
utils.SGKTools.LockMapClick()
time = time or 0.1
utils.SGKTools.LockMapClick(true)
self.view.Effect:SetActive(true);
self.view.Effect.Content:SetActive(false);
self.view.tips:SetActive(false)
print("exbg",time)
self.view.Effect.exbg[UI.Image]:DOFade(1,time):OnComplete(function()
self.view.Effect.exbg[UI.Image].color = UnityEngine.Color(0,0,0,0)
self.view.Effect.bg:SetActive(true);
if callback then
callback();
end
if content then
self.view.Effect.Content:SetActive(true);
self.view.Effect.Content[UI.Text].text = content
end
SGK.Action.DelayTime.Create(5):OnComplete(function()
utils.SGKTools.LockMapClick()
self.view.Effect.Content:SetActive(false);
self.view.Effect.bg:SetActive(false);
self.view.Effect:SetActive(false);
if status then
self.view.tips.Text[UI.Text].text = status
self.view.tips:SetActive(true)
end
end)
end)
end
function View:PlayerFly( index )
self.prefab_fly = self.prefab_fly or SGK.ResourcesManager.Load("prefabs/effect/UI/fx_ui_dati_lizi.prefab");
self.prefab = self.prefab or SGK.ResourcesManager.Load("prefabs/effect/UI/fx_ui_dati_bao.prefab");
local o = UnityEngine.GameObject.Instantiate(self.prefab_fly,self.view.transform);
o.transform.localPosition = UnityEngine.Vector3(0,0,0);
o.transform.localScale=Vector3.one*100
o.layer = UnityEngine.LayerMask.NameToLayer("UI");
for i = 0,o.transform.childCount-1 do
o.transform:GetChild(i).gameObject.layer = UnityEngine.LayerMask.NameToLayer("UI");
end
local pos = self.view.MapRoot["Map"..index].gameObject.transform.position
local tagetPos = self.view.gameObject.transform:InverseTransformPoint(pos)
o.transform:DOLocalMove(tagetPos,1):OnComplete(function( ... )
local _o = self.prefab and UnityEngine.GameObject.Instantiate(self.prefab, self.view.transform);
_o.transform.localScale = Vector3.one*100
_o.transform.localPosition = tagetPos
_o.layer = UnityEngine.LayerMask.NameToLayer("UI");
for i = 0,_o.transform.childCount-1 do
_o.transform:GetChild(i).gameObject.layer = UnityEngine.LayerMask.NameToLayer("UI");
end
local _obj = _o:GetComponentInChildren(typeof(UnityEngine.ParticleSystem))
UnityEngine.Object.Destroy(_o, _obj.main.duration)
CS.UnityEngine.GameObject.Destroy(o)
end)
end
-- function View:( ... )
-- -- body
-- end
function View:listEvent()
return{
"PLAYER_FILED_CUT",
"PLAYSCREENEFFECT",
"LOCAL_UPDATE_NPC",
"MOVE_TO_SMALL_GAME",
"LOCAL_MINIMAP_FOLLOW",
"QUEST_INFO_CHANGE",
"LOCAL_CLOSE_MINIMAP",
"LOCAL_PLAY_FLY",
"CLEAR_ALL_ROAD",
}
end
return View
|
local State = require 'squeak.state'
describe('State', function()
it('works at all', function()
assert.are.equal('table', type(State))
end)
end)
|
---
-- Sequential and parallel stream processing library for Lua
--
--
local t={}
local main_mt={}
local mt={}
---
-- Creates an empty stream
function t.new(f)
return setmetatable({},mt)
end
---
-- Evaluates if the passed object is a stream
function t.is_stream(obj)
return getmetatable(obj)==mt
end
---
-- Creates an empty stream
function t.empty()
local stream=t.new(function() end)
stream:close()
return stream
end
---
-- Returns a sequential Stream containing the elements.
function t.of(...)
end
function t.concat(stream1,stream2)
end
function main_mt.__call(...)
return t.new(...)
end
---
-- Returns a stream consisting of the results of applying the given
-- function to the elements of this stream.
--
function mt:map(f)
end
---
-- Returns a stream consisting of the results of replacing each element of
-- this stream with the contents of a mapped stream produced by applying
-- the provided mapping function to each element.
--
function mt:flatMap(f,stream)
end
---
-- Returns a stream consisting of the elements of this stream that match
-- the given predicate.
function mt:filter(f)
end
---
-- Returns a stream consisting of the distinct elements (according to
-- the __eq metamethod) of this stream.
function mt:distinct()
end
---
-- Returns a stream consisting of the elements of this stream, sorted
-- according to natural order. If the elements of this stream are not
-- comparable, an error may be thrown when the terminal operation is executed.
function mt:sorted(comparator)
end
---
-- Returns a stream consisting of the elements of this stream, additionally
-- performing the provided action on each element as elements are consumed
-- from the resulting stream.
--
function mt:peek(f)
end
---
-- Returns a stream consisting of the elements of this stream, truncated
-- to be no longer than max_size in length.
function mt:limit(max_size)
end
---
-- Returns a stream consisting of the remaining elements of this stream
-- after discarding the first n elements of the stream.
-- If this stream contains fewer than n elements then an
-- empty stream will be returned.
function mt:skip(n)
end
---
-- Performs an action for each element of this stream.
function mt:forEach(f)
end
---
-- Returns an array containing the elements of this stream.
function mt:to_array()
end
---
-- Performs a reduction on the elements of this stream,
-- using the provided identity value and an
-- associative accumulation function, and returns the reduced value.
function mt:reduce(f, identity)
end
---
-- Returns the count of elements in this stream.
function mt:count()
end
---
-- Returns whether any elements of this stream match the provided
-- predicate. May not evaluate the predicate on all elements if not
-- necessary for determining the result. If the stream is empty then
-- false is returned and the predicate is not evaluated.
function mt:any_match(f)
end
---
-- Returns whether all elements of this stream match the provided predicate.
-- May not evaluate the predicate on all elements if not necessary for
-- determining the result. If the stream is empty then true is
-- returned and the predicate is not evaluated.
function mt:all_match(f)
end
---
-- Returns whether no elements of this stream match the provided predicate.
-- May not evaluate the predicate on all elements if not necessary for
-- determining the result. If the stream is empty then true is
-- returned and the predicate is not evaluated.
function mt:none_match(predicate)
end
---
-- Returns a value describing the first element of this stream,
-- or nil if the stream is empty. If the stream has
-- no encounter order, then any element may be returned.
function mt:first()
end
---
-- Returns a value describing some element of the stream, or an
-- nil if the stream is empty.
function mt:any()
end
---
-- Closes the current stream
function mt:close()
end
return setmetatable(t,main_mt)
|
ITEM.name = "Midnight"
ITEM.replacements = "models/nasca/stalker/male_midnight_lone.mdl"
ITEM.model = "models/stalker/outfit/sunrise.mdl"
ITEM.description = "A Midnight suit."
ITEM.longdesc = "This suit is practically identicial in all ways to the PS5-M Universial Protection. However, it is slightly less effective overall due to the lower quality materials used to produce it."
ITEM.width = 2
ITEM.height = 3
ITEM.price = 41800
ITEM.flag = "b"
ITEM.isHelmet = true
ITEM.isGasmask = true
ITEM.artifactcontainers = {"1"}
ITEM.weight = 10
ITEM.res = {
["Bullet"] = 0.40,
["Blast"] = 0.35,
["Fall"] = 0.35,
["Burn"] = 0.20,
["Radiation"] = 0.20,
["Chemical"] = 0.35,
["Shock"] = 0.20,
["Psi"] = 0.00,
}
|
data:extend(
{
--electric fly swatter
{
type = "build-entity-achievement",
name = "electric-fly-swat",
order = "a[kill]",
to_build = "tesla-turret",
icon = "__military-extended__/graphics/achievements/fly-swatter.png"
},
--storm of bullets
{
type = "kill-achievement",
name = "heavy-bullet-storm",
order = "a[kill]",
type_to_kill = "unit",
amount = 100,
personally = true,
damage_type = "hard-physical",
icon = "__military-extended__/graphics/achievements/bullet-storm.png"
}
})
|
local DrawSystem = class("DrawSystem", System)
function DrawSystem:draw()
camera:attach()
-- draw arena TODO: temporary
-- love.graphics.setColor(20, 20, 20)
-- love.graphics.rectangle("fill", 0, 0, 1000, 1000)
local mapDefinitions = Utils.mapDefinitions
love.graphics.draw(ImageController.getImage("map"), -mapDefinitions.xOffset, -mapDefinitions.yOffset)
--[[for i, v in pairs(self.targets.oldEntities) do
local position = v:get("Position")
local circle = v:get("Circle")
local color = v:get("Color")
love.graphics.setColor(color.r, color.g, color.b)
love.graphics.circle("fill", position.x, position.y, circle.radius)
end
love.graphics.setColor(255, 255, 255)--]]
for i, v in pairs(self.targets) do
local position = v:get("Position")
local animation = v:get("Animation")
local circle = v:get("Circle")
local tex, quad = animation:getSprite()
local x, y, w, h = quad:getViewport()
w = w / 2;
h = h / 2;
local xScale = circle.radius / w
local ySclae = circle.radius / h
love.graphics.draw(tex, quad, position.x, position.y, animation.rotation, xScale, yScale, w, h)
end
camera:detach()
end
function DrawSystem:requires()
return {"Position", "Animation", "Circle"}
--return {oldEntities = {"Position", "Circle", "Color"}, animated = {"Position", "Animation", "Circle"}}
end
return DrawSystem
|
local version, postfix = '1.1', '1_1'
-- local version, postfix = 'dev', 'dev'
local share_name = 'minizip_ffi_mem_share'
local so_name = 'libminizip_' .. postfix
local ffi = require 'ffi'
local DIR_SEP = ffi.os == 'Windows' and '\\' or '/'
local mod_path = package.searchpath(share_name, package.path)
local pat = '^(.*' .. DIR_SEP .. ')[^' .. DIR_SEP .. ']+'
local mod_dir = mod_path:match(pat) or ''
local function read_all(filename)
local fh = assert(io.open(mod_dir .. filename, 'r'))
local str = assert(fh:read('*a'))
assert(fh:close())
return str
end
ffi.cdef(read_all('minizip_ffi_mem_share.h'))
ffi.cdef(read_all('minizip_ffi_mem_' .. postfix .. '.h'))
local ext_name = (ffi.os == 'OSX' and 'dylib' or 'so')
local so_path = ('./%s.%s'):format(so_name, ext_name)
so_path = package.searchpath(so_name, package.cpath) or so_path
local MZ = ffi.load(so_path)
local function load_mod(mod_name, ...)
local mod_path = package.searchpath(mod_name, package.path)
--local mod = loadfile(mod_path)(...)
local ok, mod, msg = pcall(loadfile, mod_path)
assert(ok, mod)
assert(mod, msg)
return mod(...)
end
local mod = load_mod('minizip_ffi_mem_' .. postfix, MZ)
mod = load_mod(share_name, MZ, mod, DIR_SEP)
mod.version = version
return mod
|
local LOGLEVEL = "debug"
local MIN = module:get_option_number("conference_timeout", 10)
local TIMEOUT = MIN
local is_healthcheck_room = module:require "util".is_healthcheck_room
local st = require "util.stanza"
local timer = require "util.timer"
module:log(LOGLEVEL, "loaded")
module:hook("muc-occupant-left", function (event)
local room = event.room
local mods = room:each_affiliation("owner");
local leaver = event.occupant.bare_jid;
local a = 0;
local b = 0;
for mod in mods do
a = a + 1;
if mod == leaver then
room:set_affiliation(true, leaver, "outcast");
module:log("info", "still a moderator present");
a = a - 1;
end
end
for mod in mods do
module:log("info", "mods: %s", a);
if a == 1 then
if is_healthcheck_room(room.jid) then
module:log(LOGLEVEL, "skip restriction")
return
end
room:broadcast_message(
st.message({ type="groupchat", from=room.jid })
:tag("subject")
:text("The conference will end in "..MIN.." sec"):up())
module:log(LOGLEVEL, "set timeout for conference, %s secs, %s",
TIMEOUT, room.jid)
timer.add_task(TIMEOUT, function()
if is_healthcheck_room(room.jid) then
return
end
for mod in mods do
b = b + 1;
end
if b == 1 then
for _, p in room:each_occupant() do
room:broadcast_message(
st.message({ type="groupchat", from=room.jid })
:tag("subject")
:text("THE CONFERENCE IS OVER"):up())
room:set_affiliation(true, p.jid, "outcast")
module:log("info", "kick the occupant, %s", p.jid)
module:log("info", "the conference terminated")
end
else
module:log("info", "still a moderator present");
room:broadcast_message(
st.message({ type="groupchat", from=room.jid })
:tag("subject")
:text(roomName))
end
end)
end
end
end)
|
Extended = {}
-- private variables
local callbacks = {}
-- hooked functions
local function onExtendedOpcode(protocol, opcode, buffer)
local callback = callbacks[opcode]
if callback then
callback(protocol, opcode, buffer)
end
end
-- public functions
function Extended.init()
connect(ProtocolGame, { onExtendedOpcode = onExtendedOpcode } )
end
function Extended.terminate()
disconnect(ProtocolGame, { onExtendedOpcode = onExtendedOpcode } )
callbacks = nil
Extended = nil
end
function Extended.register(opcode, callback)
if not callback or type(callback) ~= 'function' then
error('Invalid callback.')
return false
end
if opcode < 0 or opcode > 255 then
error('Invalid opcode. Range: 0-255')
return false
end
if callbacks[opcode] then
error('Opcode is already taken.')
return false
end
callbacks[opcode] = callback
return true
end
function Extended.unregister(opcode)
if opcode < 0 or opcode > 255 then
error('Invalid opcode. Range: 0-255')
return false
end
if not callbacks[opcode] then
error('Opcode is not registered.')
return false
end
callbacks[opcode] = nil
return true
end
|
--this is the file that users will run to use hive, it will provide the last resort error handler
--this program is assigned to Lupus590
local helpPath = "Hive/src/Help/"
local helpDocs = {server = "server.txt", turtle = "turtle.txt", client = "client.txt"}
local fileNames = {server = "server.lua", turtle = "turtle.lua", client = "client.lua"}
local logPath = "Hive/src/Logs/"
local logNames = (server = "server.log", turtle = "turtle.log", client = "client.log"}
local errorLols = {[1] = "","",""}
local function clearScreen()
term.setTextColour(colours.white)
term.setTextBackground(colours.white)
term.clear()
term.setCursorPos(1,1)
end
local args = {...} --name of "component" to run
local ok, rValue --did the program return ok, and what did it return
if #args == 0 then
--ask user what program to run and for parameters to pass
else
local program = table.remove(args,1) --remove the program name from the args, args will be passed to the launched component
if program == fileNames.surver then
clearScreen()
ok,rValue = pcall(shell.run,fileNames.server,unpack(args))
elseif program == fileNames.turtle then
clearScreen()
ok,rValue = pcall(shell.run,fileNames.turtle,unpack(args))
elseif program == fileNames.client then
clearScreen()
ok,rValue = pcall(shell.run,fileNames.client,unpack(args))
elseif program == "help"
--i have no idea what to put here
elseif program == "update"
--download latest files from github
else
error("First parameter is not the name of a hive component, if you renamed them then you need to update this script",2)
end
--error handling starts here
if not ok then
clearScreen()
print("Something went horribly wrong!")
print("Error: "..tostring(rValue))
print("This was not meant to happen.")
print("You found an error that Hive could not recover from, please report it on github https://github.com/lupus590/CC-Hive/issues/new or on the CC forum thread http://www.computercraft.info/forums2/index.php?/topic/22421-")
print("Hive has been writing error logs while it was working, we can use these logs to track down where the error happened and what caused it.")
print("The logs can be found at: "..logPath)
if http then
print("Would you like this program to upload the error logs to pastebin? [y/n]")
local _, confirm
while not (confirm == "y" or confirm =="Y" or confirm == "n" or conform == "N") do
_, confirm = os.pullEvent("char")
print("")
if confirm:lower() == "y" then
--TODO: integrate with github and auto post an issue (https://developer.github.com/v3/issues/#create-an-issue)
--upload each log to pastebin (eventually returns pasteCodes or pasteURLs)
print("The error logs were uploaded to: pastebin.com/"..pasteCodes)
elseif confirm:lower() == "n" then
print("Please upload the logs yourself, find them at: "..logPath)
else
--wait for proper confirmation
end
end
else --no HTTP
print("Please upload the logs yourself, find them at: "..logPath)
end
end
end
|
object_tangible_loot_creature_loot_collections_contraband_style1_01 = object_tangible_loot_creature_loot_collections_shared_contraband_style1_01:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_contraband_style1_01, "object/tangible/loot/creature/loot/collections/contraband_style1_01.iff")
|
local objects =
{
--Maxime
createObject ( 18024, 1424.40002, -2442.3999, 15.7 ,0, 0, 0 ,38),
createObject ( 3037, 1416.09998, -2452.30005, 14.8, 0, 0, 90 ,38),
createObject ( 3037, 1428.59961, -2452.2998, 14.8, 0, 0, 90 ,38),
createObject ( 1495, 1432.09998, -2441.19995, 12.7 ,0, 0, 0 ,38),
createObject ( 14782, 1430.90002, -2449, 13.7, 0, 0, 90 ,38),
createObject ( 11392, 1424.19995, -2438.19995, 12.6, 0, 0, 180 ,38),
createObject ( 927, 1414.5, -2451.3999, 13.9, 0, 0, 90 ,38),
createObject ( 2653, 1414.90002, -2437.3999, 18.7, 0, 180.005, 0 ,38),
createObject ( 2653, 1414.89941, -2448.5, 18.7, 0, 180, 0 ,38),
createObject ( 930, 1415.30005, -2438, 13.5 ,0, 0, 0 ,38),
createObject ( 2991, 1416.40002, -2433.5, 13.7 ,0, 0, 0 ,38),
createObject ( 2991, 1416.40002, -2433.5, 14.8 ,0, 0, 0 ,38),
createObject ( 944, 1415.2998, -2436.09961, 13.9, 0, 0, 90 ,38),
createObject ( 920, 1431.19922, -2445.19922, 13.1 ,0, 0, 0 ,38),
createObject ( 13647, 1425.5, -2420, 13.2, 0, 179.995, 90 ,38),
createObject ( 13647, 1427.5, -2420, 13.2, 0, 180, 90 ,38),
createObject ( 964, 1420.5, -2434.2998, 12.6 ,0, 0, 0 ,38),
createObject ( 13647, 1425.5, -2457.8999, 7.73, 0, 196.433, 270 ,38),
createObject ( 13647, 1427.5, -2457.8999, 7.73, 0, 196.43, 270 ,38),
createObject ( 2986, 1415.19922, -2449.2998, 17.99 ,0, 0, 0 ,38),
createObject ( 1778, 1433.80005, -2445.30005, 12.8, 0, 0, 89.022 ,38),
createObject ( 2009, 1433.7998, -2446.5, 12.8, 0, 0, 179.995 ,38),
createObject ( 1671, 1432.59961, -2446.69922, 13.2, 0, 0, 57.541 ,38),
createObject ( 2607, 1429.09961, -2446.89941, 13, 0, 0, 90 ,38),
createObject ( 2961, 1431.89941, -2445, 14.3 ,0, 0, 0 ,38),
createObject ( 3077, 1414.89941, -2443, 12.5, 0, 0, 270 ,38),
createObject ( 3017, 1429.09998, -2447.6001, 13.42 ,0, 0, 0 ,38),
createObject ( 14680, 1424, -2438.1001, 15.1 ,0, 0, 0 ,38),
createObject ( 14680, 1424.19922, -2445.59961, 15.1 ,0, 0, 0 ,38),
createObject ( 14680, 1433.69922, -2445.59961, 15.1 ,0, 0, 0 ,38),
createObject ( 14680, 1424.09998, -2453.1001, 15.1 ,0, 0, 0 ,38),
createObject ( 14680, 1417.7998, -2445.59961, 15.1 ,0, 0, 0 ,38),
createObject ( 2518, 1414.90002, -2447.30005, 12.6, 0, 0, 90 ,38),
createObject ( 14578, 1428.19922, -2452.09961, 17.9 ,0, 0, 0 ,38),
createObject ( 14882, 1437.09961, -2445.2998, 14.6, 0, 0, 92.082 ,38),
createObject ( 3029, 1423, -2452.1001, 12.5, 0, 0, 90 ,38),
createObject ( 3576, 1433, -2439.5, 14.3, 0, 0, 180 ,38),
createObject ( 3084, 1433.69995, -2443, 14.2, 0, 90, 270 ,38),
createObject ( 1025, 1429.59998, -2449.80005, 15.5, 0, 0, 180 ,38),
createObject ( 1098, 1429.59998, -2450.8999, 16.6, 0, 0, 180 ,38),
createObject ( 1097, 1429.59998, -2447.6001, 15.5, 0, 0, 179.995 ,38),
createObject ( 1082, 1429.59998, -2446.5, 15.5, 0, 0, 179.995 ,38),
createObject ( 1083, 1429.59998, -2448.69995, 15.5, 0, 0, 179.995 ,38),
createObject ( 1084, 1429.59998, -2448.69995, 14.4, 0, 0, 179.995 ,38),
createObject ( 1085, 1429.59998, -2449.80005, 14.4, 0, 0, 179.995 ,38),
createObject ( 1096, 1429.59998, -2450.8999, 15.5, 0, 0, 179.995 ,38),
createObject ( 1079, 1429.59998, -2449.80005, 13.3, 0, 0, 179.995 ,38),
createObject ( 1077, 1429.59998, -2450.8999, 13.3, 0, 0, 179.995 ,38),
createObject ( 1081, 1429.59998, -2450.8999, 14.4, 0, 0, 179.995 ,38),
createObject ( 1080, 1429.59998, -2448.68994, 13.3, 0, 0, 179.995 ,38),
createObject ( 1075, 1429.59998, -2449.80005, 16.6, 0, 0, 179.995 ,38),
createObject ( 1074, 1429.59998, -2446.5, 16.6, 0, 0, 179.995 ,38),
createObject ( 1073, 1429.59998, -2447.6001, 16.6, 0, 0, 179.995 ,38),
createObject ( 1076, 1429.59998, -2448.69995, 16.6, 0, 0, 179.995 ,38),
createObject ( 13639, 1426.5, -2436.19995, 7.4, 315, 0, 0 ,38),
createObject ( 10789, 205.60001, -120.2, 50.4 ,0, 0, 0 ,38),
createObject ( 10789, 1439.59998, -2419.1001, 14.9, 0, 0, 270 ,38),
}
local col = createColSphere(1422.083984375, -2451.73828125, 13.5546875 ,20)
local function watchChanges( )
if getElementDimension( getLocalPlayer( ) ) > 0 and getElementDimension( getLocalPlayer( ) ) ~= getElementDimension( objects[1] ) and getElementInterior( getLocalPlayer( ) ) == getElementInterior( objects[1] ) then
for key, value in pairs( objects ) do
setElementDimension( value, getElementDimension( getLocalPlayer( ) ) )
end
elseif getElementDimension( getLocalPlayer( ) ) == 0 and getElementDimension( objects[1] ) ~= 65535 then
for key, value in pairs( objects ) do
setElementDimension( value, 65535 )
end
end
end
addEventHandler( "onClientColShapeHit", col,
function( element )
if element == getLocalPlayer( ) then
addEventHandler( "onClientRender", root, watchChanges )
end
end
)
addEventHandler( "onClientColShapeLeave", col,
function( element )
if element == getLocalPlayer( ) then
removeEventHandler( "onClientRender", root, watchChanges )
end
end
)
-- Put them standby for now.
for key, value in pairs( objects ) do
setElementDimension( value, 65535 )
end
for index, object in ipairs ( objects ) do
setElementDoubleSided ( object, true )
--setElementCollisionsEnabled ( object, true )
end
|
local Ltn12 = require "ltn12"
local Json = require "cjson"
local Httpc = require "copas.http"
local Http = require "socket.http"
local Https = require "ssl.https"
local M = {}
function M.json (options)
assert (type (options) == "table")
local result = {}
options.sink = Ltn12.sink.table (result)
options.body = options.body and Json.encode (options.body)
options.source = options.body and Ltn12.source.string (options.body)
options.headers = options.headers or {}
options.headers ["Content-length"] = options.body and #options.body or 0
options.headers ["Content-type" ] = options.body and "application/json"
options.headers ["Accept" ] = "application/json"
local http
if options.copas then
http = Httpc
else
http = options.url:match "https://"
and Https
or Http
end
local _, status, headers = http.request (options)
result = #result ~= 0
and Json.decode (table.concat (result))
return result, status, headers
end
return M
|
--[[
消耗品
--]]
local THIS_MODULE = ...
local C_LOGTAG = "Consumable"
local Consumable = class("Consumable", import(".Item"))
-- 构造函数
function Consumable:ctor(type,config)
if type == "SERIALIZE" then
self:loadSerialize(config)
else -- NEW
if iskindof(config,"Item") then
config = config:saveSerialize()
Consumable.super.loadSerialize(self,config)
else
Consumable.super.initWithConfig(self,config)
end
if Consumable.super.checkValid(self) then
self:initWithConfig(config)
end
end
end
-- 保存序列
function Consumable:saveSerialize(serialize)
serialize = serialize or {}
Consumable.super.saveSerialize(self,serialize)
serialize._nowtimes = self._nowtimes
serialize._useup = self._useup
return serialize
end
-- 加载序列
function Consumable:loadSerialize(serialize)
Consumable.super.loadSerialize(self,serialize)
if Consumable.super.checkValid(self) then
self._nowtimes = serialize._nowtimes or 0
self._useup = serialize._useup
self._consumdb = dbMgr.consumables[self:getDataID()]
end
self:setValid(self:checkValid())
end
-- 通过新创建初始化
function Consumable:initWithConfig(config)
self._nowtimes = config.nowtimes or 0
self._useup = false
self._consumdb = dbMgr.consumables[self:getDataID()]
if not self._consumdb then
logMgr:warn(C_LOGTAG, "consumable [%d] is't found !!!",self:getDataID())
end
self:setValid(self:checkValid())
end
-- 饰品是否有效
function Consumable:checkValid()
return (self._consumdb and Consumable.super.checkValid(self))
end
-- 获得最少消耗次数
function Consumable:getMinTimes()
return self._consumdb.mintimes
end
-- 获得随机消耗次数
function Consumable:getRandTimes()
return self._consumdb.randtimes
end
-- 获得当前物品使用次数
function Consumable:getUseTimes()
local randtimes = self._consumdb.randtimes or 0
return (randtimes ~= 0 and math.random(0,randtimes) or 0) + self._consumdb.mintimes
end
-- 获得物品回复力
function Consumable:getRecovery()
return self._consumdb.recovery
end
-- 获得复活兵力
function Consumable:getReviveSoldiers()
return self._consumdb.revivesoldiers
end
-- 获得使用音效
function Consumable:getUseSE()
return self:getItemSE("use")
end
-- 堆叠物品
function Consumable:stackItem(item)
if Consumable.super.stackItem(self,item) then
local totaltimes = self._nowtimes + item._nowtimes
local usetimes = self:getUseTimes()
if totaltimes >= usetimes then
self:_addCount(-math.floor(totaltimes/usetimes))
self._nowtimes = totaltimes % usetimes
else
self._nowtimes = totaltimes
end
end
end
-- 拆分物品
function Consumable:splitItem(count)
local spitem = Consumable.super.splitItem(self,count)
if count > 0 then
self._nowtimes = 0
self._useup = false
end
return spitem
end
-- 尝试使用该物品
function Consumable:tryUseItem()
if not self:isUseUp() then
self._nowtimes = self._nowtimes + 1
if self._nowtimes >= self:getUseTimes() then
self._useup = true
end
return true
end
end
-- 该物品是否用尽
function Consumable:isUseUp()
return (not self:isValid() or self._useup)
end
-------------------------------------------------------------
-- 类型提升
function Consumable:upgradeType()
return self
end
-------------------------------------------------------------
return Consumable
|
function Message(msg)
print("[TTT WeightSystem] ".. msg .. ".")
end
|
local Chunk = require("__stdlib__/stdlib/area/chunk")
function findNestNear(entity, chunk_position)
local search = Chunk.to_area(chunk_position)
local spawners = entity.surface.find_entities_filtered{area = search, type = "unit-spawner"}
if #spawners > 0 then
return spawners[math.random(#spawners)]
end
if settings.global["ion-cannon-target-worms"].value then
local worms = entity.surface.find_entities_filtered{area = search, type = "turret"}
if #worms > 0 then
return worms[math.random(#worms)]
end
end
return false
end
script.on_event(defines.events.on_sector_scanned, function(event)
if #global.forces_ion_cannon_table["Queue"] > 0 then
local target = global.forces_ion_cannon_table["Queue"][1]
if target and target.valid then
for i, force in pairs(game.forces) do
if settings.global["ion-cannon-min-cannons-ready"].value < countIonCannonsReady(force) then
local current_tick = game.tick
if global.auto_tick < current_tick then
global.auto_tick = current_tick + (settings.startup["ion-cannon-heatup-multiplier"].value * 210)
local fired = targetIonCannon(force, target.position, target.surface)
if fired then
for i, player in pairs(force.connected_players) do
if settings.get_player_settings(player)["ion-cannon-custom-alerts"].value then
player.add_custom_alert(target, {type = "item", name = "orbital-ion-cannon"}, {"ion-cannon-target-location", fired, target.position.x, target.position.y, "Auto"}, true)
end
end
table.remove(global.forces_ion_cannon_table["Queue"], 1)
break
end
end
end
end
else
table.remove(global.forces_ion_cannon_table["Queue"], 1)
end
end
if global.permissions[-2] then
local radar = event.radar
local force = radar.force
if force.technologies["auto-targeting"].researched == true and settings.global["ion-cannon-min-cannons-ready"].value < countIonCannonsReady(force) then
local target = findNestNear(radar, event.chunk_position)
if target then
local fired = targetIonCannon(force, target.position, radar.surface)
if fired then
for i, player in pairs(force.connected_players) do
if settings.get_player_settings(player)["ion-cannon-custom-alerts"].value then
player.add_custom_alert(target, {type = "item", name = "orbital-ion-cannon"}, {"auto-target-designated", radar.backer_name, target.position.x, target.position.y}, true)
end
end
end
end
end
end
end)
script.on_event(defines.events.on_biter_base_built, function(event)
if settings.global["ion-cannon-auto-target-visible"].value then
local base = event.entity
for i, force in pairs(game.forces) do
if force.technologies["auto-targeting"].researched == true and force.is_chunk_visible(base.surface, Chunk.from_position(base.position)) then
table.insert(global.forces_ion_cannon_table["Queue"], base)
return
end
end
end
end)
|
local SceneManager = require 'squeak.sceneManager'
local Scene = require 'squeak.scene'
describe('SceneManager', function()
local scene, sm
before_each(function()
scene = Scene()
sm = SceneManager()
end)
it('can add scenes', function()
local result = sm:add('first', scene)
assert.are.equal(scene, result)
assert.are.equal(sm, scene.parent)
end)
it('calls lifecycle methods when switching scenes', function()
local scene2 = Scene()
sm:add('first', scene)
sm:add('second', scene2)
sm:switch('first')
sm:draw()
local leaveCalled = false
scene.leave = function() leaveCalled = true end
local enterCalled = false
scene2.enter = function() enterCalled = true end
sm:switch('second')
assert.falsy(leaveCalled)
assert.falsy(enterCalled)
sm:draw()
assert.truthy(leaveCalled)
assert.truthy(enterCalled)
end)
end)
|
--***********************************************************
--** THE INDIE STONE **
--***********************************************************
require "TimedActions/ISBaseTimedAction"
---@class ISEjectMagazine : ISBaseTimedAction
ISEjectMagazine = ISBaseTimedAction:derive("ISEjectMagazine")
function ISEjectMagazine:isValid()
return self.character:getPrimaryHandItem() == self.gun
end
function ISEjectMagazine:start()
if not self.gun:isContainsClip() then
self:forceStop()
return
end
self.character:setVariable("WeaponReloadType", self.gun:getWeaponReloadType())
self.character:setVariable("isUnloading", true)
self:setOverrideHandModels(self.gun, nil)
self:setActionAnim(CharacterActionAnims.Reload)
self.character:reportEvent("EventReloading");
self:initVars()
end
function ISEjectMagazine:update()
-- FIXME: jobDelta is always zero since maxTime is -1
self.gun:setJobDelta(self:getJobDelta())
end
function ISEjectMagazine:initVars()
ISReloadWeaponAction.setReloadSpeed(self.character, false)
end
function ISEjectMagazine:unloadAmmo()
-- get back the magazine if there was one in the gun
if self.gun:isContainsClip() then
local newMag = InventoryItemFactory.CreateItem(self.gun:getMagazineType())
newMag:setCurrentAmmoCount(self.gun:getCurrentAmmoCount())
self.character:getInventory():AddItem(newMag)
self.gun:setContainsClip(false)
self.gun:setCurrentAmmoCount(0)
end
end
function ISEjectMagazine:animEvent(event, parameter)
if event == 'playReloadSound' then
if parameter == 'unload' then
if self.gun:getEjectAmmoSound() then
self.character:playSound(self.gun:getEjectAmmoSound())
end
end
end
if event == 'unloadFinished' then
self:unloadAmmo()
self:forceComplete()
end
end
function ISEjectMagazine:stop()
self.gun:setJobDelta(0.0)
self.character:clearVariable("isUnloading")
self.character:clearVariable("WeaponReloadType")
ISBaseTimedAction.stop(self)
end
function ISEjectMagazine:perform()
self.gun:setJobDelta(0.0)
self.character:clearVariable("isUnloading")
self.character:clearVariable("WeaponReloadType")
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self)
end
function ISEjectMagazine:new(character, gun)
local o = ISBaseTimedAction.new(self, character)
o.stopOnWalk = false
o.stopOnRun = true
o.stopOnAim = false
o.maxTime = -1
o.gun = gun
o.useProgressBar = false
return o
end
|
require("alua")
function exitcb(reply)
for k, v in pairs(reply) do
print("-> " .. k)
for i, j in pairs(v) do
print(" " .. i .. " = " .. j)
end
end
alua.exit()
end
function spawncb(reply)
local procs = {}
for proc in pairs(reply.processes) do
table.insert(procs, proc)
end
print("Sending exist request...")
alua.exit(procs, 0, exitcb)
end
function opencb(reply)
alua.spawn(4, spawncb)
end
alua.open({addr="127.0.0.1", port=6080}, opencb)
alua.loop()
|
-- player/init.lua
dofile(minetest.get_modpath("player_api") .. "/api.lua")
-- Default player appearance
player_api.register_model("character.b3d", {
animation_speed = 30,
textures = {"character.png"},
animations = {
-- Standard animations.
stand = {x = 0, y = 79},
lay = {x = 162, y = 166},
walk = {x = 168, y = 187},
mine = {x = 189, y = 198},
walk_mine = {x = 200, y = 219},
sit = {x = 81, y = 160},
},
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
stepheight = 0.6,
eye_height = 1.47,
})
-- Update appearance when the player joins
minetest.register_on_joinplayer(function(player)
player_api.player_attached[player:get_player_name()] = false
player_api.set_model(player, "character.b3d")
player:set_local_animation(
{x = 0, y = 79},
{x = 168, y = 187},
{x = 189, y = 198},
{x = 200, y = 219},
30
)
end)
|
-----------------
-- Ores/blocks --
-----------------
minetest.register_node("gs_ruby:ruby_block", {
description = ("Ruby Block"),
tiles = {"gs_ruby_block.png"},
is_ground_content = true,
groups = {cracky = 3},
})
minetest.register_node("gs_ruby:ruby_ore", {
description = ("Ruby Ore"),
tiles = {"default_stone.png^gs_ruby_ore.png"},
is_ground_content = true,
groups = {cracky = 3},
drop = "gs_ruby:ruby",
})
minetest.register_craftitem("gs_ruby:ruby", {
description = ("Ruby"),
inventory_image = "gs_ruby.png",
})
------------
-- Tools --
------------
minetest.register_tool("gs_ruby:ruby_sword", {
description = "Ruby Sword",
inventory_image = "gs_ruby_sword.png",
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
groups = {sword = 1}
})
minetest.register_tool("gs_ruby:ruby_pickaxe", {
description = "Ruby Pickaxe",
inventory_image = "gs_ruby_pickaxe.png",
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=80, maxlevel=3},
},
damage_groups = {fleshy=5},
},
sound = {breaks = "default_tool_breaks"},
groups = {pickaxe = 1}
})
minetest.register_tool("gs_ruby:ruby_axe", {
description = "Ruby Axe",
inventory_image = "gs_ruby_axe.png",
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=80, maxlevel=3},
},
damage_groups = {fleshy=7},
},
sound = {breaks = "default_tool_breaks"},
groups = {axe = 1}
})
minetest.register_tool("gs_ruby:ruby_shovel", {
description = "Ruby Shovel",
inventory_image = "gs_ruby_shovel.png",
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=80, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
groups = {shovel = 1}
})
-----------------
-- Mapgen --
-----------------
-- Ruby Ore
minetest.register_ore({
ore_type = "scatter",
ore = "gs_ruby:ruby_ore",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = -256,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "gs_ruby:ruby_ore",
wherein = "default:stone",
clust_scarcity = 17 * 17 * 17,
clust_num_ores = 4,
clust_size = 3,
y_max = -128,
y_min = -255,
})
minetest.register_ore({
ore_type = "scatter",
ore = "gs_ruby:ruby_ore",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = -256,
y_min = -31000,
})
-------------
-- Crafts --
-------------
-- Tools
minetest.register_craft({
output = "gs_ruby:ruby_sword",
recipe = {
{"gs_ruby:ruby"},
{"gs_ruby:ruby"},
{"group:stick"},
}
})
minetest.register_craft({
output = "gs_ruby:ruby_pickaxe",
recipe = {
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"", "group:stick", ""},
{"", "group:stick", ""},
}
})
minetest.register_craft({
output = "gs_ruby:ruby_shovel",
recipe = {
{"gs_ruby:ruby"},
{"group:stick"},
{"group:stick"},
}
})
minetest.register_craft({
output = "gs_ruby:ruby_axe",
recipe = {
{"gs_ruby:ruby", "gs_ruby:ruby"},
{"gs_ruby:ruby", "group:stick"},
{"", "group:stick"},
}
})
minetest.register_craft({
output = "gs_ruby:ruby_block",
recipe = {
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
}
})
minetest.register_craft({
output = "gs_ruby:ruby",
recipe = {
{"gs_ruby:ruby_block"}
}
})
-- Armor
minetest.register_craft({
output = "gs_ruby:helmet_ruby",
recipe = {
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
{"", "", ""},
}
})
minetest.register_craft({
output = "gs_ruby:chestplate_ruby",
recipe = {
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
}
})
minetest.register_craft({
output = "gs_ruby:leggings_ruby",
recipe = {
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
}
})
minetest.register_craft({
output = "gs_ruby:boots_ruby",
recipe = {
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
{"", "", ""},
}
})
minetest.register_craft({
output = "gs_ruby:shield_ruby",
recipe = {
{"gs_ruby:ruby", "", "gs_ruby:ruby"},
{"gs_ruby:ruby", "gs_ruby:ruby", "gs_ruby:ruby"},
{"", "gs_ruby:ruby", ""},
}
})
-----------------------
-- 3D Armor support --
-----------------------
if minetest.get_modpath("3d_armor") then
armor:register_armor("gs_ruby:helmet_ruby", {
description = ("Ruby Helmet"),
inventory_image = "gs_ruby_helmet_inv.png",
groups = {armor_head=1, armor_heal=16, armor_use=70},
armor_groups = {fleshy=10},
damage_groups = {cracky=2, snappy=1, level=6},
})
armor:register_armor("gs_ruby:leggings_ruby", {
description = ("Ruby Leggings"),
inventory_image = "gs_ruby_leggings_inv.png",
groups = {armor_legs=1, armor_heal=16, armor_use=70},
armor_groups = {fleshy=30},
damage_groups = {cracky=2, snappy=1, level=6},
})
armor:register_armor("gs_ruby:chestplate_ruby", {
description = ("Ruby Chestplate"),
inventory_image = "gs_ruby_chestplate_inv.png",
groups = {armor_torso=1, armor_heal=16, armor_use=70},
armor_groups = {fleshy=30},
damage_groups = {cracky=2, snappy=1, level=6},
})
armor:register_armor("gs_ruby:boots_ruby", {
description = ("Ruby Boots"),
inventory_image = "gs_ruby_boots_inv.png",
groups = {armor_feet=1, armor_heal=16, armor_use=70, physics_jump=0.5},
armor_groups = {fleshy=10},
damage_groups = {cracky=2, snappy=1, level=6},
})
armor:register_armor("gs_ruby:shield_ruby", {
description = ("Ruby Shield"),
inventory_image = "gs_ruby_shield_inv.png",
groups = {armor_shield=1, armor_heal=12, armor_use=70},
armor_groups = {fleshy=10},
damage_groups = {cracky=2, snappy=1, level=6},
})
end
|
-- assume that eid is some existing entity id
function example_factory_add()
font = scene.components.font.add(eid)
end
function example_factory_get()
font, found = scene.components.font.get(eid)
end
function example_factory_remove()
scene.components.font.remove(eid)
end
function example_component_usage()
font = components.font.add(eid)
face = font.face()
font.face("Comic Sans") -- lul
pxSize = font.size()
font.size(24) -- pixels
end
|
local module = require("ut2-serv.modules")
local db = module.load("db")
local events = module.load("events")
local surface = module.load("glasses.surface")
local EventEngine = events.engine
EventEngine:subscribe("uiupdate", events.priority.normal, function(handler, evt)
-- 1. Update score
do
-- calculate advantages
local scoreB = db.teams.blue.alive
local scoreG = db.teams.green.alive
local scoreR = db.teams.red.alive
local scoreY = db.teams.yellow.alive
local scoreSum = scoreB + scoreG + scoreR + scoreY
local adB = scoreB / scoreSum
local adG = scoreG / scoreSum
local adR = scoreR / scoreSum
local adY = scoreY / scoreSum
if scoreSum == 0 then
adB = 0.25
adG = 0.25
adR = 0.25
adY = 0.25
end
-- set score labels
surface.objects["score.blue.text"].setText(("%02d"):format(scoreB))
surface.objects["score.green.text"].setText(("%02d"):format(scoreG))
surface.objects["score.red.text"].setText(("%02d"):format(scoreR))
surface.objects["score.yellow.text"].setText(("%02d"):format(scoreY))
-- set opacity
local oB = 0.8 * adB + 0.2
local oG = 0.8 * adG + 0.2
local oR = 0.8 * adR + 0.2
local oY = 0.8 * adY + 0.2
surface.objects["score.blue.box"].setAlpha(oB)
surface.objects["score.green.box"].setAlpha(oG)
surface.objects["score.red.box"].setAlpha(oR)
surface.objects["score.yellow.box"].setAlpha(oY)
-- update progress bars
surface.objects["score.red.bar"].setSize(1, (1 - adY) * 200)
surface.objects["score.green.bar"].setSize(1, (1 - adY - adR) * 200)
surface.objects["score.blue.bar"].setSize(1, adB * 200)
end
-- 2. Update time
do
local passed = db.time - db.remaining
local pMin = math.floor(passed / 60)
local pSec = passed - pMin * 60
pMin = ("%02d"):format(pMin)
pSec = ("%02d"):format(pSec)
surface.objects["time.passed.time"].setText(pMin .. ":" .. pSec)
local total = db.time
local tMin = math.floor(total / 60)
local tSec = total - tMin * 60
tMin = ("%02d"):format(tMin)
tSec = ("%02d"):format(tSec)
surface.objects["time.total.time"].setText(tMin .. ":" .. tSec)
local remain = db.remaining
local rMin = math.floor(remain / 60)
local rSec = remain - rMin * 60
rMin = ("%02d"):format(rMin)
rSec = ("%02d"):format(rSec)
surface.objects["time.remaining.time"].setText(rMin .. ":" .. rSec)
surface.objects["time.bar.passed"].setSize(1, passed / total * 200)
end
-- 3. Update nicks
do
surface.objects["nicks.blue.text"].setText(db.teams.blue.name)
surface.objects["nicks.green.text"].setText(db.teams.green.name)
surface.objects["nicks.red.text"].setText(db.teams.red.name)
surface.objects["nicks.yellow.text"].setText(db.teams.yellow.name)
end
end)
|
--[[
MIT License
Copyright (c) 2022 Michael Wiesendanger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]--
-- luacheck: globals tContains
--[[
Run all tests:
/run rgpvpw.testCombatEvent.Test([category])
]]--
local mod = rgpvpw
local me = {}
mod.testCombatEvent = me
me.tag = "TestCombatEvent"
local testGroupName = "ShouldHaveCombatEventTestForAllSpells"
--[[
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
]]--
function me.Test(category)
assert(type(category) == "table",
string.format("bad argument #1 to `Test` (expected table got %s)", type(category)))
mod.testReporter.StartTestGroup(testGroupName)
me.ShouldHaveCombatEventTestForAllSpells(category)
me.ShouldHaveCombatEventCastTestForAllSpells(category)
me.ShouldHaveCombatEventAvoidTestForAllSpells(category, RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.SELF_AVOID)
me.ShouldHaveCombatEventAvoidTestForAllSpells(category, RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.ENEMY_AVOID)
mod.testReporter.StopTestGroup()
end
--[[
Tests whether there is an appropriate testcase for every spell found in the spellMap
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
]]--
function me.ShouldHaveCombatEventTestForAllSpells(category)
local spellMap
spellMap = mod.spellMap.SearchByCategory(category.id)
if spellMap == nil then
mod.logger.LogError(me.tag, "Unable to get spellMap for category: " .. category.categoryName)
return
end
me.CombatEventTest(category, spellMap)
end
--[[
Do the actual test whether the expected function is present or not
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
@param {table} spellMap
]]--
function me.CombatEventTest(category, spellMap)
local module = mod["testCombatEvents"
.. mod.testHelper.FirstToUpper(category.categoryName)]
for _, spellData in pairs(spellMap) do
local spellMetaData = mod.spellMetaMap.GetSpellMetaDataByCategoryAndName(category.id, spellData.name)
local spellName = mod.testHelper.NormalizeSpellName(spellMetaData.name)
local trackedEvents = spellMetaData.trackedEvents
local func
for _, trackedEvent in pairs(trackedEvents) do
if tContains(mod.testHelper.GetCombatEvents(), trackedEvent) then
local testName
if spellData.rank ~= 0 then
testName = "CombatEventTestPresent" .. mod.testHelper.FirstToUpper(category.categoryName) ..
spellName .. "Rank" .. spellData.rank .. "_" .. trackedEvent
else
testName = "CombatEventTestPresent" .. mod.testHelper.FirstToUpper(category.categoryName) ..
spellName .. "_" .. trackedEvent
end
mod.testReporter.StartTestRun(testName)
local eventName = mod.testHelper.MappEventToName(trackedEvent)
if eventName == nil then
mod.testReporter.ReportFailureTestRun(
category.id,
testName,
string.format(mod.testHelper.invalidEvent, spellData.name, trackedEvent)
)
return
end
if spellData.rank ~= 0 then
func = module["TestCombatEvent" .. spellName .. "Rank" .. spellData.rank .. eventName]
else
func = module["TestCombatEvent" .. spellName .. eventName]
end
if type(func) ~= "function" then
mod.testReporter.ReportFailureTestRun(
category.id,
testName,
string.format(mod.testHelper.missingCombatEventTest, spellName, trackedEvent)
)
else
mod.testReporter.ReportSuccessTestRun()
end
end
end
end
end
--[[
Tests whether there is an appropriate testcase for every spell found in the spellMap
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
]]--
function me.ShouldHaveCombatEventCastTestForAllSpells(category)
local spellMap
spellMap = mod.spellMap.SearchByCategory(category.id)
if spellMap == nil then
mod.logger.LogError(me.tag, "Unable to get spellMap for category: " .. category.categoryName)
return
end
me.CombatEventCastTest(category, spellMap)
end
--[[
Do the actual test whether the expected function is present or not
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
@param {table} spellMap
]]--
function me.CombatEventCastTest(category, spellMap)
local module = mod["testCombatEventsCast"
.. mod.testHelper.FirstToUpper(category.categoryName)]
for _, spellData in pairs(spellMap) do
local spellMetaData = mod.spellMetaMap.GetSpellMetaDataByCategoryAndName(category.id, spellData.name)
local spellName = mod.testHelper.NormalizeSpellName(spellMetaData.name)
local trackedEvents = spellMetaData.trackedEvents
local func
for _, trackedEvent in pairs(trackedEvents) do
if tContains(mod.testHelper.GetCastEvents(), trackedEvent) then
local testName
if spellData.rank ~= 0 then
testName = "CombatEventTestPresent" .. mod.testHelper.FirstToUpper(category.categoryName) ..
spellName .. "Rank" .. spellData.rank .. "_" .. trackedEvent
else
testName = "CombatEventTestPresent" .. mod.testHelper.FirstToUpper(category.categoryName) ..
spellName .. "_" .. trackedEvent
end
mod.testReporter.StartTestRun(testName)
local eventName = mod.testHelper.MappEventToName(trackedEvent)
if eventName == nil then
mod.testReporter.ReportFailureTestRun(
category.id,
testName,
string.format(mod.testHelper.invalidEvent, spellData.name, trackedEvent)
)
return
end
if spellData.rank ~= 0 then
func = module["TestCombatEvent" .. spellName .. "Rank" .. spellData.rank .. eventName]
else
func = module["TestCombatEvent" .. spellName .. eventName]
end
if type(func) ~= "function" then
mod.testReporter.ReportFailureTestRun(
category.id,
testName,
string.format(mod.testHelper.missingCombatEventCastTest, spellName, trackedEvent)
)
else
mod.testReporter.ReportSuccessTestRun()
end
end
end
end
end
--[[
Tests whether there is an appropriate testcase for every spell that supports SPELL_MISSED
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
@param {number} spellAvoidType
RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.SELF_AVOID or RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.ENEMY_AVOID
]]--
function me.ShouldHaveCombatEventAvoidTestForAllSpells(category, spellAvoidType)
local spellMap
spellMap = mod.spellMap.SearchByCategory(category.id)
if spellMap == nil then
mod.logger.LogError(me.tag, "Unable to get spellMap for category: " .. category.categoryName)
return
end
me.CombatEventAvoidTest(category, spellMap, spellAvoidType)
end
--[[
Do the actual test whether the expected function is present or not
@param {table} category
A valid category see RGPVPW_CONSTANTS.CATEGORIES
@param {table} spellMap
@param {number} spellAvoidType
RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.SELF_AVOID or RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.ENEMY_AVOID
]]--
function me.CombatEventAvoidTest(category, spellMap, spellAvoidType)
local module
local testNameBase
local testFunctionBase
if spellAvoidType == RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.SELF_AVOID then
module = mod["testCombatEventsSelfAvoid"
.. mod.testHelper.FirstToUpper(category.categoryName)]
testNameBase = "CombatSelfAvoidEventTestPresent"
testFunctionBase = "TestCombatEventSelfAvoid"
elseif spellAvoidType == RGPVPW_CONSTANTS.SPELL_AVOID_TYPE.ENEMY_AVOID then
module = mod["testCombatEventsEnemyAvoid"
.. mod.testHelper.FirstToUpper(category.categoryName)]
testNameBase = "CombatEnemyAvoidEventTestPresent"
testFunctionBase = "TestCombatEventEnemyAvoid"
else
mod.logger.LogError(me.tag, "Invalid spellAvoidType: " .. spellAvoidType)
return
end
for _, spellData in pairs(spellMap) do
local spellMetaData = mod.spellMetaMap.GetSpellMetaDataByCategoryAndName(category.id, spellData.name)
local spellName = mod.testHelper.NormalizeSpellName(spellMetaData.name)
local trackedEvents = spellMetaData.trackedEvents
local func
for _, trackedEvent in pairs(trackedEvents) do
if tContains(mod.testHelper.GetAvoidCombatEvents(), trackedEvent) then
local testName
if spellData.rank ~= 0 then
testName = testNameBase .. mod.testHelper.FirstToUpper(category.categoryName) ..
spellName .. "Rank" .. spellData.rank .. "_" .. trackedEvent
else
testName = testNameBase .. mod.testHelper.FirstToUpper(category.categoryName) ..
spellName .. "_" .. trackedEvent
end
mod.testReporter.StartTestRun(testName)
local eventName = mod.testHelper.MappEventToName(trackedEvent)
if eventName == nil then
mod.testReporter.ReportFailureTestRun(
category.id,
testName,
string.format(mod.testHelper.invalidEvent, spellData.name, trackedEvent)
)
return
end
if spellData.rank ~= 0 then
func = module[testFunctionBase .. spellName .. "Rank" .. spellData.rank .. eventName]
else
func = module[testFunctionBase .. spellName .. eventName]
end
if type(func) ~= "function" then
mod.testReporter.ReportFailureTestRun(
category.id,
testName,
string.format(mod.testHelper.missingCombatEventAvoidTest, spellName, trackedEvent)
)
else
mod.testReporter.ReportSuccessTestRun()
end
end
end
end
end
|
local theme = require('tranquility.theme')
local highlights = require('tranquility.highlights')
local colors = nil
local function clear()
vim.cmd([[hi clear]])
vim.cmd([[if exists("g:syntax_on") | syntax reset | endif]])
end
local function setup(name)
clear()
colors = theme.define_colors(name)
highlights.set_highlights(colors)
end
local function theme_colors()
return colors
end
return { setup = setup, colors = theme_colors }
|
local drivers = {}
local blips = {}
function updateBusBlips(line)
local driversonline = 0
for k, v in ipairs(drivers[line]) do
driversonline = driversonline + #v
end
if driversonline > 0 then
for k, v in ipairs(drivers[line]) do
-- check back if see if a driver is nearing that
if #(drivers[line][k-1] or {}) + #v > 0 then
setBlipColor( blips[line][k], 127, 255, 63, 127 )
else
setBlipColor( blips[line][k], 255, 255, 63, 127 )
end
end
else -- no drivers online
for k, v in ipairs(blips[line]) do
setBlipColor( v, 255, 63, 63, 127 )
end
end
end
function removeDriver()
for k, v in ipairs(drivers) do
for key, value in ipairs(v) do
for i, player in pairs(value) do
if player == source then
table.remove(value, i)
end
end
end
end
end
function removeDriverOnAllLines()
removeDriver()
for line, v in pairs(drivers) do
updateBusBlips(line)
end
end
addEventHandler( "onPlayerQuit", getRootElement(), removeDriverOnAllLines )
addEventHandler("onCharacterLogin", getRootElement(), removeDriverOnAllLines )
function payBusDriver(line, stop)
if stop == -2 then
removeDriver()
exports.global:giveMoney(source, 36)
elseif stop == -1 then
removeDriverOnAllLines()
return
elseif stop == 0 then
table.insert( drivers[line][1], source )
else
exports.global:giveMoney(source, 18)
local x, y, z = getElementPosition(source)
local chatSphere = createColSphere(x, y, z, 20)
exports.pool:allocateElement(chatSphere)
local nearbyPlayers = getElementsWithinColShape(chatSphere, "player")
destroyElement(chatSphere)
local dimension = getElementDimension(source)
local interior = getElementInterior(source)
for index, nearbyPlayer in ipairs(nearbyPlayers) do
local nearbyPlayerDimension = getElementDimension(nearbyPlayer)
local nearbyPlayerInterior = getElementInterior(nearbyPlayer)
if (nearbyPlayerDimension==dimension) and (nearbyPlayerInterior==interior) then
local logged = getElementData(nearbyPlayer, "loggedin")
if not(isPedDead(nearbyPlayer)) and (logged==1) then
outputChatBox(" -- This stop: [".. g_bus_routes[line].stops[stop] .. "] --", nearbyPlayer, 255, 51, 102)
if(stop<#g_bus_routes[line].stops)then
outputChatBox(" -- Next stop: [".. g_bus_routes[line].stops[stop+1] .. "] --", nearbyPlayer, 255, 51, 102)
end
end
end
end
-- "remove" driver from current blip
if drivers[line][stop+1] then
removeDriver()
table.insert( drivers[line][stop+1], source )
end
end
updateBusBlips(line)
end
addEvent("payBusDriver",true)
addEventHandler("payBusDriver", getRootElement(), payBusDriver)
function takeBusFare(thePlayer)
exports.global:takeMoney(source, 5)
exports.global:giveMoney(thePlayer, 5)
end
addEvent("payBusFare", true)
addEventHandler("payBusFare", getRootElement(), takeBusFare)
function ejectPlayerFromBus()
setElementData(source, "realinvehicle", 0, false)
removePedFromVehicle(source)
end
addEvent("removePlayerFromBus", true)
addEventHandler("removePlayerFromBus", getRootElement(), ejectPlayerFromBus)
-- BUS ROUTES BLIPS
function createBusBlips( )
for routeID, route in ipairs( g_bus_routes ) do
blips[routeID] = {}
drivers[routeID] = {}
for pointID, point in ipairs( route.points ) do
if point[4] and #route.points ~= pointID then
local stop = #blips[routeID]+1
blips[routeID][stop] = createBlip( point[1], point[2], point[3], 0, 1, 255, 63, 63, 127, -5, 65 )
drivers[routeID][stop] = {}
end
end
end
end
addEventHandler( "onResourceStart", getResourceRootElement(), createBusBlips )
|
----------------------------------------------
-- Sample of SlibRGB57wTM1640.lua for W4.00.03
-- Copyright (c) 2019, AoiSaya
-- All rights reserved.
-- 2019/09/01 rev.0.02
-----------------------------------------------
function chkBreak(n)
sleep(n or 0)
if fa.sharedmemory("read", 0x00, 0x01, "") == "!" then
error("Break!",2)
end
end
fa.sharedmemory("write", 0x00, 0x01, "-")
local script_path = function()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)")
end
--main
local myDir = script_path()
led = require (myDir.."lib/SlibRGB57wTM1640")
local bright = 1 -- 0..8
local rgb={}
local color = 1
local pat = {0x0C,0x1E,0x3C,0x1E,0x0C}
local clr = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
local r, g, b
local n = 8
led:setup(bright)
while 1 do
b = bit32.btest(color,1)
r = bit32.btest(color,2)
g = bit32.btest(color,4)
color = color % 7+1
for k=1,5 do
d = pat[k]
rgb[k*3-2] = r and d or 0
rgb[k*3-1] = g and d or 0
rgb[k*3 ] = b and d or 0
end
for i=0,n*10 do
for j=0,n do
p = (n-i<j) and (i-n*8<j)
led:write(p and rgb or clr)
end
chkBreak(1)
collectgarbage()
end
end
|
--noob fix xd by kent
player = game:GetService("Players").LocalPlayer
char = player.Character
mouse = player:GetMouse()
attack = false
local makeorb = false
idleq = false
local skl = false
local healingmode = false
parts = {}
poses = {}
sizes = {}
local obj3, TARG10, TARG11, STARG, lastdg, dg, dgm, lastdf, df, dfm = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
local basicunlocked = false
mc = Instance.new("NumberValue", char)
mc.Name = "CloanTime"
mc.Value = 0
ht = Instance.new("NumberValue", char)
ht.Name = "HealingTime"
ht.Value = 6
stun = Instance.new("BoolValue", char)
stun.Name = "Stunned"
stun.Value = false
atk = Instance.new("NumberValue", char)
atk.Name = "Attack"
atk.Value = 1
def = Instance.new("NumberValue", char)
def.Name = "Defense"
def.Value = 1.1
spd = Instance.new("NumberValue", char)
spd.Name = "Speed"
spd.Value = 1
deft = Instance.new("NumberValue", char)
deft.Name = "DefenseTime"
deft.Value = 0
atkt = Instance.new("NumberValue", char)
atkt.Name = "AttackTime"
atkt.Value = 0
spdt = Instance.new("NumberValue", char)
spdt.Name = "SpeedTime"
spdt.Value = 0
posd = Instance.new("BoolValue", char)
posd.Name = "Posioned"
posd.Value = false
pt = Instance.new("NumberValue", char)
pt.Name = "PoisonTime"
pt.Value = 0
bl = Instance.new("BoolValue", char)
bl.Name = "Blocking"
bl.Value = false
bll = Instance.new("BoolValue", char)
bll.Name = "BlockingLabel"
bll.Value = false
blt = Instance.new("NumberValue", char)
blt.Name = "BlockingLeft"
blt.Value = 50
pb = Instance.new("BoolValue", char)
pb.Name = "PauseBlock"
pb.Value = false
blm = 100
gd = Instance.new("BoolValue", char)
gd.Name = "Ground"
local TARG7, obj, TARG8, obj2 = nil, nil, nil, nil
for i,v in pairs(char:GetChildren()) do
if v.ClassName == "Weld" then
v:destroy()
end
if v.ClassName == "Model" then
v:Destroy()
end
end
for i,v in pairs(player.PlayerGui:GetChildren()) do
if v.Name == "UI" then
v:Destroy()
end
end
for i,v in pairs(char.Head:GetChildren()) do
if v.ClassName == "Sound" then
v:Destroy()
end
end
local m = Instance.new("Model")
m.Name = "Cortex"
p1 = Instance.new("Part", m)
p1.BrickColor = BrickColor.new("Bright orange")
p1.Name = "P1"
p1.CFrame = CFrame.new(74.4850006, 0.896979809, -80.3010025, 0.0250819121, -0.998309731, 0.0522681326, -0.86434716, -0.0479167439, -0.500589728, 0.502244949, -0.032613717, -0.864100158)
p1.CanCollide = false
p1.FormFactor = Enum.FormFactor.Custom
p1.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p1.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p1.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p1.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p1.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p1.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p1.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b1 = Instance.new("BlockMesh", p1)
b1.Name = "Mesh"
b1.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p2 = Instance.new("Part", m)
p2.BrickColor = BrickColor.new("Br. yellowish orange")
p2.Name = "P2"
p2.CFrame = CFrame.new(74.4646378, 1.25767887, -80.2053528, 0.0524596013, -0.998304963, -0.0248665046, -0.500721753, -0.0478316285, 0.864275277, -0.864011943, -0.0328799896, -0.502379239)
p2.CanCollide = false
p2.FormFactor = Enum.FormFactor.Custom
p2.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p2.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b2 = Instance.new("BlockMesh", p2)
b2.Name = "Mesh"
b2.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p3 = Instance.new("Part", m)
p3.BrickColor = BrickColor.new("Bright orange")
p3.Name = "P3"
p3.CFrame = CFrame.new(74.4763031, 1.09725058, -80.3280258, 0.0546606034, -0.998306096, 0.0195044391, -0.965169787, -0.0478129238, 0.257183164, -0.255825788, -0.0328745358, -0.966154933)
p3.CanCollide = false
p3.FormFactor = Enum.FormFactor.Custom
p3.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p3.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p3.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p3.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p3.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p3.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p3.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b3 = Instance.new("BlockMesh", p3)
b3.Name = "Mesh"
b3.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p4 = Instance.new("Part", m)
p4.BrickColor = BrickColor.new("Br. yellowish orange")
p4.Name = "P4"
p4.CFrame = CFrame.new(74.4558029, 1.21352983, -79.8729706, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p4.CanCollide = false
p4.FormFactor = Enum.FormFactor.Custom
p4.Size = Vector3.new(0.200000003, 0.240367845, 0.721103489)
p4.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p4.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p4.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p4.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p4.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p4.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b4 = Instance.new("BlockMesh", p4)
b4.Name = "Mesh"
b4.Scale = Vector3.new(0.80122602, 1, 1)
p5 = Instance.new("Part", m)
p5.BrickColor = BrickColor.new("Br. yellowish orange")
p5.Name = "P5"
p5.CFrame = CFrame.new(74.4283676, 1.6955595, -79.7407761, -0.998334646, 0.024735868, -0.0519541278, -0.0474555828, -0.864426851, 0.500495851, -0.0325219966, 0.502124786, 0.864173353)
p5.CanCollide = false
p5.FormFactor = Enum.FormFactor.Custom
p5.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p5.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p5.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p5.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p5.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p5.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p5.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b5 = Instance.new("BlockMesh", p5)
b5.Name = "Mesh"
b5.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p6 = Instance.new("Part", m)
p6.BrickColor = BrickColor.new("Br. yellowish orange")
p6.Name = "P6"
p6.CFrame = CFrame.new(74.4612656, 1.28415167, -80.1418076, 0.0443101786, -0.998302639, -0.0375729874, -0.260042369, -0.0478305817, 0.964402497, -0.964573622, -0.0329539329, -0.26171425)
p6.CanCollide = false
p6.FormFactor = Enum.FormFactor.Custom
p6.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p6.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p6.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p6.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p6.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p6.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p6.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b6 = Instance.new("BlockMesh", p6)
b6.Name = "Mesh"
b6.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p7 = Instance.new("Part", m)
p7.BrickColor = BrickColor.new("Br. yellowish orange")
p7.Name = "P7"
p7.CFrame = CFrame.new(74.5116653, 1.13120699, -81.4558029, -0.047846213, -0.998299301, -0.0330535844, 0.998841882, -0.0479081944, 0.00134743063, -0.00291989627, -0.0329424888, 0.999444366)
p7.CanCollide = false
p7.FormFactor = Enum.FormFactor.Custom
p7.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p7.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p7.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p7.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p7.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p7.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p7.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b7 = Instance.new("BlockMesh", p7)
b7.Name = "Mesh"
b7.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p8 = Instance.new("Part", m)
p8.BrickColor = BrickColor.new("Br. yellowish orange")
p8.Name = "P8"
p8.CFrame = CFrame.new(74.5073547, 1.37105012, -81.6752472, 0.0477833003, -0.998318195, 0.0325690359, -0.998844683, -0.0478465706, -0.00143165409, 0.0029787838, -0.0324546471, -0.999460161)
p8.CanCollide = false
p8.FormFactor = Enum.FormFactor.Custom
p8.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p8.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p8.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p8.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p8.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p8.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p8.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b8 = Instance.new("BlockMesh", p8)
b8.Name = "Mesh"
b8.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p9 = Instance.new("Part", m)
p9.BrickColor = BrickColor.new("Br. yellowish orange")
p9.Name = "P9"
p9.CFrame = CFrame.new(74.293251, 1.23596191, -74.9483643, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p9.CanCollide = false
p9.FormFactor = Enum.FormFactor.Custom
p9.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p9.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p9.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p9.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p9.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p9.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p9.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b9 = Instance.new("BlockMesh", p9)
b9.Name = "Mesh"
b9.Scale = Vector3.new(0.40061301, 0.640980899, 0.40061301)
p10 = Instance.new("Part", m)
p10.BrickColor = BrickColor.new("Bright orange")
p10.Name = "P10"
p10.CFrame = CFrame.new(74.2423935, 1.30802619, -74.7262878, 0.0546606034, -0.998306096, 0.0195044391, -0.965169787, -0.0478129238, 0.257183164, -0.255825788, -0.0328745358, -0.966154933)
p10.CanCollide = false
p10.FormFactor = Enum.FormFactor.Custom
p10.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p10.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p10.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p10.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p10.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p10.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p10.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b10 = Instance.new("SpecialMesh", p10)
b10.MeshType = Enum.MeshType.Wedge
b10.Name = "Mesh"
b10.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p11 = Instance.new("Part", m)
p11.BrickColor = BrickColor.new("Reddish brown")
p11.Name = "Handle"
p11.CFrame = CFrame.new(74.4855194, 1.25221145, -80.8340607, 0.998325169, -0.0328403264, 0.0474501625, 0.0475116409, 0.0013576051, -0.998860717, 0.0327301435, 0.999451339, 0.00290685217)
p11.FormFactor = Enum.FormFactor.Custom
p11.Size = Vector3.new(0.240367815, 1.76269746, 0.240367845)
p11.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p11.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p11.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p11.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p11.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p11.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b11 = Instance.new("CylinderMesh", p11)
b11.Name = "Mesh"
p12 = Instance.new("Part", m)
p12.BrickColor = BrickColor.new("Br. yellowish orange")
p12.Name = "P12"
p12.CFrame = CFrame.new(74.3949356, 1.1679045, -77.9511261, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p12.CanCollide = false
p12.FormFactor = Enum.FormFactor.Custom
p12.Size = Vector3.new(3.68563962, 0.200000003, 0.200000003)
p12.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p12.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p12.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p12.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p12.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p12.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b12 = Instance.new("BlockMesh", p12)
b12.Name = "Mesh"
b12.Scale = Vector3.new(1, 0.640980899, 0.40061301)
p13 = Instance.new("Part", m)
p13.BrickColor = BrickColor.new("Br. yellowish orange")
p13.Name = "P66"
p13.CFrame = CFrame.new(74.3665009, 1.35283399, -77.3510208, 0.0331627727, -0.998302579, -0.0477015376, -0.00155824423, -0.0477707386, 0.998848021, -0.999440372, -0.0330418944, -0.00313103199)
p13.CanCollide = false
p13.FormFactor = Enum.FormFactor.Custom
p13.Size = Vector3.new(5.04772425, 0.200000003, 0.240367845)
p13.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p13.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p13.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p13.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p13.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p13.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b13 = Instance.new("BlockMesh", p13)
b13.Name = "Mesh"
b13.Scale = Vector3.new(1, 0.640980899, 1)
p14 = Instance.new("Part", m)
p14.BrickColor = BrickColor.new("Bright orange")
p14.Name = "P14"
p14.CFrame = CFrame.new(74.3404083, 1.09644794, -74.9578629, -0.0408099443, 0.998314857, -0.0410502069, 0.17482619, 0.04757661, 0.983440042, 0.98374635, 0.032949131, -0.176466092)
p14.CanCollide = false
p14.FormFactor = Enum.FormFactor.Custom
p14.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p14.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p14.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p14.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p14.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p14.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p14.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b14 = Instance.new("SpecialMesh", p14)
b14.MeshType = Enum.MeshType.Wedge
b14.Name = "Mesh"
b14.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p15 = Instance.new("Part", m)
p15.BrickColor = BrickColor.new("Br. yellowish orange")
p15.Name = "P15"
p15.CFrame = CFrame.new(74.518837, 1.13096368, -81.6745529, 0.0477833003, -0.998318195, 0.0325690359, -0.998844683, -0.0478465706, -0.00143165409, 0.0029787838, -0.0324546471, -0.999460161)
p15.CanCollide = false
p15.FormFactor = Enum.FormFactor.Custom
p15.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p15.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p15.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p15.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p15.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p15.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p15.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b15 = Instance.new("BlockMesh", p15)
b15.Name = "Mesh"
b15.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p16 = Instance.new("Part", m)
p16.BrickColor = BrickColor.new("Bright orange")
p16.Name = "P16"
p16.CFrame = CFrame.new(74.3224258, 1.31191719, -74.7236786, -0.0547425598, 0.998297811, 0.019693315, 0.965134799, 0.0478394888, 0.257309258, 0.25593999, 0.0330841243, -0.966117382)
p16.CanCollide = false
p16.FormFactor = Enum.FormFactor.Custom
p16.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p16.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p16.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p16.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p16.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p16.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p16.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b16 = Instance.new("SpecialMesh", p16)
b16.MeshType = Enum.MeshType.Wedge
b16.Name = "Mesh"
b16.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p17 = Instance.new("Part", m)
p17.BrickColor = BrickColor.new("Br. yellowish orange")
p17.Name = "P17"
p17.CFrame = CFrame.new(74.4683762, 1.21568036, -80.259903, 0.0571767092, -0.998301923, -0.0103862695, -0.707385659, -0.0478431173, 0.705194473, -0.704506218, -0.0329656862, -0.708920002)
p17.CanCollide = false
p17.FormFactor = Enum.FormFactor.Custom
p17.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p17.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p17.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p17.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p17.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p17.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p17.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b17 = Instance.new("BlockMesh", p17)
b17.Name = "Mesh"
b17.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p18 = Instance.new("Part", m)
p18.BrickColor = BrickColor.new("Br. yellowish orange")
p18.Transparency = 1
p18.Name = "P65"
p18.CFrame = CFrame.new(74.4222488, 1.69581449, -79.5537949, -0.99832958, 0.0574649423, -0.0043799039, -0.0476420708, -0.865793467, -0.498110175, -0.0324076116, -0.497081518, 0.867088437)
p18.CanCollide = false
p18.FormFactor = Enum.FormFactor.Custom
p18.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p18.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p18.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p18.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p18.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p18.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p18.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b18 = Instance.new("BlockMesh", p18)
b18.Name = "Mesh"
b18.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p19 = Instance.new("Part", m)
p19.BrickColor = BrickColor.new("Bright orange")
p19.Name = "P19"
p19.CFrame = CFrame.new(74.3157806, 1.43817937, -74.7073364, -0.047846213, 0.998305321, 0.0328707919, 0.998841882, 0.0479079448, -0.00135614304, -0.00291983667, 0.0327594876, -0.999450326)
p19.CanCollide = false
p19.FormFactor = Enum.FormFactor.Custom
p19.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p19.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p19.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p19.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p19.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p19.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p19.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b19 = Instance.new("SpecialMesh", p19)
b19.MeshType = Enum.MeshType.Wedge
b19.Name = "Mesh"
b19.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p20 = Instance.new("Part", m)
p20.BrickColor = BrickColor.new("Bright orange")
p20.Name = "P20"
p20.CFrame = CFrame.new(74.482811, 0.960588753, -80.327652, 0.0376285762, -0.99831003, 0.0440947786, -0.964450777, -0.0478217751, -0.259864569, 0.261527956, -0.0327405669, -0.964631498)
p20.CanCollide = false
p20.FormFactor = Enum.FormFactor.Custom
p20.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p20.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p20.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p20.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p20.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p20.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p20.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b20 = Instance.new("BlockMesh", p20)
b20.Name = "Mesh"
b20.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p21 = Instance.new("Part", m)
p21.BrickColor = BrickColor.new("Bright orange")
p21.Name = "P64"
p21.CFrame = CFrame.new(74.4723816, 1.16090846, -80.3017731, 0.0579402298, -0.998300374, 0.00467805378, -0.865818024, -0.0479083695, 0.498040795, -0.496982932, -0.0328980386, -0.867126048)
p21.CanCollide = false
p21.FormFactor = Enum.FormFactor.Custom
p21.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p21.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p21.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p21.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p21.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p21.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p21.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b21 = Instance.new("BlockMesh", p21)
b21.Name = "Mesh"
b21.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p22 = Instance.new("Part", m)
p22.BrickColor = BrickColor.new("Br. yellowish orange")
p22.Name = "P63"
p22.CFrame = CFrame.new(74.3594208, 1.47329617, -77.3113251, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p22.CanCollide = false
p22.FormFactor = Enum.FormFactor.Custom
p22.Size = Vector3.new(4.9676013, 0.200000003, 0.200000003)
p22.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p22.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p22.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p22.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p22.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p22.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b22 = Instance.new("BlockMesh", p22)
b22.Name = "Mesh"
b22.Scale = Vector3.new(1, 0.801226139, 0.40061301)
p23 = Instance.new("Part", m)
p23.BrickColor = BrickColor.new("Bright orange")
p23.Name = "P23"
p23.CFrame = CFrame.new(74.2357559, 1.43437028, -74.7099991, 0.0477872491, -0.998318255, 0.0325632654, -0.998844862, -0.0478465483, -0.00130974781, 0.00285680452, -0.0324547142, -0.999460518)
p23.CanCollide = false
p23.FormFactor = Enum.FormFactor.Custom
p23.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p23.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p23.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p23.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p23.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p23.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p23.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b23 = Instance.new("SpecialMesh", p23)
b23.MeshType = Enum.MeshType.Wedge
b23.Name = "Mesh"
b23.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p24 = Instance.new("Part", m)
p24.BrickColor = BrickColor.new("Br. yellowish orange")
p24.Name = "P24"
p24.CFrame = CFrame.new(74.4876328, 0.80141902, -80.2416992, 0.0524596013, -0.998304963, -0.0248665046, -0.500721753, -0.0478316285, 0.864275277, -0.864011943, -0.0328799896, -0.502379239)
p24.CanCollide = false
p24.FormFactor = Enum.FormFactor.Custom
p24.Size = Vector3.new(0.240367815, 0.240367845, 0.200000003)
p24.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p24.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p24.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p24.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p24.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p24.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b24 = Instance.new("BlockMesh", p24)
b24.Name = "Mesh"
b24.Scale = Vector3.new(1, 1, 0.801226139)
p25 = Instance.new("Part", m)
p25.BrickColor = BrickColor.new("Bright orange")
p25.Name = "P25"
p25.CFrame = CFrame.new(74.2489777, 1.20300317, -74.7749939, 0.0581113175, -0.998301685, -0.000360328704, -0.819068611, -0.0478758439, 0.571678638, -0.570737362, -0.0329175182, -0.820462048)
p25.CanCollide = false
p25.FormFactor = Enum.FormFactor.Custom
p25.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p25.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p25.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p25.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p25.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p25.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p25.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b25 = Instance.new("SpecialMesh", p25)
b25.MeshType = Enum.MeshType.Wedge
b25.Name = "Mesh"
b25.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p26 = Instance.new("Part", m)
p26.BrickColor = BrickColor.new("Br. yellowish orange")
p26.Name = "RAY"
p26.CFrame = CFrame.new(74.3758087, 1.20065057, -77.3905945, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p26.CanCollide = false
p26.FormFactor = Enum.FormFactor.Custom
p26.Size = Vector3.new(4.80735636, 0.200000003, 0.200000003)
p26.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p26.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p26.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p26.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p26.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p26.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b26 = Instance.new("BlockMesh", p26)
b26.Name = "Mesh"
b26.Scale = Vector3.new(1, 0.640980899, 0.40061301)
p27 = Instance.new("Part", m)
p27.BrickColor = BrickColor.new("Br. yellowish orange")
p27.Name = "P27"
p27.CFrame = CFrame.new(74.4763412, 0.896838307, -80.0377121, 0.0473471135, -0.998302162, -0.0336809494, -0.343099177, -0.047912471, 0.93806684, -0.938099384, -0.0328505039, -0.344780028)
p27.CanCollide = false
p27.FormFactor = Enum.FormFactor.Custom
p27.Size = Vector3.new(0.240367815, 0.240367845, 0.200000003)
p27.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p27.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p27.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p27.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p27.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p27.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b27 = Instance.new("BlockMesh", p27)
b27.Name = "Mesh"
b27.Scale = Vector3.new(1, 1, 0.801226139)
p28 = Instance.new("Part", m)
p28.BrickColor = BrickColor.new("Br. yellowish orange")
p28.Name = "P28"
p28.CFrame = CFrame.new(74.4585876, 1.29327106, -80.0734253, 0.0331607275, -0.998304665, -0.0476598851, -0.00151514332, -0.0477276258, 0.998850226, -0.99944061, -0.0330420434, -0.00308647985)
p28.CanCollide = false
p28.FormFactor = Enum.FormFactor.Custom
p28.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p28.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p28.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p28.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p28.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p28.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p28.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b28 = Instance.new("BlockMesh", p28)
b28.Name = "Mesh"
b28.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p29 = Instance.new("Part", m)
p29.BrickColor = BrickColor.new("Bright orange")
p29.Name = "P29"
p29.CFrame = CFrame.new(74.454628, 1.22144091, -79.8730316, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p29.CanCollide = false
p29.FormFactor = Enum.FormFactor.Custom
p29.Size = Vector3.new(0.200000003, 0.32049045, 0.640980899)
p29.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p29.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p29.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p29.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p29.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p29.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b29 = Instance.new("BlockMesh", p29)
b29.Name = "Mesh"
b29.Scale = Vector3.new(0.40061301, 1, 1)
p30 = Instance.new("Part", m)
p30.BrickColor = BrickColor.new("Br. yellowish orange")
p30.Name = "P30"
p30.CFrame = CFrame.new(74.4193573, 1.1349299, -78.6716156, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p30.CanCollide = false
p30.FormFactor = Enum.FormFactor.Custom
p30.Size = Vector3.new(2.243433, 0.200000003, 0.200000003)
p30.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p30.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p30.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p30.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p30.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p30.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b30 = Instance.new("BlockMesh", p30)
b30.Name = "Mesh"
b30.Scale = Vector3.new(1, 0.640980899, 0.40061301)
p31 = Instance.new("Part", m)
p31.BrickColor = BrickColor.new("Bright orange")
p31.Name = "P31"
p31.CFrame = CFrame.new(74.3461914, 1.07678747, -75.106041, -0.0371449776, 0.998314679, -0.0443998799, 0.0883789733, 0.0475296788, 0.994943321, 0.995386481, 0.0330247842, -0.0899875611)
p31.CanCollide = false
p31.FormFactor = Enum.FormFactor.Custom
p31.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p31.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p31.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p31.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p31.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p31.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p31.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b31 = Instance.new("SpecialMesh", p31)
b31.MeshType = Enum.MeshType.Wedge
b31.Name = "Mesh"
b31.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p32 = Instance.new("Part", m)
p32.BrickColor = BrickColor.new("Br. yellowish orange")
p32.Name = "P32"
p32.CFrame = CFrame.new(74.5144348, 1.25105679, -81.7149429, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p32.CanCollide = false
p32.FormFactor = Enum.FormFactor.Custom
p32.Size = Vector3.new(0.200000003, 0.32049045, 0.32049045)
p32.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p32.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p32.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p32.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p32.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p32.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b32 = Instance.new("BlockMesh", p32)
b32.Name = "Mesh"
b32.Scale = Vector3.new(0.80122602, 1, 1)
p33 = Instance.new("Part", m)
p33.BrickColor = BrickColor.new("Br. yellowish orange")
p33.Name = "P33"
p33.CFrame = CFrame.new(74.4974442, 1.4659605, -81.511467, 0.00499837659, -0.998306513, -0.0578139275, 0.49804318, -0.047639817, 0.86583221, -0.867123663, -0.0331132412, 0.496973723)
p33.CanCollide = false
p33.FormFactor = Enum.FormFactor.Custom
p33.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p33.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p33.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p33.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p33.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p33.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p33.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b33 = Instance.new("BlockMesh", p33)
b33.Name = "Mesh"
b33.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p34 = Instance.new("Part", m)
p34.BrickColor = BrickColor.new("Bright orange")
p34.Name = "P34"
p34.CFrame = CFrame.new(74.3349228, 1.13621974, -74.8491211, -0.0524816141, 0.998312116, -0.0245321598, 0.500629246, 0.047549706, 0.864344478, 0.864064336, 0.0330723301, -0.502276599)
p34.CanCollide = false
p34.FormFactor = Enum.FormFactor.Custom
p34.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p34.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p34.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p34.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p34.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p34.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p34.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b34 = Instance.new("SpecialMesh", p34)
b34.MeshType = Enum.MeshType.Wedge
b34.Name = "Mesh"
b34.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p35 = Instance.new("Part", m)
p35.BrickColor = BrickColor.new("Br. yellowish orange")
p35.Name = "P35"
p35.CFrame = CFrame.new(74.5204849, 1.02183568, -81.5648575, -0.0327107832, -0.998305142, 0.0479601398, 0.00157983182, -0.0480287634, -0.998835742, 0.999455273, -0.0325885825, 0.00313943322)
p35.CanCollide = false
p35.FormFactor = Enum.FormFactor.Custom
p35.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p35.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p35.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p35.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p35.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p35.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p35.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b35 = Instance.new("BlockMesh", p35)
b35.Name = "Mesh"
b35.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p36 = Instance.new("Part", m)
p36.BrickColor = BrickColor.new("Br. yellowish orange")
p36.Name = "P36"
p36.CFrame = CFrame.new(74.4320755, 1.65369916, -79.7905045, -0.9983325, 0.00546072423, -0.0573197752, -0.0474776067, -0.641084969, 0.765988171, -0.0325556472, 0.767433643, 0.640287757)
p36.CanCollide = false
p36.FormFactor = Enum.FormFactor.Custom
p36.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p36.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p36.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p36.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p36.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p36.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p36.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b36 = Instance.new("BlockMesh", p36)
b36.Name = "Mesh"
b36.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p37 = Instance.new("Part", m)
p37.BrickColor = BrickColor.new("Bright orange")
p37.Name = "P37"
p37.CFrame = CFrame.new(74.3484573, 1.02189076, -77.54216, 0.0339996666, -0.998298109, -0.0472013615, -0.0190592688, -0.0478590988, 0.998663247, -0.999231935, -0.0330462493, -0.0206454061)
p37.CanCollide = false
p37.FormFactor = Enum.FormFactor.Custom
p37.Size = Vector3.new(4.72723389, 0.200000003, 0.240367845)
p37.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p37.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p37.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p37.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p37.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p37.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b37 = Instance.new("SpecialMesh", p37)
b37.MeshType = Enum.MeshType.Wedge
b37.Name = "Mesh"
b37.Scale = Vector3.new(1, 0.40061307, 1)
p38 = Instance.new("Part", m)
p38.BrickColor = BrickColor.new("Bright orange")
p38.Name = "P38"
p38.CFrame = CFrame.new(74.5166855, 1.25886393, -81.7949753, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p38.CanCollide = false
p38.FormFactor = Enum.FormFactor.Custom
p38.Size = Vector3.new(0.200000003, 0.240367845, 0.240367845)
p38.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p38.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p38.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p38.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p38.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p38.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b38 = Instance.new("BlockMesh", p38)
b38.Name = "Mesh"
b38.Scale = Vector3.new(0.80122602, 1, 1)
p39 = Instance.new("Part", m)
p39.BrickColor = BrickColor.new("Bright orange")
p39.Name = "P39"
p39.CFrame = CFrame.new(74.4284592, 1.02568734, -77.5395355, -0.0339458846, 0.998315811, -0.0468670502, 0.0188027117, 0.0475150794, 0.998684525, 0.99923861, 0.0330116563, -0.0203753691)
p39.CanCollide = false
p39.FormFactor = Enum.FormFactor.Custom
p39.Size = Vector3.new(4.72723389, 0.200000003, 0.240367845)
p39.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p39.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p39.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p39.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p39.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p39.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b39 = Instance.new("SpecialMesh", p39)
b39.MeshType = Enum.MeshType.Wedge
b39.Name = "Mesh"
b39.Scale = Vector3.new(1, 0.40061307, 1)
p40 = Instance.new("Part", m)
p40.BrickColor = BrickColor.new("Bright orange")
p40.Name = "P40"
p40.CFrame = CFrame.new(74.2661438, 1.07290602, -75.1086884, 0.0371716507, -0.998303354, -0.0446883366, -0.0885947496, -0.0478268377, 0.994915545, -0.995369256, -0.0330207422, -0.0902140513)
p40.CanCollide = false
p40.FormFactor = Enum.FormFactor.Custom
p40.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p40.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p40.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p40.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p40.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p40.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p40.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b40 = Instance.new("SpecialMesh", p40)
b40.MeshType = Enum.MeshType.Wedge
b40.Name = "Mesh"
b40.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p41 = Instance.new("Part", m)
p41.BrickColor = BrickColor.new("Br. yellowish orange")
p41.Name = "P41"
p41.CFrame = CFrame.new(74.5011063, 1.4657886, -81.6207886, 0.0524596013, -0.998304963, -0.0248665046, -0.500721753, -0.0478316285, 0.864275277, -0.864011943, -0.0328799896, -0.502379239)
p41.CanCollide = false
p41.FormFactor = Enum.FormFactor.Custom
p41.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p41.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p41.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p41.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p41.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p41.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p41.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b41 = Instance.new("BlockMesh", p41)
b41.Name = "Mesh"
b41.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p42 = Instance.new("Part", m)
p42.BrickColor = BrickColor.new("Br. yellowish orange")
p42.Name = "P42"
p42.CFrame = CFrame.new(74.4392319, 1.53358483, -79.8338776, -0.998325825, -0.0326749459, -0.0475505628, -0.0476029031, 0.00109051703, 0.998856723, -0.032577388, 0.999457061, -0.00263533345)
p42.CanCollide = false
p42.FormFactor = Enum.FormFactor.Custom
p42.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p42.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p42.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p42.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p42.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p42.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p42.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b42 = Instance.new("BlockMesh", p42)
b42.Name = "Mesh"
b42.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p43 = Instance.new("Part", m)
p43.BrickColor = BrickColor.new("Bright orange")
p43.Name = "P43"
p43.CFrame = CFrame.new(74.3290787, 1.20679891, -74.7723618, -0.0581035241, 0.998302221, -0.000131290406, 0.8189587, 0.0477318875, 0.571848154, 0.57089591, 0.0331105255, -0.820344031)
p43.CanCollide = false
p43.FormFactor = Enum.FormFactor.Custom
p43.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p43.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p43.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p43.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p43.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p43.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p43.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b43 = Instance.new("SpecialMesh", p43)
b43.MeshType = Enum.MeshType.Wedge
b43.Name = "Mesh"
b43.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p44 = Instance.new("Part", m)
p44.BrickColor = BrickColor.new("Bright orange")
p44.Name = "P44"
p44.CFrame = CFrame.new(74.254837, 1.13231885, -74.8517838, 0.0524596013, -0.998304963, -0.0248665046, -0.500721753, -0.0478316285, 0.864275277, -0.864011943, -0.0328799896, -0.502379239)
p44.CanCollide = false
p44.FormFactor = Enum.FormFactor.Custom
p44.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p44.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p44.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p44.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p44.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p44.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p44.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b44 = Instance.new("SpecialMesh", p44)
b44.MeshType = Enum.MeshType.Wedge
b44.Name = "Mesh"
b44.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p45 = Instance.new("Part", m)
p45.BrickColor = BrickColor.new("Br. yellowish orange")
p45.Name = "P45"
p45.CFrame = CFrame.new(74.5147476, 1.07657385, -81.4702911, -0.0574037507, -0.998330653, -0.00488479249, 0.865681469, -0.0473294891, -0.498334706, 0.497283787, -0.0328266025, 0.86695683)
p45.CanCollide = false
p45.FormFactor = Enum.FormFactor.Custom
p45.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p45.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p45.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p45.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p45.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p45.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p45.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b45 = Instance.new("BlockMesh", p45)
b45.Name = "Mesh"
b45.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p46 = Instance.new("Part", m)
p46.BrickColor = BrickColor.new("Br. yellowish orange")
p46.Name = "P46"
p46.CFrame = CFrame.new(74.521553, 1.03643513, -81.6195755, -0.00440586172, -0.998309135, 0.0578165613, -0.498106778, -0.0479342304, -0.8657794, 0.867090285, -0.0326049812, -0.497065514)
p46.CanCollide = false
p46.FormFactor = Enum.FormFactor.Custom
p46.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p46.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p46.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p46.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p46.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p46.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p46.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b46 = Instance.new("BlockMesh", p46)
b46.Name = "Mesh"
b46.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p47 = Instance.new("Part", m)
p47.BrickColor = BrickColor.new("Br. yellowish orange")
p47.Name = "P47"
p47.CFrame = CFrame.new(74.4980774, 1.42602015, -81.4712448, -0.0245325584, -0.998317242, -0.0523835458, 0.864265561, -0.0475060567, 0.500769675, -0.502412498, -0.0329797827, 0.863988936)
p47.CanCollide = false
p47.FormFactor = Enum.FormFactor.Custom
p47.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p47.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p47.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p47.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p47.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p47.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p47.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b47 = Instance.new("BlockMesh", p47)
b47.Name = "Mesh"
b47.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p48 = Instance.new("Part", m)
p48.BrickColor = BrickColor.new("Br. yellowish orange")
p48.Transparency = 1
p48.Name = "P48"
p48.CFrame = CFrame.new(74.4862061, 0.842368245, -80.2588806, 0.0106396191, -0.998316407, 0.0568720587, -0.705345929, -0.0477984995, -0.707237244, 0.70876503, -0.0325813927, -0.704679608)
p48.CanCollide = false
p48.FormFactor = Enum.FormFactor.Custom
p48.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p48.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p48.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p48.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p48.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p48.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p48.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b48 = Instance.new("BlockMesh", p48)
b48.Name = "Mesh"
b48.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p49 = Instance.new("Part", m)
p49.BrickColor = BrickColor.new("Br. yellowish orange")
p49.Name = "P49"
p49.CFrame = CFrame.new(74.518013, 1.03648925, -81.5102005, -0.0520766452, -0.998332024, 0.0245817993, 0.500477791, -0.0473831333, -0.864441395, 0.864176571, -0.0327062085, 0.502107501)
p49.CanCollide = false
p49.FormFactor = Enum.FormFactor.Custom
p49.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p49.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p49.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p49.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p49.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p49.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p49.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b49 = Instance.new("BlockMesh", p49)
b49.Name = "Mesh"
b49.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p50 = Instance.new("Part", m)
p50.BrickColor = BrickColor.new("Br. yellowish orange")
p50.Name = "P50"
p50.CFrame = CFrame.new(74.4254074, 1.71774864, -79.6798553, -0.998332798, 0.0410985909, -0.0403206572, -0.0475317053, -0.983475089, 0.174640924, -0.0324685164, 0.17625919, 0.983799458)
p50.CanCollide = false
p50.FormFactor = Enum.FormFactor.Custom
p50.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p50.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p50.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p50.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p50.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p50.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p50.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b50 = Instance.new("BlockMesh", p50)
b50.Name = "Mesh"
b50.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p51 = Instance.new("Part", m)
p51.BrickColor = BrickColor.new("Br. yellowish orange")
p51.Name = "P51"
p51.CFrame = CFrame.new(74.435791, 1.59756637, -79.8227997, -0.998324037, -0.0144562852, -0.0558864549, -0.0476279929, -0.340493679, 0.93903023, -0.032595519, 0.940123737, 0.339245856)
p51.CanCollide = false
p51.FormFactor = Enum.FormFactor.Custom
p51.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p51.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p51.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p51.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p51.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p51.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p51.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b51 = Instance.new("BlockMesh", p51)
b51.Name = "Mesh"
b51.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p52 = Instance.new("Part", m)
p52.BrickColor = BrickColor.new("Bright orange")
p52.Name = "P52"
p52.CFrame = CFrame.new(74.4798431, 1.02888262, -80.3367844, 0.0477833003, -0.998318195, 0.0325690359, -0.998844683, -0.0478465706, -0.00143165409, 0.0029787838, -0.0324546471, -0.999460161)
p52.CanCollide = false
p52.FormFactor = Enum.FormFactor.Custom
p52.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p52.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p52.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p52.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p52.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p52.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p52.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b52 = Instance.new("BlockMesh", p52)
b52.Name = "Mesh"
b52.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p53 = Instance.new("Part", m)
p53.BrickColor = BrickColor.new("Bright orange")
p53.Name = "P53"
p53.CFrame = CFrame.new(74.2603378, 1.0926019, -74.9605255, 0.0409791954, -0.998298466, -0.041280102, -0.174987525, -0.0478384197, 0.983398616, -0.983710587, -0.0330670364, -0.176643103)
p53.CanCollide = false
p53.FormFactor = Enum.FormFactor.Custom
p53.Size = Vector3.new(0.200000003, 0.200000003, 0.240367845)
p53.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p53.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p53.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p53.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p53.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p53.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b53 = Instance.new("SpecialMesh", p53)
b53.MeshType = Enum.MeshType.Wedge
b53.Name = "Mesh"
b53.Scale = Vector3.new(0.80122602, 0.40061307, 1)
p54 = Instance.new("Part", m)
p54.BrickColor = BrickColor.new("Br. yellowish orange")
p54.Name = "P54"
p54.CFrame = CFrame.new(74.4578781, 1.25330591, -79.9932709, 0.0331607275, -0.998304665, -0.0476598851, -0.00151514332, -0.0477276258, 0.998850226, -0.99944061, -0.0330420434, -0.00308647985)
p54.CanCollide = false
p54.FormFactor = Enum.FormFactor.Custom
p54.Size = Vector3.new(0.200000003, 0.240367845, 0.32049045)
p54.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p54.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p54.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p54.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p54.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p54.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b54 = Instance.new("BlockMesh", p54)
b54.Name = "Mesh"
b54.Scale = Vector3.new(0.40061301, 1, 1)
p55 = Instance.new("Part", m)
p55.BrickColor = BrickColor.new("Br. yellowish orange")
p55.Name = "P55"
p55.CFrame = CFrame.new(74.5032578, 1.31667686, -81.4709473, -0.0574037507, -0.998330653, -0.00488479249, 0.865681469, -0.0473294891, -0.498334706, 0.497283787, -0.0328266025, 0.86695683)
p55.CanCollide = false
p55.FormFactor = Enum.FormFactor.Custom
p55.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p55.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p55.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p55.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p55.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p55.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p55.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b55 = Instance.new("BlockMesh", p55)
b55.Name = "Mesh"
b55.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p56 = Instance.new("Part", m)
p56.BrickColor = BrickColor.new("Br. yellowish orange")
p56.Name = "P56"
p56.CFrame = CFrame.new(74.5002518, 1.37134469, -81.4565201, -0.047846213, -0.998299301, -0.0330535844, 0.998841882, -0.0479081944, 0.00134743063, -0.00291989627, -0.0329424888, 0.999444366)
p56.CanCollide = false
p56.FormFactor = Enum.FormFactor.Custom
p56.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p56.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p56.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p56.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p56.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p56.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p56.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b56 = Instance.new("BlockMesh", p56)
b56.Name = "Mesh"
b56.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p57 = Instance.new("Part", m)
p57.BrickColor = BrickColor.new("Br. yellowish orange")
p57.Name = "P57"
p57.CFrame = CFrame.new(74.5094986, 1.18583572, -81.4706192, -0.0245325584, -0.998317242, -0.0523835458, 0.864265561, -0.0475060567, 0.500769675, -0.502412498, -0.0329797827, 0.863988936)
p57.CanCollide = false
p57.FormFactor = Enum.FormFactor.Custom
p57.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p57.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p57.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p57.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p57.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p57.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p57.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b57 = Instance.new("BlockMesh", p57)
b57.Name = "Mesh"
b57.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p58 = Instance.new("Part", m)
p58.BrickColor = BrickColor.new("Br. yellowish orange")
p58.Name = "P58"
p58.CFrame = CFrame.new(74.5042648, 1.42576611, -81.6607285, 0.0579402298, -0.998300374, 0.00467805378, -0.865818024, -0.0479083695, 0.498040795, -0.496982932, -0.0328980386, -0.867126048)
p58.CanCollide = false
p58.FormFactor = Enum.FormFactor.Custom
p58.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p58.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p58.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p58.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p58.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p58.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p58.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b58 = Instance.new("BlockMesh", p58)
b58.Name = "Mesh"
b58.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p59 = Instance.new("Part", m)
p59.BrickColor = BrickColor.new("Bright orange")
p59.Name = "P59"
p59.CFrame = CFrame.new(74.4232178, 1.71791637, -79.6149521, -0.998327017, 0.0524968728, -0.0238843542, -0.0476160161, -0.983933747, -0.172014907, -0.0325225107, -0.170600072, 0.984794736)
p59.CanCollide = false
p59.FormFactor = Enum.FormFactor.Custom
p59.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p59.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p59.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p59.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p59.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p59.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p59.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b59 = Instance.new("BlockMesh", p59)
b59.Name = "Mesh"
b59.Scale = Vector3.new(0.40061301, 0.40061307, 0.40061301)
p60 = Instance.new("Part", m)
p60.BrickColor = BrickColor.new("Br. yellowish orange")
p60.Name = "P60"
p60.CFrame = CFrame.new(74.4985809, 1.48057747, -81.5661469, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p60.CanCollide = false
p60.FormFactor = Enum.FormFactor.Custom
p60.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p60.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p60.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p60.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p60.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p60.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p60.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b60 = Instance.new("BlockMesh", p60)
b60.Name = "Mesh"
b60.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p61 = Instance.new("Part", m)
p61.BrickColor = BrickColor.new("Br. yellowish orange")
p61.Name = "P61"
p61.CFrame = CFrame.new(74.5210037, 1.07631004, -81.6597672, 0.0250819121, -0.998309731, 0.0522681326, -0.86434716, -0.0479167439, -0.500589728, 0.502244949, -0.032613717, -0.864100158)
p61.CanCollide = false
p61.FormFactor = Enum.FormFactor.Custom
p61.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
p61.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p61.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p61.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p61.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p61.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p61.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b61 = Instance.new("BlockMesh", p61)
b61.Name = "Mesh"
b61.Scale = Vector3.new(0.40061301, 0.801226139, 0.40061301)
p62 = Instance.new("Part", m)
p62.BrickColor = BrickColor.new("Br. yellowish orange")
p62.Name = "P62"
p62.CFrame = CFrame.new(74.4692383, 0.933352768, -79.8722534, 0.0331627764, -0.998302519, -0.0477015413, -0.00155824434, -0.0477707312, 0.99884814, -0.999440432, -0.0330418944, -0.00313103222)
p62.CanCollide = false
p62.FormFactor = Enum.FormFactor.Custom
p62.Size = Vector3.new(0.200000003, 0.240367845, 0.200000003)
p62.BackSurface = Enum.SurfaceType.SmoothNoOutlines
p62.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
p62.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
p62.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
p62.RightSurface = Enum.SurfaceType.SmoothNoOutlines
p62.TopSurface = Enum.SurfaceType.SmoothNoOutlines
b62 = Instance.new("BlockMesh", p62)
b62.Name = "Mesh"
b62.Scale = Vector3.new(0.80122602, 1, 0.801226139)
w1 = Instance.new("Weld", p11)
w1.Name = "P1"
w1.Part0 = p11
w1.C0 = CFrame.new(5.34057617e-005, 0.532310486, 0.35636282, 0.000409020868, -1, 0.000102993094, 0.499988496, 0.000115310409, -0.866032124, 0.866032004, 0.000405720522, 0.499988526)
w1.Part1 = p1
w1.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w2 = Instance.new("Weld", p11)
w2.Name = "P2"
w2.Part0 = p11
w2.C0 = CFrame.new(0, 0.629066467, -0.00461864471, 0.000290755852, -0.99999994, -0.000201782546, -0.865950406, -0.000150862688, -0.500129819, 0.500129759, 0.000320149353, -0.865950406)
w2.Part1 = p2
w2.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w3 = Instance.new("Weld", p11)
w3.Name = "P3"
w3.Part0 = p11
w3.C0 = CFrame.new(0, 0.505859375, 0.155825138, 0.000328774011, -1, 6.23916349e-005, -0.25878635, -0.000145348458, -0.965934634, 0.965934575, 0.000301428081, -0.25878638)
w3.Part1 = p3
w3.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w4 = Instance.new("Weld", p11)
w4.Name = "P4"
w4.Part0 = p11
w4.C0 = CFrame.new(-3.81469727e-005, 0.961502075, 0.0400307178, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w4.Part1 = p4
w4.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w5 = Instance.new("Weld", p11)
w5.Name = "P5"
w5.Part0 = p11
w5.C0 = CFrame.new(-0.000198364258, 1.0951767, -0.442374706, -1, 5.58271495e-005, 0.000208427198, 0.000208424593, 0.499879658, 0.866094828, -5.58369138e-005, 0.866094887, -0.499879628)
w5.Part1 = p5
w5.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w6 = Instance.new("Weld", p11)
w6.Name = "P6"
w6.Part0 = p11
w6.C0 = CFrame.new(-3.05175781e-005, 0.692726135, -0.0310366154, 0.000299799605, -1, -0.000249866163, -0.965866387, -0.000224840973, -0.259040594, 0.259040475, 0.000318997598, -0.965866446)
w6.Part1 = p6
w6.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w7 = Instance.new("Weld", p11)
w7.Name = "P7"
w7.Part0 = p11
w7.C0 = CFrame.new(0, -0.622436523, 0.120296478, -0.000396716408, -1, -0.000213616528, -5.96028258e-008, -0.000213616528, 1, -1, 0.000396716408, 2.51449421e-008)
w7.Part1 = p7
w7.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w8 = Instance.new("Weld", p11)
w8.Name = "P8"
w8.Part0 = p11
w8.C0 = CFrame.new(-9.15527344e-005, -0.841293335, -0.120121956, 0.000335703604, -0.99999994, -0.000274647959, 6.09774143e-005, 0.000274668448, -1, 1, 0.00033568684, 6.10696079e-005)
w8.Part1 = p8
w8.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w9 = Instance.new("Weld", p11)
w9.Name = "P9"
w9.Part0 = p11
w9.C0 = CFrame.new(-3.05175781e-005, 5.88885498, 0.0242705345, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w9.Part1 = p9
w9.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w10 = Instance.new("Weld", p11)
w10.Name = "P10"
w10.Part0 = p11
w10.C0 = CFrame.new(-0.0401077271, 6.11257935, -0.0494781733, 0.000328774011, -1, 6.23916349e-005, -0.25878635, -0.000145348458, -0.965934634, 0.965934575, 0.000301428081, -0.25878638)
w10.Part1 = p10
w10.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w11 = Instance.new("Weld", p11)
w11.Name = "P12"
w11.Part0 = p11
w11.C0 = CFrame.new(-5.34057617e-005, 2.88426208, 0.0883207321, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w11.Part1 = p12
w11.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w12 = Instance.new("Weld", p11)
w12.Name = "P66"
w12.Part0 = p11
w12.C0 = CFrame.new(-7.62939453e-006, 3.48522949, -0.0960006714, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w12.Part1 = p13
w12.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w13 = Instance.new("Weld", p11)
w13.Name = "P14"
w13.Part0 = p11
w13.C0 = CFrame.new(0.0401077271, 5.87762451, 0.165837526, -0.000227210985, 1, -2.56693547e-005, 0.984799027, 0.000219298425, -0.173697904, -0.173697904, -6.47452107e-005, -0.984799027)
w13.Part1 = p14
w13.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w14 = Instance.new("Weld", p11)
w14.Name = "P15"
w14.Part0 = p11
w14.C0 = CFrame.new(-1.52587891e-005, -0.841300964, 0.12024188, 0.000335703604, -0.99999994, -0.000274647959, 6.09774143e-005, 0.000274668448, -1, 1, 0.00033568684, 6.10696079e-005)
w14.Part1 = p15
w14.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w15 = Instance.new("Weld", p11)
w15.Name = "P16"
w15.Part0 = p11
w15.C0 = CFrame.new(0.0400619507, 6.11257172, -0.0495603085, -0.000408517197, 0.999999881, 0.000258168846, 0.258903146, 0.000355132564, -0.965903223, -0.965903163, -0.000327747373, -0.258903265)
w15.Part1 = p16
w15.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w16 = Instance.new("Weld", p11)
w16.Name = "P17"
w16.Part0 = p11
w16.C0 = CFrame.new(-5.34057617e-005, 0.574363708, 0.037350893, 0.000401318073, -1.00000024, -6.7204237e-005, -0.706963122, -0.00023663044, -0.707250774, 0.707250714, 0.000331521034, -0.706963301)
w16.Part1 = p17
w16.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w17 = Instance.new("Weld", p11)
w17.Name = "P65"
w17.Part0 = p11
w17.C0 = CFrame.new(-0.00016784668, 1.28225708, -0.442374229, -1, -4.76508685e-005, 0.000344658969, 0.000322328269, -0.49987185, 0.866099298, 0.000131014953, 0.866099358, 0.49987185)
w17.Part1 = p18
w17.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w18 = Instance.new("Weld", p11)
w18.Name = "P19"
w18.Part0 = p11
w18.C0 = CFrame.new(0.0399627686, 6.12928772, -0.175948501, -0.000396716408, 1, 3.05166359e-005, 0, 3.05166468e-005, -1, -1, -0.000396716408, -1.2101367e-008)
w18.Part1 = p19
w18.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w19 = Instance.new("Weld", p11)
w19.Name = "P20"
w19.Part0 = p11
w19.C0 = CFrame.new(1.52587891e-005, 0.505836487, 0.292643547, 0.000296961196, -0.99999994, 9.13158656e-005, 0.258852482, -1.13343931e-005, -0.965916872, 0.965916812, 0.000310477131, 0.258852482)
w19.Part1 = p20
w19.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w20 = Instance.new("Weld", p11)
w20.Name = "P64"
w20.Part0 = p11
w20.C0 = CFrame.new(-3.05175781e-005, 0.532310486, 0.0921292305, 0.000428915024, -0.999999583, -5.15282154e-005, -0.49978894, -0.000169157982, -0.866146803, 0.866146684, 0.000396966934, -0.499788523)
w20.Part1 = p21
w20.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w21 = Instance.new("Weld", p11)
w21.Name = "P63"
w21.Part0 = p11
w21.C0 = CFrame.new(-5.34057617e-005, 3.52529907, -0.216547966, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w21.Part1 = p22
w21.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w22 = Instance.new("Weld", p11)
w22.Name = "P23"
w22.Part0 = p11
w22.C0 = CFrame.new(-0.0401992798, 6.12924957, -0.175948143, 0.000335643999, -1, -0.000274625578, -6.10668212e-005, 0.000274605118, -1, 1, 0.000335660763, -6.09746457e-005)
w22.Part1 = p23
w22.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w23 = Instance.new("Weld", p11)
w23.Name = "P24"
w23.Part0 = p11
w23.C0 = CFrame.new(8.39233398e-005, 0.591369629, 0.452114344, 0.000290755852, -0.99999994, -0.000201782546, -0.865950406, -0.000150862688, -0.500129819, 0.500129759, 0.000320149353, -0.865950406)
w23.Part1 = p24
w23.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w24 = Instance.new("Weld", p11)
w24.Name = "P25"
w24.Part0 = p11
w24.C0 = CFrame.new(-0.0401153564, 6.06354523, 0.0555975437, 0.000406615087, -1, -5.44825052e-005, -0.573446751, -0.000188537713, -0.819242835, 0.819242775, 0.000364359352, -0.573446751)
w24.Part1 = p25
w24.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w25 = Instance.new("Weld", p11)
w25.Name = "RAY"
w25.Part0 = p11
w25.C0 = CFrame.new(0.000755310059, 3.44516754, 0.0563380718, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w25.Part1 = p26
w25.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w26 = Instance.new("Weld", p11)
w26.Name = "P27"
w26.Part0 = p11
w26.C0 = CFrame.new(2.28881836e-005, 0.79574585, 0.356861115, 0.000251524471, -1, -0.00033528902, -0.939617932, -0.000121592449, -0.342225492, 0.342225403, 0.000401121652, -0.939617872)
w26.Part1 = p27
w26.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w27 = Instance.new("Weld", p11)
w27.Name = "P28"
w27.Part0 = p11
w27.C0 = CFrame.new(-3.05175781e-005, 0.761169434, -0.0400733948, 0.000312735385, -1, -0.000215752894, -1, -0.000312698132, -0.00017266089, 0.000172593413, 0.000215806882, -1)
w27.Part1 = p28
w27.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w28 = Instance.new("Weld", p11)
w28.Name = "P29"
w28.Part0 = p11
w28.C0 = CFrame.new(-0.000839233398, 0.961494446, 0.0320725441, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w28.Part1 = p29
w28.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w29 = Instance.new("Weld", p11)
w29.Name = "P30"
w29.Part0 = p11
w29.C0 = CFrame.new(-0.000831604004, 2.16330719, 0.120316029, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w29.Part1 = p30
w29.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w30 = Instance.new("Weld", p11)
w30.Name = "P31"
w30.Part0 = p11
w30.C0 = CFrame.new(0.0401000977, 5.72930908, 0.18531847, -0.000295270613, 1, 8.10020629e-006, 0.996196032, 0.000294853264, -0.0871398449, -0.0871398374, -1.76604408e-005, -0.996196151)
w30.Part1 = p31
w30.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w31 = Instance.new("Weld", p11)
w31.Name = "P32"
w31.Part0 = p11
w31.C0 = CFrame.new(-3.05175781e-005, -0.881362915, -4.33921814e-005, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w31.Part1 = p32
w31.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w32 = Instance.new("Weld", p11)
w32.Name = "P33"
w32.Part0 = p11
w32.C0 = CFrame.new(-0.000114440918, -0.677146912, -0.214918613, 0.000268456817, -1, -0.000302448607, -0.86615485, -0.000383681647, 0.499775618, -0.499775708, 0.000127799169, -0.866154909)
w32.Part1 = p33
w32.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w33 = Instance.new("Weld", p11)
w33.Name = "P34"
w33.Part0 = p11
w33.C0 = CFrame.new(0.0400848389, 5.98654175, 0.126167297, -0.000315413316, 1, 0.000138656687, 0.866003335, 0.000342482643, -0.500038147, -0.500038207, -3.7641541e-005, -0.866003394)
w33.Part1 = p34
w33.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w34 = Instance.new("Weld", p11)
w34.Name = "P35"
w34.Part0 = p11
w34.C0 = CFrame.new(3.05175781e-005, -0.731864929, 0.229645252, 0.000140018819, -0.99999994, 0.000517935201, 1, 0.000140130593, 0.00021574751, -0.000215820037, 0.000517904991, 0.99999994)
w34.Part1 = p35
w34.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w35 = Instance.new("Weld", p11)
w35.Name = "P36"
w35.Part0 = p11
w35.C0 = CFrame.new(-0.000114440918, 1.04529572, -0.400530338, -1, 0.000112058558, 0.00013821898, 0.000174690591, 0.765981495, 0.642862558, -3.38349309e-005, 0.642862618, -0.765981495)
w35.Part1 = p36
w35.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w36 = Instance.new("Weld", p11)
w36.Name = "P37"
w36.Part0 = p11
w36.C0 = CFrame.new(-0.0400085449, 3.29434204, 0.233157873, 0.000323406741, -0.999999881, -0.00034174521, -0.999842703, -0.000317294121, -0.0177375581, 0.0177374501, 0.000347427878, -0.999842644)
w36.Part1 = p37
w36.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w37 = Instance.new("Weld", p11)
w37.Name = "P38"
w37.Part0 = p11
w37.C0 = CFrame.new(-3.05175781e-005, -0.961418152, -0.00796818733, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w37.Part1 = p38
w37.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w38 = Instance.new("Weld", p11)
w38.Name = "P39"
w38.Part0 = p11
w38.C0 = CFrame.new(0.0401306152, 3.29434204, 0.23316884, -0.000281685148, 1, 1.86586863e-006, 0.999847233, 0.000281674729, -0.0174786132, -0.0174786113, -3.05788194e-006, -0.999847293)
w38.Part1 = p39
w38.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w39 = Instance.new("Weld", p11)
w39.Name = "P40"
w39.Part0 = p11
w39.C0 = CFrame.new(-0.0400848389, 5.72928619, 0.185390234, 0.000312209129, -1.00000274, -0.000288609415, -0.996179938, -0.000291585922, -0.087356776, 0.0873566866, 0.000315029174, -0.996182799)
w39.Part1 = p40
w39.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w40 = Instance.new("Weld", p11)
w40.Name = "P41"
w40.Part0 = p11
w40.C0 = CFrame.new(-4.57763672e-005, -0.786529541, -0.214891911, 0.000290755852, -0.99999994, -0.000201782546, -0.865950406, -0.000150862688, -0.500129819, 0.500129759, 0.000320149353, -0.865950406)
w40.Part1 = p41
w40.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w41 = Instance.new("Weld", p11)
w41.Name = "P42"
w41.Part0 = p11
w41.C0 = CFrame.new(-9.15527344e-005, 1.00154877, -0.280337453, -1, 0.000152600463, -9.15317796e-005, 0.000152575318, 0.99999994, 0.000274665188, 9.15736891e-005, 0.000274651218, -1)
w41.Part1 = p42
w41.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w42 = Instance.new("Weld", p11)
w42.Name = "P43"
w42.Part0 = p11
w42.C0 = CFrame.new(0.0401153564, 6.06355286, 0.0556137562, -0.000398867851, 1, 0.000186098972, 0.573604763, 0.00038123221, -0.819132149, -0.819132149, -0.000219978247, -0.573604882)
w42.Part1 = p43
w42.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w43 = Instance.new("Weld", p11)
w43.Name = "P44"
w43.Part0 = p11
w43.C0 = CFrame.new(-0.0401382446, 5.98651123, 0.126256704, 0.000290755852, -0.99999994, -0.000201782546, -0.865950406, -0.000150862688, -0.500129819, 0.500129759, 0.000320149353, -0.865950406)
w43.Part1 = p44
w43.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w44 = Instance.new("Weld", p11)
w44.Name = "P45"
w44.Part0 = p11
w44.C0 = CFrame.new(0, -0.637084961, 0.174972057, 0.000110034518, -1, -0.000174376502, 0.500071824, -9.598209e-005, 0.865984023, -0.865983903, -0.00018248889, 0.500071824)
w44.Part1 = p45
w44.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w45 = Instance.new("Weld", p11)
w45.Name = "P46"
w45.Part0 = p11
w45.C0 = CFrame.new(0, -0.786567688, 0.214953423, 0.000318960956, -1, 0.000304582762, 0.86610198, 0.000124001788, -0.499867409, 0.49986726, 0.000423237914, 0.86610198)
w45.Part1 = p46
w45.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w46 = Instance.new("Weld", p11)
w46.Name = "P47"
w46.Part0 = p11
w46.C0 = CFrame.new(-6.10351563e-005, -0.637023926, -0.174875617, 0.000130058354, -1, -0.000213304491, -0.500174046, -0.00024975749, 0.865924954, -0.865924954, -5.93141567e-006, -0.500174046)
w46.Part1 = p47
w46.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w47 = Instance.new("Weld", p11)
w47.Name = "P48"
w47.Part0 = p11
w47.C0 = CFrame.new(3.81469727e-005, 0.574295044, 0.411092997, 0.000307865994, -1, 9.85547595e-005, 0.707087398, 0.000147997533, -0.7071262, 0.707126141, 0.000287386938, 0.707087457)
w47.Part1 = p48
w47.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w48 = Instance.new("Weld", p11)
w48.Name = "P49"
w48.Part0 = p11
w48.C0 = CFrame.new(5.34057617e-005, -0.677139282, 0.215050459, 8.53582751e-005, -1, -9.9242221e-005, 0.86610198, 2.43210234e-005, 0.499867409, -0.49986738, -0.000128621687, 0.86610204)
w48.Part1 = p49
w48.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w49 = Instance.new("Weld", p11)
w49.Name = "P50"
w49.Part0 = p11
w49.C0 = CFrame.new(-9.91821289e-005, 1.15619659, -0.464501381, -1, 6.55345139e-005, 0.000254195882, 0.000261710753, 0.173489466, 0.984835744, 2.04404205e-005, 0.984835744, -0.173489481)
w49.Part1 = p50
w49.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w50 = Instance.new("Weld", p11)
w50.Name = "P51"
w50.Part0 = p11
w50.C0 = CFrame.new(-0.000129699707, 1.01282501, -0.344378352, -1, 0.000166169106, -6.36503828e-005, 0.000134359943, 0.939639211, 0.34216705, 0.000116665979, 0.34216705, -0.939639211)
w50.Part1 = p51
w50.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w51 = Instance.new("Weld", p11)
w51.Name = "P52"
w51.Part0 = p11
w51.C0 = CFrame.new(0, 0.496894836, 0.2242589, 0.000335703604, -0.99999994, -0.000274647959, 6.09774143e-005, 0.000274668448, -1, 1, 0.00033568684, 6.10696079e-005)
w51.Part1 = p52
w51.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w52 = Instance.new("Weld", p11)
w52.Name = "P53"
w52.Part0 = p11
w52.C0 = CFrame.new(-0.0401000977, 5.87759399, 0.165872812, 0.000389685971, -0.999999881, -0.000262950693, -0.984769046, -0.000338032172, -0.173867315, 0.173867196, 0.000326699344, -0.984769106)
w52.Part1 = p53
w52.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w53 = Instance.new("Weld", p11)
w53.Name = "P54"
w53.Part0 = p11
w53.C0 = CFrame.new(-1.52587891e-005, 0.841255188, 4.69684601e-005, 0.000312735385, -1, -0.000215752894, -1, -0.000312698132, -0.00017266089, 0.000172593413, 0.000215806882, -1)
w53.Part1 = p54
w53.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w54 = Instance.new("Weld", p11)
w54.Name = "P55"
w54.Part0 = p11
w54.C0 = CFrame.new(-7.62939453e-005, -0.637046814, -0.0654084682, 0.000110034518, -1, -0.000174376502, 0.500071824, -9.598209e-005, 0.865984023, -0.865983903, -0.00018248889, 0.500071824)
w54.Part1 = p55
w54.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w55 = Instance.new("Weld", p11)
w55.Name = "P56"
w55.Part0 = p11
w55.C0 = CFrame.new(-7.62939453e-006, -0.622451782, -0.120115519, -0.000396716408, -1, -0.000213616528, -5.96028258e-008, -0.000213616528, 1, -1, 0.000396716408, 2.51449421e-008)
w55.Part1 = p56
w55.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w56 = Instance.new("Weld", p11)
w56.Name = "P57"
w56.Part0 = p11
w56.C0 = CFrame.new(-5.34057617e-005, -0.63710022, 0.0655829906, 0.000130058354, -1, -0.000213304491, -0.500174046, -0.00024975749, 0.865924954, -0.865924954, -5.93141567e-006, -0.500174046)
w56.Part1 = p57
w56.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w57 = Instance.new("Weld", p11)
w57.Name = "P58"
w57.Part0 = p11
w57.C0 = CFrame.new(-9.91821289e-005, -0.82660675, -0.174880862, 0.000428915024, -0.999999583, -5.15282154e-005, -0.49978894, -0.000169157982, -0.866146803, 0.866146684, 0.000396966934, -0.499788523)
w57.Part1 = p58
w57.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w58 = Instance.new("Weld", p11)
w58.Name = "P59"
w58.Part0 = p11
w58.C0 = CFrame.new(-0.000152587891, 1.22113037, -0.464583635, -1, 6.71830494e-005, 0.000222479764, 0.000207442936, -0.173560232, 0.984823287, 0.000104777064, 0.984823287, 0.173560217)
w58.Part1 = p59
w58.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w59 = Instance.new("Weld", p11)
w59.Name = "P60"
w59.Part0 = p11
w59.C0 = CFrame.new(-7.62939453e-005, -0.731819153, -0.229624748, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w59.Part1 = p60
w59.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w60 = Instance.new("Weld", p11)
w60.Name = "P61"
w60.Part0 = p11
w60.C0 = CFrame.new(3.05175781e-005, -0.826667786, 0.174979925, 0.000409020868, -1, 0.000102993094, 0.499988496, 0.000115310409, -0.866032124, 0.866032004, 0.000405720522, 0.499988526)
w60.Part1 = p61
w60.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
w61 = Instance.new("Weld", p11)
w61.Name = "P62"
w61.Part0 = p11
w61.C0 = CFrame.new(8.39233398e-005, 0.961402893, 0.320533037, 0.000312735385, -0.999999881, -0.000258901709, -1, -0.000312679476, -0.000215824606, 0.000215743639, 0.000258969172, -1)
w61.Part1 = p62
w61.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
m.Parent = char
m:MakeJoints()
local tr = char:WaitForChild("Torso")
local lr = char:WaitForChild("Left Arm")
local ra = char:WaitForChild("Right Arm")
local s1 = Instance.new("Sound", char.Head)
s1.Volume = 1
s1.SoundId = "rbxassetid://419372077"
s1.Pitch = 1
local s2 = Instance.new("Sound", char.Head)
s2.Volume = 1
s2.SoundId = "rbxassetid://419378177"
local s3 = Instance.new("Sound", char.Head)
s3.Volume = 1
s3.SoundId = "rbxassetid://419378177"
local s4 = Instance.new("Sound", char.Head)
s4.Volume = 1
s4.SoundId = "rbxassetid://320557518"
local s5 = Instance.new("Sound", char.Head)
s5.Volume = 1
s5.SoundId = "rbxassetid://320557537"
local s6 = Instance.new("Sound", char.Head)
s6.Volume = 1
s6.SoundId = "rbxassetid://433087655"
local s7 = Instance.new("Sound", char.Head)
s7.Volume = 1
s7.SoundId = "rbxassetid://338586299"
local s8 = Instance.new("Sound", char.Head)
s8.Volume = 1
s8.SoundId = "rbxassetid://338586318"
local s9 = Instance.new("Sound", char.Head)
s9.Volume = 1
s9.SoundId = "rbxassetid://338586331"
local w3 = Instance.new("Weld", char)
run = game:GetService("RunService")
w3.Part0 = lr
w3.Part1 = tr
w3.C0 = CFrame.new(1.5, 0, 0)
local w4 = Instance.new("Weld", char)
w4.Part0 = ra
w4.Part1 = tr
w4.C0 = CFrame.new(-1.5, 0, 0)
local nc = Instance.new("Weld", char)
nc.Part0 = char.Torso
nc.Part1 = char.Head
nc.C0 = CFrame.new(0, 1.5, 0)
local ll = Instance.new("Weld", char)
ll.Part0 = char.Torso
ll.Part1 = char["Left Leg"]
ll.C0 = CFrame.new(-0.5, -2, 0)
local rl = Instance.new("Weld", char)
rl.Part0 = char.Torso
rl.Part1 = char["Right Leg"]
rl.C0 = CFrame.new(0.5, -2, 0)
local ts = Instance.new("Weld", char)
ts.Part0 = char.HumanoidRootPart
ts.Part1 = char.Torso
ts.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
SWELD = Instance.new("Weld", char)
SWELD.Part0 = char["Right Arm"]
SWELD.Part1 = p11
turnonwelds = function()
w3.Part1 = tr
w4.Part1 = tr
nc.Part1 = char.Head
ll.Part1 = char["Left Leg"]
rl.Part1 = char["Right Leg"]
end
turnoffwelds = function()
w3.Part1 = nil
w4.Part1 = nil
nc.Part1 = nil
ll.Part1 = nil
rl.Part1 = nil
end
turnoffwelds()
local walk = {ll.C0 * CFrame.new(0.4, 0, 0.4) * CFrame.Angles(math.rad(0), math.rad(150), math.rad(-50)), rl.C0 * CFrame.new(-0.4, 0, -0.4) * CFrame.Angles(math.rad(0), math.rad(150), math.rad(50)), ll.C0 * CFrame.new(-0.4, 0, -0.4) * CFrame.Angles(math.rad(0), math.rad(150), math.rad(50)), rl.C0 * CFrame.new(0.4, 0, -0.4) * CFrame.Angles(math.rad(0), math.rad(150), math.rad(-50)), ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(-70), 0), nc.C0 * CFrame.Angles(math.rad(0), math.rad(70), 0), w4.C0 * CFrame.new(0.2, 1, -0.5) * CFrame.Angles(math.rad(0), math.rad(-30), math.rad(-30)), w3.C0 * CFrame.new(-0.5, 0, 0) * CFrame.Angles(math.rad(-60), math.rad(50), math.rad(0))}
local equip = {nc.C0 * CFrame.Angles(math.rad(-10), math.rad(0), 0), w3.C0 * CFrame.new(-1.1, -0.1, -1.2) * CFrame.Angles(math.rad(-160), 0, math.rad(90)), w4.C0 * CFrame.new(1.1, -0.2, -1.2) * CFrame.Angles(math.rad(-160), 0, math.rad(-90))}
local idle = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(-90), 0), nc.C0 * CFrame.Angles(0, math.rad(90), 0), ll.C0 * CFrame.new(-0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-5)), rl.C0 * CFrame.new(0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(5)), w3.C0 * CFrame.new(-0.5, 0, 0) * CFrame.Angles(math.rad(-60), math.rad(40), math.rad(0)), w4.C0 * CFrame.new(0.5, 0, 0) * CFrame.Angles(math.rad(-60), math.rad(-40), math.rad(0))}
local PA1 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(430), math.rad(0)), ll.C0 * CFrame.new(-0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-5)), rl.C0 * CFrame.new(0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(5)), nc.C0 * CFrame.Angles(math.rad(-5), math.rad(-40), 0), w3.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-120), math.rad(40), math.rad(20)), w4.C0 * CFrame.new(1, 1, 0.6) * CFrame.Angles(math.rad(-90), math.rad(-30), math.rad(20))}
local PA21 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-10), math.rad(0), 0), ll.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(10), math.rad(0), math.rad(0)), rl.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(10), math.rad(0), math.rad(0)), nc.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-5), math.rad(0), 0), w3.C0 * CFrame.new(-0.5, 0, 0) * CFrame.Angles(math.rad(-60), math.rad(40), math.rad(0)), w4.C0 * CFrame.new(0.5, 0, 0) * CFrame.Angles(math.rad(-60), math.rad(-40), math.rad(0))}
local PA2 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(0), 0), ll.C0 * CFrame.new(-0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-5)), rl.C0 * CFrame.new(0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(5)), nc.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(20), math.rad(0), 0), w4.C0 * CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(-150), math.rad(-40), math.rad(-10)), w3.C0 * CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(-150), math.rad(40), math.rad(10))}
local SK2 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(90), 0), ll.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(10), math.rad(-5)), rl.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(-10), math.rad(5)), nc.C0 * CFrame.Angles(math.rad(0), math.rad(-90), 0), w4.C0 * CFrame.new(1, 2, 0) * CFrame.Angles(math.rad(0), 0, math.rad(-90)), w3.C0 * CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), 0, math.rad(40))}
local SK3 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(-40), 0), ll.C0 * CFrame.new(-0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-5)), rl.C0 * CFrame.new(0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(5)), nc.C0 * CFrame.Angles(math.rad(10), math.rad(40), 0), w4.C0 * CFrame.new(0, 0.7, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-30)), w3.C0 * CFrame.new(-0.3, 1.7, 0) * CFrame.Angles(math.rad(-110), math.rad(-20), math.rad(0))}
local SK4 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-10), math.rad(0), 0), ll.C0 * CFrame.new(-0.1, 0, -0.2) * CFrame.Angles(math.rad(10), math.rad(0), math.rad(-5)), rl.C0 * CFrame.new(0.1, 0, -0.2) * CFrame.Angles(math.rad(10), math.rad(0), math.rad(5)), nc.C0 * CFrame.Angles(math.rad(10), math.rad(0), 0), w4.C0 * CFrame.new(0, 1, 0.5) * CFrame.Angles(math.rad(-100), math.rad(0), math.rad(0)), w3.C0 * CFrame.new(0, 1, 0.5) * CFrame.Angles(math.rad(-100), math.rad(0), math.rad(0))}
local med = {ts.C0 * CFrame.new(0, -1.7, 0) * CFrame.Angles(math.rad(0), math.rad(0), 0), ll.C0 * CFrame.new(0, 1, -0.5) * CFrame.Angles(math.rad(0), math.rad(40), math.rad(90)), rl.C0 * CFrame.new(0, 1, -0.5) * CFrame.Angles(math.rad(0), math.rad(-40), math.rad(-90)), nc.C0 * CFrame.Angles(math.rad(-20), math.rad(0), 0), w4.C0 * CFrame.new(1.1, -0.2, -1.2) * CFrame.Angles(math.rad(-160), 0, math.rad(-90)), w3.C0 * CFrame.new(-1.1, -0.1, -1.2) * CFrame.Angles(math.rad(-160), 0, math.rad(90))}
local PA3 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(20), math.rad(-40), 0), nc.C0 * CFrame.Angles(math.rad(-20), math.rad(40), 0), w4.C0 * CFrame.new(1, 2, 0) * CFrame.Angles(math.rad(10), math.rad(10), math.rad(-90)), w3.C0 * CFrame.new(-1, 2, 0) * CFrame.Angles(math.rad(30), math.rad(40), math.rad(70)), ll.C0 * CFrame.new(-1, 1, -0.7) * CFrame.Angles(math.rad(80), math.rad(0), math.rad(-40)), rl.C0 * CFrame.new(0.5, 0.5, 0.5) * CFrame.Angles(math.rad(-20), math.rad(-40), math.rad(40))}
local heal = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), 0), nc.C0 * CFrame.Angles(math.rad(-10), math.rad(0), 0), w4.C0 * CFrame.new(1, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-90)), w3.C0 * CFrame.new(-1, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(90)), ll.C0 * CFrame.new(-0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-5)), rl.C0 * CFrame.new(0.1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(5))}
local PA4 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(60), math.rad(-60), 0), nc.C0 * CFrame.Angles(math.rad(-25), math.rad(50), 0), w4.C0 * CFrame.new(0.4, 1, 0.7) * CFrame.Angles(math.rad(50), 0, math.rad(-70)), w3.C0 * CFrame.new(-1.2, -0.2, 1) * CFrame.Angles(math.rad(-40), math.rad(20), math.rad(-50)), ll.C0 * CFrame.new(-1, 0.5, 0) * CFrame.Angles(0, math.rad(0), math.rad(-30)), rl.C0 * CFrame.new(1, 0.5, 0.5) * CFrame.Angles(0, math.rad(-20), math.rad(40))}
local jump = {nc.C0 * CFrame.Angles(math.rad(20), 0, 0), w4.C0 * CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, math.rad(-30)), w3.C0 * CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, math.rad(30)), ll.C0 * CFrame.new(-0.3, 0, 0) * CFrame.Angles(0, 0, math.rad(-20)), rl.C0 * CFrame.new(0.3, 0, 0) * CFrame.Angles(0, 0, math.rad(20))}
local stunned = {nc.C0 * CFrame.Angles(0, math.rad(90), 0), w4.C0 * CFrame.new(0, 1, 0) * CFrame.Angles(0, 0, math.rad(-50)), w3.C0 * CFrame.new(0, 1, 0) * CFrame.Angles(0, 0, math.rad(50)), ll.C0 * CFrame.new(-0.3, 0, 0) * CFrame.Angles(0, 0, math.rad(-20)), rl.C0 * CFrame.new(0.3, 0, 0) * CFrame.Angles(0, 0, math.rad(20)), ts.C0 * CFrame.new(0, -2.5, 0) * CFrame.Angles(math.rad(90), 0, 0)}
local PA1C = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-30), math.rad(-40), math.rad(-30)), ll.C0 * CFrame.new(0, 0, -0.5) * CFrame.Angles(math.rad(20), math.rad(30), math.rad(-10)), rl.C0 * CFrame.new(0, -0.05, -0.5) * CFrame.Angles(math.rad(20), math.rad(-30), math.rad(10)), nc.C0 * CFrame.Angles(math.rad(-7), math.rad(-20), 0), w3.C0 * CFrame.new(0, 0.5, -0.2) * CFrame.Angles(math.rad(-100), math.rad(40), math.rad(30)), w4.C0 * CFrame.new(0, 0.6, 0) * CFrame.Angles(math.rad(30), 0, math.rad(-20))}
local Stomp = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(0), 0), nc.C0 * CFrame.Angles(math.rad(-13), math.rad(-20), 0), ll.C0 * CFrame.new(-0.05, 0, 0) * CFrame.new(math.rad(0), math.rad(0), math.rad(0)), rl.C0 * CFrame.new(0, 0.6, -0.6) * CFrame.Angles(math.rad(0), 0, math.rad(0)), w3.C0 * CFrame.new(0, 0.7, 0) * CFrame.Angles(math.rad(-30), 0, math.rad(30)), w4.C0 * CFrame.new(0, 0.7, 0) * CFrame.Angles(math.rad(-30), 0, math.rad(-30))}
local Stomp2 = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(0), 0), nc.C0 * CFrame.Angles(math.rad(-25), math.rad(-20), 0), ll.C0 * CFrame.new(-0.05, 0, 0) * CFrame.new(math.rad(0), math.rad(0), math.rad(0)), rl.C0 * CFrame.new(0, 0, -0.6) * CFrame.Angles(math.rad(0), 0, math.rad(0)), w3.C0 * CFrame.new(0, 0.7, 0) * CFrame.Angles(math.rad(-30), 0, math.rad(35)), w4.C0 * CFrame.new(0, 0.7, 0) * CFrame.Angles(math.rad(-30), 0, math.rad(-35))}
local dropkick = {ts.C0 * CFrame.new(0, 0.8, 0) * CFrame.Angles(math.rad(90), math.rad(45), 0), nc.C0 * CFrame.new(0, 0, -0.2) * CFrame.Angles(math.rad(-30), math.rad(-20), 0), ll.C0 * CFrame.new(-0.2, 0, -0.3) * CFrame.Angles(math.rad(-20), math.rad(0), math.rad(0)), rl.C0 * CFrame.new(-0.05, 0, 0) * CFrame.Angles(math.rad(0), math.rad(20), math.rad(0)), w3.C0 * CFrame.new(-2.7, 1.5, 0) * CFrame.Angles(math.rad(0), 0, math.rad(170)), w4.C0 * CFrame.new(2.7, 1.5, 0) * CFrame.Angles(math.rad(0), 0, math.rad(-160))}
local block = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), nc.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-9), math.rad(0), 0), ll.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), rl.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), w3.C0 * CFrame.new(-0.8, 1.3, -0.6) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0)), w4.C0 * CFrame.new(0.8, 1.3, -0.6) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}
local sjump = {ts.C0 * CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(-10), 0, 0), nc.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-15), math.rad(0), 0), ll.C0 * CFrame.new(0, 0.4, 0.8) * CFrame.Angles(math.rad(-70), 0, 0), rl.C0 * CFrame.new(0, 0.8, -0.5) * CFrame.Angles(math.rad(-10), 0, 0), w3.C0 * CFrame.new(0, 0.5, 0.5) * CFrame.Angles(math.rad(-50), math.rad(0), math.rad(0)), w4.C0 * CFrame.new(0, 0, -0.5) * CFrame.Angles(math.rad(40), math.rad(0), math.rad(0))}
local UpSideDownPunch = {ts.C0 * CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(180), 0, 0), nc.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), ll.C0 * CFrame.new(-0.4, 0, 0) * CFrame.Angles(0, 0, math.rad(-20)), rl.C0 * CFrame.new(0.4, 0, 0) * CFrame.Angles(0, 0, math.rad(20)), w3.C0 * CFrame.new(0, 1.7, 0) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(0)), w4.C0 * CFrame.new(0, 1.7, 0) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(0))}
local BackBreaker = {ts.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(10), math.rad(15), 0), nc.C0 * CFrame.Angles(math.rad(-15), math.rad(-5), 0), w4.C0 * CFrame.new(0, 0.1, 0.3) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)), w3.C0 * CFrame.new(0, 0.5, 0.5) * CFrame.Angles(math.rad(-90), math.rad(20), math.rad(0)), ll.C0 * CFrame.new(-0.3, 0, 0.3) * CFrame.Angles(math.rad(-20), math.rad(30), math.rad(-10)), rl.C0 * CFrame.new(-0.2, 1, -0.5) * CFrame.Angles(math.rad(-40), 0, math.rad(0))}
local FrontFlipKick1 = {ts.C0 * CFrame.new(0, 2, 0) * CFrame.Angles(math.rad(-8), math.rad(0), 0), nc.C0 * CFrame.Angles(math.rad(-15), math.rad(-5), 0), w4.C0 * CFrame.new(0, 1, -0.3) * CFrame.Angles(math.rad(140), math.rad(0), math.rad(0)), w3.C0 * CFrame.new(0, 1, -0.3) * CFrame.Angles(math.rad(140), math.rad(0), math.rad(0)), ll.C0 * CFrame.new(0, 1, 1) * CFrame.Angles(math.rad(-110), 0, math.rad(0)), rl.C0 * CFrame.new(0, 1, -1) * CFrame.Angles(math.rad(110), 0, math.rad(0))}
f = Instance.new("ScreenGui", player.PlayerGui)
f.Name = "UI"
f1 = Instance.new("Frame", f)
f1.BorderSizePixel = 0
f1.BackgroundColor3 = Color3.new(0, 0, 0)
f1.Size = UDim2.new(0.3, 0, 0.05, 0)
f1.Position = UDim2.new(0.2, 0, 0.84, 0)
f1f = Instance.new("Frame", f1)
f1f.BorderSizePixel = 0
f1f.BackgroundColor3 = Color3.new(255, 255, 255)
f1f.Size = UDim2.new(1, 0, 1, 0)
f1l = Instance.new("TextLabel", f1)
f1l.TextScaled = true
f1l.TextStrokeTransparency = 0
f1l.BackgroundTransparency = 1
f1l.TextColor3 = Color3.new(255, 255, 255)
f1l.BorderSizePixel = 0
f1l.Size = UDim2.new(1, 0, 1, 0)
f1l.Text = "[Z] Heal"
f2 = Instance.new("Frame", f)
f2.BorderSizePixel = 0
f2.BackgroundColor3 = Color3.new(0, 0, 0)
f2.Size = UDim2.new(0.3, 0, 0.05, 0)
f2.Position = UDim2.new(0.52, 0, 0.84, 0)
f2f = Instance.new("Frame", f2)
f2f.BorderSizePixel = 0
f2f.BackgroundColor3 = Color3.new(255, 255, 255)
f2f.Size = UDim2.new(1, 0, 1, 0)
f2l = Instance.new("TextLabel", f2)
f2l.TextScaled = true
f2l.TextStrokeTransparency = 0
f2l.BackgroundTransparency = 1
f2l.TextColor3 = Color3.new(255, 255, 255)
f2l.BorderSizePixel = 0
f2l.Size = UDim2.new(1, 0, 1, 0)
f2l.Text = "[X] Cleanse"
f3 = Instance.new("Frame", f)
f3.BorderSizePixel = 0
f3.BackgroundColor3 = Color3.new(0, 0, 0)
f3.Size = UDim2.new(0.3, 0, 0.05, 0)
f3.Position = UDim2.new(0.2, 0, 0.9, 0)
f3f = Instance.new("Frame", f3)
f3f.BorderSizePixel = 0
f3f.BackgroundColor3 = Color3.new(255, 255, 255)
f3f.Size = UDim2.new(1, 0, 1, 0)
f3l = Instance.new("TextLabel", f3)
f3l.TextScaled = true
f3l.TextStrokeTransparency = 0
f3l.BackgroundTransparency = 1
f3l.TextColor3 = Color3.new(255, 255, 255)
f3l.BorderSizePixel = 0
f3l.Size = UDim2.new(1, 0, 1, 0)
f3l.Text = "[C] Purify"
f4 = Instance.new("Frame", f)
f4.BorderSizePixel = 0
f4.BackgroundColor3 = Color3.new(0, 0, 0)
f4.Size = UDim2.new(0.3, 0, 0.05, 0)
f4.Position = UDim2.new(0.52, 0, 0.9, 0)
f4f = Instance.new("Frame", f4)
f4f.BorderSizePixel = 0
f4f.BackgroundColor3 = Color3.new(255, 255, 255)
f4f.Size = UDim2.new(1, 0, 1, 0)
f4l = Instance.new("TextLabel", f4)
f4l.TextScaled = true
f4l.TextStrokeTransparency = 0
f4l.BackgroundTransparency = 1
f4l.TextColor3 = Color3.new(255, 255, 255)
f4l.BorderSizePixel = 0
f4l.Size = UDim2.new(1, 0, 1, 0)
f4l.Text = "[V] Banish "
f5 = Instance.new("Frame", f)
f5.BorderSizePixel = 0
f5.BackgroundColor3 = Color3.new(255, 255, 255)
f5.Size = UDim2.new(0.3, 0, 0.03, 0)
f5.Position = UDim2.new(0.52, 0, 0.8, 0)
f5f = Instance.new("Frame", f5)
f5f.BorderSizePixel = 0
f5f.BackgroundColor3 = Color3.new(0, 255, 0)
f5f.Size = UDim2.new(1, 0, 1, 0)
f5l = Instance.new("TextLabel", f5)
f5l.TextScaled = true
f5l.TextStrokeTransparency = 0
f5l.BackgroundTransparency = 1
f5l.TextColor3 = Color3.new(255, 255, 255)
f5l.BorderSizePixel = 0
f5l.Size = UDim2.new(1, 0, 1, 0)
f5l.Text = "Health"
f6 = Instance.new("Frame", f)
f6.BorderSizePixel = 0
f6.BackgroundColor3 = Color3.new(255, 255, 255)
f6.Size = UDim2.new(0.3, 0, 0.03, 0)
f6.Position = UDim2.new(0.2, 0, 0.8, 0)
f6f = Instance.new("Frame", f6)
f6f.BorderSizePixel = 0
f6f.BackgroundColor3 = BrickColor.new("Forest green").Color
f6f.Size = UDim2.new(1, 0, 1, 0)
f6l = Instance.new("TextLabel", f6)
f6l.TextScaled = true
f6l.TextStrokeTransparency = 0
f6l.BackgroundTransparency = 1
f6l.TextColor3 = Color3.new(255, 255, 255)
f6l.BorderSizePixel = 0
f6l.Size = UDim2.new(1, 0, 1, 0)
f6l.Text = "Mana"
fa = Instance.new("TextLabel", f)
fa.TextScaled = true
fa.TextStrokeTransparency = 0
fa.BackgroundTransparency = 0.5
fa.BackgroundColor3 = Color3.new(0, 0, 0)
fa.TextColor3 = Color3.new(255, 0, 0)
fa.BorderSizePixel = 0
fa.Size = UDim2.new(0.2, 0, 0.05, 0)
fa.Position = UDim2.new(0.2, 0, 0.74, 0)
fa.Text = "Attack : 1"
fa2 = Instance.new("TextLabel", f)
fa2.TextScaled = true
fa2.TextStrokeTransparency = 0
fa2.BackgroundTransparency = 0.5
fa2.BackgroundColor3 = Color3.new(0, 0, 0)
fa2.TextColor3 = Color3.new(0, 255, 0)
fa2.BorderSizePixel = 0
fa2.Size = UDim2.new(0.2, 0, 0.05, 0)
fa2.Position = UDim2.new(0.41, 0, 0.74, 0)
fa2.Text = "Speed : 1"
fa3 = Instance.new("TextLabel", f)
fa3.TextScaled = true
fa3.TextStrokeTransparency = 0
fa3.BackgroundTransparency = 0.5
fa3.BackgroundColor3 = Color3.new(0, 0, 0)
fa3.TextColor3 = Color3.new(0, 0, 255)
fa3.BorderSizePixel = 0
fa3.Size = UDim2.new(0.2, 0, 0.05, 0)
fa3.Position = UDim2.new(0.62, 0, 0.74, 0)
fa3.Text = "Defense : 1"
S1 = true
S1T = 0
S1TF = 7
S2 = true
S2T = 0
S2TF = 15
S3 = true
S3T = 0
S3TF = 12
S4 = true
S4T = 0
S4TF = 30
energy = 0
local Close1 = CFrame.new(1.5, 0, 0)
local Close2 = CFrame.new(-1.5, 0, 0)
local Speed = 0.3
local Open4 = w4.C0 * CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, math.rad(-30))
local h1 = nc.C0 * CFrame.Angles(math.rad(20), math.rad(-30), 0)
local h2 = CFrame.new(0, 1.5, 0)
local h3 = nc.C0 * CFrame.Angles(math.rad(-20), math.rad(30), 0)
local opend = false
local current = true
local DGU = function(p, txt)
s2:Play()
local par = Instance.new("Part", game.Workspace)
par.Transparency = 1
par.Anchored = true
par.CFrame = p.CFrame
par.CanCollide = false
game.Debris:AddItem(par, 10)
local f = Instance.new("BillboardGui", par)
f.Size = UDim2.new(1.2, 0, 1.2, 0)
f.AlwaysOnTop = true
f.StudsOffset = Vector3.new(0, 2, 0)
local fr = Instance.new("Frame", f)
fr.BackgroundTransparency = 1
fr.Size = UDim2.new(1, 0, 1, 0)
fr.ClipsDescendants = true
local fe = Instance.new("TextLabel", fr)
fe.Size = UDim2.new(1, 0, 1, 0)
fe.BackgroundTransparency = 1
fe.TextColor3 = BrickColor.new("Bright yellow").Color
fe.TextStrokeTransparency = 0
fe.Text = txt
fe.TextScaled = true
fe.Font = "Legacy"
fe.Position = UDim2.new(0, 0, 1, 0)
fe:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Linear", 0.5)
wait(2)
fe:TweenPosition(UDim2.new(0, 0, -1, 0), "In", "Linear", 0.4)
for i = 0, 10 do
wait()
fe.TextTransparency = fe.TextTransparency + 0.1
end
end
local HL = function(p, txt)
local par = Instance.new("Part", game.Workspace)
par.Transparency = 1
par.Anchored = true
par.CFrame = p.CFrame
par.CanCollide = false
game.Debris:AddItem(par, 10)
local f = Instance.new("BillboardGui", par)
f.Size = UDim2.new(1.2, 0, 1.2, 0)
f.AlwaysOnTop = true
f.StudsOffset = Vector3.new(0, 2, 0)
local fr = Instance.new("Frame", f)
fr.BackgroundTransparency = 1
fr.Size = UDim2.new(1, 0, 1, 0)
fr.ClipsDescendants = true
local fe = Instance.new("TextLabel", fr)
fe.Size = UDim2.new(1, 0, 1, 0)
fe.BackgroundTransparency = 1
fe.TextColor3 = BrickColor.new("Lime green").Color
fe.TextStrokeTransparency = 0
fe.Text = txt
fe.TextScaled = true
fe.Font = "Legacy"
fe.Position = UDim2.new(0, 0, 1, 0)
fe:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Linear", 0.5)
wait(2)
fe:TweenPosition(UDim2.new(0, 0, -1, 0), "In", "Linear", 0.4)
for i = 0, 10 do
wait()
fe.TextTransparency = fe.TextTransparency + 0.1
end
end
makeui = function(color, txt)
local par = Instance.new("Part", game.Workspace)
par.Transparency = 1
par.Anchored = true
par.CFrame = char.Head.CFrame
par.CanCollide = false
game.Debris:AddItem(par, 10)
local f = Instance.new("BillboardGui", par)
f.Size = UDim2.new(1.2, 0, 1.2, 0)
f.AlwaysOnTop = true
f.StudsOffset = Vector3.new(0, 4, 0)
local fr = Instance.new("Frame", f)
fr.BackgroundTransparency = 1
fr.Size = UDim2.new(2, 0, 2, 0)
fr.ClipsDescendants = true
local fe = Instance.new("TextLabel", fr)
fe.Size = UDim2.new(1, 0, 1, 0)
fe.BackgroundTransparency = 1
fe.TextColor3 = Color3.new(255, 255, 255)
fe.TextStrokeTransparency = 0
fe.Text = txt
fe.TextScaled = true
fe.Font = "SourceSansBold"
game.Debris:AddItem(f, 4)
fe.Position = UDim2.new(0, 0, 1, 0)
fe:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Linear", 0.5)
wait(2)
fe:TweenPosition(UDim2.new(0, 0, -1, 0), "In", "Linear", 0.4)
for i = 0, 10 do
wait()
fe.TextTransparency = fe.TextTransparency + 0.1
end
end
local TARG1, TARG2, TARG3, TARG4, TARG5, TARG6 = nil, nil, nil, nil, nil, nil
local IdleAndWalk = false
turnonwelds()
opend = true
local wpb = true
local num = 1
mouse.Button1Down:connect(function()
if current == true and idleq == false and opend == true and wpb == true and stun.Value == false and bl.Value == false and healingmode == false then
local fs = nil
do
if num == 1 then
attack = true
wpb = false
current = false
fr = true
p26.Touched:connect(function(hit)
if not fr then
return
end
if hit.Parent:FindFirstChild("Defense") then
fs = math.floor(math.random(4, 8) * atk.Value / hit.Parent:FindFirstChild("Defense").Value)
else
fs = math.floor(math.random(4, 8) * atk.Value)
end
if hit.Parent.Name ~= player.Name and hit.Parent:FindFirstChild("Humanoid") and fr == true then
fr = false
if hit.Parent:FindFirstChild("Blocking") then
if hit.Parent:FindFirstChild("Blocking").Value == true then
hit.Parent.PauseBlock.Value = true
wait()
wait()
hit.Parent.BlockingLeft.Value = 5
wait()
wait()
hit.Parent.PauseBlock.Value = false
hit.Parent.BlockingLabel.Value = true
stun.Value = true
else
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - fs
DGU(hit, fs)
fr = false
end
else
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - fs
DGU(hit, fs)
fr = false
end
end
end
)
s4:Play()
local tar = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-100))
wait(0.1)
TARG1 = PA1[5]
TARG2 = PA1[6]
TARG3 = PA1[4]
TARG4 = PA1[3]
TARG5 = PA1[2]
TARG6 = PA1[1]
STARG = tar
wait(0.1)
TARG1 = PA1[5]
TARG2 = PA1[6]
TARG3 = PA1[4]
TARG4 = PA1[3]
TARG5 = PA1[2]
TARG6 = PA1[1]
STARG = tar
wait(0.1)
TARG1 = PA1[5]
TARG2 = PA1[6]
TARG3 = PA1[4]
TARG4 = PA1[3]
TARG5 = PA1[2]
TARG6 = PA1[1]
STARG = tar
wait(0.1)
TARG1 = PA1[5]
TARG2 = PA1[6]
TARG3 = PA1[4]
TARG4 = PA1[3]
TARG5 = PA1[2]
TARG6 = PA1[1]
STARG = tar
wait(0.2)
current = true
fr = false
wait(0.1)
wpb = true
num = num + 1
attack = false
return
end
do
if num == 2 then
attack = true
wpb = false
current = false
fr = true
p26.Touched:connect(function(hit)
if not fr then
return
end
if hit.Parent:FindFirstChild("Defense") then
fs = math.floor(math.random(4, 8) * atk.Value / hit.Parent:FindFirstChild("Defense").Value)
else
fs = math.floor(math.random(4, 8) * atk.Value)
end
if hit.Parent.Name ~= player.Name and hit.Parent:FindFirstChild("Humanoid") and fr == true then
fr = false
if hit.Parent:FindFirstChild("Blocking") then
if hit.Parent:FindFirstChild("Blocking").Value == true then
hit.Parent.PauseBlock.Value = true
wait()
hit.Parent.BlockingLeft.Value = 5
wait()
hit.Parent.PauseBlock.Value = true
hit.Parent.BlockingLabel.Value = true
stun.Value = true
else
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - fs
DGU(hit, fs)
fr = false
end
else
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - fs
DGU(hit, fs)
fr = false
end
end
end
)
s5:Play()
wait(0.1)
local tar = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(60), math.rad(0), math.rad(160))
local tar2 = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(60), math.rad(0), math.rad(160))
TARG1 = PA2[6]
TARG2 = PA2[5]
TARG3 = PA2[4]
TARG4 = PA2[3]
TARG5 = PA2[2]
TARG6 = PA2[1]
STARG = tar
wait(0.02)
TARG1 = PA2[6]
TARG2 = PA2[5]
TARG3 = PA2[4]
TARG4 = PA2[3]
TARG5 = PA2[2]
TARG6 = PA2[1]
STARG = tar
wait(0.02)
TARG1 = PA2[6]
TARG2 = PA2[5]
TARG3 = PA2[4]
TARG4 = PA2[3]
TARG5 = PA2[2]
TARG6 = PA2[1]
wait(0.02)
STARG = tar
TARG1 = PA2[6]
TARG2 = PA2[5]
TARG3 = PA2[4]
TARG4 = PA2[3]
TARG5 = PA2[2]
TARG6 = PA2[1]
STARG = tar
wait(0.02)
TARG1 = PA21[6]
TARG2 = PA21[5]
TARG3 = PA21[4]
TARG4 = PA21[3]
TARG5 = PA21[2]
TARG6 = PA21[1]
STARG = tar2
wait(0.02)
TARG1 = PA21[6]
TARG2 = PA21[5]
TARG3 = PA21[4]
TARG4 = PA21[3]
TARG5 = PA21[2]
TARG6 = PA21[1]
STARG = tar2
wait(0.02)
TARG1 = PA21[6]
TARG2 = PA21[5]
TARG3 = PA21[4]
TARG4 = PA21[3]
TARG5 = PA21[2]
TARG6 = PA21[1]
STARG = tar2
wait(0.02)
TARG1 = PA21[6]
TARG2 = PA21[5]
TARG3 = PA21[4]
TARG4 = PA21[3]
TARG5 = PA21[2]
TARG6 = PA21[1]
STARG = tar2
wait(0.2)
current = true
fr = false
wait(0.1)
wpb = true
num = num + 1
attack = false
return
end
do
if num == 3 then
attack = true
do
wpb = false
current = false
fr = true
char["Left Leg"].Touched:connect(function(hit)
if not fr then
return
end
if hit.Parent:FindFirstChild("Defense") then
fs = math.floor(math.random(4, 8) * atk.Value / hit.Parent:FindFirstChild("Defense").Value)
else
fs = math.floor(math.random(4, 8) * atk.Value)
end
if hit.Parent.Name ~= player.Name and hit.Parent:FindFirstChild("Humanoid") and fr == true then
fr = false
if hit.Parent:FindFirstChild("Blocking") then
if hit.Parent:FindFirstChild("Blocking").Value == true then
hit.Parent.PauseBlock.Value = true
wait()
hit.Parent.BlockingLeft.Value = 5
wait()
hit.Parent.PauseBlock.Value = true
hit.Parent.BlockingLabel.Value = true
stun.Value = true
else
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - fs
DGU(hit, fs)
fr = false
end
else
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - fs
DGU(hit, fs)
fr = false
end
end
end
)
s1.Pitch = 0.8
s1:Play()
wait(0.1)
TARG1 = PA3[4]
TARG2 = PA3[3]
TARG3 = PA3[2]
TARG4 = PA3[6]
TARG5 = PA3[5]
TARG6 = PA3[1]
wait(0.1)
TARG1 = PA3[4]
TARG2 = PA3[3]
TARG3 = PA3[2]
TARG4 = PA3[6]
TARG5 = PA3[5]
TARG6 = PA3[1]
wait(0.1)
TARG1 = PA3[4]
TARG2 = PA3[3]
TARG3 = PA3[2]
TARG4 = PA3[6]
TARG5 = PA3[5]
TARG6 = PA3[1]
wait(0.1)
TARG1 = PA3[4]
TARG2 = PA3[3]
TARG3 = PA3[2]
TARG4 = PA3[6]
TARG5 = PA3[5]
TARG6 = PA3[1]
wait(0.2)
current = true
fr = false
wait(0.1)
wpb = true
num = 1
attack = false
do return end
-- DECOMPILER ERROR at PC545: LeaveBlock: unexpected jumping out IF_THEN_STMT
-- DECOMPILER ERROR at PC545: LeaveBlock: unexpected jumping out IF_STMT
end
end
end
end
end
end
end
)
local rtb = true
local orb = nil
healplrs = function()
local plrs = {}
local healpoints = math.floor(math.random(3, 5))
local num = 0
local getsnearme = function(studs)
local list = game.Workspace:GetChildren()
local targs = {}
for i = 1, #list do
local target = list[i]
if target.ClassName == "Model" and target.Name ~= player.Name and target:FindFirstChild("Humanoid") and target:FindFirstChild("Torso") and (target.Torso.Position - char.Torso.Position).magnitude < studs then
table.insert(targs, target)
end
end
return targs
end
makeorb = true
dgm = healpoints
dg = nil
wait(0.1)
local hum = char:FindFirstChild("Humanoid")
hum.Health = hum.Health + healpoints
def.Value = def.Value + 0.03
dgm = healpoints
dg = char.Head
wait()
local f = getsnearme(30)
if f ~= nil then
for i,v in pairs(f) do
if v:FindFirstChild("Attack") then
wait(0.1)
local hum = v:FindFirstChild("Humanoid")
hum.Health = hum.Health + healpoints
v:FindFirstChild("Defense").Value = v:FindFirstChild("Defense").Value + 0.03
dgm = healpoints
dg = v.Head
else
do
wait(0.1)
do
local hum = v:FindFirstChild("Humanoid")
hum.Health = hum.Health + healpoints
dgm = healpoints
dg = v.Head
-- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out DO_STMT
-- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out IF_ELSE_STMT
-- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out IF_STMT
end
end
end
end
end
end
game:GetService("RunService").RenderStepped:connect(function()
if healingmode == true and ht.Value > 0.9 then
ht.Value = ht.Value - 0.02
end
if ht.Value < 1.1 and healingmode == true then
ht.Value = 5
healplrs()
end
end
)
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "e" and rtb == true and stun.Value == false then
if healingmode == false then
attack = true
skl = true
healingmode = true
char.Humanoid.WalkSpeed = 0
wait(0.05)
SWELD.Part0 = char.Torso
local cf = CFrame.new(0, 0, -3) * CFrame.Angles(math.rad(180), 0, 0)
TARG1 = med[6]
TARG2 = med[5]
TARG3 = med[4]
TARG4 = med[3]
TARG5 = med[2]
TARG6 = med[1]
STARG = cf
wait(0.05)
TARG1 = med[6]
TARG2 = med[5]
TARG3 = med[4]
TARG4 = med[3]
TARG5 = med[2]
TARG6 = med[1]
STARG = cf
wait(0.05)
TARG1 = med[6]
TARG2 = med[5]
TARG3 = med[4]
TARG4 = med[3]
TARG5 = med[2]
TARG6 = med[1]
STARG = cf
wait(0.05)
TARG1 = med[6]
TARG2 = med[5]
TARG3 = med[4]
TARG4 = med[3]
TARG5 = med[2]
TARG6 = med[1]
STARG = cf
local r = Instance.new("Part", char)
r.Transparency = 1
r.CanCollide = false
r.Name = "Circle"
r.CFrame = char.Torso.CFrame * CFrame.new(0, -1.7, 0)
r.Size = Vector3.new(50, 1, 50)
r.Anchored = true
local c = Instance.new("Decal", r)
c.Face = "Top"
c.Texture = "http://www.roblox.com/asset/?id=332014171"
orb = r
wait()
r.CFrame = char.Torso.CFrame * CFrame.new(0, -1.7, 0)
return
else
do
SWELD.Part0 = char["Right Arm"]
healingmode = false
skl = false
attack = false
if orb ~= nil then
orb:Destroy()
end
do return end
end
end
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if healingmode == false and orb ~= nil then
orb:Destroy()
if char:FindFirstChild("Circle") then
char:FindFirstChild("Circle"):Destroy()
end
end
end
)
local pos = 0
game:GetService("RunService").RenderStepped:connect(function()
if healingmode == true and orb ~= nil then
orb.CFrame = char.Torso.CFrame * CFrame.new(0, -1.7, 0) * CFrame.fromEulerAnglesXYZ(0, pos, 0)
pos = pos + 0.05
local cf = CFrame.new(0, 0, -3) * CFrame.Angles(math.rad(180), 0, 0)
TARG1 = med[6]
TARG2 = med[5]
TARG3 = med[4]
TARG4 = med[3]
TARG5 = med[2]
TARG6 = med[1]
STARG = cf
end
do
if healingmode == true and stun.Value == true then
orb:Destroy()
if char:FindFirstChild("Circle") then
char:FindFirstChild("Circle"):Destroy()
end
healingmode = false
skl = false
SWELD.Part0 = char["Right Arm"]
end
end
end
)
local pr, sz, ps = nil, nil, nil
local act = false
game:GetService("RunService").RenderStepped:connect(function()
if makeorb == true then
makeorb = false
local l = Instance.new("Part", game.Workspace)
l.BrickColor = BrickColor.new("Forest green")
l.Size = Vector3.new(1, 1, 1)
l.Shape = "Ball"
l.TopSurface = "Smooth"
l.BottomSurface = "Smooth"
l.Material = "Neon"
l.CanCollide = false
l.Anchored = true
l.Transparency = 0
l.CFrame = char.Torso.CFrame
game.Debris:AddItem(l, 2)
sz = Vector3.new(120, 120, 120)
ps = char.Torso.CFrame
pr = l
for i = 0, 20 do
wait()
l.Transparency = l.Transparency + 0.05
end
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if pr ~= nil and pr.Size ~= Vector3.new(40, 40, 40) then
pr.Size = pr.Size:lerp(Vector3.new(40, 40, 40), 0.05)
pr.CFrame = char.Torso.CFrame
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if dg ~= lastdg then
lastdg = dg
if dg ~= nil then
HL(dg, dgm)
end
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if df ~= lastdf then
lastdf = df
if df ~= nil then
DGU(df, dfm)
end
end
end
)
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "z" and current == true and opend == true and stun.Value == false and energy > 19 and S1 == true and healingmode == false then
attack = true
energy = energy - 20
S1T = 0
current = false
wait()
SWELD.Part0 = char.Torso
local cf = CFrame.new(0, 0, -2) * CFrame.Angles(math.rad(180), 0, 0)
SWELD.Part0 = char.Torso
makeorb = true
TARG1 = heal[4]
TARG2 = heal[3]
TARG3 = heal[2]
TARG4 = heal[6]
TARG5 = heal[5]
TARG6 = heal[1]
STARG = cf
wait(0.05)
TARG1 = heal[4]
TARG2 = heal[3]
TARG3 = heal[2]
TARG4 = heal[6]
TARG5 = heal[5]
TARG6 = heal[1]
STARG = cf
wait(0.05)
TARG1 = heal[4]
TARG2 = heal[3]
TARG3 = heal[2]
TARG4 = heal[6]
TARG5 = heal[5]
TARG6 = heal[1]
STARG = cf
wait(0.05)
TARG1 = heal[4]
TARG2 = heal[3]
TARG3 = heal[2]
TARG4 = heal[6]
TARG5 = heal[5]
TARG6 = heal[1]
STARG = cf
local plrs = {}
local healpoints = math.floor(math.random(10, 14))
local num = 0
local getsnearme = function(studs)
local list = game.Workspace:GetChildren()
local targs = {}
for i = 1, #list do
local target = list[i]
if target.ClassName == "Model" and target.Name ~= player.Name and target:FindFirstChild("Humanoid") and target:FindFirstChild("Torso") and (target.Torso.Position - char.Torso.Position).magnitude < studs then
table.insert(targs, target)
end
end
return targs
end
local f = getsnearme(30)
dgm = healpoints
dg = nil
wait(0.1)
local hum = char:FindFirstChild("Humanoid")
hum.Health = hum.Health + healpoints
def.Value = def.Value + 0.05
dgm = healpoints
dg = char.Head
wait()
for i,v in pairs(f) do
if v:FindFirstChild("Defense") then
wait(0.1)
local hum = v:FindFirstChild("Humanoid")
hum.Health = hum.Health + healpoints
v:FindFirstChild("Defense").Value = v:FindFirstChild("Defense").Value + 0.05
dgm = healpoints
dg = v.Head
else
do
wait(0.1)
do
local hum = v:FindFirstChild("Humanoid")
hum.Health = hum.Health + healpoints
dgm = healpoints
dg = v.Head
-- DECOMPILER ERROR at PC225: LeaveBlock: unexpected jumping out DO_STMT
-- DECOMPILER ERROR at PC225: LeaveBlock: unexpected jumping out IF_ELSE_STMT
-- DECOMPILER ERROR at PC225: LeaveBlock: unexpected jumping out IF_STMT
end
end
end
end
wait(0.5)
SWELD.Part0 = char["Right Arm"]
current = true
end
end
)
local r2d = false
local rb = nil
local r = false
attack = false
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "x" then
if r2d == true then
rb = char.B1.CFrame
r = true
char:FindFirstChild("B1"):Destroy()
char:FindFirstChild("B2"):Destroy()
f2l.Text = "[X] Cleanse"
r2d = false
end
if current == true and opend == true and stun.Value == false and energy > 24 and S2 == true and healingmode == false and r2d == false then
attack = true
energy = energy - 25
S2T = 0
current = false
TARG1 = SK2[6]
TARG2 = SK2[5]
TARG3 = SK2[4]
TARG4 = SK2[3]
TARG5 = SK2[2]
TARG6 = SK2[1]
local cf = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(180), math.rad(-90), 0)
STARG = cf
wait(0.05)
TARG1 = SK2[6]
TARG2 = SK2[5]
TARG3 = SK2[4]
TARG4 = SK2[3]
TARG5 = SK2[2]
TARG6 = SK2[1]
STARG = cf
wait(0.05)
TARG1 = SK2[6]
TARG2 = SK2[5]
TARG3 = SK2[4]
TARG4 = SK2[3]
TARG5 = SK2[2]
TARG6 = SK2[1]
STARG = cf
wait(0.05)
TARG1 = SK2[6]
TARG2 = SK2[5]
TARG3 = SK2[4]
TARG4 = SK2[3]
TARG5 = SK2[2]
TARG6 = SK2[1]
STARG = cf
local d1 = Instance.new("Part", char)
d1.BrickColor = BrickColor.new("Lime green")
d1.Shape = "Ball"
d1.Size = Vector3.new(5.95, 5.95, 5.95)
d1.CanCollide = false
d1.Transparency = 0.6
d1.Position = p18.CFrame.p + Vector3.new(0, 0, 0)
d1.TopSurface = "Smooth"
d1.BottomSurface = "Smooth"
d1.Material = "Neon"
d1.Name = "B1"
local v = Instance.new("BodyVelocity", d1)
v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
v.velocity = char.HumanoidRootPart.CFrame.lookVector * 80
local d2 = Instance.new("Part", char)
d2.BrickColor = BrickColor.new("Lime green")
d2.Shape = "Ball"
d2.Size = Vector3.new(8.12, 8.12, 8.12)
d2.CanCollide = false
d2.Position = d1.CFrame.p
d2.TopSurface = "Smooth"
d2.BottomSurface = "Smooth"
d2.Material = "Neon"
d2.Name = "B2"
d2.Transparency = 0.8
game.Debris:AddItem(d1, 5)
game.Debris:AddItem(d2, 5)
local w = Instance.new("Weld", d1)
w.Part0 = d1
w.Part1 = d2
r2d = true
f2l.Text = "[X] Detonate"
wait()
d1.CFrame = p18.CFrame
wait(0.5)
current = true
wait(4.4)
r2d = false
f2l.Text = "[X] Cleanse"
end
end
attack = false
end
)
ma = function()
local f = Instance.new("Part", char)
game.Debris:AddItem(f, 1.1)
f.TopSurface = "Smooth"
f.BottomSurface = "Smooth"
f.BrickColor = BrickColor.new("Lime green")
f.Size = Vector3.new(2, 2.4, 2)
f.CanCollide = false
f.Anchored = true
local fm = Instance.new("SpecialMesh", f)
fm.MeshId = "http://www.roblox.com/asset/?id=20329976"
fm.Scale = Vector3.new(6, 1, 6)
f.CFrame = CFrame.new(char.B1.CFrame.X, char.B1.CFrame.Y + -3, char.B1.CFrame.Z)
for i = 0, 10 do
wait()
f.Transparency = f.Transparency + 0.1
end
end
game:GetService("RunService").RenderStepped:connect(function()
if r2d == true and mc.Value > 0.9 then
mc.Value = mc.Value - 0.15
end
if mc.Value < 1.1 and r2d == true then
mc.Value = 2
ma()
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if r == true then
r = false
local l = Instance.new("Part", game.Workspace)
do
l.BrickColor = BrickColor.new("Forest green")
l.Size = Vector3.new(1, 1, 1)
l.Shape = "Ball"
l.TopSurface = "Smooth"
l.BottomSurface = "Smooth"
l.Material = "Neon"
l.CanCollide = false
l.Anchored = true
l.Transparency = 0
l.CFrame = rb
local dmg = true
local getsnearme = function(studs)
local list = game.Workspace:GetChildren()
local targs = {}
for i = 1, #list do
local target = list[i]
if target.ClassName == "Model" and target.Name ~= player.Name and target:FindFirstChild("Humanoid") and target:FindFirstChild("Torso") and (target.Torso.Position - l.Position).magnitude < studs and target ~= nil then
table.insert(targs, target)
end
end
return targs
end
local f = getsnearme(20)
for i,v in pairs(f) do
wait(0.1)
if v:FindFirstChild("Attack") then
if v:FindFirstChild("Blocking").Value == true then
v.BlockingLabel.Value = true
else
v:FindFirstChild("Attack").Value = v:FindFirstChild("Attack").Value - 0.1
v:FindFirstChild("Attack").Value = v:FindFirstChild("Attack").Value - 0.1
local dtd = math.floor(math.random(12, 14) * atk.Value / v:FindFirstChild("Defense").Value)
v:FindFirstChild("Humanoid").Health = v:FindFirstChild("Humanoid").Health - dtd
dfm = 5
df = nil
wait()
dfm = dtd
df = v:FindFirstChild("Head")
end
else
do
do
local dtd = math.floor(math.random(12, 14) * atk.Value)
v:FindFirstChild("Humanoid").Health = v:FindFirstChild("Humanoid").Health - dtd
dfm = 5
df = nil
wait()
dfm = dtd
df = v:FindFirstChild("Head")
-- DECOMPILER ERROR at PC145: LeaveBlock: unexpected jumping out DO_STMT
-- DECOMPILER ERROR at PC145: LeaveBlock: unexpected jumping out IF_ELSE_STMT
-- DECOMPILER ERROR at PC145: LeaveBlock: unexpected jumping out IF_STMT
end
end
end
end
game.Debris:AddItem(l, 2)
sz = Vector3.new(120, 120, 120)
pl = l
for i = 0, 20 do
wait()
l.Transparency = l.Transparency + 0.05
end
end
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if pl ~= nil and pl.Size ~= Vector3.new(40, 40, 40) then
pl.Size = pl.Size:lerp(Vector3.new(40, 40, 40), 0.05)
pl.CFrame = rb
end
end
)
makepart = function(transparency, collide, color, size, cf, material, shape, debris, anchored)
local p = Instance.new("Part", game.Workspace)
if transparency ~= nil then
p.Transparency = transparency
end
p.Anchored = true
if collide ~= nil then
p.CanCollide = collide
if color ~= nil then
p.BrickColor = BrickColor.new(color)
end
if size ~= nil then
p.Size = size
end
if cf ~= nil then
p.CFrame = cf
end
if material ~= nil then
p.Material = material
end
if shape ~= nil then
p.Shape = shape
end
if debris ~= nil then
game.Debris:AddItem(p, debris)
end
p.TopSurface = "SmoothNoOutlines"
p.BottomSurface = "SmoothNoOutlines"
p.LeftSurface = "SmoothNoOutlines"
p.RightSurface = "SmoothNoOutlines"
p.FrontSurface = "SmoothNoOutlines"
p.BackSurface = "SmoothNoOutlines"
return p
end
end
meshsomething = function(part, meshid, textureid, scale, mt)
local msh = nil
if mt ~= nil then
msh = Instance.new(mt, part)
else
msh = Instance.new("SpecialMesh", part)
end
if meshid ~= nil then
msh.MeshId = meshid
end
if textureid ~= nil then
msh.TextureId = textureid
end
if scale ~= nil then
msh.Scale = scale
end
return msh
end
local spk, spkcf, spkm = nil, nil, nil
local cf = Instance.new("CFrameValue", char)
game:GetService("RunService").RenderStepped:connect(function()
if spk ~= nil and spkcf ~= nil and spkm ~= nil then
spk.Size = spk.Size:lerp(Vector3.new(8.02, 15, 9.39), 0.05)
spk.CFrame = cf
spkm.Scale = spkm.Scale:lerp(Vector3.new(10, 10, 10), 0.05)
end
end
)
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "c" and current == true and opend == true and stun.Value == false and energy > 34 and S3 == true and healingmode == false then
attack = true
energy = energy - 26
S3T = 0
local dmg = true
do
current = false
skl = true
char.Humanoid.WalkSpeed = 0
TARG1 = SK3[6]
TARG2 = SK3[5]
TARG3 = SK3[4]
TARG4 = SK3[3]
TARG5 = SK3[2]
TARG6 = SK3[1]
wait(0.05)
TARG1 = SK3[6]
TARG2 = SK3[5]
TARG3 = SK3[4]
TARG4 = SK3[3]
TARG5 = SK3[2]
TARG6 = SK3[1]
wait(0.05)
TARG1 = SK3[6]
TARG2 = SK3[5]
TARG3 = SK3[4]
TARG4 = SK3[3]
TARG5 = SK3[2]
TARG6 = SK3[1]
wait(0.05)
TARG1 = SK3[6]
TARG2 = SK3[5]
TARG3 = SK3[4]
TARG4 = SK3[3]
TARG5 = SK3[2]
TARG6 = SK3[1]
wait(0.05)
local p1 = makepart(0, false, "Lime green", Vector3.new(2, 2.4, 2), char.HumanoidRootPart.CFrame * CFrame.new(0, -2.7, -8), "Plastic", nil, 4, true)
local m1 = meshsomething(p1, "http://www.roblox.com/asset/?id=20329976", nil, Vector3.new(8, 1, 8))
local p2 = makepart(0, false, "Lime green", Vector3.new(10.81, 1.2, 10.4), char.HumanoidRootPart.CFrame * CFrame.new(0, -3, -7.5), "Neon", nil, 4, true)
local m2 = meshsomething(p2, nil, nil, Vector3.new(1, 1, 1), "CylinderMesh")
local p3 = makepart(0, false, "Lime green", Vector3.new(8.02, 0.2, 9.39), char.HumanoidRootPart.CFrame * CFrame.new(0, -3, -7.5), "Neon", nil, 4, true)
local m3 = meshsomething(p3, "http://www.roblox.com/asset/?id=1323306", nil, Vector3.new(10, 0, 10))
spkm = m3
spkcf = p3.CFrame
spk = p3
cf = char.HumanoidRootPart.CFrame * CFrame.new(0, -3, -7.5)
local getsnearme = function(studs)
local list = game.Workspace:GetChildren()
local targs = {}
for i = 1, #list do
local target = list[i]
if target.ClassName == "Model" and target.Name ~= player.Name and target:FindFirstChild("Humanoid") and target:FindFirstChild("Torso") and (target.Torso.Position - p1.Position).magnitude < studs and target ~= nil then
table.insert(targs, target)
end
end
return targs
end
local f = getsnearme(7)
for i,v in pairs(f) do
wait(0.1)
if v:FindFirstChild("Attack") then
if v:FindFirstChild("Blocking").Value == true then
v.BlockingLabel.Value = true
else
v:FindFirstChild("Attack").Value = v:FindFirstChild("Attack").Value - 0.1
v:FindFirstChild("Attack").Value = v:FindFirstChild("Attack").Value - 0.2
local dtd = math.floor(math.random(15, 19) * atk.Value / v:FindFirstChild("Defense").Value)
v:FindFirstChild("Humanoid").Health = v:FindFirstChild("Humanoid").Health - dtd
dfm = 5
df = nil
wait()
dfm = dtd
df = v:FindFirstChild("Head")
end
else
do
do
local dtd = math.floor(math.random(15, 17) * atk.Value)
v:FindFirstChild("Humanoid").Health = v:FindFirstChild("Humanoid").Health - dtd
dfm = 5
df = nil
wait()
dfm = dtd
df = v:FindFirstChild("Head")
-- DECOMPILER ERROR at PC356: LeaveBlock: unexpected jumping out DO_STMT
-- DECOMPILER ERROR at PC356: LeaveBlock: unexpected jumping out IF_ELSE_STMT
-- DECOMPILER ERROR at PC356: LeaveBlock: unexpected jumping out IF_STMT
end
end
end
end
wait(0.2)
current = true
skl = false
for i = 0, 20 do
wait()
p1.Transparency = p1.Transparency + 0.05
p2.Transparency = p2.Transparency + 0.05
end
wait(0.1)
for i = 0, 10 do
wait()
p3.Transparency = p3.Transparency + 0.1
end
wait(0.5)
dmg = false
end
end
end
)
local ttl, cfr, ttl2, cfr2 = nil, nil, nil, nil
game:GetService("RunService").RenderStepped:connect(function()
if ttl ~= nil then
ttl.CFrame = ttl.CFrame:lerp(cfr, 0.2)
end
end
)
game:GetService("RunService").RenderStepped:connect(function()
if ttl2 ~= nil then
ttl2.CFrame = ttl2.CFrame:lerp(cfr2, 0.005)
end
attack = false
end
)
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "v" and current == true and opend == true and stun.Value == false and energy > 49 and S4 == true and healingmode == false then
attack = true
current = false
skl = true
wait(0.05)
local dmg = nil
do
S4T = 0
energy = energy - 59
wait()
char.Humanoid.WalkSpeed = 0
TARG1 = SK4[6]
TARG2 = SK4[5]
TARG3 = SK4[4]
TARG4 = SK4[3]
TARG5 = SK4[2]
TARG6 = SK4[1]
wait(0.05)
TARG1 = SK4[6]
TARG2 = SK4[5]
TARG3 = SK4[4]
TARG4 = SK4[3]
TARG5 = SK4[2]
TARG6 = SK4[1]
wait(0.05)
TARG1 = SK4[6]
TARG2 = SK4[5]
TARG3 = SK4[4]
TARG4 = SK4[3]
TARG5 = SK4[2]
TARG6 = SK4[1]
wait(0.05)
TARG1 = SK4[6]
TARG2 = SK4[5]
TARG3 = SK4[4]
TARG4 = SK4[3]
TARG5 = SK4[2]
TARG6 = SK4[1]
local p2 = makepart(0, false, "Lime green", Vector3.new(16.48, 0.2, 2.85), char.HumanoidRootPart.CFrame * CFrame.new(0, -3, -3), "Neon", nil, 4, true)
local p3 = makepart(0, false, "Lime green", Vector3.new(2, 2.4, 2), char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -3), "Neon", nil, 4, true)
local m3 = meshsomething(p3, "http://www.roblox.com/asset/?id=20329976", nil, Vector3.new(10, 10, 2))
dmg = true
local p1 = makepart(0, false, "Lime green", Vector3.new(15.68, 11.17, 2), char.HumanoidRootPart.CFrame * CFrame.new(0, -15, -3), "Neon", nil, 3, false)
ttl = p1
cfr = p1.CFrame * CFrame.new(0, 18.5, 0)
p1.Parent = game.Workspace
p1.Transparency = 0.5
dmg = true
p1.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= player.Name and dmg == true then
if hit.Parent:FindFirstChild("Attack") then
if hit.Parent:FindFirstChild("Blocking").Value == true then
hit.Parent.BlockingLabel.Value = true
else
hit.Parent.Stunned.Value = true
local dtd = math.floor(math.random(15, 24) * atk.Value * hit.Parent.Defense.Value)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - dtd
p1:Destroy()
DGU(hit.Parent.Head, dtd)
end
else
do
local dtd = math.floor(math.random(15, 24) * atk.Value)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - dtd
p1:Destroy()
DGU(hit.Parent.Head, dtd)
end
end
end
end
)
wait(0.4)
current = true
skl = false
ttl = nil
ttl2 = p1
cfr2 = p1.CFrame * CFrame.new(0, 0, -400)
dmg = true
wait(0.1)
dmg = true
p1.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= player.Name and dmg == true then
if hit.Parent:FindFirstChild("Attack") then
if hit.Parent:FindFirstChild("Blocking").Value == true then
hit.Parent.BlockingLabel.Value = true
else
hit.Parent.Stunned.Value = true
local dtd = math.floor(math.random(15, 24) * atk.Value / hit.Parent.Defense.Value)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - dtd
p1:Destroy()
DGU(hit.Parent.Head, dtd)
end
else
do
local dtd = math.floor(math.random(15, 24) * atk.Value)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - dtd
p1:Destroy()
DGU(hit.Parent.Head, dtd)
end
end
end
end
)
for i = 0, 20 do
wait()
p2.Transparency = p2.Transparency + 0.05
p3.Transparency = p3.Transparency + 0.05
end
end
end
attack = false
end
)
local Speed = 0.4
local lspeed = 0.2
game:GetService("RunService").RenderStepped:connect(function()
if Vector3.new(char.Torso.Velocity.X, 0, char.Torso.Velocity.Z).magnitude > 2 then
IdleAndWalk = true
else
IdleAndWalk = false
end
if TARG4 ~= nil then
rl.C0 = rl.C0:lerp(TARG4, lspeed)
end
if TARG5 ~= nil then
ll.C0 = ll.C0:lerp(TARG5, lspeed)
end
if TARG3 ~= nil then
nc.C0 = nc.C0:lerp(TARG3, lspeed)
end
if TARG1 ~= nil then
w3.C0 = w3.C0:lerp(TARG1, Speed)
end
if TARG2 ~= nil then
w4.C0 = w4.C0:lerp(TARG2, Speed)
end
if TARG6 ~= nil then
ts.C0 = ts.C0:lerp(TARG6, Speed)
end
if STARG ~= nil then
SWELD.C0 = SWELD.C0:lerp(STARG, Speed)
end
if TARG7 ~= nil and obj ~= nil then
obj.Scale = obj.Scale:lerp(TARG7, 0.05)
end
if TARG8 ~= nil and obj2 ~= nil then
obj2.Size = obj2.Size:lerp(TARG8, 0.4)
obj2.CFrame = char.Torso.CFrame * CFrame.new(0, -2.5, 0)
end
if TARG10 ~= nil and obj3 ~= nil and TARG11 ~= nil then
obj3.Size = obj3.Size:lerp(TARG10, 0.05)
obj3.CFrame = char.Torso.CFrame * CFrame.new(0, -2.5, 0) * TARG11
end
if TARG10 ~= nil and obj3 ~= nil and obj3.Transparency ~= 1 then
obj2.Transparency = obj2.Transparency + 0.05
obj3.Transparency = obj3.Transparency + 0.05
wait(0.1)
end
if char.Humanoid.Jump == true then
gd.Value = true
else
gd.Value = false
end
if energy < 100 and current == true then
energy = energy + 0.05
end
for i = 1, #parts do
local Part = parts[i]
Part.Size = Part.Size:lerp(Vector3.new(6, 32, 7), 0.05)
for x = 1, #poses do
Part.CFrame = poses[i]
end
end
if blt.Value < 99 and bl.Value == false and stun.Value == false then
blt.Value = blt.Value + 0.03
end
if bl.Value == true and blt.Value < 5 then
bl.Value = false
current = true
skl = false
end
if posd.Value == true and pt.Value > 0 then
pt.Value = pt.Value - 0.02
char.Humanoid.Health = char.Humanoid.Health - 0.11
end
if pt.Value < 1 then
posd.Value = false
end
if bl.Value == true then
blt.Value = blt.Value - 0.5
end
if atkt.Value > 0 then
atkt.Value = atkt.Value - 0.02
else
atk.Value = 1
end
if deft.Value > 0 then
deft.Value = deft.Value - 0.02
else
def.Value = 1.1
end
if spdt.Value > 0 then
spdt.Value = spdt.Value - 0.02
else
wait()
if spdt.Value < 1 then
spd.Value = 1
end
end
local DV2 = S1T / S1TF
local initX6 = f1.Size.X.Scale
f1f:TweenSize(UDim2.new(initX6 * DV2 * 1.665, 0, 1, 0), "In", "Linear", 1)
if S1T < 14 then
S1T = S1T + 0.04
S1 = false
else
S1 = true
end
if S1T == 14 then
S1 = true
end
local DV2 = S2T / S2TF
local initX6 = f2.Size.X.Scale
f2f:TweenSize(UDim2.new(initX6 * DV2 * 3.566, 0, 1, 0), "In", "Linear", 1)
if S2T < 14 then
S2T = S2T + 0.01
S2 = false
else
S2 = true
end
if S2T == 15 then
S2 = true
end
local DV2 = S3T / S3TF
local initX6 = f3.Size.X.Scale
f3f:TweenSize(UDim2.new(initX6 * DV2 * 2.855, 0, 1, 0), "In", "Linear", 1)
if S3T < 14 then
S3T = S3T + 0.01
S3 = false
else
S3 = true
end
if S3T == 15 then
S3 = true
end
local DV2 = S4T / S4TF
local initX6 = f4.Size.X.Scale
f4f:TweenSize(UDim2.new(initX6 * DV2 * 3.45, 0, 1, 0), "In", "Linear", 1)
if S4T < 29 then
S4T = S4T + 0.01
S4 = false
else
S4 = true
end
if S4T == 30 then
S4 = true
end
end
)
satk = atk.Value
sdef = def.Value
sspd = spd.Value
atk.Changed:connect(function()
if atk.Value < satk then
atkt.Value = atkt.Value + 4
makeui(Color3.new(255, 0, 0), "-Damage")
satk = atk.Value
else
atkt.Value = atkt.Value + 4
makeui(Color3.new(255, 0, 0), "+Damage")
satk = atk.Value
end
end
)
posd.Changed:connect(function()
if posd.Value == false then
makeui(Color3.new(255, 0, 0), "-Poison")
else
makeui(Color3.new(255, 0, 0), "+Poison")
end
end
)
def.Changed:connect(function()
if def.Value < sdef then
deft.Value = deft.Value + 4
makeui(Color3.new(0, 0, 255), "-Defense")
sdef = def.Value
else
deft.Value = deft.Value + 4
makeui(Color3.new(0, 0, 255), "+Defense")
sdef = def.Value
end
end
)
spd.Changed:connect(function()
if spd.Value < sspd then
spdt.Value = spdt.Value + 4
makeui(Color3.new(0, 255, 0), "-Speed")
sspd = spd.Value
else
spdt.Value = spdt.Value + 4
makeui(Color3.new(0, 255, 0), "+Speed")
sspd = spd.Value
end
end
)
bll.Changed:connect(function()
if bll.Value == true then
local c = Instance.new("Part", game.Workspace)
c.Anchored = true
c.CanCollide = false
c.BrickColor = BrickColor.new("Medium stone grey")
c.Shape = "Ball"
c.Size = Vector3.new(1, 1, 1)
c.CFrame = char.Torso.CFrame
c.TopSurface = "Smooth"
c.BottomSurface = "Smooth"
c.Transparency = 0.1
local v = Instance.new("Part", game.Workspace)
v.Anchored = true
v.CanCollide = false
v.BrickColor = BrickColor.new("Medium stone grey")
v.Size = Vector3.new(1, 1, 1)
v.CFrame = char.Torso.CFrame
v.TopSurface = "Smooth"
v.BottomSurface = "Smooth"
v.Transparency = 0.1
obj2 = c
TARG8 = Vector3.new(30, 30, 30)
obj3 = v
TARG10 = Vector3.new(15, 21, 15)
TARG11 = CFrame.new(0, 0, 0)
makeui(BrickColor.new("Bright bluish green").Color, "Blocked!")
bll.Value = false
end
end
)
stun.Changed:connect(function()
if stun.Value == true then
makeui(Color3.new(255, 255, 0), "+Stunned")
wait(2)
if opend == true then
stun.Value = false
end
end
if stun.Value == false then
makeui(Color3.new(255, 255, 0), "-Stunned")
end
end
)
RootPart = char.HumanoidRootPart
while true do
wait()
local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
rayCast = function(Pos, Dir, Max, Ignore)
return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
end
hitfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, char)
fa.Text = "Attack : " .. atk.Value
fa2.Text = "Speed : " .. spd.Value
fa3.Text = "Defense : " .. def.Value
local initX5 = f5.Size.X.Scale
local maxhp = char.Humanoid.MaxHealth
local hp = char.Humanoid.Health
local Pie = hp / maxhp
f5f:TweenSize(UDim2.new(initX5 * Pie * 3.33, 0, 1, 0), "In", "Linear", 1)
local DV1 = energy / 100
local initX6 = f6.Size.X.Scale
f6f:TweenSize(UDim2.new(initX6 * DV1 * 3.33, 0, 1, 0), "In", "Linear", 1)
if opend == true then
if current == true then
if idleq == false then
if stun.Value == true then
TARG1 = stunned[3]
TARG2 = stunned[2]
TARG3 = stunned[1]
TARG4 = stunned[5]
TARG5 = stunned[4]
TARG6 = stunned[6]
char.Humanoid.WalkSpeed = 0
end
if stun.Value == true then
char.Humanoid.JumpPower = 0
else
char.Humanoid.JumpPower = 50
end
if stun.Value == false and skl == false then
char.Humanoid.WalkSpeed = 16 * spd.Value
end
if char.Humanoid.Jump == true and stun.Value == false and bl.Value == false and healingmode == false then
TARG1 = jump[3]
TARG2 = jump[2]
TARG3 = jump[1]
TARG4 = jump[5]
TARG5 = jump[4]
TARG6 = CFrame.new(0, 0, 0)
end
local lilwl = ll.C0 * CFrame.new(0, 0, -0.5) * CFrame.Angles(math.rad(30), math.rad(0), math.rad(0))
local lirwl = rl.C0 * CFrame.new(0, 0, 0.5) * CFrame.Angles(math.rad(-30), math.rad(0), math.rad(0))
local lilwr = ll.C0 * CFrame.new(0, 0, 0.5) * CFrame.Angles(math.rad(-30), math.rad(0), math.rad(0))
local lirwr = rl.C0 * CFrame.new(0, 0, -0.5) * CFrame.Angles(math.rad(30), math.rad(0), math.rad(0))
if bl.Value == false then
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and healingmode == false then
TARG1 = walk[8]
TARG2 = walk[7]
TARG3 = walk[6]
TARG4 = walk[4]
TARG5 = walk[3]
TARG6 = walk[5]
STARG = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
TARG1 = walk[8]
TARG2 = walk[7]
TARG3 = walk[6]
TARG4 = walk[2]
TARG5 = walk[1]
TARG6 = walk[5]
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk == true and char.Humanoid.Jump == false and stun.Value == false and bl.Value == false and healingmode == false then
wait(0.05)
end
if IdleAndWalk ~= true or char.Humanoid.Jump ~= false or stun.Value ~= false or bl.Value ~= false or healingmode == false then
wait(0.05)
end
end
end
end
end
end
if IdleAndWalk ~= false or char.Humanoid.Jump ~= false or stun.Value ~= false or bl.Value ~= false or healingmode == false and attack == false and torvel < 1 and hitfloor ~= nil then
TARG1 = idle[5] * CFrame.Angles(0.1 * math.sin(tick()), 0, 0)
TARG2 = idle[6] * CFrame.Angles(0.1 * math.sin(tick()), 0, 0)
TARG3 = idle[2] * CFrame.Angles(0.07 * math.sin(tick()), 0, 0)
TARG4 = idle[4] * CFrame.Angles(0.07 * math.sin(tick()), 0, 0)
TARG5 = idle[3] * CFrame.Angles(0.07 * math.sin(tick()), 0, 0)
TARG6 = idle[1]
STARG = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(-40), math.rad(0), math.rad(-50))
end
end
|
return {'kuch','kuchen','kuchhoest','kucht','kuchte','kuchten','kuchend'}
|
local renderer = {}
local ph_normal = love.graphics.newImage("placeholders/ph_nm.png");
local ph_depth = love.graphics.newImage("placeholders/ph_depth.png");
local ph_specular = love.graphics.newImage("placeholders/ph_spec.png");
local ph_ao = love.graphics.newImage("placeholders/ph_ao.png");
local ph_sv = love.graphics.newImage("placeholders/ph_shadow_volume.png")
local shaded_shader = love.graphics.newShader("shaders/sprite_light.glsl")
function renderer:new(data)
--Not implemented, do not use.
data = data or {}
setmetatable(data, self)
self.__index = self
return data
end
function renderer:draw(x,y,ox,oy)
--Not implemented, do not use
end
flat_renderer = renderer:new()
shaded_renderer = renderer:new()
function flat_renderer:new(data, texture)
texture = texture or {}
data = { texture = texture }
setmetatable(data, self)
self.__index = self
return data
end
function flat_renderer:draw(x,y,ox,oy)
love.graphics.setShader()
love.graphics.draw(self.texture, x, y, 0, 1, 1, ox, oy) --Draw at center
end
-- diffuse, nm, ao, spec
function shaded_renderer:new(data, texture, normal, depth, ao, specular) --Supported texture: Albedo/Diffuse, Depth-infused Normal, Ambient Occlusion, Specular
data = data or {
texture = texture,
nm = normal or ph_normal,
depth = depth or ph_depth,
ao = ao or ph_ao,
spec = specular or ph_specular
}
setmetatable(data, self)
self.__index = self
return data
end
local resX = resX;
local resY = resY;
local scaleUp = scaleUp;
function shaded_renderer:draw(x,y,ox,oy,lights)
love.graphics.setShader(shaded_shader)
shaded_shader:send("res_x", self.texture:getWidth());
shaded_shader:send("res_y", self.texture:getHeight());
shaded_shader:send("offset_x", x - ox);
shaded_shader:send("offset_y", y - oy);
shaded_shader:send("nm",self.nm);
shaded_shader:send("depth",self.depth);
shaded_shader:send("ao",self.ao);
shaded_shader:send("spec",self.spec);
local lightIndex = 0
for i,v in pairs(lights) do
shaded_shader:send("lights[" .. lightIndex .. "].light_pos", {v.x, v.y, v.z})
shaded_shader:send("lights[" .. lightIndex .. "].light_color", {v.r, v.g, v.b})
lightIndex = lightIndex + 1
end
shaded_shader:send("light_count", lightIndex)
love.graphics.draw(self.texture, x, y, 0, 1, 1, ox, oy) --Draw at center
love.graphics.setShader()
end
|
return {
name = 'Alborz',
checkpoints = {
LinearTransform(Vec3(0.711849, -0.008111, 0.702285), Vec3(-0.065571, 0.994798, 0.077954), Vec3(-0.699265, -0.101541, 0.707615), Vec3(25.540485, 545.566772, -271.684540)),
LinearTransform(Vec3(0.975212, -0.193603, -0.107139), Vec3(0.193006, 0.981067, -0.016012), Vec3(0.108211, -0.005063, 0.994115), Vec3(16.508284, 570.404419, -152.482193)),
LinearTransform(Vec3(0.819051, -0.234208, -0.523739), Vec3(0.091521, 0.954528, -0.283724), Vec3(0.566374, 0.184452, 0.803242), Vec3(36.576107, 584.878662, -57.664307)),
LinearTransform(Vec3(-0.211756, 0.083858, -0.973718), Vec3(-0.029485, 0.995310, 0.092130), Vec3(0.976878, 0.048219, -0.208290), Vec3(82.163231, 587.025391, -31.138689)),
LinearTransform(Vec3(-0.217593, -0.105510, -0.970320), Vec3(-0.040547, 0.994259, -0.099021), Vec3(0.975197, 0.017798, -0.220622), Vec3(142.886337, 590.982605, -41.205814)),
LinearTransform(Vec3(0.097999, 0.430628, -0.897193), Vec3(0.462074, 0.778774, 0.424262), Vec3(0.881410, -0.456147, -0.122663), Vec3(267.145538, 558.197510, -62.741791)),
LinearTransform(Vec3(-0.152441, -0.103293, -0.982900), Vec3(-0.294777, 0.954008, -0.054539), Vec3(0.943328, 0.281422, -0.175879), Vec3(432.420135, 534.941284, -48.886799)),
LinearTransform(Vec3(0.450355, 0.143375, -0.881263), Vec3(-0.125818, 0.987364, 0.096340), Vec3(0.883940, 0.067492, 0.462704), Vec3(573.416687, 546.330139, -72.873642)),
LinearTransform(Vec3(0.549427, 0.288730, -0.784069), Vec3(0.073154, 0.918170, 0.389374), Vec3(0.832333, -0.271291, 0.483346), Vec3(697.834351, 524.432739, -7.072163)),
LinearTransform(Vec3(0.912464, 0.117370, 0.391960), Vec3(-0.073099, 0.989324, -0.126074), Vec3(-0.402573, 0.086386, 0.911303), Vec3(749.691406, 489.967224, 137.998077)),
LinearTransform(Vec3(0.748713, 0.015209, 0.662720), Vec3(0.009770, 0.999375, -0.033973), Vec3(-0.662822, 0.031911, 0.748097), Vec3(627.027222, 426.627106, 375.613983)),
LinearTransform(Vec3(0.995485, -0.004735, 0.094798), Vec3(0.002439, 0.999701, 0.024323), Vec3(-0.094884, -0.023982, 0.995199), Vec3(507.740082, 421.239075, 519.512939)),
LinearTransform(Vec3(0.999219, -0.036256, -0.015699), Vec3(0.035651, 0.998672, -0.037202), Vec3(0.017027, 0.036613, 0.999184), Vec3(539.094238, 433.094543, 683.572815)),
LinearTransform(Vec3(0.993641, 0.004915, 0.112484), Vec3(-0.002803, 0.999817, -0.018922), Vec3(-0.112556, 0.018486, 0.993473), Vec3(536.099548, 435.136688, 735.346558)),
},
spawns = {
LinearTransform(Vec3(0.602055, 0.000000, 0.798455), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.798455, 0.000000, 0.602055), Vec3(61.629894, 540.768433, -301.157166)),
LinearTransform(Vec3(0.628883, 0.000000, 0.777500), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.777500, 0.000000, 0.628883), Vec3(60.686523, 540.539856, -302.380859)),
LinearTransform(Vec3(0.671963, 0.000000, 0.740584), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.740584, 0.000000, 0.671963), Vec3(59.402344, 540.228333, -303.833984)),
LinearTransform(Vec3(0.698137, 0.000000, 0.715964), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.715964, 0.000000, 0.698137), Vec3(58.343407, 539.989868, -304.925140)),
LinearTransform(Vec3(0.718166, 0.000000, 0.695872), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.695872, 0.000000, 0.718166), Vec3(57.236633, 539.753235, -306.003174)),
LinearTransform(Vec3(0.762624, 0.000000, 0.646842), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.646842, 0.000000, 0.762624), Vec3(55.915009, 539.467407, -307.157684)),
LinearTransform(Vec3(0.773524, 0.000000, 0.633767), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.633767, 0.000000, 0.773524), Vec3(54.832916, 539.271851, -308.021515)),
LinearTransform(Vec3(0.809332, 0.000000, 0.587351), Vec3(0.000000, 1.000000, 0.000000), Vec3(-0.587351, 0.000000, 0.809332), Vec3(53.160027, 538.963623, -309.302002)),
},
}
|
local utils = require("utils")
local nmap = utils.nmap
local imap = utils.imap
local cmd = vim.cmd
local api = vim.api
local fn = vim.fn
local lsp = vim.lsp
local lspinstall = require("lspinstall")
local nvim_lsp = require("lspconfig")
local colors = require("colors")
cmd("autocmd ColorScheme * highlight NormalFloat guibg=" .. colors.bg)
cmd("autocmd ColorScheme * highlight FloatBorder guifg=white guibg=" .. colors.bg)
local border = {
{"🭽", "FloatBorder"},
{"▔", "FloatBorder"},
{"🭾", "FloatBorder"},
{"▕", "FloatBorder"},
{"🭿", "FloatBorder"},
{"▁", "FloatBorder"},
{"🭼", "FloatBorder"},
{"▏", "FloatBorder"}
}
local format_async = function(err, _, result, _, bufnr)
if err ~= nil or result == nil then
return
end
if not api.nvim_buf_get_option(bufnr, "modified") then
local view = fn.winsaveview()
lsp.util.apply_text_edits(result, bufnr)
fn.winrestview(view)
if bufnr == api.nvim_get_current_buf() then
api.nvim_command("noautocmd :update")
end
end
end
lsp.handlers["textDocument/formatting"] = format_async
-- _G makes this function available to vimscript lua calls
_G.lsp_organize_imports = function()
local params = {
command = "_typescript.organizeImports",
arguments = {api.nvim_buf_get_name(0)},
title = ""
}
lsp.buf.execute_command(params)
end
-- show diagnostic line with custom border and styling
_G.lsp_show_diagnostics = function()
vim.lsp.diagnostic.show_line_diagnostics({border = border})
end
local on_attach = function(client, bufnr)
cmd [[command! LspDef lua vim.lsp.buf.definition()]]
cmd [[command! LspFormatting lua vim.lsp.buf.formatting()]]
cmd [[command! LspCodeAction lua vim.lsp.buf.code_action()]]
cmd [[command! LspHover lua vim.lsp.buf.hover()]]
cmd [[command! LspRename lua vim.lsp.buf.rename()]]
cmd [[command! LspOrganize lua lsp_organize_imports()]]
cmd [[command! OR lua lsp_organize_imports()]]
cmd [[command! LspRefs lua vim.lsp.buf.references()]]
cmd [[command! LspTypeDef lua vim.lsp.buf.type_definition()]]
cmd [[command! LspImplementation lua vim.lsp.buf.implementation()]]
cmd [[command! LspDiagPrev lua vim.lsp.diagnostic.goto_prev()]]
cmd [[command! LspDiagNext lua vim.lsp.diagnostic.goto_next()]]
cmd [[command! LspDiagLine lua lsp_show_diagnostics()]]
cmd [[command! LspSignatureHelp lua vim.lsp.buf.signature_help()]]
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border})
nmap("gd", ":LspDef<CR>", {bufnr = bufnr})
nmap("gr", ":LspRename<CR>", {bufnr = bufnr})
nmap("gR", ":LspRefs<CR>", {bufnr = bufnr})
nmap("gy", ":LspTypeDef<CR>", {bufnr = bufnr})
nmap("K", ":LspHover<CR>", {bufnr = bufnr})
nmap("gs", ":LspOrganize<CR>", {bufnr = bufnr})
nmap("[a", ":LspDiagPrev<CR>", {bufnr = bufnr})
nmap("]a", ":LspDiagNext<CR>", {bufnr = bufnr})
nmap("ga", ":LspCodeAction<CR>", {bufnr = bufnr})
nmap("<Leader>a", ":LspDiagLine<CR>", {bufnr = bufnr})
imap("<C-x><C-x>", "<cmd> LspSignatureHelp<CR>", {bufnr = bufnr})
if client.resolved_capabilities.document_highlight then
api.nvim_exec(
[[
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]],
false
)
end
-- disable document formatting (currently handled by formatter.nvim)
client.resolved_capabilities.document_formatting = false
if client.resolved_capabilities.document_formatting then
api.nvim_exec(
[[
augroup LspAutocommands
autocmd! * <buffer>
autocmd BufWritePost <buffer> LspFormatting
augroup END
]],
true
)
end
end
local diagnosticls_settings = {
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
"html",
"css",
"sh"
},
init_options = {
linters = {
eslint = {
sourceName = "eslint",
command = "eslint_d",
rootPatterns = {
".git",
".eslintrc",
".eslintrc.json",
".eslintrc.js",
".eslintrc.yml",
".eslintrc.yaml",
"package.json"
},
debounce = 100,
args = {"-f", "unix", "--stdin", "--stdin-filename", "%filepath", "--format", "json"},
securities = {["1"] = "warning", ["2"] = "error"},
parseJson = {
errorsRoot = "[0].messages",
line = "line",
column = "column",
endLine = "endLine",
endColumn = "endColumn",
security = "severity",
message = "${message} [${ruleId}]"
}
},
shellcheck = {
sourceName = "shellcheck",
command = "shellcheck",
debounce = 100,
args = {"--format=gcc", "-"},
offsetLine = 0,
offsetColumn = 0,
formatLines = 1,
formatPattern = {
"^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
{line = 1, column = 2, message = 4, security = 3}
},
securities = {error = "error", warning = "warning", note = "info"}
}
},
formatters = {
prettier = {
command = "./node_modules/.bin/prettier",
args = {"--stdin-filepath", "%filepath"},
rootPatterns = {
".git",
".eslintrc.json",
".eslintrc",
".eslinrc.js",
"package.json",
".prettierrc"
}
}
},
filetypes = {
sh = "shellcheck",
javascript = "eslint",
javascriptreact = "eslint",
["javascript.jsx"] = "eslint",
typescript = "eslint",
typescriptreact = "eslint",
["typescript.tsx"] = "eslint"
},
formatFiletypes = {
javascript = "eslint_d",
typescript = "eslint_d"
}
}
}
local lua_settings = {
Lua = {
runtime = {
-- LuaJIT in the case of Neovim
version = "LuaJIT",
path = vim.split(package.path, ";")
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {"vim"}
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {
[fn.expand("$VIMRUNTIME/lua")] = true,
[fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
}
}
}
}
local function make_config()
local capabilities = lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits"
}
}
capabilities.textDocument.colorProvider = {dynamicRegistration = false}
return {
capabilities = capabilities,
on_attach = on_attach
}
end
-- lsp-install
local function setup_servers()
lspinstall.setup()
-- get all installed servers
local servers = lspinstall.installed_servers()
for _, server in pairs(servers) do
local config = make_config()
if server == "lua" then
config.settings = lua_settings
config.root_dir = function(fname)
local util = require("lspconfig/util")
return util.find_git_ancestor(fname) or util.path.dirname(fname)
end
elseif server == "vim" then
config.init_options = {isNeovim = true}
elseif server == "diagnosticls" then
config = diagnosticls_settings
end
nvim_lsp[server].setup(config)
end
end
-- install these servers by default
local function install_servers()
local required_servers = {"lua", "typescript", "bash"}
local installed_servers = lspinstall.installed_servers()
for _, server in pairs(required_servers) do
if not vim.tbl_contains(installed_servers, server) then
lspinstall.install_server(server)
end
end
end
install_servers()
setup_servers()
lspinstall.post_install_hook = function()
setup_servers()
cmd [[bufdo e]]
end
-- set up custom symbols for LSP errors
fn.sign_define("LspDiagnosticsSignError", {text = "", texthl = "LspDiagnosticsSignError", linehl = "", numhl = ""})
fn.sign_define("LspDiagnosticsSignWarning", {text = "", texthl = "LspDiagnosticsSignWarning"})
fn.sign_define("LspDiagnosticsSignInformation", {text = "●", texthl = "LspDiagnosticsSignInfo"})
fn.sign_define("LspDiagnosticsSignHint", {text = "○", texthl = "LspDiagnosticsSignHint"})
|
local tbTable = GameMain:GetMod("MagicHelper")
local tbMagic = tbTable:GetMagic("BZM_WXCB")
function tbMagic:EnableCheck(npc)
return true
end
function tbMagic:TargetCheck(key, t)
local id = t.ID
if t.IsFaBao then
return true
else
return false
end
end
function tbMagic:MagicEnter(IDs, IsThing)
self.targetId = IDs[0]
end
function tbMagic:MagicStep(dt, duration)
self:SetProgress(duration / self.magic.Param1)
if duration >= self.magic.Param1 then
return 1
end
return 0
end
function tbMagic:MagicLeave(success)
if success then
local target = ThingMgr:FindThingByID(self.targetId)
local AT = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.AttackPower)
local JT = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.KnockBackAddition)
local FX = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.FlySpeed)
local RS = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.RotSpeed)
local HL = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.LingRecover)
local ML = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.MaxLing)
local TL = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.TailLenght)
local AR = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.AttackRate)
local KB = target.Fabao:GetProperty(CS.XiaWorld.Fight.g_emFaBaoP.KnockBackResistance)
local name = target:GetName()
local prename = {
"Tian",
"De",
"Xuan",
"Huang",
"Hong",
"Huang",
"Yu",
"Zhou",
"Zhuque",
"Xuanwu",
"Huanglong",
"Baihu",
"Qinglong",
"Cha Shi",
"Jiu Zhuan",
"Kong Ming",
"Xingyun",
"Feng Zhou",
"Fen Xian",
"Ling",
"Mie",
"Lu",
"Xiong",
"Busi",
"Ming",
"You",
"Xian Dì",
"Sheng Qi",
"Sheng Bing",
"Di Bing",
"Chi",
"Fusang",
"Xingkong",
"Miemen",
"Dao Yun"
}
local random = self.bind.LuaHelper:RandomInt(1, #prename)
if target then
if AT <= 100000 then
self.bind.PropertyMgr:ModifierProperty("NpcLingMaxValue", 0, -0.1, -0.1, 0)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.AttackPower, AT * 1.25)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.KnockBackAddition, JT * 1.15)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.FlySpeed, FX * 1.05)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.RotSpeed, RS * 1.05)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.LingRecover, HL * 1.2)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.MaxLing, ML * 1.2)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.KnockBackResistance, KB * 1.15)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.TailLenght, TL * 1.09)
target.Fabao:SetProperty(CS.XiaWorld.Fight.g_emFaBaoP.AttackRate, AR * 0.91)
else
target:SetName("" .. prename[random] .. "·" .. name .. "")
self.bind.LuaHelper:TriggerStory("JT")
end
end
end
end
|
-- Copyright (C) Sony Computer Entertainment America LLC.
-- All Rights Reserved.
--
-- Dependencies
--
include "../sledluaplugin/libsce_sledluaplugin-5.2.3.lua"
include "../sleddebugger/libsce_sleddebugger.lua"
include "../../build/premake/sled_master.lua"
--
-- Premake build script for the libsce_sleddebugger unit tests
--
sdk_project "libsce_sledluaplugin-5.2.3_unittests"
sdk_location "."
sdk_kind "ConsoleApp"
configurations { sdk.DEBUG, sdk.RELEASE }
platforms { sdk.WIN_STATIC_ALL }
uuid "124234EE-EED1-8329-B433-B01234118790"
files {
"*.h",
"*.cpp",
"../sleddebugger_unittests/scoped_network.h",
"../sleddebugger_unittests/scoped_network.cpp",
"../../wws_lua/extras/Lua.Utilities/LuaInterface.h",
"../../wws_lua/extras/Lua.Utilities/LuaInterface-5.2.3.cpp",
"../../../unittest-cpp/UnitTest++/*.h",
"../../../unittest-cpp/UnitTest++/*.cpp",
"../../../unittest-cpp/UnitTest++/Win32/*.h",
"../../../unittest-cpp/UnitTest++/Win32/*.cpp",
"../sledcore/*.h",
"../sledcore/windows/*.h"
}
vpaths { ["Headers"] = {"**.h", "../sleddebugger_unittests/**.h"} }
vpaths { ["Source"] = {"**.cpp", "../sleddebugger_unittests/**.cpp"} }
includedirs { "../../", "../../../" }
links { "libsce_sledluaplugin-5.2.3", "lua-5.2.3", "libsce_sleddebugger" }
objdir(path.join(sdk.rootdir, "tmp/sce_sled/%{prj.name}/%{sdk.platform(cfg)}"))
targetdir(path.join(sdk.rootdir, "tmp/sce_sled/%{prj.name}/%{sdk.platform(cfg)}"))
defines { "SCE_LUA_VER=523", "WWS_LUA_VER=523", "UNITTEST_XML_NAME=libsce_sledluaplugin-5.2.3_unittests" }
defines { "UNITTEST_XML_SUITE=%{sdk.platform(cfg)}" }
defines { "UNITTEST_XML_NAME=libsce_sleddebugger_unittests" }
filter { "platforms:*DLL*" }
defines { "UNITTEST_DLL_EXPORT" }
filter { "system:Windows" }
files { "Win32/*" }
defines { "UNITTEST_XML_PATH=./bin/%{sdk.platform(cfg)}/test-reports" }
flags { "SEH" }
configuration { "Debug*" }
defines { "SCE_SLED_ASSERT_ENABLED=1" }
configuration { "Win*" }
links { "ws2_32", get_sledcore_pathname() }
postbuildcommands { "\"" .. get_target_pathname(prj) .. "\"" }
|
local widget = require( "widget" )
local composer = require( "composer" )
local json = require ("json")
local myData = require ("mydata")
local upgrades = require("upgradeName")
local tutorialScene = composer.newScene()
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
--> GENERAL FUNCTIONS
---------------------------------------------------------------------------------
local function onAlert( event )
if ( event.action == "clicked" ) then
if system.getInfo("platformName")=="Android" then
native.requestExit()
else
os.exit()
end
end
end
function goBackTutorial (event)
myData.webView:removeSelf()
myData.webView = nil
backSound()
composer.removeScene( "tutorialScene" )
composer.gotoScene("playerSettingScene", {effect = "fade", time = 100})
end
local function goBackTutorial(event)
if (event.phase=="ended") then
myData.webView:removeSelf()
myData.webView = nil
backSound()
composer.removeScene( "tutorialScene" )
composer.gotoScene("playerSettingScene", {effect = "fade", time = 100})
end
end
---------------------------------------------------------------------------------
--> SCENE EVENTS
---------------------------------------------------------------------------------
-- Scene Creation
function tutorialScene:create(event)
group = self.view
loginInfo = localToken()
iconSize=200
myData.webView = native.newWebView(0, 0, display.contentWidth, display.actualContentHeight-(display.actualContentHeight/15)-10 )
myData.webView.anchorX=0
myData.webView.anchorY=0
myData.webView:request( "http://app.elitehax.it/tutorial/index.html" )
myData.webView:reload()
myData.backButton = widget.newButton(
{
left = 20,
top = display.actualContentHeight - (display.actualContentHeight/15) + topPadding(),
width = display.contentWidth - 40,
height = display.actualContentHeight/15-5,
defaultFile = buttonColor1080,
-- overFile = "buttonOver.png",
fontSize = fontSize(80),
label = "Back",
labelColor = tableColor1,
onEvent = goBackTutorial
})
-- Background
myData.background = display.newImage("img/background.jpg")
myData.background:scale(4,8)
myData.background.alpha = 0.3
changeImgColor(myData.background)
-- Show HUD
group:insert(myData.background)
group:insert(myData.backButton)
group:insert(myData.webView)
-- Button Listeners
myData.backButton:addEventListener("tap",goBackTutorial)
end
-- Home Show
function tutorialScene:show(event)
local taskGroup = self.view
if event.phase == "will" then
-- Called when the scene is still off screen (but is about to come on screen).
end
if event.phase == "did" then
--
end
end
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
--> Listener setup
---------------------------------------------------------------------------------
tutorialScene:addEventListener( "create", tutorialScene )
tutorialScene:addEventListener( "show", tutorialScene )
---------------------------------------------------------------------------------
return tutorialScene
|
object_mobile_exar_kun_tomb_guardian_f_03 = object_mobile_shared_exar_kun_tomb_guardian_f_03:new {
}
ObjectTemplates:addTemplate(object_mobile_exar_kun_tomb_guardian_f_03, "object/mobile/exar_kun_tomb_guardian_f_03.iff")
|
hight = 0
while turtle.up() do
hight = hight + 1
end
shell.run('/local/bin/doc.lua')
for i = 1, hight, 1 do
while not turtle.down() do
sleep(0.1)
turtle.digDown()
end
end
|
-- Device Controller is a little more advanced than other types.
-- It can create child devices, so it can be used for handling multiple physical devices.
-- E.g. when connecting to a hub, some cloud service or just when you want to represent a single physical device as multiple endpoints.
--
-- Basic knowledge of object-oriented programming (oop) is required.
-- Learn more about oop: https://en.wikipedia.org/wiki/Object-oriented_programming
-- Learn more about managing child devices: https://manuals.fibaro.com/home-center-3-quick-apps/
function QuickApp:onInit()
self:debug("QuickApp:onInit")
-- Setup classes for child devices.
-- Here you can assign how child instances will be created.
-- If type is not defined, QuickAppChild will be used.
self:initChildDevices({
["com.fibaro.energyMeter"] = Energy,
})
-- Print all child devices.
self:debug("Child devices:")
for id,device in pairs(self.childDevices) do
self:debug("[", id, "]", device.name, ", type of: ", device.type)
end
end
function QuickApp:createButtonClicked(event)
self:createChild()
end
-- Sample method to create a new child. It can be used in a button.
function QuickApp:createChild()
local child = self:createChildDevice({
name = "Energy",
type = "com.fibaro.energyMeter",
rateType = "production"
}, Energy)
self:trace("Child device created: ", child.id)
end
class 'Energy' (QuickAppChild)
function Energy:__init(device)
QuickAppChild.__init(self, device)
self:debug("Energy init")
self:updateProperty("rateType", "production")
self:updateProperty("value", 3)
end
|
squares = {}
for i = 0, 9 do
for j = 0, 9 do
squares[i * 10 + j] = i * i + j * j
end
end
for i = 1, 99 do
for j = 0, 99 do
squares[i * 100 + j] = squares[i] + squares[j]
end
end
function sum_squares(n)
if n < 9999.5 then
return squares[n]
else
local m = math.floor(n / 10000)
return squares[n - 10000 * m] + sum_squares(m)
end
end
memory = {}
function calc_1_or_89(n)
local m = {}
n = memory[n] or n
while n ~= 1 and n ~= 89 do
n = memory[n] or sum_squares(n)
table.insert(m, n)
end
for _, i in pairs(m) do
memory[i] = n
end
return n
end
counter = 0
for i = 1, 100000000 do
if calc_1_or_89(i) == 89 then
counter = counter + 1
end
end
print(counter)
|
--[[
LuiExtended
License: The MIT License (MIT)
--]]
local CI = LUIE.CombatInfo
local strformat = zo_strformat
local optionsDataCombatInfo = {}
local castBarMovingEnable = false -- Helper local flag
local alertFrameMovingEnabled = false -- Helper local flag
local globalMethodOptions = { "Ascending", "Descending", "Radial" }
local globalMethodOptionsKeys = { ["Ascending"] = 1, ["Descending"] = 2, ["Radial"] = 3 }
local globalAlertOptions = { "Show All Incoming Abilities", "Only Show Hard CC Effects", "Only Show Unbreakable CC Effects" }
local globalAlertOptionsKeys = { ["Show All Incoming Abilities"] = 1, ["Only Show Hard CC Effects"] = 2, ["Only Show Unbreakable CC Effects"] = 3 }
function CI.CreateSettings()
-- Load LibAddonMenu
local LAM = _G["LibAddonMenu2"]
-- Get fonts
local FontsList = {}
for f in pairs(LUIE.Fonts) do
table.insert(FontsList, f)
end
-- Get sounds
local SoundsList = {}
for sound, _ in pairs(LUIE.Sounds) do
table.insert(SoundsList, sound)
end
-- Get statusbar textures
local StatusbarTexturesList = {}
for key, _ in pairs(LUIE.StatusbarTextures) do
table.insert(StatusbarTexturesList, key)
end
local panelDataCombatInfo = {
type = "panel",
name = strformat("<<1>> - <<2>>", LUIE.name, GetString(SI_LUIE_LAM_CI)),
displayName = strformat("<<1>> <<2>>", LUIE.name, GetString(SI_LUIE_LAM_CI)),
author = LUIE.author,
version = LUIE.version,
website = LUIE.website,
feedback = LUIE.feedback,
translation = LUIE.translation,
donation = LUIE.donation,
slashCommand = "/luici",
registerForRefresh = true,
registerForDefaults = true,
}
-- Combat Info Description
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "description",
text = GetString(SI_LUIE_LAM_CI_DESCRIPTION),
}
-- ReloadUI Button
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "button",
name = GetString(SI_LUIE_LAM_RELOADUI),
tooltip = GetString(SI_LUIE_LAM_RELOADUI_BUTTON),
func = function() ReloadUI("ingame") end,
width = "full",
}
-- Combat Info - Global Cooldown Options Submenu
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "submenu",
name = GetString(SI_LUIE_LAM_CI_HEADER_GCD),
controls = {
{
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_GCD_SHOW),
tooltip = GetString(SI_LUIE_LAM_CI_GCD_SHOW_TP),
getFunc = function() return CI.SV.GlobalShowGCD end,
setFunc = function(value) CI.SV.GlobalShowGCD = value CI.HookGCD() end,
width = "full",
warning = GetString(SI_LUIE_LAM_CI_GCD_SHOW_WARN),
default = CI.D.GlobalShowGCD,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
{
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_GCD_QUICK)),
tooltip = GetString(SI_LUIE_LAM_CI_GCD_QUICK_TP),
getFunc = function() return CI.SV.GlobalPotion end,
setFunc = function(value) CI.SV.GlobalPotion = value end,
width = "full",
default = CI.D.GlobalPotion,
disabled = function() return not (LUIE.SV.CombatInfo_Enabled and CI.SV.GlobalShowGCD) end,
},
{
-- Show GCD Ready Flash
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_GCD_FLASH)),
tooltip = GetString(SI_LUIE_LAM_CI_GCD_FLASH_TP),
getFunc = function() return CI.SV.GlobalFlash end,
setFunc = function(value) CI.SV.GlobalFlash = value end,
width = "full",
default = CI.D.GlobalFlash,
disabled = function() return not (LUIE.SV.CombatInfo_Enabled and CI.SV.GlobalShowGCD) end,
},
{
-- GCD - Desaturate Icons on GCD
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_GCD_DESAT)),
tooltip = GetString(SI_LUIE_LAM_CI_GCD_DESAT_TP),
getFunc = function() return CI.SV.GlobalDesat end,
setFunc = function(value) CI.SV.GlobalDesat = value end,
width = "full",
default = CI.D.GlobalDesat,
disabled = function() return not (LUIE.SV.CombatInfo_Enabled and CI.SV.GlobalShowGCD) end,
},
{
-- GCD - Color Slot Label Red
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_GCD_COLOR)),
tooltip = GetString(SI_LUIE_LAM_CI_GCD_COLOR_TP),
getFunc = function() return CI.SV.GlobalLabelColor end,
setFunc = function(value) CI.SV.GlobalLabelColor = value end,
width = "full",
default = CI.D.GlobalLabelColor,
disabled = function() return not (LUIE.SV.CombatInfo_Enabled and CI.SV.GlobalShowGCD) end,
},
{
-- GCD - Animation Method
type = "dropdown",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_GCD_ANIMATION)),
tooltip = GetString(SI_LUIE_LAM_CI_GCD_ANIMATION_TP),
choices = globalMethodOptions,
getFunc = function() return globalMethodOptions[CI.SV.GlobalMethod] end,
setFunc = function(value) CI.SV.GlobalMethod = globalMethodOptionsKeys[value] end,
width = "full",
default = CI.D.GlobalMethod,
disabled = function() return not (LUIE.SV.CombatInfo_Enabled and CI.SV.GlobalShowGCD) end,
},
},
}
-- Combat Info - Ultimate Tracking Options Submenu
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "submenu",
name = GetString(SI_LUIE_LAM_CI_HEADER_ULTIMATE),
controls = {
{
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_ULTIMATE_SHOW_VAL),
tooltip = GetString(SI_LUIE_LAM_CI_ULTIMATE_SHOW_VAL_TP),
getFunc = function() return CI.SV.UltimateLabelEnabled end,
setFunc = function(value) CI.SV.UltimateLabelEnabled = value CI.RegisterCombatInfo() CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.UltimateLabelEnabled,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
{
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_ULTIMATE_SHOW_PCT),
tooltip = GetString(SI_LUIE_LAM_CI_ULTIMATE_SHOW_PCT_TP),
getFunc = function() return CI.SV.UltimatePctEnabled end,
setFunc = function(value) CI.SV.UltimatePctEnabled = value CI.RegisterCombatInfo() CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.UltimatePctEnabled,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
{
type = "slider",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_SHARED_POSITION)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_POSITION_TP),
min = -72, max = 40, step = 2,
getFunc = function() return CI.SV.UltimateLabelPosition end,
setFunc = function(value) CI.SV.UltimateLabelPosition = value CI.ResetUltimateLabel() end,
width = "full",
default = CI.D.UltimateLabelPosition,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.UltimatePctEnabled ) end,
},
{
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONT_TP),
choices = FontsList,
sort = "name-up",
getFunc = function() return CI.SV.UltimateFontFace end,
setFunc = function(var) CI.SV.UltimateFontFace = var CI.ApplyFont() end,
width = "full",
default = CI.D.UltimateFontFace,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.UltimatePctEnabled ) end,
},
{
type = "slider",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_SIZE)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONTSIZE_TP),
min = 10, max = 30, step = 1,
getFunc = function() return CI.SV.UltimateFontSize end,
setFunc = function(value) CI.SV.UltimateFontSize = value CI.ApplyFont() end,
width = "full",
default = CI.D.UltimateFontSize,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.UltimatePctEnabled ) end,
},
{
type = "dropdown",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_STYLE)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONTSTYLE_TP),
choices = { "normal", "outline", "shadow", "soft-shadow-thick", "soft-shadow-thin", "thick-outline" },
sort = "name-up",
getFunc = function() return CI.SV.UltimateFontStyle end,
setFunc = function(var) CI.SV.UltimateFontStyle = var CI.ApplyFont() end,
width = "full",
default = CI.D.UltimateFontStyle,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.UltimatePctEnabled ) end,
},
{
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ULTIMATE_HIDEFULL)),
tooltip = GetString(SI_LUIE_LAM_CI_ULTIMATE_HIDEFULL_TP),
getFunc = function() return CI.SV.UltimateHideFull end,
setFunc = function(value) CI.SV.UltimateHideFull = value CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.UltimateHideFull,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.UltimatePctEnabled ) end,
},
{
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_ULTIMATE_TEXTURE),
tooltip = GetString(SI_LUIE_LAM_CI_ULTIMATE_TEXTURE_TP),
getFunc = function() return CI.SV.UltimateGeneration end,
setFunc = function(value) CI.SV.UltimateGeneration = value end,
width = "full",
default = CI.D.UltimateGeneration,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
},
}
-- Combat Info - Bar Ability Highlight Options Submenu
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "submenu",
name = GetString(SI_LUIE_LAM_CI_HEADER_BAR),
controls = {
{
-- Highlight Ability Bar Icon for Active Procs
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_BAR_PROC),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_PROC_TP),
getFunc = function() return CI.SV.ShowTriggered end,
setFunc = function(value) CI.SV.ShowTriggered = value CI.UpdateBarHighlightTables() CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.ShowTriggered,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
{
-- Bar Proc Sound
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_BAR_PROCSOUND)),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_PROCSOUND_TP),
getFunc = function() return CI.SV.ProcEnableSound end,
setFunc = function(value) CI.SV.ProcEnableSound = value end,
width = "full",
default = CI.D.ProcEnableSound,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Bar Proc Sound Choice
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_BAR_PROCSOUNDCHOICE)),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_PROCSOUNDCHOICE_TP),
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.ProcSoundName end,
setFunc = function(value) CI.SV.ProcSoundName = value CI.ApplyProcSound(true) end,
width = "full",
default = CI.D.ProcSoundName,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Highlight Ability Bar Icon for Active Effects
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_BAR_EFFECT),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_EFFECT_TP),
getFunc = function() return CI.SV.ShowToggled end,
setFunc = function(value) CI.SV.ShowToggled = value CI.UpdateBarHighlightTables() CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.ShowToggled,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
{
-- Show Toggled Secondary
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_BAR_SECONDARY)),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_SECONDARY_TP),
getFunc = function() return CI.SV.ShowToggledSecondary end,
setFunc = function(value) CI.SV.ShowToggledSecondary = value CI.UpdateBarHighlightTables() CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.ShowToggledSecondary,
disabled = function() return not (CI.SV.ShowToggled and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Show Toggled Ultimate
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_BAR_ULTIMATE)),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_ULTIMATE_TP),
getFunc = function() return CI.SV.ShowToggledUltimate end,
setFunc = function(value) CI.SV.ShowToggledUltimate = value CI.UpdateBarHighlightTables() CI.OnSlotsFullUpdate() end,
width = "full",
default = CI.D.ShowToggledUltimate,
disabled = function() return not (CI.SV.ShowToggled and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Show Label On Bar Highlight
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_BAR_LABEL)),
tooltip = GetString(SI_LUIE_LAM_CI_BAR_LABEL_TP),
getFunc = function() return CI.SV.BarShowLabel end,
setFunc = function(value) CI.SV.BarShowLabel = value CI.ResetBarLabel() end,
width = "full",
default = CI.D.BarShowLabel,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and ( CI.SV.ShowTriggered or CI.SV.ShowToggled) ) end,
},
{
type = "slider",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_SHARED_POSITION)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_POSITION_TP),
min = -72, max = 40, step = 2,
getFunc = function() return CI.SV.BarLabelPosition end,
setFunc = function(value) CI.SV.BarLabelPosition = value CI.ResetBarLabel() end,
width = "full",
default = CI.D.BarLabelPosition,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.BarShowLabel and ( CI.SV.ShowTriggered or CI.SV.ShowToggled)) end,
},
{
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONT_TP),
choices = FontsList,
sort = "name-up",
getFunc = function() return CI.SV.BarFontFace end,
setFunc = function(var) CI.SV.BarFontFace = var CI.ApplyFont() end,
width = "full",
default = CI.D.BarFontFace,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.BarShowLabel and ( CI.SV.ShowTriggered or CI.SV.ShowToggled)) end,
},
{
type = "slider",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_SIZE)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONTSIZE_TP),
min = 10, max = 30, step = 1,
getFunc = function() return CI.SV.BarFontSize end,
setFunc = function(value) CI.SV.BarFontSize = value CI.ApplyFont() end,
width = "full",
default = CI.D.BarFontSize,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.BarShowLabel and ( CI.SV.ShowTriggered or CI.SV.ShowToggled)) end,
},
{
type = "dropdown",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_STYLE)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONTSTYLE_TP),
choices = { "normal", "outline", "shadow", "soft-shadow-thick", "soft-shadow-thin", "thick-outline" },
sort = "name-up",
getFunc = function() return CI.SV.BarFontStyle end,
setFunc = function(var) CI.SV.BarFontStyle = var CI.ApplyFont() end,
width = "full",
default = CI.D.BarFontStyle,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.BarShowLabel and ( CI.SV.ShowTriggered or CI.SV.ShowToggled)) end,
},
{
type = "checkbox",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_BUFF_SHOWSECONDFRACTIONS)),
tooltip = GetString(SI_LUIE_LAM_BUFF_SHOWSECONDFRACTIONS_TP),
getFunc = function() return CI.SV.BarMiilis end,
setFunc = function(value) CI.SV.BarMiilis = value end,
width = "full",
default = CI.D.BarMiilis,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.BarShowLabel and ( CI.SV.ShowTriggered or CI.SV.ShowToggled)) end,
},
},
}
-- Combat Info - Quickslot Cooldown Timer Option Submenu
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "submenu",
name = GetString(SI_LUIE_LAM_CI_HEADER_POTION),
controls = {
{
-- Show Cooldowns (Potion Only when I get finished) -- TODO
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_POTION),
tooltip = GetString(SI_LUIE_LAM_CI_POTION_TP),
getFunc = function() return CI.SV.PotionTimerShow end,
setFunc = function(value) CI.SV.PotionTimerShow = value end,
width = "full",
default = CI.D.PotionTimerShow,
disabled = function() return not LUIE.SV.CombatInfo_Enabled end,
},
{
type = "slider",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_SHARED_POSITION)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_POSITION_TP),
min = -72, max = 40, step = 2,
getFunc = function() return CI.SV.PotionTimerLabelPosition end,
setFunc = function(value) CI.SV.PotionTimerLabelPosition = value CI.ResetPotionTimerLabel() end,
width = "full",
default = CI.D.PotionTimerLabelPosition,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.PotionTimerShow ) end,
},
{
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONT_TP),
choices = FontsList,
sort = "name-up",
getFunc = function() return CI.SV.PotionTimerFontFace end,
setFunc = function(var) CI.SV.PotionTimerFontFace = var CI.ApplyFont() end,
width = "full",
default = CI.D.PotionTimerFontFace,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.PotionTimerShow ) end,
},
{
type = "slider",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_SIZE)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONTSIZE_TP),
min = 10, max = 30, step = 1,
getFunc = function() return CI.SV.PotionTimerFontSize end,
setFunc = function(value) CI.SV.PotionTimerFontSize = value CI.ApplyFont() end,
width = "full",
default = CI.D.PotionTimerFontSize,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.PotionTimerShow ) end,
},
{
type = "dropdown",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_STYLE)),
tooltip = GetString(SI_LUIE_LAM_CI_SHARED_FONTSTYLE_TP),
choices = { "normal", "outline", "shadow", "soft-shadow-thick", "soft-shadow-thin", "thick-outline" },
sort = "name-up",
getFunc = function() return CI.SV.PotionTimerFontStyle end,
setFunc = function(var) CI.SV.PotionTimerFontStyle = var CI.ApplyFont() end,
width = "full",
default = CI.D.PotionTimerFontStyle,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.PotionTimerShow ) end,
},
{
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_POTION_COLOR)),
tooltip = GetString(SI_LUIE_LAM_CI_POTION_COLOR_TP),
getFunc = function() return CI.SV.PotionTimerColor end,
setFunc = function(value) CI.SV.PotionTimerColor = value end,
width = "full",
default = CI.D.PotionTimerColor,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.PotionTimerShow ) end,
},
{
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_BUFF_SHOWSECONDFRACTIONS)),
tooltip = GetString(SI_LUIE_LAM_BUFF_SHOWSECONDFRACTIONS_TP),
getFunc = function() return CI.SV.PotionTimerMillis end,
setFunc = function(value) CI.SV.PotionTimerMillis = value end,
width = "full",
default = CI.D.PotionTimerMillis,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.PotionTimerShow ) end,
},
},
}
-- Combat Info -- Cast Bar Option Submenu
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "submenu",
name = GetString(SI_LUIE_LAM_CI_HEADER_CASTBAR),
controls = {
-- Cast Bar Unlock
{
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_CASTBAR_MOVE),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_MOVE_TP),
getFunc = function() return castBarMovingEnabled end,
setFunc = CI.SetMovingState,
width = "half",
default = false,
resetFunc = CI.ResetCastBarPosition,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
-- Cast Bar Unlock Reset position
{
type = "button",
name = GetString(SI_LUIE_LAM_RESETPOSITION),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_RESET_TP),
func = CI.ResetCastBarPosition,
width = "half",
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
{
-- Enable Cast Bar
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_CASTBAR_ENABLE),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_ENABLE_TP),
getFunc = function() return CI.SV.CastBarEnable end,
setFunc = function(value) CI.SV.CastBarEnable = value CI.RegisterCombatInfo() end,
width = "full",
default = CI.D.CastBarEnable,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Cast Bar Width
type = "slider",
name = GetString(SI_LUIE_LAM_CI_CASTBAR_SIZEW),
min = 100, max = 500, step = 5,
getFunc = function() return CI.SV.CastBarSizeW end,
setFunc = function(value) CI.SV.CastBarSizeW = value CI.ResizeCastBar() end,
width = "full",
default = CI.D.CastBarSizeW,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Cast Bar Height
type = "slider",
name = GetString(SI_LUIE_LAM_CI_CASTBAR_SIZEH),
min = 16, max = 64, step = 2,
getFunc = function() return CI.SV.CastBarSizeH end,
setFunc = function(value) CI.SV.CastBarSizeH = value CI.ResizeCastBar() end,
width = "full",
default = CI.D.CastBarSizeH,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Cast Bar Icon Size
type = "slider",
name = GetString(SI_LUIE_LAM_CI_CASTBAR_ICONSIZE),
min = 16, max = 64, step = 2,
getFunc = function() return CI.SV.CastBarIconSize end,
setFunc = function(value) CI.SV.CastBarIconSize = value CI.ResizeCastBar() end,
width = "full",
default = CI.D.CastBarIconSize,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Display Label
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_LABEL)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_LABEL_TP),
getFunc = function() return CI.SV.CastBarLabel end,
setFunc = function(value) CI.SV.CastBarLabel = value end,
width = "full",
default = CI.D.CastBarLabel,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
{
-- Display Timer
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_TIMER)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_TIMER_TP),
getFunc = function() return CI.SV.CastBarTimer end,
setFunc = function(value) CI.SV.CastBarTimer = value end,
width = "full",
default = CI.D.CastBarTimer,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
{
-- Cast Bar Font Face
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_FONTFACE)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_FONTFACE_TP),
choices = FontsList,
sort = "name-up",
getFunc = function() return CI.SV.CastBarFontFace end,
setFunc = function(var) CI.SV.CastBarFontFace = var CI.ApplyFont() CI.UpdateCastBar() end,
width = "full",
default = CI.D.CastBarFontFace,
disabled = function() return not ( LUIE.SV.SpellCastBuff_Enable and CI.SV.CastBarEnable and (CI.SV.CastBarTimer or CI.SV.CastBarLabel) ) end,
},
{
-- Cast Bar Font Size
type = "slider",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_FONTSIZE)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_FONTSIZE_TP),
min = 10, max = 30, step = 1,
getFunc = function() return CI.SV.CastBarFontSize end,
setFunc = function(value) CI.SV.CastBarFontSize = value CI.ApplyFont() CI.UpdateCastBar() end,
width = "full",
default = CI.D.CastBarFontSize,
disabled = function() return not ( LUIE.SV.SpellCastBuff_Enable and CI.SV.CastBarEnable and (CI.SV.CastBarTimer or CI.SV.CastBarLabel) ) end,
},
{
-- Cast Bar Font Style
type = "dropdown",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_FONTSTYLE)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_FONTSTYLE_TP),
choices = { "normal", "outline", "shadow", "soft-shadow-thick", "soft-shadow-thin", "thick-outline" },
sort = "name-up",
getFunc = function() return CI.SV.CastBarFontStyle end,
setFunc = function(var) CI.SV.CastBarFontStyle = var CI.ApplyFont() CI.UpdateCastBar() end,
width = "full",
default = CI.D.CastBarFontStyle,
disabled = function() return not ( LUIE.SV.SpellCastBuff_Enable and CI.SV.CastBarEnable and (CI.SV.CastBarTimer or CI.SV.CastBarLabel) ) end,
},
{
-- Cast Bar Texture
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_TEXTURE)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_TEXTURE_TP),
choices = StatusbarTexturesList,
sort = "name-up",
getFunc = function() return CI.SV.CastBarTexture end,
setFunc = function(value) CI.SV.CastBarTexture = value CI.UpdateCastBar() end,
width = "full",
default = CI.D.CastBarTexture,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
{
-- Cast Bar Gradient Color 1
type = "colorpicker",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_GRADIENTC1)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_GRADIENTC1_TP),
getFunc = function() return unpack(CI.SV.CastBarGradientC1) end,
setFunc = function(r, g, b, a) CI.SV.CastBarGradientC1 = { r, g, b, a } CI.UpdateCastBar() end,
width = "half",
default = {r=CI.SV.CastBarGradientC1[1], g=CI.SV.CastBarGradientC1[2], b=CI.SV.CastBarGradientC1[3]},
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
{
-- Cast Bar Gradient Color 2
type = "colorpicker",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_CASTBAR_GRADIENTC2)),
tooltip = GetString(SI_LUIE_LAM_CI_CASTBAR_GRADIENTC2_TP),
getFunc = function() return unpack(CI.SV.CastBarGradientC2) end,
setFunc = function(r, g, b, a) CI.SV.CastBarGradientC2 = { r, g, b, a } CI.UpdateCastBar() end,
width = "half",
default = {r=CI.SV.CastBarGradientC2[1], g=CI.SV.CastBarGradientC2[2], b=CI.SV.CastBarGradientC2[3]},
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled and CI.SV.CastBarEnable ) end,
},
},
}
-- Active Combat Alerts
optionsDataCombatInfo[#optionsDataCombatInfo + 1] = {
type = "submenu",
name = GetString(SI_LUIE_LAM_CI_HEADER_ACTIVE_COMBAT_ALERT),
controls = {
{
type = "description",
text = GetString(SI_LUIE_LAM_CI_ALERT_DESCRIPTION),
},
-- Unlock Alert Frame
{
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_ALERT_UNLOCK),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_UNLOCK_TP),
getFunc = function() return alertFrameMovingEnabled end,
setFunc = CI.SetMovingStateAlert,
width = "half",
default = false,
resetFunc = CI.ResetAlertFramePosition,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
-- Reset Alert Frame
{
type = "button",
name = GetString(SI_LUIE_LAM_RESETPOSITION),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_RESET_TP),
func = CI.ResetAlertFramePosition,
width = "half",
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Show Alerts
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_ALERT_TOGGLE),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_TOGGLE_TP),
getFunc = function() return CI.SV.alerts.toggles.alertEnable end,
setFunc = function(v) CI.SV.alerts.toggles.alertEnable = v end,
default = CI.D.alerts.toggles.alertEnable,
},
{
-- Alert Font Face
type = "dropdown",
scrollable = true,
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_FONTFACE_TP),
choices = FontsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.toggles.alertFontFace end,
setFunc = function(var) CI.SV.alerts.toggles.alertFontFace = var CI.ApplyFontAlert() CI.ResetAlertSize() end,
width = "full",
default = CI.D.alerts.toggles.alertFontFace,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Alert Font Size
type = "slider",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_SIZE)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_FONTSIZE_TP),
min = 16, max = 64, step = 1,
getFunc = function() return CI.SV.alerts.toggles.alertFontSize end,
setFunc = function(value) CI.SV.alerts.toggles.alertFontSize = value CI.ApplyFontAlert() CI.ResetAlertSize() end,
width = "full",
default = CI.D.alerts.toggles.alertFontSize,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Alert Font Style
type = "dropdown",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_FONT_STYLE)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_FONTSTYLE_TP),
choices = { "normal", "outline", "shadow", "soft-shadow-thick", "soft-shadow-thin", "thick-outline" },
sort = "name-up",
getFunc = function() return CI.SV.alerts.toggles.alertFontStyle end,
setFunc = function(var) CI.SV.alerts.toggles.alertFontStyle = var CI.ApplyFontAlert() CI.ResetAlertSize() end,
width = "full",
default = CI.D.alerts.toggles.alertFontStyle,
disabled = function() return not ( LUIE.SV.CombatInfo_Enabled ) end,
},
{
-- Alert Timer
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_TIMER_TOGGLE)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_TIMER_TOGGLE_TP),
getFunc = function() return CI.SV.alerts.toggles.alertTimer end,
setFunc = function(v) CI.SV.alerts.toggles.alertTimer = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.alertTimer,
},
{
-- Shared Timer Color
type = "colorpicker",
name = strformat("\t\t\t\t\t\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_TIMER_COLOR)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_TIMER_COLOR_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertTimer) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertTimer = { r, g, b, a } CI.SetAlertColors() end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.alertTimer) end,
default = {r=CI.D.alerts.colors.alertTimer[1], g=CI.D.alerts.colors.alertTimer[2], b=CI.D.alerts.colors.alertTimer[3]}
},
{
-- Shared Label Color
type = "colorpicker",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_COLOR_BASE)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_COLOR_BASE_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertShared) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertShared = { r, g, b, a } CI.SetAlertColors() end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = {r=CI.D.alerts.colors.alertShared[1], g=CI.D.alerts.colors.alertShared[2], b=CI.D.alerts.colors.alertShared[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CI_ALERT_HEADER_SHARED),
width = "full",
},
{
-- Mitigation Aura
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_AURA)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_AURA_TP),
getFunc = function() return CI.SV.alerts.toggles.mitigationAura end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationAura = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.mitigationAura,
},
{
-- Mitigation Rank 3
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_RANK3)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_RANK3_TP),
getFunc = function() return CI.SV.alerts.toggles.mitigationRank3 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationRank3 = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.mitigationRank3,
},
{
-- Mitigation Rank 2
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_RANK2)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_RANK2_TP),
getFunc = function() return CI.SV.alerts.toggles.mitigationRank2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationRank2 = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.mitigationRank2,
},
{
-- Mitigation Rank 1
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_RANK1)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_RANK1_TP),
getFunc = function() return CI.SV.alerts.toggles.mitigationRank1 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationRank1 = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.mitigationRank1,
},
{
-- Mitigation Dungeon
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_DUNGEON)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_DUNGEON_TP),
getFunc = function() return CI.SV.alerts.toggles.mitigationDungeon end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationDungeon = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.mitigationDungeon,
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_HEADER),
width = "full",
},
{
type = "description",
text = GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_DESCRIPTION),
},
{
-- MITIGATION ENABLE
type = "checkbox",
name = GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_ENABLE),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_ENABLE_TP),
getFunc = function() return CI.SV.alerts.toggles.showAlertMitigate end,
setFunc = function(v) CI.SV.alerts.toggles.showAlertMitigate = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.showAlertMitigate,
},
{
-- Incoming Ability Filters
type = "dropdown",
name = "\t\t\t\t\tFilter Incoming Abilities (WIP)", -- TODO (when table is more complete) -- SI_LUIE_LAM_CI_ALERT_MITIGATION_FILTER
tooltip = "Choose whether to show all incoming abilities, only hard CC effects, or only unbreakable CC effects.\n\nNote this feature is currently WIP and many abilities are not flagged correctly by their CC type.", -- SI_LUIE_LAM_CI_ALERT_MITIGATION_FILTER_TP
choices = globalAlertOptions,
getFunc = function() return globalAlertOptions[CI.SV.alerts.toggles.alertOptions] end,
setFunc = function(value) CI.SV.alerts.toggles.alertOptions = globalAlertOptionsKeys[value] end,
width = "full",
default = CI.D.alerts.toggles.alertOptions,
disabled = function() return not CI.SV.alerts.toggles.showAlertMitigate end,
},
{
-- Show Mitigation Suffix
type = "checkbox",
name = strformat("\t\t\t\t\t<<1>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_SUFFIX)),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_SUFFIX_TP),
getFunc = function() return CI.SV.alerts.toggles.showMitigation end,
setFunc = function(v) CI.SV.alerts.toggles.showMitigation = v end,
disabled = function() return not CI.SV.alerts.toggles.showAlertMitigate end,
default = CI.D.alerts.toggles.showMitigation,
},
{
-- Mitigation Prefix (No Name)
type = "editbox",
name = strformat("\t\t\t\t\t<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationPrefix end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationPrefix = v end,
disabled = function() return not CI.SV.alerts.toggles.showAlertMitigate end,
default = CI.D.alerts.toggles.mitigationPrefix,
},
{
-- Mitigation Prefix (Name)
type = "editbox",
name = strformat("\t\t\t\t\t<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationPrefixN end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationPrefixN = v end,
disabled = function() return not CI.SV.alerts.toggles.showAlertMitigate end,
default = CI.D.alerts.toggles.mitigationPrefixN,
},
{
-- Show Crowd Control Border
type = "checkbox",
name = "\t\t\t\t\tShow Color Border for Crowd Control Type (WIP)", -- TODO (when table is more complete) -- SI_LUIE_LAM_CI_ALERT_MITIGATION_BORDER
tooltip = "Color the frame of the incoming ability icon based off the type of Crowd Control incoming (if any).\n\nNote this feature is currently WIP and many abilities are not flagged correctly by their CC type.", -- SI_LUIE_LAM_CI_ALERT_MITIGATION_BORDER_TP
getFunc = function() return CI.SV.alerts.toggles.showCrowdControlBorder end,
setFunc = function(v) CI.SV.alerts.toggles.showCrowdControlBorder = v end,
disabled = function() return not CI.SV.alerts.toggles.showAlertMitigate end,
default = CI.D.alerts.toggles.showCrowdControlBorder,
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_BLOCK),
width = "full",
},
{
-- Block Format
type = "editbox",
width = "half",
name = strformat("<<1>> (<<2>>)", GetString(SI_LUIE_LAM_CT_SHARED_FORMAT), GetString(SI_LUIE_LAM_CT_SHARED_ALERT_BLOCK)),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_BLOCK_TP),
getFunc = function() return CI.SV.alerts.formats.alertBlock end,
setFunc = function(v) CI.SV.alerts.formats.alertBlock = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertBlock,
},
{
-- Block Stagger Format
type = "editbox",
width = "half",
name = strformat("<<1>> (<<2>>)", GetString(SI_LUIE_LAM_CT_SHARED_FORMAT), GetString(SI_LUIE_LAM_CT_SHARED_ALERT_BLOCK_S)),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_BLOCK_S_TP),
getFunc = function() return CI.SV.alerts.formats.alertBlockStagger end,
setFunc = function(v) CI.SV.alerts.formats.alertBlockStagger = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertBlockStagger,
},
{
-- Block Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_BLOCK_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertBlockA) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertBlockA = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertBlockA[1], g=CI.D.alerts.colors.alertBlockA[2], b=CI.D.alerts.colors.alertBlockA[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_DODGE),
width = "full",
},
{
-- Dodge Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_DODGE_TP),
getFunc = function() return CI.SV.alerts.formats.alertDodge end,
setFunc = function(v) CI.SV.alerts.formats.alertDodge = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertDodge,
},
{
-- Dodge Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_DODGE_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertDodgeA) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertDodgeA = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertDodgeA[1], g=CI.D.alerts.colors.alertDodgeA[2], b=CI.D.alerts.colors.alertDodgeA[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_AVOID),
width = "full",
},
{
-- Avoid Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_AVOID_TP),
getFunc = function() return CI.SV.alerts.formats.alertAvoid end,
setFunc = function(v) CI.SV.alerts.formats.alertAvoid = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertAvoid,
},
{
-- Avoid Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_AVOID_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertAvoidB) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertAvoidB = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertAvoidB[1], g=CI.D.alerts.colors.alertAvoidB[2], b=CI.D.alerts.colors.alertAvoidB[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_INTERRUPT),
width = "full",
},
{
-- Interrupt Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_INTERRUPT_TP),
getFunc = function() return CI.SV.alerts.formats.alertInterrupt end,
setFunc = function(v) CI.SV.alerts.formats.alertInterrupt = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertInterrupt,
},
{
-- Interrupt Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_INTERRUPT_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertInterruptB) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertInterruptB = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertInterruptB[1], g=CI.D.alerts.colors.alertInterruptB[2], b=CI.D.alerts.colors.alertInterruptB[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_UNMIT),
width = "full",
},
{
-- Unmit Enable
type = "checkbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CT_SHARED_DISPLAY), GetString(SI_LUIE_LAM_CT_SHARED_ALERT_UNMIT)),
tooltip = GetString(SI_LUIE_LAM_CT_NOTIFICATION_ALERT_UNMIT_TP),
getFunc = function() return CI.SV.alerts.toggles.showAlertUnmit end,
setFunc = function(v) CI.SV.alerts.toggles.showAlertUnmit = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.showAlertUnmit,
},
{
-- Unmit Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_UNMIT_TP),
getFunc = function() return CI.SV.alerts.formats.alertUnmit end,
setFunc = function(v) CI.SV.alerts.formats.alertUnmit = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertUnmit,
},
{
-- Unmit Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_UNMIT_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertUnmit) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertUnmit = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertUnmit[1], g=CI.D.alerts.colors.alertUnmit[2], b=CI.D.alerts.colors.alertUnmit[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_POWER),
width = "full",
},
{
-- Power Enable
type = "checkbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CT_SHARED_DISPLAY), GetString(SI_LUIE_LAM_CT_SHARED_ALERT_POWER)),
tooltip = GetString(SI_LUIE_LAM_CT_NOTIFICATION_ALERT_POWER_TP),
getFunc = function() return CI.SV.alerts.toggles.showAlertPower end,
setFunc = function(v) CI.SV.alerts.toggles.showAlertPower = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.showAlertPower,
},
{
-- Power Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_POWER_TP),
getFunc = function() return CI.SV.alerts.formats.alertPower end,
setFunc = function(v) CI.SV.alerts.formats.alertPower = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertPower,
},
{
-- Prefix Power (No Name)
type = "editbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_P), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_P_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationPowerPrefix2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationPowerPrefix2 = v end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.showAlertPower) end,
default = CI.D.alerts.toggles.mitigationPowerPrefix2,
},
{
-- Prefix Power (Name)
type = "editbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_P), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_P_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationPowerPrefixN2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationPowerPrefixN2 = v end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.showAlertPower) end,
default = CI.D.alerts.toggles.mitigationPowerPrefixN2,
},
{
-- Power Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_POWER_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertPower) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertPower = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertPower[1], g=CI.D.alerts.colors.alertPower[2], b=CI.D.alerts.colors.alertPower[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_DESTROY),
width = "full",
},
{
-- Destroy Enable
type = "checkbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CT_SHARED_DISPLAY), GetString(SI_LUIE_LAM_CT_SHARED_ALERT_DESTROY)),
tooltip = GetString(SI_LUIE_LAM_CT_NOTIFICATION_ALERT_DESTROY_TP),
getFunc = function() return CI.SV.alerts.toggles.showAlertDestroy end,
setFunc = function(v) CI.SV.alerts.toggles.showAlertDestroy = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.showAlertDestroy,
},
{
-- Destroy Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_DESTROY_TP),
getFunc = function() return CI.SV.alerts.formats.alertDestroy end,
setFunc = function(v) CI.SV.alerts.formats.alertDestroy = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertDestroy,
},
{
-- Prefix Destroy (No Name)
type = "editbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_D), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_D_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationDestroyPrefix2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationDestroyPrefix2 = v end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.showAlertDestroy) end,
default = CI.D.alerts.toggles.mitigationDestroyPrefix2,
},
{
-- Prefix Destroy (Name)
type = "editbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_D), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_D_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationDestroyPrefixN2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationDestroyPrefixN2 = v end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.showAlertDestroy) end,
default = CI.D.alerts.toggles.mitigationDestroyPrefixN2,
},
{
-- Destroy Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_DESTROY_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertDestroy) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertDestroy = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertDestroy[1], g=CI.D.alerts.colors.alertDestroy[2], b=CI.D.alerts.colors.alertDestroy[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CT_SHARED_ALERT_SUMMON),
width = "full",
},
{
-- Summon Enable
type = "checkbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CT_SHARED_DISPLAY), GetString(SI_LUIE_LAM_CT_SHARED_ALERT_SUMMON)),
tooltip = GetString(SI_LUIE_LAM_CT_NOTIFICATION_ALERT_SUMMON_TP),
getFunc = function() return CI.SV.alerts.toggles.showAlertSummon end,
setFunc = function(v) CI.SV.alerts.toggles.showAlertSummon = v end,
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.showAlertSummon,
},
{
-- Summon Format
type = "editbox",
name = GetString(SI_LUIE_LAM_CT_SHARED_FORMAT),
tooltip = GetString(SI_LUIE_LAM_CT_FORMAT_NOTIFICATION_SUMMON_TP),
getFunc = function() return CI.SV.alerts.formats.alertSummon end,
setFunc = function(v) CI.SV.alerts.formats.alertSummon = v end,
isMultiline = false,
default = CI.D.alerts.formats.alertSummon,
},
{
-- Prefix Summon (No Name)
type = "editbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_S), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_S_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NO_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationSummonPrefix2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationSummonPrefix2 = v end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.showAlertSummon) end,
default = CI.D.alerts.toggles.mitigationSummonPrefix2,
},
{
-- Prefix Summon (Name)
type = "editbox",
name = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_S), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME)),
tooltip = strformat("<<1>> <<2>>", GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_FORMAT_S_TP), GetString(SI_LUIE_LAM_CI_ALERT_MITIGATION_NAME_TP)),
getFunc = function() return CI.SV.alerts.toggles.mitigationSummonPrefixN2 end,
setFunc = function(v) CI.SV.alerts.toggles.mitigationSummonPrefixN2 = v end,
disabled = function() return not (CI.SV.alerts.toggles.alertEnable and CI.SV.alerts.toggles.showAlertSummon) end,
default = CI.D.alerts.toggles.mitigationSummonPrefixN2,
},
{
-- Summon Color
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CT_SHARED_COLOR),
tooltip = GetString(SI_LUIE_LAM_CT_COLOR_NOTIFICATION_SUMMON_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.alertSummon) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.alertSummon = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.alertSummon[1], g=CI.D.alerts.colors.alertSummon[2], b=CI.D.alerts.colors.alertSummon[3]}
},
{
type = "header",
name = GetString(SI_LUIE_LAM_CI_ALERT_HEADER_CC_COLOR),
width = "full",
},
{
-- Stun
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_STUN),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_STUN_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.stunColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.stunColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.stunColor[1], g=CI.D.alerts.colors.stunColor[2], b=CI.D.alerts.colors.stunColor[3]}
},
{
-- Disorient
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_DISORIENT),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_DISORIENT_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.disorientColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.disorientColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.disorientColor[1], g=CI.D.alerts.colors.disorientColor[2], b=CI.D.alerts.colors.disorientColor[3]}
},
{
-- Fear
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_FEAR),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_FEAR_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.fearColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.fearColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.fearColor[1], g=CI.D.alerts.colors.fearColor[2], b=CI.D.alerts.colors.fearColor[3]}
},
{
-- Silence
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_SILENCE),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_SILENCE_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.silenceColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.silenceColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.silenceColor[1], g=CI.D.alerts.colors.silenceColor[2], b=CI.D.alerts.colors.silenceColor[3]}
},
{
-- Stagger
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_STAGGER),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_STAGGER_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.staggerColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.sstaggerColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.staggerColor[1], g=CI.D.alerts.colors.staggerColor[2], b=CI.D.alerts.colors.staggerColor[3]}
},
{
-- Unbreakable
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_UNBREAKABLE),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_UNBREAKABLE_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.unbreakableColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.colors.unbreakableColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.unbreakableColor[1], g=CI.D.alerts.colors.unbreakableColor[2], b=CI.D.alerts.colors.unbreakableColor[3]}
},
{
-- Snare
type = "colorpicker",
name = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_SNARE),
tooltip = GetString(SI_LUIE_LAM_CI_ALERT_CC_COLOR_SNARE_TP),
getFunc = function() return unpack(CI.SV.alerts.colors.snareColor) end,
setFunc = function(r, g, b, a) CI.SV.alerts.snareColor = { r, g, b, a } CI.SetAlertColors() end,
default = {r=CI.D.alerts.colors.snareColor[1], g=CI.D.alerts.colors.snareColor[2], b=CI.D.alerts.colors.snareColor[3]}
},
{
type = "header",
name = "ALERT SOUND OPTIONS",
width = "full",
},
{
-- Play Sound Priority 3
type = "checkbox",
name = "Enable Sound - (No CC) Priority 3",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable3 end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable3 = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable3,
},
{
-- Sound Priority 3
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound3 end,
setFunc = function(value) CI.SV.alerts.sounds.sound3 = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound3,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 3 CC
type = "checkbox",
name = "Enable Sound - (Hard CC) Priority 3",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable3CC end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable3CC = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable3CC,
},
{
-- Sound Priority 3 CC
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound3CC end,
setFunc = function(value) CI.SV.alerts.sounds.sound3CC = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound3CC,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 3 UB
type = "checkbox",
name = "Enable Sound - (Unbreakable CC) Priority 3",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable3UB end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable3UB = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable3UB,
},
{
-- Sound Priority 3 UB
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound3UB end,
setFunc = function(value) CI.SV.alerts.sounds.sound3UB = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound3UB,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 2
type = "checkbox",
name = "Enable Sound - (No CC) Priority 2",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable2 end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable2 = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable2,
},
{
-- Sound Priority 2
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound2 end,
setFunc = function(value) CI.SV.alerts.sounds.sound2 = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound2,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 2 CC
type = "checkbox",
name = "Enable Sound - (Hard CC) Priority 2",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable2CC end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable2CC = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable2CC,
},
{
-- Sound Priority 2 CC
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound2CC end,
setFunc = function(value) CI.SV.alerts.sounds.sound2CC = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound2CC,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 2 UB
type = "checkbox",
name = "Enable Sound - (Unbreakable CC) Priority 2",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable2UB end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable2UB = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable2UB,
},
{
-- Sound Priority 2 UB
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound2UB end,
setFunc = function(value) CI.SV.alerts.sounds.sound2UB = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound2UB,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 1
type = "checkbox",
name = "Enable Sound - (No CC) Priority 1",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable1 end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable1 = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable1,
},
{
-- Sound Priority 1
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound1 end,
setFunc = function(value) CI.SV.alerts.sounds.sound1 = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound1,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 1 CC
type = "checkbox",
name = "Enable Sound - (Hard CC) Priority 1",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable1CC end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable1CC = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable1CC,
},
{
-- Sound Priority 1 CC
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound1CC end,
setFunc = function(value) CI.SV.alerts.sounds.sound1CC = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound1CC,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Priority 1 UB
type = "checkbox",
name = "Enable Sound - (Unbreakable CC) Priority 1",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnable1UB end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnable1UB = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnable1UB,
},
{
-- Sound Priority 1 UB
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.sound1UB end,
setFunc = function(value) CI.SV.alerts.sounds.sound1UB = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.sound1UB,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Unmit
type = "checkbox",
name = "Play Sound - Unmitigable",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnableUnmit end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnableUnmit = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnableUnmit,
},
{
-- Sound Unmit
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.soundUnmit end,
setFunc = function(value) CI.SV.alerts.sounds.soundUnmit = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.soundUnmit,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Power
type = "checkbox",
name = "Play Sound Power",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnablePower end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnablePower = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnablePower,
},
{
-- Sound Power
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.soundPower end,
setFunc = function(value) CI.SV.alerts.sounds.soundPower = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.soundPower,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Summon
type = "checkbox",
name = "Play Sound - Summon",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnableSummon end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnableSummon = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnableSummon,
},
{
-- Sound Summon
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.soundSummon end,
setFunc = function(value) CI.SV.alerts.sounds.soundSummon = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.soundSummon,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
{
-- Play Sound Destroy
type = "checkbox",
name = "Play Sound - Destroy",
tooltip = "TODO",
getFunc = function() return CI.SV.alerts.toggles.soundEnableDestroy end,
setFunc = function(v) CI.SV.alerts.toggles.soundEnableDestroy = v end,
width = "half",
disabled = function() return not CI.SV.alerts.toggles.alertEnable end,
default = CI.D.alerts.toggles.soundEnableDestroy,
},
{
-- Sound Destroy
type = "dropdown",
scrollable = true,
name = "",
tooltip = "TODO",
choices = SoundsList,
sort = "name-up",
getFunc = function() return CI.SV.alerts.sounds.soundDestroy end,
setFunc = function(value) CI.SV.alerts.sounds.soundDestroy = value CI.PreviewAlertSound(value) end,
width = "half",
default = CI.SV.alerts.sounds.soundDestroy,
disabled = function() return not (CI.SV.ShowTriggered and LUIE.SV.CombatInfo_Enabled) end,
},
},
}
-- Register the settings panel
if LUIE.SV.CombatInfo_Enabled then
LAM:RegisterAddonPanel('LUIECombatInfoOptions', panelDataCombatInfo)
LAM:RegisterOptionControls('LUIECombatInfoOptions', optionsDataCombatInfo)
end
end
|
local ADDON_NAME, Addon = ...
local ThreatPlates = Addon.ThreatPlates
---------------------------------------------------------------------------------------------------
-- Stuff for handling the database with the SavedVariables of ThreatPlates (ThreatPlatesDB)
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Imported functions and constants
---------------------------------------------------------------------------------------------------
-- Lua APIs
local floor, select, unpack, type, min, pairs = floor, select, unpack, type, min, pairs
-- WoW APIs
local GetCVar, SetCVar = GetCVar, SetCVar
local UnitClass, GetSpecialization = UnitClass, GetSpecialization
-- ThreatPlates APIs
local L = ThreatPlates.L
local TidyPlatesThreat = TidyPlatesThreat
local RGB = ThreatPlates.RGB
---------------------------------------------------------------------------------------------------
-- Global functions for accessing the configuration
---------------------------------------------------------------------------------------------------
-- Returns if the currently active spec is tank (true) or dps/heal (false)
Addon.PlayerClass = select(2, UnitClass("player"))
local PLAYER_ROLE_BY_SPEC = ThreatPlates.SPEC_ROLES[Addon.PlayerClass]
function Addon:PlayerRoleIsTank()
local db = TidyPlatesThreat.db
if db.profile.optionRoleDetectionAutomatic then
return PLAYER_ROLE_BY_SPEC[GetSpecialization()] or false
else
return db.char.spec[GetSpecialization()]
end
end
-- Sets the role of the index spec or the active spec to tank (value = true) or dps/healing
function TidyPlatesThreat:SetRole(value,index)
if index then
self.db.char.spec[index] = value
else
self.db.char.spec[GetSpecialization()] = value
end
end
local function GetUnitVisibility(full_unit_type)
local unit_visibility = TidyPlatesThreat.db.profile.Visibility[full_unit_type]
-- assert (TidyPlatesThreat.db.profile.Visibility[full_unit_type], "missing unit type: ".. full_unit_type)
local show = unit_visibility.Show
if type(show) ~= "boolean" then
show = (GetCVar(show) == "1")
end
return show, unit_visibility.UseHeadlineView
end
local function SetNamePlateClickThrough(friendly, enemy)
-- if InCombatLockdown() then
-- ThreatPlates.Print(L["Nameplate clickthrough cannot be changed while in combat."], true)
-- else
local db = TidyPlatesThreat.db.profile
db.NamePlateFriendlyClickThrough = friendly
db.NamePlateEnemyClickThrough = enemy
Addon:CallbackWhenOoC(function()
C_NamePlate.SetNamePlateFriendlyClickThrough(friendly)
C_NamePlate.SetNamePlateEnemyClickThrough(enemy)
end, L["Nameplate clickthrough cannot be changed while in combat."])
-- end
end
---------------------------------------------------------------------------------------------------
-- Functions for migration of SavedVariables settings
---------------------------------------------------------------------------------------------------
local function GetDefaultSettingsV1(defaults)
local new_defaults = ThreatPlates.CopyTable(defaults)
local db = new_defaults.profile
db.allowClass = false
db.friendlyClass = false
db.optionRoleDetectionAutomatic = false
--db.HeadlineView.width = 116
db.text.amount = true
db.AuraWidget.ModeBar.Texture = "Aluminium"
db.uniqueWidget.scale = 35
db.uniqueWidget.y = 24
db.questWidget.ON = false
db.questWidget.ShowInHeadlineView = false
db.questWidget.ModeHPBar = true
db.ResourceWidget.BarTexture = "Aluminium"
db.settings.elitehealthborder.show = true
db.settings.healthborder.texture = "TP_Border_Default"
db.settings.healthbar.texture = "ThreatPlatesBar"
db.settings.healthbar.backdrop = "ThreatPlatesEmpty"
db.settings.healthbar.BackgroundOpacity = 1
db.settings.castborder.texture = "TP_CastBarOverlay"
db.settings.castbar.texture = "ThreatPlatesBar"
db.settings.name.typeface = "Accidental Presidency"
db.settings.name.width = 116
db.settings.name.size = 14
db.settings.level.typeface = "Accidental Presidency"
db.settings.level.size = 12
db.settings.level.height = 14
db.settings.level.x = 50
db.settings.level.vertical = "TOP"
db.settings.customtext.typeface = "Accidental Presidency"
db.settings.customtext.size = 12
db.settings.customtext.y = 1
db.settings.spelltext.typeface = "Accidental Presidency"
db.settings.spelltext.size = 12
db.settings.spelltext.y = -13
db.settings.spelltext.y_hv = -13
db.settings.eliteicon.x = 64
db.settings.eliteicon.y = 9
db.settings.skullicon.x = 55
db.settings.raidicon.y = 27
db.threat.dps.HIGH = 1.25
db.threat.tank.LOW = 1.25
return new_defaults
end
local function SwitchToDefaultSettingsV1()
local db = TidyPlatesThreat.db
local current_profile = db:GetCurrentProfile()
db:SetProfile("_ThreatPlatesInternal")
local defaults = ThreatPlates.GetDefaultSettingsV1(ThreatPlates.DEFAULT_SETTINGS)
db:RegisterDefaults(defaults)
db:SetProfile(current_profile)
db:DeleteProfile("_ThreatPlatesInternal")
end
local function SwitchToCurrentDefaultSettings()
local db = TidyPlatesThreat.db
local current_profile = db:GetCurrentProfile()
db:SetProfile("_ThreatPlatesInternal")
db:RegisterDefaults(ThreatPlates.DEFAULT_SETTINGS)
db:SetProfile(current_profile)
db:DeleteProfile("_ThreatPlatesInternal")
end
-- The version number must have a pattern like a.b.c; the rest of string (e.g., "Beta1" is ignored)
-- everything else (e.g., older version numbers) is set to 0
local function VersionToNumber(version)
-- local len, v1, v2, v3, v4
-- _, len, v1, v2 = version:find("(%d+)%.(%d+)")
-- if len then
-- version = version:sub(len + 1)
-- _, len, v3 = version:find("%.(%d+)")
-- if len then
-- version = version:sub(len + 1)
-- _, len, v4 = version:find("%.(%d+)")
-- end
-- end
--
-- return floor(v1 * 1e9 + v2 * 1e6 + v3 * 1e3 + v4)
local v1, v2, v3 = version:match("(%d+)%.(%d+)%.(%d+)")
v1, v2, v3 = v1 or 0, v2 or 0, v3 or 0
return floor(v1 * 1e6 + v2 * 1e3 + v3)
end
local function CurrentVersionIsOlderThan(current_version, max_version)
return VersionToNumber(current_version) < VersionToNumber(max_version)
end
local function DatabaseEntryExists(db, keys)
for index = 1, #keys do
db = db[keys[index]]
if db == nil then
return false
end
end
return true
end
local function DatabaseEntryDelete(db, keys)
for index = 1, #keys - 1 do
db = db[keys[index]]
if not db then
return
end
end
db[keys[#keys]] = nil
end
local function MigrateNamesColor(profile_name, profile)
local entry = {"settings", "name", "color"}
local old_color = { r = 1, g = 1, b = 1 }
if DatabaseEntryExists(profile, entry) then
local db = profile.settings.name
local color = db.color
color.r = color.r or old_color.r
color.g = color.g or old_color.g
color.b = color.b or old_color.b
db.EnemyTextColor = ThreatPlates.CopyTable(color)
db.FriendlyTextColor = ThreatPlates.CopyTable(color)
DatabaseEntryDelete(profile, entry)
end
end
local function MigrationBlizzFadeA(profile_name, profile)
local entry = {"blizzFadeA" }
if DatabaseEntryExists(profile, entry) then
profile.nameplate = profile.nameplate or {}
-- default for blizzFadeA.toggle was true
if profile.blizzFadeA.toggle ~= nil then
profile.nameplate.toggle = profile.nameplate.toggle or {}
profile.nameplate.toggle.NonTargetA = profile.blizzFadeA.toggle
end
-- default for blizzFadeA.amount was -0.3
if profile.blizzFadeA.amount ~= nil then
profile.nameplate.alpha = profile.nameplate.alpha or {}
local db = profile.nameplate.alpha
local amount = profile.blizzFadeA.amount
if amount <= 0 then
db.NonTarget = min(1, 1 + amount)
end
end
DatabaseEntryDelete(profile, entry)
end
end
local function MigrationTargetScale(profile_name, profile)
if DatabaseEntryExists(profile, { "nameplate", "scale", "Target" }) then
profile.nameplate.scale.Target = profile.nameplate.scale.Target - 1
end
if DatabaseEntryExists(profile, { "nameplate", "scale", "NoTarget" }) then
profile.nameplate.scale.NoTarget = profile.nameplate.scale.NoTarget - 1
end
end
local function MigrateCustomTextShow(profile_name, profile)
local entry = {"settings", "customtext", "show"}
-- default for db.show was true
if DatabaseEntryExists(profile, entry) then
local db = profile.settings.customtext
db.FriendlySubtext = "NONE"
db.EnemySubtext = "NONE"
DatabaseEntryDelete(profile, entry)
end
end
local function MigrateCastbarColoring(profile_name, profile)
-- default for castbarColor.toggle was true
local entry = { "castbarColor", "toggle" }
if DatabaseEntryExists(profile, entry) and profile.castbarColor.toggle == false then
profile.castbarColor = RGB(255, 255, 0, 1)
profile.castbarColorShield = RGB(255, 255, 0, 1)
DatabaseEntryDelete(profile, entry)
DatabaseEntryDelete(profile, { "castbarColorShield", "toggle" })
end
-- default for castbarColorShield.toggle was true
local entry = { "castbarColorShield", "toggle" }
if DatabaseEntryExists(profile, entry) and profile.castbarColorShield.toggle == false then
profile.castbarColorShield = profile.castbarColor or { r = 1, g = 0.56, b = 0.06, a = 1 }
DatabaseEntryDelete(profile, entry)
end
end
local function MigrationTotemSettings(profile_name, profile)
local entry = { "totemSettings" }
if DatabaseEntryExists(profile, entry) then
for key, value in pairs(profile.totemSettings) do
if type(value) == "table" then -- omit hideHealthbar setting and skip if new default totem settings
value.Style = value[7] or profile.totemSettings[key].Style
value.Color = value.color or profile.totemSettings[key].Color
if value[1] == false then
value.ShowNameplate = false
end
if value[2] == false then
value.ShowHPColor = false
end
if value[3] == false then
value.ShowIcon = false
end
value[7] = nil
value.color = nil
value[1] = nil
value[2] = nil
value[3] = nil
end
end
end
end
local function MigrateBorderTextures(profile_name, profile)
if DatabaseEntryExists(profile, { "settings", "elitehealthborder", "texture" } ) then
if profile.settings.elitehealthborder.texture == "TP_HealthBarEliteOverlay" then
profile.settings.elitehealthborder.texture = "TP_EliteBorder_Default"
else -- TP_HealthBarEliteOverlayThin
profile.settings.elitehealthborder.texture = "TP_EliteBorder_Thin"
end
end
if DatabaseEntryExists(profile, { "settings", "healthborder", "texture" } ) then
if profile.settings.healthborder.texture == "TP_HealthBarOverlay" then
profile.settings.healthborder.texture = "TP_Border_Default"
else -- TP_HealthBarOverlayThin
profile.settings.healthborder.texture = "TP_Border_Thin"
end
end
if DatabaseEntryExists(profile, { "settings", "castborder", "texture" } ) then
if profile.settings.castborder.texture == "TP_CastBarOverlay" then
profile.settings.castborder.texture = "TP_Castbar_Border_Default"
else -- TP_CastBarOverlayThin
profile.settings.castborder.texture = "TP_Castbar_Border_Thin"
end
end
end
local function MigrationAurasSettings(profile_name, profile)
if DatabaseEntryExists(profile, { "AuraWidget" } ) then
profile.AuraWidget.Debuffs = profile.AuraWidget.Debuffs or {}
profile.AuraWidget.Buffs = profile.AuraWidget.Buffs or {}
profile.AuraWidget.CrowdControl = profile.AuraWidget.CrowdControl or {}
if DatabaseEntryExists(profile, { "AuraWidget", "ShowDebuffsOnFriendly", } ) and profile.AuraWidget.ShowDebuffsOnFriendly then
profile.AuraWidget.Debuffs.ShowFriendly = true
end
DatabaseEntryDelete(profile, { "AuraWidget", "ShowDebuffsOnFriendly", } )
-- Don't migration FilterByType, does not make sense
DatabaseEntryDelete(profile, { "AuraWidget", "FilterByType", } )
if DatabaseEntryExists(profile, { "AuraWidget", "ShowFriendly", } ) and not profile.AuraWidget.ShowFriendly then
profile.AuraWidget.Debuffs.ShowFriendly = false
profile.AuraWidget.Buffs.ShowFriendly = false
profile.AuraWidget.CrowdControl.ShowFriendly = false
DatabaseEntryDelete(profile, { "AuraWidget", "ShowFriendly", } )
end
if DatabaseEntryExists(profile, { "AuraWidget", "ShowEnemy", } ) and not profile.AuraWidget.ShowEnemy then
profile.AuraWidget.Debuffs.ShowEnemy = false
profile.AuraWidget.Buffs.ShowEnemy = false
profile.AuraWidget.CrowdControl.ShowEnemy = false
DatabaseEntryDelete(profile, { "AuraWidget", "ShowEnemy", } )
end
if DatabaseEntryExists(profile, { "AuraWidget", "FilterBySpell", } ) then
profile.AuraWidget.Debuffs.FilterBySpell = profile.AuraWidget.FilterBySpell
DatabaseEntryDelete(profile, { "AuraWidget", "FilterBySpell", } )
end
if DatabaseEntryExists(profile, { "AuraWidget", "FilterMode", } ) then
if profile.AuraWidget.FilterMode == "BLIZZARD" then
profile.AuraWidget.Debuffs.FilterMode = "blacklist"
profile.AuraWidget.Debuffs.ShowAllEnemy = false
profile.AuraWidget.Debuffs.ShowOnlyMine = false
profile.AuraWidget.Debuffs.ShowBlizzardForEnemy = true
else
profile.AuraWidget.Debuffs.FilterMode = profile.AuraWidget.FilterMode:gsub("Mine", "")
end
DatabaseEntryDelete(profile, { "AuraWidget", "FilterMode", } )
end
if DatabaseEntryExists(profile, { "AuraWidget", "scale", } ) then
profile.AuraWidget.Debuffs.Scale = profile.AuraWidget.scale
DatabaseEntryDelete(profile, { "AuraWidget", "scale", } )
end
end
end
local function MigrationAurasSettingsFix(profile_name, profile)
if DatabaseEntryExists(profile, { "AuraWidget", "Debuffs", "FilterMode", } ) and profile.AuraWidget.Debuffs.FilterMode == "BLIZZARD" then
profile.AuraWidget.Debuffs.FilterMode = "blacklist"
profile.AuraWidget.Debuffs.ShowAllEnemy = false
profile.AuraWidget.Debuffs.ShowOnlyMine = false
profile.AuraWidget.Debuffs.ShowBlizzardForEnemy = true
end
if DatabaseEntryExists(profile, { "AuraWidget", "Buffs", "FilterMode", } ) and profile.AuraWidget.Buffs.FilterMode == "BLIZZARD" then
profile.AuraWidget.Buffs.FilterMode = "blacklist"
end
if DatabaseEntryExists(profile, { "AuraWidget", "CrowdControl", "FilterMode", } ) and profile.AuraWidget.CrowdControl.FilterMode == "BLIZZARD" then
profile.AuraWidget.CrowdControl.FilterMode = "blacklist"
end
end
local function MigrateAuraWidget(profile_name, profile)
if DatabaseEntryExists(profile, { "debuffWidget" }) then
if not profile.AuraWidget.ON and not profile.AuraWidget.ShowInHeadlineView then
profile.AuraWidget = profile.AuraWidget or {}
profile.AuraWidget.ModeIcon = profile.AuraWidget.ModeIcon or {}
local default_profile = ThreatPlates.DEFAULT_SETTINGS.profile.AuraWidget
profile.AuraWidget.FilterMode = profile.debuffWidget.mode or default_profile.FilterMode
profile.AuraWidget.ModeIcon.Style = profile.debuffWidget.style or default_profile.ModeIcon.Style
profile.AuraWidget.ShowTargetOnly = profile.debuffWidget.targetOnly or default_profile.ShowTargetOnly
profile.AuraWidget.ShowCooldownSpiral = profile.debuffWidget.cooldownSpiral or default_profile.ShowCooldownSpiral
profile.AuraWidget.ShowFriendly = profile.debuffWidget.showFriendly or default_profile.ShowFriendly
profile.AuraWidget.ShowEnemy = profile.debuffWidget.showEnemy or default_profile.ShowEnemy
profile.AuraWidget.scale = profile.debuffWidget.scale or default_profile.scale
if profile.debuffWidget.displays then
profile.AuraWidget.FilterByType = ThreatPlates.CopyTable(profile.debuffWidget.displays)
end
if profile.debuffWidget.filter then
profile.AuraWidget.FilterBySpell = ThreatPlates.CopyTable(profile.debuffWidget.filter)
end
-- DatabaseEntryDelete(profile, { "debuffWidget" }) -- TODO
end
end
end
local function MigrationForceFriendlyInCombat(profile_name, profile)
if DatabaseEntryExists(profile, { "HeadlineView" }) then
if profile.HeadlineView.ForceFriendlyInCombat == true then
profile.HeadlineView.ForceFriendlyInCombat = "NAME"
elseif profile.HeadlineView.ForceFriendlyInCombat == false then
profile.HeadlineView.ForceFriendlyInCombat = "NONE"
end
end
end
local function SetValueOrDefault(old_value, default_value)
if old_value ~= nil then
return old_value
else
return default_value
end
end
local function MigrationComboPointsWidget(profile_name, profile)
if DatabaseEntryExists(profile, { "comboWidget" }) then
profile.ComboPoints = profile.ComboPoints or {}
local default_profile = ThreatPlates.DEFAULT_SETTINGS.profile.ComboPoints
profile.ComboPoints.ON = SetValueOrDefault(profile.comboWidget.ON, default_profile.ON)
profile.ComboPoints.Scale = SetValueOrDefault(profile.comboWidget.scale, default_profile.Scale)
profile.ComboPoints.x = SetValueOrDefault(profile.comboWidget.x, default_profile.x)
profile.ComboPoints.y = SetValueOrDefault(profile.comboWidget.y, default_profile.y)
profile.ComboPoints.x_hv = SetValueOrDefault(profile.comboWidget.x_hv, default_profile.x_hv)
profile.ComboPoints.y_hv = SetValueOrDefault(profile.comboWidget.y_hv, default_profile.y_hv)
profile.ComboPoints.ShowInHeadlineView = SetValueOrDefault(profile.comboWidget.ShowInHeadlineView, default_profile.ShowInHeadlineView)
DatabaseEntryDelete(profile, { "comboWidget" })
end
end
local function MigrationThreatDetection(profile_name, profile)
if DatabaseEntryExists(profile, { "threat", "nonCombat" }) then
local default_profile = ThreatPlates.DEFAULT_SETTINGS.profile.threat
profile.threat.UseThreatTable = SetValueOrDefault(profile.threat.nonCombat, default_profile.UseThreatTable)
--DatabaseEntryDelete(profile, { "threat", "nonCombat" })
end
end
---- Settings in the SavedVariables file that should be migrated and/or deleted
local DEPRECATED_SETTINGS = {
-- NamesColor = { MigrateNamesColor, }, -- settings.name.color
-- CustomTextShow = { MigrateCustomTextShow, }, -- settings.customtext.show
-- BlizzFadeA = { MigrationBlizzFadeA, }, -- blizzFadeA.toggle and blizzFadeA.amount
-- TargetScale = { MigrationTargetScale, "8.5.0" }, -- nameplate.scale.Target/NoTarget
-- --AuraWidget = { MigrateAuraWidget, "8.6.0" }, -- disabled until someone requests it
-- AlphaFeatures = { "alphaFeatures" },
-- AlphaFeatureHeadlineView = { "alphaFeatureHeadlineView" },
-- AlphaFeatureAuraWidget2= { "alphaFeatureAuraWidget2" },
-- AlphaFriendlyNameOnly = { "alphaFriendlyNameOnly" },
-- HVBlizzFarding = { "HeadlineView", "blizzFading" }, -- (removed in 8.5.1)
-- HVBlizzFadingAlpha = { "HeadlineView", "blizzFadingAlpha"}, -- (removed in 8.5.1)
-- HVNameWidth = { "HeadlineView", "name", "width" }, -- (removed in 8.5.0)
-- HVNameHeight = { "HeadlineView", "name", "height" }, -- (removed in 8.5.0)
DebuffWidget = { "debuffWidget" }, -- (removed in 8.6.0)
OldSettings = { "OldSettings" }, -- (removed in 8.7.0)
CastbarColoring = { MigrateCastbarColoring }, -- (removed in 8.7.0)
TotemSettings = { MigrationTotemSettings, "8.7.0" }, -- (changed in 8.7.0)
Borders = { MigrateBorderTextures, "8.7.0" }, -- (changed in 8.7.0)
UniqueSettingsList = { "uniqueSettings", "list" }, -- (removed in 8.7.0, cleanup added in 8.7.1)
Auras = { MigrationAurasSettings, "9.0.0" }, -- (changed in 9.0.0)
AurasFix = { MigrationAurasSettingsFix }, -- (changed in 9.0.4 and 9.0.9)
MigrationComboPointsWidget = { MigrationComboPointsWidget, "9.1.0" }, -- (changed in 9.1.0)
ForceFriendlyInCombatEx = { MigrationForceFriendlyInCombat }, -- (changed in 9.1.0)
HeadlineViewEnableToggle = { "HeadlineView", "ON" }, -- (removed in 9.1.0)
ThreatDetection = { MigrationThreatDetection, "9.1.3" }, -- (changed in 9.1.0)
-- hideNonCombat = { "threat", "hideNonCombat" }, -- (removed in ...)
-- nonCombat = { "threat", "nonCombat" }, -- (removed in 9.1.0)
}
local function MigrateDatabase(current_version)
TidyPlatesThreat.db.global.MigrationLog = nil
--TidyPlatesThreat.db.global.MigrationLog = {}
local profile_table = TidyPlatesThreat.db.profiles
for key, entry in pairs(DEPRECATED_SETTINGS) do
local action = entry[1]
if type(action) == "function" then
local max_version = entry[2]
if not max_version or CurrentVersionIsOlderThan(current_version, max_version) then
-- iterate over all profiles and migrate values
--TidyPlatesThreat.db.global.MigrationLog[key] = "Migration" .. (max_version and ( " because " .. current_version .. " < " .. max_version) or "")
for profile_name, profile in pairs(profile_table) do
action(profile_name, profile)
end
end
else
-- iterate over all profiles and delete the old config entry
--TidyPlatesThreat.db.global.MigrationLog[key] = "DELETED"
for profile_name, profile in pairs(profile_table) do
DatabaseEntryDelete(profile, entry)
end
end
end
end
Addon.MigrateDatabase = MigrateDatabase
-----------------------------------------------------
-- External
-----------------------------------------------------
ThreatPlates.GetDefaultSettingsV1 = GetDefaultSettingsV1
ThreatPlates.SwitchToCurrentDefaultSettings = SwitchToCurrentDefaultSettings
ThreatPlates.SwitchToDefaultSettingsV1 = SwitchToDefaultSettingsV1
ThreatPlates.MigrateDatabase = MigrateDatabase
ThreatPlates.GetUnitVisibility = GetUnitVisibility
ThreatPlates.SetNamePlateClickThrough = SetNamePlateClickThrough
|
local class = require 'ext.class'
local real = require 'hydro.real'
local GridSolver = require 'hydro.solver.gridsolver'
local NavierStokesIncompressible = class(GridSolver)
NavierStokesIncompressible.name = 'NavierStokesIncompressible'
NavierStokesIncompressible.eqnName = 'navstokes-incomp'
function NavierStokesIncompressible:createBuffers()
NavierStokesIncompressible.super.createBuffers(self)
self:clalloc('UNextBuf', self.eqn.symbols.cons_t, self.numCells)
self:clalloc('divBuf', self.app.real, self.numCells)
self:clalloc('PBuf', self.app.real, self.numCells)
end
function NavierStokesIncompressible:getSolverCode()
error'TODO convert this to initCodeModules'
return table{
NavierStokesIncompressible.super.getSolverCode(self),
template(file['hydro/solver/navstokes-incomp.cl'], {solver=self, eqn=self.eqn}),
}:concat'\n'
end
function NavierStokesIncompressible:refreshSolverProgram()
NavierStokesIncompressible.super.refreshSolverProgram(self)
self.diffuseKernelObj = self.solverProgramObj:kernel{name='diffuse', args={self.UNextBuf, self.UBuf}, domain=self.domainWithoutBorder}
self.advectKernelObj = self.solverProgramObj:kernel{name='advect', args={self.UNextBuf, self.UBuf}, domain=self.domainWithoutBorder}
self.calcDivKernelObj = self.solverProgramObj:kernel{name='calcDiv', args={self.divBuf, self.UBuf}, domain=self.domainWithoutBorder}
self.diffusePressureKernelObj = self.solverProgramObj:kernel{name='diffusePressure', args={self.PBuf, self.divBuf}, domain=self.domainWithoutBorder}
self.projectKernelObj = self.solverProgramObj:kernel{name='project', args={self.UBuf, self.PBuf}, domain=self.domainWithoutBorder}
end
function NavierStokesIncompressible:refreshCalcDTKernel() end
function NavierStokesIncompressible:calcDT() return self.fixedDT end
-- TODO options for other solvers?
NavierStokesIncompressible.numJacobiSteps = 20
function NavierStokesIncompressible:project()
self.calcDivKernelObj()
for i=1,self.numJacobiSteps do
self.diffusePressureKernelObj()
end
self.projectKernelObj()
end
function NavierStokesIncompressible:step(dt)
local bufferSize = self.numCells * ffi.sizeof(self.eqn.symbols.cons_t)
self.diffuseKernelObj.obj:setArg(2, real(dt))
-- diffuse
for i=1,self.numJacobiSteps do
self.diffuseKernelObj()
self.cmds:enqueueCopyBuffer{src=self.UNextBuf, dst=self.UBuf, size=bufferSize}
end
self:project()
self.advectKernel()
self:project()
end
return NavierStokesIncompressible
|
#!/usr/bin/env lua
-- coroutine_test.lua 文件
co = coroutine.create(
function(i)
print(i);
end
)
coroutine.resume(co, 1) -- 1
print(coroutine.status(co)) -- dead
print("----------")
co = coroutine.wrap(
function(i)
print(i);
end
)
co(1)
print("----------")
co2 = coroutine.create(
function()
for i=1,10 do
print(i)
if i == 3 then
print(coroutine.status(co2)) --running
print(coroutine.running()) --thread:XXXXXX
end
coroutine.yield()
end
end
)
coroutine.resume(co2) --1
coroutine.resume(co2) --2
coroutine.resume(co2) --3
print(coroutine.status(co2)) -- suspended
print(coroutine.running())
print("----------")
function foo (a)
print("foo 函数输出", a)
return coroutine.yield(2 * a) -- 返回 2*a 的值
end
co = coroutine.create(function (a , b)
print("第一次协同程序执行输出", a, b) -- co-body 1 10
local r = foo(a + 1)
print("第二次协同程序执行输出", r)
local r, s = coroutine.yield(a + b, a - b) -- a,b的值为第一次调用协同程序时传入
print("第三次协同程序执行输出", r, s)
return b, "结束协同程序" -- b的值为第二次调用协同程序时传入
end)
print("main", coroutine.resume(co, 1, 10)) -- true, 4
print("--分割线----")
print("main", coroutine.resume(co, "r")) -- true 11 -9
print("---分割线---")
print("main", coroutine.resume(co, "x", "y")) -- true 10 end
print("---分割线---")
print("main", coroutine.resume(co, "x", "y")) -- cannot resume dead coroutine
print("---分割线---")
|
--Type => SubSystem
--Type => SubSystem
--ThingToBuild => name of subsystem to build
--RequiredResearch => global research dependencies
--RequiredShipSubSystems => subsystems dependencies for local to the ship
--RequiredFleetSubSystems => Fleet wide subsystem dependencies
--DisplayPriority => Order in UI lists
--DisplayedName => Localized name for UI
--Description => Description for UI
Ship = 0
SubSystem = 1
--Ship = "Ship"
--SubSystem = "SubSystem"
build = {}
bld_index = 1
dofilepath("data:scripts/utilfunc.lua")
dofilepath("data:scripts/techfunc.lua")
doscanpath("data:Scripts/Races/Vaygr/Scripts/Build", "*.lua")
doscanpath("data:Scripts/Productiontimes", "applybuildtimes.lua")
print("HWCE: Vaygr bld_index = " .. bld_index)
PrintBuild()
|
-- RFC 6265
local lpeg = require "lpeg"
local core = require "lpeg_patterns.core"
local http_core = require "lpeg_patterns.http.core"
local C = lpeg.C
local Cc = lpeg.Cc
local Cf = lpeg.Cf
local Cg = lpeg.Cg
local Ct = lpeg.Ct
local P = lpeg.P
local R = lpeg.R
local S = lpeg.S
local cookie_name = http_core.token
local cookie_octet = S"!" + R("\35\43", "\45\58", "\60\91", "\93\126")
local cookie_value = core.DQUOTE * C(cookie_octet^0) * core.DQUOTE + C(cookie_octet^0)
local cookie_pair = cookie_name * http_core.BWS * P"=" * http_core.BWS * cookie_value * http_core.BWS
local ext_char = core.CHAR - core.CTL - S";"
ext_char = ext_char - core.WSP + core.WSP * #(core.WSP^0 * ext_char) -- No trailing whitespace
-- Complexity is to make sure whitespace before an `=` isn't captured
local extension_av = ((ext_char - S"=" - core.WSP) + core.WSP^1 * #(1-S"="))^0 / string.lower
* http_core.BWS * P"=" * http_core.BWS * C(ext_char^0)
+ (ext_char)^0 / string.lower * Cc(true)
local cookie_av = extension_av
local set_cookie_string = cookie_pair * Cf(Ct(true) * (P";" * http_core.OWS * Cg(cookie_av))^0, rawset)
local Set_Cookie = set_cookie_string
local cookie_string = Cf(Ct(true) * Cg(cookie_pair) * (P";" * http_core.OWS * Cg(cookie_pair))^0, rawset)
local Cookie = cookie_string
return {
Cookie = Cookie;
Set_Cookie = Set_Cookie;
}
|
-- rtp_interface.lua
-- Manages loading RTP interface files for panels. Interface files use XML and are usually
-- saved by the Layout Editor tool, however they can be hand-generated for small projects.
-- Currently there should only be one Interface object in an application.
-------------------------------------------------------------------------------
-- $Id: //depot/bin/RTPShell4/scripts/class/rtp_interface_2.lua#47 $
-- $Date: 2014/05/22 $
-- $Change: 47580 $
-- $Author: Bzysberg $
-------------------------------------------------------------------------------
require "xml_parser"
require "psd_parser"
---- Globals ------------------------------------------------------------------
local Class_Data =
{
name = "Interface",
super = "Object",
script = "rtp_interface_2.lua",
omitFromToolbox = true,
-- TODO: Set this to a brief description of your class, this gets shown in a tooltip or status-bar control when your class is selected in layout editor.
description = "User Interface manager containing definitions of all controls and screens for an application.",
properties =
{
{ name="FileName", datatype="string", default="none", description="XML file name from which this interface is created", edit={ group="Interface", }, },
{ name="Name", datatype="string", default="Interface1", description="Name of this interface class", edit={ group="Interface", }, },
{ name="ForceUniqueNames", datatype="boolean", default=true, description="Whether or not to append the interface name to the name of each panel to force them to be unique.", edit={ visible=false } },
{ name="Size", datatype="vector2", default={x=0, y=0}, description="Size of this interface, defaults to zero size which means use the InterfaceSize field of Applicaton class (for backwards compatibility).", edit={ group="Interface", }, },
{ name="ScaleToFit", datatype="boolean", default=true, description="Whether or not this interface auto-scales to fit the presenter size.", edit={ group="Interface", }, },
{ name="StartScreen", datatype="string", default="none", description="XML screen node that is the screen to display by default.", edit={ group="Interface", }, },
},
}
local Class_PrivateData =
{
-- Styles: A style is a set of properties for a specific class that just override the defaults for whatever control is using it.
styles = {}, -- array (use ipairs on this)
stylesByName = {}, -- key = style name, value = index into styles[]
-- Controls: A control is an instance of a class derived from Object, when serializing we save only the properties of the class that
-- differ from the default values for that class.
controls = {}, -- array (use ipairs on this)
controlsByName = {}, -- key = control name, value = control
controlsByType = {}, -- key = control Class name, value = table of controls
-- Screens: A screen specifies which controls are visible with optional property overrides for each control, kinda like a layer comp in a PSD file.
screens = {}, -- array (use ipairs on this)
screensByName = {}, -- key = screen name, value = screen
}
PreRegisterClass(Class_Data, Class_PrivateData)
local SuperClass = _G[Class_Data.super] or {}
_G[Class_Data.super] = SuperClass
---- PostInit -----------------------------------------------------------------
-- This loads the XML file if one was specified in the constructor arguments.
function Interface:PostInit()
SuperClass.PostInit(self)
local fname = self:GetFileName()
if fname ~= "none" then
-- FileName must be in the asset path
local fullPath = AssetLib.GetFilePath(fname)
self:LoadXML(fullPath)
end
end
---- ImportPSD ----------------------------------------------------------------
-- * filename - string - Name of the PSD file to load (full path name)
-- * imgSavePath - string - Optional - Name of the folder to save PNG images to, if not given PNG images will not be saved.
-- This function parses a PSD file and merges its contents into this interface. Should only be used by
-- the Layout Editor tool.
function Interface:ImportPSD(filename, imgSavePath)
ParsePSD(filename, self, imgSavePath)
end
---- LoadXML ------------------------------------------------------------------
-- * filename - string - Name of the XML file to load (full path name)
-- * rootPanel - Panel to which all top-level controls defined in the interface will be added to, this is required.
-- * postLoadCallback - function - Optional - Function to call after the XML has been loaded into Lua tables (but before it has been processed).
-- Loads the given XML file into this interface. The XML defines controls and screens that the interface
-- will display.
function Interface:LoadXML(filename, rootPanel, postLoadCallback)
printf("LoadXMLInterface %s",filename)
--collectgarbage("collect")
local asset_path, fn = SplitPathAndName(filename)
-- Show progress dialog in Layout Editor tool
if gIsLayoutEditor then
-- Last param means user can't cancel (maybe eventually...)
ShowProgressDialog(string.format("Loading Interface '%s'", fn), "Parsing XML...", false)
end
local xml = XmlParser:ParseXmlFile(filename)
local iface = nil
-- Parsing XML Stage: 25% = XML loaded, 50% = Styles parsed, 75% = Controls parsed, 99% = Screens parsed
UpdateProgressDialog(nil, 25)
if xml then
-- Parse XML into Lua Tables (organized into tables similar to Class_PrivateData above)
iface = self:GetInterfaceFromXML( xml, rootPanel )
else
printf("Interface.LoadXML: Error parsing file: %s", filename)
end
if postLoadCallback then
-- Caller can use this to perform extra validation on XML before interface gets initialized with it.
-- Return true to reject the entire interface, or make corrections by editing the first parameter in place.
if postLoadCallback(self, iface, xml) then
iface = nil
end
end
if iface then
-- Create actual class objects from the interface info we loaded
self:InitializeComponents(iface, rootPanel)
-- Now that we've successfully loaded the interface, change the FileName property.
local asset_path, fn = SplitPathAndName(filename)
self:SetFileName( fn )
return true
end
printf("Interface.LoadXML: Error initializing components!")
UpdateProgressDialog(nil, 100) -- close the progress dialog on error!
return false
end
---- InitializeComponents -----------------------------------------------------
-- * iface - Lua tables loaded from XML containing info about the interface.
-- Creates class instances of controls defined in the interface. This should be made into a private helper function.
function Interface:InitializeComponents(iface, root)
--Load styles
if iface.styles then
UpdateProgressDialog("Creating Styles...", 1)
local count = #iface.styles
for i,style in ipairs(iface.styles) do
-- Convert strings to proper value types for various options (Style nodes need to have ClassName property to indicate the class of the UI element it describes)
TypeConvertProperties(style)
-- Styles contain options for a specific class but do not have an instance created for them, used for CSS style
-- behavior of defining options that can be applied to various controls.
self:AddStyle(style)
UpdateProgressDialog( nil, math.floor(99 * (i/count)) )
end
end
--Create controls used within this interface
if iface.controls then
UpdateProgressDialog("Creating Controls...", 1)
local count = #iface.controls
for i,ctrl in ipairs(iface.controls) do
-- Convert strings to proper value types for various options
TypeConvertProperties(ctrl)
local styleName = ctrl.Style
if styleName and styleName ~= "none" then
local style = self.stylesByName[styleName]
if style then
-- Merge the style info into this control properties, without overwriting any however as the control properties override the style.
table.merge(ctrl, style, false)
end
end
local c = CreateClassInstance(ctrl.ClassName, ctrl)
if c then
self:AddControl( c )
end
UpdateProgressDialog( nil, math.floor(99 * (i/count)) )
end
end
-- Post load pass for panels that need to initialize their children
for _,ctrl in ipairs(self.controls) do
ctrl:PostLoad()
end
UpdateProgressDialog( "Creating Screens...", 1 )
-- Load interface screens
local start_screen = nil
-- The "<default>" screen is always created first, this holds the default state of the controls (always!)
local screen = CreateScreen( { Name="<default>" } )
if gIsLayoutEditor then
root = Panel_FindByName("LayoutDoc")
end
if root then
screen:SetEntry(root, nil, true, true)
self.rootPanel = root
end
self:AddScreen(screen)
if iface.screens then
local count = #iface.screens
for i=1,count do
local screeninfo = iface.screens[i]
screeninfo.ClassName = "Screen"
TypeConvertProperties(screeninfo)
screeninfo.ClassName = nil
screen = CreateScreen( screeninfo )
-- Set the state for each control to the state used in the screen.
local nentries = #screeninfo.Entries
for j=1,nentries do
local entry = screeninfo.Entries[j]
local panel = Panel_FindByName(entry.Name)
if panel then
entry.ClassName = panel.ClassName
TypeConvertProperties(entry)
entry.ClassName = nil
screen:SetEntry( panel, entry )
--printf("Added Entry: %i", iEntry)
elseif screen:GetDelayBinding() then
-- Add an entry to the screen by name (not requiring the panel, for delayed binding screens)
screen:SetEntry( entry.Name, entry )
else
printf("Invalid Entry: Panel '%s' not found! (from screen '%s')", tostring(entry.Name), screen:GetName())
end
end
self:AddScreen(screen)
if self:GetStartScreen() == screen:GetName() then
start_screen = screen
end
UpdateProgressDialog( nil, math.floor(99 * (i/count)) )
end
end
-- Default to first screen if none of them are set as the starting screen
if not start_screen then
start_screen = self.screens[2]
end
if start_screen then
self:SetScreen( start_screen:GetName() )
end
-- Presumably setting the value to 100% will hide the progress dialog since it's finished now
UpdateProgressDialog(nil, 100)
collectgarbage("collect")
end
---- DoDelayedBinding ---------------------------------------------------------
-- Perform initialization for screens whose panels did not exist at load-time. This should be removed since screens
-- no longer require their panels to exist when they are created.
function Interface:DoDelayedBinding( filename )
-- Screens already exist but we need to lookup the panels for each entry and convert values to the correct datatypes instead of XML strings.
for _,screen in ipairs(self.screens) do
if screen:GetDelayBinding() then
for i,entry in ipairs(screen.Entries) do
local panel = Panel_FindByName(entry.Name)
if panel then
entry.ClassName = panel.ClassName
TypeConvertProperties(entry)
entry.ClassName = nil
screen:SetEntry(entry.Name, entry)
end
end
end
end
end
---- GetInterfaceFromXML ------------------------------------------------------
-- * root - table - Root of the raw XML that was loaded.
-- * rootPanel - The root panel to which top-level controls will be added.
-- Converts table given by XMLParser script into an interface table. This should be a private helper function.
function Interface:GetInterfaceFromXML(root, rootPanel)
local iface={}
local rootName = nil
if rootPanel then
rootName = rootPanel:GetName()
end
-- Allow Interface root tag to contain attributes that get set on the interface object.
if root.Attributes then
local iface_props = { ClassName="Interface", }
for attr,value in pairs(root.Attributes) do
iface_props[attr]=value
end
TypeConvertProperties(iface_props)
self:SetInfo(iface_props)
end
for _,xmlNode in pairs(root.ChildNodes) do
-- Load styles
if(xmlNode.Name=="Styles") then
if iface.styles==nil then
iface.styles={}
end
self:LoadStyles(xmlNode, iface.styles)
end
-- Load controls
if(xmlNode.Name=="Controls") then
if iface.controls==nil then
iface.controls={}
end
-- LoadControls is recursive, so it'd be hard to keep a consistent percentage of completeness without first traversing the whole thing to get a combined count.
-- We'll just update the progress bar as the top-level controls get parsed instead.
local count = #xmlNode.ChildNodes
for i,ctrlNode in pairs(xmlNode.ChildNodes) do
self:LoadControls(ctrlNode,rootName,iface.controls)
UpdateProgressDialog( nil, 50 + math.floor(25 * (i/count)) )
end
end
-- Load screens
if(xmlNode.Name=="Screens") then
if iface.screens==nil then
iface.screens={}
end
local count = #xmlNode.ChildNodes
for i,screenNode in pairs(xmlNode.ChildNodes) do
self:LoadScreen(screenNode,iface.screens)
UpdateProgressDialog( nil, 75 + math.floor(24 * (i/count)) )
end
end
end
if self:GetScaleToFit() and rootPanel then
local rootSizeX, rootSizeY = rootPanel:GetSize()
local isize = self:GetSize()
-- If Size=(0,0) then default to interface size defined by the application.
if isize.x == 0 and isize.y == 0 then
if gRtpApplication then
isize = gRtpApplication:GetInterfaceSize()
self:SetSize(isize)
end
end
if isize.x ~= 0 and isize.y ~= 0 then
local scaleX = rootSizeX / self.Size.x
local scaleY = rootSizeY / self.Size.y
-- TODO: Change Scale to a vector2 type so we can support non-uniform scale, for now just use whichever is the smaller of the two and center
-- on the other axis.
if scaleX < scaleY then
rootPanel:SetScale(scaleX)
local scaledH = scaleX * self.Size.y
local posY = (rootSizeY - scaledH) / 2
rootPanel:SetPosition( {x=0, y=posY} )
elseif scaleX > scaleY then
rootPanel:SetScale( scaleY )
local scaledW = scaleY * self.Size.x
local posX = (rootSizeX - scaledW) / 2
rootPanel:SetPosition( {x=posX, y=0} )
else
-- Even scale!
rootPanel:SetScale( scaleX )
end
end
end
return iface
end
---- CreateControl ------------------------------------------------------------
-- * info - table - Info about the control to create (key/value table containing settings for properties)
-- * container - string - Optional - Name of the parent panel to use for this control if not specified in info (defaults to "LayoutDoc" if not given)
-- This function creates a new control (Panel derived class) and adds it to this interface.
function Interface:CreateControl(info, container)
info.Visible = info.Visible or true
info.Container = info.Container or container or "LayoutDoc"
printf("Creating Object: "..info.Name)
local c = CreateClassInstance(info.ClassName, info)
if c then
self:AddControl(c)
end
return c
end
---- LoadScreen ---------------------------------------------------------------
-- * screenNode - table - Table from XMLParser of the screen node being loaded.
-- * screens - array - Screen array to add the new screen info to.
-- This function converts the raw XML for a screen into screen info table that will later be
-- used to create the screen. This is called internally when loading an XML file and should be
-- made private.
function Interface:LoadScreen(screenNode, screens)
-- For now just store info in tables (screen objects get created in InitializeControls after controls have been created)
local screen = {}
-- Copy screen attributes
for att,value in pairs(screenNode.Attributes) do
screen[att] = value
end
-- Copy entries for the screen
screen.Entries = {}
for _,entryNode in ipairs(screenNode.ChildNodes) do
if entryNode.Name == "Entry" then
local entry = {}
for att,value in pairs(entryNode.Attributes) do
entry[att] = value
end
table.insert(screen.Entries, entry)
end
end
table.insert(screens, screen)
end
---- LoadStyles ---------------------------------------------------------------
-- * style_node - table - Table from XMLParser of the Style node being loaded.
-- * styles - array - Styles array to add the new style info to.
-- This converts the raw XML for a Style node into the Lua info table used to construct a style.
-- This is called internally when loading an XML file and should be made private.
function Interface:LoadStyles(style_node,styles)
local count = #style_node.ChildNodes
-- Styles node contains one child Style node for each style that has attributes for each property in that style, ClassName and Name attributes are required!
for i,styleNode in ipairs(style_node.ChildNodes) do
if styleNode.Name == "Style" then
local style = {}
for att,value in pairs(styleNode.Attributes) do
style[att] = value
end
if not style.Name then
printf("Warning: Encountered a style without a Name field, discarding it!")
elseif not style.ClassName then
printf("Warning: Style (%s) needs to have a ClassName field, discarding it!", tostring(style.Name))
else
table.insert(styles, style)
end
else
printf("Warning: Encountered unexpected node type (%s) in the Styles list!", styleNode.Name)
end
-- 25-50% from parsing styles
UpdateProgressDialog( nil, 25 + math.floor(25 * (i/count)) )
end
end
---- LoadControls -------------------------------------------------------------
-- * control_node - table - Table from XMLParser of the Control node being loaded.
-- * container_name - string - Optional - Name of the container (parent panel) to add this control to.
-- * controls - array - Controls array to add the new control info to.
-- This recursively populates Lua info tables used to construct controls from the XML nodes.
-- This is called internally when loading an XML file and should be made private.
function Interface:LoadControls(control_node,container_name,controls)
--Load the current ctrl
local ctrl={}
ctrl.ClassName=control_node.Name
if container_name~=nil then
ctrl.Container=container_name
end
--setup ctrl properties
for attr,value in pairs(control_node.Attributes) do
--!!Create controls with unique name by appending Interface name to All controls
--this way we can have multiple interface from one XML file in different states.!!
if self.ForceUniqueNames and attr=="Name" then
ctrl[attr]=value.."_"..self:GetName()
else
ctrl[attr]=value
end
end
table.insert(controls, ctrl)
if #control_node.ChildNodes<1 then
return
else
for _,ctrlNode in pairs(control_node.ChildNodes) do
self:LoadControls(ctrlNode,ctrl.Name,controls)
end
end
end
---- SaveInterface ------------------------------------------------------------
-- This is the original code to save this interface to an XML file. The saving code has been revised and
-- moved into scripts specific to the LayoutEditor project, so this should be removed soon.
function Interface:SaveInterface(filename, rootPanel)
local start_screen = self:GetCurrentScreen()
local path,fn = SplitPathAndName(filename)
-- Save interface to XML file
--local fullPath = filename
local fullPath = path.."__"..fn
local f = io.open(fullPath, "w")
if not f then
printf("SaveInterface(): Error opening file for writing: %s", fullPath)
return
end
ShowProgressDialog( string.format("Saving Interface '%s'", fn), "Saving Header...", false )
f:write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
-- Write out the Interface XML node (don't close because it has child nodes)
self:WriteXML(f, "", false)
UpdateProgressDialog( nil, 99 )
if self.styles and #self.styles > 0 then
f:write("\t<Styles>\n")
UpdateProgressDialog( "Saving Styles...", 1 )
local count = #self.styles
for i,style in ipairs(self.styles) do
-- Open node with class name
f:write( "\t\t<Style " )
-- Alphabetize by property name so they appear in consistent order in the XML
local frontkeys = { "Name", "ClassName", }
local keylist = FrontSortKeys(style, frontkeys)
-- Write out properties as attributes
for _,name in ipairs(keylist) do
local val = style[name]
-- Always save class name and style name
local save = (name == "ClassName") or (name == "Name")
-- Redundancy check here at class level
if not save then
local def = self:GetCtrlPropertyDefault(name, "class", nil, nil, nil, style.ClassName)
-- If default value was found and is the same as this value then we don't need to write it, otherwise we do
save = not ((def ~= nil) and table.compare(val, def))
end
if save then
f:write( string.format("%s=\"%s\" ", name, ValueToXMLString(style, name, val)) )
end
end
-- Close node
f:write( "/>\n" )
UpdateProgressDialog( nil, 99 * (i/count) )
end
f:write("\t</Styles>\n")
end
-- Apply the default screen for the Controls section to be written as the specified default state
self:SetScreen("<default>")
UpdateProgressDialog( "Saving Controls...", 1 )
f:write("\t<Controls>\n")
if (not rootPanel) and gIsLayoutEditor then
rootPanel = Panel_FindByName("LayoutDoc")
end
if rootPanel then
local childCount = rootPanel:GetChildCount()
for i=1,childCount do
local child = rootPanel:GetChild(i)
UpdateProgressDialog( nil, 99 * (i/childCount) )
child:WriteXML(f, "\t\t")
end
end
f:write("\t</Controls>\n")
UpdateProgressDialog( "Reducing Screens...", 1 )
f:write("\t<Screens>\n")
-- We need to do one pass through ALL of the screens and for each control save any properties that are different from the Controls section. BUT... before we can do that we
-- need to support the "<default>" screen that specifies the values for the Controls section without actually writing out that screen itself... then build the list of properties
-- that differ, and in a second pass through screens for each control write out all of the properties that were found to differ in any screen, these need to be written in every screen.
local ctrl_fields = {}
local count = #self.screens
for i,screen in ipairs(self.screens) do
if screen:GetName() ~= "<default>" then
local entryCount = screen:GetNumEntries()
for i=1,entryCount do
local entry = screen:GetEntry(i)
local fields = ctrl_fields[entry.Name]
if not fields then
fields = { Name=true, }
ctrl_fields[entry.Name] = fields
end
for key,val in pairs(entry) do
if screen:GetDelayBinding() then
fields[key] = true
fields.le_NotEmpty = true
elseif (not fields[key]) and (key ~= "ClassName") then
local def = self:GetCtrlPropertyDefault(key, "control", nil, entry.Name)
-- Set the field for this control to true if it's value differs from the default value in this screen
if not ((def ~= nil) and table.compare(val, def)) then
fields[key] = true
fields.le_NotEmpty = true -- this flag indicates this entry has at least 1 field to be written other than Name (with le_ prefix which we'll reserve for this tool)
end
end
end
end
end
UpdateProgressDialog( nil, 99 * (i/count) )
end
UpdateProgressDialog( "Saving Screens...", 1 )
-- Now at this point ctrl_fields[] can be indexed by control name to get a table whose keys are the names of fields that need to be saved,
-- so go ahead and save just those fields in each screen for each control.
for i,screen in ipairs(self.screens) do
-- Default screen does not get saved to the XML
if screen:GetName() ~= "<default>" then
screen:WriteXML(f, "\t\t")
local entryCount = screen:GetNumEntries()
for i=1,entryCount do
local entry = screen:GetEntry(i)
local panel = Panel_FindByName(entry.Name)
local fields = ctrl_fields[entry.Name]
if not fields.le_NotEmpty then
-- Skip this panel because all of it's properties matches the default values in all screens so it never changes.
elseif panel or screen:GetDelayBinding() then
entry.Container = nil
if panel then
entry.ClassName = panel.ClassName
end
-- Open node with class name
f:write( "\t\t\t<Entry " )
-- Alphabetize by property name so they appear in consistent order in the XML
local frontkeys = { "Name", "Visible", "Position", "Width", "Height" }
local keylist = FrontSortKeys(entry, frontkeys)
-- Write out properties as attributes
for _,name in ipairs(keylist) do
if name ~= "ClassName" then
local val = entry[name]
local save = fields[name]
if save then
if panel then
f:write( string.format("%s=\"%s\" ", name, ValueToXMLString(entry, name, val)) )
else
-- No panel indicates a delayed binding so values remain strings in this case and just write them out as they are
f:write( string.format("%s=\"%s\" ", name, val) )
end
end
end
end
-- Close node
f:write( "/>\n" )
else
-- Print the error in the log file (still continue saving however)
printf("SaveInterface ERROR: Panel not found!: %s (from screen '%s')", tostring(entry.Name), screen:GetName())
end
end
f:write("\t\t</Screen>\n")
end
UpdateProgressDialog( nil, 99 * (i/count) )
end
f:write("\t</Screens>\n")
f:write("</Interface>\n")
f:flush()
f:close()
os.remove(filename)
os.rename(fullPath, filename)
-- Close progress dialog now
UpdateProgressDialog( nil, 100 )
-- Restore the screen that we were at before the save started
self:SetScreen(start_screen)
-- Last segment is the file name (wait until successful save to change the FileName property)
local asset_path, fn = SplitPathAndName(filename)
self:SetFileName( fn )
end
---- SetFileName --------------------------------------------------------------
-- * name - string - Name of the XML file this Interface will be saved to or was loaded from.
-- This sets the FileName property associated with this Interface, really only used by the Layout Editor tool
-- so it knows what file to save to by default when the Interface gets saved.
function Interface:SetFileName(name)
if self.FileName ~= name then
self.FileName = name
if gIsLayoutEditor then
Window.SetName("Layout Editor - ["..name.."]")
end
end
end
---- SetScreen ----------------------------------------------------------------
-- * name - string - Name of the screen to apply.
-- Call this function to apply the given screen to the controls in this interface. Returns true on success or false
-- if a screen with the given name was not found.
function Interface:SetScreen(name)
printf("SetScreen : %s", name)
local current_screen = self.screensByName[name]
if (current_screen) then
current_screen:Apply()
self.current_screen = name
return true
end
return false
end
---- GetScreen ----------------------------------------------------------------
-- Returns the name of the current screen (the screen most recently activated by a ''SetScreen'' call).
function Interface:GetScreen()
return self.current_screen
end
---- GetCtrlByName ------------------------------------------------------------
-- * ctrlName - string - Name of the control to look up.
-- This function returns the Panel object of the control in this interface with the given name, or nil if
-- no control with this name exists in this interface.
function Interface:GetCtrlByName(ctrlName)
if self.ForceUniqueNames then
ctrlName=ctrlName.."_"..self:GetName()
end
return self.controlsByName[ctrlName]
end
---- GetCtrlsByType -----------------------------------------------------------
-- * className - string - Name of the class for the control type you want to retrieve.
-- This function returns all controls in this Interface that are of the given class. Only controls that are
-- directly of this class type will be returned (does not return controls of a derived class). For example
-- calling this with "Panel" will return only plain Panel controls, not ALL controls in the Interface.
function Interface:GetCtrlsByType(className)
return self.controlsByType[className]
end
---- GetCtrlPropertyDefault ---------------------------------------------------
-- * propName - string - Name of the class property whose value to retrieve.
-- * level - string - Level at which to look up the default value, searches highest level first then steps to next lower level until found, values can be:
-- ** "class" = Return the default value for the property from the Lua class definition. (lowest level)
-- ** "style" = Return the default value for the property from the Style used by the control.
-- ** "control" = Return the default value for the property from the Controls section of the interface.
-- ** "screen" = Return the default value for the property from the Screens section of the currently active screen (or indicated screen if 4th param is supplied). (highest level)
-- * screenName - string - Optional - Name of the screen to look in when "screen" level is used, defaults to currently active screen of omitted.
-- * ctrlName - string - Name of the control to look for this property in, this is required if the level is anything above "class".
-- * styleName - string - Optional - Name of the style to look in if the "style" level or above is used, if omitted it will default to the style used by the control given in ctrlName.
-- * className - string - Optional - Name of the class to look when searching for a class default value, if omitted it will default to the class used by the control given in ctrlName.
-- This returns the default value of a property for a control, it is used by the Layout Editor tool to help reduce the amount of XML saved by omitting
-- properties that would match the default value from screen definitions and in the controls and styles sections. RTP interactives will likely never use this.
function Interface:GetCtrlPropertyDefault(propName, level, screenName, ctrlName, styleName, className)
if type(propName) ~= "string" then
error "GetCtrlPropertyDefault(): ERROR - Invalid propName !!!"
end
-- Default to "control" level and current screen if searching screens.
level = level or "control"
screenName = screenName or self.current_screen
local ctrl
if ctrlName then
ctrl = self:GetCtrlByName(ctrlName)
end
-- Style and ClassName come from the control (if not explicitly given but there is a control given)
if ctrl then
if not className then
className = ctrl.ClassName
end
if not styleName then
styleName = ctrl:GetStyle()
if styleName == "none" then
styleName = nil
end
end
end
-- Check for the value of this property in order of: screen, control, style, class
if level == "screen" then
local scrn = self.screensByName[screenName]
if scrn then
local entry = scrn:GetEntry(ctrlName)
if entry and (entry[propName] ~= nil) then
return entry[propName]
end
end
level = "control"
end
if level == "control" then
-- State of controls stored in the "<default>" screen (not yet implemented, so this will just always fall through)
local scrn = self.screensByName["<default>"]
if scrn and ctrlName then
local entry = scrn:GetEntry(ctrlName)
if entry and (entry[propName] ~= nil) then
return entry[propName]
end
end
level = "style"
end
if level == "style" then
if styleName then
local style = self.stylesByName[styleName]
if style and (style[propName] ~= nil) then
return style[propName]
end
end
end
-- "class" level is the default behavior so just always done if we get this far.
if className then
local cdata = FindClassData(className)
if cdata.defaultprops[propName] then
return cdata.defaultprops[propName].default
end
end
end
---- GetCurrentScreen ---------------------------------------------------------
-- Returns the currently set screen, this is just another name for the GetScreen function but unfortunately both
-- of them are in use by projects so we'll just keep both functions around for now at least.
function Interface:GetCurrentScreen()
return self.current_screen
end
---- OnNameChange -------------------------------------------------------------
-- * obj - Object - The Panel or Screen object whose name is being changed.
-- * oldName - string - The previous name of the given Object.
-- * newName - string - The new name the given Object is being assigned.
-- This is called when a Panel or Screen is renamed. The Panel class calls this automatically in the SetName field.
-- The call for Screens are currently being done in code specific to the Layout Editor project. Therefore RTP apps
-- cannot change the name of Screens in an Interface, and while renaming controls would work you, should avoid doing this.
function Interface:OnNameChange(obj, oldName, newName)
if obj:IsDerivedFrom("Screen") then
-- A screen is being renamed (just need to update our lookup table, no other dependencies on screen names currently exist)
self.screensByName[oldName] = nil
self.screensByName[newName] = obj
elseif obj:IsDerivedFrom("Panel") then
-- A panel is being renamed. Update Our Name=>Control LUT
self.controlsByName[oldName] = nil
self.controlsByName[newName] = obj
-- Update this panel in any screens
for _,screen in ipairs(self.screens) do
screen:UpdatePanelName(obj, oldName, newName)
end
-- Any panels that are using us in their "LayoutManager" property need to be updated with our new name.
-- NOTE: SetLayoutManager uses Panel_FindByName, so this must be called AFTER the new name is applied.
if #obj.layoutPanels > 0 then
local layouts = obj.layoutPanels
obj.layoutPanels = {}
for _,layout in ipairs(layouts) do
layout:SetLayoutManager(newName)
end
end
end
end
---- OnStyleRenamed -----------------------------------------------------------
function Interface:OnStyleRenamed(style, oldName, newName)
-- A style is being renamed (presumably if it's not a screen or panel it must be a style). Update any panels using the style.
for _,ctrl in ipairs(self.controls) do
if ctrl:GetStyle() == oldName then
ctrl:SetStyle(newName)
end
end
self.stylesByName[oldName] = nil
self.stylesByName[newName] = style
end
---- AddControl ---------------------------------------------------------------
-- * obj - Panel - The control to add to this Interface, this should be a Panel or Panel derived class object.
-- Adds this control to this Interface. RTP applications that need to dynamically create controls should call
-- this function on their Interface so that dynamic controls behave properly with regards to screen changes.
-- Panel object will contain an ''Interface'' field that references this Interface it belongs to after this.
function Interface:AddControl(obj)
if obj then
-- Add to tables
table.insert(self.controls, obj)
local ctrlName = obj:GetName()
if self.ForceUniqueNames then
ctrlName = ctrlName.."_"..self:GetName()
end
self.controlsByName[ctrlName] = obj
if not self.controlsByType[obj.ClassName] then
self.controlsByType[obj.ClassName] = {}
end
table.insert(self.controlsByType[obj.ClassName], obj)
obj.Interface = self
-- Messy, callback function doesn't get called when loading XML otherwise.
if LE_OnControlCreated then
LE_OnControlCreated(self, obj)
end
end
end
---- DeleteControl ------------------------------------------------------------
-- * obj - Panel - The control (Panel derived class) object to remove from the Interface.
-- * bSkipChildren - boolean - Optional - Pass true for this parameter to delete only the given control. Default behavior is to also delete all child controls.
-- Removes reference to this control from this Interface and also calls Release() on the control.
function Interface:DeleteControl(obj, bSkipChildren)
if obj then
local ctrlName = obj:GetName()
local childCount = obj:GetChildCount()
if LE_OnControlDeleted then
LE_OnControlDeleted(self, obj)
end
while childCount > 0 do
if bSkipChildren then
-- Unparent the child control from this control we're deleting if we aren't deleting the children. This is used to
-- allow child panels to persist so they're info can be queried when importing a PSD in psd_parser.lua script.
obj:GetChild(1):SetContainer(obj:GetContainer())
else
self:DeleteControl( obj:GetChild(1) )
end
childCount = childCount - 1
end
-- Remove from tables
self.controlsByName[ctrlName] = nil
-- NOTE: A crash here may indicate that you've created a panel manually but did not call Interface:AddControl() for it.
for i,ctrl in ipairs(self.controlsByType[obj.ClassName]) do
if ctrl == obj then
table.remove(self.controlsByType[obj.ClassName], i)
break
end
end
for i,ctrl in ipairs(self.controls) do
if ctrl == obj then
table.remove(self.controls, i)
break
end
end
-- Remove entry for this control from any screens it may have been in
for _,screen in pairs(self.screens) do
for j,ctrl in ipairs(screen) do
if ctrl == ctrlName then
table.remove(screen, j)
break
end
end
end
-- Remove the object's reference to this interface
obj.Interface = nil
-- Free memory and everything associated with this control
obj:Release()
end
end
---- AddStyle -----------------------------------------------------------------
-- * style - Table - Key/value pairs of properties to assign to controls that use this style.
-- Call this function to dynamically add a new style to the Interface. The ''style'' parameter uses the property
-- name as keys (so, strings) and the value for that property as the value. All properties in the style will get
-- assigned to controls that use this style. It must contain a ''Name'' and ''ClassName'' field, the former being
-- a unique name for this style, the latter being the name of the class (control type) this style can apply to.
-- Controls can use a style by setting the ''Style'' property to the ''Name'' of the style to use.
function Interface:AddStyle(style)
-- For now just using a basic keyed table, which must have Name field as the unique name used to identify
-- this style. Eventually we can include a specific class name to which this style can apply and instances
-- to which it is applied so changing the style can update the instances immediately. Should probably wrap
-- Style in a Lua class to implement such functionality...
if not style.Name then
printf("AddStyle: ERROR - Style table does not include a Name field.")
return
end
if self.stylesByName[style.Name] then
-- TODO: Should we merge in this case instead of erroring out?
printf("AddStyle: ERROR - Style with name '%s' already exists.", style.Name)
return
end
printf("Adding Style: "..style.Name.." ["..style.ClassName.."]")
table.insert(self.styles, style)
self.stylesByName[style.Name] = style
if StylesDialog then
StylesDialog.OnStyleCreated(style.Name)
end
return true
end
---- DeleteStyle --------------------------------------------------------------
-- style - Table - The table that was passed to AddStyle of the style to delete.
-- This function removes the given style from this Interface. If you do not retain a reference to style tables after
-- calling AddStyle you can always look them up by name using the GetStyleByName method of this class.
function Interface:DeleteStyle(style)
if style and style.Name then
if StylesDialog then
StylesDialog.OnStyleDestroyed(style.Name)
end
for i,entry in ipairs(self.styles) do
if entry == style then
table.remove(self.styles, i)
break
end
end
self.stylesByName[style.Name] = nil
-- TODO: If changing Style into a class call Style:Release() here for any class-specific cleanup.
else
printf("DeleteStyle: ERROR - Invalid parameter.")
end
end
---- UpdateStyle --------------------------------------------------------------
-- Updates the given style and for any fields that have changed also updates any controls using this style that
-- did not have a different control-specific value for that field.
function Interface:UpdateStyle(styleName, info)
if not gIsLayoutEditor then
printf("Interface.UpdateStyle: Only supported in LayoutEditor tool.")
return
end
local style = self:GetStyleByName(styleName)
local ctrls = {}
local cmodified = false
-- Collect controls using this style
for _,ctrl in pairs(self.controlsByName) do
if ctrl:GetStyle() == styleName then
table.insert(ctrls, ctrl)
end
end
-- "info" table should only contain entries for modified values in the style that need to be updated.
for k,v in pairs(info) do
-- If any controls using this style were using the styles old value then update the property in that control too.
for _,ctrl in ipairs(ctrls) do
if (not style[k]) or table.compare(ctrl["Get"..k](ctrl), style[k]) then
ctrl["Set"..k](ctrl, v)
cmodified = true
end
end
style[k] = v
end
if cmodified then
-- This is a function in the Layout Editor, we update the "<default>" screen here which refreshes the state of the properties in the <Controls>
-- section after a style change that effected at least one of the controls was made. This is required for the style change to effect controls properly.
UpdateScreen( "UpdateScreen", "<default>" )
end
end
---- GetStyleByName -----------------------------------------------------------
-- * styleName - string - The name of the style to return.
-- This function returns the table containing key/value properties for the style with the given name, or nil if
-- no style with this name exists in this interface.
function Interface:GetStyleByName(styleName)
return self.stylesByName[styleName]
end
---- AddScreen ----------------------------------------------------------------
-- * screen - Screen - The Screen class object to add to this interface.
-- This function can be used to dynamically add new screens to this interface. Upon return the screen
-- object will contain an ''Interface'' field that references this interface which it belongs to.
function Interface:AddScreen(screen)
if not screen then
printf("AddScreen: ERROR - screen parameter is nil.")
return
end
local screen_name = screen:GetName()
if not screen_name then
printf("AddScreen: ERROR - Screen table does not include a Name field.")
return
end
if self.screensByName[screen_name] then
printf("AddScreen: ERROR - Screen with name '%s' already exists.", screen_name)
return
end
table.insert(self.screens, screen)
self.screensByName[screen_name] = screen
screen.Interface = self
-- Messy, but needs to be done here to get called when XML is loaded
if LE_OnScreenCreated then
LE_OnScreenCreated(self, screen)
end
return true
end
---- DeleteScreen -------------------------------------------------------------
-- * screen - Screen - The screen object to delete.
-- This function can be called to remove a screen from this interface. It removes all references to
-- the screen and also calls the ''Release'' function to destroy the screen object.
function Interface:DeleteScreen(screen)
if screen then
if LE_OnScreenDeleted then
LE_OnScreenDeleted(self, screen)
end
local screen_name = screen:GetName()
if self.current_screen == screen_name then
self.current_screen = nil
end
for i,entry in ipairs(self.screens) do
if entry == screen then
table.remove(self.screens, i)
break
end
end
self.screensByName[screen_name] = nil
screen:Release()
else
printf("DeleteScreen: ERROR - Invalid parameter.")
end
end
---- GetSceenByName -----------------------------------------------------------
-- * name - string - The name of the screen to retrieve.
-- This function returns the Screen object for the screen with the given name, or nil if no screen
-- with this name exists in this interface.
function Interface:GetScreenByName(name)
return self.screensByName[name]
end
---- DeleteAll ----------------------------------------------------------------
-- Deletes everything in this interface, wiping it clean for a new interface file to be loaded into it.
function Interface:DeleteAll()
while (self.controls[1]) do
self:DeleteControl(self.controls[1])
end
while (self.styles[1]) do
self:DeleteStyle(self.styles[1])
end
while (self.screens[1]) do
self:DeleteScreen(self.screens[1])
end
end
---- Animate -----------------------------------------------------------------
-- * elap - Number - Elapsed time (in seconds) since the previous frame.
-- This is called by the Application class each frame, it calls the Animate function of all visible
-- controls, or the ''UpdateVisible'' function of non visible controls. The latter function is used
-- by the HotSpot class I think so they position correctly when visibility is toggled off and back on.
function Interface:Animate( elap)
if self.controls then
for _,ctrl in ipairs(self.controls) do
-- TODO !!!
-- turns out GetInfo() && TransferToLua is too expensive for intensive calls like this
-- if (ctrl:GetVisible()) then
if (ctrl.cppinst:GetVisible()) then
ctrl:Animate( elap)
elseif (ctrl.UpdateVisible) then
ctrl:UpdateVisible()
end
end
end
end
---- DumpScreens -------------------------------------------------------------
-- This is a debugging function that dumps the entries for all screens in the Interface to the
-- debug log file.
function Interface:DumpScreens()
for _,screen in ipairs(self.screens) do
screen:DumpEntries()
end
end
|
--[[
Instructions:
- Create a ScreenGui inside of the StarterGui
- Directly inside the ScreenGui create a Frame named 'SomeFrame'
- Directly inside the ScreenGui create a LocalScript and insert the following code:
--]]
local ui = script.Parent
local frame = ui:WaitForChild("SomeFrame")
--
function openMenu()
-- Setting frame out of the screen
frame.Position = UDim2.new(0.5, 0, 1.5, 0)
-- Making frame visible
frame.Visible = true
-- Moving frame into the screen
frame:TweenPosition(
-- (Required)
-- Target Position
UDim2.new(0.5, 0, 0.5, 0),
-- (Optional)
-- EasingStyle Direction
Enum.EasingDirection.Out,
-- (Optional)
-- Tween Style (EasingStyle)
Enum.EasingStyle.Quad,
-- (Optional)
-- Duration of the Tween
1,
-- (Optional)
-- Set to true if you want to
-- override a Tween that might
-- be active on the Frame right now.
false,
-- (Optional)
-- Function that gets executed
-- once the :TweenPosition finished.
function()
print("Tween has finished!")
end
)
end
--
openMenu()
|
local NightmareAmbientSoundMixer = Class(function(self, inst)
self.inst = inst
self.inst:ListenForEvent( "warnstart", function(it, data)
self:SetSoundParam(1)
self.inst.SoundEmitter:PlaySound("dontstarve/cave/nightmare_warning")
end, GetWorld())
self.inst:ListenForEvent( "calmstart", function(it, data)
self:SetSoundParam(0)
end, GetWorld())
self.inst:ListenForEvent( "nightmarestart", function(it, data)
self:SetSoundParam(2)
self.inst.SoundEmitter:PlaySound("dontstarve/cave/nightmare_full")
end, GetWorld())
self.inst:ListenForEvent( "dawnstart", function(it, data)
self:SetSoundParam(1)
self.inst.SoundEmitter:PlaySound("dontstarve/cave/nightmare_end")
end, GetWorld())
end)
function NightmareAmbientSoundMixer:SetSoundParam(val)
if not self.inst.SoundEmitter:PlayingSound("nightmare_loop") then
self.inst.SoundEmitter:PlaySound("dontstarve/cave/nightmare", "nightmare_loop")
end
self.inst.SoundEmitter:SetParameter("nightmare_loop", "nightmare", val)
end
return NightmareAmbientSoundMixer
|
local AddonName, AddonTable = ...
-- TBC Loot
AddonTable.loot = {
25050,
25053,
25054,
25055,
25056,
25057,
25058,
25059,
25069,
25071,
28029,
28052,
29910,
29915,
29926,
29927,
29928,
29945,
30028,
32593,
51965,
51985,
51987,
51993,
51995,
160610,
-- Tier Sets
--- Druid
30230,
-- Hunter
29084,
}
|
local _, ns = ...
local B, C, L, DB, P = unpack(ns)
-----------------------
-- BetterWorldQuests
-- Author: p3lim
-----------------------
local BUTTON = "OverrideActionBarButton%d"
local locations = {
[356465] = { -- spellID trigger for "The Weight of Stone" in Korthia
distance = 12,
mapID = 1961, -- Korthia
locations = {
{x=0.512295, y=0.659946, button=2},
{x=0.495522, y=0.702267, button=1},
{x=0.436255, y=0.774560, button=1},
{x=0.457401, y=0.651537, button=2},
{x=0.571717, y=0.738390, button=1},
{x=0.483011, y=0.703747, button=2},
{x=0.540073, y=0.696586, button=1},
{x=0.438710, y=0.691987, button=1},
{x=0.547435, y=0.680365, button=1},
{x=0.456530, y=0.756301, button=2},
{x=0.449992, y=0.781604, button=2},
{x=0.553119, y=0.704497, button=2},
{x=0.561304, y=0.736615, button=1},
{x=0.457527, y=0.718790, button=2},
{x=0.493594, y=0.653566, button=1},
{x=0.556713, y=0.688418, button=1},
{x=0.533274, y=0.686950, button=2},
{x=0.472837, y=0.653830, button=1},
{x=0.519417, y=0.696308, button=2},
{x=0.509723, y=0.704670, button=1},
{x=0.522772, y=0.665827, button=1},
{x=0.555976, y=0.720724, button=1},
{x=0.571639, y=0.709176, button=1},
{x=0.437535, y=0.653663, button=2},
{x=0.503524, y=0.656182, button=2},
{x=0.447420, y=0.735700, button=2},
},
},
-- TODO: there is one in Revendreth as well
}
local function OnUpdate(self)
local playerPosition = C_Map.GetPlayerMapPosition(self.data.mapID, "player")
local x, y = playerPosition:GetXY()
local bindButton
for _, location in next, self.data.locations do
-- use utilities by Blizzard (MathUtil)
local distance = CalculateDistance(location.x * 100, location.y * 100, x * 100, y * 100)
if distance <= (self.data.distance / 100) then
bindButton = location.button
break
end
end
if bindButton then
SetOverrideBindingClick(self, true, "SPACE", BUTTON:format(bindButton))
RaidNotice_AddMessage(RaidWarningFrame, L["QuestHelperTip1"], P.InfoColors)
else
ClearOverrideBindings(self)
end
end
local Handler = CreateFrame("Frame")
Handler:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
Handler:SetScript("OnEvent", function(self, event, unit, _, spellID)
if event == "UNIT_SPELLCAST_SUCCEEDED" then
local locationData = locations[spellID]
if locationData then
for i = 1, 2 do
RaidNotice_AddMessage(RaidWarningFrame, L["QuestHelperTip1"], P.InfoColors)
end
self.data = locationData
self:RegisterEvent("UNIT_EXITED_VEHICLE")
self:SetScript("OnUpdate", OnUpdate)
end
elseif event == "UNIT_EXITED_VEHICLE" then
-- just make sure we dont deadlock
ClearOverrideBindings(self)
-- cleanup
self:UnregisterEvent(event)
self:SetScript("OnUpdate", nil)
end
end)
|
local jwt = require "resty.jwt"
local jwt_token = ngx.var.arg_jwt
if jwt_token then
ngx.header['Set-Cookie'] = "jwt=" .. jwt_token
else
jwt_token = ngx.var.cookie_jwt
end
local jwt_obj = jwt:verify(ngx.var.jwt_secret, jwt_token, 0)
if not jwt_obj["verified"] then
local site = ngx.var.scheme .. "://" .. ngx.var.http_host;
local args = ngx.req.get_uri_args();
ngx.status = ngx.status = ngx.HTTP_UNAUTHORIZED
ngx.say(jwt_obj.reason);
ngx.exit(ngx.HTTP_OK)
-- or you can redirect to your website to get a new jwt token
-- then redirect back
-- return ngx.redirect("http://your-site-host/get_jwt")
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.