content
stringlengths 5
1.05M
|
---|
-----------------------------------------
-- Spell: Regen IV
-- Gradually restores target's HP.
-----------------------------------------
-- Scale down duration based on level
-- Composure increases duration 3x
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/magic")
require("scripts/globals/msg")
-----------------------------------------
function onMagicCastingCheck(caster, target, spell)
return 0
end
function onSpellCast(caster, target, spell)
local hp = math.ceil(30 * (1 + 0.01 * caster:getMod(tpz.mod.REGEN_MULTIPLIER))) -- spell base times gear multipliers
hp = hp + caster:getMerit(tpz.merit.REGEN_EFFECT) -- bonus hp from merits
hp = hp + caster:getMod(tpz.mod.LIGHT_ARTS_REGEN) -- bonus hp from light arts
local duration = calculateDuration(60 + caster:getMod(tpz.mod.REGEN_DURATION), spell:getSkillType(), spell:getSpellGroup(), caster, target)
duration = calculateDurationForLvl(duration, 86, target:getMainLvl())
if target:addStatusEffect(tpz.effect.REGEN, hp, 0, duration) then
spell:setMsg(tpz.msg.basic.MAGIC_GAIN_EFFECT)
else
spell:setMsg(tpz.msg.basic.MAGIC_NO_EFFECT) -- no effect
end
return tpz.effect.REGEN
end
|
local Config = require('vgit.core.Config')
return Config:new({
GitBackgroundPrimary = 'Normal',
GitBackgroundSecondary = {
gui = nil,
fg = nil,
bg = nil,
sp = nil,
override = false,
},
GitBorder = 'LineNr',
GitLineNr = 'LineNr',
GitComment = 'Comment',
GitSignsAdd = {
gui = nil,
fg = '#d7ffaf',
bg = nil,
sp = nil,
override = false,
},
GitSignsChange = {
gui = nil,
fg = '#7AA6DA',
bg = nil,
sp = nil,
override = false,
},
GitSignsDelete = {
gui = nil,
fg = '#e95678',
bg = nil,
sp = nil,
override = false,
},
GitSignsAddLn = 'DiffAdd',
GitSignsDeleteLn = 'DiffDelete',
GitWordAdd = {
gui = nil,
fg = nil,
bg = '#5d7a22',
sp = nil,
override = false,
},
GitWordDelete = {
gui = nil,
fg = nil,
bg = '#960f3d',
sp = nil,
override = false,
},
})
|
require 'drhayes.options'
require 'drhayes.augroup'
require 'drhayes.plugins'
-- Do all our key mappings.
local keyMappings = require 'drhayes.keyMappings'
keyMappings.initKeymap()
local a = vim.api
a.nvim_exec([[
if has ("autocmd")
filetype plugin indent on
endif
]], '')
a.nvim_command(':cabbrev h vert bo help')
-- we are done setting stuff up
a.nvim_command("silent! helptags ALL")
|
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:25' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC.
****************************************************************************
]]
ZO_ITEM_SET_COLLECTION_PIECE_TILE_KEYBOARD_DIMENSIONS = 67
ZO_ITEM_SET_COLLECTION_PIECE_TILE_KEYBOARD_ICON_DIMENSIONS = 52
local g_mouseOverIconAnimationProvider = ZO_ReversibleAnimationProvider:New("ZO_ItemSetCollectionPieceTile_Keyboard_MouseOverIconAnimation")
-- Primary logic class must be subclassed after the platform class so that platform specific functions will have priority over the logic class functionality
ZO_ItemSetCollectionPieceTile_Keyboard = ZO_Object.MultiSubclass(ZO_ContextualActionsTile_Keyboard, ZO_ContextualActionsTile)
function ZO_ItemSetCollectionPieceTile_Keyboard:New(...)
return ZO_ContextualActionsTile.New(self, ...)
end
-- Begin ZO_ContextualActionsTile_Keyboard Overrides --
function ZO_ItemSetCollectionPieceTile_Keyboard:InitializePlatform()
ZO_ContextualActionsTile_Keyboard.InitializePlatform(self)
self.statusMultiIcon = self.control:GetNamedChild("Status")
end
function ZO_ItemSetCollectionPieceTile_Keyboard:PostInitializePlatform()
-- keybindStripDescriptor and canFocus need to be set after initialize, because ZO_ContextualActionsTile
-- won't have finished initializing those until after InitializePlatform is called
ZO_ContextualActionsTile_Keyboard.PostInitializePlatform(self)
table.insert(self.keybindStripDescriptor,
{
keybind = "UI_SHORTCUT_PRIMARY",
name = GetString(SI_ITEM_RECONSTRUCTION_SELECT), -- TODO: May need two strings depending on design
callback = function()
self:ShowReconstructOptions()
end,
enabled = function()
return self:CanReconstruct()
end,
visible = function()
return ZO_RECONSTRUCT_KEYBOARD:IsSelectionModeShowing()
end,
})
self:SetCanFocus(false)
end
-- End ZO_ContextualActionsTile_Keyboard Overrides --
function ZO_ItemSetCollectionPieceTile_Keyboard:RefreshMouseoverVisuals()
if self.itemSetCollectionPieceData and self:IsMousedOver() then
-- Tooltip
ClearTooltip(ItemTooltip)
local offsetX = self.control:GetParent():GetLeft() - self.control:GetLeft() - 5
InitializeTooltip(ItemTooltip, self.control, RIGHT, offsetX, 0, LEFT)
local HIDE_TRAIT = true
ItemTooltip:SetItemSetCollectionPieceLink(self.itemSetCollectionPieceData:GetItemLink(), HIDE_TRAIT)
end
end
function ZO_ItemSetCollectionPieceTile_Keyboard:ShowMenu()
ClearMenu()
local itemSetCollectionPieceData = self.itemSetCollectionPieceData
if itemSetCollectionPieceData then
if IsChatSystemAvailableForCurrentPlatform() then
--Link in chat
local link = itemSetCollectionPieceData:GetItemLink()
AddMenuItem(GetString(SI_ITEM_ACTION_LINK_TO_CHAT), function() ZO_LinkHandler_InsertLink(zo_strformat(SI_TOOLTIP_ITEM_NAME, link)) end)
end
ShowMenu(self.control)
end
end
function ZO_ItemSetCollectionPieceTile_Keyboard:CanReconstruct()
return self.itemSetCollectionPieceData and self.itemSetCollectionPieceData:IsUnlocked()
end
function ZO_ItemSetCollectionPieceTile_Keyboard:ShowReconstructOptions()
if self:CanReconstruct() then
ZO_RECONSTRUCT_KEYBOARD:SelectItemSetPieceData(self.itemSetCollectionPieceData)
end
end
-- Begin ZO_Tile Overrides --
function ZO_ItemSetCollectionPieceTile_Keyboard:Reset()
self.itemSetCollectionPieceData = nil
self:SetCanFocus(false)
local INSTANT = true
self:SetHighlightHidden(true, INSTANT)
self:GetIconTexture():SetHidden(true)
self.statusMultiIcon:ClearIcons()
self.isNew = false
end
-- End ZO_Tile Overrides --
-- Begin ZO_ContextualActionsTile Overrides --
function ZO_ItemSetCollectionPieceTile_Keyboard:OnControlHidden()
self:OnMouseExit()
ZO_ContextualActionsTile.OnControlHidden(self)
end
function ZO_ItemSetCollectionPieceTile_Keyboard:OnFocusChanged(isFocused)
ZO_ContextualActionsTile.OnFocusChanged(self, isFocused)
local itemSetCollectionPieceData = self.itemSetCollectionPieceData
if itemSetCollectionPieceData then
if not isFocused then
ClearTooltip(ItemTooltip)
if self.isNew then
itemSetCollectionPieceData:ClearNew()
end
end
self:RefreshMouseoverVisuals()
end
end
function ZO_ItemSetCollectionPieceTile_Keyboard:SetHighlightHidden(hidden, instant)
ZO_ContextualActionsTile.SetHighlightHidden(self, hidden, instant)
if hidden then
g_mouseOverIconAnimationProvider:PlayBackward(self:GetIconTexture(), instant)
else
g_mouseOverIconAnimationProvider:PlayForward(self:GetIconTexture(), instant)
end
end
-- End ZO_ContextualActionsTile Overrides --
-- Begin ZO_ContextualActionsTile_Keyboard Overrides --
function ZO_ItemSetCollectionPieceTile_Keyboard:LayoutPlatform(data)
local itemSetCollectionPieceData = data
internalassert(itemSetCollectionPieceData ~= nil)
self.itemSetCollectionPieceData = itemSetCollectionPieceData
self:SetCanFocus(true)
-- Icon/Highlight
local iconFile = itemSetCollectionPieceData:GetIcon()
local iconTexture = self:GetIconTexture()
iconTexture:SetTexture(iconFile)
local isUnlocked = itemSetCollectionPieceData:IsUnlocked()
local desaturation = isUnlocked and 0 or 1
self:GetHighlightControl():SetDesaturation(desaturation)
ZO_SetDefaultIconSilhouette(iconTexture, not isUnlocked)
iconTexture:SetHidden(false)
-- Status
local statusMultiIcon = self.statusMultiIcon
statusMultiIcon:ClearIcons()
if isUnlocked then
if itemSetCollectionPieceData:IsNew() then
statusMultiIcon:AddIcon(ZO_KEYBOARD_NEW_ICON)
self.isNew = true
end
end
statusMultiIcon:Show()
-- Mouseover
self:RefreshMouseoverVisuals()
end
function ZO_ItemSetCollectionPieceTile_Keyboard:OnMouseUp(button, upInside)
if upInside and button == MOUSE_BUTTON_INDEX_RIGHT then
self:ShowMenu()
end
end
function ZO_ItemSetCollectionPieceTile_Keyboard:OnMouseDoubleClick(button)
if button == MOUSE_BUTTON_INDEX_LEFT then
self:ShowReconstructOptions()
end
end
-- End ZO_ContextualActionsTile_Keyboard Overrides --
-- Begin Global XML Functions --
function ZO_ItemSetCollectionPieceTile_Keyboard_OnInitialized(control)
ZO_ItemSetCollectionPieceTile_Keyboard:New(control)
end
-- End Global XML Functions -- |
local WIDGET, VERSION = 'InputBox2', 1
local GUI = LibStub('NetEaseGUI-2.0')
local InputBox2 = GUI:NewClass(WIDGET, 'EditBox', VERSION, 'Owner')
if not InputBox2 then
return
end
function InputBox2:Constructor()
self:SetBackdrop{
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
insets = { left = 2, right = 2, top = 2, bottom = 2 },
tileSize = 16, edgeSize = 16, tile=true
}
self:SetBackdropBorderColor(0.8, 0.8, 0.8, 0.8)
self:SetBackdropColor(0, 0, 0, 0.8)
self:SetFont(ChatFontNormal:GetFont(), 18)
self:SetJustifyH('CENTER')
self:SetAutoFocus(false)
self:SetTextInsets(8, 8, 0, 0)
self:SetScript('OnEscapePressed', self.ClearFocus)
self:SetScript('OnEditFocusGained', self.HighlightText)
self:SetScript('OnEditFocusLost', self.OnEditFocusLost)
self:SetScript('OnEnable', self.OnEnable)
self:SetScript('OnDisable', self.OnDisable)
end
function InputBox2:OnEditFocusLost()
self:HighlightText(0, 0)
end
function InputBox2:OnEnable()
self:SetTextColor(1, 1, 1)
end
function InputBox2:OnDisable()
self:SetTextColor(0.4, 0.4, 0.4)
end
|
require('src/test')
require('src/core')
require('src/builtins')
require('src/contextlib')
require('src/objects')
require('src/logic')
require('src/string')
require('src/system')
describe('string',
it('startswith', function()
assert(('\nabc'):startswith('\n'), 'Startswith \\n')
assert(not ('abc'):startswith('\n'), 'Not Startswith \\n')
end),
it('endswith', function()
assert(('abc\n'):endswith('\n'), 'Endswith \\n')
assert(not ('abc'):endswith('\n'), 'Not endswith \\n')
end),
it('join', function()
assertEqual(('\n'):join({'a', 'b'}), 'a\nb',
'String join table failed')
assertEqual(('\n'):join(list{'a', 'b'}), 'a\nb',
'String join list failed')
end),
it('replace', function()
assertEqual(('abcba'):replace('b', 'q'), 'aqcqa', 'String replacement incorrect')
end),
it('split', function()
local s1 = 'abc'
local s2 = 'aabbcc'
local s3 = 'a 20 300 dddd'
assertRequal(s1:split(), {'a', 'b', 'c'}, 'Split with no args')
assertRequal(s1:split('b'), {'a', 'c'}, 'Split with char arg')
assertRequal(s2:split('bb'), {'aa', 'cc'}, 'Split with string arg')
assertRequal(s3:split(' '), {'a', '20', '300', 'dddd'}, 'Split with spaces')
end),
it('strip', function()
local x = 'abacbabacabab'
local expected = 'cbabac'
assertEqual(x:strip('ab'), expected, 'String not stripped correctly')
end),
it('metafuncs add', function()
assertEqual('a' + 'b', 'ab', 'String add incorrect')
end),
it('metafuncs mul', function()
assertEqual('ab' * 2, 'abab', 'String mul incorrect')
end),
it('metafuncs pairs', function()
local c = 1
local _t = {'a', 'b', 'c'}
for i, v in pairs('abc') do
assertEqual(i, c, 'String pairs index incorrect')
assertEqual(v, _t[c], 'String pairs value incorrect')
c = c + 1
end
end),
it('metafuncs index', function()
local s = 'abc'
for i, v in pairs(string) do
assert(Not.Nil(s[i]), 'string missing function '..i)
end
assertEqual(s[1], 'a', 'Positive string index failed')
assertEqual(s[-1], 'c', 'Negative string index failed')
end),
it('metafuncs call', function()
local x = 'abcde'
assert(x(2, 4) == 'bcd', 'Did not slice string correctly')
assert(x{1, -2, 3} == 'adc', 'Did not slice string correctly')
end)
)
run_tests()
|
--[[
Export.lua
--]]
local FtpExport, dbg, dbgf = Export:newClass{ className = 'FtpExport' }
--- Constructor for extending class.
--
function FtpExport:newClass( t )
return Export.newClass( self, t )
end
--- Constructor to create the export object that represents the export dialog box.
--
-- <p>One of these objects is created when the export dialog box is presented,
-- if it has not already been.</p>
--
function FtpExport:newDialog( t )
local o = Export.new( self, t )
o:init()
return o
end
FtpExport.new = FtpExport.newDialog -- function FtpExport:new( ... ) -- synonym for (minimal) object which has access to export methods, but not representing an export in progress (with session, context, settings, ... ).
--- Create a new export object.
--
-- <p>One of these objects is created EACH time a new export is initiated,
-- then killed at export completion - supports multiple concurrent exports,
-- without interference (assuming a different set of photos is selected,
-- otherwise all kinds of interference...)</p>
--
-- @param t Parameter table<ul>
-- <li>exportContext
-- <li>functionContext</ul>
--
-- @return FtpExport object
--
function FtpExport:newExport( t )
local o = Export.newExport( self, t )
-- default property name map:
-- (if your derived class uses different name, be sure to provide a proper mapping in constructor).
o:init()
return o
end
function FtpExport:init()
self.ftpPropertyMap = { -- reminder: there is one entry for each property needed for ftp'ing, not all are for ftp-settings proper.
localRootPath = 'localRootPath',
server = "server",
username = "username",
password = "password",
port = "port",
passive = "passive",
protocol = "protocol",
path = "path", -- "remote" (ftp) server root path. name is not so descriptive for historical reasons..
remoteSubpath = "remoteSubpath", -- ftp child path.
remoteDirPathForFtpUploadTest = "remoteDirPathForFtpUploadTest", -- added 12/Mar/2014 20:22 based on comment that it was probably missing - hope nothing breaks..
}
end
-- if export via ftp enabled, then initialize the service according to interface, @now only one is supported (ftp-ag-app).
-- return s, m.
function FtpExport:_initFtpService( srvcName )
app:assert( self.ftpPropertyMap, "no ftp property map" )
app:assert( ftpAgApp, "global ftp-ag-app expected" )
app:assert( self.exportParams, "no export params" )
local destDir = self:getDestDir( self.exportParams, cat:getAnyPhoto(), nil ) -- nil is cache. ###2 theoretically, should not need to get dest dir based on any-photo.
local localRootPath = self.exportParams[self.ftpPropertyMap.localRootPath]
local localPath
if str:is( localRootPath ) then -- specified explicitly
app:logV( "Local root path has been specified in export params (determines remote subpath): ^1", localRootPath )
localPath = localRootPath
elseif str:is( destDir ) then -- this case occurs when using export-filter mode, in which case it's presumptuous to assume ftp-export properties necessarily
-- represent the correct export location. If export service is via hard-drive or one of mine, then yes - otherwise: it's a crap shoot.
app:logV( "*** No (local) root path in export params, or name not matching mapped ftp property - using computed destination dir instead (considered \"root\" of local export destination): ^1", destDir )
localPath = destDir
else
error( "no (local) root path in export params" )
end
local remotePath = self.exportParams[self.ftpPropertyMap.path] or error( "no (server root) path in export params" )
if str:is( self.exportParams[self.ftpPropertyMap.remoteSubpath] ) then
remotePath = str:parentSepChild( remotePath, "/", self.exportParams[self.ftpPropertyMap.remoteSubpath] )
app:logV( "Remote root path (as specified in export params): ^1", remotePath )
else -- again: normal case when uploading via export filter.
app:logV( "*** Remote (server) path is being used without child-dir, since no remote sub-path property found - root path: ^1", remotePath )
end
local srvcSettings = {
serviceName = srvcName,
localRootPath = localPath,
}
local ftpSettings = {
server=self.exportParams[self.ftpPropertyMap.server] or error( "no server in export params" ),
username=self.exportParams[self.ftpPropertyMap.username] or error( "no username in export params" ),
password=self.exportParams[self.ftpPropertyMap.password], -- ###2? (17/Mar/2014 18:01) or error( "no password field in export params" ), -- can be blank, but shouldn't be missing, although I suppose it could be..
port=self.exportParams[self.ftpPropertyMap.port] or error( "no port in export params" ),
passive=self.exportParams[self.ftpPropertyMap.passive] or error( "no passive in export params" ),
protocol=self.exportParams[self.ftpPropertyMap.protocol] or error( "no protocol in export params" ),
path=remotePath, -- reminder: settings are on a per-service basis, so having remote-subpath rolled in is just fine.
}
local errm
self.jobNum, errm = ftpAgApp:initService( srvcSettings, ftpSettings, self.ftpPropertyMap ) -- for now, ftp settings & password are re-initialized each job.
-- not such a bad way to go - assures freshness even if "non-optimal" (slight overkill).
if self.jobNum then -- new/fresh job num
self.taskNum = 1 -- always start a new job with task #1.
app:log( "FTP Service initialized, job-num: ^1", self.jobNum )
return true
else
Debug.pauseIf( not str:is( errm ), "no errm" )
app:logE( "FTP Service NOT initialized - ^1", errm or "no additional info" )
self.taskNum = nil -- probably (hopefully) a dont care, but do not attempt to do tasks when job not properly init.
return false, errm
end
end
-- Typically wrapped in a service externally, so service finale box tells status.
--
function FtpExport:clearFtpJobs( props )
local srvcName = self:_getServiceName( props )
local cleared = ftpAgApp:clearJobs( srvcName, props )
if cleared then
self.jobNum = 1
self.taskNum = 1
--app:show{ info="Jobs are cleared.", actionPrefKey="Jobs are cleared" }
else
-- I assume appropriate error/warning logs have already been issued.
end
end
--- Called when new export is getting under way (i.e. early in process-rendered-photos func/meth).
--
-- It makes sure the appropriate directory infrastructure exists, and ascertains the correct job-num to use.
--
function FtpExport:newFtpJob()
local srvcName = self:_getServiceName( self.exportParams )
local s, m = self:_initFtpService( srvcName )
if s then
return ftpAgApp:initJob( srvcName, self.jobNum ) -- assure dir.
else
return nil, "Unable to initialize ftp job (service) - "..(m or "no additional info" )
end
end
--- get fully qualified (unique) service name based on properties.
--
-- @usage *** critical side effect: service name will be assigned to properties *if* not publish service properties.
-- @usage *** to be clear: do NOT assign the output of this to service-name property, since it includes app-name prefix.
--
function FtpExport:_getServiceName( props )
local myName
if props.LR_publish_connectionName then -- ps
myName = props.LR_publish_connectionName
else
if str:is( props.serviceName ) then
-- note: service names are unique within a plugin, and since app-name is prepended, uniqueness is "guaranteed".
myName = props.serviceName
else
Debug.pause( "service-name should be pre-defined export setting/param" ) -- this could happen if export attempted without visiting export dialog box / publish settings (e.g. via old preset).
myName = LrUUID.generateUUID()
props.serviceName = myName -- for next time.
end
end
-- note: make sure you dont assign the output of this to service-name property or else there will be a double app-name prefix.
return app:getAppName().." - "..myName
end
-- Confine service name to a unique value - note: app-name will be auto-pre-pended, so assuming multiple plugins won't have same app-name
-- (would be more robust to use toolkit ID), one need only assure names are unique within the plugin.
--
-- @usage Lr assures publish-service instance names are unique, so no special action required in that case.
--
-- @usage call when pub-conn-name or exp-srvc-name changes.
--
function FtpExport:_confineServiceName( props, value ) -- note: @19/Mar/2014 3:48, value is a don't care.
app:pcall{ name="FtpExport_confineServiceName", async=not LrTasks.canYield(), guard=App.guardSilent, main=function( call )
if str:is( props.LR_publish_connectionName ) then
if not str:is( props.serviceName ) then
props.serviceName = props.LR_publish_connectionName -- init service name to that of publish service as a good guess,
-- but note: no need to do it if props.service-name already set, since in publish-service context the conn-name will override
-- whatever is set as service-name, and no reason to overstep boundaries (stomp on user-edited service-name setting).
-- else - already set: leave it.
end
elseif not str:is( props.serviceName ) then
props.serviceName = "Any Unique Name "..LrUUID.generateUUID()
-- else good-to-go..
end
end }
end
--- Method version of like-named static function.
--
-- @usage Same as base-class method, except pre-init ftp job.
-- @usage Note: ftp-export needs special finale logic too (to close ftp job) - not handled in this method, since it needs to weather thrown errors.
--
function FtpExport:processRenderedPhotosMethod()
local s, m = self:newFtpJob()
if s then
app:log( "FTP service initialized, current job-num: ^1", self.jobNum )
Export.processRenderedPhotosMethod( self )
else
app:logE( m or "no errm" )
self:cancelExport() -- note: this is silent.
return
end
end
--- Perform export service wrap-up.
--
-- @usage Override this method in derived class to log stats...
-- @usage *** IMPORTANT: This method is critical to export integrity.
-- Derived export class must remember to call it at end of special
-- export finale method.
--
function FtpExport:finale( service )
local srvcName = self:_getServiceName( self.exportParams )
ftpAgApp:endOfJob( srvcName, self.jobNum, self.taskNum )
Export.finale( self, service, service.status, service.message ) -- old-style calling for compatibility, I guess (doesn't hurt to pass extra params) ###2.
end
--- Called when export is initiated.
--
-- @usage This method helps export manager track managed exports (all exports based on this class are managed).
--
function FtpExport:initiate( service )
Export.initiate( self, service )
end
--- Service function of base export - processes renditions.
--
-- <p>You can override this method in its entirety, OR just:</p><ul>
--
-- <li>checkBeforeRendering
-- <li>processRenderedPhoto
-- <li>processRenderingFailure
-- <li>(and finale maybe)</ul>
--
function FtpExport:service( service )
Export.service( self, service )
end
-- E X P O R T D I A L O G B O X
--- Handle change to properties under authority of base export class.
--
-- <p>Presently there are none - but that could change</p>
--
-- @usage Call from derived class to ensure base property changes are handled.
--
function FtpExport:propertyChangeHandlerMethod( props, name, value )
-- reminder: nil name just won't match test clauses.
self:_confineServiceName( props ) -- assure appropriate service-name initialization.
--Export.propertyChangeHandlerMethod( self, props, name, value ) -- no-op, but reserved for future.
end
--- Do whatever when dialog box opening.
--
-- <p>Nuthin to do so far - but that could change.</p>
--
-- @usage Call from derived class to ensure dialog is initialized according to base class.
--
function FtpExport:startDialogMethod( props )
view:setObserver( props, 'serviceName', FtpExport, FtpExport.propertyChangeHandler )
view:setObserver( props, 'LR_publish_connectionName', FtpExport, FtpExport.propertyChangeHandler )
--view:setObserver( props, 'localRootPath', FtpExport, FtpExport.propertyChangeHandler )
end
--- Do whatever when dialog box closing.
--
-- <p>Nuthin yet...</p>
--
-- @usage Call from derived class to ensure dialog is ended properly according to base class.
--
function FtpExport:endDialogMethod( props, why )
end
--- Standard export sections for top of dialog.
--
-- <p>Presently seems like a good idea to replicate the plugin manager sections.</p>
--
-- @usage These sections can be combined with derived class's in their entirety, or strategically...
--
function FtpExport:sectionsForTopOfDialogMethod( vf, props )
return Manager.sectionsForTopOfDialog( vf, props ) -- instantiates the proper manager object via object-factory.
end
--- Standard export sections for bottom of dialog.
--
-- <p>Reminder: Lightroom supports named export presets.</p>
--
-- @usage These sections can be combined with derived class's in their entirety, or strategically - presently there are none.
--
function FtpExport:sectionsForBottomOfDialogMethod( vf, props )
local sections = Export.sectionsForBottomOfDialogMethod( self, vf, props ) or {{
title = app:getAppName() .. " Settings",
}}
local s1 = sections[#sections]
if str:is( props.LR_publish_connectionName ) then -- publish service: ftp serice name is same as publish connection name.
app:logV( "publish service: ftp service name is same as publish connection name." )
else
s1[#s1 + 1] = vf:row {
vf:static_text {
title = "Service Name",
width = share'labelWidth',
},
vf:edit_field {
value = bind'serviceName',
width = share'dataWidth',
},
}
end
--[[ *** local-root-path is handled in derived class.
s1[#s1 + 1] = vf:row {
vf:static_text {
title = "Local Root Path",
width = share'labelWidth',
},
vf:edit_field {
value = bind'localRootPath',
width = share'dataWidth',
},
}
--]]
s1[#s1 + 1] = view:startFtpSettingsView( self, props, nil, nil, { width=share'labelWidth' }, { width=share'dataWidth' } )
return sections
end
-- E X P O R T S U B - T A S K M E T H O D S
--- Remove photos not to be rendered, or whatever.
--
function FtpExport:checkBeforeRendering()
self.nPhotosToRender = self.nPhotosToExport
end
--- Process one rendered photo.
--
function FtpExport:processRenderedPhoto( rendition, photoPath )
self.nPhotosRendered = self.nPhotosRendered + 1
local srvcName = self:_getServiceName( self.exportParams )
local s, m = ftpAgApp:uploadFile( srvcName, photoPath, self.jobNum, self.taskNum ) -- note: job-num specified job-dir, task-num specified ordering in control-file (disk) "queue".
self.taskNum = self.taskNum + 1 -- regardless, I guess.
if s then
app:logV( "Upload via FTP has been scheduled." )
else
app:logE( "Unable to schedule file upload via FTP - ^1", m or "no m" )
end
end
function FtpExport:getJobDir()
assert( self.exportParams, "no export params" )
assert( self.jobNum, "no job num" )
local srvcName = self:_getServiceName( self.exportParams )
return ftpAgApp:getJobDir( srvcName, self.jobNum )
end
function FtpExport:uploadFile( photoPath )
local srvcName = self:_getServiceName( self.exportParams )
local s, m = ftpAgApp:uploadFile( srvcName, photoPath, self.jobNum, self.taskNum ) -- note: job-num specified job-dir, task-num specified ordering in control-file (disk) "queue".
self.taskNum = self.taskNum + 1 -- regardless, I guess.
if s then
app:logV( "Upload via FTP has been scheduled." ) -- local path determined by ftp-ag-app based on service config. remote path determined by ftp-app itself.
else
app:logE( "Unable to schedule file upload via FTP - ^1", m or "no m" )
end
return s, m
end
function FtpExport:purgeFile( photoPath )
local srvcName = self:_getServiceName( self.exportParams )
local s, m = ftpAgApp:purgeFile( srvcName, photoPath, self.jobNum, self.taskNum ) -- note: job-num specified job-dir, task-num specified ordering in control-file (disk) "queue".
self.taskNum = self.taskNum + 1 -- regardless, I guess.
if s then
app:logV( "Purge file via FTP has been scheduled." )
else
app:logE( "Unable to schedule purge file via FTP - ^1", m or "no m" )
end
return s, m
end
function FtpExport:purgeFolder( photoPath )
local srvcName = self:_getServiceName( self.exportParams )
local s, m = ftpAgApp:purgeFolder( srvcName, photoPath, self.jobNum, self.taskNum ) -- note: job-num specified job-dir, task-num specified ordering in control-file (disk) "queue".
self.taskNum = self.taskNum + 1 -- regardless, I guess.
if s then
app:logV( "Purge folder via FTP has been scheduled." )
else
app:logE( "Unable to schedule purge folder via FTP - ^1", m or "no m" )
end
return s, m
end
--- Process one photo rendering failure.
--
-- @param message error message generated by Lightroom.
--
function FtpExport:processRenderingFailure( rendition, message )
Export.processRenderingFailure( self, rendition, message )
end
--- FtpExport parameter change handler proper - static function
--
-- @usage Generally no reason to override in derived class - override method instead.
-- @usage Just calls corresponding method of actual (i.e derived class) export object.
--
function FtpExport.propertyChangeHandler( id, props, name, value )
if FtpExport.dialog == nil then
return
end
--assert( FtpExport.dialog ~= nil, "No export dialog to handle change." ) - not sure whether the potential for dialog
-- box to not be created has disappeared or not, hmmm...... ###3 - hasn't been happening though...
FtpExport.dialog:propertyChangeHandlerMethod( props, name, value )
end
--- Called when dialog box is opening - static function as required by Lightroom.
--
-- @usage Generally no reason to override in derived class - override method instead.
-- @usage Just calls corresponding method of actual (i.e derived class) export object.
--
function FtpExport.startDialog( props )
if FtpExport.dialog == nil then
FtpExport.dialog = objectFactory:newObject( 'ExportDialog' )
end
assert( FtpExport.dialog ~= nil, "No export dialog to start." )
FtpExport.dialog:startDialogMethod( props )
end
--- Called when dialog box is closing.
--
-- @usage Generally no reason to override in derived class - override method instead.
-- @usage Just calls corresponding method of actual (i.e derived class) export object.
--
function FtpExport.endDialog( props, why )
if FtpExport.dialog == nil then
return
end -- ###3 ditto
assert( FtpExport.dialog ~= nil, "No export dialog to end." )
FtpExport.dialog:endDialogMethod( props, why )
end
--- Presently, it is imagined to just replicate the manager's top section in the export.
--
-- @usage Generally no reason to override in derived class - override method instead.
-- @usage Just calls corresponding method of actual (i.e derived class) export dialog object.
--
function FtpExport.sectionsForTopOfDialog( vf, props )
if FtpExport.dialog == nil then
FtpExport.dialog = objectFactory:newObject( 'ExportDialog' )
end
assert( FtpExport.dialog ~= nil, "No export dialog for top sections." )
return FtpExport.dialog:sectionsForTopOfDialogMethod( vf, props )
end
--- Presently, there are no default sections imagined for the export bottom.
--
-- @usage Generally no reason to override in derived class - override method instead.
-- @usage Just calls corresponding method of actual (i.e derived class) export dialog object.
--
function FtpExport.sectionsForBottomOfDialog( vf, props )
if FtpExport.dialog == nil then
FtpExport.dialog = objectFactory:newObject( 'ExportDialog' )
end
assert( FtpExport.dialog ~= nil, "No export dialog for bottom sections." )
local sections = FtpExport.dialog:sectionsForBottomOfDialogMethod( vf, props )
return sections
end
--- Called to process render(ing) photos.
--
-- <p>Photos have not started rendering when this is first called.
-- Once started, they will be rendered in an asynchronous task within Lightroom.
-- Rendering may be started implicitly by invoking the renditions iterator of the export context,
-- or explicitly by calling export-context - start-rendering.</p>
--
-- @usage Generally no reason to override in derived class - override method instead.
-- @usage 1st: creates derived export object via object factory,
-- <br>then calls corresponding method of actual (i.e derived class) export object.
-- @usage Rendering order is not guaranteed, however experience dictates they are in order.
--
function FtpExport.processRenderedPhotos( functionContext, exportContext )
if FtpExport.exports[exportContext] ~= nil then
app:logError( "FtpExport not properly terminated." ) -- this should never happen provided derived class remembers to call base class finale method.
FtpExport.exports[exportContext] = nil -- terminate improperly...
end
FtpExport.exports[exportContext] = objectFactory:newObject( 'Export', { functionContext = functionContext, exportContext = exportContext } )
FtpExport.exports[exportContext]:processRenderedPhotosMethod()
end
local exportParams = {}
-- this param is needed by ftp-ag-app it will be superceded by LR_publish_connectionName if publish-service-only, but export-service-too plugins must populate it.
exportParams[#exportParams + 1] = { key="serviceName", default="" } -- populated by func.
--exportParams[#exportParams + 1] = { key="localRootPath", default="" } -- ###2 - this must come from derived class, or will be filled in via hook or crook.
-- note: these are as supported by view--get-ftp-settings-view:
exportParams[#exportParams + 1] = { key = 'server', default = "ftp.mydomain.com" }
exportParams[#exportParams + 1] = { key = 'username', default = "me" }
exportParams[#exportParams + 1] = { key = 'password', default = "secret" }
exportParams[#exportParams + 1] = { key = 'path', default = "wwwroot" }
exportParams[#exportParams + 1] = { key = 'port', default = 21 }
exportParams[#exportParams + 1] = { key = 'passive', default = "normal" }
exportParams[#exportParams + 1] = { key = 'protocol', default = "ftp" }
exportParams[#exportParams + 1] = { key = 'remoteDirPathForFtpUploadTest', default = "" }
FtpExport.exportPresetFields = exportParams
-- note: there are no standard (base class) export preset fields, if there were, then consider uncommenting this:
--tab:appendArray( FtpExport.exportPresetFields, Export.exportPresetFields or {} )
FtpExport:inherit( Export )
return FtpExport |
Config = {
MaxLifetime = 60.0 * 3.0, -- In seconds, how long the blip takes to fade out.
} |
local Resolver = {}
Resolver.URLs = {
"^https?://[A-Za-z0-9%.%-]*%.?youtu%.be/([A-Za-z0-9_%-]+)",
"^https?://[A-Za-z0-9%.%-]*%.?youtube%.com/watch%?.*v=([A-Za-z0-9_%-]+)",
"^https?://[A-Za-z0-9%.%-]*%.?youtube%.com/v/([A-Za-z0-9_%-]+)",
"^[A-Za-z0-9%.%-]*%.?youtu%.be/([A-Za-z0-9_%-]+)",
"^[A-Za-z0-9%.%-]*%.?youtube%.com/watch%?.*v=([A-Za-z0-9_%-]+)",
"^[A-Za-z0-9%.%-]*%.?youtube%.com/v/([A-Za-z0-9_%-]+)"
}
function Resolver:ValidateURL(url)
for i,templateURL in ipairs(self.URLs) do
if url:match(templateURL) then
return url:match(templateURL)
end
end
return false
end
-- https://www.youtube.com/watch?v=dQw4w9WgXcQ
function Resolver:Resolve(url,callback)
http.Fetch(string.format(Sonus.Config.SwadYTURL,self:ValidateURL(url)),function(data)
local metadata = util.JSONToTable(data)
-- metadata.url = string.format(Sonus.Config.SwadYTStreamURL,self:ValidateURL(url))
callback(metadata)
end,Sonus.Error)
end
Sonus.Resolver:AddResolver("youtube",Resolver)
:SetName("YouTube")
|
------------------------------------------------------------
-- Highmaul.lua
--
-- Abin
-- 2014/10/19
------------------------------------------------------------
local module = CompactRaid:GetModule("RaidDebuff")
if not module then return end
local TIER = 6 -- The Warlords of Draenor
local INSTANCE = 477 -- Highmaul
local BOSS
-- Kargath Bladefist
BOSS = 1128
module:RegisterDebuff(TIER, INSTANCE, BOSS, 159113)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 159178, 5)
-- The Butcher
BOSS = 971
module:RegisterDebuff(TIER, INSTANCE, BOSS, 156152, 5)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 156143)
-- Tectus
BOSS = 1195
-- Brackenspore
BOSS = 1196
module:RegisterDebuff(TIER, INSTANCE, BOSS, 163242)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 159463)
-- Twin Ogron
BOSS = 1148
module:RegisterDebuff(TIER, INSTANCE, BOSS, 143834)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 174404)
-- Ko'ragh
BOSS = 1153
module:RegisterDebuff(TIER, INSTANCE, BOSS, 163134)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 161242)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 162186, 5)
-- Imperator Mar'gok
BOSS = 1197
module:RegisterDebuff(TIER, INSTANCE, BOSS, 156238)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 159515)
module:RegisterDebuff(TIER, INSTANCE, BOSS, 158605, 5)
-- Common
|
local core = require('hw.arm.luaqemu.core')
local json = require('hw.arm.luaqemu.json')
machine_cpu = 'cortex-r4'
memory_regions = {
region_rom = {
name = 'mem_rom',
start = 0x8000000,
size = 0x20000
},
region_ram = {
name = 'mem_ram',
start = 0x20000000,
size = 0x20000
}
}
file_mappings = {
main_rom = {
name = './CrusherTests/Linux/stm32/testing/main.bin',
start = 0x8000000,
size = 0x1548
}
}
cpu = {
env = {
thumb = true,
cpsr = 0x400001ff,
regs = {}
},
reset_pc = 0x8000000
}
function bp_main()
local fuzz_buffer = 0x20001000
local stack_pointer = 0x20020000
lua_set_register(0, fuzz_buffer)
lua_set_register(13, stack_pointer)
local seed = read_file(fuzz_parameters.path_to_input)
lua_write_memory(fuzz_buffer, seed, #seed)
lua_set_register(1, #seed)
print "\nStart emulate"
C.printf("Input file - %s\n", fuzz_parameters.path_to_input)
lua_set_pc(0x80003ac)
lua_continue()
end
function bp_memcpy()
local fuzz_buffer = tonumber(lua_get_register(1))
local fuzz_buffer_size = tonumber(lua_get_register(2))
print "-----------------------------------------------------------"
hex_dump(lua_read_mem(fuzz_buffer, fuzz_buffer_size), fuzz_buffer)
print "-----------------------------------------------------------"
C.printf("Destination address 0x%x, size of source buffer 0x%x\n", lua_get_register(0), lua_get_register(2))
lua_continue()
end
function bp_end()
print "Stop emulate"
os.exit()
end
breakpoints = {
-- breakpoint on main function
[0x8000000] = bp_main,
-- breakpoint on memcmpy function
[0x8000312] = bp_memcpy,
-- breakpoint on end emulation
[0x80003b0] = bp_end
}
function post_init(config)
fuzz_parameters = json.read_json(config)
lua_continue()
end
|
require "love.graphics"
serialization_version = 1.0
return
{
anim_width = 32,
anim_height = 32,
animations =
{
heart =
{
frame_rate = 5,
frames = {
frame0={image="IMGID",quad=love.graphics.newQuad(0,0,32,32,64,64), xpos = 0, ypos = -8, rot = 0, xscale = 1, yscale = 1, xpivot = 16, ypivot = 16, r=255,g=255,b=255},
},
},
}
} |
local utf8 = require 'arken.utf8'
local test = {}
test.should_return_lower_case_string = function()
local str = 'ALÇA'
assert( string.len(str) == 5 )
assert( utf8.len(str) == 4 )
end
return test
|
-- Lexer.lua/Patterns.lua
-- String patterns the lexer uses to search and identify types
-- Always start patterns with ^ to indicate the beginning, and never use $ at end
local patterns = {
{
pattern = "^%[%[.-%]%]",
name = "string"
},
{
pattern = "^([\"']).-%1",
name = "string"
},
{
pattern = "^0x%w+",
name = "hexadecimal"
},
{
pattern = "^%d+%.%d+",
name = "float"
},
{
pattern = "^%d+",
name = "int"
},
{
pattern = "^%w+",
name = "word"
},
{
pattern = "^([%-%+/%*=])",
name = "operator"
},
{
pattern = "^%s+",
name = "whitespace"
},
{
pattern = "^.",
name = "unknown"
}
}
return patterns |
object_tangible_storyteller_prop_pr_droid_race = object_tangible_storyteller_prop_shared_pr_droid_race:new {
}
ObjectTemplates:addTemplate(object_tangible_storyteller_prop_pr_droid_race, "object/tangible/storyteller/prop/pr_droid_race.iff")
|
local Q = require 'Q'
local qconsts = require 'Q/UTILS/lua/q_consts'
local get_ptr = require 'Q/UTILS/lua/get_ptr'
local Scalar = require 'libsclr'
require 'Q/UTILS/lua/strict'
local tests = {}
tests.t1 = function()
local n_idx = 65
local n_val = n_idx
local idx = Q.seq( {start = 0, by = 1, qtype = "I4", len = n_idx} )
local src = Q.seq( {start = 0, by = 2, qtype = "I4", len = n_idx} )
local dst = Q.const( {val = 100, qtype = "I4", len = n_val} )
local exp_dst = Q.seq( {start = 100, by = 2, qtype = "I4", len = n_idx} )
dst:eval()
Q.add_vec_val_by_idx(idx, src, dst)
-- Q.print_csv({idx, src, dst})
local n1, n2 = Q.sum(Q.vveq(dst, exp_dst)):eval()
assert(n1 == n2)
print("Successfully completed t1")
end
tests.t2 = function()
local n_idx = 65
local n_val = n_idx
local idx = Q.seq( {start = n_idx, by = 1, qtype = "I4", len = n_idx} )
local src = Q.seq( {start = 0, by = 2, qtype = "I4", len = n_idx} )
local dst = Q.const( {val = 100, qtype = "I4", len = n_val} )
dst:eval()
Q.add_vec_val_by_idx(idx, src, dst)
-- Q.print_csv({idx, src, dst})
local n1, n2 = Q.sum(Q.vveq(dst, dst)):eval()
assert(n1 == n2)
print("Successfully completed t2")
end
return tests
|
return PlaceObj("ModDef", {
"title", "MDS Laser Cheats",
"id", "ChoGGi_MDSLaserCheats",
"steam_id", "2428918892",
"pops_any_uuid", "69f8402d-8226-4928-828d-b564c5942673",
"lua_revision", 1001569,
"version", 2,
"version_major", 0,
"version_minor", 2,
"image", "Preview.jpg",
"author", "ChoGGi",
"code", {
"Code/Script.lua",
},
"has_options", true,
"TagGameplay", true,
"description", [[Pew pew pew!
Mod Options:
Hit Chance: The chance to hit a meteor.
Fire Rate: Cooldown between shots in seconds.
Protect Range: If meteors would fall within dist range it can be destroyed by the laser (in hexes).
Shoot Range: Range at which meteors can be destroyed. Should be greater than the protection range (in hexes).
Rotate Speed: Platform's rotation speed to target meteor in Deg/Sec.
Beam Time: For how long laser beam is visible (in ms).
If you want super pew pew; then make fire rate 0, and rotate speed max.
Requested by Kommi.]],
})
|
modifier_antimage_mana_break_lua = class({})
--------------------------------------------------------------------------------
-- Classifications
function modifier_antimage_mana_break_lua:IsHidden()
return true
end
function modifier_antimage_mana_break_lua:IsPurgable()
return false
end
--------------------------------------------------------------------------------
-- Initializations
function modifier_antimage_mana_break_lua:OnCreated( kv )
-- references
self.mana_break = self:GetAbility():GetSpecialValueFor( "mana_per_hit" ) -- special value
self.mana_damage_pct = self:GetAbility():GetSpecialValueFor( "damage_per_burn" ) -- special value
end
function modifier_antimage_mana_break_lua:OnRefresh( kv )
-- references
self.mana_break = self:GetAbility():GetSpecialValueFor( "mana_per_hit" ) -- special value
self.mana_damage_pct = self:GetAbility():GetSpecialValueFor( "damage_per_burn" ) -- special value
end
function modifier_antimage_mana_break_lua:OnDestroy( kv )
end
--------------------------------------------------------------------------------
-- Modifier Effects
function modifier_antimage_mana_break_lua:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_PROCATTACK_BONUS_DAMAGE_PHYSICAL,
}
return funcs
end
function modifier_antimage_mana_break_lua:GetModifierProcAttack_BonusDamage_Physical( params )
if IsServer() and (not self:GetParent():PassivesDisabled()) then
local target = params.target
local result = UnitFilter(
target, -- Target Filter
DOTA_UNIT_TARGET_TEAM_ENEMY, -- Team Filter
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_CREEP, -- Unit Filter
DOTA_UNIT_TARGET_FLAG_MANA_ONLY, -- Unit Flag
self:GetParent():GetTeamNumber() -- Team reference
)
if result == UF_SUCCESS then
local mana_burn = math.min( target:GetMana(), self.mana_break )
target:ReduceMana( mana_burn )
self:PlayEffects( target )
return mana_burn * self.mana_damage_pct
end
end
end
function modifier_antimage_mana_break_lua:PlayEffects( target )
-- Get Resources
local particle_cast = "particles/generic_gameplay/generic_manaburn.vpcf"
local sound_cast = "Hero_Antimage.ManaBreak"
-- Create Particle
local effect_cast = ParticleManager:CreateParticle( particle_cast, PATTACH_ABSORIGIN, target )
-- ParticleManager:SetParticleControl( effect_cast, 0, vControlVector )
ParticleManager:ReleaseParticleIndex( effect_cast )
-- Create Sound
EmitSoundOn( sound_cast, target )
end
|
-- BN class
--
-- The BN (stands for big number) is used to represent either float or big integers.
-- It uses the lua-bint library to perform operations on large integers.
-- The compiler needs this class because Lua cannot work with integers large than 64 bits.
-- Large integers are required to work with uint64,
-- to mix operation between different integers ranges at compile time,
-- and to do error checking on invalid large integers.
-- BN is actually a bint class created with 192bits and with some extensions.
local bn = require 'nelua.thirdparty.bint'(192)
-- This is used to check if a table is a 'bn'.
bn._bn = true
-- Helper to convert a number composed of strings parts in any base to a big number.
local function from(base, expbase, int, frac, exp)
local neg = false
-- we need to read as positive, we can negate later
if int:match('^%-') then
neg = true
int = int:sub(2)
end
-- handle infs and nans
if int == 'inf' then
return not neg and math.huge or -math.huge
elseif int == 'nan' then
-- 0.0/0.0 always is a nan in lua
return 0.0/0.0
end
-- parse the integral part
local n = bn.zero()
for i=1,#int do
local d = tonumber(int:sub(i,i), base)
assert(d)
n = (n * base) + d
end
-- parse the fractional part
if frac then
local fracnum = from(base, expbase, frac)
local fracdiv = bn.ipow(base, #frac)
n = n + fracnum / fracdiv
end
-- parse the exponential part
if exp then
n = n * bn.ipow(expbase, tonumber(exp))
end
-- negate if needed
if neg then
n = -n
end
return n
end
-- Converts a hexadecimal number composed of string parts to a big number.
function bn.fromhex(int, frac, exp)
if frac and exp then -- hexadecimal float with fraction and exponent
return tonumber(string.format('0x%s.%sp%s', int, frac, exp))
elseif frac then -- hexadecimal float with fraction
return tonumber(string.format('0x%s.%s', int, frac))
elseif exp then -- hexadecimal float with exponent
return tonumber(string.format('0x%sp%s', int, exp))
else -- hexadecimal integral
return from(16, 2, int)
end
end
-- Converts a binary number composed of string parts to a big number.
function bn.frombin(int, frac, exp)
return from(2, 2, int, frac, exp)
end
-- Converts a decimal number composed of string parts strings to a big number.
function bn.fromdec(int, frac, exp)
if frac and exp then -- decimal float with fraction and exponent
return tonumber(string.format('%s.%se%s', int, frac, exp))
elseif frac then -- decimal float with fraction
return tonumber(string.format('%s.%s', int, frac))
elseif exp then -- decimal float with exponent
return tonumber(string.format('%se%s', int, exp))
else -- decimal integral
return from(10, 10, int)
end
end
-- Split a number string into string parts.
function bn.splitdecsci(s)
-- handle nans and infs
if s == 'inf' or s == '-inf' or s == 'nan' or s == '-nan' then
return s
end
-- split into string parts
local int, frac, exp = s:match('^(-?%d+)[.]?(%d+)[eE]?([+-]?%d*)$')
if not int then
int, exp = s:match('^(-?%d+)[eE]?([+-]?%d*)$')
end
assert(int)
if exp == '' then
exp = nil
end
return int, frac, exp
end
-- Convert a number composed of string parts in a specific base to a big number.
function bn.from(base, int, frac, exp)
if base == 'dec' then
return bn.fromdec(int, frac, exp)
elseif base == 'hex' then
return bn.fromhex(int, frac, exp)
else
assert(base == 'bin')
return bn.frombin(int, frac, exp)
end
end
-- Convert an integral number to a string in hexadecimal base.
function bn.tohex(v, bits)
if bits then -- wrap around
v = v:bwrap(bits)
end
return bn.tobase(v, 16, true)
end
-- Convert an integral number to a string in binary base.
function bn.tobin(v, bits)
if bits then -- wrap around
v = v:bwrap(bits)
end
return bn.tobase(v, 2, true)
end
-- Convert an integral number to a string in decimal base.
function bn.todec(v)
return bn.tobase(v, 10, false)
end
-- Convert to a string in decimal base considering fractional values,
-- possibly using scientific notation for float numbers, to have a shorter output.
function bn.todecsci(v, maxdigits)
if bn.isbint(v) then
-- in case of bints we can just it as string
return tostring(v)
end
-- force converting it to a number
v = tonumber(v)
local ty = math.type(v)
if ty == 'integer' then
-- in case of lua integers we can return it as string
return tostring(v)
end
-- can only be a float from now on
assert(ty == 'float')
-- 64 bit floats can only be uniquely represented by 17 decimals digits
maxdigits = maxdigits or 17
-- try to use a small float representation if possible
if maxdigits >= 16 then
local s = string.format('%.15g', v)
if tonumber(s) == v then
return s
end
s = string.format('%.16g', v)
if tonumber(s) == v then
return s
end
end
-- return the float represented in a string
return string.format('%.'..maxdigits..'g', v)
end
-- Check if the input is a NaN (not a number).
function bn.isnan(x)
-- a nan is never equals to itself
return x ~= x
end
-- Check if the input is infinite.
function bn.isinfinite(x)
return math.type(x) == 'float' and math.abs(x) == math.huge
end
-- Convert a bn number to a lua integer/number no precision is lost.
function bn.compress(x)
if bn.isbint(x) then
if x <= math.maxinteger and x >= math.mininteger then
return x:tointeger()
else
return x
end
else
return tonumber(x)
end
end
return bn
|
_, _, _, _, _, _, val = reaper.get_action_context()
reaper.SetExtState("reaticulate", "command", "set_default_channel=" .. tostring(val), false)
|
local colors = require("base46").get_colors "base_30"
return {
NvimTreeEmptyFolderName = { fg = colors.folder_bg },
NvimTreeEndOfBuffer = { fg = colors.darker_black },
NvimTreeFolderIcon = { fg = colors.folder_bg },
NvimTreeFolderName = { fg = colors.folder_bg },
NvimTreeGitDirty = { fg = colors.red },
NvimTreeIndentMarker = { fg = colors.grey_fg },
NvimTreeNormal = { bg = colors.darker_black },
NvimTreeNormalNC = { bg = colors.darker_black },
NvimTreeOpenedFolderName = { fg = colors.folder_bg },
NvimTreeGitIgnored = { fg = colors.light_grey },
NvimTreeWinSeparator = {
fg = colors.darker_black,
bg = colors.darker_black,
},
NvimTreeWindowPicker = {
fg = colors.red,
bg = colors.black2,
},
NvimTreeCursorLine = {
bg = colors.black2,
},
}
|
RUNNER = {}
local id = 0
function RUNNER:New()
id = id + 1
return setmetatable({tests = {}, name = string.format("unnamed runner #%d", id)}, RUNNER)
end
function RUNNER:Test()
for tid, tname in ipairs(self.tests) do
self.tests[tid] = TEST:New()
self.tests[tid].name = self.name .. "::" .. string.sub(tname, 5):Replace("_", " ")
self.tests[tid].Run = self[tname]
self.tests[tid]:Test()
end
end
function RUNNER:IsSuccessful()
for _, test in pairs(self.tests) do
if not test.success then
return false
end
end
return true
end
RUNNER.__index = RUNNER
RUNNER.__newindex = function(self, key, value)
rawset(self, key, value)
if isstring(key) and string.sub(key, 1, 4):lower() == "test" then
table.insert(self.tests, key)
end
end |
--[[
This is just the empty tank.
]]
local Directions = assert(foundation.com.Directions)
local table_copy = assert(foundation.com.table_copy)
local FluidStack = assert(yatm_fluids.FluidStack)
local FluidTanks = assert(yatm_fluids.FluidTanks)
local FluidMeta = assert(yatm_fluids.FluidMeta)
local fluid_tank_tiles = {
"yatm_fluid_tank_edge.png",
"yatm_fluid_tank_detail.png",
}
minetest.register_node("yatm_fluids:fluid_tank", {
basename = "yatm_fluids:fluid_tank",
description = "Fluid Tank",
groups = {
cracky = 1,
fluid_tank = 1,
fluid_interface_in = 1,
fluid_interface_out = 1,
},
connects_to = {"group:fluid_tank"},
tiles = fluid_tank_tiles,
special_tiles = {
},
use_texture_alpha = "clip",
drawtype = "glasslike_framed",
paramtype = "light",
paramtype2 = "glasslikeliquidlevel",
is_ground_content = false,
sunlight_propagates = true,
sounds = yatm.node_sounds:build("glass"),
refresh_infotext = yatm_fluids.fluid_tank_refresh_infotext,
on_construct = yatm_fluids.fluid_tank_on_construct,
after_destruct = yatm_fluids.fluid_tank_after_destruct,
after_place_node = function (pos)
FluidTanks.replace_fluid(pos, Directions.D_NONE, FluidStack.new_empty(), true)
end,
fluid_interface = assert(yatm_fluids.fluid_tank_fluid_interface),
on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
return itemstack
end,
})
local steel_tank_fluid_interface = table_copy(yatm_fluids.fluid_tank_fluid_interface)
steel_tank_fluid_interface._private.capacity = 32000
function steel_tank_fluid_interface:on_fluid_changed(pos, dir, new_stack)
local node = minetest.get_node(pos)
yatm.queue_refresh_infotext(pos, node)
end
function steel_fluid_tank_refresh_infotext(pos)
local meta = minetest.get_meta(pos)
local node = minetest.get_node(pos)
local fluid_interface = FluidTanks.get_fluid_interface(pos)
local fluid_stack = FluidMeta.get_fluid_stack(meta, "tank")
if FluidStack.is_empty(fluid_stack) then
meta:set_string("infotext", "Tank <EMPTY>")
else
local capacity = fluid_interface:get_capacity(pos, 0)
meta:set_string("infotext", "Tank <" .. FluidStack.to_string(fluid_stack, capacity) .. ">")
end
end
minetest.register_node("yatm_fluids:steel_fluid_tank", {
basename = "yatm_fluids:steel_fluid_tank",
description = "Steel Fluid Tank",
groups = {
cracky = 1,
fluid_tank = 1,
filled_fluid_tank = 1,
fluid_interface_in = 1,
fluid_interface_out = 1,
},
tiles = {
"yatm_steel_fluid_tank_top.png",
"yatm_steel_fluid_tank_bottom.png",
"yatm_steel_fluid_tank_side.png",
"yatm_steel_fluid_tank_side.png",
"yatm_steel_fluid_tank_side.png",
"yatm_steel_fluid_tank_side.png",
},
use_texture_alpha = "opaque",
paramtype = "light",
paramtype2 = "facedir",
place_param2 = 0,
is_ground_content = false,
sunlight_propagates = true,
sounds = yatm.node_sounds:build("glass"),
refresh_infotext = steel_fluid_tank_refresh_infotext,
on_construct = yatm_fluids.fluid_tank_on_construct,
after_destruct = yatm_fluids.fluid_tank_after_destruct,
after_place_node = function (pos)
FluidTanks.replace_fluid(pos, Directions.D_NONE, FluidStack.new_empty(), true)
end,
fluid_interface = steel_tank_fluid_interface,
connects_to = {"group:fluid_tank"},
})
|
local skynet = require "skynet"
local memory = require "skynet.memory"
local socket = require "skynet.socket"
local _caches = {}
local function get_data(key)
local cache = _caches[key]
if cache then
if os.time() <= cache.deadline then
return cache.data
end
_caches[key] = nil
end
end
local function set_data(key, data, timeout)
local cache = {
data = data,
deadline = os.time()+(timeout or 3)
}
_caches[key] = cache
end
local weak_day_names = {"星期日","星期一","星期二","星期三","星期四","星期五","星期六"}
local function showDate(ts)
ts = ts or os.time()
local date = os.date("*t", ts)
return os.date("%Y/%m/%d %X", ts)..weak_day_names[date.wday]
end
local _ip2regiond
local function get_ip2regiond()
if not _ip2regiond then
local list = skynet.call(".launcher", "lua", "LIST")
for address,param in pairs(list) do
if param:find("meiru/ip2regiond", 1, true) then
_ip2regiond = address
end
end
end
return _ip2regiond
end
local _serverds
local function get_serverds()
if not _serverds then
_serverds = {}
local list = skynet.call(".launcher", "lua", "LIST")
for address, param in pairs(list) do
if param:find("meiru/serverd", 1, true) then
table.insert(_serverds, address)
end
end
end
return _serverds
end
-------------------------------------------------
--system
-------------------------------------------------
local function excute_cmd(cmd)
local file = io.popen(cmd)
local ret = file:read("*all")
return ret
end
local function get_system_info()
local cmd = "top -bn 2 -i -c -d 0.1"
local output = excute_cmd(cmd)
if type(output) ~= "string" or #output == 0 then
return
end
local i, j = output:find("%s\ntop.*" )
local ret = output:sub(i, j)
return ret
end
local function match_num(str, patten)
local num = str:match(patten)
assert(num)
num = num:match("[0-9]+%.*[0-9]*")
num = tonumber(num)
assert(num)
return num
end
local function get_cpu_usage(info)
local cpu_user = match_num(info, "[0-9]+%.?[0-9]*%sus,")
local cpu_system = match_num(info, "[0-9]+%.?[0-9]*%ssy,")
local cpu_nice = match_num(info, "[0-9]+%.?[0-9]*%sni,")
local cpu_idle = match_num(info, "[0-9]+%.?[0-9]*%sid,")
local cpu_wait = match_num(info, "[0-9]+%.?[0-9]*%swa,")
local cpu_hardware_interrupt = match_num(info, "[0-9]+%.?[0-9]*%shi,")
local cpu_software_interrupt = match_num(info, "[0-9]+%.?[0-9]*%ssi,")
local cpu_steal_time = match_num(info, "[0-9]+%.?[0-9]*%sst")
local cpu_total = cpu_user + cpu_nice + cpu_system + cpu_wait + cpu_hardware_interrupt + cpu_software_interrupt + cpu_steal_time + cpu_idle
local cpu_cost = cpu_user + cpu_nice + cpu_system + cpu_wait + cpu_hardware_interrupt + cpu_software_interrupt + cpu_steal_time
local cpu_usage = cpu_cost / cpu_total
return cpu_usage
end
local function get_mem_usage(info)
local mem_total = match_num(info, "Mem[%d%p%s]*[0-9]+%stotal")
local mem_used = match_num(info, "free[%d%p%s]*[0-9]+%sused")
local mem_usage = mem_used / mem_total
return mem_usage
end
local system_stats = {}
local function do_system_record()
local info = get_system_info()
local cpu_usage = get_cpu_usage(info)
local mem_usage = get_mem_usage(info)
local system_stat = {
time = os.date("%x %H:%M"),
cpu_usage = cpu_usage,
mem_usage = mem_usage
}
table.insert(system_stats, system_stat)
if #system_stats > 60 then
table.remove(system_stats, 1)
end
local delta_time = 60*3
skynet.timeout(delta_time*100, function()
do_system_record()
end)
end
local function start_system_record()
local info = get_system_info()
if not info then
skynet.error("很抱歉,该系统不支持命令:top -bn 2 -i -c -d 0.1")
return
end
do_system_record()
end
-------------------------------------------------
-------------------------------------------------
local command = {}
function command.system_stat()
return system_stats
end
function command.service_stat()
local list = skynet.call(".launcher", "lua", "LIST")
local infos = {}
local meminfo = memory.info()
if not next(meminfo) then
for sname,_ in pairs(list) do
infos[sname] = 0
end
else
for sid,cmem in pairs(meminfo) do
infos[skynet.address(sid)] = cmem
end
end
local snames = {}
for sname in pairs(infos) do
table.insert(snames, sname)
end
table.sort(snames)
local services = {}
local service, sname
local ok, stat, kb
for _,sname in ipairs(snames) do
local cmem = infos[sname]
service = {
sname = sname,
cmem = cmem/1024.0,
param = list[sname],
}
if service.param then
ok, stat = pcall(skynet.call, sname, "debug", "STAT")
if ok then
service.mqlen = stat.mqlen
service.cpu = stat.cpu
service.message = stat.message
service.task = stat.task
else
skynet.error("error:", stat)
end
ok, kb = pcall(skynet.call, sname,"debug","MEM")
if ok then
service.lmem = kb
else
skynet.error("error:", kb)
end
end
table.insert(services, service)
end
return services
end
function command.mem_stat()
local stat = {
total = memory.total(),
block = memory.block()
}
return stat
end
function command.net_stat()
local list = skynet.call(".launcher", "lua", "LIST")
local netstats = socket.netstat()
table.sort(netstats, function(a, b)
return a.address < b.address
end)
for _, info in ipairs(netstats) do
info.sname = skynet.address(info.address)
info.read = info.read and info.read/1024.0
info.write = info.write and info.write/1024.0
info.wbuffer = info.wbuffer and info.wbuffer/1024.0
info.rtime = info.rtime and info.rtime/100.0
info.wtime = info.wtime and info.wtime/100.0
info.param = list[info.sname]
info.address = nil
end
return netstats
end
function command.client_stat()
local ips = {}
local clients = {}
local ip2client = {}
local id = 1
local serverds = get_serverds()
for _,serverd in ipairs(serverds) do
local client_infos = skynet.call(serverd, "lua", "client_infos")
for _,info in ipairs(client_infos) do
table.insert(clients, info)
info.slaveid = skynet.address(info.slaveid)
info.last_visit_time = showDate(info.last_visit_time)
info.id = id
if info.ip then
ip2client[info.ip] = info
table.insert(ips, info.ip)
end
id = id+1
end
end
local ip2regiond = get_ip2regiond()
if ip2regiond then
local ips2addrs = skynet.call(ip2regiond, "lua", "ips2region", ips)
local client
for ip,addr in pairs(ips2addrs) do
client = ip2client[ip]
client.address = addr
end
end
return clients
end
function command.online_stat()
local serverds = get_serverds()
local total_records = {}
for _,serverd in ipairs(serverds) do
local server_records = skynet.call(serverd, "lua", "server_records")
for minute,record in pairs(server_records) do
local tt_record = total_records[minute]
if not tt_record then
tt_record = record
total_records[minute] = tt_record
else
assert(tt_record.time == minute)
tt_record.ip_times = tt_record.ip_times+record.ip_times
tt_record.visit_times = tt_record.visit_times+record.visit_times
end
end
end
local minutes = {}
for minute,record in pairs(total_records) do
record.time = os.date("%x %H:%M", minute*1800)
table.insert(minutes, minute)
end
table.sort(minutes)
local rets = {}
for i,v in ipairs(minutes) do
table.insert(rets, total_records[v])
end
return rets
end
skynet.start(function()
start_system_record()
skynet.dispatch("lua", function(_,_,cmd,...)
local data = get_data(cmd)
if data then
skynet.ret(skynet.pack(data))
return
end
local f = command[cmd]
if f then
data = f(...)
set_data(cmd, data)
skynet.ret(skynet.pack(data))
else
assert(false, "error no support cmd"..cmd)
end
end)
end)
|
local item = FindInTable(ItemSpawnerManager.itemCategories, "category", "FoodVendorInventory")
item.group =
{
{ class = "SeedsBeets", percent = 100 },
{ class = "SeedsBrushPeas", percent = 100 },
{ class = "SeedsCarrots", percent = 100 },
{ class = "SeedsPotatoes", percent = 100 },
{ class = "SeedsWatermelons", percent = 100 },
{ class = "SeedsPumpkins", percent = 100 },
{ class = "SeedsRadishes", percent = 100 },
{ class = "SeedsSnapPeas", percent = 100 },
{ class = "SeedsTomatoes", percent = 100 },
{ class = "guide_cooking_1", percent = 100 },
{ class = "guide_cooking_2", percent = 100 },
{ class = "guide_cooking_3", percent = 100 },
{ class = "ChickenCooked", percent = 40 },
{ class = "HamCooked", percent = 40 },
{ class = "BearMeatCooked", percent = 40 },
{ class = "DeerMeatSteakCooked", percent = 40 },
{ class = "WolfMeatSteakCooked", percent = 40 },
{ class = "ClamSingle", percent = 40 },
{ class = "AppleFresh", percent = 100 },
{ class = "Berries", percent = 100 },
{ class = "Honeycomb", percent = 80 },
{ class = "PeanutButter", percent = 100 },
{ class = "Jelly", percent = 100 },
{ class = "CoffeeBag", percent = 100 },
{ class = "Bread", percent = 100 },
{ class = "CerealBox", percent = 100 },
{ class = "BeerCan", percent = 50 },
{ class = "Champagne", percent = 30 },
{ class = "MiniBottleGin", percent = 25 },
{ class = "MiniBottleVodka", percent = 25 },
{ class = "MiniBottleWhiskey", percent = 45 },
{ class = "ChocolateBox", percent = 40 },
{ class = "EggNog", percent = 25 },
{ class = "GingerBreadMan", percent = 25 },
{ class = "HersheysBar", percent = 90 },
{ class = "MRE", percent = 40 },
}
|
local Root = script:FindFirstAncestor("BarrierCreator")
local Roact = require(Root.dependencies.Roact)
local e = Roact.createElement
local MouseGhostSphere = require(script.Parent.Parent.components.mouseGhostSphere)
local BarrierPlacer = require(script.Parent.Parent.components.barrierPlacer)
local Dictionary = require(Root.dictionary)
local StudioPluginContext = require(script.Parent.Parent.components.studio.studioPluginContext)
-----------------------------------------------------------------------------
local AddOperationMode = Roact.Component:extend("AddOperationMode")
function AddOperationMode:init()
end
function AddOperationMode:render()
return Roact.createFragment({
MouseGhostSphere = e(MouseGhostSphere, {
active = true
}),
BarrierPlacer = e(BarrierPlacer, {
active = true
})
})
end
-- function AddOperationMode:didMount()
-- end
function AddOperationMode:didUpdate(lastProps)
end
function AddOperationMode:willUnmount()
end
function AddOperationModeWrapper(props)
return e(StudioPluginContext.Consumer, {
render = function(pluginModule)
return e(AddOperationMode, Dictionary.merge(props, {
plugin = pluginModule.plugin
}))
end
})
end
return AddOperationModeWrapper |
--[[
Copyright (c) 2020 jakub-vesely
This software is published under MIT license. Full text of the licence is available at https://opensource.org/licenses/MIT
--]]
TinyBlockBase = require "tiny_block_base"
local Power = {}
Power.__index = Power
Power.InaAddresses = {
INA_I2C_0x40 = 0,
INA_I2C_0x41 = 1,
INA_I2C_0x44 = 2,
INA_I2C_0x45 = 3,
}
function Power:is_charging()
return cl_power_is_charging(self.address)
end
function Power:_get_ina_i2c_address()
return cl_power_get_ina_i2c_address(self.address)
end
function Power:get_ina_i2c_address()
if self.ina_address == 0 then
self.ina_address = self:_get_ina_i2c_address()
end
return self.ina_address
end
function Power:set_ina_i2c_address(ina_addresss)
if ina_addresss < Power.InaAddresses.INA_I2C_0x40 or ina_addresss > Power.InaAddresses.INA_I2C_0x45 then
error("unexpected ina_address")
end
cl_power_set_ina_a0a1(self.address, ina_addresss)
self.ina_address = self:_get_ina_i2c_address()
end
function Power:initialize_ina()
cl_power_initialize_ina(self:_get_ina_i2c_address())
end
function Power:get_voltage()
return cl_power_get_voltage(self:get_ina_i2c_address())
end
function Power:get_current_ma()
return cl_power_get_current_ma(self:get_ina_i2c_address())
end
function Power:new(address)
local o = setmetatable(TinyBlockBase:new(address), Power)
print("power address", o.address)
o.ina_address = 0
o:initialize_ina()
return o
end
setmetatable(Power, {__index = TinyBlockBase})
return Power |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('StoryBit', {
ActivationEffects = {
PlaceObj('Marsquake', {
'Epicenter', "MoholeMine",
'Radius', 160,
}),
},
Effects = {},
Enables = {
"Marsquake_MoreQuakes",
},
Prerequisites = {},
ScriptDone = true,
SuppressTime = 2160000,
TextReadyForValidation = true,
TextsDone = true,
group = "Wonders",
id = "Marsquake_MoreQuakes",
})
|
print()
for cnt = 1, 10, 1 do
print(string.format("%2d: Hello from Lua script.", cnt))
end
|
local cfg = module("cfg/items")
for k,v in pairs(cfg.items) do
vRP.defInventoryItem(k,v[1],v[2])
end |
vim.g.mapleader = ' '
local keymap = require 'lib.utils'.keymap
keymap('n', '<leader>', '<NOP>')
keymap('n', '<leader><F5>', '<cmd>so $MYVIMRC<cr>')
-- clipboard
keymap('v', '<leader>y', '"+y')
keymap('n', '<leader>Y', '"+yg_')
keymap('n', '<leader>y', '"+y')
keymap('v', '<leader>p', '"+p')
keymap('v', '<leader>P', '"+P')
keymap('n', '<leader>p', '"+p')
keymap('n', '<leader>P', '"+P')
|
-- TableauxProver
-- Copyright: Laborat'orio de Tecnologia em M'etodos Formais (TecMF)
-- Pontif'icia Universidade Cat'olica do Rio de Janeiro (PUC-Rio)
-- Author: Bruno Lopes ([email protected]
-- Edward Hermann ([email protected]))
-- TableauxProver is licensed under a Creative Commons Attribution 3.0 Unported License
function love.conf(t)
t.title = "TableauxProver" -- The title of the window the game is in (string)
t.author = "TecMF" -- The author of the game (string)
t.identity = nil -- The name of the save directory (string)
t.version = "0.8.0" -- The LÖVE version this game was made for (number)
t.console = false -- Attach a console (boolean, Windows only)
t.release = false -- Enable release mode (boolean)
t.screen.width = 800 -- The window width (number)
t.screen.height = 600 -- The window height (number)
t.screen.fullscreen = false -- Enable fullscreen (boolean)
t.screen.vsync = true -- Enable vertical sync (boolean)
t.screen.fsaa = 0 -- The number of FSAA-buffers (number)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.audio = false -- Enable the audio module (boolean)
t.modules.keyboard = true -- Enable the keyboard module (boolean)
t.modules.event = true -- Enable the event module (boolean)
t.modules.image = false -- Enable the image module (boolean)
t.modules.graphics = true -- Enable the graphics module (boolean)
t.modules.timer = true -- Enable the timer module (boolean)
t.modules.mouse = true -- Enable the mouse module (boolean)
t.modules.sound = false -- Enable the sound module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
end
|
--proc/icon: icon resources.
setfenv(1, require'winapi')
require'winapi.winuser'
ffi.cdef[[
HICON LoadIconW(
HINSTANCE hInstance,
LPCWSTR lpIconName);
BOOL DestroyIcon(HICON hIcon);
]]
IDI_APPLICATION = 32512
IDI_INFORMATION = 32516
IDI_QUESTION = 32514
IDI_WARNING = 32515
IDI_ERROR = 32513
IDI_WINLOGO = 32517 --same as IDI_APPLICATION in XP
IDI_SHIELD = 32518 --not found in XP
function LoadIconFromInstance(hInstance, name)
if not name then hInstance, name = nil, hInstance end
return own(checkh(C.LoadIconW(hInstance,
ffi.cast('LPCWSTR', wcs(MAKEINTRESOURCE(name))))), DestroyIcon)
end
function DestroyIcon(hicon)
checknz(C.DestroyIcon(hicon))
end
if not ... then
print(LoadIconFromInstance(IDI_APPLICATION))
print(LoadIconFromInstance(IDI_INFORMATION))
end
|
--
-- Created by IntelliJ IDEA.
-- User: Kunkka
-- Date: 6/21/17
-- Time: 16:15
-- To change this template use File | Settings | File Templates.
--
local shader = {}
shader.cachedGLPrograms = {}
function shader:addGLProgram(vPath, fPath)
local glProgram = cc.GLProgram:createWithFilenames(vPath, fPath)
if glProgram then
local ps = string.split(fPath, "/")
local key = string.split(ps[#ps], ".")[1]
gk.log("addGLProgram -> %s, fPath = %s", key, fPath)
cc.GLProgramCache:getInstance():addGLProgram(glProgram, key)
self.cachedGLPrograms[key] = { shader = glProgram, vPath = vPath, fPath = fPath }
end
end
function shader:getCachedGLProgram(key)
return cc.GLProgramCache:getInstance():getGLProgram(key)
-- return self.cachedGLPrograms[key] and self.cachedGLPrograms[key].shader or nil
end
function shader:reloadOnRenderRecreated()
if not self.recreateListener then
local eventDispatcher = cc.Director:getInstance():getEventDispatcher()
local customListener = cc.EventListenerCustom:create("event_renderer_recreated", function(event)
gk.log("reload shader onRenderRecreated")
if self.cachedGLPrograms then
for _, info in pairs(self.cachedGLPrograms) do
local shader = info.shader
shader:reset()
shader:initWithFilenames(info.vPath, info.fPath)
shader:bindAttribLocation(cc.ATTRIBUTE_NAME_POSITION, cc.VERTEX_ATTRIB_POSITION)
shader:bindAttribLocation(cc.ATTRIBUTE_NAME_COLOR, cc.VERTEX_ATTRIB_COLOR)
shader:bindAttribLocation(cc.ATTRIBUTE_NAME_TEX_COORD, cc.VERTEX_ATTRIB_TEX_COORD)
shader:link()
shader:updateUniforms()
end
end
end)
eventDispatcher:addEventListenerWithFixedPriority(customListener, -1)
self.recreateListener = customListener
end
end
function shader:removeRecreateListener()
if self.recreateListener then
local eventDispatcher = cc.Director:getInstance():getEventDispatcher()
eventDispatcher:removeEventListener(self.recreateListener)
self.recreateListener = nil
end
end
function shader:getDefaultShader()
return cc.GLProgramCache:getInstance():getGLProgram("ShaderPositionTextureColor_noMVP")
end
function shader:getDefaultMvpShader()
return cc.GLProgramCache:getInstance():getGLProgram("ShaderPositionTextureColor_MVP")
end
return shader
|
local gears = require("gears")
local awful = require("awful")
local buttons = gears.table.join(
-- awful.button({ }, 4, awful.tag.viewnext),
-- awful.button({ }, 5, awful.tag.viewprev)
)
return buttons
|
local class = require 'pl.class'
local M = class()
M._name = 'Eventbus'
function M:_init()
self.handlers = {}
end
function M:on(name, handler)
local t = self.handlers[name]
if t == nil then
self.handlers[name] = {[handler] = true}
else
t[handler] = true
end
end
function M:off(name, handler)
local t = self.handlers[name]
if t ~= nil then
t[handler] = nil
if next(t) == nil then
self.handlers[name] = nil
end
end
end
function M:emit(name, ...)
for h in pairs(self.handlers[name] or {}) do
h(...)
end
end
return M |
function onCreate()
for i = 0, getProperty('unspawnNotes.length')-1 do
if getPropertyFromGroup('unspawnNotes', i, 'noteType') == 'Bomb Note' then
setPropertyFromGroup('unspawnNotes', i, 'texture', 'BOMBNOTE_assets');
setPropertyFromGroup('unspawnNotes', i, 'ignoreNote', true);
end
end
function noteMiss(id, i, noteType, isSustainNote)
if noteType == 'Bomb Note' then
end
end
end
function goodNoteHit(id, noteData, noteType, isSustainNote)
if noteType == 'Bomb Note' then
setProperty('health',getProperty('health')-0.3)
characterPlayAnim('boyfriend', 'burn', true);
end
end |
--[[
- PAP Engine ( https://github.com/viticm/plainframework1 )
- $Id bootstrap.lua
- @link https://github.com/viticm/plainframework1 for the canonical source repository
- @copyright Copyright (c) 2014- viticm( [email protected]/[email protected] )
- @license
- @user viticm<[email protected]/[email protected]>
- @date 2017/01/17 17:13
- @uses 全局定义,这里的方法和变量不能被重载,重载的变量和函数禁止放在此处
--]]
g_debug = true
-- Libarays.
if OS_WIN then
package.cpath = BASEPATH .."/public/luaclib/?.dll" -- Framework build with cxx.
else
package.cpath = BASEPATH .."/public/luaclib/?.so" -- Framework build with cxx.
end
-- Scripts.
if g_debug then
package.path = "./?.lua;" .. ROOTPATH .. "/?.lua;"..
BASEPATH .."/public/lualib/?.lua;".. BASEPATH .."/public/luaconf/?.lua"
else
package.path = "./?.lc;" .. ROOTPATH .. "?.lc;"..
BASEPATH .."/public/lualib/?.lc" .. BASEPATH .."/public/luaconf/?.lc"
end
require("preload")
|
return require(script.Parent.Parent["[email protected]"]["option"])
|
local methods = require("null-ls.methods")
local h = require("null-ls.helpers")
local end_col_from_quote = h.diagnostics.adapters.end_col.from_quote.end_col
local severities = {
error = h.diagnostics.severities.error,
errors = h.diagnostics.severities.error,
warning = h.diagnostics.severities.warning,
warnings = h.diagnostics.severities.warning,
}
local function parse_diagnostics(params, done)
if not params.output then
done(nil)
return
end
local diagnostics = {}
local current_severity = h.diagnostics.severities.error
local output = params.output:gsub("\r\n?", "\n") or params.output
if not output then
done(nil)
return
end
local function parse_line(line)
local _, severity = line:match([[^(%d*) ([%w]+):$]])
if severity then
current_severity = severities[severity] or h.diagnostics.severities.error
return
end
local filename, row, col, message = line:match([[([^:]+):(%d+):(%d+): (.*)$]])
if not (filename and row and col and message) then
return
end
-- only return diagnostics for the current file
if filename ~= params.temp_path then
return
end
local diagnostic = {
row = row,
col = col,
message = message,
severity = current_severity,
}
local quote = message:match([['(.+)']])
if not quote then
quote = message:match([[ ([^%s]+)$]])
end
if quote then
local entries = {
col = col,
_quote = quote,
}
local content_line = params.content[tonumber(row)]
diagnostic.end_col = end_col_from_quote(entries, content_line)
end
return diagnostic
end
for _, l in ipairs(vim.split(output, "\n")) do
local diagnostic = parse_line(l)
if diagnostic then
table.insert(diagnostics, diagnostic)
end
end
done(diagnostics)
end
return h.make_builtin({
name = "teal",
meta = {
url = "https://github.com/teal-language/tl",
description = "The compiler for Teal, a typed dialect of Lua.",
},
method = methods.internal.DIAGNOSTICS,
filetypes = { "teal" },
generator_opts = {
command = "tl",
args = { "check", "$FILENAME" },
check_exit_code = function(code)
return code <= 1
end,
from_stderr = true,
to_temp_file = true,
on_output = parse_diagnostics,
},
factory = h.generator_factory,
})
|
function testClose()
local output = io.output()
assert(io.type(output) == 'file')
output:close()
assert(io.type(output) == 'closed file')
assert(not io.stdout:close())
success, err_msg = pcall(io.close, output)
assert(not success)
assert(err_msg)
return true
end
function testFlushBegin()
io.write 'hello world!'
return true
end
function testFlushEnd()
io.flush()
return true
end |
return {
name = "Mage";
description = "An old tome of basic mana techniques for the apprentice mage.";
pointsGainPerLevel = 1;
startingPoints = 1;
lockPointsOnClassChange = true;
minLevel = 10;
maxLevel = 30;
-- visual attributes
layoutOrder = 2;
bookColor = Color3.fromRGB(11, 110, 130);
bookBackgroundImage = "rbxassetid://4149155849";
thumbnail = "rbxassetid://3559734054";
abilities = {
{
id = 4;
prerequisiteId = nil;
};
{
id = 9;
prerequisiteId = nil;
};
{
id = 12;
prerequisiteId = nil;
};
};
} |
--[[
O is the global options object
Formatters and linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- general
O.auto_complete = true
O.auto_close_tree = 0
O.wrap_lines = false
O.document_highlight = false
-- python
-- add things like O.python.formatter.yapf.exec_path
-- add things like O.python.linter.flake8.exec_path
-- add things like O.python.formatter.isort.exec_path
O.python.formatter = 'yapf'
-- O.python.linter = 'flake8'
O.python.isort = true
O.python.autoformat = true
O.python.diagnostics.virtual_text = true
O.python.diagnostics.signs = true
O.python.diagnostics.underline = true
-- json
O.json.autoformat = true
|
local state = {}
function state:enter(from)
self.from = from -- record previous state
end
function state:draw()
local W, H = love.graphics.getWidth(), love.graphics.getHeight()
-- draw previous screen
self.from:draw()
-- overlay with pause message
love.graphics.setColor(1, 0.2, 0.75, 0.65)
love.graphics.rectangle('fill', 0, 0, W, H)
love.graphics.setColor(1, 1, 1)
love.graphics.printf('Option screen', 0, H / 4, W, 'center')
love.graphics.printf('Press "x" to end the game', 0, H / 3, W, 'center')
end
function state:update(dt) end
function state:keyreleased(key, code)
if key == 'x' then Gamestate.push(TitleScreen, 1) end
if key == 'escape' then Gamestate.pop() end
end
return state |
t={}
function t:fn(x)
self.x=x
end
t:fn(1)
t.fn(t,1) |
local is_sublist = require('sublist')
describe('sublist', function()
it('should consider an empty list to be a sublist of an empty list', function()
assert.equal(true, is_sublist({}, {}))
end)
it('should consider an empty list to be a sublist of a non-empty list', function()
assert.equal(true, is_sublist({}, { 1, 2, 3 }))
end)
it('should consider a list to be a sublist of itself', function()
assert.equal(true, is_sublist({ 1, 2, 3 }, { 1, 2, 3 }))
end)
it('should not consider a subset to be a sublist', function()
assert.equal(false, is_sublist({ 1, 2, 3 }, { 2, 1, 3 }))
end)
it('should find a sublist at the beginning of a list', function()
assert.equal(true, is_sublist({ 11, 22, 33 }, { 11, 22, 33, 44, 55 }))
end)
it('should find a sublist in the middle of a list', function()
assert.equal(true, is_sublist({ 12, 13, 14 }, { 11, 12, 13, 14, 15 }))
end)
it('should find a sublist at the end of a list', function()
assert.equal(true, is_sublist({ 30, 40, 50 }, { 10, 20, 30, 40, 50 }))
end)
it('should be able to determine when a list is not a sublist', function()
assert.equal(false, is_sublist({ 1, 2, 3 }, { 5, 6, 7, 8, 9 }))
end)
it('should not consider almost sublists to be sublists', function()
assert.equal(false, is_sublist({ 3, 4, 5 }, { 1, 2, 4, 5, 6 }))
assert.equal(false, is_sublist({ 3, 4, 5 }, { 1, 2, 3, 4, 6 }))
end)
it('should find a sublist when there are multiple instances of the sublist', function()
assert.equal(true, is_sublist({ 1, 2, 3 }, { 0, 1, 2, 3, 4, 1, 2, 3, 6 }))
end)
end)
|
function create()
set("PlayState.autoCamZooming", false);
end
function onDadHit(note)
print(get("parameter1.strumTime"))
set("PlayState.autoCamZooming", true);
end |
describe('merge', function()
it('produces values from the first observable if it is the only argument', function()
local observable = Rx.Observable.fromRange(5):merge()
expect(observable).to.produce(1, 2, 3, 4, 5)
end)
it('unsubscribes from all input observables', function()
local observableA = Rx.Observable.create(function(observer)
return
end)
local unsubscribeB = spy()
local subscriptionB = Rx.Subscription.create(unsubscribeB)
local observableB = Rx.Observable.create(function(observer)
return subscriptionB
end)
local subscription = observableA:merge(observableB):subscribe()
subscription:unsubscribe()
expect(#unsubscribeB).to.equal(1)
end)
it('unsubscribes from all input observables included completed', function()
local observableA = Rx.Observable.empty()
local unsubscribeB = spy()
local subscriptionB = Rx.Subscription.create(unsubscribeB)
local observableB = Rx.Observable.create(function(observer)
return subscriptionB
end)
local subscription = observableA:merge(Rx.Observable.empty(), observableB):subscribe()
subscription:unsubscribe()
expect(#unsubscribeB).to.equal(1)
end)
it('produces values from all input observables, in order', function()
local observableA = Rx.Subject.create()
local observableB = Rx.Subject.create()
local merged = observableA:merge(observableB)
local onNext, onError, onCompleted = observableSpy(merged)
observableA:onNext('a')
observableB:onNext('b')
observableB:onNext('b')
observableA:onNext('a')
observableA:onCompleted()
observableB:onCompleted()
expect(onNext).to.equal({{'a'}, {'b'}, {'b'}, {'a'}})
end)
it('completes when all source observables complete', function()
local observableA = Rx.Subject.create()
local observableB = Rx.Subject.create()
local complete = spy()
Rx.Observable.merge(observableA, observableB):subscribe(nil, nil, complete)
expect(#complete).to.equal(0)
observableA:onNext(1)
expect(#complete).to.equal(0)
observableB:onNext(2)
expect(#complete).to.equal(0)
observableB:onCompleted()
expect(#complete).to.equal(0)
observableA:onCompleted()
expect(#complete).to.equal(1)
end)
end)
|
streams = {
[0] = { "Radio Off", "" },
}
function getStreams()
return streams
end
function getStationsFromServer(streamsFromServer)
if streamsFromServer and #streamsFromServer > 0 then
streams = streamsFromServer
outputDebugString("Client: recieved "..(#streamsFromServer).." stations from server.")
end
end
addEvent("getStationsFromServer", true)
addEventHandler("getStationsFromServer", root, getStationsFromServer)
function sendStationsRequestToServer()
triggerServerEvent("sendStationsToClient", localPlayer)
end
addCommandHandler("getstations", sendStationsRequestToServer)
function resourceStart()
setTimer(sendStationsRequestToServer, 5000, 1)
setTimer(sendStationsRequestToServer, RADIO_CLIENT_REFRESHRATE, 0)
end
addEventHandler("onClientResourceStart", resourceRoot, resourceStart) |
return {'eivol','eivorm','eivormig','eivlies','eivoer','eivliezen','eivolle','eivormige'} |
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
if not status_ok then
vim.notify("Unable to require nvim-lsp-installer", vim.lsp.log_levels.ERROR,
{title = "Plugin error"})
return
end
local servok, lsp_install_srv = pcall(require, "nvim-lsp-installer.servers")
if not servok then
vim.notify("Unable to require nvim-lsp-installer.servers",
vim.lsp.log_levels.ERROR, {title = "Plugin error"})
return
end
local handok, lsphandlers = pcall(require, "lsp.handlers")
if not handok then
vim.notify("Unable to require lsp.handlers", vim.lsp.log_levels.ERROR,
{title = "Config error"})
return
end
local lspconfigok, lspconfig = pcall(require, "lspconfig")
if not lspconfigok then
vim.notify("Unable to require lspconfig", vim.lsp.log_levels.ERROR,
{title = "Config error"})
return
end
local myconfigs = {
["bashls"] = true,
["yamlls"] = true,
["pyright"] = true,
["efm"] = false,
["solargraph"] = true,
["gopls"] = true,
["dockerls"] = true,
["clangd"] = true,
["sumneko_lua"] = true,
["jsonls"] = true,
["perlnavigator"] = true
}
lsp_installer.setup()
for myserver, enabled in pairs(myconfigs) do
local _, requested_server = lsp_install_srv.get_server(myserver)
if enabled then
if not requested_server:is_installed() then
-- Queue the server to be installed
vim.notify("Queing " .. myserver, vim.lsp.log_levels.INFO,
{title = "LSP installer"})
requested_server:install()
end
local opts = {
on_attach = lsphandlers.on_attach,
capabilities = lsphandlers.capabilities,
debounce_text_changes = 150
}
local ok, srvopts = pcall(require, "lsp.settings." .. myserver)
if not ok then
vim.notify("Unable to require lsp.settings." .. myserver,
vim.lsp.log_levels.ERROR, {title = "Config error"})
else
opts = vim.tbl_deep_extend("force", srvopts, opts)
end
lspconfig[myserver].setup(opts)
else
if requested_server:is_installed() then
vim.notify("Uninstalling " .. myserver, vim.lsp.log_levels.INFO,
{title = "LSP installer"})
requested_server:uninstall()
end
end
end
|
module( 'GameModule', package.seeall )
local GameModules = {}
local callbackModuleRelease = {}
local callbackModuleLoad = {}
function addGameModuleReleaseListener( func )
table.insert( callbackModuleRelease, func )
end
function addGameModuleLoadListener( func )
table.insert( callbackModuleLoad, func )
end
function registerGameModule( name, m )
GameModules[ name ] = m
end
function getGameModule( name )
return GameModules[ name ]
end
function hasGameModule( name )
return GameModules[ name ] ~= nil
end
function findGameModule( name )
for k, m in pairs( GameModules ) do
if k == name or k:endwith( name ) then
return m
end
end
return nil
end
--[[
create a envrionment
]]
local gameModulePaths = {}
function addGameModulePath( pattern )
table.insert( gameModulePaths, pattern )
end
function getGameModulePath()
return gameModulePaths
end
function clearGameModulePath()
gameModulePaths = {}
end
local gameModuleMap = {} --for runtime cache
function addGameModuleMapping( srcPath, dstPath )
gameModuleMap[ srcPath ] = dstPath
end
local function searchFile( path )
local mapped = gameModuleMap[ path ]
if mapped then
local fp = io.open( mapped, 'r' )
if fp then
fp:close()
return mapped
else
_warn( 'mapped script not found:', path, mapped )
end
end
path = path:gsub( '%.','/' )
for i, pattern in ipairs( gameModulePaths ) do
local f = pattern:gsub( '?', path )
local fp = io.open(f,'r')
if fp then fp:close() return f end
end
return nil
end
--------------------------------------------------------------------
local GameModuleMT = { __index = _G }
local _createEmptyModule, _loadGameModule, _requireGameModule
local _errorInfos = {}
local function flushErrorInfo()
local infos = _errorInfos
_errorInfos = {}
return infos
end
local function pushErrorInfo( data )
table.insert( _errorInfos, data )
end
local _require = require
function _createEmptyModule( path, fullpath )
local m = {
_NAME = path,
_PATH = path,
_SOURCE = fullpath,
__REQUIRES = {},
__REQUIREDBY = {}
}
m._M = m
local requireInModule = function( path, ... )
local loaded, errType, errMsg, tracebackMsg = _requireGameModule( path )
if loaded then
m.__REQUIRES[ path ] = true
loaded.__REQUIREDBY[ m._PATH ] = true
return loaded
end
if errType ~= 'notfound' then
-- print( errMsg )
-- if tracebackMsg then print( tracebackMsg ) end
error( 'error loading game module', 2 )
end
return _require( path, ... )
end
local importInModule = function( path, ... )
local result = requireInModule( path, ... )
if result then
for k, v in pairs( result ) do
if type(k) == 'string' and not rawget( m, k ) and not k:startwith('_') then
m[ k ] = v
end
end
end
return result
end
m.require = requireInModule
m.import = importInModule
return setmetatable( m, GameModuleMT )
end
--------------------------------------------------------------------
function _requireGameModule( path )
local m = GameModules[ path ]
if m then return m end
return _loadGameModule( path )
end
--------------------------------------------------------------------
function _loadGameModule( path )
local fullpath = searchFile( path )
if not fullpath then
return nil, 'notfound'
end
_stat( 'loading module from', fullpath )
local chunk, compileErr = loadfile( fullpath )
if not chunk then
pushErrorInfo{
path = path,
fullpath = fullpath,
errtype = 'compile',
msg = compileErr
}
print( 'failtocompile', compileErr )
return nil, 'failtocompile', compileErr
end
local m = _createEmptyModule( path, fullpath )
setfenv( chunk, m )
local errMsg, tracebackMsg
local function _onError( msg )
errMsg = msg
tracebackMsg = debug.traceback(2)
end
local ok = xpcall( chunk, _onError )
if ok then
registerGameModule( path, m )
for i, func in ipairs( callbackModuleLoad ) do
func( path, m )
end
return m
else
pushErrorInfo{
path = path,
fullpath = fullpath,
errtype = 'load',
msg = errMsg,
traceback = tracebackMsg
}
print( 'failtoload', errMsg )
return nil, 'failtoload', errMsg, tracebackMsg
end
end
--------------------------------------------------------------------
function loadGameModule( path, flushError )
local loaded, errType, errMsg, tracebackMsg = _requireGameModule( path )
if loaded then return loaded, {} end
if flushError then
return false, flushErrorInfo()
else
return false, _errorInfos
end
end
--------------------------------------------------------------------
function releaseGameModule( path, releasedModules )
releasedModules = releasedModules or {}
_stat( 'release game module', path )
local oldModule = GameModules[ path ]
if not oldModule then
_warn( 'can not release module', path )
return nil
end
releasedModules[ path ] = true
for i, func in ipairs( callbackModuleRelease ) do
func( path, oldModule )
end
GameModules[ path ] = nil
for requiredBy in pairs( oldModule.__REQUIREDBY ) do
releaseGameModule( requiredBy, releasedModules )
end
return oldModule
end
--------------------------------------------------------------------
function getGameModule( path )
return GameModules[ path ]
end
--------------------------------------------------------------------
function reloadGameModule( path )
flushErrorInfo()
--release
local releasedModules = {}
releaseGameModule( path, releasedModules )
--reload
for path1 in pairs( releasedModules ) do
loadGameModule( path1 )
end
local m = findGameModule( path )
return m, flushErrorInfo()
end
---------------------------------------------------------------------
function unloadGameModule( path )
flushErrorInfo()
local released = {}
releaseGameModule( path, released )
for path1 in pairs( released ) do
if path1 ~= path then
loadGameModule( path1 )
end
end
return flushErrorInfo()
end
--------------------------------------------------------------------
function compilePlainLua( inputFile, outputFile )
local f = loadfile( inputFile )
if f then
local str = string.dump( f )
local fp = io.open( outputFile, 'w' )
if fp then
fp:write( str )
fp:close()
return true
end
end
return false
end |
mpackage = "dartmudlet"
|
return PlaceObj("ModDef", {
"dependencies", {
PlaceObj("ModDependency", {
"id", "ChoGGi_Library",
"title", "ChoGGi's Library",
"version_major", 9,
"version_minor", 6,
}),
},
"title", "Services Show Comfort Boost",
"id", "ChoGGi_ServicesShowComfortBoost",
"lua_revision", 1001569,
"steam_id", "2212802600",
"pops_any_uuid", "80fc30b4-6e46-4fff-af2a-7f06eaa2e954",
"version", 1,
"version_major", 0,
"version_minor", 1,
"image", "Preview.png",
"author", "ChoGGi",
"code", {
"Code/Script.lua",
},
--~ "has_options", true,
"TagBuildings", true,
"TagInterface", true,
"TagOther", true,
"description", [[Services only show the "Service Comfort" number, but that's just used as a threshold. It's not the actual comfort received.
This mod adds the "Comfort increase on visit" to the UI (what shows up in the comfort log after a visit).
]],
})
|
ITEM.name = "Supressed Lolife"
ITEM.desc = "A semi-automatic handgun fitted with a Silencer that fires .44 Magnum Rounds"
ITEM.model = "models/arxweapon/podonok.mdl"
ITEM.class = "m9k_mrp_padonak_silenced"
ITEM.weaponCategory = "sidearm"
ITEM.width = 2
ITEM.height = 1
ITEM.price = 300 |
function source_of_life(keys)
local caster = keys.caster
local target = keys.target
if Utils:is_real_hero(target) or target:IsClone() then
local ability = keys.ability
local damage = caster:GetLevel() * ability:GetSpecialValueFor("lvl_damage")
local damage_table = {
victim = target,
attacker = caster,
damage = damage,
damage_type = DAMAGE_TYPE_MAGICAL,
ability = ability
}
ApplyDamage(damage_table)
local healing_percent = ability:GetSpecialValueFor("healing_percent") / 100
caster:Heal(math.ceil(damage * healing_percent), caster)
PopupHealing(caster, math.ceil(damage * healing_percent))
end
end
|
object_tangible_furniture_modern_bar_piece_straight_s1_treasure_map = object_tangible_furniture_modern_shared_bar_piece_straight_s1_treasure_map:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_modern_bar_piece_straight_s1_treasure_map, "object/tangible/furniture/modern/bar_piece_straight_s1_treasure_map.iff")
|
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
local test = require "integration_test"
local t_utils = require "integration_test.utils"
local zw = require "st.zwave"
local zw_test_utils = require "integration_test.zwave_test_utils"
local Configuration = (require "st.zwave.CommandClass.Configuration")({ version=4 })
local SwitchBinary = (require "st.zwave.CommandClass.SwitchBinary")({ version = 2 })
local Meter = (require "st.zwave.CommandClass.Meter")({ version = 3 })
local zooz_switch_endpoints = {
{
command_classes = {
{ value = zw.BASIC },
{ value = zw.SWITCH_BINARY },
{ value = zw.METER }
}
}
}
local mock_device = test.mock_device.build_test_zwave_device({
profile = t_utils.get_profile_definition("dual-metering-switch.yml"),
zwave_endpoints = zooz_switch_endpoints,
zwave_manufacturer_id = 0x027A,
zwave_product_type = 0xA000,
zwave_product_id = 0xA003
})
local function test_init()
test.mock_device.add_test_device(mock_device)
end
test.set_test_init_function(test_init)
test.register_coroutine_test(
"Device should be configured",
function()
test.socket.zwave:__set_channel_ordering("relaxed")
test.socket.device_lifecycle:__queue_receive({mock_device.id, "doConfigure"})
test.socket.zwave:__expect_send(zw_test_utils.zwave_test_build_send_command(
mock_device,
Configuration:Set({
parameter_number = 2,
size = 4,
configuration_value = 10
})
))
test.socket.zwave:__expect_send(zw_test_utils.zwave_test_build_send_command(
mock_device,
Configuration:Set({
parameter_number = 3,
size = 4,
configuration_value = 600
})
))
test.socket.zwave:__expect_send(zw_test_utils.zwave_test_build_send_command(
mock_device,
Configuration:Set({
parameter_number = 4,
size = 4,
configuration_value = 600
})
))
mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })
end
)
test.register_coroutine_test(
"Refresh capability should evoke the correct Z-Wave GETs",
function()
test.socket.zwave:__set_channel_ordering('relaxed')
test.socket.capability:__queue_receive({
mock_device.id,
{ capability = "refresh", component = "main", command = "refresh", args = {} }
})
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_device,
SwitchBinary:Get({},
{
encap = zw.ENCAP.AUTO,
src_channel = 0,
dst_channels={1}
})
)
)
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_device,
SwitchBinary:Get({},
{
encap = zw.ENCAP.AUTO,
src_channel = 0,
dst_channels={2}
})
)
)
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_device,
Meter:Get(
{scale = Meter.scale.electric_meter.KILOWATT_HOURS},
{
encap = zw.ENCAP.AUTO,
src_channel = 0,
dst_channels={1}
}
)
)
)
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_device,
Meter:Get(
{scale = Meter.scale.electric_meter.WATTS},
{
encap = zw.ENCAP.AUTO,
src_channel = 0,
dst_channels={1}
}
)
)
)
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_device,
Meter:Get({scale = Meter.scale.electric_meter.KILOWATT_HOURS},
{
encap = zw.ENCAP.AUTO,
src_channel = 0,
dst_channels={2}
}
)
)
)
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_device,
Meter:Get(
{scale = Meter.scale.electric_meter.WATTS},
{
encap = zw.ENCAP.AUTO,
src_channel = 0,
dst_channels={2}
})
)
)
end
)
test.run_registered_tests()
|
hyper:bind({}, "l", function()
hs.caffeinate.lockScreen()
hyper.triggered = true
end)
|
--proc/richedit: standard richedit control.
setfenv(1, require'winapi')
ffi.cdef[[
]]
|
--[[---------------------------------------------------------
Name: Files
-----------------------------------------------------------]]
include('shared.lua')
--[[---------------------------------------------------------
Name: Initialize
-----------------------------------------------------------]]
function ENT:Initialize()
--> Colors
self._colors = {
Color(self.pColor.r, self.pColor.g, self.pColor.b, 255),
Color(self.pColor.r, self.pColor.g, self.pColor.b, 100),
Color(0, 0, 0, 40),
Color(0, 0, 0, 50),
Color(0, 0, 0, 80),
Color(0, 0, 0, 100),
Color(0, 0, 0, 125),
Color(0, 0, 0, 150),
Color(0, 0, 0, 240),
Color(255, 255, 255, 255),
Color(255, 0, 0, 200),
Color(0, 255, 0, 255),
Color(0, 255, 0, 200)
}
self.colors = table.Copy(self._colors)
end
--[[---------------------------------------------------------
Name: Draw
-----------------------------------------------------------]]
function ENT:Draw()
--self:Initialize()
self:DrawModel()
--> Distance
local playerPos = LocalPlayer():GetPos()
local distance = playerPos:Distance(self:GetPos())
--> Fade
local fadeStart = self.pFadeStart
local fadeStop = self.pFadeStop
local fadeDist = fadeStop-fadeStart
if distance >= fadeStart and distance <= fadeStop then
for k,v in pairs(self._colors) do
--> Alpha
local alphaColor = self._colors[k].a/fadeDist
alphaColor = alphaColor*(fadeStop-distance)
--> Save
self.colors[k].a = math.Round(alphaColor)
end
else
--> Color
self.colors = table.Copy(self._colors)
end
--> Draw
if distance <= fadeStop then
--> Top
self:DrawPanelTop()
--> Front
self:DrawPanelFront()
--> Display
self:DrawPanelDisplay()
--> Power
self:DrawPanelPower()
--> Sides
self:DrawPanelSideLeft()
self:DrawPanelSideRight()
end
end
--[[---------------------------------------------------------
Name: WorldToScreen
-----------------------------------------------------------]]
local function WorldToScreen(vPos, vScale, aRot)
local hit = LocalPlayer():GetEyeTrace().HitPos
hit = hit - vPos
hit:Rotate(Angle(0, -aRot.y, 0))
hit:Rotate(Angle(-aRot.p, 0, 0))
hit:Rotate(Angle(0, 0, -aRot.r))
return hit.x / vScale, (-hit.y) / vScale
end
--[[---------------------------------------------------------
Name: DrawPanelTop
-----------------------------------------------------------]]
function ENT:DrawPanelTop()
--> Variables
local pos = self:GetPos()
local ang = self:GetAngles()
ang:RotateAroundAxis(ang:Up(), 90)
pos = pos + ang:Up() * 10.6 - ang:Forward() * 15.2 - ang:Right() * 16.4
--> Panel
local posX, posY = WorldToScreen(pos, 0.1, ang)
local mouseUse = LocalPlayer():KeyDown(IN_USE) and !LocalPlayer():KeyDown(IN_ATTACK)
cam.Start3D2D(pos, ang, 0.1)
--> Variables
local boxWidth = 307
local boxHeight = 309
--> Background
draw.RoundedBox(0, 0, 0, boxWidth, boxHeight, self.colors[2])
--> Printer
local printerH = 60
local printerY = 10
draw.RoundedBox(4, 8, printerY, boxWidth-16, printerH, self.colors[6])
draw.RoundedBox(4, 10, printerY+2, boxWidth-20, printerH-4, self.colors[8])
draw.SimpleTextOutlined(self.PrintName, 'segoe_bold_34', boxWidth/2, (printerH+15)/2, self.colors[10], 1, 1, 2, self.colors[3])
--> Player
local playerH = 50
local playerY = boxHeight-playerH-10
local playerT = (IsValid(self:Getowning_ent()) and self:Getowning_ent():Nick()) or DarkRP.getPhrase("unknown")
draw.RoundedBox(4, 8, playerY, boxWidth-16, playerH, self.colors[6])
draw.RoundedBox(4, 10, playerY+2, boxWidth-20, playerH-4, self.colors[8])
draw.SimpleTextOutlined(playerT, 'segoe_semibold_24', boxWidth/2, playerY+playerH/2, self.colors[10], 1, 1, 2, self.colors[3])
--> Body 6575c87eb19eb689c450e2aa38b80845ecc534bd95363f7f0377e12ca5ab14e7
local bodyH = boxHeight-printerH-playerH-40
local bodyY = printerY+printerH+10
draw.RoundedBox(4, 8, bodyY, boxWidth-16, bodyH, self.colors[4])
draw.RoundedBox(4, 10, bodyY+2, boxWidth-20, bodyH-4, self.colors[7])
draw.RoundedBox(0, 10, bodyY+(bodyH/2)-1, boxWidth-20, 2, self.colors[6])
draw.RoundedBox(0, boxWidth/2-1, bodyY+2, 2, boxHeight/4, self.colors[6])
--> Stored
local storedT = self:GetStoredMoney() or 0
local maxStore = self:GetMaxStore() or 0
if maxStore != 0 then
storedT = storedT..'/'..self:GetMaxStore()
end
draw.SimpleTextOutlined('STORED', 'segoe_semibold_24', boxWidth/4+5, bodyY+30, self.colors[10], 1, 1, 2, self.colors[3])
draw.SimpleTextOutlined('$'..storedT, 'segoe_semibold_24', boxWidth/4+5, bodyY+50, self.colors[12], 1, 1, 2, self.colors[3])
--> Rate
local rateT = math.Round(self.pRate*math.pow((self.pUpgrade/100)+1, self:GetSpeedLevel()-1), 2)
draw.SimpleTextOutlined('RATE', 'segoe_semibold_24', boxWidth/4*3-5, bodyY+30, self.colors[10], 1, 1, 2, self.colors[3])
draw.SimpleTextOutlined('$'..rateT..'/Sec', 'segoe_semibold_24', boxWidth/4*3-5, bodyY+50, self.colors[12], 1, 1, 2, self.colors[3])
--> Speed
local speedY = bodyY+bodyH/2
local speedX = 26
local speedL = self:GetSpeedLevel() or 0
local speedH = 0
draw.SimpleTextOutlined('SPEED', 'segoe_semibold_24', boxWidth/2, speedY+14, self.colors[10], 1, 1, 2, self.colors[3])
for i=1,10 do
draw.RoundedBox(4, speedX, speedY+26, 20, 20, self.colors[6])
if speedL >= i then
draw.RoundedBox(4, speedX+2, speedY+28, 20-4, 20-4, self.colors[1])
elseif posX >= speedX and posX <= speedX+20 and posY >= speedY+26 and posY <= speedY+46 then
draw.SimpleTextOutlined('E', 'segoe_bold_22', speedX+20/2, speedY+35, self.colors[10], 1, 1, 2, self.colors[3])
speedH = i
if mouseUse and (!self.mouseDelay or CurTime() > self.mouseDelay) then
net.Start('tcb_upgrade_speed')
net.WriteInt(speedH, 32)
net.SendToServer()
self.mouseDelay = CurTime()+1
end
end
speedX = speedX+26
end
draw.RoundedBox(4, boxWidth/2-75, speedY+50, 150, 24, self.colors[6])
if speedL != 10 then
if speedH == 0 then
draw.SimpleTextOutlined('PRICE: HOVER SLOT', 'segoe_semibold_18', boxWidth/2, speedY+63, self.colors[10], 1, 1, 2, self.colors[3])
else
local price = (self:GetBuyPrice()/100*self.pUpgrade)*(speedH-self:GetSpeedLevel())
draw.SimpleTextOutlined('PRICE: $'..price, 'segoe_semibold_18', boxWidth/2, speedY+63, self.colors[10], 1, 1, 2, self.colors[3])
end
else
draw.SimpleTextOutlined('MAXED OUT', 'segoe_semibold_18', boxWidth/2, speedY+63, self.colors[10], 1, 1, 2, self.colors[3])
end
cam.End3D2D()
end
--[[---------------------------------------------------------
Name: DrawPanelFront
-----------------------------------------------------------]]
function ENT:DrawPanelFront()
--> Variables
local pos = self:GetPos()
local ang = self:GetAngles()
ang:RotateAroundAxis(ang:Up(), 90)
ang:RotateAroundAxis(ang:Forward(), 90)
pos = pos + ang:Up() * 16.2 - ang:Forward() * 14.4 - ang:Right() * 10.2
--> Panel
local posX, posY = WorldToScreen(pos, 0.1, ang)
local mouseUse = LocalPlayer():KeyDown(IN_USE) and !LocalPlayer():KeyDown(IN_ATTACK)
cam.Start3D2D(pos, ang, 0.1)
--> Variables
local boxWidth = 220
local boxHeight = 95
--> Background
draw.RoundedBox(0, 0, 0, boxWidth, boxHeight, self.colors[2])
--> Health
local healthW = (boxWidth-16)/2-5
local healthH = (boxHeight-16)/2-5
local healthC = Color(self.colors[13].r, self.colors[13].g, self.colors[13].b, self.colors[13].a)
local healthV = self:GetPrinterHealth()
if healthV > 50 then
healthC.r = (255/50)*(self.pHealth-healthV)
healthC.g = 255
else
local colorG = (255/50)*healthV
if colorG < 0 then colorG = 0 end
healthC.r = 255
healthC.g = colorG
end
draw.RoundedBox(2, 8, 8, healthW, healthH, self.colors[6])
draw.RoundedBox(2, 10, 10, healthW-4, healthH-4, healthC)
draw.SimpleTextOutlined('HP: '..healthV..'%', 'segoe_semibold_18', (healthW+5)/2+5, (healthH+10)/2+2, self.colors[10], 1, 1, 1, self.colors[5])
--> Takeover
local takeoverW = (boxWidth-16)/2-5
local takeoverH = (boxHeight-16)/2-5
local takeoverX = 8+takeoverW+10
local takeoverC = Color(self.colors[11].r, self.colors[11].g, self.colors[11].b, self.colors[11].a)
local takeoverV = self:GetCaptureTime()
local takeoverF = takeoverV-CurTime()
local takeoverT = 0
if takeoverF <= 0 then
takeoverC.r = 0
takeoverC.g = 255
elseif takeoverF > (self.pStealTime/2) then
takeoverC.r = (255/(self.pStealTime/2))*(self.pStealTime-takeoverF)
takeoverC.g = 255
else
local colorG = (255/(self.pStealTime/2))*takeoverF
if colorG < 0 then colorG = 0 end
takeoverC.r = 255
takeoverC.g = colorG
end
draw.RoundedBox(2, takeoverX, 8, takeoverW, takeoverH, self.colors[6])
draw.RoundedBox(2, takeoverX+2, 10, takeoverW-4, takeoverH-4, takeoverC)
if takeoverF > 0 then
takeoverT = takeoverF
else
takeoverT = 0
end
draw.SimpleTextOutlined('TIME: '..string.FormattedTime(takeoverT, '%02i:%02i'), 'segoe_semibold_18', takeoverX+(takeoverW+5)/2-2, (takeoverH+10)/2+2, self.colors[10], 1, 1, 1, self.colors[5])
--> Notify
local notifyW = (boxWidth-16)/2-5
local notifyH = (boxHeight-16)/2-5
local notifyY = 8+notifyH+10
local notifyC = self.colors[11]
local notifyT = "WARN $"..self:GetBuyPrice()/100*self.pNotifyPrice
if self:GetNotifyUpgrade() then
notifyC = self.colors[13]
notifyT = "ENABLED"
end
draw.RoundedBox(2, 8, notifyY, notifyW, notifyH, self.colors[6])
draw.RoundedBox(2, 10, notifyY+2, notifyW-4, notifyH-4, notifyC)
if posX >= 10 and posX <= 10+notifyW-4 and posY >= notifyY+2 and posY <= notifyY+2+notifyH-4 then
draw.RoundedBox(2, 10, notifyY+2, notifyW-4, notifyH-4, self.colors[6])
if mouseUse and (!self.mouseDelay or CurTime() > self.mouseDelay) then
net.Start('tcb_upgrade_notify')
net.SendToServer()
self.mouseDelay = CurTime()+1
end
end
draw.SimpleTextOutlined(notifyT, 'segoe_semibold_18', 10+(notifyW)/2-2, notifyY+(notifyH+10)/2-6, self.colors[10], 1, 1, 1, self.colors[5])
--> Start Takeover
local stakeoverW = (boxWidth-16)/2-5
local stakeoverH = (boxHeight-16)/2-5
local stakeoverX = 8+stakeoverW+10
local stakeoverY = 8+stakeoverH+10
local stakeoverC = self.colors[11]
local stakeoverT = 'STEAL'
draw.RoundedBox(2, stakeoverX, stakeoverY, stakeoverW, stakeoverH, self.colors[6])
draw.RoundedBox(2, stakeoverX+2, stakeoverY+2, stakeoverW-4, stakeoverH-4, stakeoverC)
if posX >= stakeoverX+2 and posX <= stakeoverX+stakeoverW-4 and posY >= stakeoverY+2 and posY <= stakeoverY+2+stakeoverH-4 then
draw.RoundedBox(2, stakeoverX+2, stakeoverY+2, stakeoverW-4, stakeoverH-4, self.colors[6])
if mouseUse and (!self.mouseDelay or CurTime() > self.mouseDelay) then
net.Start('tcb_printer_steal')
net.SendToServer()
self.mouseDelay = CurTime()+1
end
end
if takeoverF > 0 then
stakeoverT = 'ABORT'
end
draw.SimpleTextOutlined(stakeoverT, 'segoe_semibold_18', stakeoverX+(stakeoverW+5)/2-2, stakeoverY+(stakeoverH+10)/2-6, self.colors[10], 1, 1, 1, self.colors[5])
cam.End3D2D()
end
--[[---------------------------------------------------------
Name: DrawPanelDisplay
-----------------------------------------------------------]]
function ENT:DrawPanelDisplay()
--> Variables
local pos = self:GetPos()
local ang = self:GetAngles()
ang:RotateAroundAxis(ang:Up(), 90)
ang:RotateAroundAxis(ang:Forward(), 90)
pos = pos + ang:Up() * 16.7 + ang:Forward() * 8.5 - ang:Right() * 9.4
--> Panel
cam.Start3D2D(pos, ang, 0.1)
--> Variables
local boxWidth = 65
local boxHeight = 22
local boxTemp = math.Round(self:GetTemperature(), 1)
local boxColor = Color(self.colors[13].r, self.colors[13].g, self.colors[13].b, self.colors[13].a)
--> Color
if boxTemp <= 60 then
boxColor.r = (255/40)*(boxTemp-20)
boxColor.g = 255
elseif boxTemp > 60 then
local colorG = (255/40)*(40-(boxTemp-60))
if colorG < 0 then colorG = 0 end
boxColor.r = 255
boxColor.g = colorG
end
--> Background
draw.RoundedBox(0, 0, 0, boxWidth, boxHeight, self.colors[2])
draw.RoundedBox(2, 2, 2, boxWidth-4, boxHeight-4, self.colors[6])
draw.RoundedBox(2, 4, 4, boxWidth-8, boxHeight-8, boxColor)
draw.SimpleTextOutlined(boxTemp..'°', 'segoe_semibold_14', boxWidth/2, (boxHeight-2)/2, self.colors[10], 1, 1, 1, self.colors[5])
cam.End3D2D()
end
--[[---------------------------------------------------------
Name: DrawPanelPower
-----------------------------------------------------------]]
function ENT:DrawPanelPower()
--> Variables
local pos = self:GetPos()
local ang = self:GetAngles()
ang:RotateAroundAxis(ang:Up(), 90)
ang:RotateAroundAxis(ang:Forward(), 90)
pos = pos + ang:Up() * 16.9 + ang:Forward() * 8.5 - ang:Right() * 5.8
--> Panel 6575c87eb19eb689c450e2aa38b80845ecc534bd95363f7f0377e12ca5ab14e7
local posX, posY = WorldToScreen(pos, 0.1, ang)
local mouseUse = LocalPlayer():KeyDown(IN_USE) and !LocalPlayer():KeyDown(IN_ATTACK)
cam.Start3D2D(pos, ang, 0.1)
--> Variables
local boxWidth = 65
local boxHeight = 30
local boxColor = Color(self.colors[11].r, self.colors[11].g, self.colors[11].b, self.colors[11].a)
--> Color
if !self:GetPower() then
boxColor.r = 0
boxColor.g = 255
end
--> Background
draw.RoundedBox(0, 0, 0, boxWidth, boxHeight, self.colors[2])
draw.RoundedBox(2, 2, 2, boxWidth-4, boxHeight-4, self.colors[6])
draw.RoundedBox(2, 4, 4, boxWidth-8, boxHeight-8, boxColor)
if posX >= 2 and posX <= boxWidth-4 and posY >= 2 and posY <= boxHeight-4 then
draw.RoundedBox(2, 4, 4, boxWidth-8, boxHeight-8, self.colors[6])
if mouseUse and (!self.mouseDelay or CurTime() > self.mouseDelay) then
net.Start('tcb_printer_power')
net.SendToServer()
self.mouseDelay = CurTime()+1
end
end
draw.SimpleTextOutlined('Power', 'segoe_semibold_14', boxWidth/2, (boxHeight-2)/2, self.colors[10], 1, 1, 1, self.colors[5])
cam.End3D2D()
end
--[[---------------------------------------------------------
Name: DrawPanelSideLeft
-----------------------------------------------------------]]
function ENT:DrawPanelSideLeft()
--> Variables
local pos = self:GetPos()
local ang = self:GetAngles()
ang:RotateAroundAxis(ang:Forward(), 90)
pos = pos + ang:Up() * 14.9 - ang:Forward() * 16.3 - ang:Right() * 10.5
--> Panel
cam.Start3D2D(pos, ang, 0.1)
--> Variables
local boxWidth = 309
local boxHeight = 105
--> Background
draw.RoundedBox(0, 0, 0, boxWidth, boxHeight, self.colors[9])
cam.End3D2D()
end
--[[---------------------------------------------------------
Name: DrawPanelSideRight 6575c87eb19eb689c450e2aa38b80845ecc534bd95363f7f0377e12ca5ab14e7
-----------------------------------------------------------]]
function ENT:DrawPanelSideRight()
--> Variables
local pos = self:GetPos()
local ang = self:GetAngles()
ang:RotateAroundAxis(ang:Forward(), 90)
pos = pos - ang:Up() * 15.3 - ang:Forward() * 16.3 - ang:Right() * 10.5
--> Panel
cam.Start3D2D(pos, ang, 0.1)
--> Variables
local boxWidth = 309
local boxHeight = 105
--> Background
draw.RoundedBox(0, 0, 0, boxWidth, boxHeight, self.colors[9])
cam.End3D2D()
end |
return {'eilaas','eilaci','eiland','eilandbestuur','eilandbewoner','eilanddeel','eilandelijk','eilandengroep','eilandenrijk','eilandenstaat','eilandenzee','eilander','eilandgebied','eilandgevoel','eilandsbestuur','eilandsraad','eilandstaat','eilandstation','eileider','eilieve','eiloof','eilandrepubliek','eilandhopping','eilandautomatisering','eilandbevolking','eilandleven','eilandenrivier','eileen','eilers','eilander','eilert','eilering','eiling','eilandbewoners','eilanden','eilandengroepen','eilandenrijken','eilanders','eilandgebieden','eilandje','eilandjes','eileiders','eilandelijke','eilandstaten','eilandenstaten','eilandrepublieken','eileens','eilandstaatje','eilandstaatjes','eilandengroepje','eilandenstaatje'} |
-- Table Inline Pass: Inlines table sets into the table declaration --
-- This works by indexing blocks backwards
-- If we find a set instruction on a table destination and the src does not use the declared table
-- or the parent tables then we can inline
--[[
Example:
local tab = {}
tab[1] = {}
tab[1][2] = "hi"
tab.a = 5
tab.b = tab
tab.c = tab.a
tab.d = tab[1][2]
to
local tab = {{[2] = "hi"}, a = 5}
tab.b = tab
tab.c = tab.a
tab.d = tab[1][2]
]]
return function(decompiler)
local analyzer = decompiler.analyzer
return function(irBlock)
local liveRanges = irBlock.liveRanges
print("Starting table inline")
-- Pass 1: Find table declarations and their live ranges
print("Finding table decls")
local decls = {
--[[
[0] = {
{ir pos, ir block, live range, table}
}
]]
}
do
local function scanBlock(irBlock)
for i=1, #irBlock do
local ir = irBlock[i]
if ir.src and #ir.src == 1 and ir.src[1][1] == "value" and type(ir.src[1][2]) == "table" then
-- If the ir part has a single source as a value that holds a table
print("Found a table")
if ir.dest and #ir.dest == 1 and ir.dest[1][1] == "register" then
-- If it has a single dest and it is a register
local reg = ir.dest[1][2]
local regdecls = decls[reg]
if not regdecls then
regdecls = {}
decls[reg] = regdecls
end
regdecls[#regdecls+1] = {i, irBlock, analyzer.findRange(liveRanges[reg], i), ir.src[1][2]}
end
end
if ir.block then
scanBlock(ir.block)
end
end
end
scanBlock(irBlock)
end
print("Collecting table sets")
do
local function scanBlock(irBlock)
for i=1, #irBlock do
local ir = irBlock[i]
if ir.dest and #ir.dest == 1 and ir.dest[1][1] == "index" and ir.dest[1][2][1] == "register" then
local sets = decls[ir.dest[1][2][2]]
for j=1, #sets do
local tabdecl = sets[j]
if tabdecl[2] == irBlock and i >= tabdecl[3][1] and i <= tabdecl[3][2] then
print("Can inline into table at "..tabdecl[1])
tabdecl[4][ir.dest[1][3]] = ir.src[1]
ir.disabled = "table_inline"
end
end
end
if ir.block then
scanBlock(ir.block)
end
end
end
scanBlock(irBlock)
end
--[=[for pass=1, 3 do
print("Starting inline pass "..pass)
local ir
local actuallyDidSomething = false -- If a pass does nothing then the loop is exit early
local function handleSource(reg, t, i)
local possible, inlineIR = analyzer.isInlinePossible(liveRanges, reg, ir.pc)
if possible then
-- To inline, we take the first source explet of the IR and put it into where the register used to be
-- The entire IR expr is then disabled so it doesn't show up in final output
-- This is so the block doesn't really have to be modified
inlineIR.disabled = "inline_source"
t[i] = inlineIR.src[1]
actuallyDidSomething = true
end
end
-- Recursively inline explets in blocks
local function inlineBlock(irBlock)
for i=1, #irBlock do
ir = irBlock[i]
if ir.src then analyzer.forEachRegisterInEachExplet(ir.src, handleSource) end
if ir.dest and #ir.dest == 1 and ir.dest[1][1] ~= "register" and
#ir.src == 1 and ir.src[1][1] == "register" then
-- Attempt destination inline
--[[
r0, r1 = func()
b = r1
a = r0
TO
a, b = func()
]]
-- Index the current block backwards until we hit an instruction that has our single source reg as a dest reg
-- Or we could just reuse analyzer usage data :P
local dest = ir.dest[1]
local src = ir.src[1]
local range = analyzer.findRange(liveRanges[src[2]], ir.pc)
if range then
local setir = range.set
for i=1, #setir.dest do
local sdest = setir.dest[i]
if sdest[1] == "register" and sdest[2] == src[2] then
setir.dest[i] = dest
ir.disabled = "inline_dest"
break
end
end
end
end
if ir.block then
inlineBlock(ir.block)
end
end
end
inlineBlock(irBlock)
if not actuallyDidSomething then
print("Nothing done in inline pass "..pass)
break
else
irBlock.liveRanges = analyzer.computeLiveRanges(irBlock)
end
end]=]
end
end
|
local reg = minetest.register_node
local mod = 'mystical_lands:'
-- earth nodes
local dirt_nodes = {
-- soils
{ description = 'Dark clay soil', name = 'dark_clay_soil', tile = 'mystical_lands_dark_clay_soil.png' },
{ description = 'Dark loam soil', name = 'dark_loam_soil', tile = 'mystical_lands_dark_loam_soil.png' },
{ description = 'Dark sandy soil', name = 'dark_sandy_soil', tile = 'mystical_lands_dark_sandy_soil.png' },
{ description = 'Dark silt soil', name = 'dark_silt_soil', tile = 'mystical_lands_dark_silt_soil.png' },
{ description = 'Clay soil', name = 'clay_soil', tile = 'mystical_lands_clay_soil.png' },
{ description = 'Loam soil', name = 'loam_soil', tile = 'mystical_lands_loam_soil.png' },
{ description = 'Sandy soil', name = 'sandy_soil', tile = 'mystical_lands_sandy_soil.png' },
{ description = 'Silt soil', name = 'silt_soil', tile = 'mystical_lands_silt_soil.png' },
{ description = 'Light clay soil', name = 'light_clay_soil', tile = 'mystical_lands_light_clay_soil.png' },
{ description = 'Light loam soil', name = 'light_loam_soil', tile = 'mystical_lands_light_loam_soil.png' },
{ description = 'Light sandy soil', name = 'light_sandy_soil', tile = 'mystical_lands_light_sandy_soil.png' },
{ description = 'Light silt soil', name = 'light_silt_soil', tile = 'mystical_lands_light_silt_soil.png' },
{ description = 'Dark lush grass', name = 'dark_lush_grass', tile = 'mystical_lands_dark_lush_grass.png' },
{ description = 'Lush grass', name = 'lush_grass', tile = 'mystical_lands_lush_grass.png' },
{ description = 'Light lush grass', name = 'light_lush_grass', tile = 'mystical_lands_light_lush_grass.png' },
{ description = 'Dark grass', name = 'dark_grass', tile = 'mystical_lands_dark_grass.png' },
{ description = 'Grass', name = 'grass', tile = 'mystical_lands_grass.png' },
{ description = 'Light grass', name = 'light_grass', tile = 'mystical_lands_light_grass.png' },
{ description = 'Patchy dark grass', name = 'dark_patchy_grass', tile = 'mystical_lands_dark_patchy_grass.png' },
{ description = 'Patchy grass', name = 'patchy_grass', tile = 'mystical_lands_patchy_grass.png' },
{ description = 'Patchy light grass', name = 'light_patchy_grass', tile = 'mystical_lands_light_patchy_grass.png' },
}
for index, n in pairs(dirt_nodes) do
reg(
mod .. n.name,
{
description = n.description,
tiles = {n.tile},
walkable = true,
pointable = true,
diggable = true,
--sounds = default.node_sound_stone_defaults(),
groups = {cracky = 3, stone = 1, mystical_lands_falling = 1},
}
)
end |
-- premake5.lua project solution script
cfg_systemversion = "latest" -- "10.0.17763.0" -- To use the latest version of the SDK available
-- solution
workspace "RayTracingProject"
configurations { "Debug", "Release" }
platforms { "Win32", "Win64" }
location "Build"
defines { "_CRT_SECURE_NO_WARNINGS" }
systemversion(cfg_systemversion)
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
targetsuffix("_d")
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter "platforms:Win32"
architecture "x32"
filter "platforms:Win64"
architecture "x64"
filter {}
targetdir("Build/Bin")
objdir("Build/Obj/%{prj.name}/%{cfg.buildcfg}")
debugdir ("Build/..");
-- project RayTracing
project "RayTracing"
language "C++"
kind "ConsoleApp"
includedirs {
"./RayTracing/common",
"./RayTracing/scene"
}
files {
"./RayTracing/common/*.h",
"./RayTracing/common/*.cc",
"./RayTracing/scene/*.h",
"./RayTracing/scene/*.cc",
"./RayTracing/*.h",
"./RayTracing/*.cc"
}
|
-- dofile('test_omni_rotar.lua')
m=m or require('omni')
local MAX_ITER = 4
local d=1000
local w = 0.4 --m/s
m.set_enable()
for i=1,MAX_ITER do
m.drive(0,0,w)
tmr.sleepms(d)
m.drive(0,0,-w)
tmr.sleepms(d)
end
m.set_enable(false)
--m.set_enable();m.raw_write(0,0,45);tmr.sleepms(2000);m.set_enable(false)
|
object_tangible_collection_rare_melee_nyenthioris = object_tangible_collection_shared_rare_melee_nyenthioris:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_rare_melee_nyenthioris, "object/tangible/collection/rare_melee_nyenthioris.iff") |
local BaseClass = require "NJLI.STATEMACHINE.SceneEntityState"
local Loading = {}
Loading.__index = Loading
--#############################################################################
--DO NOT EDIT ABOVE
--#############################################################################
--#############################################################################
--Begin Custom Code
--Required local functions:
-- __ctor()
-- __dtor()
-- __load()
-- __unLoad()
--#############################################################################
local __ctor = function(self, init)
--TODO: construct this Entity
end
local __dtor = function(self)
--TODO: destruct this Entity
end
local __load = function(self)
--TODO: load this Entity
end
local __unLoad = function(self)
--TODO: unload this Entity
end
--#############################################################################
function Loading:enter()
BaseClass.enter(self)
end
function Loading:update(timeStep)
BaseClass.update(self, timeStep)
-- print("loding gameplay")
end
function Loading:exit()
BaseClass.exit(self)
end
function Loading:onMessage(message)
BaseClass.onMessage(self, message)
end
function Loading:renderHUD()
BaseClass.renderHUD(self)
end
function Loading:touchesDown(touches)
BaseClass.touchesDown(self, touches)
end
function Loading:touchesUp(touches)
BaseClass.touchesUp(self, touches)
end
function Loading:touchesMove(touches)
BaseClass.touchesMove(self, touches)
end
function Loading:touchesCancelled(touches)
BaseClass.touchesCancelled(self, touches)
end
function Loading:touchDown(touches)
BaseClass.touchDown(self, touches)
end
function Loading:touchUp(touches)
BaseClass.touchUp(self, touches)
end
function Loading:touchMove(touches)
BaseClass.touchMove(self, touches)
end
function Loading:touchCancelled(touches)
BaseClass.touchCancelled(self, touches)
end
function Loading:mouseDown(mouse)
BaseClass.mouseDown(self, mouse)
end
function Loading:mouseUp(mouse)
BaseClass.mouseUp(self, mouse)
end
function Loading:mouseMove(mouse)
BaseClass.mouseMove(self, mouse)
end
function Loading:pause()
BaseClass.pause(self)
end
function Loading:unPause()
BaseClass.unPause(self)
end
function Loading:keyboardShow()
BaseClass.keyboardShow(self)
end
function Loading:keyboardCancel()
BaseClass.keyboardCancel(self)
end
function Loading:keyboardReturn(text)
BaseClass.keyboardReturn(self, text)
end
function Loading:willResignActive()
BaseClass.willResignActive(self)
end
function Loading:didBecomeActive()
BaseClass.didBecomeActive(self)
end
function Loading:didEnterBackground()
BaseClass.didEnterBackground(self)
end
function Loading:willEnterForeground()
BaseClass.willEnterForeground(self)
end
function Loading:willTerminate()
BaseClass.willTerminate(self)
end
function Loading:interrupt()
BaseClass.interrupt(self)
end
function Loading:resumeInterrupt()
BaseClass.resumeInterrupt(self)
end
function Loading:receivedMemoryWarning()
BaseClass.receivedMemoryWarning(self)
end
--#############################################################################
--End Custom Code
--#############################################################################
--#############################################################################
--DO NOT EDIT BELOW
--#############################################################################
setmetatable(Loading, {
__index = BaseClass,
__call = function (cls, ...)
local self = setmetatable({}, cls)
--Create the base first
BaseClass._create(self, ...)
self:_create(...)
return self
end,
})
function Loading:className()
return "Loading"
end
function Loading:class()
return self
end
function Loading:superClass()
return BaseClass
end
function Loading:__gc()
--Destroy derived class first
Loading._destroy(self)
--Destroy base class after derived class
BaseClass._destroy(self)
end
function Loading:__tostring()
local ret = self:className() .. " =\n{\n"
for pos,val in pairs(self) do
ret = ret .. "\t" .. "["..pos.."]" .. " => " .. type(val) .. " = " .. tostring(val) .. "\n"
end
ret = ret .. "\n\t" .. tostring_r(BaseClass) .. "\n}"
return ret .. "\n\t" .. tostring_r(getmetatable(self)) .. "\n}"
end
function Loading:_destroy()
assert(not self.__LoadingCalledLoad, "Must unload before you destroy")
__dtor(self)
end
function Loading:_create(init)
self.__LoadingCalledLoad = false
__ctor(self, init)
end
function Loading:load()
--load base first
BaseClass.load(self)
--load derived last...
__load(self)
self.__LoadingCalledLoad = true
end
function Loading:unLoad()
assert(self.__LoadingCalledLoad, "Must load before unLoading")
--unload derived first...
__unLoad(self)
self.__LoadingCalledLoad = false
--unload base last...
BaseClass.unLoad(self)
end
return Loading
|
local config = require('config')
local CurrentAppType = config.application1.registerAppInterfaceParams.appHMIType
Test.appHMITypes = {DEFAULT = false, COMMUNICATION = false, MEDIA = false, MESSAGING = false, NAVIGATION = false, INFORMATION = false, SOCIAL = false, BACKGROUND_PROCESS = false, TESTING = false, SYSTEM = false}
for i=1,#CurrentAppType do
Test.appHMITypes[CurrentAppType[i]] = true
end
Test.isMediaApplication = config.application1.registerAppInterfaceParams.isMediaApplication
NewTestSuiteNumber = 0 -- use as subfix of test case "NewTestSuite" to make different test case name.
-- Verify config.pathToSDL
findresultFirstCharacters = string.match (config.pathToSDL, '^%.%/')
if findresultFirstCharacters == "./" then
local CurrentFolder = assert( io.popen( "pwd" , 'r'))
local CurrentFolderPath = CurrentFolder:read( '*l' )
PathUsingCurrentFolder = string.match (config.pathToSDL, '[^%.]+')
config.pathToSDL = CurrentFolderPath .. PathUsingCurrentFolder
end
findresultLastCharacters = string.find (config.pathToSDL, '.$')
if string.sub(config.pathToSDL,findresultLastCharacters) ~= "/" then
config.pathToSDL = config.pathToSDL..tostring("/")
end
|
-- See LICENSE for terms
local mod_TurnOff
local mod_SkipGrids
local mod_SkipPassages
-- fired when settings are changed/init
local function ModOptions()
mod_TurnOff = CurrentModOptions:GetProperty("TurnOff")
mod_SkipGrids = CurrentModOptions:GetProperty("SkipGrids")
mod_SkipPassages = CurrentModOptions:GetProperty("SkipPassages")
end
-- load default/saved settings
OnMsg.ModsReloaded = ModOptions
-- fired when option is changed
function OnMsg.ApplyModOptions(id)
if id == CurrentModId then
ModOptions()
end
end
local skip_grid = {
"CableConstructionSite",
"GridSwitchConstructionSite",
"PipeConstructionSite",
}
local skips = {
"MirrorSphereBuilding",
"BlackCubeMonolith",
"CrystalsBuilding",
"Sinkhole",
}
function OnMsg.ConstructionSitePlaced(site)
if not mod_TurnOff then
return
end
if site.building_class_proto:IsKindOfClasses(skips)
or (mod_SkipPassages and site:IsKindOf("PassageConstructionSite"))
or (mod_SkipGrids and site:IsKindOfClasses(skip_grid))
then
return
end
RebuildInfopanel(site)
site:SetUIWorking(false)
end
|
-- Creator:
-- AltiV, January 17th, 2019
-- Primary Idea Giver:
-- Acalia
-----------------
-- Untouchable --
-----------------
LinkLuaModifier("modifier_imba_enchantress_untouchable", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_untouchable_slow", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_untouchable_peace_on_earth", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
imba_enchantress_untouchable = class({})
function imba_enchantress_untouchable:GetCastAnimation()
return ACT_DOTA_CAST_ABILITY_3
end
function imba_enchantress_untouchable:GetIntrinsicModifierName()
return "modifier_imba_enchantress_untouchable"
end
function imba_enchantress_untouchable:OnSpellStart()
local caster = self:GetCaster()
local peace_on_earth_duration = self:GetSpecialValueFor("peace_on_earth_duration")
local responses = {"enchantress_ench_cast_02", "enchantress_ench_move_18", "enchantress_ench_move_19", "enchantress_ench_move_20", "enchantress_ench_laugh_06", "enchantress_ench_rare_01"}
local enemies
if caster:HasScepter() then
enemies = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, FIND_UNITS_EVERYWHERE, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_ALL, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_INVULNERABLE + DOTA_UNIT_TARGET_FLAG_OUT_OF_WORLD, FIND_ANY_ORDER, false)
else
enemies = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, FIND_UNITS_EVERYWHERE, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_INVULNERABLE + DOTA_UNIT_TARGET_FLAG_OUT_OF_WORLD, FIND_ANY_ORDER, false)
end
for _, enemy in pairs(enemies) do
if not enemy:IsCourier() then
-- if not (enemy:GetCurrentActiveAbility() and (enemy:GetCurrentActiveAbility():GetName() == "item_tpscroll" or string.find(enemy:GetCurrentActiveAbility():GetName(), "item_travel_boots"))) then
-- enemy:Stop()
-- end
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_5") then
enemy:AddNewModifier(caster, self, "modifier_imba_enchantress_untouchable_peace_on_earth", {duration = peace_on_earth_duration})
else
enemy:AddNewModifier(caster, self, "modifier_imba_enchantress_untouchable_peace_on_earth", {duration = peace_on_earth_duration * (1 - enemy:GetStatusResistance())})
end
end
end
caster:AddNewModifier(caster, self, "modifier_imba_enchantress_untouchable_peace_on_earth", {duration = peace_on_earth_duration})
-- TODO: Add a good global / client sound effect for this
EmitGlobalSound(responses[RandomInt(1, #responses)])
EmitGlobalSound("DOTA_Item.HeavensHalberd.Activate")
end
--------------------------
-- UNTOUCHABLE MODIFIER --
--------------------------
modifier_imba_enchantress_untouchable = class({})
function modifier_imba_enchantress_untouchable:IsHidden() return self:GetCaster() == self:GetParent() end
function modifier_imba_enchantress_untouchable:IsPurgable() return self:GetCaster() ~= self:GetParent() end
function modifier_imba_enchantress_untouchable:RemoveOnDeath() return false end
function modifier_imba_enchantress_untouchable:OnCreated()
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.parent = self:GetParent()
self.regret_stacks = self.ability:GetSpecialValueFor("regret_stacks")
end
function modifier_imba_enchantress_untouchable:OnRefresh()
self.regret_stacks = self.ability:GetSpecialValueFor("regret_stacks")
end
function modifier_imba_enchantress_untouchable:DeclareFunctions()
return {
MODIFIER_EVENT_ON_ATTACK_START,
MODIFIER_EVENT_ON_HERO_KILLED -- IMBAfication: Regret
}
end
function modifier_imba_enchantress_untouchable:OnAttackStart(keys)
if not IsServer() then return end
-- "Does not work against wards, buildings and allies."
if self.parent == keys.target and not self.parent:PassivesDisabled() and not keys.attacker:IsOther() and not keys.attacker:IsBuilding() and keys.attacker:GetTeamNumber() ~= self.parent:GetTeamNumber() then
keys.attacker:AddNewModifier(self.parent, self.ability, "modifier_imba_enchantress_untouchable_slow", {})
end
end
function modifier_imba_enchantress_untouchable:OnHeroKilled(keys)
if not IsServer() then return end
if self.caster == self.parent and self.caster == keys.target and not self.caster:PassivesDisabled() and not self.caster:IsIllusion() and self.caster ~= keys.attacker and not keys.attacker:IsBuilding() then
keys.attacker:AddNewModifier(self.caster, self.ability, "modifier_imba_enchantress_untouchable_slow", {}):SetStackCount(self.regret_stacks)
end
end
-------------------------------
-- UNTOUCHABLE MODIFIER SLOW --
-------------------------------
modifier_imba_enchantress_untouchable_slow = class({})
function modifier_imba_enchantress_untouchable_slow:OnCreated()
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.parent = self:GetParent()
-- AbilitySpecials
self.slow_attack_speed = self.ability:GetSpecialValueFor("slow_attack_speed") + self:GetAbility():GetCaster():FindTalentValue("special_bonus_imba_enchantress_5")
--self.slow_duration = self.ability:GetSpecialValueFor("slow_duration")
self.stopgap_bat_increase = self.ability:GetSpecialValueFor("stopgap_bat_increase")
self.kindred_spirits_multiplier = self.ability:GetSpecialValueFor("kindred_spirits_multiplier")
if self.ability:GetCaster() ~= self.caster then
self.slow_attack_speed = self.slow_attack_speed * (self.kindred_spirits_multiplier * 0.01)
end
end
function modifier_imba_enchantress_untouchable_slow:GetEffectName()
return "particles/units/heroes/hero_enchantress/enchantress_untouchable.vpcf"
end
function modifier_imba_enchantress_untouchable_slow:GetStatusEffectName()
return "particles/status_fx/status_effect_enchantress_untouchable.vpcf"
end
function modifier_imba_enchantress_untouchable_slow:DeclareFunctions()
return {
MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT,
MODIFIER_PROPERTY_BASE_ATTACK_TIME_CONSTANT, -- IMBAfication: Stopgap
MODIFIER_EVENT_ON_ATTACK
}
end
function modifier_imba_enchantress_untouchable_slow:GetModifierAttackSpeedBonus_Constant()
return self.slow_attack_speed
end
function modifier_imba_enchantress_untouchable_slow:GetModifierBaseAttackTimeConstant()
return self.stopgap_bat_increase
end
-- After the attack is complete, remove the slow after a short delay
function modifier_imba_enchantress_untouchable_slow:OnAttack(keys)
if self.parent == keys.attacker then
-- Wait frame time to check if the target is not Enchantress or if she was not killed to properly apply Regret stacks
Timers:CreateTimer(FrameTime(), function()
if (keys.target ~= self.caster or self.caster:IsAlive()) and self and not self:IsNull() then
if self:GetStackCount() > 1 then
self:DecrementStackCount()
else
self:SetDuration(keys.attacker:GetAttackAnimationPoint(), false) -- Probably not the right function to call but w/e
end
end
end)
end
end
-----------------------------------------
-- UNTOUCHABLE PEACE ON EARTH MODIFIER --
-----------------------------------------
modifier_imba_enchantress_untouchable_peace_on_earth = class({})
function modifier_imba_enchantress_untouchable_peace_on_earth:IsDebuff() return true end
-- function modifier_imba_enchantress_untouchable_peace_on_earth:IgnoreTenacity() return self:GetCaster():HasTalent("special_bonus_imba_enchantress_5") end
function modifier_imba_enchantress_untouchable_peace_on_earth:OnCreated()
self.parent = self:GetParent()
if not IsServer() then return end
self.particle = ParticleManager:CreateParticle("particles/item/angelic_alliance/angelic_alliance_disarm.vpcf", PATTACH_OVERHEAD_FOLLOW, self.parent)
ParticleManager:SetParticleControl(self.particle, 0, self.parent:GetAbsOrigin())
self:AddParticle(self.particle, false, false, -1, false, false)
self.particle2 = ParticleManager:CreateParticle("particles/units/unit_greevil/loot_greevil_tgt_end_sparks.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.parent)
ParticleManager:SetParticleControl(self.particle2, 3, self.parent:GetAbsOrigin())
self:AddParticle(self.particle2, false, false, -1, false, false)
self.particle3 = ParticleManager:CreateParticle("particles/units/heroes/hero_enchantress/enchantress_natures_attendants_test.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.parent)
for wisp = 1, 4 do
ParticleManager:SetParticleControlEnt(self.particle3, wisp, self.parent, PATTACH_POINT_FOLLOW, "attach_hitloc", self.parent:GetAbsOrigin(), true)
end
self:AddParticle(self.particle3, false, false, -1, false, false)
end
function modifier_imba_enchantress_untouchable_peace_on_earth:OnRefresh()
self:OnCreated()
end
function modifier_imba_enchantress_untouchable_peace_on_earth:CheckState(keys)
local state = {
[MODIFIER_STATE_DISARMED] = true
}
return state
end
-------------
-- Enchant --
-------------
-- LinkLuaModifier("modifier_imba_enchantress_enchant", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_enchant_controlled", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_enchant_slow", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
imba_enchantress_enchant = class({})
function imba_enchantress_enchant:GetAbilityTargetTeam()
return DOTA_UNIT_TARGET_TEAM_BOTH
end
function imba_enchantress_enchant:CastFilterResultTarget(target)
if not IsServer() then return end
local caster = self:GetCaster()
if target:IsAncient() and caster:GetLevel() < 20 then
return UF_FAIL_CUSTOM
end
if target:GetTeam() == caster:GetTeam() and not target:HasModifier("modifier_imba_enchantress_enchant_controlled") then
return UF_FAIL_FRIENDLY
end
local nResult = UnitFilter( target, self:GetAbilityTargetTeam(), self:GetAbilityTargetType(), self:GetAbilityTargetFlags(), self:GetCaster():GetTeamNumber() )
return nResult
end
function imba_enchantress_enchant:GetCustomCastErrorTarget(target)
return "Ability Can't Target Ancients Until Level 20"
end
function imba_enchantress_enchant:OnSpellStart()
self.caster = self:GetCaster()
self.target = self:GetCursorTarget()
-- AbilitySpecials
self.dominate_duration = self:GetSpecialValueFor("dominate_duration")
self.slow_movement_speed = self:GetSpecialValueFor("slow_movement_speed")
self.tooltip_duration = self:GetSpecialValueFor("tooltip_duration") + self.caster:FindTalentValue("special_bonus_imba_enchantress_6")
if self.caster:HasTalent("special_bonus_imba_enchantress_6") then
self.dominate_duration = self.dominate_duration * self.caster:FindTalentValue("special_bonus_imba_enchantress_6")
end
-- Blocked by Linkens
if self.target:TriggerSpellAbsorb(self) then
return nil
end
self.caster:EmitSound("Hero_Enchantress.EnchantCast")
if (not self.target:IsConsideredHero() or self.target:IsIllusion()) and not self.target:IsRoshan() then
-- Basic dispel (buffs and debuffs)
self.target:Purge(true, true, false, false, false)
-- SUPER JANK LANE CREEP SWITCHAROO TO BYPASS LANE AI
if string.find(self.target:GetUnitName(), "guys_") then
local lane_creep_name = self.target:GetUnitName()
local new_lane_creep = CreateUnitByName(self.target:GetUnitName(), self.target:GetAbsOrigin(), false, self.caster, self.caster, self.caster:GetTeamNumber())
-- Copy the relevant stats over to the creep
new_lane_creep:SetBaseMaxHealth(self.target:GetMaxHealth())
new_lane_creep:SetHealth(self.target:GetHealth())
new_lane_creep:SetBaseDamageMin(self.target:GetBaseDamageMin())
new_lane_creep:SetBaseDamageMax(self.target:GetBaseDamageMax())
new_lane_creep:SetMinimumGoldBounty(self.target:GetGoldBounty())
new_lane_creep:SetMaximumGoldBounty(self.target:GetGoldBounty())
self.target:AddNoDraw()
self.target:ForceKill(false)
self.target = new_lane_creep
end
self.target:SetOwner(self.caster)
self.target:SetTeam(self.caster:GetTeam())
self.target:SetControllableByPlayer(self.caster:GetPlayerID(), false)
self.target:AddNewModifier(self.caster, self, "modifier_imba_enchantress_enchant_controlled", {duration = self.dominate_duration})
--self.target:AddNewModifier(self.caster, self, "modifier_dominated", {duration = self.dominate_duration}) -- This didn't work for me
self.target:AddNewModifier(self.caster, self, "modifier_kill", {duration = self.dominate_duration})
self.target:Heal(self.target:GetMaxHealth(), self.caster)
-- IMBAfication: Kindred Spirits
if self:GetCaster():HasAbility("imba_enchantress_untouchable") and self:GetCaster():FindAbilityByName("imba_enchantress_untouchable"):IsTrained() then
self.target:AddNewModifier(self.caster, self:GetCaster():FindAbilityByName("imba_enchantress_untouchable"), "modifier_imba_enchantress_untouchable", {})
end
if self.caster:GetName() == "npc_dota_hero_enchantress" then
self.caster:EmitSound("enchantress_ench_ability_enchant_0"..math.random(1,3))
end
else
-- Basic dispel (just buffs)
self.target:Purge(true, false, false, false, false)
self.target:AddNewModifier(self.caster, self, "modifier_imba_enchantress_enchant_slow", {duration = self.tooltip_duration * (1 - self.target:GetStatusResistance())})
if self.caster:GetName() == "npc_dota_hero_enchantress" then
self.caster:EmitSound("enchantress_ench_ability_enchant_0"..math.random(4,6))
end
end
end
----------------------
-- ENCHANT MODIFIER --
----------------------
-- modifier_imba_enchantress_enchant = class({})
---------------------------------
-- ENCHANT CONTROLLED MODIFIER --
---------------------------------
modifier_imba_enchantress_enchant_controlled = class({})
function modifier_imba_enchantress_enchant_controlled:IsHidden() return true end
function modifier_imba_enchantress_enchant_controlled:IsPurgable() return false end
function modifier_imba_enchantress_enchant_controlled:OnCreated()
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.parent = self:GetParent()
self.enchant_health = self.ability:GetSpecialValueFor("enchant_health")
self.enchant_damage = self.ability:GetSpecialValueFor("enchant_damage")
self.enchant_armor = self.ability:GetSpecialValueFor("enchant_armor")
if not IsServer() then return end
self.remaining_hp = self.parent:GetHealth()
self.particle = ParticleManager:CreateParticle("particles/units/heroes/hero_enchantress/enchantress_enchant.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.parent)
ParticleManager:SetParticleControl(self.particle, 0, self.parent:GetAbsOrigin())
self:AddParticle(self.particle, false, false, -1, false, false)
-- Don't need to destroy this at end because sound byte is short and modifier outlasts it by magnitudes (also it errors if I try to anyways)
self.parent:EmitSound("Hero_Enchantress.EnchantCreep")
end
function modifier_imba_enchantress_enchant_controlled:CheckState()
return {
[MODIFIER_STATE_DOMINATED] = true
}
end
function modifier_imba_enchantress_enchant_controlled:DeclareFunctions()
return {
MODIFIER_PROPERTY_EXTRA_HEALTH_BONUS,
MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE,
MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS,
MODIFIER_PROPERTY_BONUS_VISION_PERCENTAGE, -- Talent 4
MODIFIER_EVENT_ON_TAKEDAMAGE,
}
end
function modifier_imba_enchantress_enchant_controlled:GetModifierExtraHealthBonus()
return self.enchant_health
end
function modifier_imba_enchantress_enchant_controlled:GetModifierPreAttack_BonusDamage()
return self.enchant_damage
end
function modifier_imba_enchantress_enchant_controlled:GetModifierPhysicalArmorBonus()
return self.enchant_armor
end
function modifier_imba_enchantress_enchant_controlled:GetBonusVisionPercentage(keys)
return self:GetCaster():FindTalentValue("special_bonus_imba_enchantress_4")
end
-- IMBAfication: Instant Karma
function modifier_imba_enchantress_enchant_controlled:OnTakeDamage(keys)
if not IsServer() then return end
if keys.unit == self:GetParent() then
if keys.unit:IsAlive() then
self.remaining_hp = keys.unit:GetHealth()
else
-- Set overkill damage as the amount of damage attacker did over the victim's remaining health within one attack
local overkill_damage = keys.damage - self.remaining_hp
-- Don't trigger Instant Karma on buildings...
if keys.attacker:IsBuilding() then return end
local damageTable = {
victim = keys.attacker,
damage = overkill_damage,
damage_type = DAMAGE_TYPE_PURE,
damage_flags = DOTA_DAMAGE_FLAG_NO_SPELL_AMPLIFICATION + DOTA_DAMAGE_FLAG_NO_SPELL_LIFESTEAL,
attacker = self.caster,
ability = self.ability
}
ApplyDamage(damageTable)
SendOverheadEventMessage(nil, OVERHEAD_ALERT_DAMAGE, keys.attacker, overkill_damage, nil)
end
end
end
---------------------------
-- ENCHANT SLOW MODIFIER --
---------------------------
modifier_imba_enchantress_enchant_slow = class({})
function modifier_imba_enchantress_enchant_slow:GetStatusEffectName()
return "particles/status_fx/status_effect_enchantress_enchant_slow.vpcf"
end
function modifier_imba_enchantress_enchant_slow:OnCreated()
self.ability = self:GetAbility()
self.parent = self:GetParent()
self.slow_movement_speed = self.ability:GetSpecialValueFor("slow_movement_speed")
if not IsServer() then return end
self.particle = ParticleManager:CreateParticle("particles/units/heroes/hero_enchantress/enchantress_enchant_slow.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.parent)
ParticleManager:SetParticleControl(self.particle, 0, self.parent:GetAbsOrigin())
self:AddParticle(self.particle, false, false, -1, false, false)
self.parent:EmitSound("Hero_Enchantress.EnchantHero")
end
function modifier_imba_enchantress_enchant_slow:OnDestroy()
if not IsServer() then return end
self.parent:StopSound("Hero_Enchantress.EnchantHero")
end
function modifier_imba_enchantress_enchant_slow:DeclareFunctions()
local decFuncs = {
MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE,
MODIFIER_PROPERTY_PROVIDES_FOW_POSITION -- IMBAfication: Enchant provides vision of affected enemies
}
return decFuncs
end
function modifier_imba_enchantress_enchant_slow:GetModifierMoveSpeedBonus_Percentage()
return self.slow_movement_speed
end
function modifier_imba_enchantress_enchant_slow:GetModifierProvidesFOWVision()
return 1
end
-------------------------
-- Nature's Attendants --
-------------------------
LinkLuaModifier("modifier_imba_enchantress_natures_attendants", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_natures_attendants_mini", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
imba_enchantress_natures_attendants = class({})
function imba_enchantress_natures_attendants:GetCastAnimation()
return ACT_DOTA_CAST_ABILITY_3
end
function imba_enchantress_natures_attendants:OnSpellStart()
self.caster = self:GetCaster()
self.duration = self:GetDuration()
-- Make Fundamental's Essence ordered instead of random
if not self.type then
self.type = 1
else
if not self.caster:HasModifier("modifier_imba_enchantress_natures_attendants") then
self.type = self.type + 1
if self.type > 5 then
self.type = 1
end
end
end
self.caster:AddNewModifier(self.caster, self, "modifier_imba_enchantress_natures_attendants", {duration = self.duration})
if self.caster:GetName() == "npc_dota_hero_enchantress" then
self.caster:EmitSound("enchantress_ench_ability_nature_0"..math.random(1,6))
end
end
----------------------------------
-- NATURE'S ATTENDANTS MODIFIER --
----------------------------------
modifier_imba_enchantress_natures_attendants = class({})
function modifier_imba_enchantress_natures_attendants:IsPurgable() return false end
function modifier_imba_enchantress_natures_attendants:RemoveOnDeath() return false end
function modifier_imba_enchantress_natures_attendants:OnCreated()
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.parent = self:GetParent()
-- AbilitySpecials
self.heal_interval = self.ability:GetSpecialValueFor("heal_interval")
self.heal = self.ability:GetSpecialValueFor("heal")
self.radius = self.ability:GetSpecialValueFor("radius")
self.wisp_count = self.ability:GetSpecialValueFor("wisp_count")
self.critical_health_pct = self.ability:GetSpecialValueFor("critical_health_pct")
self.base_damage_reduction_pct = self.ability:GetSpecialValueFor("base_damage_reduction_pct")
self.cyan_mana_restore = self.ability:GetSpecialValueFor("cyan_mana_restore")
self.green_heal_amp = self.ability:GetSpecialValueFor("green_heal_amp")
self.orange_day_vision = self.ability:GetSpecialValueFor("orange_day_vision")
self.orange_night_vision = self.ability:GetSpecialValueFor("orange_night_vision")
self.pink_movespeed_pct = self.ability:GetSpecialValueFor("pink_movespeed_pct")
-- Sprites' Attraction Talent (multiply a bunch of values..)
if self.caster:HasTalent("special_bonus_imba_enchantress_8") then
self.multiplier = self.caster:FindTalentValue("special_bonus_imba_enchantress_8")
self.heal = self.heal * self.multiplier
self.wisp_count = self.wisp_count * self.multiplier
self.critical_health_pct = self.critical_health_pct * self.multiplier
self.base_damage_reduction_pct = self.base_damage_reduction_pct * self.multiplier
self.cyan_mana_restore = self.cyan_mana_restore * self.multiplier
self.green_heal_amp = self.green_heal_amp * self.multiplier
self.orange_day_vision = self.orange_day_vision * self.multiplier
self.orange_night_vision = self.orange_night_vision * self.multiplier
self.pink_movespeed_pct = self.pink_movespeed_pct * self.multiplier
end
self.level = self.ability:GetLevel()
if not IsServer() then return end
-- IMBAfication: Fundamental's Essence
-- 1 Base: Reduces all incoming damage by 10%
-- 2 Cyan: Every wisp heal also grants X mana
-- 3 Green: Amplifies all sources of healing by 20%
-- 4 Orange: Increase day/night vision by 250/750 respectively
-- 5 Pink: Increases move speed by 5% and grants flying movement
if self.ability.type then
self:SetStackCount(self.ability.type)
end
-- PARTICLESSSS
-- 3/5/7/9 wisps based on level
-- 3-5/7/9/11 for the wisp control points
-- CP60 for colour, CP61 Vector(1, 0, 0) to activate it
self.particle_name = "particles/units/heroes/hero_enchantress/enchantress_natures_attendants_lvl"..self.level..".vpcf"
self.particle = ParticleManager:CreateParticle(self.particle_name, PATTACH_ABSORIGIN_FOLLOW, self.parent)
for wisp = 3, 3 + (self.level * 2) do
ParticleManager:SetParticleControlEnt(self.particle, wisp, self.parent, PATTACH_POINT_FOLLOW, "attach_hitloc", self.parent:GetAbsOrigin(), true)
end
if self:GetStackCount() == 1 then
else
ParticleManager:SetParticleControl(self.particle, 61, Vector(1, 0, 0))
if self:GetStackCount() == 2 then
ParticleManager:SetParticleControl(self.particle, 60, Vector(0, 255, 255))
elseif self:GetStackCount() == 3 then
ParticleManager:SetParticleControl(self.particle, 60, Vector(50, 255, 50))
elseif self:GetStackCount() == 4 then
ParticleManager:SetParticleControl(self.particle, 60, Vector(255, 140, 0))
elseif self:GetStackCount() == 5 then
ParticleManager:SetParticleControl(self.particle, 60, Vector(255, 105, 180))
end
end
self:AddParticle(self.particle, false, false, -1, false, false)
self.caster:EmitSound("Hero_Enchantress.NaturesAttendantsCast")
self:StartIntervalThink(self.heal_interval)
end
function modifier_imba_enchantress_natures_attendants:OnIntervalThink()
if not IsServer() then return end
-- This is probably pretty inefficient...
-- Establish empty table of allies that will need healing
local hurt_allies = {}
-- Find all allies in radius
local allies = FindUnitsInRadius(self.caster:GetTeamNumber(),
self.parent:GetAbsOrigin(),
nil,
self.radius,
DOTA_UNIT_TARGET_TEAM_FRIENDLY,
DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO,
DOTA_UNIT_TARGET_FLAG_INVULNERABLE + DOTA_UNIT_TARGET_FLAG_NOT_ANCIENTS,
FIND_ANY_ORDER,
false)
-- Populate hurt allies array with those that do not have full health
for _, ally in pairs(allies) do
-- Deal damage to each
if ally:GetHealthPercent() < 100 then
table.insert(hurt_allies, ally)
end
end
if #hurt_allies == 0 then
-- If everyone's full health, bring all the wisps back to Enchantress
for wisp = 3, 3 + (self.level * 2) do
ParticleManager:SetParticleControlEnt(self.particle, wisp, self.parent, PATTACH_POINT_FOLLOW, "attach_hitloc", self.parent:GetAbsOrigin(), true)
end
else
-- Each wisp picks a random valid target to attach to and heal
for wisp = 1, self.wisp_count do
local selected_unit = RandomInt(1, #hurt_allies)
-- Reminder that particle only has 3/5/7/9 wisps and 3 to 5/7/9/11 for CP so if you want to add more wisps either edit the particle or accept it'll look weird
ParticleManager:SetParticleControlEnt(self.particle, math.min(wisp + 2, 3 + (self.level * 2)), hurt_allies[selected_unit], PATTACH_POINT_FOLLOW, "attach_hitloc", hurt_allies[selected_unit]:GetAbsOrigin(), true)
-- Each wisp heals for a separate instance
hurt_allies[selected_unit]:Heal(self.heal, self.caster)
-- Cyan: Every wisp heal also grants 5/6/7/8 mana
if self:GetStackCount() == 2 then
hurt_allies[selected_unit]:GiveMana(self.cyan_mana_restore)
end
-- IMBAfication: Rest for the Weary
if hurt_allies[selected_unit]:GetHealthPercent() < self.critical_health_pct and not hurt_allies[selected_unit]:HasModifier("modifier_imba_enchantress_natures_attendants_mini") then
hurt_allies[selected_unit]:AddNewModifier(self.caster, self.ability, "modifier_imba_enchantress_natures_attendants_mini", {duration = self.ability.duration})
end
end
end
end
function modifier_imba_enchantress_natures_attendants:OnDestroy()
if not IsServer() then return end
self.caster:StopSound("Hero_Enchantress.NaturesAttendantsCast")
end
function modifier_imba_enchantress_natures_attendants:CheckState()
if self:GetStackCount() == 5 then
return {[MODIFIER_STATE_FLYING] = true} -- * Pink: Increases move speed by 5% and grants flying movement
end
end
function modifier_imba_enchantress_natures_attendants:DeclareFunctions()
local decFuncs = {
MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, -- * Base: Reduces all incoming damage by 10%
MODIFIER_PROPERTY_HP_REGEN_AMPLIFY_PERCENTAGE, -- * Green: Amplifies all sources of healing by 20%
MODIFIER_PROPERTY_BONUS_DAY_VISION, -- * Orange: Increase day/night vision by 250/750 respectively
MODIFIER_PROPERTY_BONUS_NIGHT_VISION, -- * Orange: Increase day/night vision by 250/750 respectively
MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE -- * Pink: Increases move speed by 5% and grants flying movement
}
return decFuncs
end
function modifier_imba_enchantress_natures_attendants:GetModifierIncomingDamage_Percentage()
if self:GetStackCount() == 1 then
return self.base_damage_reduction_pct
else
return 0
end
end
function modifier_imba_enchantress_natures_attendants:GetModifierHPRegenAmplify_Percentage()
if self:GetStackCount() == 3 then
return self.green_heal_amp
else
return 0
end
end
function modifier_imba_enchantress_natures_attendants:GetBonusDayVision()
if self:GetStackCount() == 4 then
return self.orange_day_vision
else
return 0
end
end
function modifier_imba_enchantress_natures_attendants:GetBonusNightVision()
if self:GetStackCount() == 4 then
return self.orange_night_vision
else
return 0
end
end
function modifier_imba_enchantress_natures_attendants:GetModifierMoveSpeedBonus_Percentage()
if self:GetStackCount() == 5 then
return self.pink_movespeed_pct
else
return 0
end
end
---------------------------------------
-- NATURE'S ATTENDANTS MINI MODIFIER --
---------------------------------------
modifier_imba_enchantress_natures_attendants_mini = class({})
function modifier_imba_enchantress_natures_attendants_mini:OnCreated()
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.parent = self:GetParent()
-- AbilitySpecials
self.heal_interval = self.ability:GetSpecialValueFor("heal_interval")
self.heal = self.ability:GetSpecialValueFor("heal")
self.wisp_count_mini = self.ability:GetSpecialValueFor("wisp_count_mini")
if not IsServer() then return end
self.particle_name = "particles/units/heroes/hero_enchantress/enchantress_natures_attendants_lvl1.vpcf"
if self.wisp_count_mini >= 5 then
self.particle_name = "particles/units/heroes/hero_enchantress/enchantress_natures_attendants_lvl2.vpcf"
end
self.particle = ParticleManager:CreateParticle(self.particle_name, PATTACH_ABSORIGIN_FOLLOW, self.parent)
for wisp = 3, 7 do
ParticleManager:SetParticleControlEnt(self.particle, wisp, self.parent, PATTACH_POINT_FOLLOW, "attach_hitloc", self.parent:GetAbsOrigin(), true)
end
self:AddParticle(self.particle, false, false, -1, false, false)
self.parent:EmitSound("Hero_Enchantress.NaturesAttendantsCast")
self:StartIntervalThink(self.heal_interval)
end
function modifier_imba_enchantress_natures_attendants_mini:OnIntervalThink()
if not IsServer() then return end
for wisp = 1, self.wisp_count_mini do
-- Each wisp heals for a separate instance
self.parent:Heal(self.heal, self.caster)
end
end
function modifier_imba_enchantress_natures_attendants_mini:OnDestroy()
if not IsServer() then return end
self.parent:StopSound("Hero_Enchantress.NaturesAttendantsCast")
end
------------------
-- Natura Shift --
------------------
LinkLuaModifier("modifier_imba_enchantress_natura_shift", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
imba_enchantress_natura_shift = class({})
function imba_enchantress_natura_shift:IsInnateAbility() return true end
function imba_enchantress_natura_shift:IsStealable() return false end
function imba_enchantress_natura_shift:GetIntrinsicModifierName()
return "modifier_imba_enchantress_natura_shift"
end
function imba_enchantress_natura_shift:OnSpellStart()
self.modifier = self:GetCaster():FindModifierByName("modifier_imba_enchantress_natura_shift")
if not self.modifier or self.modifier:GetStackCount() == 1 then
self.modifier:SetStackCount(2)
elseif self.modifier:GetStackCount() == 2 then
self.modifier:SetStackCount(3)
elseif self.modifier:GetStackCount() == 3 then
self.modifier:SetStackCount(1)
end
end
function imba_enchantress_natura_shift:GetAbilityTextureName()
local caster = self:GetCaster()
if caster:HasModifier("modifier_imba_enchantress_natura_shift") then
local state = caster:GetModifierStackCount("modifier_imba_enchantress_natura_shift", caster)
if state == 1 then
return "custom/natura_shift_inactive"
elseif state == 2 then
return "custom/natura_shift_fast"
elseif state == 3 then
return "custom/natura_shift_slow"
else
return "custom/natura_shift_inactive"
end
end
end
modifier_imba_enchantress_natura_shift = class({})
function modifier_imba_enchantress_natura_shift:IsHidden() return true end
function modifier_imba_enchantress_natura_shift:OnCreated()
self:SetStackCount(1)
end
function modifier_imba_enchantress_natura_shift:DeclareFunctions()
local decFuncs = {
MODIFIER_PROPERTY_PROJECTILE_SPEED_BONUS
}
return decFuncs
end
function modifier_imba_enchantress_natura_shift:GetModifierProjectileSpeedBonus()
self.ability = self:GetAbility()
self.speed_fast = self.ability:GetSpecialValueFor("speed_fast")
self.speed_slow = self.ability:GetSpecialValueFor("speed_slow")
if self:GetStackCount() == 1 then
return 0
elseif self:GetStackCount() == 2 then
return self.speed_fast
elseif self:GetStackCount() == 3 then
return self.speed_slow
else
return 0
end
end
-------------
-- Impetus --
-------------
LinkLuaModifier("modifier_imba_enchantress_impetus", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_impetus_huntmastery_timer", "components/abilities/heroes/hero_enchantress.lua", LUA_MODIFIER_MOTION_NONE)
imba_enchantress_impetus = class({})
function imba_enchantress_impetus:IsStealable() return false end
function imba_enchantress_impetus:GetIntrinsicModifierName()
return "modifier_imba_enchantress_impetus"
end
----------------------
-- IMPETUS MODIFIER --
----------------------
modifier_imba_enchantress_impetus = class({})
function modifier_imba_enchantress_impetus:OnCreated()
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.parent = self:GetParent()
-- Use this boolean to track if Impetus is manually cast
self.impetus_orb = false
self.base_attack = "particles/units/heroes/hero_enchantress/enchantress_base_attack.vpcf"
--self.impetus_attack = "particles/econ/items/enchantress/enchantress_virgas/ench_impetus_virgas.vpcf"
self.impetus_attack = "particles/units/heroes/hero_enchantress/enchantress_impetus.vpcf"
self.attack_queue = {} -- Gonna try my own jank way to deal with impetus attacks at extreme speeds
--self.impetus_start = "Hero_Enchantress.Impetus.Immortal"
self.impetus_start = "Hero_Enchantress.Impetus"
--self.impetus_damage = "Hero_Enchantress.ImpetusDamage.Immortal"
self.impetus_damage = "Hero_Enchantress.ImpetusDamage"
-- AbilitySpecials
self.distance_damage_pct = self.ability:GetSpecialValueFor("distance_damage_pct")
--self.distance_cap = self.ability:GetSpecialValueFor("distance_cap")
self.bonus_attack_range_scepter = self.ability:GetSpecialValueFor("bonus_attack_range_scepter")
self.attack_cast_stack = self.ability:GetSpecialValueFor("attack_cast_stack")
self.huntmastery_grace_period = self.ability:GetSpecialValueFor("huntmastery_grace_period")
end
function modifier_imba_enchantress_impetus:OnRefresh()
self.distance_damage_pct = self.ability:GetSpecialValueFor("distance_damage_pct")
self.bonus_attack_range_scepter = self.ability:GetSpecialValueFor("bonus_attack_range_scepter")
self.attack_cast_stack = self.ability:GetSpecialValueFor("attack_cast_stack")
self.huntmastery_grace_period = self.ability:GetSpecialValueFor("huntmastery_grace_period")
end
function modifier_imba_enchantress_impetus:DeclareFunctions()
local decFuncs = {
MODIFIER_PROPERTY_CAST_RANGE_BONUS_STACKING,
MODIFIER_PROPERTY_ATTACK_RANGE_BONUS,
MODIFIER_EVENT_ON_ATTACK_START,
MODIFIER_EVENT_ON_ATTACK,
MODIFIER_EVENT_ON_ATTACK_LANDED,
MODIFIER_EVENT_ON_ATTACK_FAIL,
MODIFIER_EVENT_ON_ORDER
}
return decFuncs
end
function modifier_imba_enchantress_impetus:GetModifierCastRangeBonusStacking()
local cast_range = self:GetStackCount() * self.attack_cast_stack
if self.parent:HasScepter() then
cast_range = cast_range + self.bonus_attack_range_scepter
end
return cast_range
end
function modifier_imba_enchantress_impetus:GetModifierAttackRangeBonus()
local attack_range = self:GetStackCount() * self.attack_cast_stack
if self.parent:HasScepter() then
attack_range = attack_range + self.bonus_attack_range_scepter
end
return attack_range
end
function modifier_imba_enchantress_impetus:OnAttackStart( keys )
if not IsServer() then return end
if keys.attacker == self.caster and self.ability:IsFullyCastable() and not self.caster:IsSilenced() and not keys.target:IsBuilding() and not keys.target:IsOther() and (self.ability:GetAutoCastState() or self.impetus_orb) then
self.parent:SetRangedProjectileName(self.impetus_attack)
else
self.parent:SetRangedProjectileName(self.base_attack)
end
end
function modifier_imba_enchantress_impetus:OnAttack( keys )
if not IsServer() then return end
if keys.attacker == self.caster then
if not self.caster:IsIllusion() and self.ability:IsFullyCastable() and not self.caster:IsSilenced() and not keys.target:IsBuilding() and not keys.target:IsOther() and (self.ability:GetAutoCastState() or self.impetus_orb) then
table.insert(self.attack_queue, true)
self.ability:UseResources(true, false, false)
self.caster:EmitSound(self.impetus_start)
self.impetus_orb = false
else
table.insert(self.attack_queue, false)
end
end
end
function modifier_imba_enchantress_impetus:OnAttackLanded( keys )
if not IsServer() then return end
if keys.attacker == self.caster and #self.attack_queue > 0 then
-- If the attack is flagged as Impetus, apply the effects
if self.attack_queue[1] and not keys.target:IsBuilding() and keys.target:IsAlive() then
-- IMBAfication: Huntmastery
keys.target:AddNewModifier(self.caster, self.ability, "modifier_imba_enchantress_impetus_huntmastery_timer", {duration = self.huntmastery_grace_period})
-- Remove distance cap on damage
-- Note that CalcDistanceBetweenEntityOBB(self.caster, keys.target) actually gives different / "wrong" results...
--local distance = math.min(CalcDistanceBetweenEntityOBB(self.caster, keys.target), self.distance_cap)
local distance = (self.caster:GetAbsOrigin() - keys.target:GetAbsOrigin()):Length()
local impetus_damage = distance * ((self.distance_damage_pct + self.caster:FindTalentValue("special_bonus_imba_enchantress_9")) / 100)
local damageTable = {victim = keys.target,
damage = impetus_damage,
damage_type = DAMAGE_TYPE_PURE,
damage_flags = DOTA_DAMAGE_FLAG_NONE,
attacker = self.caster,
ability = self.ability
}
ApplyDamage(damageTable)
SendOverheadEventMessage(nil, OVERHEAD_ALERT_BONUS_SPELL_DAMAGE, keys.target, impetus_damage, nil)
keys.target:EmitSound(self.impetus_damage)
-- Armament Equivalency
if self.caster:HasTalent("special_bonus_imba_enchantress_7") then
if not self.armament_spell_amp_pct or not self.armament_attack_dmg_pct then
self.armament_spell_amp_pct = self.caster:FindTalentValue("special_bonus_imba_enchantress_7", "spell_amp_pct") / 100
self.armament_attack_dmg_pct = self.caster:FindTalentValue("special_bonus_imba_enchantress_7", "attack_dmg_pct") / 100
end
local phys_damage = impetus_damage * keys.target:GetSpellAmplification(false) * self.armament_spell_amp_pct
local magic_damage = impetus_damage * (keys.target:GetAverageTrueAttackDamage(self.caster) / 100) * self.armament_attack_dmg_pct
-- First apply the extra physical damage...
damageTable.damage = phys_damage
damageTable.damage_type = DAMAGE_TYPE_PHYSICAL
ApplyDamage(damageTable)
-- Let's stagger the damage numbers a bit so they're easier to see
Timers:CreateTimer(0.2, function()
SendOverheadEventMessage(nil, OVERHEAD_ALERT_BONUS_SPELL_DAMAGE, keys.target, phys_damage, nil)
end)
-- ...then apply the extra magical damage
damageTable.damage = magic_damage
damageTable.damage_type = DAMAGE_TYPE_MAGICAL
ApplyDamage(damageTable)
Timers:CreateTimer(0.4, function()
SendOverheadEventMessage(nil, OVERHEAD_ALERT_BONUS_SPELL_DAMAGE, keys.target, magic_damage, nil)
end)
end
-- IMBAfication: Huntmastery (deprecated to now allow a small grace period with modifier modifier_imba_enchantress_impetus_huntmastery_timer but leaving this for reference
-- Gotta wait a bit before potential kills are registered
-- Timers:CreateTimer(FrameTime(), function()
-- if not keys.target:IsAlive() and keys.target:IsRealHero() and (keys.target.IsReincarnating and not keys.target:IsReincarnating()) then
-- self:IncrementStackCount()
-- if self.caster:GetName() == "npc_dota_hero_enchantress" then
-- self.caster:EmitSound("enchantress_ench_ability_impetus_0"..math.random(1,7))
-- end
-- end
-- end)
end
table.remove(self.attack_queue, 1)
end
end
function modifier_imba_enchantress_impetus:OnAttackFail( keys )
if not IsServer() then return end
if keys.attacker == self.caster and #self.attack_queue > 0 then
table.remove(self.attack_queue, 1)
end
end
-- Handle Impetus orb flag by checking if it is manually cast
function modifier_imba_enchantress_impetus:OnOrder(keys)
if keys.unit == self.caster then
if keys.order_type == DOTA_UNIT_ORDER_CAST_TARGET and keys.ability:GetName() == self.ability:GetName() then
self.impetus_orb = true
else
self.impetus_orb = false
end
end
end
----------------------------------------
-- IMPETUS HUNTMASTERY TIMER MODIFIER --
----------------------------------------
modifier_imba_enchantress_impetus_huntmastery_timer = class({})
function modifier_imba_enchantress_impetus_huntmastery_timer:IgnoreTenacity() return true end
function modifier_imba_enchantress_impetus_huntmastery_timer:IsHidden() return true end
function modifier_imba_enchantress_impetus_huntmastery_timer:IsPurgable() return false end
function modifier_imba_enchantress_impetus_huntmastery_timer:RemoveOnDeath() return false end -- Destroys itself rather promptly
function modifier_imba_enchantress_impetus_huntmastery_timer:DeclareFunctions()
return {
MODIFIER_EVENT_ON_DEATH
}
end
function modifier_imba_enchantress_impetus_huntmastery_timer:OnDeath(keys)
if keys.unit == self:GetParent() and keys.unit:IsRealHero() and (keys.unit.IsReincarnating and not keys.unit:IsReincarnating()) then
if self:GetAbility():GetName() == "imba_enchantress_impetus_723" then
if not self:GetCaster():HasModifier("modifier_imba_enchantress_impetus_723") then
local impetus_modifier = self:GetCaster():AddNewModifier(self:GetCaster(), self:GetAbility(), "modifier_imba_enchantress_impetus_723", {})
if impetus_modifier then
impetus_modifier:IncrementStackCount()
end
else
self:GetCaster():FindModifierByName("modifier_imba_enchantress_impetus_723"):IncrementStackCount()
end
else
self.caster = self:GetCaster()
local impetus_modifier = self.caster:FindModifierByName("modifier_imba_enchantress_impetus")
if impetus_modifier then
impetus_modifier:IncrementStackCount()
end
end
if self:GetCaster():GetName() == "npc_dota_hero_enchantress" then
self:GetCaster():EmitSound("enchantress_ench_ability_impetus_0"..math.random(1,7))
end
end
end
----------------------------------
-- IMBA_ENCHANTRESS_IMPETUS_723 --
----------------------------------
LinkLuaModifier("modifier_generic_orb_effect_lua", "components/modifiers/generic/modifier_generic_orb_effect_lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enchantress_impetus_723", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
imba_enchantress_impetus_723 = imba_enchantress_impetus_723 or class({})
modifier_imba_enchantress_impetus_723 = modifier_imba_enchantress_impetus_723 or class({})
function imba_enchantress_impetus_723:IsStealable() return false end
function imba_enchantress_impetus_723:OnUpgrade()
if not self:GetCaster():HasModifier("modifier_imba_enchantress_impetus_723") then
self:GetCaster():AddNewModifier(self:GetCaster(), self, "modifier_imba_enchantress_impetus_723", {})
end
end
function imba_enchantress_impetus_723:GetIntrinsicModifierName()
return "modifier_generic_orb_effect_lua"
end
function imba_enchantress_impetus_723:GetProjectileName()
return "particles/units/heroes/hero_enchantress/enchantress_impetus.vpcf"
end
function imba_enchantress_impetus_723:OnOrbFire()
self:GetCaster():EmitSound("Hero_Enchantress.Impetus")
end
function imba_enchantress_impetus_723:OnOrbImpact( keys )
if not keys.target:IsMagicImmune() and keys.target:IsAlive() then
keys.target:EmitSound("Hero_Enchantress.ImpetusDamage")
-- IMBAfication: Huntmastery
keys.target:AddNewModifier(self:GetCaster(), self, "modifier_imba_enchantress_impetus_huntmastery_timer", {duration = self:GetSpecialValueFor("huntmastery_grace_period")})
-- Remove distance cap on damage
-- Note that CalcDistanceBetweenEntityOBB(self:Getcaster(), keys.target) actually gives different / "wrong" results...
--local distance = math.min(CalcDistanceBetweenEntityOBB(self:GetCaster(), keys.target), self.distance_cap)
local distance = (self:GetCaster():GetAbsOrigin() - keys.target:GetAbsOrigin()):Length()
local impetus_damage = distance * self:GetTalentSpecialValueFor("distance_damage_pct") / 100
ApplyDamage({
victim = keys.target,
damage = impetus_damage,
damage_type = DAMAGE_TYPE_PURE,
damage_flags = DOTA_DAMAGE_FLAG_NONE,
attacker = self:GetCaster(),
ability = self
})
SendOverheadEventMessage(nil, OVERHEAD_ALERT_BONUS_SPELL_DAMAGE, keys.target, impetus_damage, nil)
end
end
-------------------------------------------
-- MODIFIER_IMBA_ENCHANTRESS_IMPETUS_723 --
-------------------------------------------
function modifier_imba_enchantress_impetus_723:IsHidden() return self:GetStackCount() <= 0 end
function modifier_imba_enchantress_impetus_723:IsPurgable() return false end
function modifier_imba_enchantress_impetus_723:RemoveOnDeath() return false end
function modifier_imba_enchantress_impetus_723:DeclareFunctions()
return {
MODIFIER_PROPERTY_CAST_RANGE_BONUS_STACKING,
MODIFIER_PROPERTY_ATTACK_RANGE_BONUS
}
end
function modifier_imba_enchantress_impetus_723:GetModifierCastRangeBonusStacking()
if self:GetAbility() then
local cast_range = self:GetStackCount() * self:GetAbility():GetSpecialValueFor("attack_cast_stack")
-- if self:GetParent():HasScepter() then
-- cast_range = cast_range + self.bonus_attack_range_scepter
-- end
return cast_range
else
self:Destroy()
end
end
function modifier_imba_enchantress_impetus_723:GetModifierAttackRangeBonus()
if self:GetAbility() then
local attack_range = self:GetStackCount() * self:GetAbility():GetSpecialValueFor("attack_cast_stack")
-- if self:GetParent():HasScepter() then
-- attack_range = attack_range + self.bonus_attack_range_scepter
-- end
return attack_range
else
self:Destroy()
end
end
---------------------
-- TALENT HANDLERS --
---------------------
-- # Talents
-- * Level 10: +25 Movement Speed Aura | +15% Magic Resistance Aura (Aura radius is equal to Enchantress's attack range)
-- * Level 15: +300% Bonus Vision on Charmed Units | +50 Damage, +10% Spell Amp
-- * Level 20: +3s/3x Enchant Slow/Charm Duration | Peace Was Always An Option (+125 Untouchable Slow; Peace on Earth now bypasses status resistance)
-- * Level 25: Sprites' Attraction (2x Nature's Attendants wisps, heal amount, Rest for the Weary health threshold, and Fundemental's Essence values) | Armament Equivalency (Impetus deals additional physical and magical damage based on the target's spell amp and damage respectively.)
-- Client-side helper functions --
LinkLuaModifier("modifier_special_bonus_imba_enchantress_1", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_1_aura", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_2", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_2_aura", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_3", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_4", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_5", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_6", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_7", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_8", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_special_bonus_imba_enchantress_9", "components/abilities/heroes/hero_enchantress", LUA_MODIFIER_MOTION_NONE)
modifier_special_bonus_imba_enchantress_2_aura = class({})
modifier_special_bonus_imba_enchantress_3 = class({})
modifier_special_bonus_imba_enchantress_4 = class({})
modifier_special_bonus_imba_enchantress_5 = class({})
modifier_special_bonus_imba_enchantress_6 = class({})
modifier_special_bonus_imba_enchantress_7 = class({})
modifier_special_bonus_imba_enchantress_8 = class({})
modifier_special_bonus_imba_enchantress_9 = class({})
-----------------------
-- TALENT 1 MODIFIER --
-----------------------
-- Magic Resistance Aura
modifier_special_bonus_imba_enchantress_1 = class({})
function modifier_special_bonus_imba_enchantress_1:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_1:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_1:RemoveOnDeath() return false end
function modifier_special_bonus_imba_enchantress_1:IsAura() return true end
function modifier_special_bonus_imba_enchantress_1:IsAuraActiveOnDeath() return false end
function modifier_special_bonus_imba_enchantress_1:GetAuraRadius() return self:GetParent():Script_GetAttackRange() end
function modifier_special_bonus_imba_enchantress_1:GetAuraSearchFlags() return DOTA_UNIT_TARGET_FLAG_NONE end
function modifier_special_bonus_imba_enchantress_1:GetAuraSearchTeam() return DOTA_UNIT_TARGET_TEAM_FRIENDLY end
function modifier_special_bonus_imba_enchantress_1:GetAuraSearchType() return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC end
function modifier_special_bonus_imba_enchantress_1:GetModifierAura() return "modifier_special_bonus_imba_enchantress_1_aura" end
----------------------------
-- TALENT 1 MODIFIER AURA --
----------------------------
modifier_special_bonus_imba_enchantress_1_aura = class({})
function modifier_special_bonus_imba_enchantress_1_aura:GetTexture()
return "enchantress_enchant"
end
function modifier_special_bonus_imba_enchantress_1_aura:OnCreated()
self.value = self:GetCaster():FindTalentValue("special_bonus_imba_enchantress_1")
end
function modifier_special_bonus_imba_enchantress_1_aura:DeclareFunctions()
local decFuncs = {MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS}
return decFuncs
end
function modifier_special_bonus_imba_enchantress_1_aura:GetModifierMagicalResistanceBonus()
return self.value
end
-----------------------
-- TALENT 2 MODIFIER --
-----------------------
-- Movement Speed Aura
modifier_special_bonus_imba_enchantress_2 = class({})
function modifier_special_bonus_imba_enchantress_2:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_2:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_2:RemoveOnDeath() return false end
function modifier_special_bonus_imba_enchantress_2:IsAura() return true end
function modifier_special_bonus_imba_enchantress_2:IsAuraActiveOnDeath() return false end
function modifier_special_bonus_imba_enchantress_2:GetAuraRadius() return self:GetParent():Script_GetAttackRange() end
function modifier_special_bonus_imba_enchantress_2:GetAuraSearchFlags() return DOTA_UNIT_TARGET_FLAG_NONE end
function modifier_special_bonus_imba_enchantress_2:GetAuraSearchTeam() return DOTA_UNIT_TARGET_TEAM_FRIENDLY end
function modifier_special_bonus_imba_enchantress_2:GetAuraSearchType() return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC end
function modifier_special_bonus_imba_enchantress_2:GetModifierAura() return "modifier_special_bonus_imba_enchantress_2_aura" end
----------------------------
-- TALENT 2 MODIFIER AURA --
----------------------------
modifier_special_bonus_imba_enchantress_2_aura = class({})
function modifier_special_bonus_imba_enchantress_2_aura:GetTexture()
return "enchantress_enchant"
end
function modifier_special_bonus_imba_enchantress_2_aura:OnCreated()
self.value = self:GetCaster():FindTalentValue("special_bonus_imba_enchantress_2")
end
function modifier_special_bonus_imba_enchantress_2_aura:DeclareFunctions()
return {MODIFIER_PROPERTY_MOVESPEED_BONUS_CONSTANT}
end
function modifier_special_bonus_imba_enchantress_2_aura:GetModifierMoveSpeedBonus_Constant ()
return self.value
end
-----------------------
-- TALENT 3 MODIFIER --
-----------------------
-- Damage and Spell Amp
function modifier_special_bonus_imba_enchantress_3:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_3:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_3:RemoveOnDeath() return false end
function modifier_special_bonus_imba_enchantress_3:OnCreated()
self.damage = self:GetCaster():FindTalentValue("special_bonus_imba_enchantress_3", "damage")
self.spell_amp = self:GetCaster():FindTalentValue("special_bonus_imba_enchantress_3", "spell_amp")
end
function modifier_special_bonus_imba_enchantress_3:DeclareFunctions()
return {
MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE,
MODIFIER_PROPERTY_SPELL_AMPLIFY_PERCENTAGE
}
end
function modifier_special_bonus_imba_enchantress_3:GetModifierPreAttack_BonusDamage()
return self.damage
end
function modifier_special_bonus_imba_enchantress_3:GetModifierSpellAmplify_Percentage()
return self.spell_amp
end
-----------------------
-- TALENT 4 MODIFIER --
-----------------------
-- Massive Bonus Vision on Charmed Units
function modifier_special_bonus_imba_enchantress_4:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_4:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_4:RemoveOnDeath() return false end
-----------------------
-- TALENT 5 MODIFIER --
-----------------------
-- Untouchable Boost and Peace on Earth Status Resist Bypass
function modifier_special_bonus_imba_enchantress_5:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_5:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_5:RemoveOnDeath() return false end
-----------------------
-- TALENT 6 MODIFIER --
-----------------------
-- Enchant duration increase
function modifier_special_bonus_imba_enchantress_6:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_6:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_6:RemoveOnDeath() return false end
-----------------------
-- TALENT 7 MODIFIER --
-----------------------
-- Impetus Conditional Bonus Damage
function modifier_special_bonus_imba_enchantress_7:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_7:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_7:RemoveOnDeath() return false end
-----------------------
-- TALENT 8 MODIFIER --
-----------------------
-- Nature's Attendants doubling
function modifier_special_bonus_imba_enchantress_8:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_8:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_8:RemoveOnDeath() return false end
-----------------------
-- TALENT 9 MODIFIER --
-----------------------
-- +X% Impetus Damage
function modifier_special_bonus_imba_enchantress_9:IsHidden() return true end
function modifier_special_bonus_imba_enchantress_9:IsPurgable() return false end
function modifier_special_bonus_imba_enchantress_9:RemoveOnDeath() return false end
-- Since modifiers can't be applied on a dead unit, make sure they get slapped onto Enchantress on respawn if she skills a talent while dead
-- Let's do this by just attaching all the modifiers to respective abilities (and default to Untouchable if the talent isn't related to an ability)
-- Hopefully people don't go skilling zero abilities and only all talents while dead and then complaining that it doesn't work...
function imba_enchantress_untouchable:OnOwnerSpawned()
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_1") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_1") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_1"), "modifier_special_bonus_imba_enchantress_1", {})
end
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_2") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_2") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_2"), "modifier_special_bonus_imba_enchantress_2", {})
end
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_3") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_3") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_3"), "modifier_special_bonus_imba_enchantress_3", {})
end
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_5") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_5") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_5"), "modifier_special_bonus_imba_enchantress_5", {})
end
end
function imba_enchantress_enchant:OnOwnerSpawned()
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_4") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_4") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_4"), "modifier_special_bonus_imba_enchantress_4", {})
end
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_6") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_6") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_6"), "modifier_special_bonus_imba_enchantress_6", {})
end
end
function imba_enchantress_natures_attendants:OnOwnerSpawned()
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_8") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_8") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_8"), "modifier_special_bonus_imba_enchantress_8", {})
end
end
function imba_enchantress_impetus:OnOwnerSpawned()
if self:GetCaster():HasTalent("special_bonus_imba_enchantress_7") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_enchantress_7") then
self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_enchantress_7"), "modifier_special_bonus_imba_enchantress_7", {})
end
end
|
--[[-------------------------------------------------------------------------
Copyright 2017 - 2021 viral32111
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---------------------------------------------------------------------------]]
if ( SERVER ) then return false end
concommand.Add("OpenURLLauncher", function()
local ply = LocalPlayer()
title = "Enter the title of the window"
buttonText = "Please click on a player first"
buttonTextColor = Color( 220, 220, 220 )
local selectMenuFrame = vgui.Create( "DFrame" )
selectMenuFrame:SetPos( ScrW()/2-250, ScrH()/2-150 )
selectMenuFrame:SetSize( 500, 300 )
selectMenuFrame:SetTitle( "OpenURL" )
selectMenuFrame:SetVisible( true )
selectMenuFrame:SetDraggable( false )
selectMenuFrame:SetSizable( false )
selectMenuFrame:SetBackgroundBlur( false )
selectMenuFrame:ShowCloseButton( true )
selectMenuFrame:MakePopup()
function selectMenuFrame:Paint( w, h )
draw.RoundedBox( 2, 0, 0, w, h, Color( 50, 50, 50, 255 ) ) -- Body
draw.RoundedBox( 2, 0, 0, w, 24, Color( 0, 164, 219, 255 ) ) -- Header
draw.RoundedBox( 0, 0, 24, w, 1, Color( 230, 230, 230, 230 ) ) -- Line
end
local selectMenuPlayerLabel = vgui.Create( "DLabel", selectMenuFrame )
selectMenuPlayerLabel:SetPos( 180, 30 )
selectMenuPlayerLabel:SetSize( 300, 30 )
selectMenuPlayerLabel:SetFont( "TargetIDSmall" )
selectMenuPlayerLabel:SetColor( Color( 200, 200, 200 ) )
selectMenuPlayerLabel:SetText( "Please select a player on the left to continue" )
local selectMenuRunButton = vgui.Create( "DButton", selectMenuFrame )
local selectMenuURLBox = vgui.Create( "DTextEntry", selectMenuFrame )
local selectMenuTitleBox = vgui.Create( "DTextEntry", selectMenuFrame )
local selectMenuOpenInOverlayCheckbox = vgui.Create( "DCheckBox", selectMenuFrame )
local selectMenuOpenInYouTubeCheckbox = vgui.Create( "DCheckBox", selectMenuFrame )
local selectMenuOpenInOverlayLabel = vgui.Create( "DLabel", selectMenuFrame )
local selectMenuOpenInYouTubeLabel = vgui.Create( "DLabel", selectMenuFrame )
local selectMenuPlayerList = vgui.Create( "DListView", selectMenuFrame )
selectMenuPlayerList:SetMultiSelect( false )
selectMenuPlayerList:SetPos( 10, 30 )
selectMenuPlayerList:SetSize( 160, 260 )
selectMenuPlayerList:AddColumn( "Player" )
selectMenuPlayerList.OnRowSelected = function( panel, line )
selectedPlayer = panel:GetLine( line ):GetValue( 1 )
selectMenuPlayerLabel:SetText( "Selected: " .. selectedPlayer )
selectMenuPlayerLabel:SetColor( Color( 255, 255, 255 ) )
buttonText = "Open on " .. selectedPlayer
buttonTextColor = Color( 255, 255, 255 )
selectMenuRunButton:SetEnabled( true )
selectMenuURLBox:SetEnabled( true )
selectMenuURLBox:SetText( "Enter the URL you wish to open on the player" )
selectMenuTitleBox:SetEnabled( true )
selectMenuTitleBox:SetText( "Enter an easy to recognize title" )
selectMenuOpenInOverlayCheckbox:SetEnabled( true )
selectMenuOpenInYouTubeCheckbox:SetEnabled( true )
selectMenuOpenInOverlayLabel:SetColor( Color( 255, 255, 255 ) )
selectMenuOpenInYouTubeLabel:SetColor( Color( 255, 255, 255 ) )
end
for k, v in pairs( player.GetAll() ) do
selectMenuPlayerList:AddLine( v:Nick() )
end
selectMenuURLBox:SetPos( 180, 60 )
selectMenuURLBox:SetSize( 310, 25 )
selectMenuURLBox:SetEnabled( false )
selectMenuURLBox:SetText( "Please click on a player first" )
selectMenuTitleBox:SetPos( 180, 95 )
selectMenuTitleBox:SetSize( 310, 25 )
selectMenuTitleBox:SetEnabled( false )
selectMenuTitleBox:SetText( "Please click on a player first" )
function selectMenuTitleBox:OnChange()
title = selectMenuTitleBox:GetValue()
end
selectMenuOpenInOverlayCheckbox:SetPos( 180, 130 )
selectMenuOpenInOverlayCheckbox:SetValue( 0 )
selectMenuOpenInOverlayCheckbox:SetEnabled( false )
function selectMenuOpenInOverlayCheckbox:OnChange( bVal )
if ( bVal ) then
selectMenuTitleBox:SetEnabled( false )
selectMenuTitleBox:SetText( "Cannot have title with steam web browser" )
else
if ( selectedPlayer == nil ) then
selectMenuTitleBox:SetEnabled( false )
selectMenuTitleBox:SetText( "Please click on a player first" )
else
selectMenuTitleBox:SetEnabled( true )
selectMenuTitleBox:SetText( title )
end
end
end
selectMenuOpenInOverlayLabel:SetPos( 200, 123 )
selectMenuOpenInOverlayLabel:SetSize( 300, 30 )
selectMenuOpenInOverlayLabel:SetFont( "TargetIDSmall" )
selectMenuOpenInOverlayLabel:SetColor( Color( 200, 200, 200 ) )
selectMenuOpenInOverlayLabel:SetText( "Open in Steam Web Browser?" )
selectMenuOpenInYouTubeCheckbox:SetPos( 180, 150 )
selectMenuOpenInYouTubeCheckbox:SetValue( 0 )
selectMenuOpenInYouTubeCheckbox:SetEnabled( false )
selectMenuOpenInYouTubeLabel:SetPos( 200, 143 )
selectMenuOpenInYouTubeLabel:SetSize( 300, 30 )
selectMenuOpenInYouTubeLabel:SetFont( "TargetIDSmall" )
selectMenuOpenInYouTubeLabel:SetColor( Color( 200, 200, 200 ) )
selectMenuOpenInYouTubeLabel:SetText( "Open in YouTube?" )
selectMenuRunButton:SetText( "" )
selectMenuRunButton:SetPos( 180, 255 )
selectMenuRunButton:SetSize( 310, 35 )
selectMenuRunButton:SetEnabled( false )
selectMenuRunButton.DoClick = function()
selectMenuFrame:Close()
net.Start("openurlRequest", false)
net.WriteString( selectedPlayer )
net.WriteString( ply:Nick() )
net.WriteString( selectMenuURLBox:GetValue() )
net.WriteString( selectMenuTitleBox:GetValue() )
net.WriteBool( selectMenuOpenInOverlayCheckbox:GetChecked() )
net.WriteBool( selectMenuOpenInYouTubeCheckbox:GetChecked() )
net.SendToServer()
end
function selectMenuRunButton:Paint( w, h )
draw.RoundedBox( 2, 0, 0, w, h, Color( 0, 164, 219, 255 ) )
draw.DrawText( buttonText, "TargetIDSmall", w/2, 10, buttonTextColor, TEXT_ALIGN_CENTER )
end
end ) |
object_tangible_furniture_decorative_wod_pro_ns_tree_05 = object_tangible_furniture_decorative_shared_wod_pro_ns_tree_05:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_decorative_wod_pro_ns_tree_05, "object/tangible/furniture/decorative/wod_pro_ns_tree_05.iff")
|
resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937"
this_is_a_map 'yes'
data_file 'DLC_ITYP_REQUEST' 'stream/lafa2k_modernhouse.ytyp' |
return {
name = "voronianski/file-type",
version = "1.0.5",
description = "Detect the file type of a Buffer in Luvit.io",
tags = { "buffer", "luvit", "file", "file-type", "mime", "extension" },
license = "MIT",
author = { name = "Dmitri Voronianski", email = "[email protected]" },
homepage = "https://github.com/luvitrocks/file-type",
dependencies = {},
files = {
"**.lua",
"!test*"
}
}
|
local subpath = (...):match("(.-)[^%.]+$")
local is_callable = require (subpath.."is").callable
local try = {}
function try.call(t, k, ...)
if not (t and k) then return false end
local fn = t[k] if not is_callable(fn) then return false end
return true, fn(...)
end
function try.invoke(t, k, ...)
if not (t and k) then return false end
local fn = t[k] if not is_callable(fn) then return false end
return true, fn(t, ...)
end
return try
|
Runner = {}
function Runner:child()
self.__index = self
return setmetatable({ base = self }, self)
end
function Runner:new(executor)
self.__index = self
return setmetatable({ executor = executor }, self)
end
function Runner:get_results()
error("get_results is not implemented")
end
function Runner:test_suite()
error('test_suite is not implemented')
end
function Runner:did_run()
error('did_run is not implemented')
end
return Runner
|
local CorePackages = game:GetService("CorePackages")
local Cryo = require(CorePackages.Packages.Cryo)
local Rodux = require(CorePackages.Packages.Rodux)
local AddMessage = require(script.Parent.Parent.Actions.AddMessage)
local RemoveMessage = require(script.Parent.Parent.Actions.RemoveMessage)
local userMessages = Rodux.createReducer({
-- [userId] = { messageId, ... }
}, {
-- Adds the message's ID to the specific user's list of sent messages. This
-- is used with ChatBubbles so that we can efficiently grab the user's last
-- few messages, instead of iterating over the entire list of messages.
[AddMessage.name] = function(state, action)
local messages = state[action.message.userId] or {}
return Cryo.Dictionary.join(state, {
[action.message.userId] = Cryo.List.join(messages, { action.message.id })
})
end,
[RemoveMessage.name] = function(state, action)
local messages = state[action.message.userId]
if messages then
if #messages == 1 and messages[1] == action.message.id then
return Cryo.Dictionary.join(state, {
[action.message.userId] = Cryo.None,
})
else
return Cryo.Dictionary.join(state, {
[action.message.userId] = Cryo.List.filter(messages, function(messageId)
return messageId ~= action.message.id
end)
})
end
else
return state
end
end
})
return userMessages
|
pg = pg or {}
pg.enemy_data_statistics_139 = {
[10070307] = {
cannon = 105,
reload = 150,
speed_growth = 0,
cannon_growth = 1400,
rarity = 4,
air = 0,
torpedo = 100,
dodge = 11,
durability_growth = 65000,
antiaircraft = 280,
luck = 30,
reload_growth = 0,
dodge_growth = 156,
hit_growth = 210,
star = 4,
hit = 25,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 65,
base = 249,
durability = 3150,
armor_growth = 0,
torpedo_growth = 4500,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070307,
antiaircraft_growth = 3800,
antisub = 0,
equipment_list = {
533005,
533006,
533007,
533008
}
},
[10070308] = {
cannon = 150,
reload = 150,
speed_growth = 0,
cannon_growth = 2000,
rarity = 4,
air = 0,
torpedo = 60,
dodge = 11,
durability_growth = 84000,
antiaircraft = 220,
luck = 30,
reload_growth = 0,
dodge_growth = 156,
hit_growth = 210,
star = 4,
hit = 25,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 70,
base = 250,
durability = 3960,
armor_growth = 0,
torpedo_growth = 2400,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070308,
antiaircraft_growth = 2800,
antisub = 0,
equipment_list = {
533009,
533010,
533011,
533012
}
},
[10070309] = {
cannon = 180,
reload = 150,
speed_growth = 0,
cannon_growth = 2000,
rarity = 4,
air = 0,
torpedo = 0,
dodge = 11,
durability_growth = 132000,
antiaircraft = 180,
luck = 30,
reload_growth = 0,
dodge_growth = 156,
hit_growth = 210,
star = 4,
hit = 25,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 75,
base = 251,
durability = 6800,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070309,
antiaircraft_growth = 3400,
antisub = 0,
equipment_list = {
533013,
533014,
533015,
533016,
533017
},
buff_list = {
{
ID = 50510,
LV = 3
}
}
},
[10070310] = {
cannon = 150,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
rarity = 4,
air = 85,
torpedo = 0,
dodge = 11,
durability_growth = 124000,
antiaircraft = 280,
luck = 30,
reload_growth = 0,
dodge_growth = 156,
hit_growth = 210,
star = 4,
hit = 25,
antisub_growth = 0,
air_growth = 4000,
battle_unit_type = 80,
base = 252,
durability = 5400,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070310,
antiaircraft_growth = 4400,
antisub = 0,
equipment_list = {
533018,
533019,
533020,
533021,
533022
}
},
[10070311] = {
cannon = 490,
name = "测试者β型",
type = 5,
speed_growth = 0,
antiaircraft_growth = 0,
air = 460,
rarity = 6,
icon_type = 5,
armor = 0,
antisub = 0,
luck_growth = 0,
battle_unit_type = 95,
dodge_growth = 360,
star = 6,
antisub_growth = 0,
air_growth = 0,
base = 247,
durability = 122000,
armor_growth = 0,
torpedo_growth = 0,
speed = 17,
luck = 0,
id = 10070311,
scale = 120,
cannon_growth = 0,
pilot_ai_template_id = 10001,
reload = 150,
dodge = 32,
reload_growth = 0,
hit = 8,
torpedo = 200,
durability_growth = 0,
antiaircraft = 840,
hit_growth = 144,
bound_bone = {
cannon = {
{
-0.27,
0.64,
0
}
},
vicegun = {
{
3.87,
4.63,
0
}
},
torpedo = {
{
-0.13,
0.12,
0
}
},
antiaircraft = {
{
3.87,
4.63,
0
}
},
plane = {
{
0.94,
4.3,
0
}
}
},
appear_fx = {
"appearQ"
},
equipment_list = {
533023,
533024,
533025,
533026,
533027,
533028
},
buff_list = {
{
ID = 50500,
LV = 3
}
}
},
[10070312] = {
cannon = 120,
battle_unit_type = 55,
rarity = 4,
speed_growth = 0,
pilot_ai_template_id = 20001,
air = 0,
luck = 0,
dodge = 11,
id = 10070312,
cannon_growth = 1650,
speed = 20,
reload_growth = 0,
dodge_growth = 156,
reload = 150,
star = 4,
hit = 14,
antisub_growth = 0,
air_growth = 0,
torpedo = 60,
base = 250,
durability = 5400,
armor_growth = 0,
torpedo_growth = 3650,
luck_growth = 0,
hit_growth = 210,
armor = 0,
durability_growth = 44500,
antiaircraft = 220,
antisub = 0,
antiaircraft_growth = 4500,
scale = 150,
smoke = {
{
50,
{
{
"smoke",
{
-0.64,
2.22,
0
}
}
}
}
},
equipment_list = {
533009,
533010,
533011,
533012
}
},
[10070350] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
pilot_ai_template_id = 20001,
air = 0,
rarity = 1,
dodge = 0,
torpedo = 0,
durability_growth = 6800,
antiaircraft = 0,
reload_growth = 0,
dodge_growth = 0,
speed = 30,
star = 2,
hit = 8,
antisub_growth = 0,
air_growth = 0,
hit_growth = 120,
base = 90,
durability = 750,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
antiaircraft_growth = 0,
luck = 0,
battle_unit_type = 20,
id = 10070350,
antisub = 0,
armor = 0,
appear_fx = {
"appearsmall"
}
},
[10070351] = {
cannon = 0,
battle_unit_type = 35,
rarity = 1,
speed_growth = 0,
pilot_ai_template_id = 20001,
air = 0,
luck = 0,
dodge = 0,
wave_fx = "danchuanlanghuaxiao2",
cannon_growth = 0,
speed = 15,
reload_growth = 0,
dodge_growth = 0,
id = 10070351,
star = 1,
hit = 8,
antisub_growth = 0,
air_growth = 0,
reload = 150,
base = 70,
durability = 280,
armor_growth = 0,
torpedo_growth = 864,
luck_growth = 0,
hit_growth = 120,
armor = 0,
torpedo = 70,
durability_growth = 2550,
antisub = 0,
antiaircraft = 0,
antiaircraft_growth = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
533100
}
},
[10070352] = {
cannon = 60,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
pilot_ai_template_id = 80000,
air = 0,
rarity = 1,
dodge = 0,
torpedo = 120,
durability_growth = 2550,
antiaircraft = 0,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 1200,
star = 2,
hit = 81,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 15,
base = 80,
durability = 80,
armor_growth = 0,
torpedo_growth = 900,
luck_growth = 0,
speed = 30,
luck = 0,
id = 10070352,
antiaircraft_growth = 0,
antisub = 0,
armor = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
533101
}
},
[10070360] = {
cannon = 120,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
rarity = 5,
air = 0,
torpedo = 250,
dodge = 19,
durability_growth = 0,
antiaircraft = 200,
luck = 50,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 5,
hit = 30,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 90,
base = 248,
durability = 34000,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070360,
antiaircraft_growth = 0,
antisub = 0,
equipment_list = {
533301,
533302,
533303,
533304,
533305,
533306
}
},
[10070361] = {
cannon = 140,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
rarity = 5,
air = 0,
torpedo = 280,
dodge = 19,
durability_growth = 0,
antiaircraft = 220,
luck = 50,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 5,
hit = 30,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 90,
base = 248,
durability = 42000,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070361,
antiaircraft_growth = 0,
antisub = 0,
equipment_list = {
533301,
533302,
533303,
533304,
533305,
533306
}
},
[10070362] = {
cannon = 140,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
rarity = 5,
air = 0,
torpedo = 280,
dodge = 19,
durability_growth = 0,
antiaircraft = 220,
luck = 50,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 5,
hit = 30,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 90,
base = 248,
durability = 42000,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
speed = 20,
armor = 0,
id = 10070362,
antiaircraft_growth = 0,
antisub = 0,
equipment_list = {
533301,
533302,
533303,
533304,
533305,
533306
}
},
[10070390] = {
cannon = 180,
battle_unit_type = 95,
rarity = 6,
speed_growth = 0,
pilot_ai_template_id = 70035,
air = 0,
luck = 60,
dodge = 24,
cannon_growth = 0,
speed = 18,
reload = 150,
reload_growth = 0,
dodge_growth = 340,
id = 10070390,
star = 6,
hit = 50,
antisub_growth = 0,
air_growth = 0,
torpedo = 360,
base = 248,
durability = 36800,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 210,
armor = 0,
durability_growth = 0,
antiaircraft = 380,
antisub = 0,
antiaircraft_growth = 0,
scale = 150,
appear_fx = {
"bossguangxiao",
"appearQ"
},
equipment_list = {
533500,
533501,
533502,
533503,
533504
}
},
[10070391] = {
cannon = 180,
battle_unit_type = 95,
rarity = 6,
speed_growth = 0,
pilot_ai_template_id = 70075,
air = 0,
luck = 60,
dodge = 22,
cannon_growth = 0,
speed = 18,
reload = 150,
reload_growth = 0,
dodge_growth = 312,
id = 10070391,
star = 6,
hit = 45,
antisub_growth = 0,
air_growth = 0,
torpedo = 220,
base = 249,
durability = 42000,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 210,
armor = 0,
durability_growth = 0,
antiaircraft = 560,
antisub = 0,
antiaircraft_growth = 0,
scale = 150,
appear_fx = {
"bossguangxiao",
"appearQ"
},
equipment_list = {
533510,
533511,
533512,
533513,
533514,
533515
}
},
[10070392] = {
cannon = 280,
battle_unit_type = 95,
rarity = 6,
speed_growth = 0,
pilot_ai_template_id = 20001,
air = 0,
luck = 60,
dodge = 20,
cannon_growth = 0,
speed = 18,
reload = 150,
reload_growth = 0,
dodge_growth = 284,
id = 10070392,
star = 6,
hit = 40,
antisub_growth = 0,
air_growth = 0,
torpedo = 140,
base = 250,
durability = 56000,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 210,
armor = 0,
durability_growth = 0,
antiaircraft = 380,
antisub = 0,
antiaircraft_growth = 0,
scale = 150,
appear_fx = {
"bossguangxiao",
"appearQ"
},
equipment_list = {
533520,
533524
}
},
[10070393] = {
cannon = 220,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
pilot_ai_template_id = 30002,
air = 0,
rarity = 5,
dodge = 19,
torpedo = 180,
durability_growth = 0,
antiaircraft = 240,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 5,
hit = 50,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 90,
base = 248,
durability = 15000,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
speed = 18,
luck = 60,
id = 10070393,
antiaircraft_growth = 0,
antisub = 0,
armor = 0,
appear_fx = {
"bossguangxiao",
"appearQ"
},
equipment_list = {
533530,
533531
}
}
}
return
|
if not modules then modules = { } end modules ['util-sql-tickets'] = {
version = 1.001,
comment = "companion to lmx-*",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-- TODO: MAKE SOME INTO STORED PROCUDURES
-- This is experimental code and currently part of the base installation simply
-- because it's easier to distribute this way. Eventually it will be documented
-- and the related scripts will show up as well.
local tonumber = tonumber
local format = string.format
local ostime, uuid, osfulltime = os.time, os.uuid, os.fulltime
local random = math.random
local concat = table.concat
local sql = utilities.sql
local tickets = { }
sql.tickets = tickets
local trace_sql = false trackers.register("sql.tickets.trace", function(v) trace_sql = v end)
local report = logs.reporter("sql","tickets")
local serialize = sql.serialize
local deserialize = sql.deserialize
local execute = sql.execute
tickets.newtoken = sql.tokens.new
-- Beware as an index can be a string or a number, we will create
-- a combination of hash and index.
local statustags = { [0] =
"unknown",
"pending",
"busy",
"finished",
"dependent", -- same token but different subtoken (so we only need to find the first)
"reserved-1",
"reserved-2",
"error",
"deleted",
}
local status = table.swapped(statustags)
tickets.status = status
tickets.statustags = statustags
local s_unknown = status.unknown
local s_pending = status.pending
local s_busy = status.busy
----- s_finished = status.finished
local s_dependent = status.dependent
local s_error = status.error
local s_deleted = status.deleted
local s_rubish = s_error -- and higher
local function checkeddb(presets,datatable)
return sql.usedatabase(presets,datatable or presets.datatable or "tickets")
end
tickets.usedb = checkeddb
local template =[[
CREATE TABLE IF NOT EXISTS %basename% (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(50) NOT NULL,
`subtoken` INT(11) NOT NULL,
`created` int(11) NOT NULL,
`accessed` int(11) NOT NULL,
`category` int(11) NOT NULL,
`status` int(11) NOT NULL,
`usertoken` varchar(50) NOT NULL,
`data` longtext NOT NULL,
`comment` longtext NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_unique_index` (`id` ASC),
KEY `token_unique_key` (`token`)
)
DEFAULT CHARSET = utf8 ;
]]
function tickets.createdb(presets,datatable)
local db = checkeddb(presets,datatable)
local data, keys = db.execute {
template = template,
variables = {
basename = db.basename,
},
}
report("datatable %a created in %a",db.name,db.base)
return db
end
local template =[[
DROP TABLE IF EXISTS %basename% ;
]]
function tickets.deletedb(presets,datatable)
local db = checkeddb(presets,datatable)
local data, keys = db.execute {
template = template,
variables = {
basename = db.basename,
},
}
report("datatable %a removed in %a",db.name,db.base)
end
local template_push =[[
INSERT INTO %basename% (
`token`,
`subtoken`,
`created`,
`accessed`,
`status`,
`category`,
`usertoken`,
`data`,
`comment`
) VALUES (
'%token%',
%subtoken%,
%time%,
%time%,
%status%,
%category%,
'%usertoken%',
'%[data]%',
'%[comment]%'
) ;
]]
local template_fetch =[[
SELECT
*
FROM
%basename%
WHERE
`token` = '%token%'
AND
`subtoken` = '%subtoken%'
;
]]
function tickets.create(db,ticket)
-- We assume a unique token .. if not we're toast anyway. We used to lock and
-- get the last id etc etc but there is no real need for that.
-- we could check for dependent here but we don't want the lookup
local token = ticket.token or tickets.newtoken()
local time = ostime()
local status = ticket.status
local category = ticket.category or 0
local subtoken = ticket.subtoken or 0
local usertoken = ticket.usertoken or ""
local comment = ticket.comment or ""
status = not status and subtoken > 1 and s_dependent or s_pending
local result, message = db.execute {
template = template_push,
variables = {
basename = db.basename,
token = token,
subtoken = subtoken,
time = time,
status = status,
category = category,
usertoken = usertoken,
data = db.serialize(ticket.data or { },"return"),
comment = comment,
},
}
-- We could stick to only fetching the id and make the table here
-- but we're not pushing that many tickets so we can as well follow
-- the lazy approach and fetch the whole.
local result, message = db.execute {
template = template_fetch,
variables = {
basename = db.basename,
token = token,
subtoken = subtoken,
},
}
if result and #result > 0 then
if trace_sql then
report("created: %s at %s",token,osfulltime(time))
end
return result[1]
else
report("failed: %s at %s",token,osfulltime(time))
end
end
local template =[[
UPDATE
%basename%
SET
`data` = '%[data]%',
`status` = %status%,
`accessed` = %time%
WHERE
`id` = %id% ;
]]
function tickets.save(db,ticket)
local time = ostime()
local data = db.serialize(ticket.data or { },"return")
local status = ticket.status or s_error
-- print("SETTING")
-- inspect(data)
ticket.status = status
ticket.accessed = time
db.execute {
template = template,
variables = {
basename = db.basename,
id = ticket.id,
time = ostime(),
status = status,
data = data,
},
}
if trace_sql then
report("saved: id %s, time %s",id,osfulltime(time))
end
return ticket
end
local template =[[
UPDATE
%basename%
SET
`accessed` = %time%
WHERE
`token` = '%token%' ;
SELECT
*
FROM
%basename%
WHERE
`id` = %id% ;
]]
function tickets.restore(db,id)
local record, keys = db.execute {
template = template,
variables = {
basename = db.basename,
id = id,
time = ostime(),
},
}
local record = record and record[1]
if record then
if trace_sql then
report("restored: id %s",id)
end
record.data = db.deserialize(record.data or "")
return record
elseif trace_sql then
report("unknown: id %s",id)
end
end
local template =[[
DELETE FROM
%basename%
WHERE
`id` = %id% ;
]]
function tickets.remove(db,id)
db.execute {
template = template,
variables = {
basename = db.basename,
id = id,
},
}
if trace_sql then
report("removed: id %s",id)
end
end
local template_yes =[[
SELECT
*
FROM
%basename%
ORDER BY
`id` ;
]]
local template_nop =[[
SELECT
`created`,
`usertoken`,
`accessed`,
`status`
FROM
%basename%
ORDER BY
`id` ;
]]
function tickets.collect(db,nodata)
local records, keys = db.execute {
template = nodata and template_nop or template_yes,
variables = {
basename = db.basename,
token = token,
},
}
if not nodata then
db.unpackdata(records)
end
if trace_sql then
report("collected: %s tickets",#records)
end
return records, keys
end
-- We aleays keep the last select in the execute so one can have
-- an update afterwards.
local template =[[
DELETE FROM
%basename%
WHERE
`accessed` < %time% OR `status` >= %rubish% ;
]]
local template_cleanup_yes =[[
SELECT
*
FROM
%basename%
WHERE
`accessed` < %time%
ORDER BY
`id` ;
]] .. template
local template_cleanup_nop =[[
SELECT
`accessed`,
`created`,
`accessed`,
`token`
`usertoken`
FROM
%basename%
WHERE
`accessed` < %time%
ORDER BY
`id` ;
]] .. template
function tickets.cleanupdb(db,delta,nodata) -- maybe delta in db
local time = delta and (ostime() - delta) or 0
local records, keys = db.execute {
template = nodata and template_cleanup_nop or template_cleanup_yes,
variables = {
basename = db.basename,
time = time,
rubish = s_rubish,
},
}
if not nodata then
db.unpackdata(records)
end
if trace_sql then
report("cleaned: %s seconds before %s",delta,osfulltime(time))
end
return records, keys
end
-- status related functions
local template =[[
SELECT
`status`
FROM
%basename%
WHERE
`token` = '%token%'
ORDER BY
`id`
;
]]
function tickets.getstatus(db,token)
local record, keys = db.execute {
template = template,
variables = {
basename = db.basename,
token = token,
},
}
local record = record and record[1]
return record and record.status or s_unknown
end
local template =[[
SELECT
`status`
FROM
%basename%
WHERE
`status` >= %rubish% OR `accessed` < %time%
ORDER BY
`id`
;
]]
function tickets.getobsolete(db,delta)
local time = delta and (ostime() - delta) or 0
local records = db.execute {
template = template,
variables = {
basename = db.basename,
time = time,
rubish = s_rubish,
},
}
db.unpackdata(records)
return records
end
local template =[[
SELECT
`id`
FROM
%basename%
WHERE
`status` = %status%
LIMIT
1 ;
]]
function tickets.hasstatus(db,status)
local records = db.execute {
template = template,
variables = {
basename = db.basename,
status = status or s_unknown,
},
}
return records and #records > 0 or false
end
local template =[[
UPDATE
%basename%
SET
`status` = %status%,
`accessed` = %time%
WHERE
`id` = %id% ;
]]
function tickets.setstatus(db,id,status)
db.execute {
template = template,
variables = {
basename = db.basename,
id = id,
time = ostime(),
status = status or s_error,
},
}
end
local template =[[
DELETE FROM
%basename%
WHERE
`status` IN (%status%) ;
]]
function tickets.prunedb(db,status)
if type(status) == "table" then
status = concat(status,",")
end
local data, keys = db.execute {
template = template,
variables = {
basename = db.basename,
status = status or s_unknown,
},
}
if trace_sql then
report("pruned: status %s removed",status)
end
end
-- START TRANSACTION ; ... COMMIT ;
-- LOCK TABLES %basename% WRITE ; ... UNLOCK TABLES ;
local template_a = [[
SET
@last_ticket_token = '' ;
UPDATE
%basename%
SET
`token` = (@last_ticket_token := `token`),
`status` = %newstatus%,
`accessed` = %time%
WHERE
`status` = %status%
ORDER BY
`id`
LIMIT
1
;
SELECT
*
FROM
%basename%
WHERE
`token` = @last_ticket_token
ORDER BY
`id`
;
]]
local template_b = [[
SELECT
*
FROM
tickets
WHERE
`status` = %status%
ORDER BY
`id`
LIMIT
1
;
]]
function tickets.getfirstwithstatus(db,status,newstatus)
local records
if type(newstatus) == "number" then -- todo: also accept string
records = db.execute {
template = template_a,
variables = {
basename = db.basename,
status = status or s_pending,
newstatus = newstatus,
time = ostime(),
},
}
else
records = db.execute {
template = template_b,
variables = {
basename = db.basename,
status = status or s_pending,
},
}
end
if type(records) == "table" and #records > 0 then
for i=1,#records do
local record = records[i]
record.data = db.deserialize(record.data or "")
record.status = newstatus or s_busy
end
return records
end
end
-- The next getter assumes that we have a sheduler running so that there is
-- one process in charge of changing the status.
local template = [[
SET
@last_ticket_token = '' ;
UPDATE
%basename%
SET
`token` = (@last_ticket_token := `token`),
`status` = %newstatus%,
`accessed` = %time%
WHERE
`status` = %status%
ORDER BY
`id`
LIMIT
1
;
SELECT
@last_ticket_token AS `token`
;
]]
function tickets.getfirstinqueue(db,status,newstatus)
local records = db.execute {
template = template,
variables = {
basename = db.basename,
status = status or s_pending,
newstatus = newstatus or s_busy,
time = ostime(),
},
}
local token = type(records) == "table" and #records > 0 and records[1].token
return token ~= "" and token
end
local template =[[
SELECT
*
FROM
%basename%
WHERE
`token` = '%token%'
ORDER BY
`id` ;
]]
function tickets.getticketsbytoken(db,token)
local records, keys = db.execute {
template = template,
variables = {
basename = db.basename,
token = token,
},
}
db.unpackdata(records)
return records
end
local template =[[
SELECT
*
FROM
%basename%
WHERE
`usertoken` = '%usertoken%' AND `status` < %rubish%
ORDER BY
`id` ;
]]
function tickets.getusertickets(db,usertoken)
-- todo: update accessed
-- todo: get less fields
-- maybe only data for status changed (hard to check)
local records, keys = db.execute {
template = template,
variables = {
basename = db.basename,
usertoken = usertoken,
rubish = s_rubish,
},
}
db.unpackdata(records)
return records
end
local template =[[
UPDATE
%basename%
SET
`status` = %deleted%
WHERE
`usertoken` = '%usertoken%' ;
]]
function tickets.removeusertickets(db,usertoken)
db.execute {
template = template,
variables = {
basename = db.basename,
usertoken = usertoken,
deleted = s_deleted,
},
}
if trace_sql then
report("removed: usertoken %s",usertoken)
end
end
|
local source, level = ...
level = level + 2
local f = assert(debug.getinfo(level,"f").func, "can't find function")
local uv = {}
local locals = {}
local uv_id = {}
local local_id = {}
local i = 1
while true do
local name, value = debug.getlocal(level, i)
if name == nil then
break
end
if name:byte() ~= 40 then -- '('
uv[#uv+1] = name
locals[#locals+1] = ("[%d]=%s,"):format(i,name)
local_id[name] = value
end
i = i + 1
end
local i = 1
while true do
local name = debug.getupvalue(f, i)
if name == nil then
break
end
uv_id[name] = i
uv[#uv+1] = name
i = i + 1
end
local full_source
if #uv > 0 then
full_source = ([[
local $ARGS
return function(...)
$SOURCE
end,
function()
return {$LOCALS}
end
]]):gsub("%$(%w+)", {
ARGS = table.concat(uv, ","),
SOURCE = source,
LOCALS = table.concat(locals),
})
else
full_source = ([[
return function(...)
$SOURCE
end,
function()
return {$LOCALS}
end
]]):gsub("%$(%w+)", {
SOURCE = source,
LOCALS = table.concat(locals),
})
end
local func, update = assert(load(full_source, '=(eval)'))()
local i = 1
while true do
local name = debug.getupvalue(func, i)
if name == nil then
break
end
local local_value = local_id[name]
if local_value then
debug.setupvalue(func, i, local_value)
end
local upvalue_id = uv_id[name]
if upvalue_id then
debug.upvaluejoin(func, i, f, upvalue_id)
end
i = i + 1
end
local rets
local vararg, v = debug.getlocal(level, -1)
if vararg then
local vargs = { v }
local i = 2
while true do
vararg, v = debug.getlocal(level, -i)
if vararg then
vargs[i] = v
else
break
end
i=i+1
end
rets = table.pack(func(table.unpack(vargs)))
else
rets = table.pack(func())
end
local needupdate = update()
for k,v in pairs(needupdate) do
debug.setlocal(level,k,v)
end
return table.unpack(rets)
|
--Script Name : jlp_Select next track or next item.lua
--Author : Jean Loup Pecquais
--Description : Select next track or next item
--v1.0.0
local libPath = reaper.GetExtState("Reaper Evolution", "libPath")
if not libPath or libPath == "" then
reaper.MB("Reaper Evolution library is not found. Please refer to user guide", "Library not found", 0)
return
end
loadfile(libPath .. "reaVolutionLib.lua")()
-------------------------------------------------------------------------------------------------------------
local context = reaper.GetCursorContext2( true )
if context == 0 then
reaper.Main_OnCommandEx(40285, 0, 0) -- select next track
elseif context == 1 then
reaper.Main_OnCommandEx(40417, 0, 0) -- select next item
end
|
function parse.percentage(str, dest_type, options)
local str = parse._pre_fold(str)
local dest_type = dest_type or atom.number
local options = table.new(options)
options.precision = options.precision or 0
if options.decimal_shift == true then
options.decimal_shift = options.precision + 2
end
local f = parse.decimal(string.match(str, "^ *([^%%]*) *%%? *$"), dest_type, options)
if dest_type == atom.number then
if f then
return f / 100
end
elseif dest_type == atom.integer then
if f then
f = f / 100
if atom.is_integer(f) then
return f
else
return atom.integer.invalid
end
end
elseif dest_type == atom.fraction then
if f then
return f / 100
end
else
error("Missing or invalid destination type for parsing.")
end
end
|
function deepcopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function length(tbl)
local ret = 0
for n in pairs(tbl) do
ret = ret + 1
end
return ret
end
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
|
require 'Coat'
local CodeGen = require 'CodeGen'
local ipairs = ipairs
local pairs = pairs
singleton 'Smc.Graphviz'
extends 'Smc.Language'
has.id = { '+', default = 'GRAPH' }
has.name = { '+', default = 'Graphviz' }
has.option = { '+', default = '-graph' }
has.suffix = { '+', default = '_sm' }
has.generator = { '+', isa = 'Smc.Graphviz.Generator',
default = function () return require 'Smc.Graphviz.Generator' end }
has.glevelFlag = { '+', default = true }
class 'Smc.Graphviz.Generator'
extends 'Smc.Generator'
has.suffix = { '+', default = 'dot' }
local function escape (s)
s = s:gsub("\\", "\\\\")
s = s:gsub("\"", "\\\"")
s = s:gsub("\n", "\\l")
s = s:gsub(">", "\\>")
s = s:gsub("<", "\\<")
s = s:gsub("\\|", "\\\\|")
return s
end
local function normalize (s)
s = s:gsub("%s+", " ")
return s
end
function override:generate(fsm, stream)
local function maps4dot ()
local maps = {}
for _, map in ipairs(fsm.maps) do
local defaultState = map.defaultState
local mapName = map.name
local function states ()
local t = {}
for _, state in ipairs(map.states) do
local entryActions = state.entryActions or (defaultState and defaultState.entryActions)
local exitActions = state.exitActions or (defaultState and defaultState.exitActions)
local hasEntryExit = (entryActions ~= nil) or (exitActions ~= nil)
local internalEvents = {}
for _, trans in ipairs(state.transitions) do
for _, guard in ipairs(trans.guards) do
if guard.isInternalEvent then
table.insert(internalEvents, { guard = guard })
end
end
end
if defaultState then
for _, trans in ipairs(defaultState.transitions) do
local transName = trans.name
if state:callDefault(transName) then
for _, guard in ipairs(trans.guards) do
if not state:findGuard(transName, guard.condition) then
if guard.isInternalEvent then
table.insert(internalEvents, { guard = guard })
end
end
end
end
end
end
if #internalEvents == 0 then
internalEvents = nil
end
table.insert(t, {
state = state,
hasEntryExit = hasEntryExit,
entryActions = entryActions,
exitActions = exitActions,
internalEvents = internalEvents,
})
end
return t
end -- states
local function guards ()
local t = {}
for _, state in ipairs(map.states) do
local function add_guard (guard)
local orig = mapName .. "::" .. state.name
local dest
local transType = guard.transType
if transType ~= 'TRANS_POP' then
local endStateName = guard.endState
if endStateName == 'nil' then
endStateName = state.name
end
if not endStateName:find "::" then
endStateName = mapName .. "::" .. endStateName
end
dest = endStateName
if transType == 'TRANS_PUSH' then
local pushStateName = guard.pushState
local idx = pushStateName:find "::"
if idx then
dest = dest .. "::" .. pushStateName:sub(1, idx-1)
else
dest = dest .. "::" .. mapName
end
end
else
local pop = guard.endState
local popArgs = guard.popArgs
if self.graphLevel == 2 and popArgs ~= '' then
pop = pop .. ", " .. escape(normalize(popArgs))
end
dest = mapName .. "::pop(" .. pop .. ")"
end
table.insert(t, { guard = guard, orig = orig, dest = dest })
end -- add_guard
for _, trans in ipairs(state.transitions) do
for _, guard in ipairs(trans.guards) do
if not guard.isInternalEvent then
add_guard(guard)
end
end
end
if defaultState then
for _, trans in ipairs(defaultState.transitions) do
local transName = trans.name
if state:callDefault(transName) then
for _, guard in ipairs(trans.guards) do
if not state:findGuard(transName, guard.condition) then
if not guard.isInternalEvent then
add_guard(guard)
end
end
end
end
end
end
end
return t
end -- guards
local function hasStart ()
local startStateName = fsm.startState
local startMapName = startStateName:sub(1, startStateName:find(':') - 1)
return startMapName == mapName
end -- hasStart
local function pushEntry ()
local pushEntryMap = {}
for _, map2 in ipairs(fsm.maps) do
for _, state in ipairs(map2.allStates) do
for _, trans in ipairs(state.transitions) do
for _, guard in ipairs(trans.guards) do
if guard.transType == 'TRANS_PUSH' then
local pushStateName = guard.pushState
if pushStateName:find(mapName) == 1 then
pushEntryMap[pushStateName] = true
end
end
end
end
end
end
local t = {}
for k in pairs(pushEntryMap) do
local orig = "push(" .. k .. ")"
table.insert(t, { orig = orig, dest = k })
end
return t
end -- pushEntry
local popTransMap = {}
local function putPopTrans (guard)
local endStateName = guard.endState
local popKey = endStateName
local popArgs = guard.popArgs
if self.graphLevel == 2 and popArgs ~= '' then
popKey = popKey .. ", " .. escape(normalize(popArgs))
end
popTransMap[popKey] = true
end -- putPopTrans
local function popTrans ()
local t = {}
for k in pairs(popTransMap) do
table.insert(t, { pop = k })
end
return t
end -- popTrans
local pushStateMap = {}
local function putPushState (guard, state)
local endStateName = guard.endState
if endStateName == 'nil' then
endStateName = state.name
end
pushStateMap[mapName .. "::" .. endStateName .. "::" .. guard.pushMapName] = guard
end -- putPushState
local function pushState ()
local t = {}
for k, v in pairs(pushStateMap) do
local r = k:reverse()
local s = r:sub(2 + r:find "::"):reverse()
table.insert(t, { guard = v, orig = k, dest = s })
end
return t
end -- pushState
local defaultState = map.defaultState
local needEnd = false
for _, state in ipairs(map.states) do
for _, trans in ipairs(state.transitions) do
for _, guard in ipairs(trans.guards) do
local transType = guard.transType
if transType == 'TRANS_PUSH' then
putPushState(guard, state)
elseif transType == 'TRANS_POP' then
putPopTrans(guard)
needEnd = true;
end
end
end
if defaultState then
for _, trans in ipairs(defaultState.transitions) do
local transName = trans.name
if state:callDefault(transName) then
for _, guard in ipairs(trans.guards) do
if not state:findGuard(transName, guard.condition) then
local transType = guard.transType
if transType == 'TRANS_PUSH' then
putPushState(guard, state)
elseif transType == 'TRANS_POP' then
putPopTrans(guard)
needEnd = true;
end
end
end
end
end
end
end
table.insert(maps, {
map = map,
states = states(),
guards = guards(),
hasStart = hasStart(),
pushEntry = pushEntry(),
popTrans = popTrans(),
pushState = pushState(),
needEnd = needEnd,
})
end
return maps
end -- maps4dot
local tmpl = self.template
tmpl.fsm = fsm
tmpl.generator = self
tmpl.maps = maps4dot()
local output, msg = tmpl 'TOP'
stream:write(output)
if msg then error(msg) end
end
function method:_build_template ()
return CodeGen{
TOP = [[
// ex: set ro:
// DO NOT EDIT.
// generated by smc (http://github.com/fperrad/lua-Smc)
// from file : ${fsm.filename}
digraph ${fsm.name} {
node
[shape=Mrecord width=1.5];
${maps/_map()}
}
// Local variables:
// buffer-read-only: t
// End:
]],
_map = [[
subgraph cluster_${map.name} {
label=${map.name};
//
// States (Nodes)
//
${states/_node_state()}
${popTrans/_node_pop()}
${needEnd?_node_end()}
${pushState/_node_push_state()}
${hasStart?_node_start()}
${pushEntry/_node_push_entry()}
//
// Transitions (Edges)
//
${guards/_edge_guard()}
${popTrans/_edge_pop()}
${pushState/_edge_push_state()}
${hasStart?_edge_start()}
${pushEntry/_edge_push_entry()}
}
]],
_node_state = [[
"${map.name}::${state.name}"
[label="{${state.name}${generator.graphLevel1?_node_state1()}}"];
]],
_node_state1 = "${hasEntryExit?_node_sep()}${entryActions?_node_entry()}${exitActions?_node_exit()}${internalEvents?_node_internal_events()}",
_node_sep = "|",
_node_entry = "Entry/\\l${entryActions/_indent_action()}",
_indent_action = " ${_action()}",
_node_exit = "Exit/\\l${exitActions/_indent_action()}",
_node_internal_events = "|${internalEvents/_internal_guard()}",
_internal_guard = "${guard.transition.name}${generator.graphLevel2?_guard_params()}${generator.graphLevel1?_guard_cond()}/\\l${guard.actions/_indent_action()}${guard.doesPush?_indent_guard_push_action()}",
_indent_guard_push_action = " ${_guard_push_action()}",
_node_pop = [[
"${map.name}::pop(${pop})"
[label="" width=1];
]],
_node_end = [[
"${map.name}::%end"
[label="" shape=doublecircle style=filled fillcolor=black width=0.15];
]],
_node_push_state = [[
"${orig}"
[label="{${guard.pushMapName}|O-O\r}"];
]],
_node_start = [[
"%start"
[label="" shape=circle style=filled fillcolor=black width=0.25];
]],
_node_push_entry = [[
"${orig}"
[label="" shape=plaintext];
]],
_edge_guard = [[
"${orig}" -> "${dest}"
[label="${guard.transition.name}${generator.graphLevel2?_guard_params()}${generator.graphLevel1?_guard_cond()}/\l${guard.actions/_action()}${guard.doesPush?_guard_push_action()}"];
]],
_guard_params = "(${guard.transition.parameters/_parameter(); separator=', '})",
_guard_cond = "${guard.hasCondition?_guard_cond_if()}",
_guard_cond_if = "\\l\\[${guard.condition; format=escape}\\]",
escape = escape,
_guard_push_action = "push(${guard.pushState})\\l",
_edge_pop = [[
"${map.name}::pop(${pop})" -> "${map.name}::%end"
[label="pop(${pop});\l"];
]],
_edge_push_state = [[
"${orig}" -> "${dest}"
[label="pop/"]
]],
_edge_start = [[
"%start" -> "${fsm.startState}"
]],
_edge_push_entry = [[
"${orig}" -> "${dest}"
[arrowtail=odot];
]],
_action = "${generator.graphLevel1?_action1()}",
_action1 = "${name}${generator.graphLevel2?_action2()};\\l",
_action2 = "${propertyFlag?_action_prop()!_action_no_prop()}",
_action_prop = " = ${arguments; format=escape}",
_action_no_prop = "(${arguments; separator=', '; format=escape})",
_parameter = "${name}${_type?_parameter_type()}",
_parameter_type = ": ${_type}",
}
end
|
return {'saks','saksen','saksisch','saksische','sak','sake','saki','sakkeren','sakkerloot','sakkers','sakser','sake','sakkers','sak','sakko','sakken','sakker','sakkerde','sakkerden','sakkerse','sakkert','sakes'} |
local t = {
version = '2.0.0',
scope = 'workers',
desc = 'n4c framework core status report'
}
local mix = require('lib.Utils').mix
local encode = require('cjson').encode
local decode = require('cjson').decode
local route_uri = '/'..n4c.configuration.default_channel_name..'/api' -- /N4C/api
local counter = {
active = 0, -- non internal active only
internal = 0, -- internal active
-- total = nil, -- by calculation, total request with subrequest
-- request = nil, -- from n4c, total request(with internal), but without subrequest
-- subrequest = nil, -- from n4c, total subrequest
-- cast = nil, -- from n4c, only cast subrequest by ngx_cc
}
setmetatable(counter, { __index = n4c.stat() })
function t.doInternalRequestBegin()
counter.internal = counter.internal + 1
end
function t.doInternalResponseEnd()
counter.internal = counter.internal - 1
end
function t.doRequestBegin(uri, method, arg)
counter.active = counter.active + 1
if (uri == route_uri) and arg.coStatus then
local no_redirected, r_status, r_resps = route.isInvokeAtPer()
if not no_redirected then -- mix all
local resultObject = {}
if r_status then
for _, resp in ipairs(r_resps) do
mix(resultObject, resp and resp.body and decode(resp.body) or nil)
end
end
ngx.say(encode(resultObject))
else -- say status
local c3 = counter
ngx.say(encode({
ngx_4c = { total=c3.request+c3.subrequest, active=c3.active, internal=c3.internal, subrequest=c3.subrequest, cast=c3.cast },
}))
end
ngx.exit(ngx.HTTP_OK)
end
end
function t.doResponseEnd()
counter.active = counter.active - 1
end
return t |
local match_hall_pin_map = require("qnFiles/qnPlist/hall/match_hall_pin");
local match_hall_vertical_view=
{
name="match_hall_vertical_view",type=0,typeName="View",time=0,x=0,y=0,width=1280,height=720,visible=1,nodeAlign=kAlignTopLeft,fillParentWidth=1,fillParentHeight=1,
{
name="contentView",type=0,typeName="View",time=113673565,x=0,y=0,width=1280,height=720,nodeAlign=kAlignTopLeft,visible=1,fillParentWidth=0,fillParentHeight=0,
{
name="leftView",type=0,typeName="View",time=98384370,x=0,y=0,width=600,height=590,nodeAlign=kAlignTopLeft,visible=1,fillParentWidth=0,fillParentHeight=0,fillTopLeftX=40,fillTopLeftY=110,fillBottomRightY=20,fillBottomRightX=640,
{
name="focalMatchView",type=0,typeName="View",time=98385172,x=0,y=-70,width=600,height=453,nodeAlign=kAlignCenter,visible=1,fillParentWidth=1,fillParentHeight=0,
{
name="focalMatchListView",type=0,typeName="View",time=98385521,x=0,y=0,width=600,height=453,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=1,
{
name="txtNoMatchFocal",type=4,typeName="Text",time=101131687,report=0,x=0,y=0,width=600,height=50,visible=0,fillParentWidth=1,fillParentHeight=0,nodeAlign=kAlignCenter,fontSize=30,textAlign=kAlignCenter,colorRed=118,colorGreen=72,colorBlue=18,string=[[暂无该类型比赛]]
},
{
name="focalMatchListView",type=0,typeName="View",time=99083438,x=0,y=0,width=730,height=540,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0
}
}
}
},
{
name="rightView",type=0,typeName="View",time=98384380,x=0,y=0,width=600,height=720,nodeAlign=kAlignBottomRight,visible=1,fillParentWidth=0,fillParentHeight=0,fillBottomRightX=40,fillBottomRightY=0,fillTopLeftX=640,fillTopLeftY=0,
{
name="matchContentView",type=0,typeName="View",time=98536335,x=0,y=55,width=600,height=476,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fillBottomRightY=134,fillBottomRightX=0,fillTopLeftY=110,fillTopLeftX=0,
{
name="txtNoMatch",type=4,typeName="Text",time=71825648,report=0,x=0,y=0,width=600,height=50,visible=0,fillParentWidth=1,fillParentHeight=0,nodeAlign=kAlignCenter,fontSize=30,textAlign=kAlignCenter,colorRed=118,colorGreen=72,colorBlue=18,string=[[暂无该类型比赛]]
}
}
}
},
{
name="bg",type=0,typeName="Image",time=113997930,x=0,y=0,width=1280,height=720,nodeAlign=kAlignCenter,visible=1,fillParentWidth=1,fillParentHeight=1,file="hall/matchHall/shield_bg.png"
},
{
name="bottomView",type=0,typeName="View",time=113672603,x=0,y=0,width=650,height=720,nodeAlign=kAlignTop,visible=1,fillParentWidth=0,fillParentHeight=0,
{
name="tagsView",type=0,typeName="View",time=113672606,x=0,y=0,width=593,height=94,nodeAlign=kAlignTop,visible=1,fillParentWidth=0,fillParentHeight=0,
{
name="bg",type=0,typeName="Image",time=113672607,x=0,y=0,width=744,height=65,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['top_bg.png'],gridLeft=20,gridRight=20,gridTop=20,gridBottom=20,
{
name="matchTypeBtn",type=0,typeName="Button",time=113672608,x=0,y=0,width=186,height=94,nodeAlign=kAlignRight,visible=1,fillParentWidth=0,fillParentHeight=0,file="isolater/bg_blank.png",
{
name="imgSel",type=0,typeName="Image",time=113672609,x=0,y=0,width=192,height=59,nodeAlign=kAlignCenter,visible=0,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['top_select.png'],gridLeft=40,gridRight=40,gridTop=25,gridBottom=25
},
{
name="text",type=0,typeName="Text",time=113672610,x=0,y=0,width=112,height=40,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=28,textAlign=kAlignCenter,colorRed=255,colorGreen=255,colorBlue=255,
{
name="imgSignupNum",type=1,typeName="Image",time=113672611,report=0,x=-15,y=-15,width=31,height=31,visible=0,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignRight,file=match_hall_pin_map['redDot.png'],
{
name="txtSignupNum",type=4,typeName="Text",time=113672612,report=0,x=0,y=0,width=31,height=31,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignTopLeft,fontSize=25,textAlign=kAlignCenter,colorRed=254,colorGreen=239,colorBlue=167,string=[[5]]
}
}
},
{
name="img",type=0,typeName="Image",time=113672613,x=12,y=0,width=22,height=17,nodeAlign=kAlignRight,visible=0,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['tags_up.png']
}
},
{
name="tagBtn_3",type=0,typeName="Button",time=113672614,x=163,y=0,width=186,height=65,nodeAlign=kAlignRight,visible=1,fillParentWidth=0,fillParentHeight=1,file="isolater/bg_blank.png",
{
name="imgSel",type=0,typeName="Image",time=113672615,x=0,y=0,width=192,height=59,nodeAlign=kAlignCenter,visible=0,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['top_select.png']
},
{
name="text",type=0,typeName="Text",time=113672616,x=0,y=0,width=40,height=40,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=28,textAlign=kAlignCenter,colorRed=255,colorGreen=255,colorBlue=255
}
},
{
name="tagBtn_2",type=0,typeName="Button",time=113672617,x=305,y=0,width=186,height=65,nodeAlign=kAlignRight,visible=1,fillParentWidth=0,fillParentHeight=1,file="isolater/bg_blank.png",
{
name="imgSel",type=0,typeName="Image",time=113672618,x=0,y=0,width=192,height=59,nodeAlign=kAlignCenter,visible=0,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['top_select.png']
},
{
name="text",type=0,typeName="Text",time=113672619,x=0,y=0,width=40,height=40,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=28,textAlign=kAlignCenter,colorRed=255,colorGreen=255,colorBlue=255
}
},
{
name="tagBtn_1",type=0,typeName="Button",time=113672620,x=0,y=0,width=186,height=65,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=1,file="isolater/bg_blank.png",
{
name="imgSel",type=0,typeName="Image",time=113672621,x=2,y=0,width=192,height=59,nodeAlign=kAlignCenter,visible=0,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['top_select.png']
},
{
name="text",type=0,typeName="Text",time=113672622,x=0,y=0,width=40,height=40,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=28,textAlign=kAlignCenter,colorRed=255,colorGreen=255,colorBlue=255
}
}
},
{
name="popupBg",type=0,typeName="Image",time=113672623,x=-3,y=79,width=172,height=295,nodeAlign=kAlignBottomRight,visible=0,fillParentWidth=0,fillParentHeight=0,file=match_hall_pin_map['tags_popup_bg.png'],
{
name="shield",type=0,typeName="Image",time=113672624,x=0,y=0,width=2,height=2,nodeAlign=kAlignTopLeft,visible=1,fillParentWidth=0,fillParentHeight=0,file="isolater/bg_blank.png"
},
{
name="listView",type=0,typeName="ListView",time=113672625,x=0,y=15,width=160,height=273,nodeAlign=kAlignBottom,visible=1,fillParentWidth=0,fillParentHeight=0
}
}
}
}
}
return match_hall_vertical_view; |
giant_crystal_snake = Creature:new {
objectName = "@mob/creature_names:giant_crystal_snake",
socialGroup = "snake",
faction = "",
level = 31,
chanceHit = 0.39,
damageMin = 310,
damageMax = 330,
baseXp = 3097,
baseHAM = 8300,
baseHAMmax = 10100,
armor = 0,
resists = {20,20,20,20,20,20,20,20,-1},
meatType = "meat_carnivore",
meatAmount = 7,
hideType = "hide_scaley",
hideAmount = 4,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0.25,
ferocity = 0,
pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY,
creatureBitmask = PACK,
optionsBitmask = AIENABLED,
diet = CARNIVORE,
templates = {"object/mobile/giant_crystal_snake.iff"},
controlDeviceTemplate = "object/intangible/pet/crystal_snake.iff",
scale = 1.4,
lootGroups = {},
weapons = {"creature_spit_small_toxicgreen"},
conversationTemplate = "",
attacks = {
{"posturedownattack",""},
{"strongpoison",""}
}
}
CreatureTemplates:addCreatureTemplate(giant_crystal_snake, "giant_crystal_snake")
|
return PlaceObj("ModDef", {
"title", "Rotate All Buildings",
"id", "ChoGGi_RotateAllBuildings",
"pops_any_uuid", "e22c2a8a-60a1-4736-9c11-b4ecbe14dce0",
"steam_id", "1566471085",
"lua_revision", 1007000, -- Picard
"version", 3,
"version_major", 0,
"version_minor", 3,
"image", "Preview.jpg",
"author", "ChoGGi",
"code", {
"Code/Script.lua",
},
"has_options", true,
"TagGameplay", true,
"TagInterface", true,
"description", [[
Removes rotate limit imposed on certain buildings.
Lets you rotate the Underground Entrance to pick where the elevator entrance goes (objs too close may interfere when rotating).
]],
})
|
local Prop = {}
Prop.Name = "Evocity District Factory"
Prop.Cat = "Warehouse"
Prop.Price = 4100
Prop.Doors = {
Vector( -3221, 13320, 316 ),
Vector( -3221, 13048, 316 ),
Vector( -3221, 14008, 316 ),
Vector( -3221, 14280, 316 ),
Vector( -2108, 13956, 262.28100585938 ),
Vector( -3112, 13436, 262.281006 ),
}
GM.Property:Register( Prop ) |
-------------------------------------------------------------------------------
--
-- tek.class.markup
-- Written by Timm S. Mueller <tmueller at schulze-mueller.de>
-- See copyright notice in COPYRIGHT
--
-- OVERVIEW::
-- [[#ClassOverview]] :
-- [[#tek.class : Class]] / Markup ${subclasses(Markup)}
--
-- This class implements a markup parser and converter for producing
-- feature-rich XHTML 1.0 from plain text with special formattings.
--
-- IMPLEMENTS::
-- - Markup.new()
-- - Markup:run()
--
-------------------------------------------------------------------------------
--
-- FORMAT DESCRIPTION::
--
-- ==== Block ====
--
-- Text of a consistent indentation level running uninterrupted by empty
-- lines is combined into ''blocks''. Lines in blocks can break at any
-- position; the line breaks are not included in the result:
--
-- This is a block.
--
-- This is another
-- block.
--
-- ==== Indentation ====
--
-- The ''indentation depth'' is measured in the consecutive number of
-- ''indentation characters'' (tabs or spaces, which may depend on
-- the application) at the beginning of a line; different indentation
-- levels are taken into account accordingly:
--
-- This is a block.
--
-- This is another
-- block.
--
-- This is a third
-- block.
--
-- ==== Preformatted ====
--
-- For blocks of code and other kinds of ''preformatted text'' use an
-- indentation that is ''two levels deeper'' than the current level,
-- e.g.:
--
-- Normal text
--
-- /* Code markup */
--
-- Back to normal
--
-- ==== Code ====
--
-- Inlined ''code'' is marked up between double braces. It may occur at
-- any position in a line, but it must be the same line in which the
-- opening and the closing of the markup occurs:
--
-- This is {{code_markup}} in running text.
--
-- ==== Lists ====
--
-- There are two types of items in ''lists''; ''soft'' and ''bulleted''
-- items. They are recognized by their initiatory character (dash or
-- asterisk), followed by a whitespace at the beginning of a line:
--
-- - soft item
-- * bulleted item
--
-- Soft items are, by the way, a natural means to enforce line breaks:
--
-- - this is a line,
-- - this is another line,
-- - this is a third line.
--
-- Lists follow the same indentation rules as normal text:
--
-- * one
-- * two
-- * three
-- * eins
-- * zwei
-- - ichi
-- - ni
-- - san
-- * drei
--
-- '''NOTE''': Although not strictly required, it is recommended to
-- indent lists by one level. This will help the parser to avoid
-- ambiguities; otherwise, when a regular block follows an unindented
-- list, it would be concatenated with the last item, as empty lines are
-- not sufficient to break out from a list.
--
-- ==== Links ====
--
-- Links are enclosed in double squared brackets, according to the
-- template {{[[description][link target]]}}, where {{[description]}}
-- is optional, e.g.:
--
-- * [[home]] -
-- Internal link: Link target is description at the same time.
--
-- * [[Home page][home]] -
-- Internal link with alternate description
--
-- * [[http://www.foo.bar/]] -
-- External link
--
-- * [[You know what cool is][http://www.foo.bar/]] -
-- External link with alternate description
--
-- ==== Tables ====
--
-- Lines running uninterrupted with at least one cell separator in each
-- of them automatically form a table. The cell separator is a double
-- vertical bar:
--
-- First cell || Second cell
-- Third cell || Fourth cell
--
-- It is also possible to create empty cells as long as the separators
-- are present. Note, by the way, that cell separators do not
-- necessarily have to be aligned exactly below each other.
--
-- ==== Headings ====
--
-- Headings occupy an entire line. They are enclosed by at least one
-- equal sign and a whitspace on each side; the more equal signs, the
-- less significant the section:
--
-- = Heading 1 =
--
-- == Heading 2 ==
--
-- === Heading 3 ===
--
-- ==== Rules ====
--
-- A minimum of four dashes (or equal signs) is interpreted as a horizontal
-- rule. Rules may occur at arbitrary indentation levels, but otherwise they
-- must occupy the whole line:
--
-- before the rule
-- ----------------------------------------------
-- after the rule
--
-- A rule comprised of equal signs will be of the "page-break" class; it is
-- up to a browser (or downstream parser) to visualize this in a useful way.
--
-- a rule indicating a page break:
-- ==============================================
--
-- ==== Emphasis ====
--
-- An emphasized portion of text may occur at any position in a line,
-- but the opening and the closing of the markup must occur in the same
-- line to be recognized.
--
-- The emphasized text is surrounded by at least two ticks on each side;
-- the more ticks, the stronger the emphasis.
--
-- - normal
-- - ''emphasis''
-- - '''strong emphasis'''
-- - ''''very strong emphasis''''
--
-- ==== Nodes ====
--
-- The possible templates for nodes are
-- - {{==( link target )==}}
-- - {{==( link target : description )==}}
-- ''Nodes'' translate to anchors in a document, and a browser will
-- usually interprete them as jump targets. Visually, nodes translate
-- to headlines also; as usual, the number of equal signs with which
-- the heading is paired determines the significance and therefore
-- size of a headline, e.g.:
--
-- =( Large )=
-- ==( Medium )==
-- ===( Small : Small node with alternate text )===
--
-- In addition to normal node headlines, there is also a variant which
-- is marked up as code, which is indicated by braces instead of
-- parantheses. This is especially useful for jump targets in technical
-- documentation:
--
-- ={ LargeCode : Large code node }=
-- =={ MediumCode : Medium code node }==
-- ==={ SmallCode : Small code node }===
--
-- When referencing a node, use a number sign {{#}} followed by the
-- node name. This, by the way, also works when referencing nodes in
-- other documents.
--
-- '''NOTE''': Don't be too adventurous when selecting a node name;
-- if you need blanks or punctuation or if in doubt use the alternate
-- text notation.
--
local Class = require "tek.class"
local type = type
local insert = table.insert
local remove = table.remove
local concat = table.concat
local min = math.min
local max = math.max
local char = string.char
local stdin = io.stdin
local stdout = io.stdout
local ipairs = ipairs
module("tek.class.markup", tek.class)
_VERSION = "Markup 3.2"
local Markup = _M
Class:newClass(Markup)
-------------------------------------------------------------------------------
-- iterate over lines in a string
-------------------------------------------------------------------------------
local function rd_string(s)
local pos = 1
return function()
if pos then
local a, e = s:find("[\r]?\n", pos)
local o = pos
if not a then
pos = nil
return s:sub(o)
else
pos = e + 1
return s:sub(o, a - 1)
end
end
end
end
-------------------------------------------------------------------------------
-- utf8values: iterator over UTF-8 encoded Unicode chracter codes
-------------------------------------------------------------------------------
local function utf8values(s)
local readc
local i = 0
if type(s) == "string" then
readc = function()
i = i + 1
return s:byte(i)
end
else
readc = function()
local c = s:read(1)
return c and c:byte(1)
end
end
local accu = 0
local numa = 0
local min, buf
return function()
local c
while true do
if buf then
c = buf
buf = nil
else
c = readc()
end
if not c then
return
end
if c == 254 or c == 255 then
break
end
if c < 128 then
if numa > 0 then
buf = c
break
end
return c
elseif c < 192 then
if numa == 0 then break end
accu = accu * 64 + c - 128
numa = numa - 1
if numa == 0 then
if accu == 0 or accu < min or
(accu >= 55296 and accu <= 57343) then
break
end
c = accu
accu = 0
return c
end
else
if numa > 0 then
buf = c
break
end
if c < 224 then
min = 128
accu = c - 192
numa = 1
elseif c < 240 then
min = 2048
accu = c - 224
numa = 2
elseif c < 248 then
min = 65536
accu = c - 240
numa = 3
elseif c < 252 then
min = 2097152
accu = c - 248
numa = 4
else
min = 67108864
accu = c - 252
numa = 5
end
end
end
accu = 0
numa = 0
return 65533 -- bad character
end
end
-------------------------------------------------------------------------------
-- encodeform: encode for forms (display '<', '>', '&', '"' literally)
-------------------------------------------------------------------------------
function Markup:encodeform(s)
local tab = { }
if s then
for c in utf8values(s) do
if c == 34 then
insert(tab, """)
elseif c == 38 then
insert(tab, "&")
elseif c == 60 then
insert(tab, "<")
elseif c == 62 then
insert(tab, ">")
elseif c == 91 or c == 93 or c > 126 then
insert(tab, ("&#%03d;"):format(c))
else
insert(tab, char(c))
end
end
end
return concat(tab)
end
-------------------------------------------------------------------------------
-- encodeurl: encode string to url; optionally specify a string with a
-- set of characters that should be left unmodified, from: $&+,/:;=?@
-------------------------------------------------------------------------------
local function encodefunc(c)
return ("%%%02x"):format(c:byte())
end
function Markup:encodeurl(s, excl)
-- reserved chars with special meaning:
local matchset = "$&+,/:;=?@"
if excl == true then
matchset = ""
elseif excl and type(excl) == "string" then
matchset = matchset:gsub("[" .. excl:gsub(".", "%%%1") .. "]", "")
end
-- unsafe chars are always substituted:
matchset = matchset .. '"<>#%{}|\\^~[]`]'
matchset = "[%z\001-\032\127-\255" .. matchset:gsub(".", "%%%1") .. "]"
return s:gsub(matchset, encodefunc)
end
-------------------------------------------------------------------------------
-- get a SGML/XML tag
-------------------------------------------------------------------------------
function Markup:getTagML(id, tag, open)
if tag then
local tab = { tag }
if id == "link" or id == "emphasis" or id == "code" then
if not self.brpend and not self.inline then
insert(tab, 1, ("\t"):rep(self.depth))
end
self.inline = true
self.brpend = false
else
if id == "image" then
if not self.inline then
insert(tab, 1, ("\t"):rep(self.depth))
end
self.brpend = true
else
if id == "pre" or id == "preline" then
self.brpend = false
elseif open or id ~= "preline" then
insert(tab, 1, ("\t"):rep(self.depth))
if not open and self.inline then
self.brpend = true
end
end
if self.brpend then
insert(tab, 1, "\n")
end
if id ~= "preline" or not open then
insert(tab, "\n")
end
self.inline = false
self.brpend = false
end
end
return concat(tab)
end
end
-------------------------------------------------------------------------------
-- get a SGML/XML line of text
-------------------------------------------------------------------------------
function Markup:getTextML(line, id)
local tab = { }
if self.brpend then
insert(tab, "\n")
insert(tab, ("\t"):rep(self.depth))
else
if id ~= "link" and id ~= "emphasis" and id ~= "code" then
if not self.inline then
insert(tab, ("\t"):rep(self.depth))
end
end
end
line:gsub("^(%s*)(.-)(%s*)$", function(a, b, c)
if a ~= "" then
insert(tab, " ")
end
insert(tab, b)
if c ~= "" then
insert(tab, " ")
end
end)
self.brpend = true
return concat(tab)
end
-------------------------------------------------------------------------------
-- definitions for output as XHTML 1.0 strict
-------------------------------------------------------------------------------
function Markup:out(...)
self.wrfunc(concat { ... })
end
function Markup:init(docname)
self.depth = 1
local metadata = { }
for _, k in ipairs { "author", "created" } do
if self[k] then
insert(metadata, [[
<meta name="]] .. k .. [[" content="]] .. self[k] .. [[" />
]])
end
end
metadata = concat(metadata)
return [[
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>]] .. docname .. [[</title>
<link rel="stylesheet" href="manual.css" />
]] .. metadata .. [[
</head>
<body>
]]
end
function Markup:exit()
return [[
</body>
</html>
]]
end
function Markup:gettag(id, tag, open)
return self:getTagML(id, tag, open)
end
function Markup:gettext(line, id)
return self:encodeform(self:getTextML(line, id))
end
function Markup:getpre(line)
return self:encodeform(line), '\n'
end
function Markup:getcode(line)
return self:encodeform(line)
end
function Markup:head(level, text)
return '<h' .. level .. '>', '</h' .. level .. '>'
end
function Markup:headnode(id, text, len, is_code)
if is_code then
return ('<div class="node"><h%d><a name="%s" id="%s"><code>%s</code></a></h%d>'):format(
len, id, id, text, len), '</div>'
else
return ('<div class="node"><h%d><a name="%s" id="%s">%s</a></h%d>'):format(
len, id, id, text, len), '</div>'
end
end
function Markup:def(name)
self.prebr = false
return '<div class="definition"><dfn>' .. name .. '</dfn>', '</div>'
end
function Markup:indent()
return '<blockquote>', '</blockquote>'
end
function Markup:list()
return '<ul>', '</ul>'
end
function Markup:item(bullet)
if bullet then
return '<li>', '</li>'
end
return '<li style="list-style-type: none">', '</li>'
end
function Markup:block()
return '<p>', '</p>'
end
function Markup:rule()
return '<hr />'
end
function Markup:pagebreak()
return '<hr class="page-break" />'
end
function Markup:pre()
return '<pre>', '</pre>'
end
function Markup:code()
return '<code>', '</code>'
end
function Markup:emphasis(len, text)
if len == 1 then
return '<em>', '</em>'
elseif len == 2 then
return '<strong>', '</strong>'
else
return '<em><strong>', '</strong></em>'
end
end
function Markup:link(link)
--local isurl = link:match("^%a*://.*$")
local func = link:match("^(.*)%(%)$")
if func then
return '<a href="#' .. func .. '"><code>', '</code></a>'
else
local url, anch = link:match("^([^#]*#?)([^#]*)$")
link = url .. anch:gsub("[^a-zA-Z%d%_%-%.%:]", "")
return '<a href="' .. link .. '">', '</a>'
end
end
function Markup:table(border)
return '<table>', '</table>'
end
function Markup:row()
self.column = 0
return '<tr>', '</tr>'
end
function Markup:cell(border)
self.column = self.column + 1
return '<td class="column' .. self.column .. '">', '</td>'
end
function Markup:image(link, extra)
return '<img src="' .. self:encodeurl(link, true) .. '" ' ..
(extra or "") .. ' alt="image" />'
end
function Markup:document()
end
-------------------------------------------------------------------------------
-- run(): This function starts the conversion.
-------------------------------------------------------------------------------
function Markup:run()
local function doid(id, ...)
if self[id] then
return self[id](self, ...)
end
end
local function doout(id, ...)
doid("out", doid(id, ...))
end
local function push(id, ...)
local opentag, closetag = doid(id, ...)
doout("gettag", id, opentag, true)
insert(self.stack, { id = id, closetag = closetag })
self.depth = self.depth + 1
end
local function pop()
local e = remove(self.stack)
if e then
self.depth = self.depth - 1
doout("gettag", e.id, e.closetag)
return e.id
end
end
local function top()
local e = self.stack[#self.stack]
if e then
return e.id
end
end
local function popuntil(...)
local i
repeat
i = pop()
for _, v in ipairs { ... } do
if v == i then
return
end
end
until not i
end
local function popwhilenot(...)
local i
repeat
i = top()
for _, v in ipairs { ... } do
if v == i then
return
end
end
pop()
until not i
end
local function popwhile(...)
local cont
repeat
local id = top()
cont = false
for _, v in ipairs { ... } do
if v == id then
local i = pop()
cont = true
break
end
end
until not cont
end
local function popif(...)
local i = top()
for _, v in ipairs { ... } do
if v == i then
pop()
return
end
end
end
local function checktop(...)
local i = top()
for _, v in ipairs { ... } do
if v == i then
return true
end
end
end
local function pushfragment(...)
local line = concat { ... }
if not self.context.fragments then
self.context.fragments = { }
end
self.id = (self.id or 0) + 1
insert(self.context.fragments, 1, { line = line, id = self.id })
self.context.topid = self.id
end
local function popfragment()
self.context.firstfragment = false
local frag = remove(self.context.fragments, 1)
if frag then
self.line = frag.line
if frag.id == self.context.topid then
self.context.firstfragment = self.context.parentfirstfragment
end
else
self.line = false
end
return self.line
end
local function pushcontext(id, line)
insert(self.cstack, self.context)
if id then
self.context = { id = id, fragments = { } }
pushfragment(line)
insert(self.cstack, self.context)
end
end
local function popcontext()
self.context = remove(self.cstack) or false
return self.context
end
-- parse
self.lnr = 1
self.previndent = 0
self.stack = { }
self.depth = 0
self.in_table = false
self.prebr = false
self.is_dynamic_content = false
doout("init", self.docname)
push("document")
local linematch = ("^(%s*)(.-)%%s*$"):format(self.indentchar)
local feature = { }
self.features:gsub("%a", function(f)
feature[f] = true
end)
for line in self.rdfunc(self.input) do
self.indentlevel = 0
line = line:gsub(linematch, function(s, t)
if t ~= "" then
self.indentlevel = s:len()
else
self.indentlevel = self.previndent
end
return t
end)
if feature["t"] then
self.istabline = line:find("||", 1, 1) or false
if self.istabline then
popif("block")
end
if self.in_table then
popuntil("row")
if not self.istabline then
popuntil("table")
self.in_table = false
end
end
end
if self.indentlevel < self.previndent then
if not self.preindent or self.indentlevel < self.preindent then
local i = self.indentlevel
while i < self.previndent do
i = i + 1
if top() == "pre" then
i = i + 1
end
popuntil("indent", "pre")
end
self.preindent = false
end
elseif self.indentlevel == self.previndent + 1 then
popif("block")
push("indent")
elseif feature["p"] and self.indentlevel >= self.previndent + 2 then
if not self.preindent then
self.preindent = self.previndent + 2
popif("block")
push("pre")
end
end
if not self.preindent then
if feature["d"] then
-- def ( SYNOPSIS )
line = line:gsub("^(%u[%u%d%s_]+)::$", function(name)
popwhile("def", "item", "list", "block", "pre")
push("def", name)
return ""
end)
end
if feature["f"] then
-- function ( INCLUDE(name) )
line = line:gsub("^%s*(INCLUDE_?%a*)%(%s*(.*)%s*%)%s*$",
function(key, line)
if key == "INCLUDE" or key == "INCLUDE_STATIC" then
local args = { }
line:gsub(",?([^,]*)", function(a)
a = a:match("^%s*(%S.-)%s*$")
if a then
insert(args, a)
end
end)
popwhilenot("document")
push("func", key == "INCLUDE", args)
return ""
end
end)
-- argument ( ======== )
line = line:gsub("^%s*========+%s*$", function()
popwhilenot("func")
push("argument")
return ""
end)
end
if feature["n"] then
-- headnode ( ==( id : text )== )
line = line:gsub("^%s*(=+[%(%{])%s+(.+)%s+:%s+(.+)%s+([%)%}]=+)%s*$",
function(s1, id, text, s2)
local l = min(s1:len() - 1, s2:len() - 1, 5)
popwhilenot("document")
id = id:gsub("[^a-zA-Z%d%_%-%.%:]", "")
push("headnode", id, text, l, s2:sub(1, 1) == "}")
return ""
end)
-- headnode ( ==( text )== )
line = line:gsub("^%s*(=+[%(%{])%s+(.*)%s+([%)%}]=+)%s*$",
function(s1, text, s2)
local l = min(s1:len() - 1, s2:len() - 1, 5)
popwhilenot("document")
local id = text:gsub("[^a-zA-Z%d%_%-%.%:]", "")
push("headnode", id, text, l, s2:sub(1, 1) == "}")
return ""
end)
end
if feature["s"] then
-- rule ( ----.. )
line = line:gsub("^%s*(%-%-%-%-+)%s*$", function(s)
popwhile("block", "list", "item")
push("rule")
pop()
return ""
end)
line = line:gsub("^%s*(%=%=%=%=+)%s*$", function(s)
popwhile("block", "list", "item")
push("pagebreak")
pop()
return ""
end)
end
end
--
self.cstack = { }
self.context = { parentfirstfragment = true }
pushfragment(line)
pushcontext()
if line == "" then
popwhile("block")
end
while popcontext() do
while popfragment() do
line = self.line
if self.preindent then
if self.prepend then
push("preline")
doout("getpre", "")
pop()
self.prepend = false
end
if line == "" then
self.prepend = true
else
push("preline")
doout("getpre", (" "):rep(self.indentlevel -
self.preindent) .. line)
pop()
end
else
self.prepend = false
if line ~= "" then
if feature["l"] then
-- list/item ( * ... )
local _, _, b, a = line:find("^([%*%-])%s+(.*)$")
if b and a then
local inlist = checktop("item", "list")
popwhile("item", "block")
if not inlist then
push("list")
end
if b == "*" then
push("item", true)
else
push("item")
end
pushcontext("item", a)
break
end
end
if feature["t"] then
-- table cells
local _, pos, a, b =
line:find("^%s*(.-)%s*||%s*(.*)%s*$")
if pos then
if self.context.id == "table" then
popuntil("cell")
else
self.context.id = "table"
if not self.in_table then
self.in_table = true
push("table")
end
push("row")
end
pushfragment(b)
push("cell")
pushcontext("cell", a)
break
elseif self.context.id == "table" then
popuntil("cell")
push("cell")
pushcontext("cell", line)
break
end
end
if feature["c"] then
-- code
local _, _, a, text, b =
line:find("^(.-){{(.-)}}(.*)%s*$")
if text then
if a == "" then
if not checktop("block", "item", "cell") then
push("block")
end
if self.context.firstfragment then
doout("gettext", "")
end
push("code")
if b == "" then b = " " end
pushfragment(b)
pushcontext("code", text)
else
pushfragment("{{", text, "}}", b)
pushfragment(a)
pushcontext()
end
break
end
end
if feature["e"] then
-- emphasis
local _, _, a, x, text, y, b =
line:find("^(.-)(''+)(.-)(''+)(.*)$")
if text then
if a == "" then
x, y = x:len(), y:len()
local len = min(x, y, 4)
if not checktop("block", "item", "cell") then
push("block")
end
if self.context.firstfragment then
doout("gettext", "")
end
push("emphasis", len - 1)
if b == "" then b = " " end
pushfragment(b)
pushcontext("emphasis", text)
else
pushfragment(x, text, y, b)
pushfragment(a)
pushcontext()
end
break
end
end
if feature["a"] then
-- [[link]], [[title][link]], function(), [[link : title]]
if self.context.id ~= "link"
and self.context.id ~= "code" then
local a, title, link, b
a, link, title, b = -- [[link : title]]
line:match("^(.-)%[%[([^%]]-)%s+:%s+([^%]]-)%]%](.*)%s*$")
if not link then
a, title, link, b = -- [[text][...]]
line:match("^(.-)%[%[([^%]]-)%]%[([^%]]-)%]%](.*)%s*$")
end
if not link then -- [[....]]
a, link, b = line:match("^(.-)%[%[([^%]]-)%]%](.*)%s*$")
if link then
title = link:match("^#?(.*)$")
end
end
if not link then -- class:function()
a, link, b = line:match("^(.-)(%a[%w_:.]-%(%))(.*)%s*$")
end
if not link then -- prot://foo/bar
a, link, b = line:match(
"^(.-)(%a*://[%w_%-%.,:;/%?=~]*)(.*)%s*$")
end
if link then
if a == "" then
if not checktop("block", "item", "cell") then
push("block")
end
if self.context.firstfragment then
doout("gettext", "")
end
push("link", link)
if b == "" then b = " " end
pushfragment(b)
pushcontext("link", title or link)
else
pushfragment("[[", title or link, "][", link, "]]", b)
pushfragment(a)
pushcontext()
end
break
end
end
end
if feature["i"] then
-- imglink (@@...@@), (@<...<@), (@>...>@)
line = line:gsub("@([@<>])(.*)([@<>])@", function(s1, link, s2)
local extra
if s1 == s2 and s1 == "<" then
extra = 'style="float: left"'
elseif s1 == s2 and s1 == ">" then
extra = 'style="float: right"'
end
push("image", link, extra)
pop()
return ""
end)
end
if feature["h"] then
-- head ( = ... = )
line = line:gsub("(=+)%s+(.*)%s+(=+)",
function(s1, text, s2)
local l = min(s1:len(), s2:len(), 5)
popwhile("block", "item", "list")
push("head", l)
return text
end)
end
-- output
if line ~= "" then
if not checktop("item", "block", "cell", "pre",
"head", "emphasis", "link", "code") then
popwhile("item", "list", "pre", "code")
push("block")
end
if top() == "code" then
doout("getcode", line, top())
else
doout("gettext", line, top())
end
end
popif("emphasis", "head", "link", "code")
end
end
end
end
self.previndent = self.indentlevel
self.lnr = self.lnr + 1
end
popuntil()
doout("exit")
return self.is_dynamic_content
end
-------------------------------------------------------------------------------
--
-- parser = Markup:new(args): Creates a new markup parser. {{args}} can be a
-- table of initial arguments that constitute its behavior. Supported fields
-- in {{args}} are:
--
-- {{indentchar}} || Character recognized for indentation, default {{"\t"}}
-- {{input}} || Filehandle or string, default {{io.stdin}}
-- {{rdfunc}} || Line reader, by default reads using {{args.input:lines}}
-- {{wrfunc}} || Writer func, by default {{io.stdout.write}}
-- {{docname}} || Name of document, default {{"Manual"}}
-- {{features}} || Feature codes, default {{"hespcadlint"}}
--
-- The parser supports the following features, which can be combined into
-- a string and passed to the constructor in {{args.features}}:
--
-- Code || Description || rough HTML equivalent
-- {{h}} || Heading || {{<h1>}}, {{<h2>}}, ...
-- {{e}} || Emphasis || {{<strong>}}
-- {{s}} || Separator || {{<hr>}}
-- {{p}} || Preformatted block || {{<pre>}}
-- {{c}} || Code || {{<code>}}
-- {{a}} || Anchor, link || {{<a href="...">}}
-- {{d}} || Definition || {{<dfn>}}
-- {{l}} || List || {{<ul>}}, {{<li>}}
-- {{i}} || Image || {{<img>}}
-- {{n}} || Node header || {{<a name="...">}}
-- {{t}} || Table || {{<table>}}
-- {{f}} || Function || (undocumented, internal use only)
--
-- After creation of the parser, conversion starts by calling Markup:run().
--
-------------------------------------------------------------------------------
function Markup.new(class, self)
self = self or { }
self.indentchar = self.indentchar or "\t"
self.input = self.input or stdin
self.rdfunc = self.rdfunc or
type(self.input) == "string" and rd_string or self.input.lines
self.wrfunc = self.wrfunc or function(s) stdout:write(s) end
self.features = self.features or "hespcadlint"
self.docname = self.docname or "Manual"
self.author = self.author or false
self.created = self.created or false
self.column = false
self.inline = false
self.brpend = false
self.prepend = false
self.line = false
self.id = false
self.cstack = false
self.context = false
self.lnr = false
self.indentlevel = 0
self.istabline = false
self.preindent = false
self.previndent = 0
self.preline = false
self.stack = { }
self.depth = 0
self.in_table = false
self.prebr = false
self.is_dynamic_content = false
return Class.new(class, self)
end
|
local ffi = require "ffi"
--WINUSEPTHREAD = true
local Mutex = require "lj-async.mutex"
local Thread = require "lj-async.thread"
local thread_data_t = ffi.typeof("struct { int x; }")
local function threadMain(m,...)
print("init thread")
return function(threadid)
local ffi = require "ffi"
--WINUSEPTHREAD = true
local Mutex = require "lj-async.mutex"
m = ffi.cast(ffi.typeof("$*",Mutex), m)
threadid = ffi.cast("struct { int x; }*",threadid)
for i=1,20 do
m:lock()
print("Thread ",tostring(threadid.x)," got mutex, i=",i)
m:unlock()
end
end
end
print("Each thread will try to aquire the mutex 20 times.")
local mutex = Mutex()
local threads = {}
for i=1,3 do
threads[i] = Thread(threadMain, thread_data_t(i), mutex)
end
for i=#threads,1,-1 do
local ok, err = threads[i]:join()
if ok then
print("Thread "..i.." ran successfully")
else
print("Thread "..i.." terminated with error: "..tostring(err))
end
threads[i]:free()
threads[i] = nil
end
mutex:destroy()
mutex = nil |
local table = require("hs/lang/table")
local Class = require("hs/lang/Class")
--------------------------------------------------------------------------------
-- TMXMapのObjectGroupです.
--
-- @class table
-- @name TMXObject
--------------------------------------------------------------------------------
local TMXObject = Class()
---------------------------------------
-- コンストラクタです
---------------------------------------
function TMXObject:init()
self.name = ""
self.type = ""
self.x = 0
self.y = 0
self.width = 0
self.height = 0
self.gid = nil
self.properties = {}
end
---------------------------------------
-- DisplayObjectを生成します.
---------------------------------------
function TMXObject:createDisplayObject()
end
---------------------------------------
-- Box2DBodyを生成します.
---------------------------------------
function TMXObject:createBox2DBody()
end
return TMXObject
|
-- old depth picking algorithm. Pick the most foregorund object.
function CalcForFrame(framenum)
local min_depth, max_depth, mean_depth = CalcForFrameRaw();
local res_depth = -min_depth;
print(string.format("debug %3d front %3d back %3d mean %3d res %3d",
framenum, -min_depth, -max_depth, -mean_depth, res_depth));
return res_depth;
end
function CalcForSub(startframenum, lengthinframes, depths)
local value = math.max(table.unpack(depths));
print(string.format("depths: sub started at frame #%d has depth value %d", startframenum, value));
return value;
end
|
local slaxdom = require 'slaxdom' -- https://github.com/Phrogz/SLAXML
local cjson = require "cjson"
local XML = {}
-- 如果没有子元素,才返回。
local function ele_text(ele)
local text = nil
for _,n in ipairs(ele.kids) do
if n.type=='text' then
text = n.value
elseif n.type == "element" then
return nil
end
end
return text
end
local function dom_parse(xml)
return slaxdom:dom(xml)
end
function XML.loads(xml)
local ok, doc = pcall(dom_parse, xml)
if not ok or doc == nil or doc.root == nil then
if doc == nil or doc.root == nil then
doc = "doc.root is nil"
end
ngx.log(ngx.ERR, "parse xml [", tostring(xml) , "] failed! err:", doc)
return nil, "xml-invalid"
end
local root = doc.root
local function parse_element(ele, t)
if not t then
t = {}
end
--ngx.say("--- ele:", ele.name, ", childs: ", #ele.kids)
local value = ele_text(ele)
if value then -- 直接有内容的。
else
for _,child in ipairs(ele.kids) do
if child.type=='element' then
if value == nil then
value = {}
end
parse_element(child, value)
end
end
end
value = value or ""
local old_ele = t[ele.name]
if old_ele then -- 已经有相同的对象了,需要使用数组存储。
--ngx.say("same obj:", ele.name, " type:", type(old_ele) == 'table', " size:", #old_ele >= 1)
if type(old_ele) == 'table' and #old_ele >= 1 then
table.insert(old_ele, value)
else
local arr = {}
table.insert(arr, old_ele)
table.insert(arr, value)
t[ele.name] = arr
end
else
t[ele.name] = value
end
return t
end
return parse_element(root)
end
--[[
local function dump_tab(child_tab, name)
local values = {}
if #child_tab > 0 then -- 数组类型。
for _, value in ipairs(child_tab) do
if type(value) == 'table' then
value = dump_tab(value)
table.insert(values, string.format("<%s>%s</%s>", name, value, name))
else
value = tostring(value)
table.insert(values, string.format("<%s>%s</%s>", name, value, name))
end
end
else
for key, value in pairs(child_tab) do
if type(value) == 'table' then
if #value > 0 then -- 数组类型,需要把key传进去。
value = dump_tab(value, key)
table.insert(values, value)
else
key = tostring(key)
value = dump_tab(value)
table.insert(values, string.format("<%s>%s</%s>", key, value, key))
end
else
key = tostring(key)
value = tostring(value)
table.insert(values, string.format("<%s>%s</%s>", key, value, key))
end
end
end
return table.concat(values)
end
]]
function XML.dumps(tab)
if type(tab) ~= 'table' then
return false, "tab-invalid"
end
local function xtabs(x)
if x == nil or x == 0 then
return ""
end
local t = {}
for i=1,x do
table.insert(t, ' ')
end
return table.concat(t)
end
local function add_value(values, key, value, level, multiline)
if multiline then
table.insert(values, xtabs(level) .. string.format("<%s>", key))
-- 已经缩进过了。
if string.sub(value, 1, 4) == ' ' then
table.insert(values, value)
else
table.insert(values, xtabs(level) .. value)
end
table.insert(values, xtabs(level) .. string.format("</%s>", key))
else
table.insert(values, xtabs(level) .. string.format("<%s>%s</%s>", key, value, key))
end
end
local function dump_tab(child_tab, level)
level = level or 0
local values = {}
for key, value in pairs(child_tab) do
if type(value) == 'table' then
if #value > 0 then -- 数组类型,需要把key传进去。
for _, arr_val in ipairs(value) do
if type(arr_val) == 'table' then
arr_val = dump_tab(arr_val, level + 1)
add_value(values, key, arr_val, level, true)
else
arr_val = tostring(arr_val)
add_value(values, key, arr_val, level)
end
end
else
key = tostring(key)
value = dump_tab(value, level + 1)
add_value(values, key, value, level, true)
end
else
key = tostring(key)
value = tostring(value)
add_value(values, key, value, level)
end
end
return table.concat(values, "\n")
end
return dump_tab(tab)
end
return XML |
LiAutoRepairVersionNum = 5
AddonMsgPrefix = "LiARVersion"
C_ChatInfo.RegisterAddonMessagePrefix(AddonMsgPrefix)
UpdateNotificationDisplayed = false
LiAutoRepair = false
InventorySlots = {
"HeadSlot",
"ShoulderSlot",
"ChestSlot",
"WristSlot",
"HandsSlot",
"WaistSlot",
"LegsSlot",
"FeetSlot",
"MainHandSlot",
"SecondaryHandSlot"
}
function LiARGetDurability()
DCur, DMax = 0, 0
for _, v in pairs(InventorySlots) do
iCur, iMax = GetInventoryItemDurability(GetInventorySlotInfo(v));
iCur, iMax = (iCur or 0), (iMax or 0)
DCur = DCur + iCur
DMax = DMax + iMax
end
return DCur, DMax
end
function SendAddonVerMessages()
C_ChatInfo.SendAddonMessage(AddonMsgPrefix, LiAutoRepairVersionNum, "GUILD")
C_ChatInfo.SendAddonMessage(AddonMsgPrefix, LiAutoRepairVersionNum, "PARTY")
C_ChatInfo.SendAddonMessage(AddonMsgPrefix, LiAutoRepairVersionNum, "RAID")
end
function LiAutoRepairInit()
FrameLiAutoRepair:SetScript("Onevent", LiAutoRepairEvent)
FrameLiAutoRepair:RegisterEvent("MERCHANT_SHOW")
FrameLiAutoRepair:RegisterEvent("CHAT_MSG_ADDON")
FrameLiAutoRepair:RegisterEvent("UPDATE_INVENTORY_DURABILITY")
DEFAULT_CHAT_FRAME:AddMessage("[Li-AutoRepair] Version "..tostring(LiAutoRepairVersionNum).." loaded.")
SendAddonVerMessages()
end
function round(number, decimals)
return (("%%.%df"):format(decimals)):format(number)
end
-- Most of this would not be neccecary if RepairAllItems() returned true/false for success/fail,
-- but instead, we have to rely on a timed cycle and a hook to UPDATE_INVENTORY_DURABILITY.
function LiAR_OnUpdate(self, elapsed)
if (LiAutoRepair == true) then
if (Total_GR >= 0.25) and (Total < 1) then
if ((IsInGuild() == true) and (CanGuildBankRepair() == true) and (RepairUsingGuild == true)) then
if (GRepairAttempted == false) then
RepairAllItems(true)
Total_GR = 0
GRepairAttempted = true
end
else
RepairUsingGuild = false
end
end
if (((Total_PR >= 0.25) and (Total > 2)) or (RepairUsingGuild == false)) then
if (RepairAllCost <= GetMoney()) then
if (PRepairAttempted == false) then
RepairAllItems(false)
Total_PR = 0
PRepairAttempted = true
end
else
RepairUsingPersonal = false
end
end
if ((RepairUsingGuild == false) and (RepairUsingPersonal == false)) then
LiAutoRepair = false
DEFAULT_CHAT_FRAME:AddMessage("[Li-AutoRepair] Could not repair your gear!")
end
Total_GR = Total_GR + elapsed
Total_PR = Total_PR + elapsed
Total = Total + elapsed
end
end
CreateFrame("frame"):SetScript("OnUpdate", LiAR_OnUpdate)
function LiAutoRepairEvent(self, event, prefix, message, chatType, sender)
if ((event == "MERCHANT_SHOW") and (CanMerchantRepair() == true)) then
RepairAllCost, CanRepair = 0, false
RepairAllCost, CanRepair = GetRepairAllCost()
if ((CanRepair == true) and (RepairAllCost > 0)) then
Start_Dur, Start_MaxDur = LiARGetDurability()
if (Start_Dur < Start_MaxDur) then
Total = 0
Total_GR = 0
Total_PR = 0
RepairUsingGuild = true
RepairUsingPersonal = true
GRepairAttempted = false
PRepairAttempted = false
LiAutoRepair = true
end
end
end
if (event == "UPDATE_INVENTORY_DURABILITY") then
End_Dur, End_MaxDur = LiARGetDurability()
if (LiAutoRepair == true) then
if ((End_Dur == End_MaxDur) and (Start_Dur < End_Dur)) then
LiAutoRepair = false
if (((Total < 2) and (RepairUsingGuild == true)) or (RepairUsingPersonal == false)) then
FundType = " [Guild] funds."
elseif (((Total > 2) and (RepairUsingPersonal == true)) or (RepairUsingGuild == false)) then
FundType = " [Personal] funds."
else
FundType = "."
end
DEFAULT_CHAT_FRAME:AddMessage("[Li-AutoRepair] Repaired all equipment from "..round((Start_Dur/Start_MaxDur)*100, 1).."% durability.")
DEFAULT_CHAT_FRAME:AddMessage("[Li-AutoRepair] Costing "..GetCoinTextureString(RepairAllCost)..FundType)
end
end
end
if (event == "CHAT_MSG_ADDON") and (AddonMsgPrefix == prefix) then
if (LiAutoRepairVersionNum < tonumber(message)) and (UpdateNotificationDisplayed == false) then
DEFAULT_CHAT_FRAME:AddMessage("[Li-AutoRepair] A newer version of LiAutoRepair is avalible, you should update!")
UpdateNotificationDisplayed = true
elseif (LiAutoRepairVersionNum > tonumber(message)) then
SendAddonVerMessages()
end
end
end
|
-- Set baud rate to 115200 (for older firware versions, like 0.9.6)
-- uart.setup(0,115200,8,0,1)
-- Run main.lua after 2 seconds
tmr.create():alarm( 2000, tmr.ALARM_SINGLE, function() dofile("main.lua") end ) |
local help_message = [[
This is a module file for the container quay.io/biocontainers/emboss:5.0.0--0, which exposes the
following programs:
- aaindexextract
- abiview
- acdc
- acdpretty
- acdtable
- acdtrace
- acdvalid
- antigenic
- backtranambig
- backtranseq
- banana
- bdftogd
- biosed
- btwisted
- cai
- chaos
- charge
- checktrans
- chips
- cirdna
- codcmp
- codcopy
- coderet
- compseq
- cons
- cpgplot
- cpgreport
- cusp
- cutgextract
- cutseq
- dan
- dbiblast
- dbifasta
- dbiflat
- dbigcg
- dbxfasta
- dbxflat
- dbxgcg
- degapseq
- descseq
- diffseq
- digest
- distmat
- dotmatcher
- dotpath
- dottup
- dreg
- edialign
- einverted
- embossdata
- embossversion
- emma
- emowse
- entret
- epestfind
- eprimer3
- equicktandem
- est2genome
- etandem
- extractalign
- extractfeat
- extractseq
- fclique
- fconsense
- fcontml
- fcontrast
- fdiscboot
- fdnacomp
- fdnadist
- fdnainvar
- fdnaml
- fdnamlk
- fdnamove
- fdnapars
- fdnapenny
- fdollop
- fdolmove
- fdolpenny
- fdrawgram
- fdrawtree
- ffactor
- ffitch
- ffreqboot
- fgendist
- findkm
- fkitsch
- fmix
- fmove
- fneighbor
- fpars
- fpenny
- fproml
- fpromlk
- fprotdist
- fprotpars
- freak
- frestboot
- frestdist
- frestml
- fretree
- fseqboot
- fseqbootall
- ftreedist
- ftreedistpair
- fuzznuc
- fuzzpro
- fuzztran
- garnier
- gd2copypal
- gd2togif
- gd2topng
- gdcmpgif
- gdlib-config
- gdparttopng
- gdtopng
- geecee
- getorf
- giftogd2
- helixturnhelix
- hmoment
- iep
- infoalign
- infoseq
- isochore
- jembossctl
- lindna
- listor
- makenucseq
- makeprotseq
- marscan
- maskfeat
- maskseq
- matcher
- megamerger
- merger
- msbar
- mwcontam
- mwfilter
- needle
- newcpgreport
- newcpgseek
- newseq
- noreturn
- notseq
- nthseq
- octanol
- oddcomp
- palindrome
- pasteseq
- patmatdb
- patmatmotifs
- pepcoil
- pepinfo
- pepnet
- pepstats
- pepwheel
- pepwindow
- pepwindowall
- plotcon
- plotorf
- pngtogd
- pngtogd2
- polydot
- preg
- prettyplot
- prettyseq
- primersearch
- printsextract
- profit
- prophecy
- prophet
- prosextract
- pscan
- psiphi
- rebaseextract
- recoder
- redata
- remap
- restover
- restrict
- revseq
- runJemboss.csh
- seealso
- seqmatchall
- seqret
- seqretsplit
- showalign
- showdb
- showfeat
- showorf
- showseq
- shuffleseq
- sigcleave
- silent
- sirna
- sixpack
- skipseq
- splitter
- stretcher
- stssearch
- supermatcher
- syco
- tcode
- textsearch
- tfextract
- tfm
- tfscan
- tmap
- tranalign
- transeq
- trimest
- trimseq
- twofeat
- union
- vectorstrip
- water
- webpng
- whichdb
- wobble
- wordcount
- wordfinder
- wordmatch
- wossname
- xslt-config
- xsltproc
- yank
This container was pulled from:
https://quay.io/repository/biocontainers/emboss
If you encounter errors in emboss or need help running the
tools it contains, please contact the developer at
http://emboss.bioinformatics.nl/
For errors in the container or module file, please
submit a ticket at
[email protected]
https://portal.tacc.utexas.edu/tacc-consulting
]]
help(help_message,"\n")
whatis("Name: emboss")
whatis("Version: ctr-5.0.0--0")
whatis("Category: ['Sequence analysis', 'Local alignment', 'Sequence alignment analysis', 'Global alignment', 'Sequence alignment']")
whatis("Keywords: ['Molecular biology', 'Sequence analysis', 'Biology']")
whatis("Description: Diverse suite of tools for sequence analysis; many programs analagous to GCG; context-sensitive help for each tool.")
whatis("URL: https://quay.io/repository/biocontainers/emboss")
set_shell_function("aaindexextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg aaindexextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg aaindexextract $*')
set_shell_function("abiview",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg abiview $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg abiview $*')
set_shell_function("acdc",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdc $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdc $*')
set_shell_function("acdpretty",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdpretty $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdpretty $*')
set_shell_function("acdtable",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdtable $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdtable $*')
set_shell_function("acdtrace",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdtrace $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdtrace $*')
set_shell_function("acdvalid",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdvalid $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg acdvalid $*')
set_shell_function("antigenic",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg antigenic $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg antigenic $*')
set_shell_function("backtranambig",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg backtranambig $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg backtranambig $*')
set_shell_function("backtranseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg backtranseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg backtranseq $*')
set_shell_function("banana",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg banana $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg banana $*')
set_shell_function("bdftogd",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg bdftogd $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg bdftogd $*')
set_shell_function("biosed",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg biosed $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg biosed $*')
set_shell_function("btwisted",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg btwisted $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg btwisted $*')
set_shell_function("cai",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cai $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cai $*')
set_shell_function("chaos",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg chaos $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg chaos $*')
set_shell_function("charge",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg charge $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg charge $*')
set_shell_function("checktrans",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg checktrans $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg checktrans $*')
set_shell_function("chips",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg chips $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg chips $*')
set_shell_function("cirdna",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cirdna $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cirdna $*')
set_shell_function("codcmp",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg codcmp $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg codcmp $*')
set_shell_function("codcopy",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg codcopy $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg codcopy $*')
set_shell_function("coderet",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg coderet $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg coderet $*')
set_shell_function("compseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg compseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg compseq $*')
set_shell_function("cons",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cons $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cons $*')
set_shell_function("cpgplot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cpgplot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cpgplot $*')
set_shell_function("cpgreport",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cpgreport $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cpgreport $*')
set_shell_function("cusp",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cusp $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cusp $*')
set_shell_function("cutgextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cutgextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cutgextract $*')
set_shell_function("cutseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cutseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg cutseq $*')
set_shell_function("dan",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dan $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dan $*')
set_shell_function("dbiblast",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbiblast $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbiblast $*')
set_shell_function("dbifasta",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbifasta $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbifasta $*')
set_shell_function("dbiflat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbiflat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbiflat $*')
set_shell_function("dbigcg",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbigcg $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbigcg $*')
set_shell_function("dbxfasta",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbxfasta $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbxfasta $*')
set_shell_function("dbxflat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbxflat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbxflat $*')
set_shell_function("dbxgcg",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbxgcg $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dbxgcg $*')
set_shell_function("degapseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg degapseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg degapseq $*')
set_shell_function("descseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg descseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg descseq $*')
set_shell_function("diffseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg diffseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg diffseq $*')
set_shell_function("digest",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg digest $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg digest $*')
set_shell_function("distmat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg distmat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg distmat $*')
set_shell_function("dotmatcher",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dotmatcher $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dotmatcher $*')
set_shell_function("dotpath",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dotpath $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dotpath $*')
set_shell_function("dottup",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dottup $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dottup $*')
set_shell_function("dreg",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dreg $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg dreg $*')
set_shell_function("edialign",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg edialign $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg edialign $*')
set_shell_function("einverted",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg einverted $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg einverted $*')
set_shell_function("embossdata",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg embossdata $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg embossdata $*')
set_shell_function("embossversion",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg embossversion $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg embossversion $*')
set_shell_function("emma",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg emma $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg emma $*')
set_shell_function("emowse",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg emowse $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg emowse $*')
set_shell_function("entret",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg entret $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg entret $*')
set_shell_function("epestfind",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg epestfind $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg epestfind $*')
set_shell_function("eprimer3",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg eprimer3 $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg eprimer3 $*')
set_shell_function("equicktandem",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg equicktandem $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg equicktandem $*')
set_shell_function("est2genome",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg est2genome $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg est2genome $*')
set_shell_function("etandem",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg etandem $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg etandem $*')
set_shell_function("extractalign",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg extractalign $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg extractalign $*')
set_shell_function("extractfeat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg extractfeat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg extractfeat $*')
set_shell_function("extractseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg extractseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg extractseq $*')
set_shell_function("fclique",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fclique $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fclique $*')
set_shell_function("fconsense",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fconsense $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fconsense $*')
set_shell_function("fcontml",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fcontml $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fcontml $*')
set_shell_function("fcontrast",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fcontrast $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fcontrast $*')
set_shell_function("fdiscboot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdiscboot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdiscboot $*')
set_shell_function("fdnacomp",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnacomp $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnacomp $*')
set_shell_function("fdnadist",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnadist $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnadist $*')
set_shell_function("fdnainvar",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnainvar $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnainvar $*')
set_shell_function("fdnaml",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnaml $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnaml $*')
set_shell_function("fdnamlk",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnamlk $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnamlk $*')
set_shell_function("fdnamove",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnamove $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnamove $*')
set_shell_function("fdnapars",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnapars $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnapars $*')
set_shell_function("fdnapenny",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnapenny $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdnapenny $*')
set_shell_function("fdollop",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdollop $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdollop $*')
set_shell_function("fdolmove",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdolmove $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdolmove $*')
set_shell_function("fdolpenny",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdolpenny $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdolpenny $*')
set_shell_function("fdrawgram",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdrawgram $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdrawgram $*')
set_shell_function("fdrawtree",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdrawtree $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fdrawtree $*')
set_shell_function("ffactor",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ffactor $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ffactor $*')
set_shell_function("ffitch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ffitch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ffitch $*')
set_shell_function("ffreqboot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ffreqboot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ffreqboot $*')
set_shell_function("fgendist",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fgendist $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fgendist $*')
set_shell_function("findkm",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg findkm $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg findkm $*')
set_shell_function("fkitsch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fkitsch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fkitsch $*')
set_shell_function("fmix",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fmix $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fmix $*')
set_shell_function("fmove",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fmove $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fmove $*')
set_shell_function("fneighbor",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fneighbor $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fneighbor $*')
set_shell_function("fpars",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fpars $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fpars $*')
set_shell_function("fpenny",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fpenny $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fpenny $*')
set_shell_function("fproml",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fproml $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fproml $*')
set_shell_function("fpromlk",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fpromlk $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fpromlk $*')
set_shell_function("fprotdist",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fprotdist $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fprotdist $*')
set_shell_function("fprotpars",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fprotpars $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fprotpars $*')
set_shell_function("freak",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg freak $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg freak $*')
set_shell_function("frestboot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg frestboot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg frestboot $*')
set_shell_function("frestdist",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg frestdist $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg frestdist $*')
set_shell_function("frestml",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg frestml $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg frestml $*')
set_shell_function("fretree",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fretree $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fretree $*')
set_shell_function("fseqboot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fseqboot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fseqboot $*')
set_shell_function("fseqbootall",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fseqbootall $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fseqbootall $*')
set_shell_function("ftreedist",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ftreedist $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ftreedist $*')
set_shell_function("ftreedistpair",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ftreedistpair $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg ftreedistpair $*')
set_shell_function("fuzznuc",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fuzznuc $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fuzznuc $*')
set_shell_function("fuzzpro",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fuzzpro $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fuzzpro $*')
set_shell_function("fuzztran",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fuzztran $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg fuzztran $*')
set_shell_function("garnier",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg garnier $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg garnier $*')
set_shell_function("gd2copypal",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gd2copypal $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gd2copypal $*')
set_shell_function("gd2togif",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gd2togif $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gd2togif $*')
set_shell_function("gd2topng",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gd2topng $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gd2topng $*')
set_shell_function("gdcmpgif",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdcmpgif $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdcmpgif $*')
set_shell_function("gdlib-config",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdlib-config $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdlib-config $*')
set_shell_function("gdparttopng",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdparttopng $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdparttopng $*')
set_shell_function("gdtopng",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdtopng $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg gdtopng $*')
set_shell_function("geecee",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg geecee $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg geecee $*')
set_shell_function("getorf",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg getorf $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg getorf $*')
set_shell_function("giftogd2",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg giftogd2 $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg giftogd2 $*')
set_shell_function("helixturnhelix",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg helixturnhelix $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg helixturnhelix $*')
set_shell_function("hmoment",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg hmoment $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg hmoment $*')
set_shell_function("iep",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg iep $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg iep $*')
set_shell_function("infoalign",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg infoalign $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg infoalign $*')
set_shell_function("infoseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg infoseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg infoseq $*')
set_shell_function("isochore",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg isochore $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg isochore $*')
set_shell_function("jembossctl",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg jembossctl $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg jembossctl $*')
set_shell_function("lindna",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg lindna $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg lindna $*')
set_shell_function("listor",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg listor $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg listor $*')
set_shell_function("makenucseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg makenucseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg makenucseq $*')
set_shell_function("makeprotseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg makeprotseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg makeprotseq $*')
set_shell_function("marscan",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg marscan $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg marscan $*')
set_shell_function("maskfeat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg maskfeat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg maskfeat $*')
set_shell_function("maskseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg maskseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg maskseq $*')
set_shell_function("matcher",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg matcher $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg matcher $*')
set_shell_function("megamerger",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg megamerger $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg megamerger $*')
set_shell_function("merger",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg merger $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg merger $*')
set_shell_function("msbar",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg msbar $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg msbar $*')
set_shell_function("mwcontam",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg mwcontam $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg mwcontam $*')
set_shell_function("mwfilter",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg mwfilter $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg mwfilter $*')
set_shell_function("needle",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg needle $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg needle $*')
set_shell_function("newcpgreport",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg newcpgreport $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg newcpgreport $*')
set_shell_function("newcpgseek",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg newcpgseek $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg newcpgseek $*')
set_shell_function("newseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg newseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg newseq $*')
set_shell_function("noreturn",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg noreturn $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg noreturn $*')
set_shell_function("notseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg notseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg notseq $*')
set_shell_function("nthseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg nthseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg nthseq $*')
set_shell_function("octanol",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg octanol $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg octanol $*')
set_shell_function("oddcomp",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg oddcomp $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg oddcomp $*')
set_shell_function("palindrome",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg palindrome $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg palindrome $*')
set_shell_function("pasteseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pasteseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pasteseq $*')
set_shell_function("patmatdb",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg patmatdb $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg patmatdb $*')
set_shell_function("patmatmotifs",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg patmatmotifs $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg patmatmotifs $*')
set_shell_function("pepcoil",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepcoil $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepcoil $*')
set_shell_function("pepinfo",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepinfo $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepinfo $*')
set_shell_function("pepnet",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepnet $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepnet $*')
set_shell_function("pepstats",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepstats $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepstats $*')
set_shell_function("pepwheel",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepwheel $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepwheel $*')
set_shell_function("pepwindow",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepwindow $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepwindow $*')
set_shell_function("pepwindowall",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepwindowall $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pepwindowall $*')
set_shell_function("plotcon",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg plotcon $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg plotcon $*')
set_shell_function("plotorf",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg plotorf $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg plotorf $*')
set_shell_function("pngtogd",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pngtogd $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pngtogd $*')
set_shell_function("pngtogd2",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pngtogd2 $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pngtogd2 $*')
set_shell_function("polydot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg polydot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg polydot $*')
set_shell_function("preg",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg preg $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg preg $*')
set_shell_function("prettyplot",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prettyplot $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prettyplot $*')
set_shell_function("prettyseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prettyseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prettyseq $*')
set_shell_function("primersearch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg primersearch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg primersearch $*')
set_shell_function("printsextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg printsextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg printsextract $*')
set_shell_function("profit",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg profit $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg profit $*')
set_shell_function("prophecy",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prophecy $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prophecy $*')
set_shell_function("prophet",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prophet $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prophet $*')
set_shell_function("prosextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prosextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg prosextract $*')
set_shell_function("pscan",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pscan $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg pscan $*')
set_shell_function("psiphi",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg psiphi $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg psiphi $*')
set_shell_function("rebaseextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg rebaseextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg rebaseextract $*')
set_shell_function("recoder",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg recoder $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg recoder $*')
set_shell_function("redata",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg redata $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg redata $*')
set_shell_function("remap",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg remap $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg remap $*')
set_shell_function("restover",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg restover $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg restover $*')
set_shell_function("restrict",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg restrict $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg restrict $*')
set_shell_function("revseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg revseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg revseq $*')
set_shell_function("runJemboss.csh",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg runJemboss.csh $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg runJemboss.csh $*')
set_shell_function("seealso",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seealso $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seealso $*')
set_shell_function("seqmatchall",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seqmatchall $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seqmatchall $*')
set_shell_function("seqret",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seqret $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seqret $*')
set_shell_function("seqretsplit",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seqretsplit $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg seqretsplit $*')
set_shell_function("showalign",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showalign $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showalign $*')
set_shell_function("showdb",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showdb $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showdb $*')
set_shell_function("showfeat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showfeat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showfeat $*')
set_shell_function("showorf",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showorf $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showorf $*')
set_shell_function("showseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg showseq $*')
set_shell_function("shuffleseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg shuffleseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg shuffleseq $*')
set_shell_function("sigcleave",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg sigcleave $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg sigcleave $*')
set_shell_function("silent",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg silent $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg silent $*')
set_shell_function("sirna",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg sirna $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg sirna $*')
set_shell_function("sixpack",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg sixpack $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg sixpack $*')
set_shell_function("skipseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg skipseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg skipseq $*')
set_shell_function("splitter",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg splitter $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg splitter $*')
set_shell_function("stretcher",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg stretcher $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg stretcher $*')
set_shell_function("stssearch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg stssearch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg stssearch $*')
set_shell_function("supermatcher",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg supermatcher $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg supermatcher $*')
set_shell_function("syco",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg syco $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg syco $*')
set_shell_function("tcode",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tcode $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tcode $*')
set_shell_function("textsearch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg textsearch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg textsearch $*')
set_shell_function("tfextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tfextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tfextract $*')
set_shell_function("tfm",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tfm $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tfm $*')
set_shell_function("tfscan",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tfscan $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tfscan $*')
set_shell_function("tmap",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tmap $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tmap $*')
set_shell_function("tranalign",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tranalign $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg tranalign $*')
set_shell_function("transeq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg transeq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg transeq $*')
set_shell_function("trimest",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg trimest $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg trimest $*')
set_shell_function("trimseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg trimseq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg trimseq $*')
set_shell_function("twofeat",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg twofeat $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg twofeat $*')
set_shell_function("union",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg union $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg union $*')
set_shell_function("vectorstrip",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg vectorstrip $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg vectorstrip $*')
set_shell_function("water",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg water $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg water $*')
set_shell_function("webpng",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg webpng $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg webpng $*')
set_shell_function("whichdb",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg whichdb $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg whichdb $*')
set_shell_function("wobble",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wobble $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wobble $*')
set_shell_function("wordcount",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wordcount $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wordcount $*')
set_shell_function("wordfinder",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wordfinder $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wordfinder $*')
set_shell_function("wordmatch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wordmatch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wordmatch $*')
set_shell_function("wossname",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wossname $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg wossname $*')
set_shell_function("xslt-config",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg xslt-config $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg xslt-config $*')
set_shell_function("xsltproc",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg xsltproc $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg xsltproc $*')
set_shell_function("yank",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg yank $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-5.0.0--0.simg yank $*')
|
UTILS = {}
function UTILS:QsPrint(msg)
DEFAULT_CHAT_FRAME:AddMessage("|CFFFF0000<|r|CFFFFD100QStall|r|CFFFF0000>|r"..(msg or "nil"));
end
function UTILS:QsWhisper(content, playerName)
local selfName,_ = UnitName("player")
UTILS:QsPrint("[QsWhisper] ["..playerName.."] ["..selfName.."]")
if string.find(playerName, selfName) then
UTILS:QsPrint("WHISPER:"..content)
else
SendChatMessage(content, "WHISPER", nil, playerName)
end
end
function UTILS:StrSplit(text, delimiter)
local list = {}
local pos = 1
if strfind("", delimiter, 1) then
error("delimiter matches empty string!")
end
while 1 do
local first, last = strfind(text, delimiter, pos)
if first then
tinsert(list, strsub(text, pos, first-1))
pos = last+1
else
tinsert(list, strsub(text, pos))
break
end
end
return list
end
function UTILS:arrPrint(arr, indentLevel)
local str = ""
local indentStr = "#"
if(indentLevel == nil) then
print(print_r(arr, 0))
return
end
for i = 0, indentLevel do
indentStr = indentStr.."\t"
end
for index,value in pairs(arr) do
if type(value) == "table" then
str = str..indentStr..index..": \n"..print_r(value, (indentLevel + 1))
else
str = str..indentStr..index..": "..value.."\n"
end
end
return str
end
function UTILS:queueNew()
return {first = 0, last = -1}
end
function UTILS:queuePush(list, value)
local last = list.last + 1
list.last = last
list[last] = value
UTILS:arrPrint(list, 2)
end
function UTILS:queuePop(list)
local first = list.first
if first > list.last then error("list is empty") end
local value = list[first]
list[first] = nil
list.first = first + 1
UTILS:arrPrint(list, 2)
return value
end
QsMain = {}
QsMain.StallTip = "1g开门,密我地点:奥格OG,雷霆TB,幽暗UC"
QsMain.DesQueue = UTILS:queueNew()
function QsMain:switchChange(switchOn)
if switchOn then
QStallConfigCharacter.SwitchOn = true
UTILS:QsPrint('QStall switch on!')
SendChatMessage(QsMain.StallTip, "YELL")
SendChatMessage(QsMain.StallTip, "DND")
else
QStallConfigCharacter.SwitchOn = false
UTILS:QsPrint("QStall switch off!")
SendChatMessage("", "DND")
end
end
QsMain.DestinationDef = {OG="AG|ag|Ag|AUG|aug|Aug|OG|og|Og|奥|澳", UC="YA|ya|Ya|UC|uc|Uc|幽", TB="TB|tb|Tb|LT|lt|Lt|雷"}
function QsMain:teleportPlayer(playerName, des)
UTILS:QsPrint("[teleportPlayer] ["..playerName.."] ["..des.."]")
if des == "OG" then
UTILS:queuePush(QsMain.DesQueue, des)
UTILS:QsWhisper("[奥格瑞玛] 1g,请交易", playerName)
UTILS:QsWhisper("[奥格瑞玛] 1g,请交易", playerName)
elseif des == "UC" then
UTILS:queuePush(QsMain.DesQueue, des)
UTILS:QsWhisper("[幽暗城] 1g,请交易", playerName)
UTILS:QsWhisper("[幽暗城] 1g,请交易", playerName)
elseif des == "TB" then
UTILS:queuePush(QsMain.DesQueue, des)
UTILS:QsWhisper("[雷霆崖] 1g,请交易", playerName)
UTILS:QsWhisper("[雷霆崖] 1g,请交易", playerName)
else
UTILS:QsWhisper(QsMain.StallTip, playerName)
return
end
UTILS:QsPrint("[InitiateTrade] ["..playerName.."]")
InitiateTrade(playerName)
end
local function handler(msg, editBox)
if msg == 'on' then
QsMain:switchChange(true)
elseif msg == 'off' then
QsMain:switchChange(false)
else
UTILS:QsPrint("Usage: /qstall [on | off]")
end
end
SLASH_QSTALL1, SLASH_QSTALL2 = '/qs', '/qstall';
SlashCmdList["QSTALL"] = handler;
local frame = CreateFrame("Frame")
frame:RegisterEvent("ADDON_LOADED")
frame:RegisterEvent("CHAT_MSG_WHISPER")
frame:RegisterEvent("TRADE_ACCEPT_UPDATE")
frame:RegisterEvent("PLAYER_TRADE_MONEY")
frame:RegisterEvent("CHAT_MSG_MONEY")
frame:SetScript("OnEvent", function(self, event, arg1, arg2, arg3, arg4, arg5)
if event == "ADDON_LOADED" and arg1 == "qstall" then
if QStallConfigCharacter == nil then
QStallConfigCharacter = {}
QStallConfigCharacter.SwitchOn = false
end
UTILS:QsPrint("QStall loaded.")
QsMain:switchChange(QStallConfigCharacter.SwitchOn)
end
if event == "CHAT_MSG_WHISPER" and QStallConfigCharacter.SwitchOn then
UTILS:QsPrint("[OnEvent:"..event.."] ["..(arg1 or "nil").."] ["..(arg5 or "nil").."]")
local text, playerName = arg1, arg5
local des = nil
-- UTILS:QsWhisper("先退出其它队伍。", playerName)
InviteUnit(playerName)
for k,v in pairs(QsMain.DestinationDef) do
for w in string.gmatch(v, '([^|]+)') do
if string.find(text, w) then
des = k
end
end
end
UTILS:QsPrint("[Destination Match] ["..playerName.."] ["..(des or '').."]")
if des ~= nil then
QsMain:teleportPlayer(playerName, des)
else
UTILS:QsWhisper("1g开门,密我地点:奥格OG,雷霆TB,幽暗UC", playerName)
end
end
if event == "TRADE_ACCEPT_UPDATE" and QStallConfigCharacter.SwitchOn then
UTILS:QsPrint("[OnEvent:"..event.."] ["..(arg1 or "nil").."] ["..(arg2 or "nil").."]")
local playerAccepted, targetAccepted = arg1, arg2
if targetAccepted == 1 then
AcceptTrade()
local targetTradeMoney = GetTargetTradeMoney();
UTILS:QsPrint("[targetTradeMoney] ["..tostring(targetTradeMoney).."]")
if targetTradeMoney < 2 then
SendChatMessage("请付款,至少1g", "YELL")
else
des = UTILS:queuePop(QsMain.DesQueue)
if des ~= nil then
if des == "OG" then
CastSpellByName("传送门:奥格瑞玛")
elseif des == "UC" then
CastSpellByName("传送门:幽暗城")
elseif des == "TB" then
CastSpellByName("传送门:雷霆崖")
end
end
end
end
end
if event == "PLAYER_TRADE_MONEY" and QStallConfigCharacter.SwitchOn then
UTILS:QsPrint("[OnEvent:"..event.."] ["..(arg1 or "nil").."] ["..(arg2 or "nil").."]")
local playerAccepted, targetAccepted = arg1, arg2
if targetAccepted == 1 then
AcceptTrade()
end
end
end)
-- todo: 队内聊天也要处理;
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.