content
stringlengths 5
1.05M
|
---|
local AddonName, Addon = ...;
local HtmlView = {};
local function scrollbarHide(self)
local control = self:GetParent();
local parent = control:GetParent();
local offset = control.containerPadding or 0;
control.Background:Hide();
control:GetScrollChild():SetWidth(control:GetWidth());
getmetatable(self).__index.Hide(self);
end
local function scrollbarShow(self)
local control = self:GetParent();
local parent = control:GetParent();
local offset = control.containerPadding or 0;
control.Background:Show();
control:GetScrollChild():SetWidth(control:GetWidth() - (self:GetWidth() + 6));
getmetatable(self).__index.Show(self);
end
local function setupScrollbar(self)
local control = self:GetParent();
local offset = control.containerPadding or 0;
local adjustX = control.adjustX or 0;
local adjustY = control.adjustY or 0;
-- We want to anchor the scrollbar to our right side, when it's
-- visible we reduce the size of our parent account for it.
local up = self.ScrollUpButton;
local down = self.ScrollDownButton;
self:ClearAllPoints();
self:SetPoint("TOPRIGHT", control, "TOPRIGHT", 0, -(up:GetHeight() - 6));
self:SetPoint("BOTTOMRIGHT", control, "BOTTOMRIGHT", 0, down:GetHeight() - 6)
up:ClearAllPoints();
up:SetPoint("BOTTOMLEFT", self, "TOPLEFT");
up:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT");
down:ClearAllPoints();
down:SetPoint("TOPLEFT", self, "BOTTOMLEFT");
down:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT");
local bg = control.Background;
if (not bg) then
bg = self:CreateTexture(nil, "BACKGROUND")
bg:SetColorTexture(0.20, 0.20, 0.20, 0.3)
control.Background = bg
end
bg:ClearAllPoints();
bg:SetPoint("LEFT", up, "LEFT");
bg:SetPoint("RIGHT", down, "RIGHT");
bg:SetPoint("TOP", up, "CENTER");
bg:SetPoint("BOTTOM", down, "CENTER");
bg:Hide();
self.Show = scrollbarShow;
self.Hide = scrollbarHide;
--control.scrollBarHideable = 1;
self:Hide();
end
local function finalizeScrollbar(self)
local control = self:GetParent();
self.ChildWidth = control:GetWidth() - self:GetWidth() - 6
control:GetScrollChild():SetWidth(self.ChildWidth)
end
function HtmlView:OnLoad()
ScrollFrame_OnLoad(self);
setupScrollbar(self.ScrollBar);
self:RegisterEvent("ADDON_LOADED");
self:SetScript("OnEvent",
function(self, event, addon)
if (addon ~= AddonName) then
return;
end
finalizeScrollbar(self.ScrollBar);
self:UnregisterEvent(event);
end);
end
function HtmlView:SetHtml(html)
self:GetScrollChild():SetText(html or "");
end
Addon.Controls = Addon.Controls or {};
Addon.Controls.HtmlView = HtmlView;
|
-- Author: __Vector__
addEvent ("enableVehicleCruiseSpeed", true);
addEventHandler ("enableVehicleCruiseSpeed", getRootElement (),
function (state)
if state then
setElementSyncer (source, getVehicleController (source));
else
setElementSyncer (source, true);
end;
end);
|
--[[
name : netatmo.lua
version: 1.0
description: netatmo plugin for dzbasic
5 uservariables to be created :
'netatmo_homeid'
'netatmo_appid'
'netatmo_appsecret'
'netatmo_username'
'netatmo_passwd'
author : casanoe
creation : 16/04/2021
update : 16/04/2021
--]]
-- Script description
local scriptName = 'netatmo'
local scriptVersion = '1.0'
-- Dzvents
return {
on = {
customEvents = { 'netatmo' },
shellCommandResponses = { 'netatmo*' }
},
logging = {
-- level = domoticz.LOG_DEBUG,
-- level = domoticz.LOG_INFO,
-- level = domoticz.LOG_ERROR,
-- level = domoticz.LOG_MODULE_EXEC_INFO,
marker = scriptName..' v'..scriptVersion
},
data = {
token = { initial = {} }
},
execute = function(dz, triggeredItem, info)
local TIMEOUT = nil
local home_id = dz.variables('netatmo_homeid').value
local app_id = dz.variables('netatmo_appid').value
local app_secret = dz.variables('netatmo_appsecret').value
local username = dz.variables('netatmo_username').value
local password = dz.variables('netatmo_passwd').value
local scope = 'read_station read_thermostat write_thermostat read_camera write_camera access_camera read_presence access_presence write_presence read_homecoach'
local dzu = dz.utils
dz.helpers.load_dzBasicLibs(dz)
local now = os.time(os.date('*t'))
-----------------------------------------
local trigger = triggeredItem.trigger
if trigger == 'netatmo' then
if not dz.data.token['expires'] or dz.data.token['expires'] < now then
print('>>>> NETATMO GET AUTH')
curl('https://api.netatmo.net/oauth2/token', {
headers = { 'Content-type: application/x-www-form-urlencoded;charset=UTF-8' },
data = {
grant_type = 'password',
client_id = app_id,
client_secret = app_secret,
username = username,
password = password,
scope = scope
},
method = 'POST',
callback = 'netatmo_auth'
})
else
print('>>>> NETATMO AUTH NOT EXPIRED')
trigger = 'netatmo_auth'
end
end
if trigger == 'netatmo_auth' then
if triggeredItem.ok and triggeredItem.isJSON then
print('>>>> NETATMO UPDATE AUTH TOKEN')
data = dzu.fromJSON(triggeredItem.data, '')
dz.data.token = data
aprint(data)
dz.data.token['expires'] = data['expires_in'] + now
else
print('>>>> NETATMO TOKEN AUTH OK')
data = dz.data.token
end
print('>>>> NETATMO GET DATA')
curl('https://api.netatmo.com/api/gethomedata', {
headers = { 'accept: application/json', 'Authorization: Bearer '..data['access_token'] },
data = {
size = 0,
home_id = home_id
},
callback = 'netatmo_data'
})
end
if trigger == 'netatmo_data' then
if triggeredItem.ok and triggeredItem.isJSON then
--print(triggeredItem.data)
args = dzBasicCall_getData('netatmo')['args']
aprint('ARG = '..args['msg'])
print('>>>> NETATMO CALL BACK')
dzBasicCall_return('netatmo', triggeredItem.json, TIMEOUT)
end
end
end
}
|
module("kinstall/adjustable2", package.seeall)
setfenv(1, getfenv(2));
--Adjustable2 Container
--
-- Kopia z oryginalnego Adjustable Container, z drobną zmiana
-- będzie to używane dopóki nie przygotuje PRa do Mudleta
--
--Just use it like a normal Geyser Container with some extras like:
--moveable, Adjustable2 size, attach to borders, minimizeable, save/load...
--right click on top border for menu
--Inspired heavily by Adjustable2 Label (by Jor'Mox ) and EMCO (by demonnic )
--by Edru 2020
Adjustable2 = Adjustable2 or {}
--------------------------------------
-- --
-- The Geyser Layout Manager by guy --
-- Adjustable2 Container by Edru --
-- --
--------------------------------------
-- Adjustable2 Container
-- @module Adjustable2Container
Adjustable2.Container = Adjustable2.Container or Geyser.Container:new({name = "Adjustable2ContainerClass"})
local adjustInfo = {}
-- Internal function to add "%" to a value and round it
-- Resulting percentage has five precision points to ensure accurate
-- representation in pixel space.
-- @param num Any float. For 0-100% output, use 0.0-1.0
local function make_percent(num)
return string.format("%.5f%%", (num * 100))
end
-- Internal function: checks where the mouse is at on the Label
-- and saves the information for further use at resizing/repositioning
-- also changes the mousecursor for easier use of the resizing/repositioning functionality
-- @param self the Adjustable2.Container it self
-- @param label the Label which allows the Container to be Adjustable2
-- @param event Mouse Click event and its infomations
local function adjust_Info(self, label, event)
local x, y = getMousePosition()
local w, h = self.adjLabel:get_width(), self.adjLabel:get_height()
local x1, y1 = x - event.x, y - event.y
local x2, y2 = x1 + w, y1 + h
local left, right, top, bottom = event.x <= 10, x >= x2 - 10, event.y <= 3, y >= y2 - 10
if right and left then left = false end
if top and bottom then top = false end
if event.button ~= "LeftButton" and not self.minimized then
if (top or bottom) and not (left or right) then
label:setCursor("ResizeVertical")
elseif (left or right) and not (top or bottom) then
label:setCursor("ResizeHorizontal")
elseif (top and left) or (bottom and right) then
label:setCursor("ResizeTopLeft")
elseif (top and right) or (bottom and left) then
label:setCursor("ResizeTopRight")
else
label:setCursor("OpenHand")
end
end
adjustInfo = {name = adjustInfo.name, top = top, bottom = bottom, left = left, right = right, x = x, y = y, move = adjustInfo.move}
end
-- Internal function: hides the window title if the window gets smaller
-- @param lbl the Label which allows the Container to be Adjustable2 and where the title text is on
local function shrink_title(lbl)
if lbl.locked and lbl.connectedContainers then
return
end
local w = lbl:get_width()
local titleText = lbl.titleText
if #titleText <= 15 then titleText = titleText.." " end
if w < (#titleText-10)*6.6+20 then
titleText = string.sub(lbl.titleText, 0, math.floor(w/6)).."..."
end
if #titleText <= 15 then titleText = "" end
lbl.adjLabel:echo(titleText, lbl.titleTxtColor, "l")
end
--- function to give your Adjustable2 container a new title
-- @param text new title text
-- @param color title text color
function Adjustable2.Container:setTitle(text, color)
text = text or self.name.." - Adjustable2 Container"
self.titleTxtColor = color or "green"
self.titleText = " "..text
shrink_title(self)
end
-- internal function to handle the onClick event of main Adjustable2.Container Label
-- @param label the main Adjustable2.Container Label
-- @param event the onClick event and its informations
function Adjustable2.Container:onClick(label, event)
if label.cursorShape == "OpenHand" then
label:setCursor("ClosedHand")
end
if event.button == "LeftButton" and not(self.locked and not self.connectedContainers) then
if self.raiseOnClick then
self:raiseAll()
end
adjustInfo.name = label.name
adjustInfo.move = not (adjustInfo.right or adjustInfo.left or adjustInfo.top or adjustInfo.bottom)
if self.minimized then adjustInfo.move = true end
adjust_Info(self, label, event)
end
if event.button == "RightButton" then
--if not in the Geyser main window attach Label is not needed and will be removed
if self.container ~= Geyser and table.index_of(self.rCLabel.nestedLabels, self.attLabel) then
label:hideMenuLabel("attLabel")
-- if we are back to the Geyser main window attach Label will be readded
elseif self.container == Geyser and not table.index_of(self.rCLabel.nestedLabels, self.attLabel) then
label:showMenuLabel("attLabel")
end
if not self.customItemsLabel.nestedLabels then
label:hideMenuLabel("customItemsLabel")
else
label:showMenuLabel("customItemsLabel")
end
end
label:onRightClick(event)
end
-- internal function to handle the onRelease event of main Adjustable2.Container Label
-- @param label the main Adjustable2.Container Label
-- @param event the onRelease event and its informations
function Adjustable2.Container:onRelease (label, event)
if event.button == "LeftButton" and adjustInfo ~= {} and adjustInfo.name == label.name then
if label.cursorShape == "ClosedHand" then
label:setCursor("OpenHand")
end
raiseEvent(
"AdjustableContainerRepositionFinish",
self.name,
self.get_width(),
self.get_height(),
self.get_x(),
self.get_y(),
adjustInfo.name == self.adjLabel.name and (adjustInfo.move or adjustInfo.right or adjustInfo.left or adjustInfo.top or adjustInfo.bottom)
)
adjustInfo = {}
end
end
-- internal function to handle the onMove event of main Adjustable2.Container Label
-- @param label the main Adjustable2.Container Label
-- @param event the onMove event and its informations
function Adjustable2.Container:onMove (label, event)
if self.locked and not self.connectedContainers then
if label.cursorShape ~= 0 then
label:resetCursor()
end
return
end
if adjustInfo.move == nil then
adjust_Info(self, label, event)
end
if self.connectedToBorder then
for k in pairs(self.connectedToBorder) do
if adjustInfo[k] then
label:resetCursor()
return
end
end
end
if adjustInfo.x and adjustInfo.name == label.name then
self:adjustBorder()
local x, y = getMousePosition()
local winw, winh = getMainWindowSize()
local x1, y1, w, h = self.get_x(), self.get_y(), self:get_width(), self:get_height()
if (self.container) and (self.container ~= Geyser) then
x1,y1 = x1-self.container.get_x(), y1-self.container.get_y()
winw, winh = self.container.get_width(), self.container.get_height()
end
local dx, dy = adjustInfo.x - x, adjustInfo.y - y
local max, min = math.max, math.min
if adjustInfo.move and not self.connectedContainers then
label:setCursor("ClosedHand")
local tx, ty = max(0,x1-dx), max(0,y1-dy)
tx, ty = min(tx, winw - w), min(ty, winh - h)
tx = make_percent(tx/winw)
ty = make_percent(ty/winh)
self:move(tx, ty)
--[[
-- automated lock on border deactivated for now
if x1-dx <-5 then self:attachToBorder("left") end
if y1-dy <-5 then self:attachToBorder("top") end
if winw - w < tx+0.1 then self:attachToBorder("right") end
if winh - h < ty+0.1 then self:attachToBorder("bottom") end--]]
elseif adjustInfo.move == false then
local w2, h2, x2, y2 = w - dx, h - dy, x1 - dx, y1 - dy
local tx, ty, tw, th = x1, y1, w, h
if adjustInfo.top then
ty, th = y2, h + dy
elseif adjustInfo.bottom then
th = h2
end
if adjustInfo.left then
tx, tw = x2, w + dx
elseif adjustInfo.right then
tw = w2
end
tx, ty, tw, th = max(0,tx), max(0,ty), max(10,tw), max(10,th)
tw, th = min(tw, winw), min(th, winh)
tx, ty = min(tx, winw-tw), min(ty, winh-th)
tx = make_percent(tx/winw)
ty = make_percent(ty/winh)
self:move(tx, ty)
local minw, minh = 0,0
if self.container == Geyser and not self.noLimit then minw, minh = 75,25 end
tw,th = max(minw,tw), max(minh,th)
tw,th = make_percent(tw/winw), make_percent(th/winh)
self:resize(tw, th)
shrink_title(self)
if self.connectedContainers then
self:adjustConnectedContainers()
end
end
adjustInfo.x, adjustInfo.y = x, y
end
end
-- internal function to check which valid attach position the container is at
function Adjustable2.Container:validAttachPositions()
local winw, winh = getMainWindowSize()
local found_positions = {}
if (winh*0.8)-self.get_height()<= self.get_y() then found_positions[#found_positions+1] = "bottom" end
if (winw*0.8)-self.get_width() <= self.get_x() then found_positions[#found_positions+1] = "right" end
if self.get_y() <= winh*0.2 then found_positions[#found_positions+1] = "top" end
if self.get_x() <= winw*0.2 then found_positions[#found_positions+1] = "left" end
return found_positions
end
-- internal function to adjust the main console borders if needed
function Adjustable2.Container:adjustBorder()
local winw, winh = getMainWindowSize()
local where = false
if type(self.attached) ~= "string" then
return false
end
where = self.attached:lower()
if table.contains(self:validAttachPositions(), where) == false or self.minimized or self.hidden then
self:detach()
return
end
if where == "right" then
self.borderSize = winw+self.attachedMargin-self.get_x()
elseif where == "left" then
self.borderSize = self.get_width()+self.get_x()+self.attachedMargin
elseif where == "bottom" then
self.borderSize = winh+self.attachedMargin-self.get_y()
elseif where == "top" then
self.borderSize = self.get_height()+self.get_y()+self.attachedMargin
else
self.attached = false
return
end
local borderSize = self.borderSize
for k,v in pairs(Adjustable2.Container.Attached[where]) do
if v.borderSize > borderSize then
borderSize = v.borderSize
end
end
local funcname = string.format("setBorder%s", string.title(where))
_G[funcname](borderSize)
end
-- internal function to adjust connected containers
function Adjustable2.Container:adjustConnectedContainers()
local where = self.attached
local x, y, height, width = self.x, self.y, self.height, self.width
if not where or not self.connectedContainers then
return false
end
for k in pairs(self.connectedContainers) do
local container = Adjustable2.Container.all[k]
if container then
if container.attached == where then
if where == "right" or where == "left" then
height = nil
y = nil
end
if where == "top" or where == "bottom" then
width = nil
x = nil
end
container:move(x, y)
container:resize(width, height)
else
if where == "right" then
container:resize(self:get_x() - container:get_x(), nil)
end
if where == "left" then
local right_x = container:get_x() + container:get_width()
local left_x = self:get_x() + self:get_width()
container:move(left_x, nil)
container:resize(right_x - container:get_x(), nil)
end
if where == "bottom" then
container:resize(nil, self:get_y() - container:get_y())
end
if where == "top" then
local bottom_y = container:get_y() + container:get_height()
local top_y = self:get_y() + self:get_height()
container:move(nil, top_y)
container:resize(nil, bottom_y - container:get_y())
end
end
container:adjustBorder()
end
end
end
--- connect your container to a border
-- @param border main border ("top", "bottom", "left", "right")
function Adjustable2.Container:connectToBorder(border)
if not self.attached or not Adjustable2.Container.Attached[border] then
return
end
self.connectedToBorder = self.connectedToBorder or {}
self.connectedToBorder[border] = true
self.connectedContainers = self.connectedContainers or {}
for k,v in pairs(Adjustable2.Container.Attached[border]) do
v.connectedContainers = v.connectedContainers or {}
v.connectedContainers[self.name] = true
if self.attached == border then
v.connectedToBorder = v.connectedToBorder or {}
v.connectedToBorder[border] = true
self.connectedContainers[k] = v
end
v:adjustConnectedContainers()
end
end
--- adds elements to connect containers to borders into the right click menu
function Adjustable2.Container:addConnectMenu()
local label = self.adjLabel
local menuTxt = self.Locale.connectTo.message
label:addMenuLabel("Connect To: ")
label:findMenuElement("Connect To: "):echo(menuTxt, "nocolor", "c")
local menuParent = self.rCLabel.MenuItems
menuParent[#menuParent + 1] = {"top", "bottom", "left", "right"}
self.rCLabel.MenuWidth3 = self.ChildMenuWidth
self.rCLabel.MenuFormat3 = self.rCLabel.MenuFormat2
label:createMenuItems()
for k,v in ipairs(menuParent[#menuParent]) do
menuTxt = self.Locale[v] and self.Locale[v].message or v
label:findMenuElement("Connect To: ."..v):echo(menuTxt, "nocolor")
label:setMenuAction("Connect To: ."..v, function() closeAllLevels(self.rCLabel) self:connectToBorder(v) end)
end
menuTxt = self.Locale.disconnect.message
label:addMenuLabel("Disconnect ")
label:setMenuAction("Disconnect ", function() closeAllLevels(self.rCLabel) self:disconnect() end)
label:findMenuElement("Disconnect "):echo(menuTxt, "nocolor", "c")
end
--- disconnects your container from a border
function Adjustable2.Container:disconnect()
if not self.connectedToBorder then
return
end
for k in pairs(self.connectedToBorder) do
if Adjustable2.Container.Attached[k] then
for k1,v1 in pairs(Adjustable2.Container.Attached[k]) do
if v1.connectedContainers and v1.connectedContainers[self.name] then
v1.connectedContainers[self.name] = nil
if table.is_empty(v1.connectedContainers) then
v1.connectedContainers = nil
end
end
end
end
end
self.connectedToBorder = nil
self.connectedContainers = nil
end
--- gives your MainWindow borders a margin
-- @param margin in pixel
function Adjustable2.Container:setBorderMargin(margin)
self.attachedMargin = margin
self:adjustBorder()
end
-- internal function to resize the border automatically if the window size changes
function Adjustable2.Container:resizeBorder()
local winw, winh = getMainWindowSize()
self.timer_active = self.timer_active or true
-- Check if Window resize already happened.
-- If that is not checked this creates an infinite loop and crashes because setBorder also causes a resize event
if (winw ~= self.old_w_value or winh ~= self.old_h_value) and self.timer_active then
self.timer_active = false
tempTimer(0.2, function() self:adjustBorder() self:adjustConnectedContainers() end)
end
self.old_w_value = winw
self.old_h_value = winh
end
--- attaches your container to the given border
-- attach is only possible if the container is located near the border
-- @param border possible border values are "top", "bottom", "right", "left"
function Adjustable2.Container:attachToBorder(border)
if self.attached then self:detach() end
Adjustable2.Container.Attached[border] = Adjustable2.Container.Attached[border] or {}
Adjustable2.Container.Attached[border][self.name] = self
self.attached = border
self:adjustBorder()
self.resizeHandlerID=registerAnonymousEventHandler("sysWindowResizeEvent", function() self:resizeBorder() end)
closeAllLevels(self.rCLabel)
end
--- detaches the given container
-- this means the mudlet main window border will be reseted
function Adjustable2.Container:detach()
if Adjustable2.Container.Attached and Adjustable2.Container.Attached[self.attached] then
Adjustable2.Container.Attached[self.attached][self.name] = nil
end
self.borderSize = nil
self:resetBorder(self.attached)
self.attached=false
if self.resizeHandlerID then killAnonymousEventHandler(self.resizeHandlerID) end
end
-- internal function to reset the given border
-- @param where possible border values are "top", "bottom", "right", "left"
function Adjustable2.Container:resetBorder(where)
local resetTo = 0
if not Adjustable2.Container.Attached[where] then
return
end
for k,v in pairs(Adjustable2.Container.Attached[where]) do
if v.borderSize > resetTo then
resetTo = v.borderSize
end
end
if where == "right" then setBorderRight(resetTo)
elseif where == "left" then setBorderLeft(resetTo)
elseif where == "bottom" then setBorderBottom(resetTo)
elseif where == "top" then setBorderTop(resetTo)
end
end
-- creates the Adjustable2 label and the container where all the elements will be put in
function Adjustable2.Container:createContainers()
self.adjLabel = Geyser.Label:new({
x = "0",
y = "0",
height = "100%",
width = "100%",
name = self.name.."adjLabel"
},self)
self.Inside = Geyser.Container:new({
x = self.padding,
y = self.padding*2,
height = "-"..self.padding,
width = "-"..self.padding,
name = self.name.."InsideContainer"
},self)
end
--- locks your Adjustable2 container
--lock means that your container is no longer moveable/resizable by mouse.
--You can also choose different lockStyles which changes the border or container style.
--if no lockStyle is added "standard" style will be used
-- @param lockNr the number of the lockStyle [optional]
-- @param lockStyle the lockstyle used to lock the container,
-- the lockStyle is the behaviour/mode of the locked state.
-- integrated lockStyles are "standard", "border", "full" and "light" (default "standard")
-- standard: This is the default lockstyle, with a small margin on top to keep the right click menu usable.
-- light: Only hides the min/restore and close labels. Borders and margin are not affected.
-- full: The container gets fully locked without any margin left for the right click menu.
-- border: Keeps the borders of the container visible while locked.
function Adjustable2.Container:lockContainer(lockNr, lockStyle)
closeAllLevels(self.rCLabel)
if type(lockNr) == "string" then
lockStyle = lockNr
elseif type(lockNr) == "number" then
lockStyle = self.lockStyles[lockNr][1]
end
lockStyle = lockStyle or self.lockStyle
if not self.lockStyles[lockStyle] then
lockStyle = "standard"
end
self.lockStyle = lockStyle
if self.minimized == false then
self.lockStyles[lockStyle][2](self)
self.exitLabel:hide()
self.minimizeLabel:hide()
self.locked = true
self:adjustBorder()
end
end
-- internal function to handle the custom Items onClick event
-- @param customItem the item clicked at
function Adjustable2.Container:customMenu(customItem)
closeAllLevels(self.rCLabel)
if self.minimized == false then
self.customItems[customItem][2](self)
end
end
--- unlocks your previous locked container
-- what means that the container is moveable/resizable by mouse again
function Adjustable2.Container:unlockContainer()
closeAllLevels(self.rCLabel)
self.Inside:resize("-"..self.padding,"-"..self.padding)
self.Inside:move(self.padding, self.padding*2)
self.adjLabel:setStyleSheet(self.adjLabelstyle)
self.exitLabel:show()
self.minimizeLabel:show()
self.locked = false
shrink_title(self)
end
--- sets the padding of your container
-- changes how far the the container is positioned from the border of the container
-- padding behaviour also depends on your lockStyle
-- @param padding the padding value (standard is 10)
function Adjustable2.Container:setPadding(padding)
self.padding = padding
if self.locked then
self:lockContainer()
else
self:unlockContainer()
end
end
-- internal function: onClick Lock event
function Adjustable2.Container:onClickL()
if self.locked == true then
self:unlockContainer()
else
self:lockContainer()
end
end
-- internal function: adjusts/sets the borders if an container gets hidden
function Adjustable2.Container:hideObj()
self:hide()
self:adjustBorder()
end
-- internal function: onClick minimize event
function Adjustable2.Container:onClickMin()
closeAllLevels(self.rCLabel)
if self.minimized == false then
self:minimize()
else
self:restore()
end
end
-- internal function: onClick save event
function Adjustable2.Container:onClickSave()
closeAllLevels(self.rCLabel)
self:save()
end
-- internal function: onClick load event
function Adjustable2.Container:onClickLoad()
closeAllLevels(self.rCLabel)
self:load()
end
--- minimizes the container
-- hides everything beside the title
function Adjustable2.Container:minimize()
if self.minimized and self.locked then
return
end
self.origh = self.height
self.Inside:hide()
self:resize(nil, self.buttonsize + 10)
self.minimized = true
if self.connectedToBorder or self.connectedContainers then
self:disconnect()
end
self:adjustBorder()
end
--- restores the container after it was minimized
function Adjustable2.Container:restore()
if self.minimized == true then
self.origh = self.origh or "25%"
self.Inside:show()
self:resize(nil,self.origh)
self.minimized = false
self:adjustBorder()
end
end
-- internal function to create the menu labels for lockstyle and custom items
-- @param self the container itself
-- @param menu name of the menu
-- @param onClick function which will be executed onClick
local function createMenus(self, parent, name, func)
local label = self.adjLabel
local menuTxt = self.Locale[name] and self.Locale[name].message or name
label:addMenuLabel(name, parent)
label:findMenuElement(parent.."."..name):echo(menuTxt, "nocolor")
label:setMenuAction(parent.."."..name, func, self, name)
end
-- internal function: Handler for the onEnter event of the attach menu
-- the attach menu will be created with the valid positions onEnter of the mouse
function Adjustable2.Container:onEnterAtt()
local attm = self:validAttachPositions()
self.attLabel.nestedLabels = {}
for i=1,#attm do
if self.att[i].container ~= Geyser then
self.att[i]:changeContainer(Geyser)
end
self.att[i].flyDir = self.attLabel.flyDir
self.att[i]:echo("<center>"..self.Locale[attm[i]].message, "nocolor")
self.att[i]:setClickCallback("Adjustable2.Container.attachToBorder", self, attm[i])
self.attLabel.nestedLabels[#self.attLabel.nestedLabels+1] = self.att[i]
end
doNestShow(self.attLabel)
end
-- internal function to create the Minimize/Close and the right click Menu Labels
function Adjustable2.Container:createLabels()
self.exitLabel = Geyser.Label:new({
x = -(self.buttonsize * 1.4), y=4, width = self.buttonsize, height = self.buttonsize, fontSize = self.buttonFontSize, name = self.name.."exitLabel"
},self)
self.exitLabel:echo("<center>x</center>")
self.minimizeLabel = Geyser.Label:new({
x = -(self.buttonsize * 2.6), y=4, width = self.buttonsize, height = self.buttonsize, fontSize = self.buttonFontSize, name = self.name.."minimizeLabel"
},self)
self.minimizeLabel:echo("<center>-</center>")
end
-- internal function to create the right click menu
function Adjustable2.Container:createRightClickMenu()
self.adjLabel:createRightClickMenu(
{MenuItems = {"lockLabel", "minLabel", "saveLabel", "loadLabel", "attLabel", {"att1","att2","att3","att4"}, "lockStylesLabel",{}, "customItemsLabel",{}},
Style = self.menuStyleMode,
MenuStyle = self.menustyle,
MenuWidth = self.ParentMenuWidth,
MenuWidth2 = self.ChildMenuWidth,
MenuHeight = self.MenuHeight,
MenuFormat = "l"..self.MenuFontSize,
MenuFormat2 = "c"..self.MenuFontSize,
}
)
self.rCLabel = self.adjLabel.rightClickMenu
for k,v in pairs(self.rCLabel.MenuLabels) do
self[k] = v
end
for k,v in ipairs(self.rCLabel.MenuLabels["attLabel"].MenuItems) do
self.att[k] = self.rCLabel.MenuLabels["attLabel"].MenuLabels[v]
end
end
-- internal function to set the text on the right click menu labels
function Adjustable2.Container:echoRightClickMenu()
for k,v in ipairs(self.adjLabel.rightClickMenu.MenuItems) do
if type(v) == "string" then
self[v]:echo(self[v].txt, "nocolor")
end
end
end
--- function to change the right click menu style
-- there are 2 styles: dark and light
--@param mode the style mode (dark or light)
function Adjustable2.Container:changeMenuStyle(mode)
self.menuStyleMode = mode
self.adjLabel:styleMenuItems(self.menuStyleMode)
end
-- overriden add function to put every new window to the Inside container
-- @param window derives from the original Geyser.Container:add function
-- @param cons derives from the original Geyser.Container:add function
function Adjustable2.Container:add(window, cons)
if self.goInside then
if self.useAdd2 == false then
self.Inside:add(window, cons)
else
--add2 inheritance set to true
self.Inside:add2(window, cons, true)
end
else
if self.useAdd2 == false then
Geyser.add(self, window, cons)
else
--add2 inheritance set to true
self:add2(window, cons, true)
end
end
end
-- overriden show function to prevent to show the right click menu on show
function Adjustable2.Container:show(auto)
Geyser.Container.show(self, auto)
closeAllLevels(self.rCLabel)
end
--- saves your container settings
-- like position/size and some other variables in your Mudlet Profile Dir/ Adjustable2Container
-- to be reliable it is important that the Adjustable2.Container has an unique 'name'
-- @param slot defines a save slot for example a number (1,2,3..) or a string "backup" [optional]
-- @param dir defines save directory [optional]
-- @see Adjustable2.Container:load
function Adjustable2.Container:save(slot, dir)
assert(slot == nil or type(slot) == "string" or type(slot) == "number", "Adjustable2.Container.save: bad argument #1 type (slot as string or number expected, got "..type(slot).."!)")
assert(dir == nil or type(dir) == "string" , "Adjustable2.Container.save: bad argument #2 type (directory as string expected, got "..type(dir).."!)")
dir = dir or self.defaultDir
local saveDir = string.format("%s%s.lua", dir, self.name)
local mainTable = {}
mainTable.slot = {}
local mytable = {}
-- check if there are already saved settings and if so load them to the mainTable
if io.exists(saveDir) then
table.load(saveDir, mainTable)
end
if slot then
mainTable.slot[slot] = mytable
else
mytable = mainTable
end
mytable.x = self.x
mytable.y = self.y
mytable.height= self.height
mytable.width= self.width
mytable.minimized= self.minimized
mytable.origh= self.origh
mytable.locked = self.locked
mytable.attached = self.attached
mytable.lockStyle = self.lockStyle
mytable.padding = self.padding
mytable.attachedMargin = self.attachedMargin
mytable.hidden = self.hidden
mytable.auto_hidden = self.auto_hidden
mytable.connectedToBorder = self.connectedToBorder
mytable.connectedContainers = self.connectedContainers
mytable.windowname = self.windowname
if not(io.exists(dir)) then lfs.mkdir(dir) end
table.save(saveDir, mainTable)
return true
end
--- restores/loads the before saved settings
-- @param slot defines a load slot for example a number (1,2,3..) or a string "backup" [optional]
-- @param dir defines load directory [optional]
-- @see Adjustable2.Container:save
function Adjustable2.Container:load(slot, dir)
local mytable = {}
mytable.slot = {}
assert(slot == nil or type(slot) == "string" or type(slot) == "number", "Adjustable2.Container.load: bad argument #1 type (slot as string or number expected, got "..type(slot).."!)")
assert(dir == nil or type(dir) == "string" , "Adjustable2.Container.load: bad argument #2 type (directory as string expected, got "..type(dir).."!)")
dir = dir or self.defaultDir
local loadDir = string.format("%s%s.lua", dir, self.name)
if not (io.exists(loadDir)) then
return string.format("Adjustable2.Container.load: Couldn't load settings from %s", loadDir)
end
local ok = pcall(table.load, loadDir, mytable)
if not ok then
self:deleteSaveFile()
debugc(string.format("Adjustable2.Container.load: Save file %s got corrupted. It was deleted so everything else can load properly.", loadDir))
return false
end
-- if slot settings not found load default settings
if slot then
mytable = mytable.slot[slot] or mytable
end
mytable.windowname = mytable.windowname or "main"
-- send Adjustable2 Container to a UserWindow if saved there
if mytable.windowname ~= self.windowname then
if mytable.windowname == "main" then
self:changeContainer(Geyser)
else
self:changeContainer(Geyser.windowList[mytable.windowname.."Container"].windowList[mytable.windowname])
end
end
self.lockStyle = mytable.lockStyle or self.lockStyle
self.padding = mytable.padding or self.padding
self.attachedMargin = mytable.attachedMargin or self.attachedMargin
if mytable.x then
self:move(mytable.x, mytable.y)
self:resize(mytable.width, mytable.height)
self.minimized = mytable.minimized
if mytable.locked == true then self:lockContainer() else self:unlockContainer() end
if self.minimized == true then self.Inside:hide() self:resize(nil, self.buttonsize + 10) else self.Inside:show() end
self.origh = mytable.origh
end
self:detach()
if mytable.attached then
self:attachToBorder(mytable.attached)
end
self:adjustBorder()
self.connectedContainers = mytable.connectedContainers or self.connectedContainers
self.connectedToBorder = mytable.connectedToBorder or self.connectedToBorder
if self.connectedToBorder then
for k in pairs(self.connectedToBorder) do
self:connectToBorder(k)
end
end
if mytable.auto_hidden or mytable.hidden then
self:hide()
if not mytable.hidden then self.hidden = false self.auto_hidden = true end
else
self:show()
end
self:adjustConnectedContainers()
return true
end
--- overridden reposition function to raise an event of the Adjustable2.Container changing position/size
-- event name: "AdjustableContainerReposition" passed values (name, width, height, x, y)
-- it also calls the shrink_title function
function Adjustable2.Container:reposition()
Geyser.Container.reposition(self)
raiseEvent(
"AdjustableContainerReposition",
self.name,
self.get_width(),
self.get_height(),
self.get_x(),
self.get_y(),
adjustInfo.name == self.adjLabel.name and (adjustInfo.move or adjustInfo.right or adjustInfo.left or adjustInfo.top or adjustInfo.bottom)
)
if self.titleText and not(self.locked) then
shrink_title(self)
end
end
--- deletes the file where your saved settings are stored
-- @param dir defines directory where the saved file is in [optional]
-- @see Adjustable2.Container:save
function Adjustable2.Container:deleteSaveFile(dir)
assert(dir == nil or type(dir) == "string" , "Adjustable2.Container.deleteSaveFile: bad argument #1 type (directory as string expected, got "..type(dir).."!)")
dir = dir or self.defaultDir
local deleteDir = string.format("%s%s.lua", dir, self.name)
if io.exists(deleteDir) then
os.remove(deleteDir)
else
return "Adjustable2.Container.deleteSaveFile: Couldn't find file to delete at " .. deleteDir
end
return true
end
--- saves all your Adjustable2 containers at once
-- @param slot defines a save slot for example a number (1,2,3..) or a string "backup" [optional]
-- @param dir defines save directory [optional]
-- @see Adjustable2.Container:save
function Adjustable2.Container:saveAll(slot, dir)
for k,v in pairs(Adjustable2.Container.all) do
v:save(slot, dir)
end
end
--- loads all your Adjustable2 containers at once
-- @param slot defines a load slot for example a number (1,2,3..) or a string "backup" [optional]
-- @param dir defines load directory [optional]
-- @see Adjustable2.Container:load
function Adjustable2.Container:loadAll(slot, dir)
for k,v in pairs(Adjustable2.Container.all) do
v:load(slot, dir)
end
end
--- shows all your Adjustable2 containers
-- @see Adjustable2.Container:doAll
function Adjustable2.Container:showAll()
for k,v in pairs(Adjustable2.Container.all) do
v:show()
end
end
--- executes the function myfunc which affects all your containers
-- @param myfunc function which will be executed at all your containers
function Adjustable2.Container:doAll(myfunc)
for k,v in pairs(Adjustable2.Container.all) do
myfunc(v)
end
end
--- changes the values of your container to absolute values
-- (standard settings are set values to percentages)
-- @param size_as_absolute bool true to have the size as absolute values
-- @param position_as_absolute bool true to have the position as absolute values
function Adjustable2.Container:setAbsolute(size_as_absolute, position_as_absolute)
if position_as_absolute then
self.x, self.y = self.get_x(), self.get_y()
end
if size_as_absolute then
self.width, self.height = self.get_width(), self.get_height()
end
self:set_constraints(self)
end
--- changes the values of your container to be percentage values
-- only needed if values where set to absolute before
-- @param size_as_percent bool true to have the size as percentage values
-- @param position_as_percent bool true to have the position as percentage values
function Adjustable2.Container:setPercent (size_as_percent, position_as_percent)
local x, y, w, h = self:get_x(), self:get_y(), self:get_width(), self:get_height()
local winw, winh = getMainWindowSize()
if (self.container) and (self.container ~= Geyser) then
x,y = x-self.container.get_x(),y-self.container.get_y()
winw, winh = self.container.get_width(), self.container.get_height()
end
x, y, w, h = make_percent(x/winw), make_percent(y/winh), make_percent(w/winw), make_percent(h/winh)
if size_as_percent then self:resize(w,h) end
if position_as_percent then self:move(x,y) end
end
-- Save a reference to our parent constructor
Adjustable2.Container.parent = Geyser.Container
-- Create table to put every Adjustable2.Container in it
Adjustable2.Container.all = Adjustable2.Container.all or {}
Adjustable2.Container.all_windows = Adjustable2.Container.all_windows or {}
Adjustable2.Container.Attached = Adjustable2.Container.Attached or {}
-- Internal function to create all the standard lockstyles
function Adjustable2.Container:globalLockStyles()
self.lockStyles = self.lockStyles or {}
self:newLockStyle("standard", function (s)
s.Inside:resize("100%",-1)
s.Inside:move(0, s.padding)
s.adjLabel:setStyleSheet(string.gsub(s.adjLabelstyle, "(border.-)%d(.-;)","%10%2"))
s.adjLabel:echo("")
end)
self:newLockStyle("border", function (s)
s.Inside:resize("-"..s.padding,"-"..s.padding)
s.Inside:move(s.padding, s.padding)
s.adjLabel:setStyleSheet(s.adjLabelstyle)
s.adjLabel:echo("")
end)
self:newLockStyle("full", function (s)
s.Inside:resize("100%","100%")
s.Inside:move(0,0)
s.adjLabel:setStyleSheet(string.gsub(s.adjLabelstyle, "(border.-)%d(.-;)","%10%2"))
s.adjLabel:echo("")
end)
self:newLockStyle("light", function (s)
shrink_title(s)
s.Inside:resize("-"..s.padding,"-"..s.padding)
s.Inside:move(s.padding, s.padding*2)
s.adjLabel:setStyleSheet(s.adjLabelstyle)
end)
end
--- creates a new Lockstyle
-- @param name Name of the menu item/lockstyle
-- @param func function of the new lockstyle
function Adjustable2.Container:newLockStyle(name, func)
if self.lockStyles[name] then
return
end
self.lockStyles[#self.lockStyles + 1] = {name, func}
self.lockStyles[name] = self.lockStyles[#self.lockStyles]
if self.lockStylesLabel then
createMenus(self, "lockStylesLabel", name, "Adjustable2.Container.lockContainer")
end
end
--- creates a new custom menu item
-- @param name Name of the new menu iten
-- @param func function of the new custom menu item
function Adjustable2.Container:newCustomItem(name, func)
self.customItems = self.customItems or {}
if self.customItems[name] then
return
end
self.customItems[#self.customItems + 1] = {name, func}
self.customItems[name] = self.customItems[#self.customItems]
createMenus(self, "customItemsLabel", name, "Adjustable2.Container.customMenu")
end
--- enablesAutoSave normally only used internally
-- only useful if autoSave was set to false before
function Adjustable2.Container:enableAutoSave()
self.autoSave = true
self.autoSaveHandler = self.autoSaveHandler or registerAnonymousEventHandler("sysExitEvent", function() self:save() end)
end
--- disableAutoSave function to disable a before enabled autoSave
function Adjustable2.Container:disableAutoSave()
self.autoSave = false
killAnonymousEventHandler(self.autoSaveHandler)
end
--- constructor for the Adjustable2 Container
---@param cons besides standard Geyser.Container parameters there are also:
---@param container
--@param[opt="getMudletHomeDir().."/Adjustable2Container/"" ] cons.defaultDir default dir where settings are loaded/saved to/from
--@param[opt="102" ] cons.ParentMenuWidth menu width of the main right click menu
--@param[opt="82"] cons.ChildMenuWidth menu width of the children in the right click menu (for attached, lockstyles and custom items)
--@param[opt="22"] cons.MenuHeight height of a single menu item
--@param[opt="8"] cons.MenuFontSize font size of the menu items
--@param[opt="15"] cons.buttonsize size of the minimize and close buttons
--@param[opt="8"] cons.buttonFontSize font size of the minimize and close buttons
--@param[opt="10"] cons.padding how far is the inside element placed from the corner (depends also on the lockstyle setting)
--@param[opt="5"] cons.attachedMargin margin for the MainWindow border if an Adjustable2 container is attached
--@param cons.adjLabelstyle style of the main Label where all elements are in
--@param cons.menustyle menu items style
--@param cons.buttonstyle close and minimize buttons style
--@param[opt=false] cons.minimized minimized at creation?
--@param[opt=false] cons.locked locked at creation?
--@param[opt=false] cons.attached attached to a border at creation? possible borders are ("top", "bottom", "left", "right")
--@param cons.lockLabel.txt text of the "lock" menu item
--@param cons.minLabel.txt text of the "min/restore" menu item
--@param cons.saveLabel.txt text of the "save" menu item
--@param cons.loadLabel.txt text of the "load" menu item
--@param cons.attLabel.txt text of the "attached menu" item
--@param cons.lockStylesLabel.txt text of the "lockstyle menu" item
--@param cons.customItemsLabel.txt text of the "custom menu" item
--@param[opt="green"] cons.titleTxtColor color of the title text
--@param cons.titleText title text
--@param[opt="standard"] cons.lockStyle choose lockstyle at creation. possible integrated lockstyle are: "standard", "border", "light" and "full"
--@param[opt=false] cons.noLimit there is a minimum size limit if this constraint is set to false.
--@param[opt=true] cons.raiseOnClick raise your container if you click on it with your left mouse button
--@param[opt=true] cons.autoSave saves your container settings on exit (sysExitEvent). If set to false it won't autoSave
--@param[opt=true] cons.autoLoad loads the container settings (if there are some to load) at creation of the container. If set to false it won't load the settings at creation
function Adjustable2.Container:new(cons,container)
Adjustable2.Container.Locale = Adjustable2.Container.Locale or loadTranslations("AdjustableContainer")
cons = cons or {}
cons.type = cons.type or "Adjustable2container"
local me = self.parent:new(cons, container)
setmetatable(me, self)
self.__index = self
me.defaultDir = me.defaultDir or getMudletHomeDir().."/Adjustable2Container/"
me.ParentMenuWidth = me.ParentMenuWidth or "102"
me.ChildMenuWidth = me.ChildMenuWidth or "82"
me.MenuHeight = me.MenuHeight or "22"
me.MenuFontSize = me.MenuFontSize or "8"
me.buttonsize = me.buttonsize or "15"
me.buttonFontSize = me.buttonFontSize or "8"
me.padding = me.padding or 10
me.attachedMargin = me.attachedMargin or 5
me.adjLabelstyle = me.adjLabelstyle or [[
background-color: rgba(0,0,0,100%);
border: 4px double green;
border-radius: 4px;]]
me.menuStyleMode = "light"
me.buttonstyle= me.buttonstyle or [[
QLabel{ border-radius: 7px; background-color: rgba(255,30,30,100%);}
QLabel::hover{ background-color: rgba(255,0,0,50%);}
]]
me:createContainers()
me.att = me.att or {}
me:createLabels()
me:createRightClickMenu()
me:globalLockStyles()
me.minimized = me.minimized or false
me.locked = me.locked or false
me.adjLabelstyle = me.adjLabelstyle..[[ qproperty-alignment: 'AlignLeft | AlignTop';]]
me.lockLabel.txt = me.lockLabel.txt or [[<font size="5" face="Noto Emoji">🔒</font>]] .. self.Locale.lock.message
me.minLabel.txt = me.minLabel.txt or [[<font size="5" face="Noto Emoji">🗕</font>]] ..self.Locale.min_restore.message
me.saveLabel.txt = me.saveLabel.txt or [[<font size="5" face="Noto Emoji">💾</font>]].. self.Locale.save.message
me.loadLabel.txt = me.loadLabel.txt or [[<font size="5" face="Noto Emoji">📁</font>]].. self.Locale.load.message
me.attLabel.txt = me.attLabel.txt or [[<font size="5" face="Noto Emoji">⚓</font>]]..self.Locale.attach.message
me.lockStylesLabel.txt = me.lockStylesLabel.txt or [[<font size="5" face="Noto Emoji">🖌</font>]]..self.Locale.lockstyle.message
me.customItemsLabel.txt = me.customItemsLabel.txt or [[<font size="5" face="Noto Emoji">🖇</font>]]..self.Locale.custom.message
me.adjLabel:setStyleSheet(me.adjLabelstyle)
me.exitLabel:setStyleSheet(me.buttonstyle)
me.minimizeLabel:setStyleSheet(me.buttonstyle)
me:echoRightClickMenu()
me.adjLabel:setClickCallback("Adjustable2.Container.onClick",me, me.adjLabel)
me.adjLabel:setReleaseCallback("Adjustable2.Container.onRelease",me, me.adjLabel)
me.adjLabel:setMoveCallback("Adjustable2.Container.onMove",me, me.adjLabel)
me.minLabel:setClickCallback("Adjustable2.Container.onClickMin", me)
me.saveLabel:setClickCallback("Adjustable2.Container.onClickSave", me)
me.lockLabel:setClickCallback("Adjustable2.Container.onClickL", me)
me.loadLabel:setClickCallback("Adjustable2.Container.onClickLoad", me)
me.origh = me.height
me.exitLabel:setClickCallback("Adjustable2.Container.hideObj", me)
me.minimizeLabel:setClickCallback("Adjustable2.Container.onClickMin", me)
me.attLabel:setOnEnter("Adjustable2.Container.onEnterAtt", me)
me.goInside = true
me.titleTxtColor = me.titleTxtColor or "green"
me.titleText = me.titleText or me.name.." - Adjustable2 Container"
me.titleText = " "..me.titleText
shrink_title(me)
me.lockStyle = me.lockStyle or "standard"
me.noLimit = me.noLimit or false
if not(me.raiseOnClick == false) then
me.raiseOnClick = true
end
if not Adjustable2.Container.all[me.name] then
Adjustable2.Container.all_windows[#Adjustable2.Container.all_windows + 1] = me.name
else
--prevent showing the container on recreation if hidden is true
if Adjustable2.Container.all[me.name].hidden then
me:hide()
end
if Adjustable2.Container.all[me.name].auto_hidden then
me:hide(true)
end
-- detach if setting at creation changed
Adjustable2.Container.all[me.name]:detach()
end
if me.minimized then
me:minimize()
end
if me.locked then
me:lockContainer()
end
if me.attached then
local attached = me.attached
me.attached = nil
me:attachToBorder(attached)
end
-- hide/show on creation
if cons.hidden == true then
me:hide()
elseif cons.hidden == false then
me:show()
end
-- Loads on creation (by Name) if autoLoad is not false
if not(me.autoLoad == false) then
me.autoLoad = true
me:load()
end
-- Saves on Exit if autoSave is not false
if not(me.autoSave == false) then
me.autoSave = true
me:enableAutoSave()
end
Adjustable2.Container.all[me.name] = me
me:adjustBorder()
return me
end
-- Adjustable2 Container already uses add2 as it is essential for its functioning (especially for the autoLoad function)
-- added this wrapper for consistency
Adjustable2.Container.new2 = Adjustable2.Container.new
--- Overriden constructor to use the old add
-- if someone really wants to use the old add for Adjustable2 Container
-- use this function (not recommended)
-- or just create elements inside the Adjustable2 Container with the cons useAdd2 = false
function Adjustable2.Container:oldnew(cons, container)
cons = cons or {}
cons.useAdd2 = false
local me = self:new(cons, container)
return me
end
-- addressing empty locale in development version
if Adjustable2.Container.Locale == nil then
Adjustable2.Container['Locale'] = {}
Adjustable2.Container.Locale = {
lock = { message = "lock" },
min_restore = { message = "min_restore"},
save = { message = "save"},
load = { message = "load"},
attach = { message = "attach"},
lockstyle = { message = "lockstyle"},
custom = { message = "custom"},
}
end
|
object_tangible_deed_player_house_deed_emperors_house_deed = object_tangible_deed_player_house_deed_shared_emperors_house_deed:new {
}
ObjectTemplates:addTemplate(object_tangible_deed_player_house_deed_emperors_house_deed, "object/tangible/deed/player_house_deed/emperors_house_deed.iff")
|
local machine = script.Parent.Parent
local selection1Name = "Flavors"
local selection2Name = "FlavorsTwo"
local origModel = machine.Yogurt
local origTool = script["Frozen Yogurt"]
local instruction1 = "Select first flavor"
local instruction2 = "Select second flavor"
local function handleSelection1(obj, button)
obj.FillingOne.BrickColor = button.Color.Value
obj.FillingOne.Material = button.Material.Value
end
local function handleSelection2(obj, button)
obj.FillingTwo.BrickColor = button.Color.Value
obj.FillingTwo.Material = button.Material.Value
end
local module = game.ServerScriptService:FindFirstChild("FoodMachineHandler")
if not module then -- install script
module = script.FoodMachineHandler
module.Parent = game.ServerScriptService
else
script.FoodMachineHandler:Destroy()
end
require(module):Add(machine, selection1Name, selection2Name, origModel, origTool, instruction1, instruction2, handleSelection1, handleSelection2)
|
local lorem = [[lorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat sed diam
voluptua at vero eos et accusam et justo duo dolores et ea rebum stet clita
kasd gubergren no sea takimata sanctus est lorem ipsum dolor sit amet lorem
ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat sed diam voluptua at
vero eos et accusam et justo duo dolores et ea rebum stet clita kasd
gubergren no sea takimata sanctus est lorem ipsum dolor sit amet lorem ipsum
dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat sed diam voluptua at vero
eos et accusam et justo duo dolores et ea rebum stet clita kasd gubergren no
sea takimata sanctus est lorem ipsum dolor sit amet
duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat vel illum dolore eu feugiat nulla facilisis at vero eros
et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril
delenit augue duis dolore te feugait nulla facilisi lorem ipsum dolor sit
amet consectetuer adipiscing elit sed diam nonummy nibh euismod tincidunt ut
laoreet dolore magna aliquam erat volutpat
ut wisi enim ad minim veniam quis nostrud exerci tation ullamcorper suscipit
lobortis nisl ut aliquip ex ea commodo consequat duis autem vel eum iriure
dolor in hendrerit in vulputate velit esse molestie consequat vel illum
dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio
dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te
feugait nulla facilisi
nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum lorem ipsum dolor sit amet
consectetuer adipiscing elit sed diam nonummy nibh euismod tincidunt ut
laoreet dolore magna aliquam erat volutpat ut wisi enim ad minim veniam quis
nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
commodo consequat
duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat vel illum dolore eu feugiat nulla facilisis
at vero eos et accusam et justo duo dolores et ea rebum stet clita kasd
gubergren no sea takimata sanctus est lorem ipsum dolor sit amet lorem ipsum
dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat sed diam voluptua at vero
eos et accusam et justo duo dolores et ea rebum stet clita kasd gubergren no
sea takimata sanctus est lorem ipsum dolor sit amet lorem ipsum dolor sit
amet consetetur sadipscing elitr at accusam aliquyam diam diam dolore
dolores duo eirmod eos erat et nonumy sed tempor et et invidunt justo labore
stet clita ea et gubergren kasd magna no rebum sanctus sea sed takimata ut
vero voluptua est lorem ipsum dolor sit amet lorem ipsum dolor sit amet
consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat
consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat sed diam voluptua at vero eos et accusam et
justo duo dolores et ea rebum stet clita kasd gubergren no sea takimata
sanctus est lorem ipsum dolor sit amet lorem ipsum dolor sit amet consetetur
sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat sed diam voluptua at vero eos et accusam et justo duo
dolores et ea rebum stet clita kasd gubergren no sea takimata sanctus est
lorem ipsum dolor sit amet lorem ipsum dolor sit amet consetetur sadipscing
elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat sed diam voluptua at vero eos et accusam et justo duo dolores
et ea rebum stet clita kasd gubergren no sea takimata sanctus est lorem
ipsum dolor sit amet]]
SILE.registerCommand("lorem", function(options, content)
local words = tonumber(options.words) or 50
local s = ""
local t
while words > 1 do
if not t then t = lorem end
s = s .. string.match(t, "%w+%s+")
t = string.gsub(t, "%w+%s+", "", 1)
words = words - 1
end
SILE.typesetter:typeset(s)
SILE.typesetter:leaveHmode()
end)
|
-- oc3-ftp Server File (1.4)
-- This program should be ran on an OC computer.
-- For setup info, see README.md
local comp = require("component")
local ok, err = pcall(function()
local fs = require("filesystem")
local event = require("event")
local serialization = require("serialization")
local gpu = comp.gpu
local protectedFiles = {
"ftp-cc.lua",
".shrc",
"ftp-api.lua"
}
local monthes = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}
local drivePath = "/mnt/2ab"
local drive = fs.proxy("raid")
local modems = comp.list("modem")
--local drive = fs.proxy("raid")
local modemID = ""
local modem
for i, v in pairs(modems) do
modemID = i
modem = v
break
end
-- Messaging functions
local function successChecker(err)
if err then
return {err = err, success = false}
else
return {success = true}
end
end
local function reply(data, orgin)
data.type = "reply"
data.id = math.random(1, 10^6)
data.orginID = orgin
comp.invoke(modemID, "transmit", 889, 888, data)
end
-- File functions
local function isProtected(file)
for i, v in pairs(protectedFiles) do
if fs.name(file) == v then
return true
end
end
return false
end
local function readFile(file)
--print(drivePat, file)
local contents = ""
local lineNumber = 1
for line in io.lines(fs.concat("/mnt/2ab", file)) do
contents = contents .. line .. "\n"
lineNumber = lineNumber + 1
if lineNumber % 100 == 0 and lineNumber ~= 0 then
os.sleep(0.1)
end
end
return contents
end
-- Logging functions
local function formatMessage(p, message)
--print(os.date().day)
print(("%s %d, %d @ %d:%d:%d [%s] %s"):format(os.date("%b"), os.date("%d"), os.date("%Y"), os.date("%H"), os.date("%M"), os.date("%S"), p, message))
end
local function info(message)
gpu.setForeground(0x66b6ff)
formatMessage("INFO", message)
end
local function success(message)
gpu.setForeground(0x00ff00)
formatMessage("SUCCESS", message)
end
local function warn(message)
gpu.setForeground(0xff6d00)
formatMessage("WARN", message)
end
comp.invoke(modemID, "open", 888)
success("Server online!")
while true do
local event, _, channel, replyCh, message = event.pullMultiple("modem_message")
os.sleep(0.2)
if message.type == "request" then
if message.requestType == "list" then
info("Requestsed listing of " .. message.directory or "/")
local listing = drive.list(message.directory or "/")
success("Listed " .. #listing .. " files")
reply({content = serialization.serialize(listing)}, message.requestIdentifier)
elseif message.requestType == "listFormatted" then
info("Requested formatted listing of " .. message.directory or "/")
local listing = drive.list(message.directory or "/")
local formatted_listing = {}
for i, file in pairs(listing) do
if i ~= "n" then
local insert = {name = file, isDir = false, protected = false}
if isProtected(file) then
insert.protected = true
end
if string.sub(file, -1) == "/" then
insert.isDir = true
end
table.insert(formatted_listing, insert)
end
end
reply({content = serialization.serialize(formatted_listing)}, message.requestIdentifier)
elseif message.requestType == "ping" then
reply({content = "pong"})
elseif message.requestType == "isRestricted" then
if isProtected(message.path) then
reply({protected = true}, message.requestIdentifier)
else
reply({protected = false}, message.requestIdentifier)
end
elseif message.requestType == "delete" then
if isProtected(message.path) then
warn("User requested to delete a file that cannot be deleted, rejecting")
reply(successChecker("File is protected"))
else
if not drive.exists(message.path) then
warn("File not found")
reply(successChecker("File not found"))
else
drive.remove(message.path)
reply({success = true}, message.requestIdentifier)
end
end
elseif message.requestType == "upload" then
if isProtected(message.path) then
warn("User requested to edit a file that cannot be edited, rejecting")
reply(successChecker("File is protected"))
else
info("Requested upload of file to " .. message.path)
local file = drive.open(message.path, "w")
drive.write(file, message.contents)
drive.close(file)
success("Saved " .. #message.contents .. " bytes of text to " .. message.path)
reply({success = true}, message.requestIdentifier)
end
elseif message.requestType == "download" then
info("Requested download of file " .. message.path)
if drive.exists(message.path) then
local contents = readFile(message.path)
reply({success = true, content = contents}, message.requestIdentifier)
success("Sent " .. #contents .. " bytes")
else
warn("File not found")
reply(successChecker("File not found"), message.requestIdentifier)
end
end
end
end
end)
if not ok then
local computer = comp.computer
print(err)
for i = 1, 3 do
computer.beep(1750, 1)
os.sleep(0.7)
end
end
|
--# selene: allow(unused_variable)
---@diagnostic disable: unused-local
-- HID interface for Hammerspoon, controls and queries caps lock state
--
-- Portions sourced from (https://discussions.apple.com/thread/7094207).
---@class hs.hid
local M = {}
hs.hid = M
-- Checks the state of the caps lock via HID
--
-- Parameters:
-- * None
--
-- Returns:
-- * true if on, false if off
---@return boolean
function M.capslock.get() end
-- Assigns capslock to the desired state
--
-- Parameters:
-- * state - A boolean indicating desired state
--
-- Returns:
-- * true if on, false if off
---@return boolean
function M.capslock.set(state, ...) end
-- Toggles the state of caps lock via HID
--
-- Parameters:
-- * None
--
-- Returns:
-- * true if on, false if off
---@return boolean
function M.capslock.toggle() end
|
--[[--------------------------------------------------------------------------
Copyright (c) 2011, salesforce.com, inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--]]--------------------------------------------------------------------------
require 'net_utils'
logger = {}
local logroll = ''
function logger.logprint(...)
logroll = logroll .. '\n' .. os.date() .. ':' .. string.format(...)
end
-- Find your device id:
local response, code = http.request{url = "http://" .. hostname .. "/1.0/deviceid",
method = 'POST',
source = encode({imei = string.gsub(platform.imei(), "%.", "")})}
logger.device_id = response
function logger.publish()
assert (hostname, "hostname is nil")
local logServlet = "http://" .. hostname .. "/1.0/log"
local body, status = http.request{url = logServlet,
headers = {DEVICEID = logger.device_id},
method = "POST",
source = logroll}
assert (status == 201, "could not POST the log")
end
logger.originalprint = print
print = logger.logprint
function logger.restorePrint()
print = logger.originalprint
end
return logger
|
require "torch"
require('libimage')
--use_gfx=""
if use_gfx then -- This creates an uneccesary dependency - should move to gfx
require "gfx"
local function loadPng(filename,type,depth)
local surf=gfx.ImageSurface(filename);
if surf == nil then
return nil
end
if depth==nil then depth=4; end;
if not( depth==1 or depth==3 or depth==4) then
error('gfx: invalid depth');
end;
local x;
if depth==1 then
x = torch.Tensor(surf.width,surf.height);
-- Black & White
else
x = torch.Tensor(surf.width,surf.height, depth);
-- RGB or RGBA
end
surf:toTensor(x)
return x;
end
rawset(image, 'load', loadPng)
local function savePng(filename,x)
local surf = gfx.ImageSurface(x:size(1),x:size(2))
surf.lcairo_object:from_tensor(x);
surf.lcairo_object:write_to_png(filename)
end
rawset(image, 'save', savePng)
end
local function crop(src,dst,startx,starty,endx,endy)
if endx==nil then
return image.cropNoScale(src,dst,startx,starty);
else
local depth=0;
if src:nDimension()>2 then
depth=src:size(3);
end
local x=torch.Tensor(endx-startx,endy-starty,depth);
image.cropNoScale(src,x,startx,starty);
image.scale(x,dst);
end
end
rawset(image, 'crop', crop)
local function scale(src,dst,type)
if type=='bilinear' then
image.scaleBilinear(src,dst);
else
image.scaleSimple(src,dst);
end
end
rawset(image, 'scale', scale)
local function convolveInPlace(mysrc,kernel,pad_const)
local kH=kernel:size(1);
local kW=kernel:size(2);
local stepW=1;
local stepH=1;
local inputHeight =mysrc:size(1);
local outputHeight = (inputHeight-kH)/stepH + 1
local inputWidth = mysrc:size(2);
local outputWidth = (inputWidth-kW)/stepW + 1
-- create destination so it is the same size as input,
-- and pad input so convolution makes the same size
outputHeight=inputHeight;
outputWidth=inputWidth;
inputWidth=((outputWidth-1)*stepW)+kW;
inputHeight=((outputHeight-1)*stepH)+kH;
local src;
src=torch.Tensor(inputHeight,inputWidth);
src:zero(); src=src + pad_const;
image.translate(mysrc,src,math.floor(kW/2),math.floor(kH/2));
mysrc:zero();
mysrc:addT4dotT2(1,
src:unfold(1, kW, stepW):unfold(2, kH, stepH),
kernel)
return mysrc;
end
rawset(image, 'convolveInPlace', convolveInPlace)
local function convolveToDst(src,dst,kernel)
local kH=kernel:size(1);
local kW=kernel:size(2);
local stepW=1;
local stepH=1;
local inputHeight =src:size(1);
local outputHeight = (inputHeight-kH)/stepH + 1
local inputWidth = src:size(2);
local outputWidth = (inputWidth-kW)/stepW + 1
if dst==nil then
dst=torch.Tensor(outputHeight,outputWidth);
dst:zero();
end
dst:addT4dotT2(1,
src:unfold(1, kW, stepW):unfold(2, kH, stepH),
kernel)
return dst;
end
rawset(image, 'convolveToDst', convolveToDst)
local function convolve(p1,p2,p3)
if type(p3)=="number" then
image.convolveInPlace(p1,p2,p3)
else
image.convolveToDst(p1,p2,p3)
end
end
rawset(image, 'convolve', convolve)
-- Backwards compatibility functions (remove later)::
rawset(image, 'scale_bilinear', image.scaleBilinear)
rawset(image, 'crop_noscale', image.cropNoScale)
rawset(image, 'convolve_inplace', convolveInPlace)
|
-- rc.lua
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome libraries
local gfs = require("gears.filesystem")
local beautiful = require("beautiful")
local naughty = require("naughty")
require("awful.autofocus")
require("awful.hotkeys_popup")
require("awful.hotkeys_popup.keys")
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
naughty.connect_signal("request::display_error", function(message, startup)
naughty.notification {
urgency = "critical",
title = "Oops, an error happened" ..
(startup and " during startup!" or "!"),
message = message
}
end)
beautiful.init(gfs.get_configuration_dir() .. "theme.lua")
-- Import Configuration
require("configuration")
-- Import Daemons and Widgets
require("ui")
require("signals")
client = client
screen = screen
awesome = awesome
mouse = mouse
-- Garbage Collector Settings
collectgarbage("setpause", 110)
collectgarbage("setstepmul", 1000)
-- EOF ------------------------------------------------------------------------
|
local Name2Id = GetFileConfig(OUTPUTBASE .. "server/setting/item/itemtype2class.lua").Name2Id
return function (Data)
assert(Name2Id[Data], Data.."没有该类型,请确认相关物品表")
local Id = Name2Id[Data]
return Id
end
|
if not ngx then
ngx = {
log = print,
ERR = 0,
INFO = 0,
WARN = 0
}
end
local log = ngx.log
local ERR = ngx.ERR
local INFO = ngx.INFO
local WARN = ngx.WARN
local _M = {}
local function file_exists(file)
local f = io.open(file, "rb")
if f then
f:close()
end
return f ~= nil
end
function _M.file_get_lines(file)
if not file_exists(file) then
return nil, 'File does not exist'
end
local lines = {}
for line in io.lines(file) do
lines[#lines + 1] = line
end
return lines
end
function _M.log_info(...)
log(INFO, "imaging: ", ...)
end
function _M.log_warn(...)
log(WARN, "imaging: ", ...)
end
function _M.log_error(...)
log(ERR, "imaging: ", ...)
end
return _M
|
local Ships = PlayState:addState('Ships')
local PHASE_DURATION = 23.5 - 11.75
function Ships:enteredState()
if ANDROID or IOS then
-- Unlock achievement for reaching the ships state.
love.system.unlockAchievement(IDS.ACH_REACH_THE_SHIPS)
end
local stars = self:addEntity(Stars())
self:flashWhite(1.0)
self:addEntity(Ship('top', PHASE_DURATION, lume.random(-1, 1)))
local pos = lume.random(-1, 1)
self.timer:after(2, function()
self:addEntity(Ship('right', PHASE_DURATION - 2, pos))
end)
self.timer:after(4, function()
self:addEntity(Ship('left', PHASE_DURATION - 4, pos))
end)
self.timer:after(PHASE_DURATION, function()
for _, ship in ipairs(self:getEntitiesByTag('ship')) do
ship:destroy()
end
for _, bullet in ipairs(self:getEntitiesByTag('obstacle')) do
bullet:destroy()
end
stars:destroy()
self:gotoState('Tunnel')
end)
end
|
require("fucore.lib.entity")
require("fubelts.prototypes.item")
require("fubelts.prototypes.recipe")
require("fubelts.prototypes.technology")
|
require('notify').setup {
background_colour = '#000000',
}
vim.notify = require('notify')
|
object_mobile_col_forage_aggravated_worm = object_mobile_shared_col_forage_aggravated_worm:new {
}
ObjectTemplates:addTemplate(object_mobile_col_forage_aggravated_worm, "object/mobile/col_forage_aggravated_worm.iff")
|
local modpath = minetest.get_modpath(minetest.get_current_modname())
name_generator = dofile(modpath.."/namegen.lua")
--name_generator.parse_lines(io.lines(modpath.."/data/books.cfg"))
--name_generator.parse_lines(io.lines(modpath.."/data/creatures.cfg"))
--name_generator.parse_lines(io.lines(modpath.."/data/inns.cfg"))
--name_generator.parse_lines(io.lines(modpath.."/data/potions.cfg"))
--name_generator.parse_lines(io.lines(modpath.."/data/towns.cfg"))
local generate_examples = function()
for _, set in ipairs(name_generator.get_sets()) do
minetest.debug("set: " .. set)
local examples = "examples: "
for i = 1, 30 do
examples = examples .. name_generator.generate(set)
if i < 30 then
examples = examples .. ", "
end
end
minetest.debug(examples)
end
end
--generate_examples()
|
require( "components/cavern/cavern_encounter" )
--------------------------------------------------------------------
if encounter_special_serpent_wards == nil then
encounter_special_serpent_wards = class( {}, {}, CCavernEncounter )
end
--------------------------------------------------------------------
function encounter_special_serpent_wards:GetEncounterType()
return CAVERN_ROOM_TYPE_SPECIAL
end
--------------------------------------------------------------------
function encounter_special_serpent_wards:GetEncounterLevels()
return { 1, 2, 3, 4 }
end
--------------------------------------------------------------------
function encounter_special_serpent_wards:Start()
CCavernEncounter.Start( self )
--[[
local vLeftColumnStart = self.hRoom.vRoomCenter - 0.80*self.hRoom.vHalfX - 0.40*self.hRoom.vHalfY
local vRightColumnStart = self.hRoom.vRoomCenter + 0.80*self.hRoom.vHalfX - 0.40*self.hRoom.vHalfY
local vBottomRowStart = self.hRoom.vRoomCenter + 0.35*self.hRoom.vHalfX - 0.40*self.hRoom.vHalfY
local dx = 100
local dy = 150
for x=1,2 do
for y=1,5 do
local vPos = vLeftColumnStart + Vector(x*dx,0,0) + Vector(0,y*dy,0)
local hUnit = self:SpawnNonCreepByName( "npc_dota_creature_shadow_shaman_ward", vPos, false, nil, nil, DOTA_TEAM_BADGUYS )
local vPos = vRightColumnStart - Vector(x*dx,0,0) + Vector(0,y*dy,0)
local hUnit = self:SpawnNonCreepByName( "npc_dota_creature_shadow_shaman_ward", vPos, false, nil, nil, DOTA_TEAM_BADGUYS )
local vPos = vBottomRowStart - Vector(y*dy,0,0) - Vector(0,x*dx,0)
local hUnit = self:SpawnNonCreepByName( "npc_dota_creature_shadow_shaman_ward", vPos, false, nil, nil, DOTA_TEAM_BADGUYS )
end
end
--]]
local vLeftColumnStart = self.hRoom.vRoomCenter - 0.85*self.hRoom.vHalfX - 0.85*self.hRoom.vHalfY
local dx = 200
local dy = 200
for x=1,10 do
for y=1,7 do
local vPos = vLeftColumnStart + Vector(x*dx,0,0) + Vector(0,y*dy,0)
local hUnit = self:SpawnNonCreepByName( "npc_dota_creature_shadow_shaman_ward", vPos, false, nil, nil, DOTA_TEAM_BADGUYS )
end
end
return true
end
--------------------------------------------------------------------
|
--- 3D vector implementation in lua
-- Was created as inline library to use in Principia game
-- This file is mostly for documentation, you might want to use minified version in your code
-- Minified version https://github.com/mrsimb/lua-vec/blob/main/vec.min.lua
-- @author mrsimb https://github.com/mrsimb
Vec = {}
Vec.protomt = {}
Vec.mt = {}
Vec.mt.__index = Vec
setmetatable(Vec, Vec.protomt)
-- Static methods
--- Vec() constructor
-- @return Vec
-- @see Vec.from
function Vec.protomt:__call(x, y, z)
return Vec.from(x, y, z)
end
--- Constructs new vector. Call Vec() directly to achieve same result
-- @param x number | table | Vec = 0
-- @param y number = 0
-- @param z number = 0
-- @return Vec
-- @usage Vec(1, 0, 0)
-- @usage Vec({1, 0, 0})
-- @usage Vec({x = 1, y = 0, z = 0})
-- @usage Vec(anotherVector)
function Vec.from(x, y, z)
if (type(x) == 'table') then
return Vec.from(x.x or x[1], x.y or x[2], x.z or x[3])
end
local v = {}
v.x = x or 0
v.y = y or 0
v.z = z or 0
setmetatable(v, Vec.mt)
return v
end
--- Returns normalized vector from 2D angle
-- @param a number = 0
-- @return Vec
-- @usage Vec.fromAngle(0) -> {1, 0, 0}
function Vec.fromAngle(a)
return Vec.from(math.cos(a or 0), math.sin(a or 0))
end
--- Returns normalized vector from random 2D angle
-- @return Vec
function Vec.random2d()
local a = math.random() * math.pi * 2;
return Vec.fromAngle(a)
end
--- Returns normalized random vector
-- @return Vec
function Vec.random()
return Vec(
math.random() * 2 - 1,
math.random() * 2 - 1,
math.random() * 2 - 1
):norm()
end
-- Metamethods
--- + operator
-- @param v number | table | Vec
-- @return Vec
-- @usage Vec(1, 2, 3) + 10 -> {11, 12, 13}
-- @usage Vec(1, 2, 3) + Vec(10, 0, 0) -> {11, 2, 3}
-- @see Vec:add
function Vec.mt:__add(v)
return self:add(v, v, v)
end
--- - operator (binary)
-- @param v number | table | Vec
-- @return Vec
-- @usage Vec(1, 2, 3) - 10 -> {-8, -7, -6}
-- @usage Vec(1, 2, 3) - Vec(10, 0, 0) -> {-8, 2, 3}
-- @see Vec:sub
function Vec.mt:__sub(v)
return self:sub(v, v, v)
end
--- - operator (unary)
-- @usage -Vec(1, 2, 3) -> {-1, -2, -3}
-- @return Vec
function Vec.mt:__unm()
return self:mul(-1, -1, -1)
end
--- * operator
-- @param v number | table | Vec
-- @return Vec
-- @usage Vec(1, 2, 3) * 10 -> {10, 20, 30}
-- @usage Vec(1, 2, 3) * Vec(10, 1, 1) -> {10, 2, 3}
-- @see Vec:mul
function Vec.mt:__mul(v)
return self:mul(v, v, v)
end
--- / operator
-- @param v number | table | Vec
-- @return Vec
-- @usage Vec(1, 2, 3) / 10 -> {0.1, 0.2, 0.3}
-- @usage Vec(1, 2, 3) / Vec(10, 1, 1) -> {0.1, 2, 3}
-- @see Vec:div
function Vec.mt:__div(v)
return self:div(v, v, v)
end
--- ^ operator
-- @param v number | table | Vec
-- @return Vec
-- @usage Vec(1, 2, 3) ^ 2 -> {1, 4, 9}
-- @usage Vec(1, 2, 3) ^ Vec(1, 1, 2) -> {1, 2, 9}
-- @see Vec:pow
function Vec.mt:__pow(v)
return self:pow(v, v, v)
end
--- == operator
-- @param v Vec
-- @return boolean Vector equals to input
-- @usage Vec(1, 2, 3) == Vec(1, 2, 3) -> true
-- @see Vec:eq
function Vec.mt:__eq(v)
return self:eq(v)
end
--- < operator
-- @param v Vec
-- @return boolean Vector magnitude is less than input
-- @usage Vec(1, 2, 3) < Vec(3, 3, 3) -> true
-- @see Vec:lt
function Vec.mt:__lt(v)
return self:lt(v)
end
--- <= operator
-- @param v Vec
-- @return boolean Vector magnitude is less than or equal to input
-- @usage Vec(1, 2, 3) <= Vec(3, 3, 3) -> true
-- @see Vec:lt
function Vec.mt:__le(v)
return self:le(v)
end
--- .. operator
-- @param a string | Vec
-- @param b string | Vec
-- @return string
-- @usage 'Position is ' .. Vec(1, 2, 3) -> 'Position is {1, 2, 3}'
function Vec.mt.__concat(a, b)
return tostring(a) .. tostring(b)
end
--- tostring()
-- @return string
-- @usage print(Vec(1, 2, 3)) -> '{1, 2, 3}'
function Vec.mt:__tostring()
return self:toString()
end
-- Public methods
--- Sets vector components to input. Accepts numbers, table or Vec
-- @param x number | table | Vec = self.x
-- @param y number = self.y
-- @param z number = self.z
-- @return Vec self
-- @usage Vec(1, 2, 3):set(10) -> {10, 2, 3}
-- @usage Vec(1, 2, 3):set(nil, nil, 10) -> {1, 2, 10}
function Vec:set(x, y, z)
local v = Vec.from(x or self.x, y or self.y, z or self.z)
self.x = v.x
self.y = v.y
self.z = v.z
return self
end
--- Returns string representation of vector
-- @return string
-- @usage Vec(1, 2, 3):toString() -> '{1, 2, 3}'
function Vec:toString()
return '{' .. self.x .. ', ' .. self.y .. ', ' .. self.z .. '}'
end
--- Returns array of vector components
-- @return table
-- @usage Vec(1, 2, 3):toArray() -> {1, 2, 3}
function Vec:toArray()
return {self.x, self.y, self.z}
end
--- Sets vector component by numeric index
-- @param idx number Index of component
-- @param n number New value
-- @return Vec
-- @usage Vec(5, 6, 7):setAt(3, 10) -> {5, 6, 10}
function Vec:setAt(idx, n)
if (idx == 1) then
self.x = n
elseif (idx == 2) then
self.y = n
elseif (idx == 3) then
self.z = n
end
end
--- Gets vector component value by numeric index
-- @param idx number Index of component
-- @return number
-- @usage Vec(5, 6, 7):getAt(3) -> 7
function Vec:getAt(idx)
if (idx == 1) then
return self.x
elseif (idx == 2) then
return self.y
elseif (idx == 3) then
return self.z
end
end
--- Returns vectors sum
-- @param x number | table | Vec = 0
-- @param y number = 0
-- @param z number = 0
-- @return Vec
-- @usage Vec(1, 2, 3):add(10) -> {11, 2, 3}
-- @usage Vec(1, 2, 3):add(10, 10, 10) -> {11, 12, 13}
function Vec:add(x, y, z)
local v = Vec.from(x or 0, y or 0, z or 0)
return Vec.from(self.x + v.x, self.y + v.y, self.z + v.z)
end
--- Returns vectors difference
-- @param x number | table | Vec = 0
-- @param y number = 0
-- @param z number = 0
-- @return Vec
-- @usage Vec(1, 2, 3):sub(10) -> {-9, 2, 3}
-- @usage Vec(1, 2, 3):sub(10, 10, 10) -> {-9, -8, -7}
function Vec:sub(x, y, z)
local v = Vec.from(x or 0, y or 0, z or 0)
return Vec.from(self.x - v.x, self.y - v.y, self.z - v.z)
end
--- Returns vector whose components are multiplicated by input
-- @param x number | table | Vec = 1
-- @param y number = 1
-- @param z number = 1
-- @return Vec
-- @usage Vec(1, 2, 3):mul(10) -> {10, 2, 3}
-- @usage Vec(1, 2, 3):mul(10, 10, 10) -> {10, 20, 30}
function Vec:mul(x, y, z)
local v = Vec.from(x or 1, y or 1, z or 1)
return Vec.from(self.x * v.x, self.y * v.y, self.z * v.z)
end
--- Returns vector whose components are divided by input
-- @param x number | table | Vec = 1
-- @param y number = 1
-- @param z number = 1
-- @return Vec
-- @usage Vec(1, 2, 3):div(10) -> {0.1, 2, 3}
-- @usage Vec(1, 2, 3):div(10, 10, 10) -> {0.1, 0.2, 0.3}
function Vec:div(x, y, z)
local v = Vec.from(x or 1, y or 1, z or 1)
return Vec.from(self.x / v.x, self.y / v.y, self.z / v.z)
end
--- Returns vector whose components are raised by input
-- @param x number | table | Vec = 1
-- @param y number = 1
-- @param z number = 1
-- @return Vec
-- @usage Vec(2, 3, 4):pow(3) -> {8, 3, 4}
-- @usage Vec(2, 3, 4):pow(3, 3, 3) -> {8, 27, 64}
function Vec:pow(x, y, z)
local v = Vec.from(x or 1, y or 1, z or 1)
return Vec.from(self.x ^ v.x, self.y ^ v.y, self.z ^ v.z)
end
--- Returns true if vector and input are equal
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return boolean
-- @usage Vec(2, 3, 4):eq(2, 3, 4) -> true
function Vec:eq(x, y, z)
local v = Vec.from(x, y, z)
return self.x == v.x and self.y == v.y and self.z == v.z
end
--- Returns true if vector magnitude is less than input
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return Vec
-- @usage Vec(2, 3, 4):lt(10, 10, 10) -> true
function Vec:lt(x, y, z)
return self:len() < Vec.from(x, y, z):len()
end
--- Returns true if vector magnitude is less than or equal to input
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return boolean
-- @usage Vec(2, 3, 4):le(10, 10, 10) -> true
function Vec:le(x, y, z)
return self:len() <= Vec.from(x, y, z):len()
end
--- Returns true if vector magnitude is greater than input
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return boolean
-- @usage Vec(2, 3, 4):gt(0, 0, 0) -> true
function Vec:gt(x, y, z)
return self:len() > Vec.from(x, y, z):len()
end
--- Returns true if vector magnitude is greater than or equal to input
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return boolean
-- @usage Vec(2, 3, 4):ge(0, 0, 0) -> true
function Vec:ge(x, y, z)
return self:len() >= Vec.from(x, y, z):len()
end
--- Returns vector magnitude (length)
-- @return number
-- @usage Vec(10, 0, 0):len() -> 10
function Vec:len()
return math.sqrt(self:lenSq())
end
--- Returns vector magnitude (length) squared
-- @return number
-- @usage Vec(10, 0, 0):len() -> 100
function Vec:lenSq()
return self.x ^ 2 + self.y ^ 2 + self.z ^ 2
end
--- Returns distance beetween vectors
-- @return number
-- @usage Vec(10, 0, 0):dist(15, 0, 0) -> 5
function Vec:dist(x, y, z)
return math.sqrt(self:distSq(x, y, z))
end
--- Returns distance squared between vectors
-- @return number
-- @usage Vec(10, 0, 0):distSq(15, 0, 0) -> 25
function Vec:distSq(x, y, z)
local v = Vec.from(x, y, z)
return self:sub(v):lenSq()
end
--- Returns vectors cross product
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return Vec
-- @usage Vec(3, -3, 1):cross(4, 9, 2) -> {-15, -2, 39}
function Vec:cross(x, y, z)
local v = Vec.from(x, y, z)
return Vec.from(
self.y * v.z - self.z * v.y,
self.z * v.x - self.x * v.z,
self.x * v.y - self.y * v.x
)
end
--- Returns vectors dot product
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return number
-- @usage Vec(1, 2, 3):cross(6, 7, 8) -> 44
function Vec:dot(x, y, z)
local v = Vec.from(x, y, z)
return self.x * v.x + self.y * v.y + self.z * v.z
end
--- Returns normalized vector
-- @return Vec
-- @usage Vec(10, 5, 0):norm() -> {0.89442719099992, 0.44721359549996, 0}
function Vec:norm()
local len = self:len()
return len == 0 and self or self / len
end
--- Returns vector with magnitude limited by number
-- @param n number
-- @return Vec
-- @usage Vec(10, 5, 0):limit(2) -> {0.97014250014533, 0.24253562503633, 0}
function Vec:limit(n)
return self:norm():mul(n)
end
--- Returns 2D rotation angle of vector
-- @return number
-- @usage Vec(-1, 0, 0):angle2d() -> 3.1415926535898
function Vec:angle2d()
return math.atan2(self.y, self.x)
end
--- Returns angle between 3D vectors
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return number
function Vec:angleBetween(x, y, z)
local v = Vec.from(x, y, z)
return math.acos(self:dot(v) / (self:len() * v:len()))
end
--- Returns vector with 2D rotation applied to it
-- @param a number
-- @return Vec
function Vec:rotate2d(a)
local v = Vec.from(self)
local na = self:angle2d() + a
local m = self:len()
v.x = math.cos(na) * m
v.y = math.sin(na) * m
return v
end
--- Returns linear interpolation between vectors
-- @param n number
-- @param x number | table | Vec
-- @param y number
-- @param z number
-- @return Vec
-- @usage Vec(10, -10, 2):lerp(0.5, {20, 10, 1}) -> {15, 0, 1.5}
function Vec:lerp(n, x, y, z)
local v = Vec.from(x, y, z)
return Vec.from(
self.x + (v.x - self.x) * n,
self.y + (v.y - self.y) * n,
self.z + (v.z - self.z) * n
)
end
|
--[[
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]--
-- This is aaa.lua - AAA filter with email validation.
-- It checks that an oauth validated email account matches *@foocorp.com and if
-- so, grants access to private emails.
-- To use this as your AAA lib, replace aaa.lua in site/api/lib with this file.
local config = require 'lib/config'
-- validated emails ending with @foocorp.com have access to all private emails
-- This is a GLOB, so could also be *@internal.foocorp.com, or *[email protected] etc
-- This AAA module requires strcmp_match which is only found in Apache httpd currently.
local valid_email = "*@foocorp.com"
local grant_access_to = "*" -- use * for access to all, or specify a (sub)domain to grant access to
local useAlternates = false -- also check against alternate email addresses??
-- Is email a valid foocorp email?
local function validateEmail(r, email)
-- do a GLOB match, testing email aginst valid_email
if r:strcmp_match(valid_email, email) then
return true
end
return false
end
-- Get a list of domains the user has private email access to (or wildcard if org member)
local function getRights(r, usr)
local email = usr.credentials.email or "|||"
local xemail = email:match("([-a-zA-Z0-9._@]+)") -- whitelist characters
local rights = {}
-- bad char in email?
if not email or xemail ~= email then
return rights
end
-- first, check against primary address
local validEmail = validateEmail(r, email)
-- if enabled, check against alternates
if useAlternates then
if usr and usr.credentials and type(usr.credentials.altemail) == "table" then
for k, v in pairs(usr.credentials.altemail) do
if validateEmail(r, v.email) then
validEmail = true
break
end
end
end
end
-- Check if email matches foocorp.com
if usr.internal.admin or validateEmail(r, email) then
table.insert(rights, grant_access_to)
end
return rights
end
-- module defs
return {
validateParams = true,
rights = getRights
}
|
-- @Author:pandayu
-- @Version:1.0
-- @DateTime:2018-09-09
-- @Project:pandaCardServer CardGame
-- @Contact: QQ:815099602
local fund_config = require "game.template.fund"
local _M = function(role,data)
if not data.id then data.id = 2 end
data.id = tonumber(data.id)
local pass = role.base:can_fund_reward(data.id)
if not pass then return 3006 end
local profit = fund_config:get_fund_reward_profit(data.id)
role:gain_resource(profit)
role.base:add_fund_reward(data.id)
return 0,{data = profit}
end
return _M
|
--example, how to use
-- local opts = {
-- nwr = {3, 2, 2},
-- ak_sk = {'accesskey', 'secret_key'},
-- timeouts = {1, 1, 1},
-- }
-- local cli = redis_proxy_cli:new({{ip, port}}, opts)
--
-- "retry(another N times) is optional"
-- cli:get(key, retry)
-- E.g. cli:get('key1')
-- E.g. cli:get('key1', 1)
--
-- "expire(msec) and retry(another N times) are optional"
-- cli:set(key, val, expire, retry)
-- E.g. cli:set('key1', 'val1')
-- E.g. cli:set('key1', 'val1', 1000)
-- E.g. cli:set('key1', 'val1', nil, 2)
-- E.g. cli:set('key1', 'val1', 1000, 2)
--
-- "retry(another N times) is optional"
-- cli:hget(hashname, hashkey, retry)
-- E.g. cli:hget('hashname1', 'hashkey1')
-- E.g. cli:hget('hashname1', 'hashkey1', 2)
--
-- "expire(msec) and retry(another N times) are optional"
-- cli:hset(hashname, hashkey, val, expire, retry)
-- E.g. cli:hset('hashname1', 'hashkey1', 'val')
-- E.g. cli:hset('hashname1', 'hashkey1', 'val', 1000)
-- E.g. cli:hset('hashname1', 'hashkey1', 'val', nil, 2)
-- E.g. cli:hset('hashname1', 'hashkey1', 'val', 1000, 2)
local http_cli = require("acid.httpclient")
local aws_signer = require('resty.awsauth.aws_signer')
local tableutil = require('acid.tableutil')
local strutil = require('acid.strutil')
local json = require('acid.json')
local _M = { _VERSION = '1.0' }
local mt = { __index = _M }
local to_str = strutil.to_str
-- cmd: {"redis operation", "http method", "args count", "optional args names"}
local cmds = {
get = {"get", "GET", 2, {}},
set = {"set", "PUT", 4, {"expire"}},
hget = {"hget", "GET", 3, {}},
hset = {"hset", "PUT", 5, {"expire"}},
hkeys = {"keys", "GET", 2, {}},
hvals = {"hvals", "GET", 2, {}},
hgetall = {"hgetall", "GET", 2, {}},
delete = {"del", "DELETE", 2, {}},
hdel = {"hdel", "DELETE", 3, {}},
}
local function _sign_req(rp_cli, req)
if rp_cli.access_key == nil or rp_cli.secret_key == nil then
return nil, nil, nil
end
local signer, err, errmsg = aws_signer.new(rp_cli.access_key,
rp_cli.secret_key,
{default_expires = 600})
if err ~= nil then
return nil, err, errmsg
end
local opts = {
query_auth = true,
sign_payload = (req['body'] ~= nil),
}
return signer:add_auth_v4(req, opts)
end
local function _make_req_uri(rp_cli, params, opts, qs_values)
local path = tableutil.extends({rp_cli.ver}, params)
local qs_list = {
string.format('n=%s', rp_cli.n),
string.format('w=%s', rp_cli.w),
string.format('r=%s', rp_cli.r),
}
for i = 1, #opts do
if opts[i] ~= nil and qs_values[i] ~= nil then
table.insert(qs_list, string.format('%s=%s', opts[i], qs_values[i]))
end
end
return string.format(
'%s?%s',
table.concat(path, '/'),
table.concat(qs_list, '&')
)
end
local function _req(rp_cli, ip, port, request)
local req = tableutil.dup(request, true)
req['headers'] = req['headers'] or {}
if req['headers']['Host'] == nil then
req['headers']['Host'] = string.format('%s:%s', ip, port)
end
if req['body'] ~= nil then
req['headers']['Content-Length'] = #req['body']
end
local _, err, errmsg = _sign_req(rp_cli, req)
if err ~= nil then
return nil, err, errmsg
end
local cli = http_cli:new(ip, port, rp_cli.timeouts)
local req_opts = {
method = req['verb'],
headers = req['headers'],
body = req['body'],
}
local _, err, errmsg = cli:request(req['uri'], req_opts)
if err ~= nil then
return nil, err, errmsg
end
local res, err, errmsg = cli:read_body(100*1024*1024)
if err ~= nil then
return nil, err, errmsg
end
if cli.status == 404 then
return nil, 'KeyNotFoundError', to_str('Uri:', req['uri'])
elseif cli.status ~= 200 then
return nil, 'ServerResponseError', to_str('Res:', res, ' Uri:', req['uri'])
end
return res, nil, nil
end
local function can_proxy(proxy_hosts, verb, err)
if #proxy_hosts == 0 then
return false
end
if verb == 'PUT' and err == nil then
return true
end
if verb == 'GET' and err ~= nil then
return true
end
return false
end
local function _send_req(rp_cli, request)
local rst, err, errmsg
for _, h in ipairs(rp_cli.hosts) do
local ip, port = h[1], h[2]
rst, err, errmsg = _req(rp_cli, ip, port, request)
if err == nil then
break
end
end
if not can_proxy(rp_cli.proxy_hosts, request.verb, err) then
return rst, err, errmsg
end
for _, hosts in ipairs(rp_cli.proxy_hosts) do
ngx.log(ngx.INFO, to_str("send req to proxy hosts:", hosts))
for _, h in ipairs(hosts) do
local ip, port = h[1], h[2]
rst, err, errmsg = _req(rp_cli, ip, port, request)
if err == nil then
break
end
end
if not can_proxy(rp_cli.proxy_hosts, request.verb, err) then
break
end
end
ngx.log(ngx.INFO, to_str("finish send req to proxy hosts error:", err, ",", errmsg))
return rst, err, errmsg
end
local function _parse_args(cmd, args, args_cnt, http_mtd, opts)
local path = {string.upper(cmd)}
-- (args count) - (#opts) - "retry"
local path_args_cnt = args_cnt - #opts - 1
if http_mtd == "PUT" then
-- remove body
path_args_cnt = path_args_cnt - 1
end
for _ = 1, path_args_cnt do
table.insert(path, args[1])
table.remove(args, 1)
end
local body
if http_mtd == "PUT" then
body = args[1]
table.remove(args, 1)
end
local retry
if #args > #opts then
retry = args[#args]
table.remove(args, #args)
end
return path, args, body, retry
end
local function _do_cmd(rp_cli, cmd, ...)
ngx.log(ngx.INFO, to_str("start do cmd:", cmd))
local cmd_info = cmds[cmd]
if cmd_info == nil then
local support_keys = tableutil.keys(cmds)
return nil, 'NotSupportCmd', to_str(cmd, ' not in ', support_keys)
end
local args = {...}
local http_mtd, args_cnt, opts = cmd_info[2], cmd_info[3], cmd_info[4]
local path, qs_values, body, retry = _parse_args(cmd_info[1], args, args_cnt, http_mtd, opts)
local req = {
verb = http_mtd,
uri = _make_req_uri(rp_cli, path, opts, qs_values),
}
local res, err, errmsg
if body ~= nil then
req['body'], err = json.enc(body)
if err ~= nil then
return nil, err, to_str("json encode error:", body)
end
end
retry = retry or 0
for _ = 1, retry + 1 do
res, err, errmsg = _send_req(rp_cli, req)
if err == nil then
break
end
end
if err ~= nil then
return nil, err, errmsg
end
if http_mtd == 'GET' then
res, err = json.dec(res)
if err ~= nil then
return nil, err, to_str("json decode error:", res)
end
return res, nil, nil
end
return nil, nil, nil
end
function _M.new(_, hosts, opts)
opts = opts or {}
local nwr = opts.nwr or {3, 2, 2}
local ak_sk = opts.ak_sk or {}
local n, w, r = nwr[1], nwr[2], nwr[3]
local access_key, secret_key = ak_sk[1], ak_sk[2]
return setmetatable({
ver = '/redisproxy/v1',
hosts = hosts,
proxy_hosts = opts.proxy_hosts or {},
n = n,
w = w,
r = r,
access_key = access_key,
secret_key = secret_key,
timeouts = opts.timeouts,
}, mt)
end
for cmd, _ in pairs(cmds) do
_M[cmd] = function (self, ...)
return _do_cmd(self, cmd, ...)
end
end
return _M
|
local Doors = {}
AddEvent("OnPackageStart", function()
log.info("Loading interactive doors...")
local _table = File_LoadJSONTable("packages/" .. GetPackageName() .. "/doors/doors.json")
for _, config in pairs(_table) do
CreateInteractiveDoor(config)
end
end)
AddEvent("OnPackageStop", function()
log.info "Destroying all interactive doors..."
for door in pairs(Doors) do
Doors[door] = nil
DestroyDoor(door)
end
end)
function CreateInteractiveDoor(config)
log.debug("Creating interactive door")
local door = CreateDoor(config['doorID'], config['x'], config['y'], config['z'], config['yaw'], true)
SetDoorOpen(door, true) -- close door by default (should be false according to wiki)
SetDoorPropertyValue(door, "owner", "12345") -- GetPlayerSteamId(player)
Doors[door] = true
end
AddEvent("OnPlayerInteractDoor", function(player, door, bWantsOpen)
local bWantsOpen = not bWantsOpen -- the door open state here is backwards (bug in onset)
local bIsDoorOpen = not IsDoorOpen(door) -- again, is backwards (bugged)
debug(player, "Door: " .. door .. ", open: ".. tostring(bIsDoorOpen) ..", wants: ".. tostring(bWantsOpen))
local owner = GetDoorPropertyValue(door, "owner")
if not bIsDoorOpen and GetPlayerSteamId(player) ~= GetDoorPropertyValue(door, "owner") then
-- door is locked
CallRemoteEvent(player, "ShowError", "Locked")
return
end
SetDoorOpen(door, bWantsOpen)
end)
AddCommand("closedoors", function(player)
for k, v in pairs(GetAllDoors()) do
debug(player, dump(IsDoorOpen(v)))
SetDoorOpen(v, false)
end
end)
|
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ───────────────────────────────────────────────── --
-- Plugin: alpha-nvim
-- Github: github.com/goolord/alpha-nvim
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
local function footer()
local plugins = #vim.tbl_keys(packer_plugins)
local v = vim.version()
return string.format("\n\n %s plugins v%s.%s.%s ", plugins, v.major, v.minor, v.patch)
end
local function pick_color()
local colors = {"String", "Identifier", "Keyword", "Number"}
return colors[math.random(#colors)]
end
-- Set header
dashboard.section.header.val = {
" ",
" ",
" ",
" ",
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
" ",
" ",
" ",
" ",
" ",
}
dashboard.section.header.opts.hl = pick_color()
-- Set menu
dashboard.section.buttons.val = {
dashboard.button("r", " > Recent", ":Telescope oldfiles<CR>"),
dashboard.button("t", " > Find text", ":Telescope live_grep <CR>"),
dashboard.button("f", " > Find file", ":Telescope find_files<CR>"),
dashboard.button("s", " > Settings", ":e ~/.config/nvim/init.lua<CR>"),
dashboard.button("u", " > Update Plugins", ":PackerSync <CR>"),
dashboard.button("q", " > Quit NVIM", ":qa<CR>")
}
dashboard.section.footer.val = footer()
dashboard.section.footer.opts.hl = dashboard.section.header.opts.hl
dashboard.config.layout[1].val = 1
-- Send config to alpha
alpha.setup(dashboard.opts)
-- Disable folding on alpha buffer
vim.cmd([[
autocmd FileType alpha setlocal nofoldenable
]])
|
local logging = require("logging")
local tg_logger = logging.new(
function(self, level, msg)
if type(bot) == "table" then
bot.sendMessage(config.monitor, ("*[%s]*\n```\n%s\n```"):format(level, msg), "Markdown")
end
return true
end
)
tg_logger:setLevel(logging.WARN)
local logger = logging.new(
function(self, level, msg)
print(("%s | %-7s | %s"):format(
os.date("%Y-%m-%d %H:%M:%S", os.time() + 8 * 3600),
level,
msg:gsub("%s+", " ")
))
tg_logger:log(level, msg)
return true
end
)
logger:setLevel(logging.DEBUG)
return logger
|
function ends_in_3(num)
return num % 10 == 3
end
print(ends_in_3(13))
print(ends_in_3(20))
|
-- Kills the specified historical figure
--[====[
devel/kill-hf
=============
Kills the specified historical figure, even if off-site, or terminates a
pregnancy. Useful for working around :bug:`11549`.
Usage::
devel/kill-hf [-p|--pregnancy] [-n|--dry-run] HISTFIG_ID
Arguments:
``histfig_id``:
the ID of the historical figure to target
``-p``, ``--pregnancy``:
if specified, and if the historical figure is pregnant, terminate the
pregnancy instead of killing the historical figure
``-n``, ``--dry-run``:
if specified, only print the name of the historical figure
]====]
local target_hf = -1
local target_pregnancy = false
local dry_run = false
for _, arg in ipairs({...}) do
if arg == '-p' or arg == '--pregnancy' then
target_pregnancy = true
elseif arg == '-n' or arg == '--dry-run' then
dry_run = true
elseif tonumber(arg) and target_hf == -1 then
target_hf = tonumber(arg)
else
qerror('unrecognized argument: ' .. arg)
end
end
local hf = df.historical_figure.find(target_hf)
or qerror('histfig not found: ' .. target_hf)
local hf_name = dfhack.df2console(dfhack.TranslateName(hf.name))
local hf_desc = ('%i: %s (%s)'):format(target_hf, hf_name, dfhack.units.getRaceNameById(hf.race))
if dry_run then
print('Would target histfig ' .. hf_desc)
return
end
if target_pregnancy then
hf.info.wounds.childbirth_year = -1
hf.info.wounds.childbirth_tick = -1
print('Terminated pregnancy of histfig ' .. hf_desc)
else
hf.old_year = df.global.cur_year
hf.old_seconds = df.global.cur_year_tick + 1
hf.died_year = df.global.cur_year
hf.died_seconds = df.global.cur_year_tick + 1
print('Killed histfig ' .. hf_desc)
end
|
require "bots/data/ability_data"
require "bots/dota2_nn/util"
local function ChooseHeroes()
-- selects heroes for all the bots
local ids = GetTeamPlayers(GetTeam())
util.Debug("selecting team composition")
local team = ability_data.teams[RandomInt(1, #ability_data.teams)][GetTeam()]
util.Debug("assigning heroes: ")
for i, id in ipairs(ids) do
if IsPlayerBot(id) then
util.Debug(i)
util.Debug(id .. " (" .. i .. "): " .. team[i])
SelectHero(id, team[i])
end
end
heroesSelected = true
end
function Think()
ChooseHeroes()
Think = function() end
end
|
pix = lepton.pixCreate(30,30,1)
lepton.pixClearAll(pix)
lepton.pixSetPixel(pix,10,10,1)
out = lepton.pixDilateBrick(nil,pix,18,18)
lepton.pixWritePng("out_l.png",out,1.0)
|
--region supers_Tester.lua
--Author : jefflwq
--Date : 2016/03/02
--说明 : supers 的测试程序
--endregion
if true then --false:启用测试, true:禁用测试(测试无问题后请设为true)
return
end
using "Joop"
using "System.Tester"
import "System.CType"
import "System.Drawing.CColor"
import "System.Drawing.EColor"
namespace "Testers.Keyword.SupersTester"
{
static_class "supers_Tester" : CJoopTester
{
IsEnabled = true,
OnTest =
function(self, ...)
local obj = CMultiSuper()
Print(obj:GetJoopTypeName()) --true, false
--obj:SetColor(EColor.Red)
Print(obj.RGB, obj.R, obj.G, obj.B)
local obj2 = CMultiSuper2()
local obj3 = CMultiSuper3()
local obj4 = CMultiSuper4()
print("CBase1:IsTypeOf(obj2)", CBase1:IsTypeOf(obj2))
print("CBase2:IsTypeOf(obj2)", CBase2:IsTypeOf(obj2))
print("CBase3:IsTypeOf(obj2)", CBase3:IsTypeOf(obj2))
print("CBase4:IsTypeOf(obj2)", CBase4:IsTypeOf(obj2))
print("CBase1:IsTypeOf(obj3)", CBase1:IsTypeOf(obj3))
print("CBase2:IsTypeOf(obj3)", CBase2:IsTypeOf(obj3))
print("CBase3:IsTypeOf(obj3)", CBase3:IsTypeOf(obj3))
print("CBase4:IsTypeOf(obj3)", CBase4:IsTypeOf(obj3))
print("CBase1:IsTypeOf(obj4)", CBase1:IsTypeOf(obj4))
print("CBase2:IsTypeOf(obj4)", CBase2:IsTypeOf(obj4))
print("CBase3:IsTypeOf(obj4)", CBase3:IsTypeOf(obj4))
print("CBase4:IsTypeOf(obj4)", CBase4:IsTypeOf(obj4))
--Print(obj.super[CType].GetJoopTypeName())
end,
--你可以定义这个函数以指定传递给OnTest的参数
--GetSpecifiedParams =
--function(self, ...)
--return "SpecifiedParam1", "SpecifiedParam2"
--end,
},
class "CMultiSuper" : supers(CType, CColor)
{
CMultiSuper =
function(self)
CType.CType(self, self)
CColor.CColor(self, 0.1, 0.2, 0.3, 0.5)
end,
},
class "CBase1"
{
},
class "CBase2"
{
},
class "CBase3"
{
},
class "CBase4"
{
},
class "CMultiSuper2" : supers(CBase1, CBase2)
{
},
class "CMultiSuper3" : supers(CBase3, CBase4)
{
},
class "CMultiSuper4" : supers(CMultiSuper2, CMultiSuper3)
{
},
}
|
newoption {
trigger = "gfxlib",
value = "LIBRARY",
description = "Choose a particular development library",
default = "glfw",
allowed = {
{ "glfw", "GLFW" },
{ "sdl2", "SDL2" },
},
}
newoption {
trigger = "glfwdir64",
value = "PATH",
description = "Directory of glfw",
default = "../glfw-3.3.4.bin.WIN64",
}
newoption {
trigger = "glfwdir32",
value = "PATH",
description = "Directory of glfw",
default = "../glfw-3.3.4.bin.WIN32",
}
newoption {
trigger = "sdl2dir",
value = "PATH",
description = "Directory of sdl2",
default = "../SDL2-2.0.14",
}
workspace "librw"
location "build"
language "C++"
configurations { "Release", "Debug" }
filter { "system:windows" }
configurations { "ReleaseStatic" }
platforms { "win-x86-null", "win-x86-gl3", "win-x86-d3d9",
"win-amd64-null", "win-amd64-gl3", "win-amd64-d3d9" }
filter { "system:linux" }
platforms { "linux-x86-null", "linux-x86-gl3",
"linux-amd64-null", "linux-amd64-gl3",
"linux-arm-null", "linux-arm-gl3",
"ps2" }
if _OPTIONS["gfxlib"] == "sdl2" then
includedirs { "/usr/include/SDL2" }
end
filter {}
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release*"
defines { "NDEBUG" }
optimize "On"
filter "configurations:ReleaseStatic"
staticruntime("On")
filter { "platforms:*null" }
defines { "RW_NULL" }
filter { "platforms:*gl3" }
defines { "RW_GL3" }
if _OPTIONS["gfxlib"] == "sdl2" then
defines { "LIBRW_SDL2" }
end
filter { "platforms:*d3d9" }
defines { "RW_D3D9" }
filter { "platforms:ps2" }
defines { "RW_PS2" }
toolset "gcc"
gccprefix 'ee-'
buildoptions { "-nostdlib", "-fno-common" }
includedirs { "$(PS2SDK)/ee/include", "$(PS2SDK)/common/include" }
optimize "Off"
filter { "platforms:*amd64*" }
architecture "x86_64"
filter { "platforms:*x86*" }
architecture "x86"
filter { "platforms:*arm*" }
architecture "ARM"
filter { "platforms:win*" }
system "windows"
filter { "platforms:linux*" }
system "linux"
filter { "platforms:win*gl3" }
includedirs { path.join(_OPTIONS["sdl2dir"], "include") }
filter { "platforms:win-x86-gl3" }
includedirs { path.join(_OPTIONS["glfwdir32"], "include") }
filter { "platforms:win-amd64-gl3" }
includedirs { path.join(_OPTIONS["glfwdir64"], "include") }
filter "action:vs*"
buildoptions { "/wd4996", "/wd4244" }
filter { "platforms:win*gl3", "action:not vs*" }
if _OPTIONS["gfxlib"] == "sdl2" then
includedirs { "/mingw/include/SDL2" } -- TODO: Detect this properly
end
filter {}
Libdir = "lib/%{cfg.platform}/%{cfg.buildcfg}"
Bindir = "bin/%{cfg.platform}/%{cfg.buildcfg}"
project "librw"
kind "StaticLib"
targetname "rw"
targetdir (Libdir)
defines { "LODEPNG_NO_COMPILE_CPP" }
files { "src/*.*" }
files { "src/*/*.*" }
filter { "platforms:*gl3" }
files { "src/gl/glad/*.*" }
project "dumprwtree"
kind "ConsoleApp"
targetdir (Bindir)
removeplatforms { "*gl3", "*d3d9", "ps2" }
files { "tools/dumprwtree/*" }
includedirs { "." }
libdirs { Libdir }
links { "librw" }
function findlibs()
filter { "platforms:linux*gl3" }
links { "GL" }
if _OPTIONS["gfxlib"] == "glfw" then
links { "glfw" }
else
links { "SDL2" }
end
filter { "platforms:win-amd64-gl3" }
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") }
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x64") }
filter { "platforms:win-x86-gl3" }
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-vc2015") }
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") }
filter { "platforms:win*gl3" }
links { "opengl32" }
if _OPTIONS["gfxlib"] == "glfw" then
links { "glfw3" }
else
links { "SDL2" }
end
filter { "platforms:*d3d9" }
links { "gdi32", "d3d9" }
filter { "platforms:*d3d9", "action:vs*" }
links { "Xinput9_1_0" }
filter {}
end
function skeleton()
files { "skeleton/*.cpp", "skeleton/*.h" }
files { "skeleton/imgui/*.cpp", "skeleton/imgui/*.h" }
includedirs { "skeleton" }
end
function skeltool(dir)
targetdir (Bindir)
files { path.join("tools", dir, "*.cpp"),
path.join("tools", dir, "*.h") }
vpaths {
{["src"] = { path.join("tools", dir, "*") }},
{["skeleton"] = { "skeleton/*" }},
}
skeleton()
debugdir ( path.join("tools", dir) )
includedirs { "." }
libdirs { Libdir }
links { "librw" }
findlibs()
end
function vucode()
filter "files:**.dsm"
buildcommands {
'cpp "%{file.relpath}" | dvp-as -o "%{cfg.objdir}/%{file.basename}.o"'
}
buildoutputs { '%{cfg.objdir}/%{file.basename}.o' }
filter {}
end
project "playground"
kind "WindowedApp"
characterset ("MBCS")
skeltool("playground")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" } -- for now
project "imguitest"
kind "WindowedApp"
characterset ("MBCS")
skeltool("imguitest")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" }
project "lights"
kind "WindowedApp"
characterset ("MBCS")
skeltool("lights")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" }
project "subrast"
kind "WindowedApp"
characterset ("MBCS")
skeltool("subrast")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" }
project "camera"
kind "WindowedApp"
characterset ("MBCS")
skeltool("camera")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" }
project "im2d"
kind "WindowedApp"
characterset ("MBCS")
skeltool("im2d")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" }
project "im3d"
kind "WindowedApp"
characterset ("MBCS")
skeltool("im3d")
entrypoint("WinMainCRTStartup")
removeplatforms { "*null" }
removeplatforms { "ps2" }
project "ska2anm"
kind "ConsoleApp"
characterset ("MBCS")
targetdir (Bindir)
files { path.join("tools/ska2anm", "*.cpp"),
path.join("tools/ska2anm", "*.h") }
debugdir ( path.join("tools/ska2nm") )
includedirs { "." }
libdirs { Libdir }
links { "librw" }
findlibs()
removeplatforms { "*gl3", "*d3d9", "*ps2" }
project "ps2test"
kind "ConsoleApp"
targetdir (Bindir)
vucode()
removeplatforms { "*gl3", "*d3d9", "*null" }
targetextension '.elf'
includedirs { "." }
files { "tools/ps2test/*.cpp",
"tools/ps2test/vu/*.dsm",
"tools/ps2test/*.h" }
libdirs { "$(PS2SDK)/ee/lib" }
links { "librw" }
--project "ps2rastertest"
-- kind "ConsoleApp"
-- targetdir (Bindir)
-- removeplatforms { "*gl3", "*d3d9" }
-- files { "tools/ps2rastertest/*.cpp" }
-- includedirs { "." }
-- libdirs { Libdir }
-- links { "librw" }
|
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local Modules = Players.LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local RetrievalStatus = require(Modules.NotLApp.Enum.RetrievalStatus)
local Cryo = require(Modules.Packages.Cryo)
local Logging = require(Modules.Packages.Logging)
local AvatarEditorCategories = require(Modules.AvatarExperience.AvatarEditor.Categories)
local AvatarExperienceConstants = require(Modules.AvatarExperience.Common.Constants)
local AvatarEditorConstants = require(Modules.AvatarExperience.AvatarEditor.Constants)
local CatalogCategories = require(Modules.AvatarExperience.Catalog.Categories)
local GetFFlagAvatarEditorUpdateCamera = function() return true end
local AppPage = require(Modules.NotLApp.AppPage)
local memoize = require(Modules.Common.memoize)
local FFlagAvatarEditorTweenMinimizeButton = true
local GRADIENT_THRESHOLD = 20
local OTHER_PAGE = {
PageType = AvatarExperienceConstants.PageType.Other,
RecommendationsType = AvatarEditorConstants.RecommendationsType.None,
}
local AvatarExperienceUtils = {}
AvatarExperienceUtils.GetCategoryInfo = memoize(function(categories, categoryIndex, subcategoryIndex)
local categoryInfo = categories[categoryIndex]
if categoryInfo.Subcategories then
local subcategoryInfo = categoryInfo.Subcategories[subcategoryIndex]
if subcategoryInfo then
return Cryo.Dictionary.join(categoryInfo, subcategoryInfo)
end
end
-- Emotes doesn't use standard sub-categories
-- Construct a unique CategoryInfo table based on the slot that is currently being edited
if categoryInfo.PageType == AvatarExperienceConstants.PageType.Emotes then
return Cryo.Dictionary.join(categoryInfo, {
EmoteSlot = subcategoryIndex,
})
end
return categoryInfo
end)
local function getCatalogCardFooterHeight(width)
if width < 100 then
return 30
elseif width < 148 then
return 36
else
return 42
end
end
local CatalogItemTileHeightGetter = memoize(function(fontHeight)
return function(width)
local itemImageHeight = width
local titleHeight = AvatarExperienceConstants.ItemTileTitleMaxLines * fontHeight
local paddingHeight = AvatarExperienceConstants.ItemTilePadding * 2 -- padding for top and bottom
local footerHeight = getCatalogCardFooterHeight(width)
return itemImageHeight + titleHeight + paddingHeight + footerHeight
end
end)
local BundleItemTileHeightGetter = memoize(function(fontHeight)
return function(width)
local imageHeight = width
local titleHeight = AvatarExperienceConstants.ItemTileTitleMaxLines * fontHeight
local paddingHeight = AvatarExperienceConstants.ItemTilePadding
return imageHeight + titleHeight + paddingHeight
end
end)
local function squareItemHeightGetter(width)
return width
end
function AvatarExperienceUtils.GridItemHeightGetter(itemType, ...)
if itemType == AvatarExperienceConstants.ItemType.AvatarEditorTile then
return squareItemHeightGetter
elseif itemType == AvatarExperienceConstants.ItemType.BodyColorButton then
return squareItemHeightGetter
elseif itemType == AvatarExperienceConstants.ItemType.BundleItemTile then
return BundleItemTileHeightGetter(...)
elseif itemType == AvatarExperienceConstants.ItemType.CatalogItemTile then
return CatalogItemTileHeightGetter(...)
end
warn("Unknown itemType " ..tostring(itemType).. " in AvatarExperienceUtils.GridItemHeightGetter")
return squareItemHeightGetter
end
function AvatarExperienceUtils.getParentPage(state)
local routeHistory = state.Navigation.history
local route = routeHistory[#routeHistory]
for i = #route, 1, -1 do
local page = route[i].name
if page == AppPage.AvatarEditor or page == AppPage.Catalog or page == AppPage.SearchPage then
return page
end
end
return route[#route].name
end
function AvatarExperienceUtils.getCurrentPage(state)
local routeHistory = state.Navigation.history
local route = routeHistory[#routeHistory]
return route[#route].name
end
function AvatarExperienceUtils.doubleTapToZoomEnabled(state)
local page = AvatarExperienceUtils.getCurrentPage(state)
if page == AppPage.ItemDetails then
page = AvatarExperienceUtils.getParentPage(state)
end
if page == AppPage.AvatarEditor or page == AppPage.Catalog or page == AppPage.SearchPage then
return true
elseif page == AppPage.AvatarExperienceLandingPage then
return false
elseif page ~= AppPage.ItemDetails then
Logging.warn("Unknown SceneType")
return false
end
return false
end
function AvatarExperienceUtils.getFullViewFromState(state)
local page = AvatarExperienceUtils.getCurrentPage(state)
if page == AppPage.ItemDetails then
page = AvatarExperienceUtils.getParentPage(state)
end
if page == AppPage.AvatarEditor then
return state.AvatarExperience.AvatarEditor.FullView
elseif page == AppPage.Catalog or page == AppPage.SearchPage then
return state.AvatarExperience.Catalog.FullView
elseif page == AppPage.AvatarExperienceLandingPage then
return false
elseif page ~= AppPage.ItemDetails then
Logging.warn("Unknown SceneType")
return false
end
return false
end
function AvatarExperienceUtils.getPageFromState(state)
local page = AvatarExperienceUtils.getCurrentPage(state)
if page == AppPage.AvatarEditor then
local categoryIndex = state.AvatarExperience.AvatarEditor.Categories.category
local subcategoryIndex = state.AvatarExperience.AvatarEditor.Categories.subcategory
return AvatarExperienceUtils.GetCategoryInfo(AvatarEditorCategories, categoryIndex, subcategoryIndex)
elseif page == AppPage.Catalog then
local categoryIndex = state.AvatarExperience.Catalog.Categories.category
local subcategoryIndex = state.AvatarExperience.Catalog.Categories.subcategory
return AvatarExperienceUtils.GetCategoryInfo(CatalogCategories, categoryIndex, subcategoryIndex)
elseif not GetFFlagAvatarEditorUpdateCamera() and page == AppPage.SearchPage then
return page
elseif not GetFFlagAvatarEditorUpdateCamera() and page == AppPage.ItemDetails then
return page
elseif page == AppPage.AvatarExperienceLandingPage then
return page
else
if not true then
Logging.warn("Unknown Page in AvatarExperienceUtils.getPageFromState")
end
return OTHER_PAGE
end
end
local HumanoidDescriptionFullyQualifiedProperties = {
"Torso",
"RightArm",
"LeftArm",
"LeftLeg",
"RightLeg",
}
function AvatarExperienceUtils.isFullyQualifiedCostume(humanoidDescription)
for _, propertyName in ipairs(HumanoidDescriptionFullyQualifiedProperties) do
if humanoidDescription[propertyName] == "" or humanoidDescription[propertyName] == 0 then
return false
end
end
return true
end
function AvatarExperienceUtils.shouldShowGradientForScrollingFrame(scrollingFrame)
local absoluteSize = scrollingFrame.AbsoluteSize
local canvasSize = scrollingFrame.CanvasSize
local canvasPosition = scrollingFrame.CanvasPosition
local shouldShowGradient = absoluteSize.X < canvasSize.X.Offset
local showLeft = canvasPosition.X > GRADIENT_THRESHOLD
local showRight = canvasPosition.X + absoluteSize.X < canvasSize.X.Offset - GRADIENT_THRESHOLD
return shouldShowGradient, showLeft, showRight
end
function AvatarExperienceUtils.Round(num, roundToNearest)
roundToNearest = roundToNearest or 1
return math.floor((num + roundToNearest/2) / roundToNearest) * roundToNearest
end
function AvatarExperienceUtils.isFetchingDoneOrFailed(prevFetchingState, nextfetchingState)
local isPrevFetchingDoneOrFailed = (prevFetchingState == RetrievalStatus.Done)
or (prevFetchingState == RetrievalStatus.Failed)
local isNextFetchingDoneOrFailed = (nextfetchingState == RetrievalStatus.Done)
or (nextfetchingState == RetrievalStatus.Failed)
return not isPrevFetchingDoneOrFailed and isNextFetchingDoneOrFailed
end
function AvatarExperienceUtils.getDeviceType()
local platform = UserInputService:GetPlatform()
if platform == Enum.Platform.Android then
return AvatarExperienceConstants.DeviceType.Android
elseif platform == Enum.Platform.IOS then
return AvatarExperienceConstants.DeviceType.IOS
else
return AvatarExperienceConstants.DeviceType.Other
end
end
function AvatarExperienceUtils.lerp(a, b, t)
return (b - a) * t + a
end
return AvatarExperienceUtils
|
return {
meta = {
_next = "assets/levels/level-7.lua",
pause = false,
info = "LEVEL 6\nDON'T PANIC!!!!"
},
blocks = {
{x = 400, y = 168,},
{x = 432, y = 168,},
{x = 496, y = 200,},
{x = 610, y = 168,},
{x = 610 + 32, y = 168,},
{x = 610 + 142, y = 200,},
{x = 950, y = 231,},
}
}
|
local spec = require 'spec.spec'
describe("Twitter-oauth", function()
it("uses the api key + secret to call twitter API and include an Authorization token in the request headers", function()
local twitter_oauth = spec.middleware('twitter-oauth/twitter_oauth.lua')
local request = spec.request({ method = 'GET', uri = '/'})
local next_middleware = spec.next_middleware(function()
assert.contains(request, {
method = 'GET',
uri = '/',
headers = { Authorization = 'Bearer foo'}
})
return {status = 200, body = 'ok'}
end)
spec.mock_http({
method = "POST",
url = 'https://api.twitter.com/oauth2/token',
body = 'grant%5Ftype=client%5Fcredentials',
headers = {
Authorization = "Basic TVlfVFdJVFRFUl9BUElfS0VZOk1ZX1RXSVRURVJfQVBJX1NFQ1JFVA==",
["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8",
["Content-type"] = "application/x-www-form-urlencoded",
["content-length"] = 33
}
}, {
body = '{"access_token":"foo"}'
})
local response = twitter_oauth(request, next_middleware)
assert.spy(next_middleware).was_called()
assert.contains(response, {status = 200, body = 'ok'})
end)
end)
|
--[[
TTT -> Database library (ServerSide)
by Tassilo (https://github.com/TASSIA710)
--]]
-- Load MySQLOO
require("mysqloo")
TTT.Database = mysqloo.connect(TTT.Config.Database.Hostname,
TTT.Config.Database.Username, TTT.Config.Database.Password,
TTT.Config.Database.Database, TTT.Config.Database.Port)
-- Generic error callback
TTT.Database.GenericErrorCallback = function(_, sql, err)
Log.Error("Error while trying to execute query:")
Log.Error("> " .. sql)
Log.Error("SQL: " .. err)
end
-- Connection established
TTT.Database.onConnected = function()
Log.Info("Database connection established, running initial queries...")
hook.Run("TTTDatabaseCreateTables", TTT.Database)
hook.Run("TTTDatabaseInitialQueries", TTT.Database)
hook.Run("TTTDatabaseConnected", TTT.Database)
Log.Info("Database successfully initialized.")
end
-- Connection failed
TTT.Database.onConnectionFailed = function(_, err)
Log.Error("Failed to connect to database:")
Log.Error(err)
end
|
return function (Data)
local Tbl = {}
local TmpTips = Split(Data,",")
if #TmpTips == 1 then
Tbl.CommonTips = Data
else
for _,strData in ipairs(TmpTips) do
local TmpData = Split(strData, "|")
assert(#TmpData == 2,"参数错误,"..strData)
local TmpInfo = {
Job = TmpData[1],
Tips = TmpData[2],
}
if not Tbl.JobTips then
Tbl.JobTips = {}
end
Tbl.JobTips[TmpInfo.Job] = TmpInfo
end
end
return Tbl
end
|
---------------------------------------------------------------------------------------------
-- Requirement summary:
-- [SubscribeVehicleData] DISALLOWED response when all parameters are not allowed in the request
-- [Mobile API] [GENIVI] SubscribeVehicleData request/response
-- [HMI API] [GENIVI] VehicleInfo.SubscribeVehicleData request/response
--
-- Description:
-- SDL must:
-- - not send anything to HMI,
-- - AND return the individual results of DISALLOWED to response to mobile app + "ResultCode:DISALLOWED, success: false"
-- In case:
-- - SubscribeVehicleData RPC is allowed by policies with less than supported by protocol parameters
-- - AND the app assigned with such policies requests SubscribeVehicleData with one and-or more NOT-allowed params only
--
-- Preconditions:
-- 1. Application with <appID> is registered on SDL.
-- 2. Specific permissions are assigned for <appID> with SubscribeVehicleData
-- Steps:
-- 1. Send SubscribeVehicleData RPC App -> SDL with not specified parameters
-- 2. Verify status of response
--
-- Expected result:
-- SDL -> App:
-- General: success: false, resultCode: DISALLOWED
-- Individual: dataType: <parameter>, resultCode: DISALLOWED
---------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local commonFunctions = require("user_modules/shared_testcases/commonFunctions")
local commonSteps = require("user_modules/shared_testcases/commonSteps")
local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable")
local utils = require ('user_modules/utils')
--[[ General Precondition before ATF start ]]
commonSteps:DeleteLogsFileAndPolicyTable()
--testCasesForPolicyTable:Precondition_updatePolicy_By_overwriting_preloaded_pt("files/jsons/Policies/App_Permissions/ptu_015.json")
--[[ Local functions ]]
local function UpdatePolicy()
local PermissionForSubscribeVehicleData =
[[
"SubscribeVehicleData": {
"hmi_levels": ["BACKGROUND",
"FULL",
"LIMITED",
"NONE"],
"parameters": []
}
]].. ", \n"
local PermissionForUnsubscribeVehicleData =
[[
"UnsubscribeVehicleData": {
"hmi_levels": ["BACKGROUND",
"FULL",
"LIMITED",
"NONE"],
"parameters": []
}
]].. ", \n"
local PermissionLinesForBase4 = PermissionForSubscribeVehicleData..PermissionForUnsubscribeVehicleData
local PTName = testCasesForPolicyTable:createPolicyTableFile_temp(PermissionLinesForBase4, nil, nil, {"SubscribeVehicleData","UnsubscribeVehicleData"})
testCasesForPolicyTable:Precondition_updatePolicy_By_overwriting_preloaded_pt(PTName)
end
UpdatePolicy()
--[[ General Settings for configuration ]]
Test = require("connecttest")
require("user_modules/AppTypes")
--[[ Preconditions ]]
commonFunctions:newTestCasesGroup("Preconditions")
function Test:Precondition_trigger_getting_device_consent()
testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC())
end
--[[ Test ]]
commonFunctions:newTestCasesGroup("Test")
function Test:TestStep_SubscribeVehicleData()
local corId = self.mobileSession:SendRPC("SubscribeVehicleData",
{
fuelLevel_State = true,
instantFuelConsumption = true,
})
EXPECT_HMICALL("VehicleInfo.SubscribeVehicleData") :Times(0)
self.mobileSession:ExpectResponse(corId, { success = false, resultCode = "DISALLOWED" })
end
--[[ Postconditions ]]
commonFunctions:newTestCasesGroup("Postconditions")
testCasesForPolicyTable:Restore_preloaded_pt()
function Test.Postcondition_StopSDL()
StopSDL()
end
|
Boolean = Object:extend("Boolean")
function Boolean.prototype:isPresent()
return self
end
function Boolean.prototype:toString()
if self then
return 'true'
end
return 'false'
end
Boolean.prototype.class = Boolean
local meta = { __index = Boolean.prototype, __metatable = false, __tostring = function (self) return self:toString() end }
debug.setmetatable(false, meta)
debug.setmetatable(true, meta)
|
local modkeys = {}
modkeys.map = {
["left ctrl"] = "ctrl",
["right ctrl"] = "ctrl",
["left shift"] = "shift",
["right shift"] = "shift",
["left alt"] = "alt",
["right alt"] = "altgr",
}
modkeys.keys = { "ctrl", "alt", "altgr", "shift" }
return modkeys
|
-- Sets stress to negative one million
-- With unit selected, affects that unit. Use "remove-stress all" to affect all units.
--By Putnam; http://www.bay12forums.com/smf/index.php?topic=139553.msg5820486#msg5820486
local utils = require 'utils'
validArgs = validArgs or utils.invert({
'help',
'all'
})
local args = utils.processArgs({...}, validArgs)
if args.help then
print([[
remove-stress [-all]
sets the stress level of every unit to -1000000, or just the selected unit if the '-all' argument is not given
]])
return
end
if args.all then
for k,v in ipairs(df.global.world.units.active) do
v.status.current_soul.personality.stress_level=-1000000
end
else
local unit = dfhack.gui.getSelectedUnit()
if unit then
unit.status.current_soul.personality.stress_level=-1000000
else
error 'Invalid usage: No unit selected and -all argument not given.'
end
end
|
PlazaPopupFirstPayCcsView = class("PlazaPopupFirstPayCcsView")
PlazaPopupFirstPayCcsView.onCreationComplete = function (slot0)
ClassUtil.extends(slot0, ZoomPopUpChildView, true, slot0, slot0.bg, slot0.view)
end
PlazaPopupFirstPayCcsView.show = function (slot0)
slot1 = Hero:getFirstPayPrice() or 0
slot2 = Hero:getFirstPayScore() or 0
slot0.view.content.content_tf:setHtmlText(slot3)
TweenLite.from(slot0.view.content, 0.25, {
delay = 0.1,
x = -150,
ease = Sine.easeOut
})
if not slot0._spine then
slot0._spine = sp.SkeletonAnimation:create("gameres/animation/spine/zsb_scth/zsb_scth.json", "gameres/animation/spine/zsb_scth/zsb_scth.atlas")
slot0._spine:setAnimation(0, "start", false)
slot0._spine:addAnimation(0, "idle", true)
slot0.view.spine:addChild(slot0._spine)
end
ZoomPopUpChildView.show(slot0)
end
PlazaPopupFirstPayCcsView.hide = function (slot0)
ZoomPopUpChildView.hide(slot0)
if slot0._spine then
slot0._spine:removeFromParent()
slot0._spine = nil
end
end
PlazaPopupFirstPayCcsView.onRootClick = function (slot0)
return
end
PlazaPopupFirstPayCcsView.onBtnClick = function (slot0, slot1, slot2)
if slot1 == slot0.view.btnClose then
slot0.model:setIsShowingFirstPay(false)
elseif slot1 == slot0.view.btnClick then
requireModule("ChargeModule")
ProxyCharge:show(nil, nil, CHARGE_ORDER_TYPE_FIRST_PAY, Hero:getFirstPayPrice())
slot0.model:setIsShowingFirstPay(false)
end
end
PlazaPopupFirstPayCcsView.destroy = function (slot0)
if slot0._spine then
slot0._spine:removeFromParent()
slot0._spine = nil
end
destroySomeObj(slot0.view.content.content_tf)
destroySomeObj(slot0.view.btnClick)
destroySomeObj(slot0.view.btnClose)
ZoomPopUpChildView.destroy(slot0)
end
return
|
local Globals = require("vr-radio-helper.globals")
local AcfReader = require("vr-radio-helper.shared_components.acf_reader")
local AircraftCompatibilityId
do
AircraftCompatibilityId = {}
function AircraftCompatibilityId:new()
local newInstanceWithState = {
icao = icao,
acfFileName = acfFileName,
acfPropertyDesc = acfDesc,
acfPropertyManufacturer = acfManufacturer,
acfPropertyStudio = acfStudio,
acfPropertyAuthor = acfAuthor,
acfPropertyName = acfName
}
setmetatable(newInstanceWithState, self)
self.__index = self
self:_generateIdStringNow()
-- self:_generateIdHashNow()
return newInstanceWithState
end
function AircraftCompatibilityId:getIdString()
return self.idString
end
-- function AircraftCompatibilityId:getIdHash()
-- return self.idHash
-- end
function AircraftCompatibilityId:_generateIdStringNow()
local acfReader = AcfReader:new()
local acfPath = AIRCRAFT_PATH .. AIRCRAFT_FILENAME
if (not acfReader:loadFromFile(acfPath)) then
logMsg(("Plane Compatibility: Aircraft file=%s could not be loaded."):format(acfPath))
end
self.icao = PLANE_ICAO
self.acfFileName = AIRCRAFT_FILENAME
self.tailnumber = PLANE_TAILNUMBER
self.acfPropertyDesc = acfReader:getPropertyValue("acf/_descrip")
self.acfPropertyManufacturer = acfReader:getPropertyValue("acf/_manufacturer")
self.acfPropertyStudio = acfReader:getPropertyValue("acf/_studio")
self.acfPropertyAuthor = acfReader:getPropertyValue("acf/_author")
self.acfPropertyName = acfReader:getPropertyValue("acf/_name")
local NoInfoMarker = ":"
self.idString =
("ICAO:%s:TAILNUMBER:%s:ACF_FILE_NAME:%s:ACF_DESC:%s:ACF_MANUFACTURER:%s:ACF_STUDIO:%s:ACF_AUTHOR:%s:ACF_NAME:%s"):format(
self.icao,
self.tailnumber,
self.acfFileName,
self.acfPropertyDesc or NoInfoMarker,
self.acfPropertyManufacturer or NoInfoMarker,
self.acfPropertyStudio or NoInfoMarker,
self.acfPropertyAuthor or NoInfoMarker,
self.acfPropertyName or NoInfoMarker
)
end
-- function AircraftCompatibilityId:_generateIdHashNow()
-- self.idHash = MD5.sumhexa(self.idString)
-- end
end
return AircraftCompatibilityId
|
--------------------------------
-- @module ProgressTo
-- @extend ActionInterval
-- @parent_module cc
---@class cc.ProgressTo:cc.ActionInterval
local ProgressTo = {}
cc.ProgressTo = ProgressTo
--------------------------------
--- brief Initializes with a duration and destination percentage.
--- param duration Specify the duration of the ProgressTo action. It's a value in seconds.
--- param percent Specify the destination percentage.
--- return If the creation success, return true; otherwise, return false.
---@param duration number
---@param percent number
---@return boolean
function ProgressTo:initWithDuration(duration, percent)
end
--------------------------------
--- brief Create and initializes with a duration and a destination percentage.
--- param duration Specify the duration of the ProgressTo action. It's a value in seconds.
--- param percent Specify the destination percentage.
--- return If the creation success, return a pointer of ProgressTo action; otherwise, return nil.
---@param duration number
---@param percent number
---@return cc.ProgressTo
function ProgressTo:create(duration, percent)
end
--------------------------------
---
---@param target cc.Node
---@return cc.ProgressTo
function ProgressTo:startWithTarget(target)
end
--------------------------------
---
---@return cc.ProgressTo
function ProgressTo:clone()
end
--------------------------------
---
---@return cc.ProgressTo
function ProgressTo:reverse()
end
--------------------------------
---
---@param time number
---@return cc.ProgressTo
function ProgressTo:update(time)
end
--------------------------------
---
---@return cc.ProgressTo
function ProgressTo:ProgressTo()
end
return nil
|
function onCreate()
-- background shit
makeLuaSprite('w2stage', 'w2stage', 0, 0);
setScrollFactor('w2stage', 1, 1);
addLuaSprite('w2stage', false);
makeLuaSprite('overlay', 'w2overlay', 0, 0)
setScrollFactor('overlay', 1, 1)
setObjectCamera('overlay', 'hud')
setBlendMode('overlay', 'overlay')
addLuaSprite('overlay', true)
makeLuaSprite('vignette', 'vignette', 0, 0)
setScrollFactor('vignette', 0, 0)
setObjectCamera('vignette', 'hud')
setProperty('vignette.alpha', 0.5)
addLuaSprite('vignette', true)
makeLuaSprite('flash', 'camFlash', 0, 0)
setObjectCamera('flash', 'other')
setProperty('flash.alpha', 0)
addLuaSprite('flash', true)
lightningBeat = 0
lightningOffset = 8
end
function onBeatHit()
if math.random(10) == 10 and curBeat > lightningBeat + lightningOffset then
lightningBaybee()
end
end
function lightningBaybee()
lightningBeat = curBeat
lightningOffset = math.random(10, 30)
playSound("thunder" .. math.floor(math.random(1,2)),0.7);
if flashingLights then
setProperty('flash.alpha', 0.4)
doTweenAlpha('camflashlololol', 'flash', 0, 0.75, 'linear')
end
objectPlayAnimation('boyfriend', 'scared', true)
objectPlayAnimation('gf', 'scared', true)
end
|
local id= require "id"
local lst= require "lists"
local num= require "num"
-----------------------------------------------------------
local function create()
return {id=id.new(), cells={}, cooked={}} end
-----------------------------------------------------------
local function update(i,cells,t)
i.cells=lst.copy(cells)
i.cooked=lst.copy(cells)
for _,head in pairs(t.all.cols) do
head.what.update(head, cells[head.pos]) end
return i end
-----------------------------------------------------------
local function dominate1(i,j,t)
local e,n = 2.71828,#t.goals
local sum1,sum2=0,0
for _,col in pairs(t.goals) do
local w= col.weight
local x= num.norm(col, i.cells[col.pos])
local y= num.norm(col, j.cells[col.pos])
sum1 = sum1 - e^(w * (x-y)/n)
sum2 = sum2 - e^(w * (y-x)/n)
end
return sum1/n < sum2/n
end
-----------------------------------------------------------
local function dominate(i,t)
if not i.dom then
i.dom=0
for x,j in pairs(t.rows) do
if i.id ~= j.id then
if dominate1(i,j,t) then
i.dom = i.dom + 1 end end end end
return i.dom end
-----------------------------------------------------------
return {create=create, update=update,dominate=dominate}
|
local drpath = require("directories")
drpath.addPath("myprograms",
"ZeroBraineProjects",
"CorporateProjects",
-- When not located in general directory search in projects
"ZeroBraineProjects/dvdlualib",
"ZeroBraineProjects/ExtractWireWiki")
drpath.addBase("D:/LuaIDE")
drpath.addBase("C:/Users/ddobromirov/Documents/Lua-Projs/ZeroBraineIDE").setBase(1)
local com = require("common")
print(com.randomGetString(30))
|
local json = require("utils.json")
local t = {
testing = "tst";
int = 20;
soemthing = "else";
}
function Activate()
thisEntity:SetThink(function() return setAtt() end,"idk",0)
end
function setAtt()
thisEntity:SetIntAttr("plswork",10)
--EntFire(thisEntity,"jackpot","AddCSSClass","MOTHERFUCKER")
--EntFire(thisEntity,"jackpot","RemoveCSSClass","MOTHERFUCKER",0.3)
SendToConsole("@panorama_dispatch_event AddStyleToEachChild(\'"..json.encode(t)..Time().." \')");
return 0.05
end
|
norushtime_timing = 1
norushtime_flag = 1
if (Locale_AddDictionary ~= nil) then
Locale_AddDictionary("locale:LevelData\\Multiplayer\\lib\\norushtime.dat")
end
function norushtime_updating()
if (norushtime_flag == 1) then
for playerIndex = 0, Player_Count do
if (Player_IsAlive(playerIndex) == 1) then
if (Player_HasShipWithBuildQueue(playerIndex) == 1) then
local position = SobGroup_GetPosition("Player_Ships" .. playerIndex)
Volume_AddSphere("norushtime_volume" .. playerIndex, {position[1],position[2],position[3],}, 6600)
UI_TimerReset("NewTaskbar", "GameTimer")
UI_TimerStart("NewTaskbar", "GameTimer")
UI_SetTimerOffset("NewTaskbar", "GameTimer", 0 - (norushtime * 60))
end
end
end
norushtime_flag = 0
end
for playerIndex = 0, Player_Count do
if (Player_IsAlive(playerIndex) == 1) then
if (Player_HasShipWithBuildQueue(playerIndex) == 1) then
if (norushtime > 0) then
SobGroup_Clear("temp1")
local norushtime_volumeIndex = 0
for norushtime_volumeIndex = 0, Player_Count do
if ((Player_IsAlive(norushtime_volumeIndex) == 1) and (playerIndex ~= norushtime_volumeIndex) and (AreAllied(playerIndex, norushtime_volumeIndex) == 0)) then
Player_FillSobGroupInVolume("temp", playerIndex, "norushtime_volume" .. norushtime_volumeIndex)
SobGroup_SobGroupAdd("temp1", "temp")
end
end
if (SobGroup_Count("temp1") > 0) then
SobGroup_TakeDamage("temp1", 0.15)
Subtitle_Message_Handler("$14770", 2, "data:sound\\sfx\\ui\\frontend\\CHATMESSAGERECEIVED", playerIndex) --to localize
end
if (norushtime_timing == 1) then
local subtitleMessage = Message_FormatFf("$14771", norushtime)
Subtitle_Message_Handlerw(subtitleMessage, 2, "data:sound\\sfx\\ui\\frontend\\CHATMESSAGERECEIVED", playerIndex) --to localize
end
else
Subtitle_Message_Handler("$14772", 2, "data:sound\\sfx\\ui\\frontend\\CHATMESSAGERECEIVED", playerIndex) --to localize
end
end
end
end
if (norushtime <= 0) then
for norushtime_volumeIndex = 0, Player_Count do
Volume_Delete("norushtime_volume" .. norushtime_volumeIndex)
end
Rule_Remove("norushtime_updating")
return
end
norushtime_timing = norushtime_timing + 1
if (norushtime_timing > 6) then
norushtime_timing = 1
norushtime = norushtime - 1
end
end
|
-- SPDX-License-Identifier: MIT
local lgi = require('lgi')
local GLib = lgi.require('GLib')
hexchat.register('Playback', '1', "Integration with ZNC's Playback module")
--[[
This should behave like this:
On connect (end of MOTD):
if new server, play all
if old server, play all after latest timestamp
On close query:
clear all
On new message:
update latest timestamp
]]
local CAP_NAME = 'znc.in/playback'
local servers = {} -- Table of id to timestamp
-- Request capability
hexchat.hook_print('Capability List', function (args)
if args[2]:find(CAP_NAME) then
hexchat.command('quote CAP REQ :' .. CAP_NAME)
local ctx = hexchat.props.context
hexchat.hook_timer(1, function ()
-- Emit this event right after the current one
if ctx:set() then
hexchat.emit_print('Capability Request', CAP_NAME)
end
end)
end
end)
-- Capability supported
hexchat.hook_print('Capability Acknowledgement', function (args)
local id = hexchat.prefs['id']
if args[2]:find(CAP_NAME) and not servers[id] then
servers[id] = 0 -- New server
end
end)
local function play_history()
local timestamp = servers[hexchat.prefs['id']]
if timestamp then
hexchat.command('quote PRIVMSG *playback :play * ' .. tostring(timestamp))
end
end
-- On RPL_ENDOFMOTD or ERR_NOMOTD play history
hexchat.hook_server('376', function (word, word_eol)
play_history()
end)
hexchat.hook_server('422', function (word, word_eol)
play_history()
end)
-- Remove history when closed
hexchat.hook_print('Close Context', function (args)
local id = hexchat.prefs['id']
local timestamp = servers[id]
if not timestamp then
return
end
local ctx_type = hexchat.props['type']
if ctx_type == 3 then -- Dialog
hexchat.command('quote PRIVMSG *playback :clear ' .. hexchat.get_info('channel'))
elseif ctx_type == 1 then -- Server
servers[id] = nil
end
end)
-- Store the timestamp of the latest message on the server
hexchat.hook_server_attrs('PRIVMSG', function (word, word_eol, attrs)
local id = hexchat.prefs['id']
if servers[id] then
servers[id] = GLib.get_real_time() / 1000000 -- epoch in seconds with milisecond precision UTC
end
end, hexchat.PRI_LOWEST)
|
-- Basic example of a simulation Input File
thermal_solver={}
thermal_solver.mesh = {
filename = "/data/star.mesh",
serial = 1,
parallel = 1
}
thermal_solver.order = 2
thermal_solver.timestepper = "quasistatic"
-- define initial conditions
thermal_solver.u0 = { type = "function", func = "BoundaryTemperature"}
-- define conducitivity
thermal_solver.kappa = { type = "constant", constant = 0.5}
-- linear solver parameters
thermal_solver.solver = {
rel_tol = 1.e-6,
abs_tol = 1.e-12,
print_level = 0,
max_iter = 100,
dt = 1.0,
steps = 1
}
-- boundary conditions
thermal_solver.bcs = {
["temperature_1"] = {
attrs = {3, 4, 7},
coef = function (v)
-- Constant is defined as a function
return 12.55
end
},
["temperature_2"] = {
attrs = {4, 6, 1},
coef = function (v)
return v.x * 0.12
end
},
["flux"] = {
attrs = {14, 62, 11},
vec_coef = function (v)
scale = 0.12
return v * scale
end
}
}
|
slot0 = setmetatable
slot1 = Mathf
slot2 = Vector3
UnityEngine.Plane = {
__index = function (slot0, slot1)
return rawget(slot0, slot1)
end,
__call = function (slot0, slot1)
return slot0.New(slot1)
end,
New = function (slot0, slot1)
return slot0({
normal = slot0:Normalize(),
distance = slot1
}, slot1)
end,
Get = function (slot0)
return slot0.normal, slot0.distance
end,
Raycast = function (slot0, slot1)
slot3 = -slot0.Dot(slot1.origin, slot0.normal) - slot0.distance
if slot1.Approximately(slot0.Dot(slot1.direction, slot0.normal), 0) then
return false, 0
end
return slot3 / slot2 > 0, slot4
end,
SetNormalAndPosition = function (slot0, slot1, slot2)
slot0.normal = slot1:Normalize()
slot0.distance = -slot0.Dot(slot1, slot2)
end,
Set3Points = function (slot0, slot1, slot2, slot3)
slot0.normal = slot0.Normalize(slot0.Cross(slot2 - slot1, slot3 - slot1))
slot0.distance = -slot0.Dot(slot0.normal, slot1)
end,
GetDistanceToPoint = function (slot0, slot1)
return slot0.Dot(slot0.normal, slot1) + slot0.distance
end,
GetSide = function (slot0, slot1)
return slot0.Dot(slot0.normal, slot1) + slot0.distance > 0
end,
SameSide = function (slot0, slot1, slot2)
return (slot0:GetDistanceToPoint(slot1) > 0 and slot0:GetDistanceToPoint(slot2) > 0) or (slot3 <= 0 and slot0.GetDistanceToPoint(slot2) <= 0)
end
}
slot0(, )
return
|
local bst = require("data_structures.sorted_set.binary_search_tree")
describe("Binary search tree", function()
local tree = bst.new()
-- Checks a BST
local function check_bst(subtree)
if not subtree then
return
end
if subtree[true] then
assert.truthy(subtree[true].key < subtree.key)
end
if subtree[false] then
assert.truthy(subtree[false].key > subtree.key)
end
end
local function count(subtree)
if not subtree then
return 0
end
if subtree.root then
return count(subtree.root)
end
if not subtree.key then
return 0
end
return 1 + count(subtree[true]) + count(subtree[false])
end
check_bst(tree.root)
-- Insert random numbers
local hash_set = {}
for _ = 1, 100 do
local x = math.random(1e6)
if not tree:has(x) then
assert.falsy(hash_set[x])
tree:add(x)
assert.truthy(tree:has(x))
check_bst(tree.root)
hash_set[x] = true
end
end
-- Do range queries and compare against sorted list
local sorted_list = {}
for number in pairs(hash_set) do
table.insert(sorted_list, number)
end
table.sort(sorted_list)
assert.equal(#sorted_list, count(tree))
-- Iterate tree in descending order
do
local i = #sorted_list
tree:descending(function(key)
assert.equal(sorted_list[i], key)
i = i - 1
end)
assert.equal(0, i)
end
local function test_range(from, to)
-- Ascending
local k = from
tree:range(function(key)
assert.truthy(k <= to)
assert.equal(sorted_list[k], key)
k = k + 1
end, sorted_list[from], sorted_list[to])
assert.equal(to + 1, k)
-- Descending
tree:range(function(key)
k = k - 1
assert.truthy(k >= from)
assert.equal(sorted_list[k], key)
end, sorted_list[to], sorted_list[from])
assert(from, k)
end
for _ = 1, 100 do
local i = math.random(#sorted_list)
local j = math.random(i, #sorted_list)
test_range(i, j)
end
for i = 1, #sorted_list do
test_range(i, i)
end
-- Delete all numbers
local c = #sorted_list
for x in pairs(hash_set) do
assert.truthy(tree:has(x))
assert.equal(x, tree:get(x))
assert.truthy(tree:remove(x))
c = c - 1
assert.equal(c, count(tree))
check_bst(tree)
assert.falsy(tree:has(x))
end
assert.truthy(bst:empty())
end)
|
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onGetFormulaValues(player, skill, attack, factor)
local min = (player:getLevel() / 5) + (skill * attack * 0.03) + 7
local max = (player:getLevel() / 5) + (skill * attack * 0.05) + 11
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
|
require 'plugins.startify.bindings'
vim.g.startify_change_to_dir = 0
vim.g.startify_change_to_vcs_root = 1
vim.g.startify_custom_header = ""
vim.g.startify_enable_unsafe = 1
vim.g.startify_files_number = 8
vim.g.startify_session_autoload = 1
vim.g.startify_session_persistence = 1
vim.g.startify_session_delete_buffers = 1
vim.g.startify_bookmarks = {
{d = '~/dotfiles'},
{c = '~/code/'}
}
|
--
-- Copyright (c) 2015, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
--
-- Author: Marc'Aurelio Ranzato <[email protected]>
-- Sumit Chopra <[email protected]>
-- Michael Auli <[email protected]>
-- Wojciech Zaremba <[email protected]>
--
-- Script that launches training and testing of a summarization model
-- using MIXER as described in:
-- http://arxiv.org/abs/1511.06732 (ICLR 2016)
require('xlua')
require('nn')
require('nngraph')
require('cutorch')
require('cunn')
paths.dofile('Trainer.lua')
paths.dofile('Mixer.lua')
paths.dofile('ReinforceCriterion.lua')
paths.dofile('DataSource.lua')
local mdls = paths.dofile('model_factory.lua')
paths.dofile('reward_factory.lua')
torch.manualSeed(1111)
cutorch.manualSeed(1111)
local cmd = torch.CmdLine()
cmd:option('-datadir', 'data', 'path to binarized training data')
cmd:option('-lr', 0.2, 'learning rate')
cmd:option('-gparamclip', 10, 'clipping threshold of parameter gradients')
cmd:option('-bsz', 32, 'batch size')
cmd:option('-nhid', 256, 'number of hidden units')
cmd:option('-bptt', 25, 'number of backprop steps through time')
cmd:option('-deltasteps', 3,
'increment of number of words we predict using REINFORCE at next' ..
' round')
cmd:option('-nepochs', 5,
'number of epochs of each stage of REINFORCE training')
cmd:option('-epoch_xent', 25,
'number of epochs we do with pure XENT to initialize the model')
cmd:option('-devid', 1, 'GPU device id')
cmd:option('-reward', 'bleu', 'reward type: bleu|rouge')
local config = cmd:parse(arg)
cutorch.setDevice(config.devid)
-- building configuration hyper-parameters for Trainer, Model and Dataset.
config.trainer = {
bptt = config.bptt,
n_epochs = config.nepochs,
initial_learning_rate = config.lr,
save_dir = './backups/'} -- directory where we save checkpoints
config.model = {
n_hidden = config.nhid,
batch_size = config.bsz,
bptt = config.bptt,
grad_param_clip = config.gparamclip,
reward = config.reward}
-- load data
local path2data = config.datadir
-- download the data if its not already in the data directory.
if not (paths.dirp(path2data) and
paths.filep(paths.concat(path2data, 'dict.target.th7')) and
paths.filep(paths.concat(path2data, 'dict.source.th7'))) then
print('[[ Data not found: fetching a fresh copy and running tokenizer]]')
os.execute('./prepareData.sh')
end
-- load target and source dictionaries and add padding token
local dict_target = torch.load(paths.concat(path2data, 'dict.target.th7'))
local dict_source = torch.load(paths.concat(path2data, 'dict.source.th7'))
-- add the padding index if using the aligned data source
dict_target.nwords = dict_target.nwords + 1
local padidx_target = dict_target.nwords
dict_target.index_to_symbol[padidx_target] = '<PAD>'
dict_target.symbol_to_index['<PAD>'] = padidx_target
dict_target.paddingIndex = padidx_target
dict_source.nwords = dict_source.nwords + 1
local padidx_source = dict_source.nwords
dict_source.index_to_symbol[padidx_source] = '<PAD>'
dict_source.symbol_to_index['<PAD>'] = padidx_source
dict_source.paddingIndex = padidx_source
local train_data = DataSource(
{root_path = path2data,
data_type = 'train',
batch_size = config.bsz,
bin_thresh = 800,
sequence_length = config.bptt,
dct_target = dict_target,
dct_source = dict_source})
local valid_data = DataSource(
{root_path = path2data,
data_type = 'valid',
batch_size = config.bsz,
bin_thresh = 800,
max_shard_len = 0,
sequence_length = config.bptt,
dct_target = dict_target,
dct_source = dict_source})
local test_data = DataSource(
{root_path = path2data,
data_type = 'test',
batch_size = config.bsz,
bin_thresh = 800,
max_shard_len = 0,
sequence_length = config.bptt,
dct_target = dict_target,
dct_source = dict_source})
-- create and initialize the core net at a given time step
config.model.eosIndex = dict_target.separatorIndex
config.model.n_tokens = dict_target.nwords
config.model.paddingIndex = dict_target.paddingIndex
local unk_id = dict_target.symbol_to_index['<unk>']
local net, size_hid_layers = mdls.makeNetSingleStep(
config.model, dict_target, dict_source)
config.model.size_hid_layers = size_hid_layers
-- create the criterion for the whole sequence
local compute_reward =
RewardFactory(config.model.reward, config.bptt, config.model.n_tokens,
config.model.eosIndex, config.model.paddingIndex, unk_id,
config.bsz)
compute_reward:training_mode()
compute_reward:cuda()
local reinforce = nn.ReinforceCriterion(compute_reward, config.bptt,
config.model.eosIndex,
config.model.paddingIndex)
-- create and initialize the RNNreinforce model (replicating "net" over time)
local model = Mixer(config.model, net, reinforce)
local trainer = Trainer(config.trainer, model)
trainer:cuda()
print('Start training')
-- start by training using XENT only.
model:set_xent_weight(1)
local start_nrstepsinit = config.model.bptt
for nrstepsinit = start_nrstepsinit, 1, -config.deltasteps do
print('nrstepsinit', nrstepsinit)
trainer.save_dir = config.trainer.save_dir .. nrstepsinit .. '/'
trainer:set_nrstepsinit(nrstepsinit)
if nrstepsinit < config.model.bptt then
model:set_xent_weight(0.5)
end
local num_epochs = config.trainer.n_epochs
if (nrstepsinit == config.model.bptt) then
num_epochs = config.epoch_xent
end
if nrstepsinit == 1 or nrstepsinit - config.deltasteps < 1 then
num_epochs = 100 -- run forever at the very last iteration
end
trainer:run(num_epochs, train_data, valid_data, test_data)
-- compute BLEU on validation set
trainer:set_nrstepsinit(1)
trainer:eval_generation(valid_data)
end
print('End of training.')
print('****************')
print('Evaluating now generation on the test set')
trainer:eval_generation(test_data)
|
---------------------------------------------------------------------------------------------------
-- func: spawnmob
-- desc: Spawns a mob.
---------------------------------------------------------------------------------------------------
cmdprops =
{
permission = 1,
parameters = "iii"
};
function error(player, msg)
player:PrintToPlayer(msg);
player:PrintToPlayer("!spawnmob <mob ID> {despawntime} {respawntime}");
end;
function onTrigger(player, mobId, despawntime, respawntime)
-- validate mobId
if (mobId == nil) then
error(player, "You must provide a mob ID.");
return;
end
local targ = GetMobByID(mobId);
if (targ == nil) then
error(player, "Invalid mob ID.");
return;
end
-- validate despawntime
if (despawntime ~= nil and despawntime < 0) then
error(player, "Invalid despawn time.");
return;
end
-- validate respawntime
if (respawntime ~= nil and respawntime < 0) then
error(player, "Invalid respawn time.");
return;
end
SpawnMob( targ:getID(), despawntime, respawntime );
player:PrintToPlayer( string.format("Spawned %s %s.", targ:getName(), targ:getID()) );
end
|
--this = SceneNode()
function create()
--this:setIsStatic(true)
greenDensity = {}
greenDensityMax = 0.0
nature = {}
natureConectToScene = {}--list all nodes to connect nature models to(so they dont colide with each other)
natureCount = 0
for i=-128, 128, 1 do
greenDensity[i] = {}
for j=-128, 128, 1 do
greenDensity[i][j] = 0.0
end
end
local islands = this:getRootNode():findAllNodeByNameTowardsLeaf("*island*")
for i=0, islands:size()-1, 1 do
generateGreenDensity(islands:item(i))
end
setMaxDensity()--finds the higest density
for i=0, islands:size()-1, 1 do
generateFlora(islands:item(i))
end
-- add the connection last, so no collisions occure
for i=0, natureCount-1, 1 do
natureConectToScene[i]:addChild(nature[i])
--now make so there is no need to do an update
nature[i]:setIsStatic(true)
--nature[i]:render()
end
return true
end
function setMaxDensity()
local list = this:getRootNode():findAllNodeByNameTowardsLeaf("*rock_face*")
local val = 0.0
for i=0, list:size()-1, 1 do
val = calculateGreenDensity(list:item(i):getGlobalPosition())
if val>greenDensityMax then greenDensityMax = val end
end
end
function calculateGreenDensity(vec)
local x = math.floor(vec.x)
local y = math.floor(vec.z)
local value = 0.0
local xp = 0.0
local yp = 0.0
local DIST = 3
for i=-DIST, DIST, 1 do
xp = 0.25 + ( 0.75 * (DIST-math.abs(i)) )
for j=-DIST, DIST, 1 do
yp = 0.25 + ( 0.75 * (DIST-math.abs(j)) )
value = value + (xp * yp * greenDensity[x+i][y+j])
end
end
return value
end
function generateGreenDensity(island)
increaseGreenDensityByObj(island,"*tree*",2.0)
increaseGreenDensityByObj(island,"*bush*",0.3)
increaseGreenDensityByObj(island,"*fearn*",0.3)
increaseGreenDensityByObj(island,"*leaf*",0.1)
increaseGreenDensityByObj(island,"*vine*",0.1)
increaseGreenDensityByObj(island,"*cactus*",0.1)
increaseGreenDensityByObj(island,"*weed*",0.25)
increaseGreenDensityByObj(island,"*flower*",0.1)
increaseGreenDensityByObj(island,"*flora*",0.1)
increaseGreenDensityByObj(island,"*mushroom*",0.25)
end
function increaseGreenDensityByObj(island,name,val)
local list = island:findAllNodeByNameTowardsLeaf(name)
for i=0, list:size()-1, 1 do
local x = math.floor(list:item(i):getGlobalPosition().x)
local y = math.floor(list:item(i):getGlobalPosition().z)
greenDensity[x][y] = greenDensity[x][y] + val
end
end
function generateFlora(island)
local list = island:findAllNodeByNameTowardsLeaf("*world_edge*")
local gPer = 0.0
for i=0, list:size()-1, 1 do
--
-- vines
--
for j=0, 5, 1 do
local yRand = math.randomFloat()
local mat = list:item(i):getGlobalMatrix()
local offset = Vec3(0.0,-(2.1 * yRand),0.0)+(mat:getRightVec():normalizeV() * (1.5 * ((2.0*math.randomFloat())-1.0)))
--gPer is the nature density on the map
gPer = 0.20 + (0.80*(calculateGreenDensity(list:item(i):getGlobalPosition()+offset)/greenDensityMax))
if gPer>math.randomFloat() then
local vStart = mat:getPosition() + offset + mat:getAtVec():normalizeV()
local vEnd = mat:getPosition() + offset - mat:getAtVec():normalizeV()
local vNormal = Vec3()
local cLine = Line3D(vStart,vEnd)
local retScene = island:collisionTree(cLine,vNormal)
if retScene then
--(0.65*yRand)>math.randomFloat() will increase posibility offset larger plant spwn lower down
if (0.65*yRand)>math.randomFloat() then
nature[natureCount] = Core.getModel( "Data/Models/nature/Plants/vines/vine_down2.mym" )
else
nature[natureCount] = Core.getModel( "Data/Models/nature/Plants/vines/vine_down1.mym" )
end
nature[natureCount]:setLocalPosition(mat:inverseM()*cLine.endPos)
natureConectToScene[natureCount] = list:item(i)
natureCount = natureCount + 1
end
end
end
--
-- roots
--
-- for j=0, 4, 1 do
-- local yRand = math.randomFloat()
-- local mat = list:item(i):getGlobalMatrix()
-- local offset = Vec3(0.0,-0.8-(1.3 * yRand),0.0)+(mat:getRightVec():normalizeV() * (1.5 * ((2.0*math.randomFloat())-1.0)))
--
-- --gPer is the nature density on the map
-- gPer = 0.15 + (0.85*(calculateGreenDensity(list:item(i):getGlobalPosition()+offset)/greenDensityMax))
-- if gPer>math.randomFloat() then
-- local vStart = mat:getPosition() + offset + mat:getAtVec():normalizeV()
-- local vEnd = mat:getPosition() + offset - mat:getAtVec():normalizeV()
-- local vNormal = Vec3()
-- local cLine = Line3D(vStart,vEnd)
-- local retScene = island:collisionTree(cLine,vNormal)
-- if retScene then
-- nature[natureCount] = Core.getModel( string.format("Data/Models/nature/roots/root%d.mym", (1.0+(math.randomFloat()*4.95))) )
-- nature[natureCount]:setLocalPosition(mat:inverseM()*cLine.endPos)
-- natureConectToScene[natureCount] = list:item(i)
-- natureCount = natureCount + 1
-- end
-- end
-- end
end
end
function update()
return false
end
|
-- simple.lua
-- Simple conditional expression example
a = 10
if a then
a = a / 2
else
a = a * 2
end
|
local builtin = require('telescope.builtin')
local function get_workspace_folder ()
return vim.lsp.buf.list_workspace_folders()[1] or vim.fn.systemlist('git rev-parse --show-toplevel')[1]
end
return require('telescope').register_extension {
setup = function()
builtin.live_grep_workspace = function(opts)
opts.cwd = get_workspace_folder()
builtin.live_grep(opts)
end
builtin.find_files_workspace = function(opts)
opts.cwd = get_workspace_folder()
builtin.find_files(opts)
end
builtin.grep_string_workspace = function(opts)
opts.cwd = get_workspace_folder()
builtin.grep_string(opts)
end
end;
}
|
-- Soldiers ( Team E )
-- Officer
mobs:register_mob("mobs_modern:moTEof", {
-- animal, monster, npc
name = "moTEofficer",
type = "armye", "te",
owner = "MisterE",
-- aggressive, shoots shuriken
damage = 3,
attack_type = "shoot",
shoot_interval = 1,
arrow = "mobs_modern:bullet",
shoot_offset = 2,
attacks_npcs = false,
attack_armyas = false,
attack_tas = false,
attack_armybs = true,
attacks_tbs = true,
attack_armycs = true,
attacks_tcs = true,
attack_armyds = true,
attacks_tds = true,
attack_armyes = false,
attacks_tes = false,
attack_evils = true,
group_attack = true,
peaceful = true,
passive = false,
pathfinding = true,
-- health & armor
hp_min = 20, hp_max = 30, armor = 100,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "3d_armor_character.b3d",
drawtype = "front",
textures = {
{"TE_sol_ofi1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_ofi2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
-- {"TE_sol_ofi3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
-- {"TE_sol_ofi4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
},
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
sounds = {},
-- speed and jump
walk_velocity = 3,
run_velocity = 3,
jump = true,
-- drops shuriken when dead
drops = {
{name = "default:apple",
chance = 1, min = 1, max = 5},
},
-- damaged by
water_damage = 0,
lava_damage = 2,
light_damage = 0,
fall_damage = 0,
view_range = 18,
-- model animation
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
shoot_start = 200, shoot_end = 219,
},
})
-- Special Forces
mobs:register_mob("mobs_modern:moTEsp", {
-- animal, monster, npc
name = "moTEsp",
type = "armye", "te",
owner = "PresidentE",
-- aggressive, shoots shuriken
damage = 5,
attack_type = "shoot",
shoot_interval = .2,
arrow = "mobs_modern:bullet",
shoot_offset = 2,
attack_monsters = true,
attacks_npcs = false,
attack_armyas = false,
attack_tas = false,
attack_armybs = true,
attacks_tbs = true,
attack_armycs = true,
attacks_tcs = true,
attack_armyds = true,
attacks_tds = true,
attack_armyes = false,
attacks_tes = false,
attack_evils = true,
group_attack = true,
peaceful = true,
passive = false,
pathfinding = true,
-- health & armor
hp_min = 24, hp_max = 36, armor = 90,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "3d_armor_character.b3d",
drawtype = "front",
textures = {
{"TE_sol_spe1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ak47"].inventory_image,},
{"TE_sol_spe2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ak47"].inventory_image,},
{"TE_sol_spe3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_rpk"].inventory_image,},
-- {"TE_sol_spe4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
-- {"TE_sol_spe5.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
-- {"TE_sol_spe6.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
-- {"TE_sol_spe7.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
},
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
sounds = {},
-- speed and jump
walk_velocity = 1.5,
run_velocity = 3,
jump = true,
-- drops shuriken when dead
drops = {
{name = "mobs:shurikent",
chance = 1, min = 1, max = 5},
},
-- damaged by
water_damage = 0,
lava_damage = 2,
light_damage = 0,
fall_damage = 0,
view_range = 20,
-- model animation
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
shoot_start = 200, shoot_end = 219,
},
})
-- Soldier
mobs:register_mob("mobs_modern:moTEso", {
-- animal, monster, npc
name = "moTEsoldier",
type = "armye", "te",
owner = "PresidentE",
-- aggressive, shoots shuriken
damage = 3,
attack_type = "shoot",
shoot_interval = .2,
arrow = "mobs_modern:bullet",
shoot_offset = 2,
attack_monsters = true,
attacks_npcs = false,
attack_armyas = false,
attack_tas = false,
attack_armybs = true,
attacks_tbs = true,
attack_armycs = true,
attacks_tcs = true,
attack_armyds = true,
attacks_tds = true,
attack_armyes = false,
attacks_tes = false,
attack_evils = true,
group_attack = true,
peaceful = true,
passive = false,
pathfinding = true,
-- health & armor
hp_min = 20, hp_max = 30, armor = 100,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "3d_armor_character.b3d",
drawtype = "front",
textures = {
{"TE_sol_infA1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infA2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infA3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_infA4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
{"TE_sol_infA5.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infA6.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infA7.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_infA8.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
{"TE_sol_infA9.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infA10.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infA11.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_infB1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
{"TE_sol_infB2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infB3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infB4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_infB5.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
{"TE_sol_infB6.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infB7.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infB8.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
-- {"TE_sol_infC1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infC2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infC3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_infC4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
{"TE_sol_infC5.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
{"TE_sol_infC6.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_infC7.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_infC8.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_infC9.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
},
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
sounds = {},
-- speed and jump
walk_velocity = 3,
run_velocity = 3,
jump = true,
-- drops shuriken when dead
drops = {
{name = "default:apple",
chance = 1, min = 1, max = 5},
},
-- damaged by
water_damage = 0,
lava_damage = 2,
light_damage = 0,
fall_damage = 0,
view_range = 18,
-- model animation
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
shoot_start = 200, shoot_end = 219,
},
})
-- Sniper
mobs:register_mob("mobs_modern:moTEsn", {
-- animal, monster, npc
name = "moTEsniper",
type = "armye", "te",
owner = "PresidentE",
-- aggressive, shoots shuriken
damage = 10,
attack_type = "shoot",
shoot_interval = 1.5,
arrow = "mobs_modern:snibul",
shoot_offset = 2,
attacks_npcs = false,
attack_armyas = false,
attack_tas = false,
attack_armybs = true,
attacks_tbs = true,
attack_armycs = true,
attacks_tcs = true,
attack_armyds = true,
attacks_tds = true,
attack_armyes = false,
attacks_tes = false,
attack_evils = true,
group_attack = true,
peaceful = true,
passive = false,
pathfinding = true,
-- health & armor
hp_min = 20, hp_max = 30, armor = 100,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "3d_armor_character.b3d",
drawtype = "front",
textures = {
{"TE_sol_sni1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_sni2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_sni3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_sni4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
-- {"TE_sol_sni5.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
{"TE_sol_sni6.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_mp5"].inventory_image,},
{"TE_sol_sni7.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ump"].inventory_image,},
{"TE_sol_sni8.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_benelli"].inventory_image,},
-- {"TE_sol_sni9.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_svd"].inventory_image,},
-- {"TE_sol_sni10.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_svd"].inventory_image,},
{"TE_sol_sco1.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ak47"].inventory_image,},
{"TE_sol_sco2.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_ak47"].inventory_image,},
{"TE_sol_sco3.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_rpk"].inventory_image,},
{"TE_sol_sco4.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_uzi"].inventory_image,},
},
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
sounds = {},
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
jump = true,
-- drops shuriken when dead
drops = {
{name = "default:apple",
chance = 1, min = 1, max = 5},
},
-- damaged by
water_damage = 0,
lava_damage = 2,
light_damage = 0,
fall_damage = 0,
view_range = 38,
-- model animation
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
shoot_start = 200, shoot_end = 219,
},
})
mobs:register_mob("mobs_modern:moTErp", {
-- animal, monster, npc
name = "moTErpgGuy",
type = "armye", "te",
owner = "PresidentE",
-- aggressive, shoots shuriken
damage = 3,
reach = 5,
attack_type = "shoot",
shoot_interval = 3.4,
arrow = "mobs_modern:shot_bazooka",
shoot_offset = 2,
attacks_monsters = true,
attack_animals = false,
attack_armyas = false,
attack_tas = false,
attack_armybs = true,
attacks_tbs = true,
attack_armycs = true,
attacks_tcs = true,
attack_armyds = true,
attacks_tds = true,
attack_armyes = false,
attacks_tes = false,
attack_evils = true,
group_attack = false,
peaceful = true,
passive = false,
-- health & armor
hp_min = 20, hp_max = 30, armor = 100,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "3d_armor_character.b3d",
drawtype = "front",
textures = {
{"TE_sol_infA10.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_rpg"].inventory_image,},
{"TE_sol_infB6.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_rpg"].inventory_image,},
{"TE_sol_infB8.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_rpg"].inventory_image,},
{"TE_sol_infC9.png", "3d_armor_trans.png", minetest.registered_items["mobs_modern:weapon_bazooka"].inventory_image,},
},
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
sounds = {},
-- speed and jump
walk_velocity = 2,
run_velocity = 2,
jump = true,
-- drops shuriken when dead
drops = {
{name = "default:apple",
chance = 1, min = 1, max = 5},
},
-- damaged by
water_damage = 0,
lava_damage = 2,
light_damage = 0,
fall_damage = 0,
view_range = 27,
-- model animation
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
shoot_start = 200, shoot_end = 219,
},
})
-- ninja spawn on top of trees
--mobs:register_spawn("testmobs:ninja", {"default:leaves"}, 5, 0, 10000, 1, 31000)
mobs:register_egg("mobs_modern:moTEof", "Officer (moTE)", "default_leaves.png", 1)
mobs:register_egg("mobs_modern:moTEsp", "Special Unit (moTE)", "default_leaves.png", 1)
mobs:register_egg("mobs_modern:moTEso", "Soldier (moTE)", "default_leaves.png", 1)
mobs:register_egg("mobs_modern:moTEsn", "Sniper (moTE)", "default_leaves.png", 1)
mobs:register_egg("mobs_modern:moTErp", "RPG Unit (moTE)", "default_leaves.png", 1)
|
--[=[
@c Guild x Snowflake
@d Represents a Discord guild (or server). Guilds are a collection of members,
channels, and roles that represents one community.
]=]
local Cache = require('iterables/Cache')
local Role = require('containers/Role')
local Emoji = require('containers/Emoji')
local Invite = require('containers/Invite')
local Webhook = require('containers/Webhook')
local Ban = require('containers/Ban')
local Member = require('containers/Member')
local Resolver = require('client/Resolver')
local AuditLogEntry = require('containers/AuditLogEntry')
local GuildTextChannel = require('containers/GuildTextChannel')
local GuildVoiceChannel = require('containers/GuildVoiceChannel')
local GuildCategoryChannel = require('containers/GuildCategoryChannel')
local Snowflake = require('containers/abstract/Snowflake')
local json = require('json')
local enums = require('enums')
local channelType = enums.channelType
local floor = math.floor
local format = string.format
local Guild, get = require('class')('Guild', Snowflake)
function Guild:__init(data, parent)
Snowflake.__init(self, data, parent)
self._roles = Cache({}, Role, self)
self._emojis = Cache({}, Emoji, self)
self._members = Cache({}, Member, self)
self._text_channels = Cache({}, GuildTextChannel, self)
self._voice_channels = Cache({}, GuildVoiceChannel, self)
self._categories = Cache({}, GuildCategoryChannel, self)
self._voice_states = {}
if not data.unavailable then
return self:_makeAvailable(data)
end
end
function Guild:_load(data)
Snowflake._load(self, data)
return self:_loadMore(data)
end
function Guild:_loadMore(data)
if data.features then
self._features = data.features
end
end
function Guild:_makeAvailable(data)
self._roles:_load(data.roles)
self._emojis:_load(data.emojis)
self:_loadMore(data)
if not data.channels then return end -- incomplete guild
local states = self._voice_states
for _, state in ipairs(data.voice_states) do
states[state.user_id] = state
end
local text_channels = self._text_channels
local voice_channels = self._voice_channels
local categories = self._categories
for _, channel in ipairs(data.channels) do
local t = channel.type
if t == channelType.text or t == channelType.news then
text_channels:_insert(channel)
elseif t == channelType.voice then
voice_channels:_insert(channel)
elseif t == channelType.category then
categories:_insert(channel)
end
end
for _, channel in ipairs(data.threads) do
channel.permission_overwrites = {}
text_channels:_insert(channel)._permission_overwrites = text_channels:get(channel.parent_id)._permission_overwrites
end
return self:_loadMembers(data)
end
function Guild:_loadMembers(data)
local members = self._members
members:_load(data.members)
for _, presence in ipairs(data.presences) do
local member = members:get(presence.user.id)
if member then -- rogue presence check
member:_loadPresence(presence)
end
end
if self._large and self.client._options.cacheAllMembers then
return self:requestMembers()
end
end
function Guild:_modify(payload)
local data, err = self.client._api:modifyGuild(self._id, payload)
if data then
self:_load(data)
return true
else
return false, err
end
end
--[=[
@m requestMembers
@t ws
@r boolean
@d Asynchronously loads all members for this guild. You do not need to call this
if the `cacheAllMembers` client option (and the `syncGuilds` option for
user-accounts) is enabled on start-up.
]=]
function Guild:requestMembers()
local shard = self.client._shards[self.shardId]
if not shard then
return false, 'Invalid shard'
end
if shard._loading then
shard._loading.chunks[self._id] = true
end
return shard:requestGuildMembers(self._id)
end
--[=[
@m sync
@t ws
@r boolean
@d Asynchronously loads certain data and enables the receiving of certain events
for this guild. You do not need to call this if the `syncGuilds` client option
is enabled on start-up.
Note: This is only for user accounts. Bot accounts never need to sync guilds!
]=]
function Guild:sync()
local shard = self.client._shards[self.shardId]
if not shard then
return false, 'Invalid shard'
end
if shard._loading then
shard._loading.syncs[self._id] = true
end
return shard:syncGuilds({self._id})
end
--[=[
@m getMember
@t http?
@p id User-ID-Resolvable
@r Member
@d Gets a member object by ID. If the object is already cached, then the cached
object will be returned; otherwise, an HTTP request is made.
]=]
function Guild:getMember(id)
id = Resolver.userId(id)
local member = self._members:get(id)
if member then
return member
else
local data, err = self.client._api:getGuildMember(self._id, id)
if data then
return self._members:_insert(data)
else
return nil, err
end
end
end
--[=[
@m getRole
@t mem
@p id Role-ID-Resolvable
@r Role
@d Gets a role object by ID.
]=]
function Guild:getRole(id)
id = Resolver.roleId(id)
return self._roles:get(id)
end
--[=[
@m getEmoji
@t mem
@p id Emoji-ID-Resolvable
@r Emoji
@d Gets a emoji object by ID.
]=]
function Guild:getEmoji(id)
id = Resolver.emojiId(id)
return self._emojis:get(id)
end
--[=[
@m getChannel
@t mem
@p id Channel-ID-Resolvable
@r GuildChannel
@d Gets a text, voice, or category channel object by ID.
]=]
function Guild:getChannel(id)
id = Resolver.channelId(id)
return self._text_channels:get(id) or self._voice_channels:get(id) or self._categories:get(id)
end
--[=[
@m createTextChannel
@t http
@p name string
@r GuildTextChannel
@d Creates a new text channel in this guild. The name must be between 2 and 100
characters in length.
]=]
function Guild:createTextChannel(name)
local data, err = self.client._api:createGuildChannel(self._id, {name = name, type = channelType.text})
if data then
return self._text_channels:_insert(data)
else
return nil, err
end
end
--[=[
@m createVoiceChannel
@t http
@p name string
@r GuildVoiceChannel
@d Creates a new voice channel in this guild. The name must be between 2 and 100
characters in length.
]=]
function Guild:createVoiceChannel(name)
local data, err = self.client._api:createGuildChannel(self._id, {name = name, type = channelType.voice})
if data then
return self._voice_channels:_insert(data)
else
return nil, err
end
end
--[=[
@m createCategory
@t http
@p name string
@r GuildCategoryChannel
@d Creates a channel category in this guild. The name must be between 2 and 100
characters in length.
]=]
function Guild:createCategory(name)
local data, err = self.client._api:createGuildChannel(self._id, {name = name, type = channelType.category})
if data then
return self._categories:_insert(data)
else
return nil, err
end
end
--[=[
@m createRole
@t http
@p name string
@r Role
@d Creates a new role in this guild. The name must be between 1 and 100 characters
in length.
]=]
function Guild:createRole(name)
local data, err = self.client._api:createGuildRole(self._id, {name = name})
if data then
return self._roles:_insert(data)
else
return nil, err
end
end
--[=[
@m createEmoji
@t http
@p name string
@p image Base64-Resolvable
@r Emoji
@d Creates a new emoji in this guild. The name must be between 2 and 32 characters
in length. The image must not be over 256kb, any higher will return a 400 Bad Request
]=]
function Guild:createEmoji(name, image)
image = Resolver.base64(image)
local data, err = self.client._api:createGuildEmoji(self._id, {name = name, image = image})
if data then
return self._emojis:_insert(data)
else
return nil, err
end
end
--[=[
@m setName
@t http
@p name string
@r boolean
@d Sets the guilds name. This must be between 2 and 100 characters in length.
]=]
function Guild:setName(name)
return self:_modify({name = name or json.null})
end
--[=[
@m setRegion
@t http
@p region string
@r boolean
@d Sets the guild's voice region (eg: `us-east`). See `listVoiceRegions` for a list
of acceptable regions.
]=]
function Guild:setRegion(region)
return self:_modify({region = region or json.null})
end
--[=[
@m setVerificationLevel
@t http
@p verification_level number
@r boolean
@d Sets the guild's verification level setting. See the `verificationLevel`
enumeration for acceptable values.
]=]
function Guild:setVerificationLevel(verification_level)
return self:_modify({verification_level = verification_level or json.null})
end
--[=[
@m setNotificationSetting
@t http
@p default_message_notifications number
@r boolean
@d Sets the guild's default notification setting. See the `notficationSetting`
enumeration for acceptable values.
]=]
function Guild:setNotificationSetting(default_message_notifications)
return self:_modify({default_message_notifications = default_message_notifications or json.null})
end
--[=[
@m setExplicitContentSetting
@t http
@p explicit_content_filter number
@r boolean
@d Sets the guild's explicit content level setting. See the `explicitContentLevel`
enumeration for acceptable values.
]=]
function Guild:setExplicitContentSetting(explicit_content_filter)
return self:_modify({explicit_content_filter = explicit_content_filter or json.null})
end
--[=[
@m setAFKTimeout
@t http
@p afk_timeout number
@r number
@d Sets the guild's AFK timeout in seconds.
]=]
function Guild:setAFKTimeout(afk_timeout)
return self:_modify({afk_timeout = afk_timeout or json.null})
end
--[=[
@m setAFKChannel
@t http
@p id Channel-ID-Resolvable
@r boolean
@d Sets the guild's AFK channel.
]=]
function Guild:setAFKChannel(id)
id = id and Resolver.channelId(id)
return self:_modify({afk_channel_id = id or json.null})
end
--[=[
@m setSystemChannel
@t http
@p id Channel-Id-Resolvable
@r boolean
@d Sets the guild's join message channel.
]=]
function Guild:setSystemChannel(id)
id = id and Resolver.channelId(id)
return self:_modify({system_channel_id = id or json.null})
end
--[=[
@m setOwner
@t http
@p id User-ID-Resolvable
@r boolean
@d Transfers ownership of the guild to another user. Only the current guild owner
can do this.
]=]
function Guild:setOwner(id)
id = id and Resolver.userId(id)
return self:_modify({owner_id = id or json.null})
end
--[=[
@m setIcon
@t http
@p icon Base64-Resolvable
@r boolean
@d Sets the guild's icon. To remove the icon, pass `nil`.
]=]
function Guild:setIcon(icon)
icon = icon and Resolver.base64(icon)
return self:_modify({icon = icon or json.null})
end
--[=[
@m setBanner
@t http
@p banner Base64-Resolvable
@r boolean
@d Sets the guild's banner. To remove the banner, pass `nil`.
]=]
function Guild:setBanner(banner)
banner = banner and Resolver.base64(banner)
return self:_modify({banner = banner or json.null})
end
--[=[
@m setSplash
@t http
@p splash Base64-Resolvable
@r boolean
@d Sets the guild's splash. To remove the splash, pass `nil`.
]=]
function Guild:setSplash(splash)
splash = splash and Resolver.base64(splash)
return self:_modify({splash = splash or json.null})
end
--[=[
@m getPruneCount
@t http
@op days number
@r number
@d Returns the number of members that would be pruned from the guild if a prune
were to be executed.
]=]
function Guild:getPruneCount(days)
local data, err = self.client._api:getGuildPruneCount(self._id, days and {days = days} or nil)
if data then
return data.pruned
else
return nil, err
end
end
--[=[
@m pruneMembers
@t http
@op days number
@op count boolean
@r number
@d Prunes (removes) inactive, roleless members from the guild who have not been online in the last provided days.
If the `count` boolean is provided, the number of pruned members is returned; otherwise, `0` is returned.
]=]
function Guild:pruneMembers(days, count)
local t1 = type(days)
if t1 == 'number' then
count = type(count) == 'boolean' and count
elseif t1 == 'boolean' then
count = days
days = nil
end
local data, err = self.client._api:beginGuildPrune(self._id, nil, {
days = days,
compute_prune_count = count,
})
if data then
return data.pruned
else
return nil, err
end
end
--[=[
@m getBans
@t http
@r Cache
@d Returns a newly constructed cache of all ban objects for the guild. The
cache and its objects are not automatically updated via gateway events. You must
call this method again to get the updated objects.
]=]
function Guild:getBans()
local data, err = self.client._api:getGuildBans(self._id)
if data then
return Cache(data, Ban, self)
else
return nil, err
end
end
--[=[
@m getBan
@t http
@p id User-ID-Resolvable
@r Ban
@d This will return a Ban object for a giver user if that user is banned
from the guild; otherwise, `nil` is returned.
]=]
function Guild:getBan(id)
id = Resolver.userId(id)
local data, err = self.client._api:getGuildBan(self._id, id)
if data then
return Ban(data, self)
else
return nil, err
end
end
--[=[
@m getInvites
@t http
@r Cache
@d Returns a newly constructed cache of all invite objects for the guild. The
cache and its objects are not automatically updated via gateway events. You must
call this method again to get the updated objects.
]=]
function Guild:getInvites()
local data, err = self.client._api:getGuildInvites(self._id)
if data then
return Cache(data, Invite, self.client)
else
return nil, err
end
end
--[=[
@m getAuditLogs
@t http
@op query table
@r Cache
@d Returns a newly constructed cache of audit log entry objects for the guild. The
cache and its objects are not automatically updated via gateway events. You must
call this method again to get the updated objects.
If included, the query parameters include: query.limit: number, query.user: UserId Resolvable
query.before: EntryId Resolvable, query.type: ActionType Resolvable
]=]
function Guild:getAuditLogs(query)
if type(query) == 'table' then
query = {
limit = query.limit,
user_id = Resolver.userId(query.user),
before = Resolver.entryId(query.before),
action_type = Resolver.actionType(query.type),
}
end
local data, err = self.client._api:getGuildAuditLog(self._id, query)
if data then
self.client._users:_load(data.users)
self.client._webhooks:_load(data.webhooks)
return Cache(data.audit_log_entries, AuditLogEntry, self)
else
return nil, err
end
end
--[=[
@m getWebhooks
@t http
@r Cache
@d Returns a newly constructed cache of all webhook objects for the guild. The
cache and its objects are not automatically updated via gateway events. You must
call this method again to get the updated objects.
]=]
function Guild:getWebhooks()
local data, err = self.client._api:getGuildWebhooks(self._id)
if data then
return Cache(data, Webhook, self.client)
else
return nil, err
end
end
--[=[
@m listVoiceRegions
@t http
@r table
@d Returns a raw data table that contains a list of available voice regions for
this guild, as provided by Discord, with no additional parsing.
]=]
function Guild:listVoiceRegions()
return self.client._api:getGuildVoiceRegions(self._id)
end
--[=[
@m leave
@t http
@r boolean
@d Removes the current user from the guild.
]=]
function Guild:leave()
local data, err = self.client._api:leaveGuild(self._id)
if data then
return true
else
return false, err
end
end
--[=[
@m delete
@t http
@r boolean
@d Permanently deletes the guild. The current user must owner the server. This cannot be undone!
]=]
function Guild:delete()
local data, err = self.client._api:deleteGuild(self._id)
if data then
local cache = self._parent._guilds
if cache then
cache:_delete(self._id)
end
return true
else
return false, err
end
end
--[=[
@m kickUser
@t http
@p id User-ID-Resolvable
@op reason string
@r boolean
@d Kicks a user/member from the guild with an optional reason.
]=]
function Guild:kickUser(id, reason)
id = Resolver.userId(id)
local query = reason and {reason = reason}
local data, err = self.client._api:removeGuildMember(self._id, id, query)
if data then
return true
else
return false, err
end
end
--[=[
@m banUser
@t http
@p id User-ID-Resolvable
@op reason string
@op days number
@r boolean
@d Bans a user/member from the guild with an optional reason. The `days` parameter
is the number of days to consider when purging messages, up to 7.
]=]
function Guild:banUser(id, reason, days)
local query = reason and {reason = reason}
if days then
query = query or {}
query['delete-message-days'] = days
end
id = Resolver.userId(id)
local data, err = self.client._api:createGuildBan(self._id, id, query)
if data then
return true
else
return false, err
end
end
--[=[
@m unbanUser
@t http
@p id User-ID-Resolvable
@op reason string
@r boolean
@d Unbans a user/member from the guild with an optional reason.
]=]
function Guild:unbanUser(id, reason)
id = Resolver.userId(id)
local query = reason and {reason = reason}
local data, err = self.client._api:removeGuildBan(self._id, id, query)
if data then
return true
else
return false, err
end
end
--[=[@p shardId number The ID of the shard on which this guild is served. If only one shard is in
operation, then this will always be 0.]=]
function get.shardId(self)
return floor(self._id / 2^22) % self.client._total_shard_count
end
--[=[@p name string The guild's name. This should be between 2 and 100 characters in length.]=]
function get.name(self)
return self._name
end
--[=[@p icon string/nil The hash for the guild's custom icon, if one is set.]=]
function get.icon(self)
return self._icon
end
--[=[@p iconURL string/nil The URL that can be used to view the guild's icon, if one is set.]=]
function get.iconURL(self)
local icon = self._icon
return icon and format('https://cdn.discordapp.com/icons/%s/%s.png', self._id, icon)
end
--[=[@p splash string/nil The hash for the guild's custom splash image, if one is set. Only partnered
guilds may have this.]=]
function get.splash(self)
return self._splash
end
--[=[@p splashURL string/nil The URL that can be used to view the guild's custom splash image, if one is set.
Only partnered guilds may have this.]=]
function get.splashURL(self)
local splash = self._splash
return splash and format('https://cdn.discordapp.com/splashes/%s/%s.png', self._id, splash)
end
--[=[@p banner string/nil The hash for the guild's custom banner, if one is set.]=]
function get.banner(self)
return self._banner
end
--[=[@p bannerURL string/nil The URL that can be used to view the guild's banner, if one is set.]=]
function get.bannerURL(self)
local banner = self._banner
return banner and format('https://cdn.discordapp.com/banners/%s/%s.png', self._id, banner)
end
--[=[@p large boolean Whether the guild has an arbitrarily large amount of members. Guilds that are
"large" will not initialize with all members cached.]=]
function get.large(self)
return self._large
end
--[=[@p lazy boolean Whether the guild follows rules for the lazy-loading of client data.]=]
function get.lazy(self)
return self._lazy
end
--[=[@p region string The voice region that is used for all voice connections in the guild.]=]
function get.region(self)
return self._region
end
--[=[@p vanityCode string/nil The guild's vanity invite URL code, if one exists.]=]
function get.vanityCode(self)
return self._vanity_url_code
end
--[=[@p description string/nil The guild's custom description, if one exists.]=]
function get.description(self)
return self._description
end
--[=[@p maxMembers number/nil The guild's maximum member count, if available.]=]
function get.maxMembers(self)
return self._max_members
end
--[=[@p maxPresences number/nil The guild's maximum presence count, if available.]=]
function get.maxPresences(self)
return self._max_presences
end
--[=[@p mfaLevel number The guild's multi-factor (or two-factor) verification level setting. A value of
0 indicates that MFA is not required; a value of 1 indicates that MFA is
required for administrative actions.]=]
function get.mfaLevel(self)
return self._mfa_level
end
--[=[@p joinedAt string The date and time at which the current user joined the guild, represented as
an ISO 8601 string plus microseconds when available.]=]
function get.joinedAt(self)
return self._joined_at
end
--[=[@p afkTimeout number The guild's voice AFK timeout in seconds.]=]
function get.afkTimeout(self)
return self._afk_timeout
end
--[=[@p unavailable boolean Whether the guild is unavailable. If the guild is unavailable, then no property
is guaranteed to exist except for this one and the guild's ID.]=]
function get.unavailable(self)
return self._unavailable or false
end
--[=[@p totalMemberCount number The total number of members that belong to this guild. This should always be
greater than or equal to the total number of cached members.]=]
function get.totalMemberCount(self)
return self._member_count
end
--[=[@p verificationLevel number The guild's verification level setting. See the `verificationLevel`
enumeration for a human-readable representation.]=]
function get.verificationLevel(self)
return self._verification_level
end
--[=[@p notificationSetting number The guild's default notification setting. See the `notficationSetting`
enumeration for a human-readable representation.]=]
function get.notificationSetting(self)
return self._default_message_notifications
end
--[=[@p explicitContentSetting number The guild's explicit content level setting. See the `explicitContentLevel`
enumeration for a human-readable representation.]=]
function get.explicitContentSetting(self)
return self._explicit_content_filter
end
--[=[@p premiumTier number The guild's premier tier affected by nitro server
boosts. See the `premiumTier` enumeration for a human-readable representation]=]
function get.premiumTier(self)
return self._premium_tier
end
--[=[@p premiumSubscriptionCount number The number of users that have upgraded
the guild with nitro server boosting.]=]
function get.premiumSubscriptionCount(self)
return self._premium_subscription_count
end
--[=[@p features table Raw table of VIP features that are enabled for the guild.]=]
function get.features(self)
return self._features
end
--[=[@p me Member/nil Equivalent to `Guild.members:get(Guild.client.user.id)`.]=]
function get.me(self)
return self._members:get(self.client._user._id)
end
--[=[@p owner Member/nil Equivalent to `Guild.members:get(Guild.ownerId)`.]=]
function get.owner(self)
return self._members:get(self._owner_id)
end
--[=[@p ownerId string The Snowflake ID of the guild member that owns the guild.]=]
function get.ownerId(self)
return self._owner_id
end
--[=[@p afkChannelId string/nil The Snowflake ID of the channel that is used for AFK members, if one is set.]=]
function get.afkChannelId(self)
return self._afk_channel_id
end
--[=[@p afkChannel GuildVoiceChannel/nil Equivalent to `Guild.voiceChannels:get(Guild.afkChannelId)`.]=]
function get.afkChannel(self)
return self._voice_channels:get(self._afk_channel_id)
end
--[=[@p systemChannelId string/nil The channel id where Discord's join messages will be displayed.]=]
function get.systemChannelId(self)
return self._system_channel_id
end
--[=[@p systemChannel GuildTextChannel/nil The channel where Discord's join messages will be displayed.]=]
function get.systemChannel(self)
return self._text_channels:get(self._system_channel_id)
end
--[=[@p defaultRole Role Equivalent to `Guild.roles:get(Guild.id)`.]=]
function get.defaultRole(self)
return self._roles:get(self._id)
end
--[=[@p connection VoiceConnection/nil The VoiceConnection for this guild if one exists.]=]
function get.connection(self)
return self._connection
end
--[=[@p roles Cache An iterable cache of all roles that exist in this guild. This includes the
default everyone role.]=]
function get.roles(self)
return self._roles
end
--[=[@p emojis Cache An iterable cache of all emojis that exist in this guild. Note that standard
unicode emojis are not found here; only custom emojis.]=]
function get.emojis(self)
return self._emojis
end
--[=[@p members Cache An iterable cache of all members that exist in this guild and have been
already loaded. If the `cacheAllMembers` client option (and the `syncGuilds`
option for user-accounts) is enabled on start-up, then all members will be
cached. Otherwise, offline members may not be cached. To access a member that
may exist, but is not cached, use `Guild:getMember`.]=]
function get.members(self)
return self._members
end
--[=[@p textChannels Cache An iterable cache of all text channels that exist in this guild.]=]
function get.textChannels(self)
return self._text_channels
end
--[=[@p voiceChannels Cache An iterable cache of all voice channels that exist in this guild.]=]
function get.voiceChannels(self)
return self._voice_channels
end
--[=[@p categories Cache An iterable cache of all channel categories that exist in this guild.]=]
function get.categories(self)
return self._categories
end
return Guild
|
vim.deepcopy = (function()
local function _id(v)
return v
end
local deepcopy_funcs = {
table = function(orig)
local copy = {}
if vim._empty_dict_mt ~= nil and getmetatable(orig) == vim._empty_dict_mt then
copy = vim.empty_dict()
end
for k, v in pairs(orig) do
copy[vim.deepcopy(k)] = vim.deepcopy(v)
end
if getmetatable(orig) then
setmetatable(copy, getmetatable(orig))
end
return copy
end,
['function'] = _id or function(orig)
local ok, dumped = pcall(string.dump, orig)
if not ok then
error(debug.traceback(dumped))
end
local cloned = loadstring(dumped)
local i = 1
while true do
local name = debug.getupvalue(orig, i)
if not name then
break
end
debug.upvaluejoin(cloned, i, orig, i)
i = i + 1
end
return cloned
end,
number = _id,
string = _id,
['nil'] = _id,
boolean = _id,
}
return function(orig)
local f = deepcopy_funcs[type(orig)]
if f then
return f(orig)
else
error("Cannot deepcopy object of type "..type(orig))
end
end
end)()
|
--
-- astar.lua
-- lua-astar
--
-- Based on John Eriksson's Python A* implementation.
-- http://www.pygame.org/project-AStar-195-.html
--
-- Created by Jay Roberts on 2011-01-08.
-- Copyright 2011 Jay Roberts All rights reserved.
--
-- Licensed under the MIT License
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
local util = include( "modules/util" )
-------------------------------------------------------------------------------
-- Represents a path found by the AStar pather.
local Path = {}
function Path:new(nodes, totalCost, startNode)
local instance = util.tcopy(self)
instance.nodes = nodes -- An array of nodes in order of path traversal
instance.totalCost = totalCost -- The total cost of the discovered path over all nodes
instance.startNode = startNode
return instance
end
function Path:getNodes()
return self.nodes
end
function Path:getStartNode()
return self.startNode
end
function Path:getTotalMoveCost()
return self.totalCost
end
-----------------------------------------------------------------------------------
-- A generic search node for the AStar pather. Included in the Path search result.
local Node = {}
function Node:new(location, mCost, lid, parent)
local instance = util.tcopy(self)
instance.location = location -- Where is the node located
instance.mCost = mCost -- Total move cost to reach this node
instance.parent = parent -- Parent node
instance.score = 0 -- Calculated score for this node
instance.depth = parent and (parent.depth + 1) or 0
instance.lid = lid -- set the location id - unique for each location in the map
return instance
end
function Node:isEqual(a, b)
return a.lid == b.lid
end
-------------------------------------------------------------------------------
--
local AStar = {}
function AStar:new( maphandler )
local instance = util.tcopy( self )
instance.mh = maphandler
return instance
end
function AStar:_getBestOpenNode()
local bestNode = nil
for lid, n in pairs(self.open) do
if bestNode == nil then
bestNode = n
else
if n.score < bestNode.score then
bestNode = n
elseif n.score == bestNode.score then
if type(n.location) == "number" then
if n.location < bestNode.location then
bestNode = n
end
elseif (n.location.y < bestNode.location.y or (n.location.y == bestNode.location.y and n.location.x < bestNode.location.x) ) then
bestNode = n
end
end
end
end
return bestNode
end
function AStar:_tracePath(n)
local nodes = {}
local totalCost = n.mCost
local p = n.parent
table.insert(nodes, 1, n)
while true do
if p.parent == nil then
break
end
table.insert(nodes, 1, p)
p = p.parent
end
return Path:new(nodes, totalCost, p)
end
function AStar:_handleNode(node, goal, ignoreGoal)
self.open[node.lid] = nil
self.closed[node.lid] = node.mCost
assert(node.location ~= nil, 'About to pass a node with nil location to getAdjacentNodes')
local nodes = self.mh:getAdjacentNodes(node, goal, self.closed)
for lid, n in ipairs(nodes) do
if not ignoreGoal and self.mh:isGoal(n, goal) then
return n
elseif self.closed[n.lid] ~= nil then -- Alread in close, skip this
elseif self.open[n.lid] ~= nil then -- Already in open, check if better score
local on = self.open[n.lid]
if n.mCost < on.mCost then
self.open[n.lid] = nil
self.open[n.lid] = n
end
else -- New node, append to open list
self.open[n.lid] = n
end
end
return nil
end
function AStar:findPath(fromlocation, tolocation)
self.open = {}
self.closed = {}
local goal = tolocation
local fnode = self.mh:getNode(fromlocation)
local nextNode = nil
if fnode ~= nil then
self.open[fnode.lid] = fnode
nextNode = fnode
end
while nextNode ~= nil do
local finish = self:_handleNode(nextNode, goal)
if finish then
return self:_tracePath(finish)
end
nextNode = self:_getBestOpenNode()
end
return nil
end
function AStar:findNodeCost(fromlocation, tolocation, testLocation)
-- return the node cost for 'testLocation'.
-- This function can be called iteratively (self.closed is cached for future queries)
if self.closed == nil then
self.closed = {}
end
local testNode = self.mh:getNode(testLocation)
if self.closed[testNode.lid] then
--log:write("TRUECOST (%d, %d) -> (%d, %d) for cell (%d, %d) is %.2f (%d closed)",
-- fromlocation.x, fromlocation.y, tolocation.x, tolocation.y, testLocation.x, testLocation.y, self.closed[testNode.lid], util.tcount(self.closed))
return self.closed[testNode.lid]
end
local nextNode = nil
if self.open == nil then
nextNode = self.mh:getNode(fromlocation)
self.open = {}
else
nextNode = self:_getBestOpenNode()
end
while nextNode ~= nil do
self:_handleNode( nextNode, tolocation, true )
if self.closed[testNode.lid] then
--log:write("TRUECOST (%d, %d) -> (%d, %d) for cell (%d, %d) is %d (%d closed)",
-- fromlocation.x, fromlocation.y, tolocation.x, tolocation.y, testLocation.x, testLocation.y, self.closed[testNode.lid], util.tcount(self.closed))
return self.closed[testNode.lid]
end
nextNode = self:_getBestOpenNode()
end
--log:write("No true-cost heuristic for (%d, %d) (%d closed)", testLocation.x, testLocation.y, util.tcount(self.closed))
-- Cache this unreachable node in the closed list.
self.closed[testNode.lid] = nil
return nil
end
return
{
AStar = AStar,
Path = Path,
Node = Node,
}
|
slot0 = class("StaticCellView", import("view.level.cell.LevelCellView"))
slot0.Ctor = function (slot0, slot1)
slot0.super.Ctor(slot0)
slot0.parent = slot1
slot0.go = nil
slot0.tf = nil
slot0.info = nil
end
slot0.GetOrder = function (slot0)
return ChapterConst.CellPriorityNone
end
slot0.SetTpl = function (slot0, slot1)
slot0._tpl = slot1
end
slot0.UpdateGO = function (slot0)
if slot0._tpl and slot0._currentTpl ~= slot1 then
slot0:DestroyGO()
slot0.go = Instantiate(slot1)
setParent(slot0.go, slot0.parent)
slot0.tf = slot0.go.transform
slot0._currentTpl = slot1
slot0:OverrideCanvas()
end
end
slot0.PrepareBase = function (slot0, slot1)
slot0.go = GameObject.New(slot1)
slot0.go:AddComponent(typeof(RectTransform))
setParent(slot0.go, slot0.parent)
slot0.tf = tf(slot0.go)
slot0.tf.sizeDelta = slot0.parent.sizeDelta
slot0:OverrideCanvas()
slot0:ResetCanvasOrder()
end
slot0.SetActive = function (slot0, slot1)
setActive(slot0.go, slot1)
end
slot0.DestroyGO = function (slot0)
if slot0.loader then
slot0.loader:ClearRequests()
end
if not IsNil(slot0.go) then
Destroy(slot0.go)
slot0.go = nil
slot0.tf = nil
end
end
slot0.Clear = function (slot0)
slot0.parent = nil
slot0._tpl = nil
slot0._currentTpl = nil
slot0.info = nil
slot0:DestroyGO()
end
return slot0
|
local cf = require "cf"
local child = require "child"
local pids = {}
local pid_cb = nil
local co = coroutine.create(function ()
while true do
local pid, code = coroutine.yield()
if pid_cb then
cf.fork(pid_cb, pid, code)
else
print('exit', pid, pids[pid])
end
end
end)
coroutine.resume(co)
local event = {}
function event.init(pid_list)
for _, pid in ipairs(pid_list) do
pids[pid] = child.watch(pid, co)
end
end
function event.setcb(func)
pid_cb = func
end
return event
|
newoption {
trigger = "plainc",
description = "Set this to build GL Load without C++ support.",
}
project("glload")
kind "StaticLib"
includedirs {"include", "source"}
targetdir "lib"
if(_OPTIONS["plainc"]) then
language "c"
else
language "c++"
end
files {
"include/glload/gl_*.h",
"include/glload/gl_*.hpp",
"include/glload/gll.h",
"include/glload/gll.hpp",
"source/gll*.c",
"source/gll*.cpp",
"source/gll*.h",
};
configuration "plainc"
excludes {
"source/gll*.cpp",
"include/glload/gll.hpp",
"include/glload/gl_*.hpp"
}
configuration "windows"
defines {"WIN32"}
files {"include/glload/wgl_*.h",}
files {"source/wgll*.c",
"source/wgll*.cpp",
"source/wgll*.h",}
configuration "linux"
defines {"LOAD_X11"}
files {"include/glload/glx_*.h"}
files {"source/glxl*.c",
"source/glxl*.cpp",
"source/glxl*.h",}
configuration "Debug"
flags "Unicode";
defines {"DEBUG", "_DEBUG", "MEMORY_DEBUGGING"};
objdir "Debug";
flags "Symbols";
targetname "glloadD";
configuration "Release"
defines {"NDEBUG", "RELEASE"};
flags "Unicode";
flags {"OptimizeSpeed", "NoFramePointer", "ExtraWarnings", "NoEditAndContinue"};
objdir "Release";
targetname "glload"
|
resource.AddFile( "materials/vgui/entities/weapon_acf_xm25.vmt" )
AddCSLuaFile( "shared.lua" )
if CLIENT then -- Client only variables
SWEP.Slot = 3 -- Slot in the weapon selection menu
SWEP.SlotPos = 12 -- Position in the slot
killicon.AddFont( "weapon_acf_awp", "CSSD_Killcon", "r", Color( 255, 80, 0, 255 ) )
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/gfx/vgui/fav_weap/awp" )
SWEP.UseHands = false
end
if SERVER then -- Server only variables
-- Nothing here!
end
if true then -- Shared variables
SWEP.PrintName = "XM25" -- 'Nice' Weapon name (Shown on HUD)
SWEP.Base = "weapon_acf_base"
SWEP.HoldType = "crossbow"
SWEP.ViewModel = "models/weapons/v_xm25.mdl"
SWEP.WorldModel = "models/weapons/w_xm25.mdl"
SWEP.Spawnable = true
SWEP.AdminSpawnable = false
SWEP.Category = "ACF"
SWEP.Primary.Ammo = "SMG1_Grenade"
sound.Add( {
name = "ACF_SWEP_xm25",
channel = CHAN_WEAPON,
volume = VOL_NORM,
level = 80,
pitch = { 95, 110 },
sound = ")weapons/grenade_launcher1.wav"
} )
SWEP.Primary.Sound = "ACF_SWEP_xm25"
SWEP.Primary.TPSound = "ACF_SWEP_xm25"
SWEP.Primary.Delay = 1.6
SWEP.Primary.ClipSize = 5
SWEP.Primary.DefaultClip = 10
SWEP.Primary.Automatic = false
SWEP.ReloadTime = 3.6
SWEP.Launcher = false
SWEP.AimOffset = Vector( 32, 8, -1 )
-- Gun statistics
SWEP.Handling = {}
SWEP.Handling.Mass = 6350 -- Weight in grams
SWEP.Handling.Barrel = 450 -- Barrel length in milimeters
SWEP.Handling.Balance = 1 -- Recoil multiplier for this weapon
-- Sight Options
SWEP.HasZoom = true
SWEP.ZoomFOV = 10
-- Custom Ammunition
function SWEP:InitBulletData()
self.BulletData = {}
self.BulletData["Accel"] = Vector( 0.000000, 0.000000, -600.000000 )
self.BulletData["BoomPower"] = 0.09550192653132
self.BulletData["Caliber"] = 4
self.BulletData["Colour"] = Color( 255, 255, 255 )
self.BulletData["DetonatorAngle"] = 80
self.BulletData["DragCoef"] = 0.0053551695179568
self.BulletData["FillerMass"] = 0.09530086413132
self.BulletData["FrAera"] = 12.5664
self.BulletData["Id"] = "40mmGL"
self.BulletData["KETransfert"] = 0.1
self.BulletData["LimitVel"] = 100
self.BulletData["MuzzleVel"] = 210
self.BulletData["PenAera"] = 8.5966500438773
self.BulletData["ProjLength"] = 6
self.BulletData["ProjMass"] = 0.23465923829046
self.BulletData["PropLength"] = 0.01
self.BulletData["PropMass"] = 0.0002010624
self.BulletData["Ricochet"] = 60
self.BulletData["RoundVolume"] = 75.524064
self.BulletData["ShovePower"] = 0.1
self.BulletData["Tracer"] = 1.25
self.BulletData["Type"] = "HE"
end
end
|
local sayHi = require('sayHi')
sayHi('world')
|
local changeYourJob, inMenu = vector3(478.79, -107.85, 63.15), false
local plyPed, plyCoords = PlayerPedId(), vector3(0, 0, 0)
OnGoingHuntSession = false
local timer = 0
TempLicense = 0
local Blips = {
['hunting'] = {
['blips'] = {
[1] = {['blip'] = 0, ['title'] = 'Hunting Office', ['coords'] = vector3(-675.4431, 5836.979, 17.34016), ['type'] = 141, ['colour'] = 31},
[2] = {['blip'] = 0, ['title'] = 'Hunting Trading', ['coords'] = vector3(569.04, 2796.67, 42.01), ['type'] = 628, ['colour'] = 2},
}
}
}
RegisterNetEvent('npc-hunting:obtainLicense')
AddEventHandler('npc-hunting:obtainLicense', function()
TempLicense = 1
end)
function DrawText3Ds(coords, text)
if coords then
local onScreen,_x,_y=World3dToScreen2d(coords.x,coords.y,coords.z)
local px,py,pz=table.unpack(GetGameplayCamCoords())
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x,_y)
local factor = #text / 370
DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)
end
end
CreateThread(function()
local blipInfo = Blips['hunting']['blips'][1]
blipInfo.blip = AddBlipForCoord(blipInfo.coords)
SetBlipSprite(blipInfo.blip, blipInfo.type)
SetBlipDisplay(blipInfo.blip, 4)
SetBlipScale(blipInfo.blip, 0.7)
SetBlipColour(blipInfo.blip, blipInfo.colour)
SetBlipAsShortRange(blipInfo.blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(blipInfo.title)
EndTextCommandSetBlipName(blipInfo.blip)
TriggerEvent('chat:addSuggestion', '/checkhunting', '/checkhunting CID. Check hunting license status')
end)
-- Hunting and other jobs:
local huntingAnimals = {
[`a_c_boar`] = {
['time'] = math.random(90000, 110000),
['pelt'] = {['item'] = 'pelt20', ['quant'] = 1},
['meat'] = {['item'] = 'rawmeat', ['quant'] = math.random(3,6)},
['trophy'] = {['item'] = 'fangs', ['quant'] = 1}
},
[`a_c_coyote`] = {
['time'] = math.random(50000, 80000),
['pelt'] = {['item'] = 'pelt10', ['quant'] = 1},
['meat'] = {['item'] = 'rawmeat', ['quant'] = math.random(2,4)},
['trophy'] = {['item'] = 'animalteeth', ['quant'] = 1}
},
[`a_c_deer`] = {
['time'] = math.random(90000, 110000),
['pelt'] = {['item'] = 'pelt15', ['quant'] = 1},
['meat'] = {['item'] = 'rawmeat', ['quant'] = math.random(3,7)},
['trophy'] = {['item'] = 'antlers', ['quant'] = 1}
},
[`a_c_mtlion`] = {
['time'] = math.random(110000, 140000),
['pelt'] = {['item'] = 'pelt15', ['quant'] = 1},
['meat'] = {['item'] = 'rawmeat', ['quant'] = math.random(3,5)},
['trophy'] = {['item'] = 'fangs', ['quant'] = 1}
},
[`a_c_rabbit_01`] = {
['time'] = math.random(50000, 80000),
['pelt'] = {['item'] = 'pelt2', ['quant'] = 1},
['meat'] = {['item'] = 'rawmeat', ['quant'] = math.random(1,2)},
},
[`a_c_chickenhawk`] = {
['time'] = math.random(50000, 80000),
['pelt'] = {['item'] = 'pelt2', ['quant'] = 1},
['meat'] = {['item'] = 'rawmeat', ['quant'] = 1},
},
[`a_c_cormorant`] = {
['time'] = math.random(50000, 80000),
['pelt'] = {['item'] = 'feather', ['quant'] = math.random(3)},
['meat'] = {['item'] = 'rawmeat', ['quant'] = 1},
},
}
local currentHuntingStatus = 0
CreateThread(function()
while true do
plyPed = PlayerPedId()
plyCoords = GetEntityCoords(plyPed)
Wait(1000)
end
end)
CreateThread(function()
WarMenu.CreateMenu('huntmenu', 'Hunting')
WarMenu.SetSubTitle("huntmenu", "Sell your legal hunting items here.")
WarMenu.SetMenuWidth("huntmenu", 0.5)
WarMenu.SetMenuX("huntmenu", 0.71)
WarMenu.SetMenuY("huntmenu", 0.017)
WarMenu.SetMenuMaxOptionCountOnScreen("huntmenu", 30)
WarMenu.SetTitleColor("huntmenu", 250, 135, 135, 255)
WarMenu.SetTitleBackgroundColor("huntmenu", 0 , 0, 0, 150)
WarMenu.SetMenuBackgroundColor("huntmenu", 0, 0, 0, 100)
WarMenu.SetMenuSubTextColor("huntmenu", 255, 255, 255, 255)
local showMenu = false
local items = {
{name="Hunting Sniper", id="100416529"},
{name="Cougar Pelt", id="cpelt"},
{name="Cougar Tooth", id="ctooth"},
{name="Animal Carcass Tier 1", id="huntingcarcass1"},
{name="Animal Carcass Tier 2 ", id="huntingcarcass2"},
{name="Animal Carcass Tier 3", id="huntingcarcass3"},
{name="Animal Carcass Tier 4", id="huntingcarcass4"},
{name="Rabbit Pelt", id ="rpelt"},
{name="Hunting Pelt Tier 1", id='huntingpelt1'},
{name="Hunting Pelt Tier 2", id='huntingpelt2'},
{name="Hunting Pelt Tier 3", id='huntingpelt3'},
}
while true do
Wait(0)
local officeDist = GetDistanceBetweenCoords(plyCoords, -675.4431, 5836.979, 17.34016)
local storeDist = GetDistanceBetweenCoords(plyCoords, 569.04, 2796.67, 42.01)
local storeDist2 = GetDistanceBetweenCoords(plyCoords, -676.0071, 5834.161, 17.34014)
if officeDist < 2 and currentHuntingStatus == 0 then
DrawText3Ds(vector3(-675.4431, 5836.979, 17.34016), '[~b~E~w~] Hunting Clock-In')
if officeDist < 1 then
if IsControlJustReleased(0, 38) then
TriggerServerEvent('npc-hunting:hasLicense', exports['isPed']:isPed('cid'))
Wait(1000)
end
end
elseif storeDist2 < 2 and currentHuntingStatus == 1 then
DrawText3Ds(vector3(-676.0071, 5834.161, 17.34014), '[~y~E~w~] Buy Hunting Ammo x50')
if IsControlJustPressed(0, 38) then
SetAmmoInClip(PlayerPedId(), 'WEAPON_SNIPERRIFLE', 50)
end
elseif officeDist < 2 and currentHuntingStatus == 2 then
DrawText3Ds(vector3(-675.4431, 5836.979, 17.34016), '[~g~E~w~] Hunting License')
if officeDist < 1 then
if IsControlJustReleased(0, 38) then
TriggerEvent('npc-hunting:PurchaseHuntingLicense', exports['isPed']:isPed('cid'))
TriggerEvent('DoShortHudText', 'Signing up to a hunting license. Please wait.')
Wait(5000)
end
end
elseif officeDist < 2 and currentHuntingStatus == 1 then
DrawText3Ds(vector3(-675.4431, 5836.979, 17.34016), '[~y~E~w~] Hunting Clock-Off')
if officeDist < 1 then
if IsControlJustReleased(0, 38) then
currentHuntingStatus = 0
TriggerServerEvent('npc-hunting:removeloadout')
Wait(100)
SetPedInfiniteAmmo(PlayerPedId(), false)
RemoveWeaponFromPed(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'))
OnGoingHuntSession = false
Wait(1000)
end
end
elseif storeDist < 2 and currentHuntingStatus == 1 then
DrawText3Ds(vector3(569.04, 2796.67, 42.01), '[~y~E~w~] Hunting Trading')
if storeDist < 1 then
if IsControlJustReleased(0, 38) then
showMenu = not showMenu
WarMenu.OpenMenu('huntmenu')
CreateThread(function()
while true do
Wait(0)
if WarMenu.CurrentMenu() and showMenu then
for i=1, #items do
if WarMenu.Button(items[i]['name']) then
TriggerServerEvent('npc-hunting:sellItem', items[i]['id'], exports['npc-inventory']:getQuantity(items[i]['id']))
Wait(1000)
end
end
WarMenu.Display()
else
return
end
end
end)
end
else
if showMenu then showMenu = false end;
end
else
Wait(1000)
WarMenu.CloseMenu()
end
-- else
-- Wait(1111)
--end
--else
-- Wait(2222)
--end
end
end)
local huntingBusy = false
local HuntingKnives = {
[`weapon_knife`] = true,
[`weapon_dagger`] = true,
[`weapon_hatchet`] = true,
[`weapon_machete`] = true,
[`weapon_switchblade`] = true,
[`weapon_battleaxe`] = true
}
CreateThread(function()
while true do Wait(0)
--local job = 'hunting'--exports["isPed"]:isPed('myjob')
--if job then
--if job == 'hunting' then
if not huntingBusy then
local otherped = GetPedInFront()
if DoesEntityExist(otherped) then
if GetPedType(otherped) == 28 then
if huntingAnimals[GetEntityModel(otherped)] then
if IsPedFatallyInjured(otherped) then
local animalCoords = GetEntityCoords(otherped)
DrawText3Ds(animalCoords, '[~o~E~w~] Skin Animal')
if IsControlJustReleased(0, 38) then
if #(plyCoords - animalCoords) < 1.3 then
if HuntingKnives[GetSelectedPedWeapon(plyPed)] then
huntingBusy = true
TriggerServerEvent('npc-hunting:cacheAnimal', NetworkGetNetworkIdFromEntity(otherped))
local animOn = true
CreateThread(function()
TaskTurnPedToFaceEntity(plyPed, otherped, -1)
Wait(2500)
RequestAnimDict('amb@medic@standing@timeofdeath@enter')
while not HasAnimDictLoaded("amb@medic@standing@timeofdeath@enter") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@timeofdeath@enter", "enter", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(5500)
RequestAnimDict('amb@medic@standing@timeofdeath@base')
while not HasAnimDictLoaded("amb@medic@standing@timeofdeath@base") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@timeofdeath@base", "base", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(6500)
RequestAnimDict('amb@medic@standing@timeofdeath@exit')
while not HasAnimDictLoaded("amb@medic@standing@timeofdeath@exit") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@timeofdeath@exit", "exit", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(7000)
if animOn then
RequestAnimDict('amb@medic@standing@tendtodead@enter')
while not HasAnimDictLoaded("amb@medic@standing@tendtodead@enter") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@tendtodead@enter", "enter", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(GetAnimDuration("amb@medic@standing@tendtodead@enter", "enter") * 1000 + 200)
end
if animOn then
Wait(100)
RequestAnimDict('amb@medic@standing@tendtodead@idle_a')
while not HasAnimDictLoaded("amb@medic@standing@tendtodead@idle_a") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@tendtodead@idle_a", "idle_a", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(GetAnimDuration("amb@medic@standing@tendtodead@exit", "exit") * 1000 + 200)
end
if animOn then
RequestAnimDict('amb@medic@standing@kneel@base')
while not HasAnimDictLoaded("amb@medic@standing@kneel@base") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base", "base", 8.0, -8, -1, 2, 0, 0, 0, 0)
end
Wait(5000)
if animOn then
RequestAnimDict('amb@medic@standing@tendtodead@idle_a')
while not HasAnimDictLoaded("amb@medic@standing@tendtodead@idle_a") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@tendtodead@idle_a", "idle_a", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(GetAnimDuration("amb@medic@standing@tendtodead@exit", "exit") * 1000 + 200)
end
while animOn do
Wait(100)
if not IsEntityPlayingAnim(PlayerPedId(), "amb@medic@standing@kneel@base", "base", 3) then
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@kneel@base", "base", 8.0, -8, -1, 2, 0, 0, 0, 0)
end
end
return
end)
local finished = exports["npc-taskbar"]:taskBar(huntingAnimals[GetEntityModel(otherped)]['time'],"Skinning Animal", true, true, true)
if (finished == 100) then
animOn = false
Wait(100)
RequestAnimDict('amb@medic@standing@tendtodead@exit')
while not HasAnimDictLoaded("amb@medic@standing@tendtodead@exit") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@tendtodead@exit", "exit", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(GetAnimDuration("amb@medic@standing@tendtodead@exit", "exit") * 1000 + 200)
ClearPedTasks(plyPed)
TriggerServerEvent('npc-hunting:getReward', GetEntityModel(otherped), huntingAnimals[GetEntityModel(otherped)])
NetworkFadeOutEntity(otherped, false, true)
Citizen.Wait(800)
DeleteEntity(otherped)
else
animOn = false
Wait(100)
RequestAnimDict('amb@medic@standing@tendtodead@exit')
while not HasAnimDictLoaded("amb@medic@standing@tendtodead@exit") do Wait(100) end
TaskPlayAnim(PlayerPedId(), "amb@medic@standing@tendtodead@exit", "exit", 8.0, -8, -1, 2, 0, 0, 0, 0)
Wait(GetAnimDuration("amb@medic@standing@tendtodead@exit", "exit") * 1000 + 200)
ClearPedTasks(plyPed)
end
huntingBusy = false
end
end
end
else
Wait(690)
end
else
Wait(1222)
end
else
Wait(1320)
end
else
Wait(1234)
end
else
Wait(500)
end
--end
-- end
end
end)
Citizen.CreateThread(function()
while true do
SetAmmoInClip(PlayerPedId(), 'WEAPON_SNIPERRIFLE', 10)
SetPedInfiniteAmmo(PlayerPedId(), true, 'WEAPON_SNIPERRIFLE')
Citizen.Wait(1000)
end
end)
RegisterNetEvent("npc-hunting:hasLicense")
AddEventHandler("npc-hunting:hasLicense", function(hasLicense)
if tonumber(hasLicense) == 1 then
currentHuntingStatus = 1
TriggerEvent('DoLongHudText', 'You have a hunting license in our system, feel free to go legally hunting.', 1)
local blipInfo = Blips['hunting']['blips'][2]
TriggerServerEvent('npc-GiveLoadOutForHunting')
-- TriggerEvent('npc-banned:getID', source, '100416529', 1)
GiveWeaponToPed(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'), 0, 0, 1)
SetCurrentPedWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'), 1)
SetAmmoInClip(PlayerPedId(), 'WEAPON_SNIPERRIFLE', 10)
SetPedInfiniteAmmo(PlayerPedId(), true, 'WEAPON_SNIPERRIFLE')
blipInfo.blip = AddBlipForCoord(blipInfo.coords)
SetBlipSprite(blipInfo.blip, blipInfo.type)
SetBlipDisplay(blipInfo.blip, 4)
SetBlipScale(blipInfo.blip, 0.7)
SetBlipColour(blipInfo.blip, blipInfo.colour)
SetBlipAsShortRange(blipInfo.blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(blipInfo.title)
EndTextCommandSetBlipName(blipInfo.blip)
Citizen.Wait(1000)
RemoveWeaponFromPed(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'))
OnGoingHuntSession = true
else
CreateThread(function() currentHuntingStatus = 2 Wait(5000) if currentHuntingStatus == 2 then currentHuntingStatus = 0 end end)
TriggerEvent('DoLongHudText', 'Missing hunting license, press E to purchase one.', 2)
end
end)
function GetPedInFront()
local plyOffset = GetOffsetFromEntityInWorldCoords(plyPed, 0.0, 1.3, 0.0)
local rayHandle = StartShapeTestCapsule(plyCoords.x, plyCoords.y, plyCoords.z, plyOffset.x, plyOffset.y, plyOffset.z, 1.0, 12, plyPed, 7)
local _, _, _, _, ped = GetShapeTestResult(rayHandle)
return ped
end
RegisterNetEvent('npc-hunting:sellItems')
AddEventHandler('npc-hunting:sellItems', function(amount)
local LocalPlayer = exports["npc-core"]:getModule("LocalPlayer")
local Player = LocalPlayer:getCurrentCharacter()
LocalPlayer:addCash(Player.id, amount)
end)
RegisterNetEvent('npc-hunting:PurchaseHuntingLicense')
AddEventHandler('npc-hunting:PurchaseHuntingLicense', function()
local LocalPlayer = exports["npc-core"]:getModule("LocalPlayer")
local Player = LocalPlayer:getCurrentCharacter()
if Player.cash >= 1500 then
LocalPlayer:removeCash(Player.id, 1500)
TriggerServerEvent('npc-hunting:obtainLicense', exports['isPed']:isPed('cid'))
else
TriggerEvent('DoLongHudText', 'You do not have enough money to purchase a hunting license.')
end
end)
RegisterCommand('checkhunting', function(source, args)
if tostring(args[1]) == nil then
TriggerEvent('DoLongHudText', 'Input a CID')
return
else
if args[1] ~= nil then
local argh = args[1]
if exports['isPed']:isPed('job') == 'Police' then
TriggerServerEvent('checkhunting', argh)
end
end
end
end)
RegisterNetEvent('npc-hunting:license:check')
AddEventHandler('npc-hunting:license:check', function(license, cid)
if license == (1 or '1') then
license = 'True'
else
license = 'False'
end
TriggerEvent('DoLongHudText', 'Player CID : ' ..cid.. ' | Hunting License Status = ' ..license)
end)
local aim = false
Citizen.CreateThread(function()
while true do
local sleep = 250
if OnGoingHuntSession then
if IsPlayerFreeAiming(PlayerId()) == false and HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE')) then
DisablePlayerFiring(PlayerPedId(), true)
if IsPlayerFreeAiming(PlayerId()) == 1 and HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE')) then
DisablePlayerFiring(PlayerPedId(), false)
end
end
if IsControlJustPressed(0,25) and HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE')) then
SendNUIMessage({
display = true,
})
HideHudComponentThisFrame(14)
elseif IsControlJustReleased(0,25) and HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE')) then
SendNUIMessage({
display = false,
})
end
local aiming, targetPed = GetEntityPlayerIsFreeAimingAt(PlayerId())
if IsPedAPlayer(targetPed) and HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE')) then
RemoveWeaponFromPed(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'))
TriggerEvent('DoLongHudText', 'Hunting Humans is illegal!', 2)
Citizen.Wait(1000)
end
sleep = 0
timer = timer + 1
SetAmmoInClip(PlayerPedId(), 'WEAPON_SNIPERRIFLE', 10)
SetPedInfiniteAmmo(PlayerPedId(), true, GetHashKey('WEAPON_SNIPERRIFLE'))
if timer > 180000 then
TriggerServerEvent('npc-hunting:removeloadout')
TriggerEvent('DoLongHudText', 'Uh oh! you ran out of time, yoink!', 2)
timer = 0
OnGoingHuntSession = false
if HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'), false) then
RemoveWeaponFromPed(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'))
SetPedInfiniteAmmo(PlayerPedId(), false, GetHashKey('WEAPON_SNIPERRIFLE'))
end
end
else
OnGoingHuntSession = false
if HasPedGotWeapon(PlayerPedId(), GetHashKey('WEAPON_SNIPERRIFLE'), false) then
end
end
Wait(sleep)
end
end)
--
|
local PLUGIN = PLUGIN;
function PLUGIN:Tick()
if(#player.GetAll() == 0) then return; end;
for k, v in pairs(player.GetAll()) do
local playerMan = v;
local table = v:GetCharacters();
for k2, v2 in pairs(table) do
if(v2.data["CharTempBanned"]) then
if(os.time() >= v2.data["CharBanTime"]) then
if(v:Name() == v2.name) then
print("unbanning the dude " .. v2.name);
PLUGIN:SetTempBanned(v, false, 0);
else
v2.data["CharTempBanned"] = false;
print("unbanning the dude " .. v2.name);
end;
local charactersTable = Clockwork.config:Get("mysql_characters_table"):Get();
local charName = v2.name;
local queryObj = Clockwork.database:Select(charactersTable);
queryObj:SetCallback(function(result)
if (Clockwork.database:IsResult(result)) then
local queryObj = Clockwork.database:Update(charactersTable);
queryObj:Replace("_Data", "\"CharBanned\":true", "\"CharBanned\":false");
queryObj:AddWhere("_Name = ?", charName);
queryObj:Replace("_Data", "\"CharTempBanned\":true", "\"CharTempBanned\":false");
queryObj:AddWhere("_Name = ?", charName);
queryObj:Push();
end;
end);
queryObj:AddWhere("_Name = ?", charName);
queryObj:Pull();
if(v:HasInitialized()) then
Clockwork.player:Notify(v, "Your character " .. v2.name .. " has been unbanned.");
end;
end;
end;
end;
end;
end;
|
Prefab = Class(function(self, name, fn, assets, deps)
self.name = name or ""
self.path = name or nil
self.name = string.sub(name, string.find(name, "[^/]*$"))
self.desc = ""
self.fn = fn
self.assets = assets or {}
self.deps = deps or {}
end)
function Prefab:__tostring()
return string.format("Prefab %s - %s", self.name, self.desc)
end
Asset = Class(function(self, type, file)
self.type = type
self.file = file
end)
|
paths.dofile('../layers/ResidualBest.lua')
local function lin_old(numIn,numOut,inp)
-- Apply 1x1 convolution, stride 1, no padding
local bn_relu = nn.RReLU()(nn.SpatialBatchNormalization(numIn)(inp))
local spatial_dropout = nn.SpatialDropout(opt.spatialdropout)(bn_relu)
return nn.SpatialConvolution(numIn,numOut,1,1,1,1,0,0)(spatial_dropout)
end
local function lin(numIn,numOut,inp)
-- Apply 1x1 convolution, stride 1, no padding
local bn_relu = nn.ReLU(true)(nn.SpatialBatchNormalization(numIn)(inp))
return nn.SpatialConvolution(numIn,numOut,1,1,1,1,0,0)(bn_relu)
end
local function createModel()
if not nn.NoBackprop then
paths.dofile('modules/NoBackprop.lua')
end
print('Load model: ' .. paths.concat(opt.ensemble, 'final_model.t7'))
local trained_model = torch.load(paths.concat(opt.ensemble, 'final_model.t7'))
trained_model:evaluate()
-- craft network
local inp = nn.Identity()()
local hg_net = nn.NoBackprop(trained_model)(inp) -- disable backprop
local concat_outputs = nn.JoinTable(2)(hg_net)
local ll1 = lin(outputDim[1][1]*opt.nStack, 512, concat_outputs)
local out = lin(512, outputDim[1][1], ll1)
opt.nOutputs = 1
-- Final model
local model = nn.gModule({inp}, {out})
return model
end
-------------------------
return createModel
|
#!/usr/bin/env lua
local lub = require 'lub'
local lib = lub
local tmp = lub.Template(lub.content(lub.path '|rockspec.in'))
lub.writeall(lib.type..'-'..lib.VERSION..'-1.rockspec', tmp:run({lib = lib}))
tmp = lub.Template(lub.content(lub.path '|CMakeLists.txt.in'))
lub.writeall('CMakeLists.txt', tmp:run())
tmp = lub.Template(lub.content(lub.path '|dist.info.in'))
lub.writeall('dist.info', tmp:run({lib = lib}))
|
-- Lua script used to clean up tabs and spaces in C, CPP and H files.
-- Copyright (c) 2014, bel
-- MIT License (http://opensource.org/licenses/mit-license.php)
--
-- It can be used from the command line:
-- Call Lua5.1 or Lua5.2 + this script file + the C/CPP/H file to clean
--
-- It can be used in Visual Studio as an external tool:
-- command: Lua5.1.exe or Lua5.2.exe
-- argument: "X:\civetweb\resources\cleanup.lua" $(ItemPath)
--
clean = arg[1]
print("Cleaning " .. clean)
lines = io.lines(clean)
if not lines then
print("Can not open file " .. clean)
return
end
function trimright(s)
return s:match "^(.-)%s*$"
end
local lineend = false
local tabspace = false
local changed = false
local invalid = false
local newfile = {}
lineno = 0
incmt = false
for l in lines do
lineno = lineno + 1
local lt = trimright(l)
if (lt ~= l) then
lineend = true
changed = true
end
local mcmt = l:find("%/%*");
if mcmt then
if incmt then
print("line " .. lineno .. " nested comment")
end
if not (l:sub(mcmt):find("%*%/")) then
-- multiline comment begins here
incmt = true
end
elseif incmt then
if not l:find("^%s*%*") then
print("line " .. lineno .. " multiline comment without leading *")
end
if l:find("%*%/") then
incmt = false
end
else
local cmt = l:find("//")
if (cmt) and (l:sub(cmt-5, cmt+1) ~= "http://") and (l:sub(cmt-6, cmt+1) ~= "https://") then
print("line " .. lineno .. " has C++ comment //")
end
end
local lts = lt:gsub('\t', ' ')
if (lts ~= lt) then
tabspace = true
changed = true
end
for i=1,#lts do
local b = string.byte(lts,i)
if b<32 or b>=127 then
print("Letter " .. string.byte(l,i) .. " (" .. b .. ") found in line " .. lts)
invalid = true
end
end
newfile[#newfile + 1] = lts
end
print("Line endings trimmed: " .. tostring(lineend))
print("Tabs converted to spaces: " .. tostring(tabspace))
print("Invalid characters: " .. tostring(invalid))
if changed then
local f = io.open(clean, "wb")
for i=1,#newfile do
f:write(newfile[i])
f:write("\n")
end
f:close()
print("File cleaned")
end
|
local AddonName, AddonTable = ...
AddonTable.consumable = {
-- Potions
22829,
22832,
32902,
32905,
}
AddonTable.foodDrink = {
28399,
27854,
27855,
27859,
27860,
29449,
29451,
29452,
}
|
Constraint =
{
Properties=
{
radius = 0.03,
damping = 0,
bNoSelfCollisions = 1,
bUseEntityFrame=1,
max_pull_force=0,
max_bend_torque=0,
bConstrainToLine=0,
bConstrainToPlane=0,
bConstrainFully=1,
bNoRotation=0,
Limits = {
x_min = 0,
x_max = 0,
yz_min = 0,
yz_max = 0,
}
},
numUpdates = 0,
Editor=
{
Icon="Magnet.bmp",
ShowBounds = 1,
},
}
function Constraint:OnReset()
--Log("%s:OnReset() idEnt: %s idConstr: %s broken: %s", self:GetName(), tostring(self.idEnt),
-- tostring(self.idConstr), tostring(self.broken))
--if (self.idConstr) then
--System.GetEntity(self.idEnt):SetPhysicParams(PHYSICPARAM_REMOVE_CONSTRAINT, { id=self.idConstr })
--end
self.idEnt = nil
self.idConstr = nil
self.broken = nil
self.numUpdates = 0
end
function Constraint:Apply()
--Log("%s:Apply() idEnt: %s idConstr: %s broken: %s", self:GetName(), tostring(self.idEnt),
-- tostring(self.idConstr), tostring(self.broken))
local ConstraintParams = {pivot={},frame0={},frame1={}};
if self.idEnt then
elseif (not self.broken) then
local ents = Physics.SamplePhysEnvironment(self:GetPos(), self.Properties.radius);
if (ents[1] and ents[6]) then
CopyVector(ConstraintParams.pivot, self:GetPos());
if self.Properties.bUseEntityFrame==1 then
CopyVector(ConstraintParams.frame1, ents[1]:GetAngles());
else
CopyVector(ConstraintParams.frame1, self:GetAngles());
end
CopyVector(ConstraintParams.frame0, ConstraintParams.frame1);
ConstraintParams.entity_part_id_1 = ents[2];
ConstraintParams.phys_entity_id = ents[6];
ConstraintParams.entity_part_id_2 = ents[5];
ConstraintParams.xmin = self.Properties.Limits.x_min;
ConstraintParams.xmax = self.Properties.Limits.x_max;
ConstraintParams.yzmin = self.Properties.Limits.yz_min;
ConstraintParams.yzmax = self.Properties.Limits.yz_max;
ConstraintParams.ignore_buddy = self.Properties.bNoSelfCollisions;
ConstraintParams.damping = self.Properties.damping;
ConstraintParams.sensor_size = self.Properties.radius;
ConstraintParams.max_pull_force = self.Properties.max_pull_force;
ConstraintParams.max_bend_torque = self.Properties.max_bend_torque;
ConstraintParams.line = self.Properties.bConstrainToLine;
ConstraintParams.plane = self.Properties.bConstrainToPlane;
ConstraintParams.no_rotation = self.Properties.bNoRotation;
ConstraintParams.full = self.Properties.bConstrainFully;
self.idConstr = ents[1]:SetPhysicParams(PHYSICPARAM_CONSTRAINT, ConstraintParams);
self.idEnt = ents[1].id;
else
self:SetTimer(1,1);
end
end
end
function Constraint:OnTimer()
if (self.numUpdates < 10) then
self:Apply();
self.numUpdates = self.numUpdates+1;
end
end
function Constraint:OnLevelLoaded()
--Log("%s:OnLevelLoaded() idEnt: %s idConstr: %s broken: %s", self:GetName(), tostring(self.idEnt),
-- tostring(self.idConstr), tostring(self.broken))
if ((not self.broken) and (not self.idConstr)) then
self.numUpdates = 0
self.idEnt = nil
self.idConstr = nil
self:Apply()
end
end
function Constraint:OnPropertyChange()
self:OnReset()
end
function Constraint:OnSpawn()
self:OnReset()
end
function Constraint:Event_ConstraintBroken(sender)
--Log("%s:Event_ConstraintBroken() idEnt: %s idConstr: %s broken: %s", self:GetName(), tostring(self.idEnt),
-- tostring(self.idConstr), tostring(self.broken))
if self.idEnt then
System.GetEntity(self.idEnt):SetPhysicParams(PHYSICPARAM_REMOVE_CONSTRAINT, { id=self.idConstr });
self.idEnt = nil
self.idConstr = nil
end
self.broken = true
self:KillTimer(1)
BroadcastEvent(self, "ConstraintBroken")
end
function Constraint:OnSave( props )
--Log("%s:OnSave() idEnt: %s idConstr: %s broken: %s", self:GetName(), tostring(self.idEnt),
-- tostring(self.idConstr), tostring(self.broken))
props.broken = self.broken
props.idEnt = self.idEnt
props.idConstr = self.idConstr
end
function Constraint:OnLoad( props )
self.broken = props.broken
self.idEnt = props.idEnt
self.idConstr = props.idConstr
--Log("%s:OnLoad() idEnt: %s idConstr: %s broken: %s", self:GetName(), tostring(self.idEnt),
-- tostring(self.idConstr), tostring(self.broken))
end
function Constraint:OnDestroy()
end
Constraint.FlowEvents =
{
Inputs =
{
ConstraintBroken = { Constraint.Event_ConstraintBroken, "bool" },
},
Outputs =
{
ConstraintBroken = "bool",
},
}
|
-----------------------------------
-- Ruinator
-- Axe weapon skill
-- Skill level: 357
-- Description: Delivers a four-hit attack. params.accuracy varies with TP
-- In order to obtain Ruinator, the quest Martial Mastery must be completed.
-- This Weapon Skill's first hit params.ftp is duplicated for all additional hits
-- Aligned with the Aqua Gorget, Snow Gorget & Breeze Gorget
-- Aligned with the Aqua Belt, Snow Belt & Breeze Belt.
-- Element: None
-- Modifiers: STR:73~85%, depending on merit points upgrades.
-- 100%TP 200%TP 300%TP
-- 1.08 1.08 1.08
-----------------------------------
require("scripts/globals/status")
require("scripts/globals/settings")
require("scripts/globals/weaponskills")
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {}
params.numHits = 4
params.ftp100 = 1.08 params.ftp200 = 1.08 params.ftp300 = 1.08
params.str_wsc = 0.85 + (player:getMerit(tpz.merit.RUINATOR) / 100) params.dex_wsc = 0.0 params.vit_wsc = 0.0 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0
params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0
params.canCrit = false
params.acc100 = 0.8 params.acc200= 0.9 params.acc300= 1.0
params.atk100 = 1.1; params.atk200 = 1.1; params.atk300 = 1.1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.7 + (player:getMerit(tpz.merit.RUINATOR) / 100)
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar)
return tpHits, extraHits, criticalHit, damage
end
|
local component = require("component")
local transposer = component.transposer
local sides = require("sides")
local tdebug = require("tdebug")
local function transfer1()
print("transfer1")
for i = 1, transposer.getInventorySize(sides.west) do
transposer.transferItem(sides.top, sides.west, 1, 1, i)
end
print("done")
end
local function transfer2()
local slots = {}
for i = 1, 53 do
slots[i] = 1
end
slots[54] = 0
print("transfer2")
for i = 1, transposer.getInventorySize(sides.west) do
if slots[i] == 0 then
transposer.transferItem(sides.top, sides.west, 1, 1, i)
end
end
print("done")
end
local function query1()
local total = 0
print("query1")
for i = 1, transposer.getInventorySize(sides.top) do
local count = transposer.getSlotStackSize(sides.top, i)
total = total + count
end
print("done, " .. total)
end
-- Seems like this works really well, definitely use it() to traverse inventory.
-- The "it.count()" function returns inventory size, but it's slow.
-- Can also do it[n] to get item table for the n'th slot, but returns a table with minecraft:air for empty slots (unlike it() which returns empty table).
local function query2()
local total = 0
print("query2")
local it = transposer.getAllStacks(sides.top)
local item = it()
while item do
total = total + (item.size or 0)
item = it()
end
print("done, " .. total)
end
local time1 = os.clock()
query2()
local time2 = os.clock()
print("took " .. time2 - time1)
|
-- inventory.lua
local inventory = {
box = {
x = 0,
y = 0,
w = 350,
h = 350
},
buttons = {},
lastItemAdded = ""
}
local bounds = {
width = 350,
height = 350,
left = 0,
top = 0,
rows = 5,
columns = 5
}
local colors = {
}
local buttonTimerMax = 0.2
local buttonTimer = 0
local function addIngredient(xPos, yPos, textName, nName)
newButton = {x = xPos, y = yPos, w = 70, h = 70, text = textName, alias = nName, backgroundDraw = false}
table.insert(inventory.buttons, newButton)
end
function loadInv()
-- load sounds:
soundBubbling = love.audio.newSource("assets/sounds/bubbling.wav", static)
soundClick = love.audio.newSource("assets/sounds/click.wav", static)
soundKnock = love.audio.newSource("assets/sounds/knock.wav", static)
-- first row:
addIngredient(0, 0, "Frog", "fr") --fr
addIngredient(70, 0, "Salt", "sa")--sa
addIngredient(140, 0, "Sage's Eye", "ey") --ey
addIngredient(210, 0, "Dahlia", "fl") -- fl
addIngredient(280, 0, "Wheat", "wh") -- wh
-- second row:
addIngredient(0, 70, "Olive Twig", "ot") -- ot
addIngredient(70, 70, "Sow's Milk", "gm") -- gm
addIngredient(140, 70, "Bog Water", "bw") -- bw
addIngredient(210, 70, "Aloe", "al") -- al
addIngredient(280, 70, "Witch's Hair", "wi") -- wi
-- third row:
addIngredient(0, 140, "Newt Tongue", "nt") --nt
addIngredient(70, 140, "Croc Scales", "cs") -- cs
addIngredient(140, 140, "Vinegar", "vi") -- vi
addIngredient(210, 140, "Wolf Fang", "wf") -- wf
addIngredient(280, 140, "Quail Egg", "qe") -- qe
-- fourth row:
addIngredient(0, 210, "Rosemary", "ro") --ro
addIngredient(70, 210, "Rat's Tail", "rt") -- rt
addIngredient(140, 210, "Ash", "as") -- as
addIngredient(210, 210, "Dove's Wing", "dw") -- dw
addIngredient(280, 210, "Dragonfly's Wing", "df") -- df
-- fifth row:
addIngredient(0, 280, "Mandrake Root", "mr") -- da
addIngredient(70, 280, "Fox's Tail", "ft") -- ft
addIngredient(140, 280, "Toad's Tongue", "tt") -- tt
addIngredient(210, 280, "Cat's Paw", "cp")-- cat's eye
addIngredient(280, 280, "Familiar's Blood", "fb") -- bb
-- treatment buttons
addIngredient(280, 530, "Treat", "")
addIngredient(0, 530, "Empty", "")
end
function updateButtons(dt)
-- checks for mouse clicks
for _, button in ipairs(inventory.buttons) do
if love.mouse.getX() > button.x and love.mouse.getX() < button.x + button.w and
love.mouse.getY() > button.y and love.mouse.getY() < button.y + button.h and
love.mouse.isDown(1) and buttonTimer <= 0 and roundEnd == false then
if button.text == "Treat" then -- if the player clicks Treat
love.audio.play(soundBubbling)
button.backgroundDraw = true
buttonTimer = buttonTimerMax
inventory.lastItemAdded = ""
treatPatient()
elseif button.text == "Empty" then
love.audio.play(soundClick)
button.backgroundDraw = true
buttonTimer = buttonTimerMax
inventory.lastItemAdded = ""
cauldron = {}
elseif table.getn(cauldron) ~= 5 then
love.audio.play(soundClick)
addToCauldron(button.text)
inventory.lastItemAdded = button.text
button.backgroundDraw = true
buttonTimer = buttonTimerMax
else
love.audio.play(soundKnock)
print("Cauldron Full!")
button.backgroundDraw = true
buttonTimer = buttonTimerMax
end
-- spawn object to fall into cauldron
elseif buttonTimer <= 0 then
button.backgroundDraw = false
end
end
-- decrement button Timer
if buttonTimer > 0 then
buttonTimer = buttonTimer - (1 * dt)
end
if roundEnd then
cauldron = {}
inventory.lastItemAdded = ""
end
end
function drawGrid()
local columnWidth = bounds.width / bounds.columns
for x=1, bounds.columns do
love.graphics.line(x*columnWidth, 0, x*columnWidth, bounds.height)
end
local rowHeight = bounds.height / bounds.rows
for y=1, bounds.rows do
love.graphics.line(0, y*rowHeight, bounds.width, y*rowHeight)
end
end
function drawInv()
for _, button in ipairs(inventory.buttons) do
if button.backgroundDraw then
love.graphics.setColor(255, 0, 0, 150)
love.graphics.rectangle("fill", button.x, button.y, button.w, button.h)
love.graphics.setColor(255, 255, 255, 255)
-- continue drawing object
end
love.graphics.setFont(thin)
love.graphics.printf(button.text, button.x+3, button.y+25, button.w-6, "center")
end
-- draw last item added
love.graphics.printf(inventory.lastItemAdded, 145, 555, 70, "center")
end
return inventory
|
-- 扩展httpc
httpc.answer = require "app.gg.http.answer"
function httpc.signature(str,secret)
if type(str) == "table" then
str = table.ksort(str,"&",{sign=true})
end
return crypt.base64encode(crypt.hmac_sha1(secret,str))
end
function httpc.make_request(request,secret)
secret = secret or "secret"
request.sign = httpc.signature(request,secret)
return request
end
function httpc.unpack_response(response)
response = cjson.decode(response)
return response
end
-- 回复一个http请求
function httpc.response(linkid,status,body,header)
logger.logf("debug","http","op=send,linkid=%s,status=%s,body=%s,header=%s",
linkid,status,body,header)
local ok,err = httpd.write_response(sockethelper.writefunc(linkid),status,body,header)
if not ok then
skynet.error(string.format("linktype=http,linkid=%s,err=%s",linkid,err))
end
end
-- 以json格式回复一个http请求
function httpc.response_json(linkid,status,body,header)
if header and not header["content-type"] then
header["content-type"] = "application/json;charset=utf-8"
end
if body then
body = cjson.encode(body)
end
httpc.response(linkid,status,body,header)
end
--- 扩展httpc.post,支持传入header,并根据header中指定content-type对form编码
--@param[type=string] host 主机地址,如:127.0.0.1:8887
--@param[type=string] url url
--@param[type=string|table] form 请求的body数据,传table时默认根据header中指定的content-type编码
--@param[type=table,opt] header 请求头,默认为application/json编码
--@param[type=table,opt] recvheader 如果指定时会记录回复收到的header信息
function httpc.postx(host,url,form,header,recvheader)
if not header then
header = {
["content-type"] = "application/json;charset=utf-8"
}
end
local content_type = header["content-type"]
local body
if string.find(content_type,"application/json") then
if type(form) == "table" then
body = cjson.encode(form)
else
body = form
end
else
assert(string.find(content_type,"application/x-www-form-urlencoded"))
if type(form) == "table" then
body = string.urlencode(form)
else
body = form
end
end
assert(type(body) == "string")
return httpc.request("POST", host, url, recvheader, header, body)
end
---发送http/https请求
--@param[type=string] url url
--@param[type=table] get get请求参数
--@param[type=table] post post请求参数,存在该参数表示POST请求,否则为GET请求
--@return[type=number] status http状态码
--@return[type=string] response 回复数据
function httpc.req(url,get,post,no_reply)
local address = httpc.webclient_address or ".webclient"
if no_reply then
skynet.send(address,"lua","request",url,get,post,no_reply)
else
local isok,response,info = skynet.call(address,"lua","request",url,get,post,no_reply)
return info.response_code,response
end
end
return httpc
|
worldgen = {}
worldgen.overworld_top = 256
worldgen.overworld_bottom = 0
-- Doubles as the surface height too
worldgen.overworld_sealevel = worldgen.overworld_bottom + 63
-- sets where we will randomly plot a sturcture
worldgen.overworld_struct_min = worldgen.overworld_bottom + 25
worldgen.overworld_struct_max = worldgen.overworld_sealevel - 5
worldgen.hell_top = worldgen.overworld_bottom - 128 -- 128 block seperation between biomes
worldgen.hell_bottom = worldgen.hell_top - 128 -- 128 blocks tall hell
worldgen.hell_sealevel = worldgen.hell_bottom + 63
local c_wool = minetest.get_content_id("bobcraft_blocks:wool_green")
-- Commonly used content ids
local c_air = minetest.get_content_id("air")
local c_grass = minetest.get_content_id("bobcraft_blocks:grass_block")
local c_dirt = minetest.get_content_id("bobcraft_blocks:dirt")
local c_stone = minetest.get_content_id("bobcraft_blocks:stone")
local c_water = minetest.get_content_id("bobcraft_blocks:water_source")
local c_bedrock = minetest.get_content_id("bobcraft_blocks:bedrock")
function worldgen.get_perlin_map(noiseparam, sidelen, minp)
local pm = minetest.get_perlin_map(noiseparam, sidelen)
return pm:get_2d_map_flat({x = minp.x, y = minp.z, z = 0})
end
function worldgen.get_perlin_map_3d(noiseparam, sidelen, minp)
local pm = minetest.get_perlin_map(noiseparam, sidelen)
return pm:get_3d_map_flat({x = minp.x, y = minp.y, z = minp.z})
end
-- Used for smittering the bedrock
worldgen.np_bedrock = {
offset = 0,
scale = 10,
spread = {x=1, y=1, z=1},
seed = -minetest.get_mapgen_setting("seed"), -- we get the inverse of the map's seed, to make the bedrock ALWAYS generate with seed 0. A quirk (bug?) minecraft has that is pretty neat.
octaves = 1,
persist = 0.5,
}
-- TODO: the following nose parameters are ALL for the overworld.
-- This doesn't seem right with the concept of dimensions, so we need to move them to dimension specific areas.
-- Base - the meat of the y height
worldgen.np_base = {
offset = 0,
scale = 1,
spread = {x=256, y=256, z=256},
seed = 69420,
octaves = 6,
persist = 0.5,
}
-- Overlay - multiplies on-top of the already set y height from Base
worldgen.np_overlay = {
offset = 0,
scale = 1,
spread = {x=512, y=512, z=512},
seed = 42078,
octaves = 6,
persist = 0.5,
}
-- Overlay2 - removes from the base + overlay1
worldgen.np_overlay2 = {
offset = 0,
scale = 1,
spread = {x=512, y=512, z=512},
seed = 47238239, -- key mash
octaves = 6,
persist = 0.5,
}
-- second layer - the shape of the dirt/stone mix, irrespective of surface
worldgen.np_second_layer = {
offset = 0,
scale = 1,
spread = {x=256, y=256, z=256},
seed = 42069,
octaves = 6,
persist = 0.5,
}
-- caves - we cut caves into the ground, 'nuff said
worldgen.np_caves = {
offset = 0,
scale = 2,
spread = {x=32, y=32, z=32},
octaves = 4,
seed = 1867986957268147339, -- "cave!"
persist = 0.5,
lacunarity = 2,
}
worldgen.np_caves2 = {
offset = 0,
scale = 2,
spread = {x=32, y=32, z=32},
octaves = 4,
seed = -6644799973611538138, -- "cave?"
persist = 0.5,
lacunarity = 2,
}
worldgen.np_caves3 = {
offset = 0,
scale = 2,
spread = {x=32, y=32, z=32},
octaves = 4,
seed = -4674843423187234620, -- "cave..."
persist = 0.5,
lacunarity = 2,
}
-- The hell 'caves'
worldgen.np_caves_hell = {
offset = 0,
scale = 1,
spread = {x=256, y=128, z=256},
octaves = 4,
seed = 410430084494322969, -- "SATANSATANSATAN"
persist = 0.6,
lacunarity = 2,
flags = "eased",
}
-- Temperature - How we generate temperature values
worldgen.np_temperature = {
offset = 0,
scale = 2,
spread = {x=256, y=256, z=256},
seed = -5012447954499666283, -- python's hash() function returned this for "temperature"
octaves = 6,
persist = 0.5,
}
-- Rainfall - How we generate humidity values
worldgen.np_rainfall = {
offset = 0,
scale = 2,
spread = {x=256, y=256, z=256},
seed = -5394576791132434734, -- python's hash() function returned this for "rainfall"
octaves = 2,
persist = 0.5,
}
local mp = minetest.get_modpath("bobcraft_worldgen")
dofile(mp.."/structures.lua")
dofile(mp.."/biomes.lua")
dofile(mp.."/dimensions.lua")
dofile(mp.."/ores.lua")
dofile(mp.."/decorations.lua")
function worldgen.y_at_point(x, z, ni, biome, tempdiff, noise1, noise2, noise3) -- TODO: this is overworld specific, should we move this to dimensions?
local y
local effector = 1.1
y = 8 * (noise1[ni]*effector)
y = y * (noise2[ni]*effector) * 4
y = y - (noise3[ni] * effector) * 8
y = y + worldgen.overworld_sealevel
return y
end
worldgen.get_nearest_dimension = bobutil.get_nearest_dimension
-- Returns the biome at the pos.
function worldgen.get_biome(pos)
local noise_temperature = worldgen.get_perlin_map(worldgen.np_temperature, {x=1, y=1, z=1}, pos)
local noise_rainfall = worldgen.get_perlin_map(worldgen.np_rainfall, {x=1, y=1, z=1}, pos)
local temperature = noise_temperature[1]
local rainfall = noise_rainfall[ni]
local dimension = worldgen.get_nearest_dimension(pos)
local biome = worldgen.get_biome_nearest(temperature, rainfall, dimension.biome_list)
return biome
end
minetest.register_on_generated(function(minp, maxp, blockseed)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local function set_layers(block, noise, min, max, minp, maxp)
local nixyz = 1
if noise ~= nil then
local h = maxp.x - minp.x + 1
noise = worldgen.get_perlin_map_3d(noise, {x=h,y=h,z=h}, minp)
end
if (maxp.y >= min and minp.y <= max) then
for y = min, max do
for x = minp.x, maxp.x do
for z = minp.z, maxp.z do
local vi = area:index(x,y,z)
if noise == nil then
data[vi] = block
else
if noise[nixyz] > 0.5 then
data[vi] = block
end
end
nixyz = nixyz + 1
end
end
end
end
end
for i = 1, #worldgen.registered_dimensions do
local dim = worldgen.registered_dimensions[i]
if maxp.y >= dim.y_min and minp.y <= dim.y_max then
data = dim.gen_func(dim, minp, maxp, blockseed, vm, area, data)
end
-- The very last step is to set the bedrock up
-- TODO: jittery bedrock
if dim.seal_top then
set_layers(dim.seal_node, nil, dim.y_max, dim.y_max, minp, maxp)
set_layers(dim.seal_node, worldgen.np_bedrock, dim.y_max-dim.seal_thickness, dim.y_max, minp, maxp)
end
if dim.seal_bottom then
set_layers(dim.seal_node, nil, dim.y_min, dim.y_min, minp, maxp)
set_layers(dim.seal_node, worldgen.np_bedrock, dim.y_min, dim.y_min+dim.seal_thickness, minp, maxp)
end
end
vm:set_data(data)
-- Let minetest set the ores and decorations up
minetest.generate_ores(vm)
minetest.generate_decorations(vm)
vm:set_lighting({day=0, night=0})
vm:calc_lighting()
vm:write_to_map()
vm:update_liquids()
end)
|
-----------------------------------
-- Area: Al Zahbi
-- NPC: Bornahn
-- Guild Merchant NPC: Goldsmithing Guild
-- !pos 46.011 0.000 -42.713 48
-----------------------------------
require("scripts/globals/settings")
require("scripts/globals/shop")
local ID = require("scripts/zones/Al_Zahbi/IDs")
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
if (player:sendGuild(60429, 8, 23, 4)) then
player:showText(npc, ID.text.BORNAHN_SHOP_DIALOG)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
|
local t = Def.ActorFrame{
LoadActor("EditMenu Left")..{
BeginCommand=cmd(zoomx,-1);
};
};
return t;
|
class("PlayPuzzleSidebar").extends(Sidebar)
function PlayPuzzleSidebar:init()
PlayPuzzleSidebar.super.init(self)
end
function PlayPuzzleSidebar:enter(context, selected)
local player = context.player
local creator = context.creator
local puzzle = context.puzzle
local config = {
player = player.avatar,
creator = creator.avatar,
menuTitle = self:getTitle(player, creator, puzzle),
menuItems = {
{
text = puzzle.hasBeenSolved and "See results" or "Solve",
exec = function()
closeSidebar()
end
}
}
}
if not puzzle.hasBeenSolved then
table.insert(config.menuItems, {
text = "Hint style: " .. NUM_STYLE_NAMES[context.settings.hintStyle],
selected = selected == ACTION_ID_HINT_STYLE,
img = createHintStylePreview(context.settings.hintStyle),
exec = function ()
self.onHintStyleNext()
end,
execLeft = function ()
self.onHintStylePrevious()
end,
execRight = function ()
self.onHintStyleNext()
end
})
table.insert(config.menuItems, {
text = "Restart",
exec = function()
context.screen:resetGrid()
end
})
end
if player.id == PLAYER_ID_QUICK_PLAY then
if puzzle.hasBeenSolved then
table.insert(config.menuItems, {
text = "Solve another",
exec = function()
self.onNext()
end
})
end
else
if creator.id == player.id or player:hasPlayed(puzzle) then
table.insert(config.menuItems, {
text = "Remix puzzle",
exec = function()
self.onRemixPuzzle()
end
})
end
if creator.id == player.id then
table.insert(config.menuItems, {
text = "Delete puzzle",
exec = function()
self.onDeletePuzzle()
end
})
end
end
PlayPuzzleSidebar.super.enter(self, context, config)
end
function PlayPuzzleSidebar:getTitle(player, creator, puzzle)
if creator.id == player.id or player:hasPlayed(puzzle) then
return "\"" .. puzzle.title .. "\""
end
for i, id in ipairs(creator.created) do
if id == puzzle.id then
return string.format("Puzzle %02d", i)
end
end
end
|
modifier_rubick_spell_steal_lua_hidden = class({})
--------------------------------------------------------------------------------
-- Classifications
function modifier_rubick_spell_steal_lua_hidden:IsHidden()
return true
end
function modifier_rubick_spell_steal_lua_hidden:IsDebuff()
return false
end
function modifier_rubick_spell_steal_lua_hidden:IsPurgable()
return false
end
function modifier_rubick_spell_steal_lua_hidden:RemoveOnDeath()
return false
end
--------------------------------------------------------------------------------
-- Initializations
function modifier_rubick_spell_steal_lua_hidden:OnCreated( kv )
end
function modifier_rubick_spell_steal_lua_hidden:OnRefresh( kv )
end
function modifier_rubick_spell_steal_lua_hidden:OnDestroy()
end
--------------------------------------------------------------------------------
-- Modifier Effects
function modifier_rubick_spell_steal_lua_hidden:DeclareFunctions()
local funcs = {
MODIFIER_EVENT_ON_ABILITY_FULLY_CAST,
}
return funcs
end
function modifier_rubick_spell_steal_lua_hidden:OnAbilityFullyCast( params )
if IsServer() then
if params.unit==self:GetParent() and (not params.ability:IsItem()) then
return
end
-- Filter
if params.unit:IsIllusion() then
return
end
self:GetAbility():SetLastSpell( params.unit, params.ability )
end
end
|
local function ErrorHandler(err)
print(string.format("[Error] %s", err))
print(debug.traceback())
end
return function(folder, file_names)
local files, data = {}
for _, file_name in ipairs(file_names) do
data = select(2, xpcall(require, ErrorHandler, table.concat({folder, ".", file_name})))
files[data.name or file_name] = data
end
return files
end
|
--=========== Copyright © 2020, Planimeter, All rights reserved. ===========--
--
-- Purpose:
--
--==========================================================================--
local SDL = require( "sdl" )
module( "framework.timer" )
_frames = _frames or 0
_dt = _dt or 0
_lastTime = _lastTime or 0
_fps = _fps or 0
_averageDelta = _averageDelta or 0
_nextFPSUpdate = _nextFPSUpdate or 0
_lastFPSUpdate = _lastFPSUpdate or 0
function getAverageDelta()
return _averageDelta
end
function getDelta()
return _dt
end
function getFPS()
return _fps
end
function getTime()
return SDL.SDL_GetTicks() / 1000
end
function sleep( seconds )
SDL.SDL_Delay( seconds * 1000 )
end
function step()
_frames = _frames + 1
local time = getTime()
_dt = time - _lastTime
_lastTime = time
if ( _nextFPSUpdate <= time ) then
_fps = _frames
_averageDelta = ( ( time - _lastFPSUpdate ) / _frames )
_nextFPSUpdate = time + 1
_lastFPSUpdate = time
_frames = 0
end
return _dt
end
|
local widget = require( "widget" )
local composer = require( "composer" )
local json = require ("json")
local loadsave = require( "loadsave" )
local myData = require ("mydata")
local crewWarsAlertScene = composer.newScene()
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
--> GENERAL FUNCTIONS
---------------------------------------------------------------------------------
local close = function(event)
if (event.phase == "ended") then
cwOverlay=false
backSound()
timer.performWithDelay(100,composer.hideOverlay( "fade", 100 ))
end
end
local function onAlert()
end
---------------------------------------------------------------------------------
--> SCENE EVENTS
---------------------------------------------------------------------------------
-- Scene Creation
function crewWarsAlertScene:create(event)
alertGroup = self.view
loginInfo = localToken()
params = event.params
tutIconSize=fontSize(300)
myData.alertRect = display.newRoundedRect( display.contentWidth/2, display.contentHeight/2, display.contentWidth/1.2, fontSize(300), 15 )
myData.alertRect.anchorX = 0.5
myData.alertRect.anchorY = 0.5
myData.alertRect.strokeWidth = 5
myData.alertRect:setFillColor( 0,0,0 )
myData.alertRect:setStrokeColor( strokeColor1[1], strokeColor1[2], strokeColor1[3] )
myData.alertRect.rotation=90
local options =
{
text = params.text,
x = myData.alertRect.x+fontSize(110),
y = myData.alertRect.y,
width = myData.alertRect.width-80,
font = native.systemFont,
fontSize = fontSize(42),
align = "center"
}
myData.alertText = display.newText( options )
myData.alertText:setFillColor( 0.9,0.9,0.9 )
myData.alertText.anchorX=0.5
myData.alertText.anchorY=0
myData.alertText.rotation=90
myData.completeButton = widget.newButton(
{
left = myData.alertRect.x-myData.alertText.height,
top = myData.alertRect.y,
width = 400,
height = fontSize(90),
defaultFile = buttonColor400,
-- overFile = "buttonOver.png",
fontSize = fontSize(60),
label = "Close",
labelColor = tableColor1,
onEvent = close
})
myData.completeButton.anchorX=0.5
myData.completeButton.anchorY=0
myData.completeButton.x = myData.alertRect.x-myData.alertText.height/2
myData.completeButton.y = myData.alertRect.y
myData.completeButton.rotation=90
-- Show HUD
alertGroup:insert(myData.alertRect)
alertGroup:insert(myData.alertText)
alertGroup:insert(myData.completeButton)
-- Button Listeners
myData.completeButton:addEventListener("tap", close)
end
-- Home Show
function crewWarsAlertScene:show(event)
local taskalertGroup = self.view
if event.phase == "will" then
-- Called when the scene is still off screen (but is about to come on screen).
end
if event.phase == "did" then
--
end
end
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
--> Listener setup
---------------------------------------------------------------------------------
crewWarsAlertScene:addEventListener( "create", crewWarsAlertScene )
crewWarsAlertScene:addEventListener( "show", crewWarsAlertScene )
---------------------------------------------------------------------------------
return crewWarsAlertScene
|
object_tangible_quest_survey_data_05 = object_tangible_quest_shared_survey_data_05:new {
}
ObjectTemplates:addTemplate(object_tangible_quest_survey_data_05, "object/tangible/quest/survey_data_05.iff")
|
-- Shows mechanisms linked to the current building.
--[====[
gui/mechanisms
==============
Lists mechanisms connected to the building, and their links. Navigating
the list centers the view on the relevant linked buildings.
.. image:: /docs/images/mechanisms.png
To exit, press :kbd:`Esc` or :kbd:`Enter`; :kbd:`Esc` recenters on
the original building, while :kbd:`Enter` leaves focus on the current
one. :kbd:`Shift`:kbd:`Enter` has an effect equivalent to pressing
:kbd:`Enter`, and then re-entering the mechanisms UI.
]====]
local utils = require 'utils'
local gui = require 'gui'
local guidm = require 'gui.dwarfmode'
function listMechanismLinks(building)
local lst = {}
local function push(item, mode)
if item then
lst[#lst+1] = {
obj = item, mode = mode,
name = utils.getBuildingName(item)
}
end
end
push(building, 'self')
if not df.building_actual:is_instance(building) then
return lst
end
local item, tref, tgt
for _,v in ipairs(building.contained_items) do
item = v.item
if df.item_trappartsst:is_instance(item) then
tref = dfhack.items.getGeneralRef(item, df.general_ref_type.BUILDING_TRIGGER)
if tref then
push(tref:getBuilding(), 'trigger')
end
tref = dfhack.items.getGeneralRef(item, df.general_ref_type.BUILDING_TRIGGERTARGET)
if tref then
push(tref:getBuilding(), 'target')
end
end
end
return lst
end
MechanismList = defclass(MechanismList, guidm.MenuOverlay)
MechanismList.focus_path = 'mechanisms'
function MechanismList:init(info)
self:assign{
links = {}, selected = 1
}
self:fillList(info.building)
end
function MechanismList:fillList(building)
local links = listMechanismLinks(building)
self.old_viewport = self:getViewport()
self.old_cursor = guidm.getCursorPos()
if #links <= 1 then
links[1].mode = 'none'
end
self.links = links
self.selected = 1
end
local colors = {
self = COLOR_CYAN, none = COLOR_CYAN,
trigger = COLOR_GREEN, target = COLOR_GREEN
}
local icons = {
self = 128, none = 63, trigger = 27, target = 26
}
function MechanismList:onRenderBody(dc)
dc:clear()
dc:seek(1,1):string("Mechanism Links", COLOR_WHITE):newline()
for i,v in ipairs(self.links) do
local pen = { fg=colors[v.mode], bold = (i == self.selected) }
dc:newline(1):pen(pen):char(icons[v.mode])
dc:advance(1):string(v.name)
end
local nlinks = #self.links
if nlinks <= 1 then
dc:newline():newline(1):string("This building has no links", COLOR_LIGHTRED)
end
dc:newline():newline(1):pen(COLOR_WHITE)
dc:key('LEAVESCREEN'):string(": Back, ")
dc:key('SELECT'):string(": Switch"):newline(1)
dc:key_string('LEAVESCREEN_ALL', "Exit to map")
end
function MechanismList:changeSelected(delta)
if #self.links <= 1 then return end
self.selected = 1 + (self.selected + delta - 1) % #self.links
self:selectBuilding(self.links[self.selected].obj)
end
function MechanismList:onInput(keys)
if keys.SECONDSCROLL_UP then
self:changeSelected(-1)
elseif keys.SECONDSCROLL_DOWN then
self:changeSelected(1)
elseif keys.LEAVESCREEN or keys.LEAVESCREEN_ALL then
self:dismiss()
if self.selected ~= 1 and not keys.LEAVESCREEN_ALL then
self:selectBuilding(self.links[1].obj, self.old_cursor, self.old_viewport)
end
elseif keys.SELECT_ALL then
if self.selected > 1 then
self:fillList(self.links[self.selected].obj)
end
elseif keys.SELECT then
self:dismiss()
elseif self:simulateViewScroll(keys) then
return
end
end
if not string.match(dfhack.gui.getCurFocus(), '^dwarfmode/QueryBuilding/Some') then
qerror("This script requires the main dwarfmode view in 'q' mode")
end
local list = MechanismList{ building = df.global.world.selected_building }
list:show()
list:changeSelected(1)
|
local mod = get_mod("InfiniteAmmo") -- luacheck: ignore get_mod
-- luacheck: globals Managers Unit ScriptUnit
mod.on_disabled = function()
if not mod.is_ready then
return
end
mod.remove_buffs()
end
mod.update = function()
if not mod.is_ready then
return
end
if mod:is_enabled() then
mod.refresh_buffs()
else
mod.remove_buffs()
end
end
mod.on_game_state_changed = function(status, state)
if status == "enter" and state == "StateIngame" then
mod.is_ready = true
end
end
mod.remove_buffs = function()
if Managers.player:local_player() then
local local_player_unit = Managers.player:local_player().player_unit
if local_player_unit and Unit.alive(local_player_unit) then
local buff_extension = ScriptUnit.has_extension(local_player_unit, "buff_system")
if buff_extension and buff_extension:has_buff_type("twitch_no_overcharge_no_ammo_reloads") then
local inf_ammo_buff = buff_extension:get_non_stacking_buff("twitch_no_overcharge_no_ammo_reloads")
buff_extension:remove_buff(inf_ammo_buff.id)
end
end
end
if Managers.player.is_server then
local players = Managers.player:human_and_bot_players()
for _, player in pairs(players) do
local unit = player.player_unit
if Unit.alive(unit) then
local buff_extension = ScriptUnit.has_extension(unit, "buff_system")
if buff_extension and buff_extension:has_buff_type("twitch_no_overcharge_no_ammo_reloads") then
local inf_ammo_buff = buff_extension:get_non_stacking_buff("twitch_no_overcharge_no_ammo_reloads")
buff_extension:remove_buff(inf_ammo_buff.id)
end
end
end
end
end
mod.refresh_buffs = function()
if Managers.player:local_player() then
local local_player_unit = Managers.player:local_player().player_unit
if local_player_unit and Unit.alive(local_player_unit) then
local buff_extension = ScriptUnit.has_extension(local_player_unit, "buff_system")
if buff_extension then
buff_extension:add_buff("twitch_no_overcharge_no_ammo_reloads")
end
end
end
if Managers.player.is_server then
local players = Managers.player:human_and_bot_players()
for _, player in pairs(players) do
local unit = player.player_unit
if Unit.alive(unit) then
local buff_extension = ScriptUnit.has_extension(unit, "buff_system")
if buff_extension and not buff_extension:has_buff_type("twitch_no_overcharge_no_ammo_reloads") then
local buff_system = Managers.state.entity:system("buff_system")
local server_controlled = false
buff_system:add_buff(unit, "twitch_no_overcharge_no_ammo_reloads", unit, server_controlled)
end
end
end
end
end
|
_ENV.require = nil
local require = loadfile "D:\\Programming\\lua-vfs\\knowledge_base\\lua\\relative_require.lua" () (...)
-- local require = require "relative_require" (...)
local restore = package.path
package.path = "./?.lua"
local Promise = require "Promise"
Promise.async, Promise.await = require "keywords" (
Promise.new,
function(promise, handler) promise:next(handler) end,
function(promise, handler) promise:catch(handler) end)
package.path = restore
return Promise
|
local ansible = {}
function ansible.config()
vim.g.ansible_unindent_after_newline = 1
vim.g.ansible_extra_keywords_highlight = 1
vim.g.ansible_template_syntaxes = {
["*.sh.j2"] = "sh",
}
end
return ansible
|
namespace('Radio')
local g_NotifyPlayers = {}
local function loadChannels()
channels = {}
local node, i = xmlLoadFile('conf/radio.xml'), 0
if(node) then
while(true) do
local subnode = xmlFindChild(node, 'channel', i)
if(not subnode) then break end
i = i + 1
local ch = {}
ch.name = xmlNodeGetAttribute(subnode, 'name')
ch.img = xmlNodeGetAttribute(subnode, 'img')
ch.url = xmlNodeGetValue(subnode)
assert(ch.name and ch.url)
table.insert(channels, ch)
end
xmlUnloadFile(node)
else
Debug.warn('Failed to load radio channnels list')
end
table.sort(channels, function(ch1, ch2) return ch1.name:lower() < ch2.name:lower() end)
return channels
end
local function notifyAll()
triggerClientEvent(g_NotifyPlayers, 'toxic.onRadioChannelsChange', resourceRoot)
end
function saveChannels(channels)
local node = xmlCreateFile('conf/radio.xml', 'channels')
if(not node) then return false end
table.sort(channels, function(ch1, ch2) return ch1.name:lower() < ch2.name:lower() end)
Cache.set('Radio.Channels', channels, 300)
for i, ch in ipairs(channels) do
local subnode = xmlCreateChild(node, 'channel')
xmlNodeSetValue(subnode, ch.url)
xmlNodeSetAttribute(subnode, 'name', ch.name)
if(ch.img) then
xmlNodeSetAttribute(subnode, 'img', ch.img)
end
end
xmlSaveFile(node)
xmlUnloadFile(node)
notifyAll()
end
function getChannels()
local channels = Cache.get('Radio.Channels')
if(not channels) then
channels = loadChannels()
Cache.set('Radio.Channels', channels, 300)
end
if(not table.find(g_NotifyPlayers, client)) then
table.insert(g_NotifyPlayers, client)
end
return channels
end
RPC.allow('Radio.getChannels')
addInitFunc(function()
addEventHandler('onPlayerQuit', root, function()
table.removeValue(g_NotifyPlayers, source)
end)
end)
|
--[[
################################################################################
#
# Copyright (c) 2014-2019 Ultraschall (http://ultraschall.fm)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
################################################################################
]]
-------------------------------------
--- ULTRASCHALL - API - FUNCTIONS ---
-------------------------------------
--- Clipboard Module ---
-------------------------------------
if type(ultraschall)~="table" then
-- update buildnumber and add ultraschall as a table, when programming within this file
local retval, string = reaper.BR_Win32_GetPrivateProfileString("Ultraschall-Api-Build", "Functions-Build", "", reaper.GetResourcePath().."/UserPlugins/ultraschall_api/IniFiles/ultraschall_api.ini")
local retval, string = reaper.BR_Win32_GetPrivateProfileString("Ultraschall-Api-Build", "Clipboard-Module-Build", "", reaper.GetResourcePath().."/UserPlugins/ultraschall_api/IniFiles/ultraschall_api.ini")
local retval, string2 = reaper.BR_Win32_GetPrivateProfileString("Ultraschall-Api-Build", "API-Build", "", reaper.GetResourcePath().."/UserPlugins/ultraschall_api/IniFiles/ultraschall_api.ini")
if string=="" then string=10000
else
string=tonumber(string)
string=string+1
end
if string2=="" then string2=10000
else
string2=tonumber(string2)
string2=string2+1
end
reaper.BR_Win32_WritePrivateProfileString("Ultraschall-Api-Build", "Functions-Build", string, reaper.GetResourcePath().."/UserPlugins/ultraschall_api/IniFiles/ultraschall_api.ini")
reaper.BR_Win32_WritePrivateProfileString("Ultraschall-Api-Build", "API-Build", string2, reaper.GetResourcePath().."/UserPlugins/ultraschall_api/IniFiles/ultraschall_api.ini")
ultraschall={}
ultraschall.API_TempPath=reaper.GetResourcePath().."/UserPlugins/ultraschall_api/temp/"
end
function ultraschall.GetMediaItemsFromClipboard()
--[[
<US_DocBloc version="1.0" spok_lang="en" prog_lang="*">
<slug>GetMediaItemsFromClipboard</slug>
<requires>
Ultraschall=4.00
Reaper=5.40
Lua=5.3
</requires>
<functioncall>integer count, array MediaItemStateChunkArray = ultraschall.GetMediaItemsFromClipboard()</functioncall>
<description>
Returns the number of mediaitems and a MediaItemStateChunkArray of the mediaitems, as stored in the clipboard.
It does it by pasting the items at the end of the project, getting them and deleting them again.
Use sparsely and with care, as it uses a lot of resources!
</description>
<retvals>
integer count - the number of items in the clipboard
array MediaItemStatechunkArray - the mediaitem-statechunks of the items in the clipboard. One entry for each mediaitem-statechunk.
</retvals>
<chapter_context>
Clipboard Functions
</chapter_context>
<target_document>US_Api_Functions</target_document>
<source_document>Modules/ultraschall_functions_Clipboard_Module.lua</source_document>
<tags>copy and paste, clipboard, mediaitems, statechunk, mediaitemstatechunk</tags>
</US_DocBloc>
]]
local trackstring_old=ultraschall.GetAllSelectedTracks()
local Aoldmarker=reaper.GetCursorPosition()
local Astartpos=reaper.GetProjectLength()
reaper.SetEditCurPos(Astartpos,false,false)
reaper.Main_OnCommand(40058,0)
local Aendpos=reaper.GetProjectLength()
trackstring = ultraschall.CreateTrackString(1, reaper.CountTracks(), 1)
local Acount, MediaItemArray, MediaItemStateChunkArray = ultraschall.GetAllMediaItemsBetween(Astartpos-.0000000001, Aendpos, trackstring, true)
reaper.SetEditCurPos(Aoldmarker,true,false)
local retval = ultraschall.DeleteMediaItemsFromArray(MediaItemArray)
reaper.UpdateArrange()
return Acount, MediaItemStateChunkArray
end
function ultraschall.GetStringFromClipboard_SWS()
--[[
<US_DocBloc version="1.0" spok_lang="en" prog_lang="*">
<slug>GetStringFromClipboard_SWS</slug>
<requires>
Ultraschall=4.00
Reaper=5.52
SWS=2.9.7
Lua=5.3
</requires>
<functioncall>string clipboard_string = ultraschall.GetStringFromClipboard_SWS()</functioncall>
<description>
Returns the content of the clipboard as a string. Uses the SWS-function reaper.CF_GetClipboard, but does everything for you, that is needed for proper use of this function.
</description>
<retvals>
string clipboard_string - the content of the clipboard as a string
</retvals>
<chapter_context>
Clipboard Functions
</chapter_context>
<target_document>US_Api_Functions</target_document>
<source_document>Modules/ultraschall_functions_Clipboard_Module.lua</source_document>
<tags>copy and paste, clipboard, sws</tags>
</US_DocBloc>
]]
local buf = reaper.CF_GetClipboard(buf)
local WDL_FastString=reaper.SNM_CreateFastString("HudelDudel")
local clipboardstring=reaper.CF_GetClipboardBig(WDL_FastString)
reaper.SNM_DeleteFastString(WDL_FastString)
return clipboardstring
end
function ultraschall.PutMediaItemsToClipboard_MediaItemArray(MediaItemArray)
--[[
<US_DocBloc version="1.0" spok_lang="en" prog_lang="*">
<slug>PutMediaItemsToClipboard_MediaItemArray</slug>
<requires>
Ultraschall=4.00
Reaper=5.95
Lua=5.3
</requires>
<functioncall>boolean retval = ultraschall.PutMediaItemsToClipboard_MediaItemArray(MediaItemArray MediaItemArray)</functioncall>
<description>
Puts the items in MediaItemArray into the clipboard.
Returns false in case of an error
</description>
<parameters>
MediaItemArray MediaItemArray - an array with all MediaItems, that shall be put into the clipboard
</parameters>
<retvals>
boolean retval - true, if successful; false, if not
</retvals>
<chapter_context>
Clipboard Functions
</chapter_context>
<target_document>US_Api_Functions</target_document>
<source_document>Modules/ultraschall_functions_Clipboard_Module.lua</source_document>
<tags>mediaitem, put, clipboard, set</tags>
</US_DocBloc>
]]
if ultraschall.IsValidMediaItemArray(MediaItemArray)==false then ultraschall.AddErrorMessage("PutMediaItemsToClipboard_MediaItemArray", "MediaItemArray", "must be a valid MediaItemArray", -1) return false end
reaper.PreventUIRefresh(1)
local count, MediaItemArray_selected = ultraschall.GetAllSelectedMediaItems() -- get old selection
reaper.SelectAllMediaItems(0, false) -- deselect all MediaItems
local retval = ultraschall.SelectMediaItems_MediaItemArray(MediaItemArray) -- select to-be-cut-MediaItems
reaper.Main_OnCommand(40057,0) -- copy them into clipboard
reaper.SelectAllMediaItems(0, false) -- deselect all MediaItems
local retval = ultraschall.SelectMediaItems_MediaItemArray(MediaItemArray_selected) -- select formerly selected MediaItems
reaper.PreventUIRefresh(-1)
reaper.UpdateArrange()
return true
end
|
table.insert(emojichatHTML, [===[<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<style>
body {
background-color: transparent;
color: #fff!important;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-family: Verdana, sans-serif;
font-weight: 700;
letter-spacing: 1px;
}
a {
color: #4A99D2;
cursor: pointer;
}
.emoji {
height: 1.25em;
width: 1.25em;
padding: 0 .05em 0 .1em;
vertical-align: -0.2em;
}
img.emoji {
width: auto;
}
#output {
position: absolute;
top: 0;
left: 0;
bottom: 25px;
overflow: hidden;
font-size: 14px;
}
.output-full {
right: 0;
}
.output-reduced {
right: 245px;
}
.line {
min-height: 3em;
}
.line>* {
word-wrap: break-word;
}
.inactive-line {
opacity: 0;
}
#input-suggestions {
position: absolute;
left: 0;
right: 17px;
bottom: 25px;
background: rgba(0, 0, 0, 0.85);
display: none;
z-index: 999;
font-size: 16px;
border-radius: 5px 5px 0 0;
}
#suggestion-item-0 {
border-radius: 5px 5px 0 0;
}
.suggestion-item {
padding-left: 10px;
position: relative;
}
.selected-suggestion {
background: rgba(192, 57, 43, 0.5);
}
.suggestion-up, .suggestion-down, .suggestion-select {
position: absolute;
right: 0;
display: none;
background: #aaa;
text-align: center;
color: black;
border-radius: 4px;
font-size: 0.8em;
border-right: 2px solid #777;
border-bottom: 2px solid #777;
border-top: 2px solid #ddd;
border-left: 2px solid #ddd;
}
.suggestion-select {
width: 70px;
top: 0;
}
.suggestion-up, .suggestion-down {
width: 18px;
right: 26px;
}
.suggestion-up {
top: -2px;
}
.suggestion-down {
top: 2px;
}
.previous-suggestion .suggestion-up, .next-suggestion .suggestion-down, .selected-suggestion .suggestion-select {
display: inline-block;
}
#input {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 25px;
display: none;
}
input:focus {
outline: none !important;
border:1px solid #c0392b!important;
}
#input-box-wrapper {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
}
#input-box {
background: #333;
color: rgb(230, 230, 230);
height: 25px;
font-size: 16px;
padding: 0;
border: 0;
width: 100%;
}
#input-emoji-button {
position: absolute;
cursor: pointer;
bottom: 0;
right: 0;
}
#input-emoji-button-inner-wrapper {
border-radius: 5px;
text-align: center;
background: #666;
padding-left: 5px;
padding-right: 7px;
}
#input-emoji-list {
display: none;
position: absolute;
top: 0;
right: 0;
bottom: 25px;
width: 252px;
line-height: 19px;
border-left: 1px solid #c0392b;
/* background: black; */
}
#input-emoji-list-emojis {
overflow-x: hidden;
overflow-y: scroll;
position: absolute;
padding: 5px 3px 5px 10px;
top: 0;
left: 0;
right: 0;
bottom: 34px;
}
#input-emoji-category-list {
text-align: center;
position: absolute;
bottom: 0;
padding: 5px 0;
left: 0;
right: 0;
}
.emoji-category-button {
cursor: pointer;
padding: 2px 2px 1px 0px;
border-radius: 4px;
}
.emoji-category-button:hover, .emoji-category-list-emoji:hover {
background: rgba(192, 57, 43, 0.5);
}
.active-emoji-category-button {
background: white;
}
.emoji-category-emojis {
display: none;
}
.emoji-category-list-emoji {
cursor: pointer;
}
/* From Bootstrap */
body {
font-size: 1rem;
text-align: left;
line-height: 1.5;
}
button, input {
overflow: visible;
}
button, input, optgroup, select, textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
*, ::after, ::before {
box-sizing: border-box;
}
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
</style>
</head>
<body id="body">
<div id="output" class="output-full"></div>
<div id="input-suggestions"></div>
<div id="input-emoji-list">
<div id="input-emoji-list-emojis"></div>
<div id="input-emoji-category-list"></div>
<div style="position: absolute;left: 0;bottom: 30px;height: 4px;right: 0;">
<div style="background: #c0392b;height: 50%;width: 75%;margin: 0 auto;margin-top: 2px;"></div>
</div>
</div>
<div id="input">
<span id="input-prompt"></span>
<div id="input-box-wrapper">
<input id="input-box" type="text" />
</div>
</div>
<script type="text/javascript">var emojiChat=function(a){var e={};function r(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return a[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=a,r.c=e,r.d=function(a,e,t){r.o(a,e)||Object.defineProperty(a,e,{enumerable:!0,get:t})},r.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},r.t=function(a,e){if(1&e&&(a=r(a)),8&e)return a;if(4&e&&"object"==typeof a&&a&&a.__esModule)return a;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:a}),2&e&&"string"!=typeof a)for(var o in a)r.d(t,o,function(e){return a[e]}.bind(null,o));return t},r.n=function(a){var e=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(e,"a",e),e},r.o=function(a,e){return Object.prototype.hasOwnProperty.call(a,e)},r.p="",r(r.s=2)}([function(a,e,r){a.exports={lib:r(4),ordered:r(5),fitzpatrick_scale_modifiers:["🏻","🏼","🏽","🏾","🏿"]}},function(a,e,r){"use strict";var t,o,c;Object.defineProperty(e,"__esModule",{value:!0}),e.Reset=n,e.AreActive=function(){return t},e.Show=function(a,e){if(t=!0,a.length<1)return void(o=[]);o=a.slice(0,1),s(e),i().style.display="block";var r=document.getElementById("suggestion-item-0").scrollHeight,c=document.getElementById("output").scrollHeight,n=Math.floor(c/r);o=a.slice(0,Math.min(a.length,n)),s(e),d(0,0,1)},e.Hide=function(){n(),i().style.display="none"},e.ChangeSelection=function(a){l("previous-suggestion"),l("selected-suggestion"),l("next-suggestion");var e=c+a;e<0?e=o.length-1:e>=o.length&&(e=0);var r=Math.max(e-1,0),t=Math.min(e+1,o.length-1);d(e,r,t)},e.GetSelectedSuggestion=function(){return o[c]};function n(){t=!1,o=[],c=0}function i(){return document.getElementById("input-suggestions")}function s(a){var e=i();e.innerHTML="";for(var r=0;r<o.length;r++){var t=o[r];e.innerHTML+='<div id="suggestion-item-'+r+'" class="suggestion-item">'+a(t)+'<span class="suggestion-up">▲</span><span class="suggestion-down">▼</span><span class="suggestion-select">ENTER ↩</span></div>'}}function l(a){for(var e=document.getElementsByClassName(a),r=0;r<e.length;r++)e[r].classList.remove(a)}function d(a,e,r){c=a;var t=document.getElementById("suggestion-item-"+c);if(null!==t&&t.classList.add("selected-suggestion"),e!=a){var o=document.getElementById("suggestion-item-"+e);null!==o&&o.classList.add("previous-suggestion")}if(r!=a){var n=document.getElementById("suggestion-item-"+r);null!==n&&n.classList.add("next-suggestion")}}},function(a,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.openURL=function(a){s.OpenURL(a)},e.insertEmoji=function(a){z(a)},e.setFadeTime=function(a){f.State.FadeTimeSeconds=a},e.setActive=function(a,e,r){var t=JSON.parse(e),o=JSON.parse(r);f.State.Active=!0,f.State.ActivePlayer=o,t.sort((function(a,e){return a.name>e.name?1:e.name>a.name?-1:0})),f.State.PlayerList=t,d.SetDestination(a),d.SetActivePlayerName(f.State.ActivePlayer.name),u.Chatbox.SetInputActive(),f.State.SuggestionMode=f.SuggestionMode.None,i.Hide();for(var c=document.getElementsByClassName("line"),n=0;n<c.length;n++){c[n].classList.remove("inactive-line")}},e.setInactive=function(){f.State.Active=!1,l.Reset(),window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),f.State.SuggestionMode=f.SuggestionMode.None,i.Hide();for(var a=document.getElementsByClassName("faded-line"),e=0;e<a.length;e++){a[e].classList.add("inactive-line")}u.Chatbox.ScrollToBottom(),u.Chatbox.SetInputInactive()},e.addOutput=b;var t=y(r(3)),o=y(r(9)),c=r(10),n=r(11),i=y(r(1)),s=y(r(13)),l=y(r(14)),d=y(r(15)),u=r(16),f=r(17);function y(a){if(a&&a.__esModule)return a;var e={};if(null!=a)for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);return e.default=a,e}var _=27,p=13,g=38,h=40,k=39,m=96,w=64;function b(a){for(var e=JSON.parse(a),r="",t=0;t<e.length;t++){var o=e[t];r+='<span style="color: '+(0,n.colourToRGBA)(o.colour)+'">'+(0,n.preProcessTextForOutput)(o.text)+"</span>"}var c="line-"+f.State.CurrentLine++;u.Chatbox.OutputElement().innerHTML+="<div id='"+c+"' class='line'>"+r+"</div>",u.Chatbox.ScrollToBottom(),function(a){setTimeout((function(){var e=document.getElementById(a);e.classList.add("faded-line"),f.State.Active||e.classList.add("inactive-line")}),1e3*f.State.FadeTimeSeconds)}(c)}function z(a){for(var e=u.Chatbox.InputBoxElement(),r=e.value,t=e.selectionStart,o=e.selectionEnd,c=r.substring(0,t),i=r.substring(o,r.length),l=c+a+i,d=!1;(0,n.byteLength)(l)>126;)d=!0,l=c+(a=a.substring(0,a.length-1))+i;d&&s.PlayWarningSound(),e.value=l;var f=l.length-i.length;e.setSelectionRange(f,f),(0,n.triggerEvent)(e,"input")}u.Chatbox.InputBoxElement().addEventListener("keyup",(function(a){(a.which||a.keyCode||0)===p&&(a.preventDefault(),l.ShouldIgnoreNextEnterRelease()||s.SendMessage(a.target.value,d.GetSelectedDestination()),l.ConsumeEnterRelease())})),document.getElementById("body").addEventListener("keydown",(function(a){(a.which||a.keyCode||0)===_&&(a.preventDefault(),s.CloseChat())})),u.Chatbox.InputBoxElement().addEventListener("click",(function(a){l.UpdateCaretPosition(a.target.selectionStart)})),u.Chatbox.InputBoxElement().addEventListener("focus",(function(a){l.UpdateCaretPosition(a.target.selectionStart)})),u.Chatbox.InputBoxElement().addEventListener("keypress",(function(a){var e=a.which||a.keyCode||0;e!==m&&e!==k&&e!==w||s.HideMenu()})),u.Chatbox.InputBoxElement().addEventListener("keydown",(function(a){var e=a.which||a.keyCode||0;e===g?(a.preventDefault(),i.AreActive()&&i.ChangeSelection(-1)):e===h?(a.preventDefault(),i.AreActive()&&i.ChangeSelection(1)):l.UpdateCaretPosition(a.target.selectionStart)})),u.Chatbox.InputBoxElement().addEventListener("paste",(function(a){a.preventDefault(),a.stopPropagation(),z((a.clipboardData||window.clipboardData).getData("text"))})),u.Chatbox.InputBoxElement().addEventListener("input",(function(a){if(f.State.Active){var e=a.target,r=e.value;if((0,n.byteLength)(r)>126)return r=l.GetText(),e.value=r,e.setSelectionRange(r.length,r.length),void s.PlayWarningSound();if(l.SetText(r),f.State.SuggestionMode===f.SuggestionMode.PlayerName||f.State.SuggestionMode===f.SuggestionMode.None){var d=c.TextAnalyser.FindInProgressPlayerName(e.value,e.selectionStart);if(d.inProgress)o.search(f.State.PlayerList,d.incompletePlayerName).length>0?f.State.SuggestionMode=f.SuggestionMode.PlayerName:f.State.SuggestionMode=f.SuggestionMode.None;else i.Hide(),f.State.SuggestionMode=f.SuggestionMode.None}if(f.State.SuggestionMode===f.SuggestionMode.Emoji||f.State.SuggestionMode===f.SuggestionMode.None){var u=c.TextAnalyser.FindInProgressEmoji(e.value,e.selectionStart);if(u.inProgress)t.search(u.incompleteEmojiCode).length>0?f.State.SuggestionMode=f.SuggestionMode.Emoji:f.State.SuggestionMode=f.SuggestionMode.None;else i.Hide(),f.State.SuggestionMode=f.SuggestionMode.None}s.InputChangeCallback(r)}})),u.Chatbox.ScrollToBottom(),d.Reset(),i.Reset(),b('[{"colour":{"r":0,"g":0,"b":0,"a":0},"text":""}]')},function(a,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EmojiOption=void 0,e.search=function(a){var e=a.toLocaleLowerCase(),r=[];d.forEach((function(a){-1!==a.toLocaleLowerCase().indexOf(e)&&(r=r.concat(l[a]))})),(r=(0,o.uniq)(r)).sort((function(a,e){return t.ordered[a]-t.ordered[e]})),-1!==r.indexOf(a)&&(r.splice(r.indexOf(a),1),r.unshift(a));return r.map((function(a){return new c(a,t.lib[a].char)}))},e.getCategories=function(){for(var a=[],e=0;e<n.length;e++){var r=n[e];a.push({name:r,symbol:i[r],emojis:s[r]})}return a};var t=function(a){if(a&&a.__esModule)return a;var e={};if(null!=a)for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);return e.default=a,e}(r(0)),o=r(6);var c=e.EmojiOption=function a(e,r){!function(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.name=e,this.char=r},n=["people","animals_and_nature","food_and_drink","travel_and_places","objects","activity","symbols","flags"],i={people:"🙂",animals_and_nature:"🌳",food_and_drink:"🍰",travel_and_places:"🚗",objects:"📦",activity:"⚽",symbols:"▶",flags:"🏴"},s={},l=function(){for(var a={},e=0;e<n.length;e++)s[n[e]]=[];return Object.keys(t.lib).forEach((function(e){var r=t.lib[e];if(r.char){var o=r.category;void 0===s[o]?console.log("Emoji '"+e+"' missing from categories. Category: '"+o+"'"):s[o].push({char:r.char,code:":"+e+":"});var c=r.keywords;c.push(e),c.forEach((function(r){a[r]?a[r].push(e):a[r]=[e]}))}})),a}(),d=Object.keys(l)},function(a){a.exports={100:{keywords:["score","perfect","numbers","century","exam","quiz","test","pass","hundred"],char:"💯",fitzpatrick_scale:!1,category:"symbols"},1234:{keywords:["numbers","blue-square"],char:"🔢",fitzpatrick_scale:!1,category:"symbols"},grinning:{keywords:["face","smile","happy","joy",":D","grin"],char:"😀",fitzpatrick_scale:!1,category:"people"},grimacing:{keywords:["face","grimace","teeth"],char:"😬",fitzpatrick_scale:!1,category:"people"},grin:{keywords:["face","happy","smile","joy","kawaii"],char:"😁",fitzpatrick_scale:!1,category:"people"},joy:{keywords:["face","cry","tears","weep","happy","happytears","haha"],char:"😂",fitzpatrick_scale:!1,category:"people"},rofl:{keywords:["face","rolling","floor","laughing","lol","haha"],char:"🤣",fitzpatrick_scale:!1,category:"people"},partying:{keywords:["face","celebration","woohoo"],char:"🥳",fitzpatrick_scale:!1,category:"people"},smiley:{keywords:["face","happy","joy","haha",":D",":)","smile","funny"],char:"😃",fitzpatrick_scale:!1,category:"people"},smile:{keywords:["face","happy","joy","funny","haha","laugh","like",":D",":)"],char:"😄",fitzpatrick_scale:!1,category:"people"},sweat_smile:{keywords:["face","hot","happy","laugh","sweat","smile","relief"],char:"😅",fitzpatrick_scale:!1,category:"people"},laughing:{keywords:["happy","joy","lol","satisfied","haha","face","glad","XD","laugh"],char:"😆",fitzpatrick_scale:!1,category:"people"},innocent:{keywords:["face","angel","heaven","halo"],char:"😇",fitzpatrick_scale:!1,category:"people"},wink:{keywords:["face","happy","mischievous","secret",";)","smile","eye"],char:"😉",fitzpatrick_scale:!1,category:"people"},blush:{keywords:["face","smile","happy","flushed","crush","embarrassed","shy","joy"],char:"😊",fitzpatrick_scale:!1,category:"people"},slightly_smiling_face:{keywords:["face","smile"],char:"🙂",fitzpatrick_scale:!1,category:"people"},upside_down_face:{keywords:["face","flipped","silly","smile"],char:"🙃",fitzpatrick_scale:!1,category:"people"},relaxed:{keywords:["face","blush","massage","happiness"],char:"☺️",fitzpatrick_scale:!1,category:"people"},yum:{keywords:["happy","joy","tongue","smile","face","silly","yummy","nom","delicious","savouring"],char:"😋",fitzpatrick_scale:!1,category:"people"},relieved:{keywords:["face","relaxed","phew","massage","happiness"],char:"😌",fitzpatrick_scale:!1,category:"people"},heart_eyes:{keywords:["face","love","like","affection","valentines","infatuation","crush","heart"],char:"😍",fitzpatrick_scale:!1,category:"people"},smiling_face_with_three_hearts:{keywords:["face","love","like","affection","valentines","infatuation","crush","hearts","adore"],char:"🥰",fitzpatrick_scale:!1,category:"people"},kissing_heart:{keywords:["face","love","like","affection","valentines","infatuation","kiss"],char:"😘",fitzpatrick_scale:!1,category:"people"},kissing:{keywords:["love","like","face","3","valentines","infatuation","kiss"],char:"😗",fitzpatrick_scale:!1,category:"people"},kissing_smiling_eyes:{keywords:["face","affection","valentines","infatuation","kiss"],char:"😙",fitzpatrick_scale:!1,category:"people"},kissing_closed_eyes:{keywords:["face","love","like","affection","valentines","infatuation","kiss"],char:"😚",fitzpatrick_scale:!1,category:"people"},stuck_out_tongue_winking_eye:{keywords:["face","prank","childish","playful","mischievous","smile","wink","tongue"],char:"😜",fitzpatrick_scale:!1,category:"people"},zany:{keywords:["face","goofy","crazy"],char:"🤪",fitzpatrick_scale:!1,category:"people"},raised_eyebrow:{keywords:["face","distrust","scepticism","disapproval","disbelief","surprise"],char:"🤨",fitzpatrick_scale:!1,category:"people"},monocle:{keywords:["face","stuffy","wealthy"],char:"🧐",fitzpatrick_scale:!1,category:"people"},stuck_out_tongue_closed_eyes:{keywords:["face","prank","playful","mischievous","smile","tongue"],char:"😝",fitzpatrick_scale:!1,category:"people"},stuck_out_tongue:{keywords:["face","prank","childish","playful","mischievous","smile","tongue"],char:"😛",fitzpatrick_scale:!1,category:"people"},money_mouth_face:{keywords:["face","rich","dollar","money"],char:"🤑",fitzpatrick_scale:!1,category:"people"},nerd_face:{keywords:["face","nerdy","geek","dork"],char:"🤓",fitzpatrick_scale:!1,category:"people"},sunglasses:{keywords:["face","cool","smile","summer","beach","sunglass"],char:"😎",fitzpatrick_scale:!1,category:"people"},star_struck:{keywords:["face","smile","starry","eyes","grinning"],char:"🤩",fitzpatrick_scale:!1,category:"people"},clown_face:{keywords:["face"],char:"🤡",fitzpatrick_scale:!1,category:"people"},cowboy_hat_face:{keywords:["face","cowgirl","hat"],char:"🤠",fitzpatrick_scale:!1,category:"people"},hugs:{keywords:["face","smile","hug"],char:"🤗",fitzpatrick_scale:!1,category:"people"},smirk:{keywords:["face","smile","mean","prank","smug","sarcasm"],char:"😏",fitzpatrick_scale:!1,category:"people"},no_mouth:{keywords:["face","hellokitty"],char:"😶",fitzpatrick_scale:!1,category:"people"},neutral_face:{keywords:["indifference","meh",":|","neutral"],char:"😐",fitzpatrick_scale:!1,category:"people"},expressionless:{keywords:["face","indifferent","-_-","meh","deadpan"],char:"😑",fitzpatrick_scale:!1,category:"people"},unamused:{keywords:["indifference","bored","straight face","serious","sarcasm","unimpressed","skeptical","dubious","side_eye"],char:"😒",fitzpatrick_scale:!1,category:"people"},roll_eyes:{keywords:["face","eyeroll","frustrated"],char:"🙄",fitzpatrick_scale:!1,category:"people"},thinking:{keywords:["face","hmmm","think","consider"],char:"🤔",fitzpatrick_scale:!1,category:"people"},lying_face:{keywords:["face","lie","pinocchio"],char:"🤥",fitzpatrick_scale:!1,category:"people"},hand_over_mouth:{keywords:["face","whoops","shock","surprise"],char:"🤭",fitzpatrick_scale:!1,category:"people"},shushing:{keywords:["face","quiet","shhh"],char:"🤫",fitzpatrick_scale:!1,category:"people"},symbols_over_mouth:{keywords:["face","swearing","cursing","cussing","profanity","expletive"],char:"🤬",fitzpatrick_scale:!1,category:"people"},exploding_head:{keywords:["face","shocked","mind","blown"],char:"🤯",fitzpatrick_scale:!1,category:"people"},flushed:{keywords:["face","blush","shy","flattered"],char:"😳",fitzpatrick_scale:!1,category:"people"},disappointed:{keywords:["face","sad","upset","depressed",":("],char:"😞",fitzpatrick_scale:!1,category:"people"},worried:{keywords:["face","concern","nervous",":("],char:"😟",fitzpatrick_scale:!1,category:"people"},angry:{keywords:["mad","face","annoyed","frustrated"],char:"😠",fitzpatrick_scale:!1,category:"people"},rage:{keywords:["angry","mad","hate","despise"],char:"😡",fitzpatrick_scale:!1,category:"people"},pensive:{keywords:["face","sad","depressed","upset"],char:"😔",fitzpatrick_scale:!1,category:"people"},confused:{keywords:["face","indifference","huh","weird","hmmm",":/"],char:"😕",fitzpatrick_scale:!1,category:"people"},slightly_frowning_face:{keywords:["face","frowning","disappointed","sad","upset"],char:"🙁",fitzpatrick_scale:!1,category:"people"},frowning_face:{keywords:["face","sad","upset","frown"],char:"☹",fitzpatrick_scale:!1,category:"people"},persevere:{keywords:["face","sick","no","upset","oops"],char:"😣",fitzpatrick_scale:!1,category:"people"},confounded:{keywords:["face","confused","sick","unwell","oops",":S"],char:"😖",fitzpatrick_scale:!1,category:"people"},tired_face:{keywords:["sick","whine","upset","frustrated"],char:"😫",fitzpatrick_scale:!1,category:"people"},weary:{keywords:["face","tired","sleepy","sad","frustrated","upset"],char:"😩",fitzpatrick_scale:!1,category:"people"},pleading:{keywords:["face","begging","mercy"],char:"🥺",fitzpatrick_scale:!1,category:"people"},triumph:{keywords:["face","gas","phew","proud","pride"],char:"😤",fitzpatrick_scale:!1,category:"people"},open_mouth:{keywords:["face","surprise","impressed","wow","whoa",":O"],char:"😮",fitzpatrick_scale:!1,category:"people"},scream:{keywords:["face","munch","scared","omg"],char:"😱",fitzpatrick_scale:!1,category:"people"},fearful:{keywords:["face","scared","terrified","nervous","oops","huh"],char:"😨",fitzpatrick_scale:!1,category:"people"},cold_sweat:{keywords:["face","nervous","sweat"],char:"😰",fitzpatrick_scale:!1,category:"people"},hushed:{keywords:["face","woo","shh"],char:"😯",fitzpatrick_scale:!1,category:"people"},frowning:{keywords:["face","aw","what"],char:"😦",fitzpatrick_scale:!1,category:"people"},anguished:{keywords:["face","stunned","nervous"],char:"😧",fitzpatrick_scale:!1,category:"people"},cry:{keywords:["face","tears","sad","depressed","upset",":'("],char:"😢",fitzpatrick_scale:!1,category:"people"},disappointed_relieved:{keywords:["face","phew","sweat","nervous"],char:"😥",fitzpatrick_scale:!1,category:"people"},drooling_face:{keywords:["face"],char:"🤤",fitzpatrick_scale:!1,category:"people"},sleepy:{keywords:["face","tired","rest","nap"],char:"😪",fitzpatrick_scale:!1,category:"people"},sweat:{keywords:["face","hot","sad","tired","exercise"],char:"😓",fitzpatrick_scale:!1,category:"people"},hot:{keywords:["face","feverish","heat","red","sweating"],char:"🥵",fitzpatrick_scale:!1,category:"people"},cold:{keywords:["face","blue","freezing","frozen","frostbite","icicles"],char:"🥶",fitzpatrick_scale:!1,category:"people"},sob:{keywords:["face","cry","tears","sad","upset","depressed"],char:"😭",fitzpatrick_scale:!1,category:"people"},dizzy_face:{keywords:["spent","unconscious","xox","dizzy"],char:"😵",fitzpatrick_scale:!1,category:"people"},astonished:{keywords:["face","xox","surprised","poisoned"],char:"😲",fitzpatrick_scale:!1,category:"people"},zipper_mouth_face:{keywords:["face","sealed","zipper","secret"],char:"🤐",fitzpatrick_scale:!1,category:"people"},nauseated_face:{keywords:["face","vomit","gross","green","sick","throw up","ill"],char:"🤢",fitzpatrick_scale:!1,category:"people"},sneezing_face:{keywords:["face","gesundheit","sneeze","sick","allergy"],char:"🤧",fitzpatrick_scale:!1,category:"people"},vomiting:{keywords:["face","sick"],char:"🤮",fitzpatrick_scale:!1,category:"people"},mask:{keywords:["face","sick","ill","disease"],char:"😷",fitzpatrick_scale:!1,category:"people"},face_with_thermometer:{keywords:["sick","temperature","thermometer","cold","fever"],char:"🤒",fitzpatrick_scale:!1,category:"people"},face_with_head_bandage:{keywords:["injured","clumsy","bandage","hurt"],char:"🤕",fitzpatrick_scale:!1,category:"people"},woozy:{keywords:["face","dizzy","intoxicated","tipsy","wavy"],char:"🥴",fitzpatrick_scale:!1,category:"people"},sleeping:{keywords:["face","tired","sleepy","night","zzz"],char:"😴",fitzpatrick_scale:!1,category:"people"},zzz:{keywords:["sleepy","tired","dream"],char:"💤",fitzpatrick_scale:!1,category:"people"},poop:{keywords:["hankey","shitface","fail","turd","shit"],char:"💩",fitzpatrick_scale:!1,category:"people"},smiling_imp:{keywords:["devil","horns"],char:"😈",fitzpatrick_scale:!1,category:"people"},imp:{keywords:["devil","angry","horns"],char:"👿",fitzpatrick_scale:!1,category:"people"},japanese_ogre:{keywords:["monster","red","mask","halloween","scary","creepy","devil","demon","japanese","ogre"],char:"👹",fitzpatrick_scale:!1,category:"people"},japanese_goblin:{keywords:["red","evil","mask","monster","scary","creepy","japanese","goblin"],char:"👺",fitzpatrick_scale:!1,category:"people"},skull:{keywords:["dead","skeleton","creepy","death"],char:"💀",fitzpatrick_scale:!1,category:"people"},ghost:{keywords:["halloween","spooky","scary"],char:"👻",fitzpatrick_scale:!1,category:"people"},alien:{keywords:["UFO","paul","weird","outer_space"],char:"👽",fitzpatrick_scale:!1,category:"people"},robot:{keywords:["computer","machine","bot"],char:"🤖",fitzpatrick_scale:!1,category:"people"},smiley_cat:{keywords:["animal","cats","happy","smile"],char:"😺",fitzpatrick_scale:!1,category:"people"},smile_cat:{keywords:["animal","cats","smile"],char:"😸",fitzpatrick_scale:!1,category:"people"},joy_cat:{keywords:["animal","cats","haha","happy","tears"],char:"😹",fitzpatrick_scale:!1,category:"people"},heart_eyes_cat:{keywords:["animal","love","like","affection","cats","valentines","heart"],char:"😻",fitzpatrick_scale:!1,category:"people"},smirk_cat:{keywords:["animal","cats","smirk"],char:"😼",fitzpatrick_scale:!1,category:"people"},kissing_cat:{keywords:["animal","cats","kiss"],char:"😽",fitzpatrick_scale:!1,category:"people"},scream_cat:{keywords:["animal","cats","munch","scared","scream"],char:"🙀",fitzpatrick_scale:!1,category:"people"},crying_cat_face:{keywords:["animal","tears","weep","sad","cats","upset","cry"],char:"😿",fitzpatrick_scale:!1,category:"people"},pouting_cat:{keywords:["animal","cats"],char:"😾",fitzpatrick_scale:!1,category:"people"},palms_up:{keywords:["hands","gesture","cupped","prayer"],char:"🤲",fitzpatrick_scale:!0,category:"people"},raised_hands:{keywords:["gesture","hooray","yea","celebration","hands"],char:"🙌",fitzpatrick_scale:!0,category:"people"},clap:{keywords:["hands","praise","applause","congrats","yay"],char:"👏",fitzpatrick_scale:!0,category:"people"},wave:{keywords:["hands","gesture","goodbye","solong","farewell","hello","hi","palm"],char:"👋",fitzpatrick_scale:!0,category:"people"},call_me_hand:{keywords:["hands","gesture"],char:"🤙",fitzpatrick_scale:!0,category:"people"},"+1":{keywords:["thumbsup","yes","awesome","good","agree","accept","cool","hand","like"],char:"👍",fitzpatrick_scale:!0,category:"people"},"-1":{keywords:["thumbsdown","no","dislike","hand"],char:"👎",fitzpatrick_scale:!0,category:"people"},facepunch:{keywords:["angry","violence","fist","hit","attack","hand"],char:"👊",fitzpatrick_scale:!0,category:"people"},fist:{keywords:["fingers","hand","grasp"],char:"✊",fitzpatrick_scale:!0,category:"people"},fist_left:{keywords:["hand","fistbump"],char:"🤛",fitzpatrick_scale:!0,category:"people"},fist_right:{keywords:["hand","fistbump"],char:"🤜",fitzpatrick_scale:!0,category:"people"},v:{keywords:["fingers","ohyeah","hand","peace","victory","two"],char:"✌",fitzpatrick_scale:!0,category:"people"},ok_hand:{keywords:["fingers","limbs","perfect","ok","okay"],char:"👌",fitzpatrick_scale:!0,category:"people"},raised_hand:{keywords:["fingers","stop","highfive","palm","ban"],char:"✋",fitzpatrick_scale:!0,category:"people"},raised_back_of_hand:{keywords:["fingers","raised","backhand"],char:"🤚",fitzpatrick_scale:!0,category:"people"},open_hands:{keywords:["fingers","butterfly","hands","open"],char:"👐",fitzpatrick_scale:!0,category:"people"},muscle:{keywords:["arm","flex","hand","summer","strong","biceps"],char:"💪",fitzpatrick_scale:!0,category:"people"},pray:{keywords:["please","hope","wish","namaste","highfive"],char:"🙏",fitzpatrick_scale:!0,category:"people"},foot:{keywords:["kick","stomp"],char:"🦶",fitzpatrick_scale:!0,category:"people"},leg:{keywords:["kick","limb"],char:"🦵",fitzpatrick_scale:!0,category:"people"},handshake:{keywords:["agreement","shake"],char:"🤝",fitzpatrick_scale:!1,category:"people"},point_up:{keywords:["hand","fingers","direction","up"],char:"☝",fitzpatrick_scale:!0,category:"people"},point_up_2:{keywords:["fingers","hand","direction","up"],char:"👆",fitzpatrick_scale:!0,category:"people"},point_down:{keywords:["fingers","hand","direction","down"],char:"👇",fitzpatrick_scale:!0,category:"people"},point_left:{keywords:["direction","fingers","hand","left"],char:"👈",fitzpatrick_scale:!0,category:"people"},point_right:{keywords:["fingers","hand","direction","right"],char:"👉",fitzpatrick_scale:!0,category:"people"},fu:{keywords:["hand","fingers","rude","middle","flipping"],char:"🖕",fitzpatrick_scale:!0,category:"people"},raised_hand_with_fingers_splayed:{keywords:["hand","fingers","palm"],char:"🖐",fitzpatrick_scale:!0,category:"people"},love_you:{keywords:["hand","fingers","gesture"],char:"🤟",fitzpatrick_scale:!0,category:"people"},metal:{keywords:["hand","fingers","evil_eye","sign_of_horns","rock_on"],char:"🤘",fitzpatrick_scale:!0,category:"people"},crossed_fingers:{keywords:["good","lucky"],char:"🤞",fitzpatrick_scale:!0,category:"people"},vulcan_salute:{keywords:["hand","fingers","spock","star trek"],char:"🖖",fitzpatrick_scale:!0,category:"people"},writing_hand:{keywords:["lower_left_ballpoint_pen","stationery","write","compose"],char:"✍",fitzpatrick_scale:!0,category:"people"},selfie:{keywords:["camera","phone"],char:"🤳",fitzpatrick_scale:!0,category:"people"},nail_care:{keywords:["beauty","manicure","finger","fashion","nail"],char:"💅",fitzpatrick_scale:!0,category:"people"},lips:{keywords:["mouth","kiss"],char:"👄",fitzpatrick_scale:!1,category:"people"},tooth:{keywords:["teeth","dentist"],char:"🦷",fitzpatrick_scale:!1,category:"people"},tongue:{keywords:["mouth","playful"],char:"👅",fitzpatrick_scale:!1,category:"people"},ear:{keywords:["face","hear","sound","listen"],char:"👂",fitzpatrick_scale:!0,category:"people"},nose:{keywords:["smell","sniff"],char:"👃",fitzpatrick_scale:!0,category:"people"},eye:{keywords:["face","look","see","watch","stare"],char:"👁",fitzpatrick_scale:!1,category:"people"},eyes:{keywords:["look","watch","stalk","peek","see"],char:"👀",fitzpatrick_scale:!1,category:"people"},brain:{keywords:["smart","intelligent"],char:"🧠",fitzpatrick_scale:!1,category:"people"},bust_in_silhouette:{keywords:["user","person","human"],char:"👤",fitzpatrick_scale:!1,category:"people"},busts_in_silhouette:{keywords:["user","person","human","group","team"],char:"👥",fitzpatrick_scale:!1,category:"people"},speaking_head:{keywords:["user","person","human","sing","say","talk"],char:"🗣",fitzpatrick_scale:!1,category:"people"},baby:{keywords:["child","boy","girl","toddler"],char:"👶",fitzpatrick_scale:!0,category:"people"},child:{keywords:["gender-neutral","young"],char:"🧒",fitzpatrick_scale:!0,category:"people"},boy:{keywords:["man","male","guy","teenager"],char:"👦",fitzpatrick_scale:!0,category:"people"},girl:{keywords:["female","woman","teenager"],char:"👧",fitzpatrick_scale:!0,category:"people"},adult:{keywords:["gender-neutral","person"],char:"🧑",fitzpatrick_scale:!0,category:"people"},man:{keywords:["mustache","father","dad","guy","classy","sir","moustache"],char:"👨",fitzpatrick_scale:!0,category:"people"},woman:{keywords:["female","girls","lady"],char:"👩",fitzpatrick_scale:!0,category:"people"},blonde_woman:{keywords:["woman","female","girl","blonde","person"],char:"👱♀️",fitzpatrick_scale:!0,category:"people"},blonde_man:{keywords:["man","male","boy","blonde","guy","person"],char:"👱",fitzpatrick_scale:!0,category:"people"},bearded_person:{keywords:["person","bewhiskered"],char:"🧔",fitzpatrick_scale:!0,category:"people"},older_adult:{keywords:["human","elder","senior","gender-neutral"],char:"🧓",fitzpatrick_scale:!0,category:"people"},older_man:{keywords:["human","male","men","old","elder","senior"],char:"👴",fitzpatrick_scale:!0,category:"people"},older_woman:{keywords:["human","female","women","lady","old","elder","senior"],char:"👵",fitzpatrick_scale:!0,category:"people"},man_with_gua_pi_mao:{keywords:["male","boy","chinese"],char:"👲",fitzpatrick_scale:!0,category:"people"},woman_with_headscarf:{keywords:["female","hijab","mantilla","tichel"],char:"🧕",fitzpatrick_scale:!0,category:"people"},woman_with_turban:{keywords:["female","indian","hinduism","arabs","woman"],char:"👳♀️",fitzpatrick_scale:!0,category:"people"},man_with_turban:{keywords:["male","indian","hinduism","arabs"],char:"👳",fitzpatrick_scale:!0,category:"people"},policewoman:{keywords:["woman","police","law","legal","enforcement","arrest","911","female"],char:"👮♀️",fitzpatrick_scale:!0,category:"people"},policeman:{keywords:["man","police","law","legal","enforcement","arrest","911"],char:"👮",fitzpatrick_scale:!0,category:"people"},construction_worker_woman:{keywords:["female","human","wip","build","construction","worker","labor","woman"],char:"👷♀️",fitzpatrick_scale:!0,category:"people"},construction_worker_man:{keywords:["male","human","wip","guy","build","construction","worker","labor"],char:"👷",fitzpatrick_scale:!0,category:"people"},guardswoman:{keywords:["uk","gb","british","female","royal","woman"],char:"💂♀️",fitzpatrick_scale:!0,category:"people"},guardsman:{keywords:["uk","gb","british","male","guy","royal"],char:"💂",fitzpatrick_scale:!0,category:"people"},female_detective:{keywords:["human","spy","detective","female","woman"],char:"🕵️♀️",fitzpatrick_scale:!0,category:"people"},male_detective:{keywords:["human","spy","detective"],char:"🕵",fitzpatrick_scale:!0,category:"people"},woman_health_worker:{keywords:["doctor","nurse","therapist","healthcare","woman","human"],char:"👩⚕️",fitzpatrick_scale:!0,category:"people"},man_health_worker:{keywords:["doctor","nurse","therapist","healthcare","man","human"],char:"👨⚕️",fitzpatrick_scale:!0,category:"people"},woman_farmer:{keywords:["rancher","gardener","woman","human"],char:"👩🌾",fitzpatrick_scale:!0,category:"people"},man_farmer:{keywords:["rancher","gardener","man","human"],char:"👨🌾",fitzpatrick_scale:!0,category:"people"},woman_cook:{keywords:["chef","woman","human"],char:"👩🍳",fitzpatrick_scale:!0,category:"people"},man_cook:{keywords:["chef","man","human"],char:"👨🍳",fitzpatrick_scale:!0,category:"people"},woman_student:{keywords:["graduate","woman","human"],char:"👩🎓",fitzpatrick_scale:!0,category:"people"},man_student:{keywords:["graduate","man","human"],char:"👨🎓",fitzpatrick_scale:!0,category:"people"},woman_singer:{keywords:["rockstar","entertainer","woman","human"],char:"👩🎤",fitzpatrick_scale:!0,category:"people"},man_singer:{keywords:["rockstar","entertainer","man","human"],char:"👨🎤",fitzpatrick_scale:!0,category:"people"},woman_teacher:{keywords:["instructor","professor","woman","human"],char:"👩🏫",fitzpatrick_scale:!0,category:"people"},man_teacher:{keywords:["instructor","professor","man","human"],char:"👨🏫",fitzpatrick_scale:!0,category:"people"},woman_factory_worker:{keywords:["assembly","industrial","woman","human"],char:"👩🏭",fitzpatrick_scale:!0,category:"people"},man_factory_worker:{keywords:["assembly","industrial","man","human"],char:"👨🏭",fitzpatrick_scale:!0,category:"people"},woman_technologist:{keywords:["coder","developer","engineer","programmer","software","woman","human","laptop","computer"],char:"👩💻",fitzpatrick_scale:!0,category:"people"},man_technologist:{keywords:["coder","developer","engineer","programmer","software","man","human","laptop","computer"],char:"👨💻",fitzpatrick_scale:!0,category:"people"},woman_office_worker:{keywords:["business","manager","woman","human"],char:"👩💼",fitzpatrick_scale:!0,category:"people"},man_office_worker:{keywords:["business","manager","man","human"],char:"👨💼",fitzpatrick_scale:!0,category:"people"},woman_mechanic:{keywords:["plumber","woman","human","wrench"],char:"👩🔧",fitzpatrick_scale:!0,category:"people"},man_mechanic:{keywords:["plumber","man","human","wrench"],char:"👨🔧",fitzpatrick_scale:!0,category:"people"},woman_scientist:{keywords:["biologist","chemist","engineer","physicist","woman","human"],char:"👩🔬",fitzpatrick_scale:!0,category:"people"},man_scientist:{keywords:["biologist","chemist","engineer","physicist","man","human"],char:"👨🔬",fitzpatrick_scale:!0,category:"people"},woman_artist:{keywords:["painter","woman","human"],char:"👩🎨",fitzpatrick_scale:!0,category:"people"},man_artist:{keywords:["painter","man","human"],char:"👨🎨",fitzpatrick_scale:!0,category:"people"},woman_firefighter:{keywords:["fireman","woman","human"],char:"👩🚒",fitzpatrick_scale:!0,category:"people"},man_firefighter:{keywords:["fireman","man","human"],char:"👨🚒",fitzpatrick_scale:!0,category:"people"},woman_pilot:{keywords:["aviator","plane","woman","human"],char:"👩✈️",fitzpatrick_scale:!0,category:"people"},man_pilot:{keywords:["aviator","plane","man","human"],char:"👨✈️",fitzpatrick_scale:!0,category:"people"},woman_astronaut:{keywords:["space","rocket","woman","human"],char:"👩🚀",fitzpatrick_scale:!0,category:"people"},man_astronaut:{keywords:["space","rocket","man","human"],char:"👨🚀",fitzpatrick_scale:!0,category:"people"},woman_judge:{keywords:["justice","court","woman","human"],char:"👩⚖️",fitzpatrick_scale:!0,category:"people"},man_judge:{keywords:["justice","court","man","human"],char:"👨⚖️",fitzpatrick_scale:!0,category:"people"},woman_superhero:{keywords:["woman","female","good","heroine","superpowers"],char:"🦸♀️",fitzpatrick_scale:!0,category:"people"},man_superhero:{keywords:["man","male","good","hero","superpowers"],char:"🦸♂️",fitzpatrick_scale:!0,category:"people"},woman_supervillain:{keywords:["woman","female","evil","bad","criminal","heroine","superpowers"],char:"🦹♀️",fitzpatrick_scale:!0,category:"people"},man_supervillain:{keywords:["man","male","evil","bad","criminal","hero","superpowers"],char:"🦹♂️",fitzpatrick_scale:!0,category:"people"},mrs_claus:{keywords:["woman","female","xmas","mother christmas"],char:"🤶",fitzpatrick_scale:!0,category:"people"},santa:{keywords:["festival","man","male","xmas","father christmas"],char:"🎅",fitzpatrick_scale:!0,category:"people"},sorceress:{keywords:["woman","female","mage","witch"],char:"🧙♀️",fitzpatrick_scale:!0,category:"people"},wizard:{keywords:["man","male","mage","sorcerer"],char:"🧙♂️",fitzpatrick_scale:!0,category:"people"},woman_elf:{keywords:["woman","female"],char:"🧝♀️",fitzpatrick_scale:!0,category:"people"},man_elf:{keywords:["man","male"],char:"🧝♂️",fitzpatrick_scale:!0,category:"people"},woman_vampire:{keywords:["woman","female"],char:"🧛♀️",fitzpatrick_scale:!0,category:"people"},man_vampire:{keywords:["man","male","dracula"],char:"🧛♂️",fitzpatrick_scale:!0,category:"people"},woman_zombie:{keywords:["woman","female","undead","walking dead"],char:"🧟♀️",fitzpatrick_scale:!1,category:"people"},man_zombie:{keywords:["man","male","dracula","undead","walking dead"],char:"🧟♂️",fitzpatrick_scale:!1,category:"people"},woman_genie:{keywords:["woman","female"],char:"🧞♀️",fitzpatrick_scale:!1,category:"people"},man_genie:{keywords:["man","male"],char:"🧞♂️",fitzpatrick_scale:!1,category:"people"},mermaid:{keywords:["woman","female","merwoman","ariel"],char:"🧜♀️",fitzpatrick_scale:!0,category:"people"},merman:{keywords:["man","male","triton"],char:"🧜♂️",fitzpatrick_scale:!0,category:"people"},woman_fairy:{keywords:["woman","female"],char:"🧚♀️",fitzpatrick_scale:!0,category:"people"},man_fairy:{keywords:["man","male"],char:"🧚♂️",fitzpatrick_scale:!0,category:"people"},angel:{keywords:["heaven","wings","halo"],char:"👼",fitzpatrick_scale:!0,category:"people"},pregnant_woman:{keywords:["baby"],char:"🤰",fitzpatrick_scale:!0,category:"people"},breastfeeding:{keywords:["nursing","baby"],char:"🤱",fitzpatrick_scale:!0,category:"people"},princess:{keywords:["girl","woman","female","blond","crown","royal","queen"],char:"👸",fitzpatrick_scale:!0,category:"people"},prince:{keywords:["boy","man","male","crown","royal","king"],char:"🤴",fitzpatrick_scale:!0,category:"people"},bride_with_veil:{keywords:["couple","marriage","wedding","woman","bride"],char:"👰",fitzpatrick_scale:!0,category:"people"},man_in_tuxedo:{keywords:["couple","marriage","wedding","groom"],char:"🤵",fitzpatrick_scale:!0,category:"people"},running_woman:{keywords:["woman","walking","exercise","race","running","female"],char:"🏃♀️",fitzpatrick_scale:!0,category:"people"},running_man:{keywords:["man","walking","exercise","race","running"],char:"🏃",fitzpatrick_scale:!0,category:"people"},walking_woman:{keywords:["human","feet","steps","woman","female"],char:"🚶♀️",fitzpatrick_scale:!0,category:"people"},walking_man:{keywords:["human","feet","steps"],char:"🚶",fitzpatrick_scale:!0,category:"people"},dancer:{keywords:["female","girl","woman","fun"],char:"💃",fitzpatrick_scale:!0,category:"people"},man_dancing:{keywords:["male","boy","fun","dancer"],char:"🕺",fitzpatrick_scale:!0,category:"people"},dancing_women:{keywords:["female","bunny","women","girls"],char:"👯",fitzpatrick_scale:!1,category:"people"},dancing_men:{keywords:["male","bunny","men","boys"],char:"👯♂️",fitzpatrick_scale:!1,category:"people"},couple:{keywords:["pair","people","human","love","date","dating","like","affection","valentines","marriage"],char:"👫",fitzpatrick_scale:!1,category:"people"},two_men_holding_hands:{keywords:["pair","couple","love","like","bromance","friendship","people","human"],char:"👬",fitzpatrick_scale:!1,category:"people"},two_women_holding_hands:{keywords:["pair","friendship","couple","love","like","female","people","human"],char:"👭",fitzpatrick_scale:!1,category:"people"},bowing_woman:{keywords:["woman","female","girl"],char:"🙇♀️",fitzpatrick_scale:!0,category:"people"},bowing_man:{keywords:["man","male","boy"],char:"🙇",fitzpatrick_scale:!0,category:"people"},man_facepalming:{keywords:["man","male","boy","disbelief"],char:"🤦♂️",fitzpatrick_scale:!0,category:"people"},woman_facepalming:{keywords:["woman","female","girl","disbelief"],char:"🤦♀️",fitzpatrick_scale:!0,category:"people"},woman_shrugging:{keywords:["woman","female","girl","confused","indifferent","doubt"],char:"🤷",fitzpatrick_scale:!0,category:"people"},man_shrugging:{keywords:["man","male","boy","confused","indifferent","doubt"],char:"🤷♂️",fitzpatrick_scale:!0,category:"people"},tipping_hand_woman:{keywords:["female","girl","woman","human","information"],char:"💁",fitzpatrick_scale:!0,category:"people"},tipping_hand_man:{keywords:["male","boy","man","human","information"],char:"💁♂️",fitzpatrick_scale:!0,category:"people"},no_good_woman:{keywords:["female","girl","woman","nope"],char:"🙅",fitzpatrick_scale:!0,category:"people"},no_good_man:{keywords:["male","boy","man","nope"],char:"🙅♂️",fitzpatrick_scale:!0,category:"people"},ok_woman:{keywords:["women","girl","female","pink","human","woman"],char:"🙆",fitzpatrick_scale:!0,category:"people"},ok_man:{keywords:["men","boy","male","blue","human","man"],char:"🙆♂️",fitzpatrick_scale:!0,category:"people"},raising_hand_woman:{keywords:["female","girl","woman"],char:"🙋",fitzpatrick_scale:!0,category:"people"},raising_hand_man:{keywords:["male","boy","man"],char:"🙋♂️",fitzpatrick_scale:!0,category:"people"},pouting_woman:{keywords:["female","girl","woman"],char:"🙎",fitzpatrick_scale:!0,category:"people"},pouting_man:{keywords:["male","boy","man"],char:"🙎♂️",fitzpatrick_scale:!0,category:"people"},frowning_woman:{keywords:["female","girl","woman","sad","depressed","discouraged","unhappy"],char:"🙍",fitzpatrick_scale:!0,category:"people"},frowning_man:{keywords:["male","boy","man","sad","depressed","discouraged","unhappy"],char:"🙍♂️",fitzpatrick_scale:!0,category:"people"},haircut_woman:{keywords:["female","girl","woman"],char:"💇",fitzpatrick_scale:!0,category:"people"},haircut_man:{keywords:["male","boy","man"],char:"💇♂️",fitzpatrick_scale:!0,category:"people"},massage_woman:{keywords:["female","girl","woman","head"],char:"💆",fitzpatrick_scale:!0,category:"people"},massage_man:{keywords:["male","boy","man","head"],char:"💆♂️",fitzpatrick_scale:!0,category:"people"},woman_in_steamy_room:{keywords:["female","woman","spa","steamroom","sauna"],char:"🧖♀️",fitzpatrick_scale:!0,category:"people"},man_in_steamy_room:{keywords:["male","man","spa","steamroom","sauna"],char:"🧖♂️",fitzpatrick_scale:!0,category:"people"},couple_with_heart_woman_man:{keywords:["pair","love","like","affection","human","dating","valentines","marriage"],char:"💑",fitzpatrick_scale:!1,category:"people"},couple_with_heart_woman_woman:{keywords:["pair","love","like","affection","human","dating","valentines","marriage"],char:"👩❤️👩",fitzpatrick_scale:!1,category:"people"},couple_with_heart_man_man:{keywords:["pair","love","like","affection","human","dating","valentines","marriage"],char:"👨❤️👨",fitzpatrick_scale:!1,category:"people"},couplekiss_man_woman:{keywords:["pair","valentines","love","like","dating","marriage"],char:"💏",fitzpatrick_scale:!1,category:"people"},couplekiss_woman_woman:{keywords:["pair","valentines","love","like","dating","marriage"],char:"👩❤️💋👩",fitzpatrick_scale:!1,category:"people"},couplekiss_man_man:{keywords:["pair","valentines","love","like","dating","marriage"],char:"👨❤️💋👨",fitzpatrick_scale:!1,category:"people"},family_man_woman_boy:{keywords:["home","parents","child","mom","dad","father","mother","people","human"],char:"👪",fitzpatrick_scale:!1,category:"people"},family_man_woman_girl:{keywords:["home","parents","people","human","child"],char:"👨👩👧",fitzpatrick_scale:!1,category:"people"},family_man_woman_girl_boy:{keywords:["home","parents","people","human","children"],char:"👨👩👧👦",fitzpatrick_scale:!1,category:"people"},family_man_woman_boy_boy:{keywords:["home","parents","people","human","children"],char:"👨👩👦👦",fitzpatrick_scale:!1,category:"people"},family_man_woman_girl_girl:{keywords:["home","parents","people","human","children"],char:"👨👩👧👧",fitzpatrick_scale:!1,category:"people"},family_woman_woman_boy:{keywords:["home","parents","people","human","children"],char:"👩👩👦",fitzpatrick_scale:!1,category:"people"},family_woman_woman_girl:{keywords:["home","parents","people","human","children"],char:"👩👩👧",fitzpatrick_scale:!1,category:"people"},family_woman_woman_girl_boy:{keywords:["home","parents","people","human","children"],char:"👩👩👧👦",fitzpatrick_scale:!1,category:"people"},family_woman_woman_boy_boy:{keywords:["home","parents","people","human","children"],char:"👩👩👦👦",fitzpatrick_scale:!1,category:"people"},family_woman_woman_girl_girl:{keywords:["home","parents","people","human","children"],char:"👩👩👧👧",fitzpatrick_scale:!1,category:"people"},family_man_man_boy:{keywords:["home","parents","people","human","children"],char:"👨👨👦",fitzpatrick_scale:!1,category:"people"},family_man_man_girl:{keywords:["home","parents","people","human","children"],char:"👨👨👧",fitzpatrick_scale:!1,category:"people"},family_man_man_girl_boy:{keywords:["home","parents","people","human","children"],char:"👨👨👧👦",fitzpatrick_scale:!1,category:"people"},family_man_man_boy_boy:{keywords:["home","parents","people","human","children"],char:"👨👨👦👦",fitzpatrick_scale:!1,category:"people"},family_man_man_girl_girl:{keywords:["home","parents","people","human","children"],char:"👨👨👧👧",fitzpatrick_scale:!1,category:"people"},family_woman_boy:{keywords:["home","parent","people","human","child"],char:"👩👦",fitzpatrick_scale:!1,category:"people"},family_woman_girl:{keywords:["home","parent","people","human","child"],char:"👩👧",fitzpatrick_scale:!1,category:"people"},family_woman_girl_boy:{keywords:["home","parent","people","human","children"],char:"👩👧👦",fitzpatrick_scale:!1,category:"people"},family_woman_boy_boy:{keywords:["home","parent","people","human","children"],char:"👩👦👦",fitzpatrick_scale:!1,category:"people"},family_woman_girl_girl:{keywords:["home","parent","people","human","children"],char:"👩👧👧",fitzpatrick_scale:!1,category:"people"},family_man_boy:{keywords:["home","parent","people","human","child"],char:"👨👦",fitzpatrick_scale:!1,category:"people"},family_man_girl:{keywords:["home","parent","people","human","child"],char:"👨👧",fitzpatrick_scale:!1,category:"people"},family_man_girl_boy:{keywords:["home","parent","people","human","children"],char:"👨👧👦",fitzpatrick_scale:!1,category:"people"},family_man_boy_boy:{keywords:["home","parent","people","human","children"],char:"👨👦👦",fitzpatrick_scale:!1,category:"people"},family_man_girl_girl:{keywords:["home","parent","people","human","children"],char:"👨👧👧",fitzpatrick_scale:!1,category:"people"},yarn:{keywords:["ball","crochet","knit"],char:"🧶",fitzpatrick_scale:!1,category:"people"},thread:{keywords:["needle","sewing","spool","string"],char:"🧵",fitzpatrick_scale:!1,category:"people"},coat:{keywords:["jacket"],char:"🧥",fitzpatrick_scale:!1,category:"people"},labcoat:{keywords:["doctor","experiment","scientist","chemist"],char:"🥼",fitzpatrick_scale:!1,category:"people"},womans_clothes:{keywords:["fashion","shopping_bags","female"],char:"👚",fitzpatrick_scale:!1,category:"people"},tshirt:{keywords:["fashion","cloth","casual","shirt","tee"],char:"👕",fitzpatrick_scale:!1,category:"people"},jeans:{keywords:["fashion","shopping"],char:"👖",fitzpatrick_scale:!1,category:"people"},necktie:{keywords:["shirt","suitup","formal","fashion","cloth","business"],char:"👔",fitzpatrick_scale:!1,category:"people"},dress:{keywords:["clothes","fashion","shopping"],char:"👗",fitzpatrick_scale:!1,category:"people"},bikini:{keywords:["swimming","female","woman","girl","fashion","beach","summer"],char:"👙",fitzpatrick_scale:!1,category:"people"},kimono:{keywords:["dress","fashion","women","female","japanese"],char:"👘",fitzpatrick_scale:!1,category:"people"},lipstick:{keywords:["female","girl","fashion","woman"],char:"💄",fitzpatrick_scale:!1,category:"people"},kiss:{keywords:["face","lips","love","like","affection","valentines"],char:"💋",fitzpatrick_scale:!1,category:"people"},footprints:{keywords:["feet","tracking","walking","beach"],char:"👣",fitzpatrick_scale:!1,category:"people"},flat_shoe:{keywords:["ballet","slip-on","slipper"],char:"🥿",fitzpatrick_scale:!1,category:"people"},high_heel:{keywords:["fashion","shoes","female","pumps","stiletto"],char:"👠",fitzpatrick_scale:!1,category:"people"},sandal:{keywords:["shoes","fashion","flip flops"],char:"👡",fitzpatrick_scale:!1,category:"people"},boot:{keywords:["shoes","fashion"],char:"👢",fitzpatrick_scale:!1,category:"people"},mans_shoe:{keywords:["fashion","male"],char:"👞",fitzpatrick_scale:!1,category:"people"},athletic_shoe:{keywords:["shoes","sports","sneakers"],char:"👟",fitzpatrick_scale:!1,category:"people"},hiking_boot:{keywords:["backpacking","camping","hiking"],char:"🥾",fitzpatrick_scale:!1,category:"people"},socks:{keywords:["stockings","clothes"],char:"🧦",fitzpatrick_scale:!1,category:"people"},gloves:{keywords:["hands","winter","clothes"],char:"🧤",fitzpatrick_scale:!1,category:"people"},scarf:{keywords:["neck","winter","clothes"],char:"🧣",fitzpatrick_scale:!1,category:"people"},womans_hat:{keywords:["fashion","accessories","female","lady","spring"],char:"👒",fitzpatrick_scale:!1,category:"people"},tophat:{keywords:["magic","gentleman","classy","circus"],char:"🎩",fitzpatrick_scale:!1,category:"people"},billed_hat:{keywords:["cap","baseball"],char:"🧢",fitzpatrick_scale:!1,category:"people"},rescue_worker_helmet:{keywords:["construction","build"],char:"⛑",fitzpatrick_scale:!1,category:"people"},mortar_board:{keywords:["school","college","degree","university","graduation","cap","hat","legal","learn","education"],char:"🎓",fitzpatrick_scale:!1,category:"people"},crown:{keywords:["king","kod","leader","royalty","lord"],char:"👑",fitzpatrick_scale:!1,category:"people"},school_satchel:{keywords:["student","education","bag","backpack"],char:"🎒",fitzpatrick_scale:!1,category:"people"},luggage:{keywords:["packing","travel"],char:"🧳",fitzpatrick_scale:!1,category:"people"},pouch:{keywords:["bag","accessories","shopping"],char:"👝",fitzpatrick_scale:!1,category:"people"},purse:{keywords:["fashion","accessories","money","sales","shopping"],char:"👛",fitzpatrick_scale:!1,category:"people"},handbag:{keywords:["fashion","accessory","accessories","shopping"],char:"👜",fitzpatrick_scale:!1,category:"people"},briefcase:{keywords:["business","documents","work","law","legal","job","career"],char:"💼",fitzpatrick_scale:!1,category:"people"},eyeglasses:{keywords:["fashion","accessories","eyesight","nerdy","dork","geek"],char:"👓",fitzpatrick_scale:!1,category:"people"},dark_sunglasses:{keywords:["face","cool","accessories"],char:"🕶",fitzpatrick_scale:!1,category:"people"},goggles:{keywords:["eyes","protection","safety"],char:"🥽",fitzpatrick_scale:!1,category:"people"},ring:{keywords:["wedding","propose","marriage","valentines","diamond","fashion","jewelry","gem","engagement"],char:"💍",fitzpatrick_scale:!1,category:"people"},closed_umbrella:{keywords:["weather","rain","drizzle"],char:"🌂",fitzpatrick_scale:!1,category:"people"},dog:{keywords:["animal","friend","nature","woof","puppy","pet","faithful"],char:"🐶",fitzpatrick_scale:!1,category:"animals_and_nature"},cat:{keywords:["animal","meow","nature","pet","kitten"],char:"🐱",fitzpatrick_scale:!1,category:"animals_and_nature"},mouse:{keywords:["animal","nature","cheese_wedge","rodent"],char:"🐭",fitzpatrick_scale:!1,category:"animals_and_nature"},hamster:{keywords:["animal","nature"],char:"🐹",fitzpatrick_scale:!1,category:"animals_and_nature"},rabbit:{keywords:["animal","nature","pet","spring","magic","bunny"],char:"🐰",fitzpatrick_scale:!1,category:"animals_and_nature"},fox_face:{keywords:["animal","nature","face"],char:"🦊",fitzpatrick_scale:!1,category:"animals_and_nature"},bear:{keywords:["animal","nature","wild"],char:"🐻",fitzpatrick_scale:!1,category:"animals_and_nature"},panda_face:{keywords:["animal","nature","panda"],char:"🐼",fitzpatrick_scale:!1,category:"animals_and_nature"},koala:{keywords:["animal","nature"],char:"🐨",fitzpatrick_scale:!1,category:"animals_and_nature"},tiger:{keywords:["animal","cat","danger","wild","nature","roar"],char:"🐯",fitzpatrick_scale:!1,category:"animals_and_nature"},lion:{keywords:["animal","nature"],char:"🦁",fitzpatrick_scale:!1,category:"animals_and_nature"},cow:{keywords:["beef","ox","animal","nature","moo","milk"],char:"🐮",fitzpatrick_scale:!1,category:"animals_and_nature"},pig:{keywords:["animal","oink","nature"],char:"🐷",fitzpatrick_scale:!1,category:"animals_and_nature"},pig_nose:{keywords:["animal","oink"],char:"🐽",fitzpatrick_scale:!1,category:"animals_and_nature"},frog:{keywords:["animal","nature","croak","toad"],char:"🐸",fitzpatrick_scale:!1,category:"animals_and_nature"},squid:{keywords:["animal","nature","ocean","sea"],char:"🦑",fitzpatrick_scale:!1,category:"animals_and_nature"},octopus:{keywords:["animal","creature","ocean","sea","nature","beach"],char:"🐙",fitzpatrick_scale:!1,category:"animals_and_nature"},shrimp:{keywords:["animal","ocean","nature","seafood"],char:"🦐",fitzpatrick_scale:!1,category:"animals_and_nature"},monkey_face:{keywords:["animal","nature","circus"],char:"🐵",fitzpatrick_scale:!1,category:"animals_and_nature"},gorilla:{keywords:["animal","nature","circus"],char:"🦍",fitzpatrick_scale:!1,category:"animals_and_nature"},see_no_evil:{keywords:["monkey","animal","nature","haha"],char:"🙈",fitzpatrick_scale:!1,category:"animals_and_nature"},hear_no_evil:{keywords:["animal","monkey","nature"],char:"🙉",fitzpatrick_scale:!1,category:"animals_and_nature"},speak_no_evil:{keywords:["monkey","animal","nature","omg"],char:"🙊",fitzpatrick_scale:!1,category:"animals_and_nature"},monkey:{keywords:["animal","nature","banana","circus"],char:"🐒",fitzpatrick_scale:!1,category:"animals_and_nature"},chicken:{keywords:["animal","cluck","nature","bird"],char:"🐔",fitzpatrick_scale:!1,category:"animals_and_nature"},penguin:{keywords:["animal","nature"],char:"🐧",fitzpatrick_scale:!1,category:"animals_and_nature"},bird:{keywords:["animal","nature","fly","tweet","spring"],char:"🐦",fitzpatrick_scale:!1,category:"animals_and_nature"},baby_chick:{keywords:["animal","chicken","bird"],char:"🐤",fitzpatrick_scale:!1,category:"animals_and_nature"},hatching_chick:{keywords:["animal","chicken","egg","born","baby","bird"],char:"🐣",fitzpatrick_scale:!1,category:"animals_and_nature"},hatched_chick:{keywords:["animal","chicken","baby","bird"],char:"🐥",fitzpatrick_scale:!1,category:"animals_and_nature"},duck:{keywords:["animal","nature","bird","mallard"],char:"🦆",fitzpatrick_scale:!1,category:"animals_and_nature"},eagle:{keywords:["animal","nature","bird"],char:"🦅",fitzpatrick_scale:!1,category:"animals_and_nature"},owl:{keywords:["animal","nature","bird","hoot"],char:"🦉",fitzpatrick_scale:!1,category:"animals_and_nature"},bat:{keywords:["animal","nature","blind","vampire"],char:"🦇",fitzpatrick_scale:!1,category:"animals_and_nature"},wolf:{keywords:["animal","nature","wild"],char:"🐺",fitzpatrick_scale:!1,category:"animals_and_nature"},boar:{keywords:["animal","nature"],char:"🐗",fitzpatrick_scale:!1,category:"animals_and_nature"},horse:{keywords:["animal","brown","nature"],char:"🐴",fitzpatrick_scale:!1,category:"animals_and_nature"},unicorn:{keywords:["animal","nature","mystical"],char:"🦄",fitzpatrick_scale:!1,category:"animals_and_nature"},honeybee:{keywords:["animal","insect","nature","bug","spring","honey"],char:"🐝",fitzpatrick_scale:!1,category:"animals_and_nature"},bug:{keywords:["animal","insect","nature","worm"],char:"🐛",fitzpatrick_scale:!1,category:"animals_and_nature"},butterfly:{keywords:["animal","insect","nature","caterpillar"],char:"🦋",fitzpatrick_scale:!1,category:"animals_and_nature"},snail:{keywords:["slow","animal","shell"],char:"🐌",fitzpatrick_scale:!1,category:"animals_and_nature"},beetle:{keywords:["animal","insect","nature","ladybug"],char:"🐞",fitzpatrick_scale:!1,category:"animals_and_nature"},ant:{keywords:["animal","insect","nature","bug"],char:"🐜",fitzpatrick_scale:!1,category:"animals_and_nature"},grasshopper:{keywords:["animal","cricket","chirp"],char:"🦗",fitzpatrick_scale:!1,category:"animals_and_nature"},spider:{keywords:["animal","arachnid"],char:"🕷",fitzpatrick_scale:!1,category:"animals_and_nature"},scorpion:{keywords:["animal","arachnid"],char:"🦂",fitzpatrick_scale:!1,category:"animals_and_nature"},crab:{keywords:["animal","crustacean"],char:"🦀",fitzpatrick_scale:!1,category:"animals_and_nature"},snake:{keywords:["animal","evil","nature","hiss","python"],char:"🐍",fitzpatrick_scale:!1,category:"animals_and_nature"},lizard:{keywords:["animal","nature","reptile"],char:"🦎",fitzpatrick_scale:!1,category:"animals_and_nature"},"t-rex":{keywords:["animal","nature","dinosaur","tyrannosaurus","extinct"],char:"🦖",fitzpatrick_scale:!1,category:"animals_and_nature"},sauropod:{keywords:["animal","nature","dinosaur","brachiosaurus","brontosaurus","diplodocus","extinct"],char:"🦕",fitzpatrick_scale:!1,category:"animals_and_nature"},turtle:{keywords:["animal","slow","nature","tortoise"],char:"🐢",fitzpatrick_scale:!1,category:"animals_and_nature"},tropical_fish:{keywords:["animal","swim","ocean","beach","nemo"],char:"🐠",fitzpatrick_scale:!1,category:"animals_and_nature"},fish:{keywords:["animal","food","nature"],char:"🐟",fitzpatrick_scale:!1,category:"animals_and_nature"},blowfish:{keywords:["animal","nature","food","sea","ocean"],char:"🐡",fitzpatrick_scale:!1,category:"animals_and_nature"},dolphin:{keywords:["animal","nature","fish","sea","ocean","flipper","fins","beach"],char:"🐬",fitzpatrick_scale:!1,category:"animals_and_nature"},shark:{keywords:["animal","nature","fish","sea","ocean","jaws","fins","beach"],char:"🦈",fitzpatrick_scale:!1,category:"animals_and_nature"},whale:{keywords:["animal","nature","sea","ocean"],char:"🐳",fitzpatrick_scale:!1,category:"animals_and_nature"},whale2:{keywords:["animal","nature","sea","ocean"],char:"🐋",fitzpatrick_scale:!1,category:"animals_and_nature"},crocodile:{keywords:["animal","nature","reptile","lizard","alligator"],char:"🐊",fitzpatrick_scale:!1,category:"animals_and_nature"},leopard:{keywords:["animal","nature"],char:"🐆",fitzpatrick_scale:!1,category:"animals_and_nature"},zebra:{keywords:["animal","nature","stripes","safari"],char:"🦓",fitzpatrick_scale:!1,category:"animals_and_nature"},tiger2:{keywords:["animal","nature","roar"],char:"🐅",fitzpatrick_scale:!1,category:"animals_and_nature"},water_buffalo:{keywords:["animal","nature","ox","cow"],char:"🐃",fitzpatrick_scale:!1,category:"animals_and_nature"},ox:{keywords:["animal","cow","beef"],char:"🐂",fitzpatrick_scale:!1,category:"animals_and_nature"},cow2:{keywords:["beef","ox","animal","nature","moo","milk"],char:"🐄",fitzpatrick_scale:!1,category:"animals_and_nature"},deer:{keywords:["animal","nature","horns","venison"],char:"🦌",fitzpatrick_scale:!1,category:"animals_and_nature"},dromedary_camel:{keywords:["animal","hot","desert","hump"],char:"🐪",fitzpatrick_scale:!1,category:"animals_and_nature"},camel:{keywords:["animal","nature","hot","desert","hump"],char:"🐫",fitzpatrick_scale:!1,category:"animals_and_nature"},giraffe:{keywords:["animal","nature","spots","safari"],char:"🦒",fitzpatrick_scale:!1,category:"animals_and_nature"},elephant:{keywords:["animal","nature","nose","th","circus"],char:"🐘",fitzpatrick_scale:!1,category:"animals_and_nature"},rhinoceros:{keywords:["animal","nature","horn"],char:"🦏",fitzpatrick_scale:!1,category:"animals_and_nature"},goat:{keywords:["animal","nature"],char:"🐐",fitzpatrick_scale:!1,category:"animals_and_nature"},ram:{keywords:["animal","sheep","nature"],char:"🐏",fitzpatrick_scale:!1,category:"animals_and_nature"},sheep:{keywords:["animal","nature","wool","shipit"],char:"🐑",fitzpatrick_scale:!1,category:"animals_and_nature"},racehorse:{keywords:["animal","gamble","luck"],char:"🐎",fitzpatrick_scale:!1,category:"animals_and_nature"},pig2:{keywords:["animal","nature"],char:"🐖",fitzpatrick_scale:!1,category:"animals_and_nature"},rat:{keywords:["animal","mouse","rodent"],char:"🐀",fitzpatrick_scale:!1,category:"animals_and_nature"},mouse2:{keywords:["animal","nature","rodent"],char:"🐁",fitzpatrick_scale:!1,category:"animals_and_nature"},rooster:{keywords:["animal","nature","chicken"],char:"🐓",fitzpatrick_scale:!1,category:"animals_and_nature"},turkey:{keywords:["animal","bird"],char:"🦃",fitzpatrick_scale:!1,category:"animals_and_nature"},dove:{keywords:["animal","bird"],char:"🕊",fitzpatrick_scale:!1,category:"animals_and_nature"},dog2:{keywords:["animal","nature","friend","doge","pet","faithful"],char:"🐕",fitzpatrick_scale:!1,category:"animals_and_nature"},poodle:{keywords:["dog","animal","101","nature","pet"],char:"🐩",fitzpatrick_scale:!1,category:"animals_and_nature"},cat2:{keywords:["animal","meow","pet","cats"],char:"🐈",fitzpatrick_scale:!1,category:"animals_and_nature"},rabbit2:{keywords:["animal","nature","pet","magic","]===])
|
return {
mod_description = {
en = "V2RT description",
},
}
|
--[[
© CloudSixteen.com do not share, re-distribute or modify
without permission of its author ([email protected]).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
-- Translated by karl-police
CW_GERMAN = Clockwork.lang:GetTable("German");
CW_GERMAN["CannotChangeClassFor"] = "Du kannst die Klasse für #1 Sekunde(n) nicht wechseln!";
CW_GERMAN["CannotActionRightNow"] = "Du kannst diese Handlung, in diesem Moment, nicht machen!";
CW_GERMAN["DroppedItemsOtherChar"] = "Du kannst keine Gegenstände aufnehmen, die du von einem anderen Charakter gefallen hast!";
CW_GERMAN["DroppedCashOtherChar"] = "Du kannst nicht #1 aufnehmen, dass du von einem anderen Charakter gefallen hast!";
CW_GERMAN["CannotPurchaseAnotherDoor"] = "Du kannst nicht eine andere Türe kaufen!";
CW_GERMAN["EntityOptionWaitTime"] = "You cannot use another entity that fast!";
CW_GERMAN["CannotDropWeaponFar"] = "You cannot drop your weapon that far away!";
CW_GERMAN["CannotDropNameFar"] = "Du kannst #1 nicht so weit weg fallen lassen!";
CW_GERMAN["CannotDropItemFar"] = "Du kannst diesen Gegenstand nicht so weit weg fallen lassen!";
CW_GERMAN["CannotUseItemInVehicle"] = "Du kannst diesen Gegenstand nicht in einem Fahrzeug benutzen!";
CW_GERMAN["YouNeedAnother"] = "Du braucht ein anderer #1!";
CW_GERMAN["NotEnoughText"] = "Du hast nicht genug Text angegeben!";
CW_GERMAN["ConfigVariablesPrinted"] = "Die Konfigurationsvariablen wurden gerade bei der Konsole gedruckt..";
CW_GERMAN["PlayerForceDemoted"] = "#1 hat #2 eine Degradierung zu Rang '#3' erzwungen.";
CW_GERMAN["PlayerDemotedPlayer"] = "#1 hat #2 zu Rang '#3' degradiert.";
CW_GERMAN["PlayerDemotedUserToGroup"] = "#1 hat #2 von #3 zu #4 degradiert.";
CW_GERMAN["DemotePermsNeeded"] = "Du hast keine Rechte um diesen Spieler zu degradieren.";
CW_GERMAN["DemoteFactionOnly"] = "Du kannst nur jemand degradieren der innerhalb deiner eigener Faktion ist!";
CW_GERMAN["YouCannotDemotePlayer"] = "Du kannst diesen Spieler nicht degradieren!";
CW_GERMAN["ForceDemoteAdminNeeded"] = "Du musst ein Admin oder Superadmin sein, um eine Degradierung zu erzwingen!";
CW_GERMAN["PlayerUnbannedPlayer"] = "#1 hat #2 nicht mehr verbannt.";
CW_GERMAN["PlayerSetConfigRestart"] = "#1 stellte #2 auf '#3' für den nächsten Neustart.";
CW_GERMAN["PlayerSetConfig"] = "#1 stellte #2 auf '#3'.";
CW_GERMAN["PlayerForcePromoted"] = "#1 hat #2 eine Beförderung zu Rang '#3' erzwungen.";
CW_GERMAN["PlayerPromotedPlayer"] = "#1 hat #2 zu Rang '#3' befördert.";
CW_GERMAN["PromotePermsNeeded"] = "Du hast keine Rechte um diesen Spieler zu befördern.";
CW_GERMAN["PromoteFactionOnly"] = "Du kannst nur jemand befördern der innerhalb deiner eigener Faktion ist!";
CW_GERMAN["YouCannotPromotePlayer"] = "Du kannst diesen Spieler nicht befördern!";
CW_GERMAN["ForcePromoteAdminNeeded"] = "Du musst ein Admin oder Superadmin sein, um eine Beförderung zu erzwingen!";
CW_GERMAN["PlayerRemovedFromWhitelist"] = "#1 hat #2 von der #3 Whitelist entfernt.";
CW_GERMAN["PlayerAddedToWhitelist"] = "#1 hat #2 zu der #3 Whitelist hinzugefügt.";
CW_GERMAN["PlayerAlreadyOnWhitelist"] = "#1 ist schon auf der #2 Whitelist!";
CW_GERMAN["FactionDoesNotHaveWhitelist"] = "#1 hat keine Whitelist!";
CW_GERMAN["PlayerNotOnWhitelist"] = "#1 ist nicth auf der #2 Whitelist!";
CW_GERMAN["FactionIsNotValid"] = "#1 ist kein gültiger Faktion!";
CW_GERMAN["IdentifierIsNotValid"] = "#1 ist keine gültige Bezeichnung!";
CW_GERMAN["DurationNotValid"] = "#1 ist keine gültige Dauer!";
CW_GERMAN["ItemIsNotValid"] = "#1 ist kein gültiger Gegenstand!";
CW_GERMAN["PlayerConfigSetNextRestart"] = "#1 stellte #2#3 auf '#4' für den nächsten Neustart.";
CW_GERMAN["PlayerConfigSet"] = "#1 stellte #2#3 auf '#4'.";
CW_GERMAN["PlayerBannedPlayer"] = "#1 hat den Charakter '#2' verbannt.";
CW_GERMAN["PlayerHasFlags"] = "Dieser Spieler hat #1 Flaggen.";
CW_GERMAN["NotValidMap"] = "#1 ist keine gültige KArte!";
CW_GERMAN["CannotHolsterWeapon"] = "Du kannst die Waffe nicht ins Holster stecken!";
CW_GERMAN["CannotDropWeapon"] = "Du kannst diese Waffe nicht fallen lassen!";
CW_GERMAN["CannotUseWeapon"] = "Du kannst diese Waffe nicht benutzen!";
CW_GERMAN["ConfigUnableToSet"] = "#1 war nicht imstande festgelegt zu werden!";
CW_GERMAN["ConfigIsStaticKey"] = "#1 ist eine statische Konfigschlüssel!";
CW_GERMAN["ConfigKeyNotValid"] = "#1 ist kein gültiger Konfigschlüssel!";
CW_GERMAN["NotValidCharacter"] = "#1 ist kein gültiger Charakter!";
CW_GERMAN["NotValidPlayer"] = "#1 ist kein gültiger Spieler!";
CW_GERMAN["NotValidAmount"] = "Das ist keine gültige Menge!";
CW_GERMAN["NotValidTarget"] = "#1 ist kein gültiger Ziel!";
CW_GERMAN["PlayerHasProtectionStatus"] = "#1 hat ein geschützen Status und kann nicht verändert werden!";
CW_GERMAN["PlayerHasProtectionOffline"] = "Dieser Spieler hat ein geschützen Status und kann nicht verändert werden!";
CW_GERMAN["CannotGiveAdminFlags"] = "Du kannst keine 'o', 'a', or 's' Flaggen vergeben!";
CW_GERMAN["CannotTakeAdminFlags"] = "Du kannst keine 'o', 'a', or 's' Flaggen entnehmen!";
CW_GERMAN["PlayerIsOnlyAUser"] = "Dieser Spieler ist nur ein Benutzer und kann nicht degradiert werden!";
CW_GERMAN["TargetIsTooFarAway"] = "Dieses Ziel ist zu weit weg!";
CW_GERMAN["MustLookAtValidTarget"] = "Du musst auf einem gültigen Ziel schauen!";
CW_GERMAN["ThisNotValidWeapon"] = "Das ist keine gültige Waffe!";
CW_GERMAN["Framework"] = "Framework";
CW_GERMAN["ChatBox"] = "Chat Box";
CW_GERMAN["AdminESP"] = "Admin ESP";
CW_GERMAN["Theme"] = "Theme";
CW_GERMAN["Language"] = "Sprache";
CW_GERMAN["LangDesc"] = "Die derzeitig ausgewählte Sprache.";
CW_GERMAN["ErrorCraftingNonInstance"] = "Fehlgeschlagen, eine nicht instanzierter Entwurf anzufertigen!";
CW_GERMAN["SuccessfulCraftWithMsg"] = "Du hast erfolgreich ein #1 angefertigt! #2";
CW_GERMAN["SuccessfulCraft"] = "Du hast erfolgreich ein #1 angefertigt!";
CW_GERMAN["ErrorCraftingWithMsg"] = "Nicht imstande um ein #1 anzufertigen! #2";
CW_GERMAN["YouHaveGivenSomeItem"] = "Du hast #1 ein paar #2 gegeben.";
CW_GERMAN["YouHaveGivenItemAmount"] = "Du hast #1 #2x #3 gegeben.";
CW_GERMAN["YouHaveGivenAnItem"] = "Du hast #1 ein #2 gegeben.";
CW_GERMAN["YouWereGivenSomeItem"] = "#1 hat dir ein paar #2 gegeben.";
CW_GERMAN["YouWereGivenItemAmount"] = "#1 hat dir #2x #3 gegeben.";
CW_GERMAN["YouWereGivenAnItem"] = "#1 hat dir ein #2 gegeben.";
CW_GERMAN["YouGaveCashTo"] = "Du hast #1 an #2 gegeben.";
CW_GERMAN["YouWereGivenCashBy"] = "Dir wurden #1 von #2 gegeben.";
CW_GERMAN["NoAuthority"] = "Du hast nicht die Authorität um das zu machen!";
CW_GERMAN["ErrorGiveNonInstance"] = "Fehlgeschlagen, einen Spieler ein nicht instanzierter Gegenstand zu geben!";
CW_GERMAN["YourInventoryFull"] = "Dein Inventar ist gerade zu voll!";
CW_GERMAN["PluginNotValid"] = "Dieses Plugin ist nicht gültig!";
CW_GERMAN["PluginCouldNotBeUnloaded"] = "Dieses Plugin konnte nicht ungeladen werden!";
CW_GERMAN["PluginCouldNotBeLoaded"] = "Dieses Plugin konnte nicht geladen werden!";
CW_GERMAN["PluginDependsOnAnother"] = "Das Plugin hängt von einem anderen Plugin ab!";
CW_GERMAN["PlayerUnloadedPlugin"] = "#1 hat das #2 Plugin, für den nächsten Neustart, ungeladen.";
CW_GERMAN["PlayerLoadedPlugin"] = "#1 hat das #2 Plugin, für den nächsten Neustart, geladen.";
CW_GERMAN["PlayerRestartingMapIn"] = "#1 startet die Karte in #2 Sekunde(n) neu!";
CW_GERMAN["PlayerChangingMapIn"] = "#1 wechselt die Karte zu #2 in #3 Sekunde(n)!";
CW_GERMAN["MapNameIsNotValid"] = "#1 ist keine gültige Karte!";
CW_GERMAN["ConfigKeyIsStatic"] = "#1 ist ein statischer Konfigschlüssel!";
CW_GERMAN["ConfigKeyIsNotValid"] = "#1 ist kein gültiger Konfigschlüssel!";
CW_GERMAN["UnableToBeSet"] = "#1 ist nicht imstande festgelt zu werden!";
CW_GERMAN["TieCommandNotFound"] = "Dieses Schema beinhaltet den Befehl, 'InvZipTie', nicht!";
CW_GERMAN["YouHaveUntiedPlayer"] = "Du hast den gezielten Charakter aufgebunden.";
CW_GERMAN["YouHaveTiedPlayer"] = "Du hast den gezielten Charakter zugebunden.";
CW_GERMAN["YouWereUntiedByPlayer"] = "Du wurdest von einem anderen Charakter aufgebunden.";
CW_GERMAN["YouWereTiedByPlayer"] = "Du wurdest von einem anderen Charakter zugebunden.";
CW_GERMAN["NoAccessToAny"] = "Du hast keinen Zugriff auf irgendwelche #1!";
CW_GERMAN["NoAccessToCommand"] = "Du hast keinen Zugriff auf diesen Befehl, #1.";
CW_GERMAN["NotValidCommandOrAlias"] = "Das ist kein gültiger Befehl oder Alias!";
CW_GERMAN["CannotUseCommandsYet"] = "Du kannst diesen Befehl noch nicht benutzen!";
CW_GERMAN["YouHaveMaxOfThese"] = "Du hast die maximale Menge für diese erreicht!";
CW_GERMAN["CannotDropWhileWearing"] = "Du kannst das nicht fallen lassen, während du es trägst!";
CW_GERMAN["FactionCannotWearThis"] = "Deine derzeitige Faktion, kann das nicht tragen!";
CW_GERMAN["NeedWeaponThatUsesAmmo"] = "Du brauchst eine ausgerüstete Waffe, die diese Munition verwendet!";
CW_GERMAN["StorageHasNoInstance"] = "Die Lagerung beinhaltet kein Exemplar von diesem Gegenstand!";
CW_GERMAN["YouHaveNoStorageOpen"] = "Du hast derzeitig keine Lagerung offen!";
CW_GERMAN["YouCannotGiveItemsToThisContainer"] = "Du kannst keine Gegenstände an dieser Lagerung vergeben!";
CW_GERMAN["YouRemovedVoicemail"] = "Du hast deine Sprachnachricht entfernt.";
CW_GERMAN["YouSetVoicemail"] = "Du hast deine Sprachnachricht auf '#1' gestellt.";
CW_GERMAN["YouHaveNoInstanceOfThisItem"] = "Du hast kein Exemplar von diesem Gegenstand!";
CW_GERMAN["YouHaveNoAccessToClass"] = "Du hast keinen Zugriff zu dieser Klasse!";
CW_GERMAN["TooManyCharactersWithClass"] = "Es sind zu viele Charaktere mit dieser Klasse!";
CW_GERMAN["ClassNotValid"] = "Das ist keine gütlige Klasse!";
CW_GERMAN["YouSetPlayersCash"] = "Du hast #1s #2 auf #3 gestellt.";
CW_GERMAN["YourCashSetBy"] = "Dein #1 wurde auf #2 von #3 gestellt.";
CW_GERMAN["PlayerAlreadyBannedFromVoice"] = "#1 ist schon von der Nutzung der Stimme verbannt!";
CW_GERMAN["PlayerNotBannedFromVoice"] = "#1 ist nicht von der Nutzung der Stimme verbannt!";
CW_GERMAN["ThereAreNoBannedPlayersWithID"] = "Es sind keine Spieler mit der '#1' Bezeichnung verbannt!";
CW_GERMAN["UserGroupMustBeAdminType"] = "Die Benutzergruppe muss 'superadmin', 'admin', oder 'operator' sein!";
CW_GERMAN["PlayerTookFlagsFrom"] = "#1 nahm die '#2' Flaggen von #3.";
CW_GERMAN["PlayersHealthWasSet"] = "#1s Lebenspunkte wurden auf #2 gestellt.";
CW_GERMAN["YourHealthWasSet"] = "Deine Lebenspunkte wurden auf #1 von #2 gestellt.";
CW_GERMAN["PlayerSetPlayerName"] = "#1 stellte #2s Name zu #3.";
CW_GERMAN["PlayerSetPlayerModel"] = "#1 stellte #2s Model auf '#3'.";
CW_GERMAN["PlayerSlainBy"] = "#1 wurde von #2 erschlagen.";
CW_GERMAN["YouAreAlreadySearchingCharacter"] = "Du durchsuchst schon einen Charakter!";
CW_GERMAN["PlayerAlreadyBeingSearched"] = "#1 wird schon durchsucht!";
CW_GERMAN["EntityIsNotPhysics"] = "Dieses Entity ist nicht ein physikalisches Entity!";
CW_GERMAN["YouDoNotOwnThis"] = "Du bist nicht der Besitzer von dies!";
CW_GERMAN["PlayerTeleportedPlayerTo"] = "#1 hat #2 zu #3 teleportiert!";
CW_GERMAN["PlayerTeleportedPlayerToLocation"] = "#1 hat #2 zu ihrem Standort teleportiert!";
CW_GERMAN["PlayerWasRespawnedToTarget"] = "#1 wurde regespawnt und zu der Position des Ziels teleportiert!";
CW_GERMAN["PlayerWasRespawnedToDeath"] = "#1 wurde an ihrer Position des Todes regespawnt.";
CW_GERMAN["PlayerSetPlayerGroupTo"] = "#1 hat #2s Benutzergruppe auf #3 gestellt.";
CW_GERMAN["PlayerSetPlayerFlagsTo"] = "#1 hat #2s Flaggen auf #3 gestellt.";
CW_GERMAN["PlayerKickedPlayer"] = "#1 hat #2 gekickt (#3).";
CW_GERMAN["PlayerGoneToPlayer"] = "#1 ging zu #2s Standort.";
CW_GERMAN["PlayerGavePlayerFlags"] = "#1 gab #2 '#3' Flaggen.";
CW_GERMAN["PlayerBroughtPlayerTo"] = "#1 brachte #2 zu ihrem Standort.";
CW_GERMAN["PlayerBannedPlayerHours"] = "#1 hat #2 für #3 Stunde(n) verbannt (#4).";
CW_GERMAN["PlayerBannedPlayerMinutes"] = "#1 hat #2 für #3 Minute(n) verbannt (#4).";
CW_GERMAN["PlayerBannedPlayerPerma"] = "#1 hat #2 permanent verbannt (#4).";
CW_GERMAN["PhysDescChangeOtherDesc"] = "Zu was möchtest du, den Spielers physikalische Beschreibung ändern?";
CW_GERMAN["PhysDescChangeTitle"] = "Physikalische Beschreibung Ändern";
CW_GERMAN["PhysDescChangeDesc"] = "Zu was möchtest du deine physikalische Beschreibung ändern?";
CW_GERMAN["PlayersPhysDescChangedTo"] = "#1s physikalische Beschreibung wurde auf '#2' geändert.";
CW_GERMAN["PhysDescMinimumLength"] = "Die physikalische Beschreibung muss mindistens #1 Charakter(e) lang sein.";
CW_GERMAN["RequestAdminRedirect"] = "Du bist ein Admin, benutz den /a Befehl stattdessen.";
CW_GERMAN["NoAccessToOrderItem"] = "Du hast kein Zugriff um diesen Gegenstand zu bestellen!";
CW_GERMAN["NoAccessToMenu"] = "Du hast kein Zugriff um auf das #1 Menü zuzugreifen!";
CW_GERMAN["CannotOrderThatFarAway"] = "Du kannst diesen Gegenstand nicht so weit weg bestellen!";
CW_GERMAN["RequiredIngredientsMissing"] = "Du hast nicht die benötigte Ingredienzen um dieses Rezept anzufertigen!";
CW_GERMAN["NoBlueprintsForCraftingMenu"] = "Es hat keine Entwürfe für das {MenuNameCrafting} Menü!";
CW_GERMAN["NotValidAttribute"] = "Das ist kein gültiger {AttributeName}!";
CW_GERMAN["YouHaveMaxOfThis"] = "Du hast das maximum von das #1!";
CW_GERMAN["PlayerAlreadyIsFaction"] = "#1 ist schon auf der #2 Faktion!";
CW_GERMAN["PlayerNotCorrectGenderForFaction"] = "#1 ist nicht das korrekte Geschlecht für die #2 Faktion!";
CW_GERMAN["PlayerTransferredPlayer"] = "#1 hat #2 zu der #3 Fraktion transferiert.";
CW_GERMAN["PlayerCannotTransferToFaction"] = "#1 kann nicht zu der #2 Faktion transferiert werden!";
CW_GERMAN["PlayerCouldNotBeTransferred"] = "#1 konnte nicht zu der #2 Faktion transferiert werden!";
CW_GERMAN["PlayerNotOnFactionWhitelist"] = "#1 ist nicht auf der #2 Whitelist!";
CW_GERMAN["FaultMorePointsThanCanSpend"] = "Du hast mehr #1 points ausgewählt, als du dir überhaupt zum spendieren leisten kannst!";
CW_GERMAN["FaultDidNotChooseAttributes"] = "Du hast nicht irgendwelche #1 ausgewählt oder die jenigen die du hast sind nicht gültig!";
CW_GERMAN["FaultNameNoSpecialChars"] = "Dein Vorname und Nachname dürfen keine Punktationen, Abstände oder Ziffern beinhalten!";
CW_GERMAN["FaultNameHaveVowel"] = "Dein Vorname und Nachname müssen beide zumindest einen Vokal beinhalten!";
CW_GERMAN["FaultNameMinLength"] = "Dein Vorname und Nachname müssen beide zumindest 2 Charaktere lang sein!";
CW_GERMAN["FaultNameTooLong"] = "Dein Vorname und Nachname müssen nicht mehr als 16 Charaktere lang sein!";
CW_GERMAN["FaultNameInvalid"] = "Du hast kein Name ausgewählt, oder der Name den du ausgewählt hast ist nicht gültig!";
CW_GERMAN["FaultPhysDescNeeded"] = "Du hast keine phyische Beschreibung eingegeben!";
CW_GERMAN["FaultNeedModel"] = "Du hast kein Model ausgewählt, oder das Model das du ausgewählt hast ist nicht gültig!";
CW_GERMAN["FaultNeedGender"] = "Du hast kein Geschlecht ausgewählt, oder das Geschlecht das du ausgewählt hast ist nicht gültig!";
CW_GERMAN["FaultNeedClass"] = "Du hast keine Klasse ausgewählt, oder die Klasse die du ausgewählt hast ist nicht gültig!";
CW_GERMAN["FaultNotOnWhitelist"] = "Du bist nicht auf der #1 Whitelist!";
CW_GERMAN["FaultTooManyInFaction"] = "Du kannst keine weitere Charaktere für diese Faktion erstellen.";
CW_GERMAN["FaultTooManyCharacters"] = "Du kannst keine weitere Charaktere erstellen !";
CW_GERMAN["FaultGenericError"] = "Es gab einen Fehler beim erstellen dieses Charakters!";
CW_GERMAN["FaultCharNameExists"] = "Ein Charakter mit dem Namen '#1' existiert bereits!";
CW_GERMAN["FaultDidNotChooseFaction"] = "Du hast keine Faktion ausgewählt oder den der du ausgewählt hast ist nicht gültig!";
CW_GERMAN["FaultDidNotFillPanel"] = "Du hast nicht #1 ausgefüllt!";
CW_GERMAN["FaultDidNotFillPanelWithNumber"] = "Du hast #1 nicht mit einer Nummer ausgefüllt!";
CW_GERMAN["FaultTextEntryHigherThan"] = "Du kannst nicht höher als #1 in der #2 Texteingabe gehen!";
CW_GERMAN["FaultTextEntryLowerThan"] = "Du kannst nicht tiefer als #1 in der #2 Texteingabe gehen!";
CW_GERMAN["YouAlreadyHaveCharName"] = "Du hast schon einen Charakter mit dem Namen '#1'!";
CW_GERMAN["MenuDescAttributes"] = "Überprüfe deinen Status deiner Attribute.";
CW_GERMAN["MenuDescScoreboard"] = "Sehe welche Spieler auf dem Server sind.";
CW_GERMAN["MenuDescDirectory"] = "Eine Directory mit mehrere Themen und Informationen.";
CW_GERMAN["MenuDescInventory"] = "Verwalte die Gegenstände in deinem Inventar.";
CW_GERMAN["MenuDescBusiness"] = "Bestelle Gegenstände für dein Geschäft.";
CW_GERMAN["MenuDescPluginCenter"] = "Durchstöbere und Abonniere zu Clockwork Plugins.";
CW_GERMAN["MenuDescCommunity"] = "Besuchen Sie die offiziele Clockwork Community.";
CW_GERMAN["MenuDescSystem"] = "Greifen sie auf eine Vielfalt von Server-sided Optionen.";
CW_GERMAN["MenuDescCrafting"] = "Kombiniere verschiedene Gegenstände um neue Gegenstände.";
CW_GERMAN["MenuDescDonations"] = "Überprüfe deine Spenden Abonnomments.";
CW_GERMAN["MenuDescClasses"] = "Wähle aus einer Liste von verfügbaren Klassen.";
CW_GERMAN["MenuDescSettings"] = "Konfiguriere den Weg wie Clockwork für dich funktionieren soll.";
CW_GERMAN["MenuNameAttributes"] = "Attribute";
CW_GERMAN["MenuNameScoreboard"] = "Scoreboard";
CW_GERMAN["MenuNamePluginCenter"] = "Plugin Center";
CW_GERMAN["MenuNameDirectory"] = "Directory";
CW_GERMAN["MenuNameBusiness"] = "Business";
CW_GERMAN["MenuNameCrafting"] = "Crafting";
CW_GERMAN["MenuNameInventory"] = "Inventar";
CW_GERMAN["MenuNameCommunity"] = "Community";
CW_GERMAN["MenuNameClasses"] = "Klassen";
CW_GERMAN["MenuNameDonations"] = "Spenden";
CW_GERMAN["MenuNameSettings"] = "Einstellungen";
CW_GERMAN["MenuNameSystem"] = "System";
CW_GERMAN["AttributeName"] = "Attribut";
CW_GERMAN["EquipmentName"] = "Ausrüstung";
CW_GERMAN["Monday"] = "Montag";
CW_GERMAN["Tuesday"] = "Dienstag";
CW_GERMAN["Wednesday"] = "Mittwoch";
CW_GERMAN["Thursday"] = "Donnerstag";
CW_GERMAN["Friday"] = "Freitag";
CW_GERMAN["Saturday"] = "Samstag";
CW_GERMAN["Sunday"] = "Sonntag";
CW_GERMAN["Confirm"] = "Bestätigen";
CW_GERMAN["Cancel"] = "Abbrechen";
CW_GERMAN["Delete"] = "Löschen";
CW_GERMAN["Examine"] = "Untersuchen";
CW_GERMAN["Destroy"] = "Zerstören";
CW_GERMAN["Supply"] = "Vorrat";
CW_GERMAN["Gender"] = "Geschlecht";
-- Amount of weight an inventory can carry.
CW_GERMAN["Weight"] = "Gewicht";
-- Amount of space (size) an inventory can hold.
CW_GERMAN["Space"] = "Platz";
CW_GERMAN["Next"] = "Weiter";
CW_GERMAN["Back"] = "Zurück";
CW_GERMAN["Drop"] = "Droppen";
CW_GERMAN["Open"] = "Öffnen";
CW_GERMAN["Take"] = "Nehmen";
CW_GERMAN["Okay"] = "Okay";
CW_GERMAN["Name"] = "Name";
CW_GERMAN["Use"] = "Benutzen";
CW_GERMAN["Yes"] = "Ja";
CW_GERMAN["No"] = "Nein";
CW_GERMAN["Weightless"] = "Gewichtslos";
CW_GERMAN["Spaceless"] = "Nimmt keinen Platz";
CW_GERMAN["Information"] = "Information";
CW_GERMAN["Category"] = "Kategorie";
CW_GERMAN["RecipeNumber"] = "Rezept #1";
CW_GERMAN["Requirements"] = "Anforderungen";
CW_GERMAN["Price"] = "Preis";
CW_GERMAN["CharacterRoleplayInfo"] = "CHARAKTER UND ROLEPLAY INFO";
CW_GERMAN["SelectQuickMenuOption"] = "WÄHLE EINE RASCHE MENÜ OPTION";
CW_GERMAN["SelectWhoCanRecognize"] = "WÄHLE WER DICH ERKENNEN KANN";
CW_GERMAN["AllInWhisperRange"] = "Alle Charaktere innerhalb der Reichweite des flüsterns.";
CW_GERMAN["AllInYellRange"] = "Alle Charaktere innerhalb der Reichweite des schreiens";
CW_GERMAN["AllInTalkRange"] = "Alle Charaktere innerhalb der Reichweite des redens.";
CW_GERMAN["CharacterYouAreLookingAt"] = "Den Charakter den du anschaust.";
CW_GERMAN["QuickMenuFallOver"] = "Umfallen";
CW_GERMAN["QuickMenuDescription"] = "Physikalische Beschreibung";
CW_GERMAN["CharacterMenuNew"] = "NEU";
CW_GERMAN["CharacterMenuCancel"] = "ABBRECHEN";
CW_GERMAN["CharacterMenuLoad"] = "LADEN";
CW_GERMAN["CharacterMenuLeave"] = "VERLASSEN";
CW_GERMAN["CharacterMenuPrevious"] = "VORHERIGE";
CW_GERMAN["CharacterMenuNext"] = "NÄCHSTE";
CW_GERMAN["CharacterMenuFactionHelp"] = "Die Faktion definiert den gesamten Charakter und kann fast wahrscheinlich unverändert bleiben.";
CW_GERMAN["CharacterMenuPhysDescHelp"] = "Schreibe eine physikalische Beschreibung für dein Charakter.";
CW_GERMAN["CharacterMenuPhysDesc"] = "Beschreibung";
CW_GERMAN["CharacterMenuFullName"] = "Voller Name";
CW_GERMAN["CharacterMenuAppearance"] = "Aussehen";
CW_GERMAN["CharacterMenuForename"] = "Vorname";
CW_GERMAN["CharacterMenuSurname"] = "Nachname";
CW_GERMAN["CharacterMenuFaction"] = "Faktion";
CW_GERMAN["KickPlayer"] = "Spieler kicken";
CW_GERMAN["KickPlayerReason"] = "Was ist dein Grund warum du sie kicken möchtest?";
CW_GERMAN["BanPlayer"] = "Spieler bannen";
CW_GERMAN["BanPlayerTime"] = "Für wie viele minuten möchstest du sie bannen lassen?";
CW_GERMAN["BanPlayerReason"] = "Was ist dein Grund warum du sie bannen möchtest?";
CW_GERMAN["GiveFlags"] = "Flaggen geben";
CW_GERMAN["GiveFlagsHelp"] = "Welche Flaggen möchtest du ihnen geben?";
CW_GERMAN["TakeFlags"] = "Flaggen entnehmen";
CW_GERMAN["TakeFlagsHelp"] = "Welche Flaggen möchtest du von ihnen entnehmen?";
CW_GERMAN["SetName"] = "Name setzen";
CW_GERMAN["SetNameHelp"] = "Zu was möchtest du ihren Namen setzen?";
CW_GERMAN["GiveItem"] = "Gegenstand geben";
CW_GERMAN["GiveItemHelp"] = "Welcher Gegenstand möchtest du ihnen geben?";
CW_GERMAN["BanCharacter"] = "Charakter bannen";
CW_GERMAN["SetGroup"] = "Gruppe setzen";
CW_GERMAN["SuperAdmin"] = "Super Admin";
CW_GERMAN["Admin"] = "Admin";
CW_GERMAN["Operator"] = "Operator";
CW_GERMAN["Whitelist"] = "Whitelist";
CW_GERMAN["Unwhitelist"] = "Unwhitelisten";
CW_GERMAN["Demote"] = "Degradieren";
CW_GERMAN["PageCount"] = "Seite #1/#2";
CW_GERMAN["ScoreboardMenuHelp"] = "Klick auf ein Spielers Model-Icon um verfügbare Befehle aufzubringen.";
CW_GERMAN["ScoreboardMenuPing"] = "Der Spielers Ping ist #1.";
CW_GERMAN["ScoreboardMenuNoPlayers"] = "Es sind keine Spieler online, um etwas anzuzeigen.";
CW_GERMAN["SettingsMenuHelp"] = "Diese Einstellungen sind Client-side um dir zu helfen Clockwork zu personalisieren.";
CW_GERMAN["SettingsMenuNoAccess"] = "Du hast keinen Zugriff auf irgendwelche Einstellungen!";
CW_GERMAN["ManagePlugins"] = "Plugins Verwalten";
CW_GERMAN["ManagePluginsHelp"] = "Du kannst von hier Plugins laden und entladen.";
CW_GERMAN["ManageGroups"] = "Gruppen Verwalten";
CW_GERMAN["ManageGroupsHelp"] = "Ein WEg um alle Administartion-Gruppen zu verwalten.";
CW_GERMAN["ManageGroupsNoUsers"] = "Es sind keine Benutzer zum anzeigen in dieser Gruppe.";
CW_GERMAN["ManageGroupsGettingUsers"] = "Warte während die Gruppen-Benutzer erneuert werden...";
CW_GERMAN["ManageGroupsSuperAdmins"] = "Super Admins";
CW_GERMAN["ManageGroupsAdmins"] = "Admins";
CW_GERMAN["ManageGroupsDemoteText"] = "Bist du sicher, dass du #1 degradieren willst?";
CW_GERMAN["ManageGroupsDemoteTitle"] = "#1 Degradieren";
CW_GERMAN["ManageGroupsSteamIDInfo"] = "Dieser Spielers Steam ID ist #1.";
CW_GERMAN["ManageGroupsBackToGroups"] = "Zurück zu Benutzergruppen";
CW_GERMAN["ManageGroupsManageWithin"] = "Verwalte Benutzer innerhalb der #1 Benutzergruppe.";
CW_GERMAN["ManageGroupsOperators"] = "Operatoren";
CW_GERMAN["ManageGroupsUserGroups"] = "Benutzergruppen";
CW_GERMAN["ManageGroupsSelectingGroup"] = "Die Auswahl eine Benutzergruppe wird eine Liste von Benutzern in dieser Gruppe aufbringen.";
CW_GERMAN["ManageConfig"] = "Config Verwalten";
CW_GERMAN["ManageConfigHelp"] = "Ein einfacher Weg zum editieren der Clockwork config.";
CW_GERMAN["ManageBans"] = "Bans Verwalten";
CW_GERMAN["ManageBansHelp"] = "Eine Methode um Spieler graphisch zu unbannen.";
CW_GERMAN["ManageBansNoPlayers"] = "Es hat keine gebannte Spieler zum anzeigen.";
CW_GERMAN["ManageBansGettingBans"] = "Warte während die verbannten Spieler Liste erneuert wird...";
CW_GERMAN["ManageBansAreYouSure"] = "Bist du sicher das du #1 unbannen möchtest?";
CW_GERMAN["ManageBansUnbanTitle"] = "#1 Unbannen";
CW_GERMAN["ManageBansBannedPerma"] = "Dieser Spieler ist permanent gebannt.";
CW_GERMAN["ManageBansBanInfo"] = "#1\n#2\n#Gebannt für '#3'.";
CW_GERMAN["ManageBansUnbannedInHours"] = "Ungebannt in #1 Stunde(n).";
CW_GERMAN["ManageBansUnbannedInMinutes"] = "Ungebannt in #1 Minute(n).";
CW_GERMAN["ManageBansUnbannedInSeconds"] = "Ungebannt in #1 Sekunde(n).";
CW_GERMAN["ColorModify"] = "Config Modifizieren";
CW_GERMAN["ColorModifyHelp"] = "Bearbeite das Schemas Global Farbe zum anpassen deines bedarfs.";
CW_GERMAN["ManagePlayers"] = "Spieler Verwalten";
CW_GERMAN["ManagePlayersHelp"] = "Beinhaltet ein Set von nützlichen Befehlen zum benutzen eines Spielers.";
CW_GERMAN["ManagePlayersCommands"] = "Wenn man auf einem Spieler klickt wird eine Liste von verfügbaren Befehlen aufgebracht.";
CW_GERMAN["ManagePlayersNoPlayers"] = "Es hat keine Spieler zum anzeigen.";
CW_GERMAN["PlayerNameAndSteamID"] = "Dieser Spielers Name ist #1.\nDieser Spielers Steam ID ist #2.";
CW_GERMAN["SelectToMakeDefaultClass"] = "Wähle das aus um das als deine Charakters Standart Klasse zu machen.";
CW_GERMAN["SystemMenuBackToNavigation"] = "Zurück zur Navigation";
CW_GERMAN["ClickToOpenSystemPanel"] = "Klick hier um die Systemsteuerung zu öffnen.";
CW_GERMAN["SystemMenuNoAccess"] = "Du hast keinen Zugriff zu dieser Systemsteuerung.";
CW_GERMAN["SystemMenuNavigation"] = "Navigation";
CW_GERMAN["ConfigMenuListName"] = "Name";
CW_GERMAN["ConfigMenuListKey"] = "Key";
CW_GERMAN["ConfigMenuListAddedBy"] = "Hinzugefügt von";
CW_GERMAN["ConfigMenuStartToEdit"] = "Jetzt kannst du anfangen dein Config-Wert zu bearbeiten, oder klick ein anderen Config-Key.";
CW_GERMAN["ConfigMenuValueText"] = "Value";
CW_GERMAN["ConfigMenuMapText"] = "Map";
CW_GERMAN["ConfigMenuOkayText"] = "Okay";
CW_GERMAN["ConfigMenuOnText"] = "On";
CW_GERMAN["ConfigMenuHelp"] = "Klick auf einem Config-Key um den Config-Wert zu bearbeiten.";
CW_GERMAN["ConfigMenuTitle"] = "Config";
CW_GERMAN["TabMenuCharacters"] = "CHARAKTERE ANZEIGEN";
CW_GERMAN["TabMenuCharactersDesc"] = "Klick hier um deine Charaktere anzuzeigen.";
CW_GERMAN["TabMenuCloseDesc"] = "Klick hier um das Menü zu schliessen.";
CW_GERMAN["TabMenuClose"] = "ROLEPLAY FORTFAHREN";
CW_GERMAN["YouCanSpendMorePoints"] = "Du kannst noch #1 mehr Punkt(e) spendieren.";
CW_GERMAN["CharacterDoesNotExist"] = "Dieser Charakter existiert nicht!";
CW_GERMAN["YouCannotUseThisCharacter"] = "Du kannst diesen Charakter nicht benutzen!";
CW_GERMAN["YouCannotDeleteThisCharacter"] = "Du kannst diesen Charakter nicht löschen!";
CW_GERMAN["AlreadyUsingThisCharacter"] = "Du benutzt diesen Charakter schon!";
CW_GERMAN["YouCannotSwitchToCharacter"] = "Du kannst nicht zu diesem Charakter wechseln!";
CW_GERMAN["CannotSwitchFactionFull"] = "Die #1 Faktion ist voll (#2/#3)!";
CW_GERMAN["CannotDeleteCharacterUsing"] = "Du kannst den Charakter den du benutzt nicht löschen!";
CW_GERMAN["UseThisCharacter"] = "Benutze diesen Charakter.";
CW_GERMAN["DeleteThisCharacter"] = "Lösche diesen Charakter.";
CW_GERMAN["PurchasableDoorText"] = "Diese Türe kann nicht gekauft werden.";
CW_GERMAN["PurchasedDoorText"] = "Diese Türe wurde gekauft.";
CW_GERMAN["OwnableDoorText"] = "Diese Türe kann im Besitz sein.";
CW_GERMAN["OwnedDoorText"] = "Diese Türe ist im Besitz.";
CW_GERMAN["UnownableDoorText"] = "Diese Türe ist unbesitzbar.";
CW_GERMAN["Door"] = "Türe";
CW_GERMAN["CreateCharacterStage1"] = "Persuasion";
CW_GERMAN["CreateCharacterStage2"] = "Beschreibung";
CW_GERMAN["CreateCharacterStage3"] = "Preferierte Rolle";
CW_GERMAN["CreateCharacterStage4"] = "Attribute";
CW_GERMAN["ChatLines"] = "Chat Linien";
CW_GERMAN["ChatLinesDesc"] = "Die menge von Chat Linien auf einmal angezeigt.";
CW_GERMAN["EnableAdminConsoleLog"] = "Aktiviere Admin Console Log";
CW_GERMAN["EnableAdminConsoleLogDesc"] = "Ob die Admin Console Log angezeigt werden soll oder nicht.";
CW_GERMAN["EnableTwelveHourClock"] = "Aktiviere Twelve Hour Clock";
CW_GERMAN["EnableTwelveHourClockDesc"] = "Ob die Twelve Hour Clock angezeigt werden soll oder nicht.";
CW_GERMAN["ShowTopBars"] = "Zeige Top Bars";
CW_GERMAN["ShowTopBarsDesc"] = "Ob der Balken beim oberem Bereiche des Bildschirms angezeigt werden soll oder nicht.";
CW_GERMAN["EnableHintsSystem"] = "Aktiviere Hints System";
CW_GERMAN["EnableHintsSystemDesc"] = "Ob Hinweise angezeigt werden soll oder nicht.";
CW_GERMAN["EnableVignette"] = "Aktiviere Vignette";
CW_GERMAN["EnableVignetteDesc"] = "Ob die Vignette gerendert werden soll oder nicht.";
CW_GERMAN["ShowMessageTimeStamps"] = "Zeige Message Time Stamps";
CW_GERMAN["ShowMessageTimeStampsDesc"] = "Ob die Zeitstempel an den Nachrichten angezeigt werden soll oder nicht.";
CW_GERMAN["ShowClockworkMessages"] = "Zeige Clockwork Messages";
CW_GERMAN["ShowClockworkMessagesDesc"] = "Ob irgendwelche Clockwork Nachrichten angezeigt werden soll oder nicht.";
CW_GERMAN["ShowServerMessages"] = "Zeige Server Messages";
CW_GERMAN["ShowServerMessagesDesc"] = "Ob irgendwelche Server Nachrichten angezeigt werden soll oder nicht.";
CW_GERMAN["ShowOOCMessages"] = "Zeige OOC Messages";
CW_GERMAN["ShowOOCMessagesDesc"] = "Ob irgendwelche Out-Of-Character Nachrichten angezeigt werden soll oder nicht.";
CW_GERMAN["ShowICMessages"] = "Zeige IC Messages";
CW_GERMAN["ShowICMessagesDesc"] = "Ob irgendwelche In-Character Nachrichten angezeigt werden soll oder nicht.";
CW_GERMAN["EnableAdminESP"] = "Aktiviere Admin ESP";
CW_GERMAN["EnableAdminESPDesc"] = "Ob die Admin ESP angezeigt werden soll oder nicht.";
CW_GERMAN["DrawESPBars"] = "Rendere ESP Bars";
CW_GERMAN["DrawESPBarsDesc"] = "Ob der Fortschritts Balken für gewisse Werte gerendert werden soll oder nicht.";
CW_GERMAN["ShowItemEntities"] = "Zeige Item Entities";
CW_GERMAN["ShowItemEntitiesDesc"] = "Ob man Gegenstände in der Admin ESP sehen kann oder nicht.";
CW_GERMAN["ShowSalesmenEntities"] = "Zeige Salesmen Entities";
CW_GERMAN["ShowSalesmenEntitiesDesc"] = "Ob man Salesmens in der Admin ESP sehen kann oder nicht.";
CW_GERMAN["ESPInterval"] = "ESP Interval";
CW_GERMAN["ESPIntervalDesc"] = "Die Menge an Zeit zwischen ESP checks.";
CW_GERMAN["HeadbobAmount"] = "Headbob Menge";
CW_GERMAN["HeadbobAmountDesc"] = "Die Menge von der Skalierung des Headbobs.";
CW_GERMAN["ThemeDesc"] = "Das derzeitige aktive GUI Thema zum anzeigen.";
CW_GERMAN["AttributeProgressionScale"] = "Attribut Fortschritts-Skalierung";
CW_GERMAN["AttributeProgressionScaleDesc"] = "Die Menge von der Skalierung des Attributenfortschritts.";
CW_GERMAN["MessagesMustSeePlayer"] = "Nachrichten muss Spieler sehen";
CW_GERMAN["MessagesMustSeePlayerDesc"] = "Ob du ein Spieler sehen musst um In-Character Nachrichten zu hören sollst oder nicht.";
CW_GERMAN["StartingAttributePoints"] = "Starting Attribute Points";
CW_GERMAN["StartingAttributePointsDesc"] = "Der Standart Betrag für Attributenpünkte das ein Spieler hat.";
CW_GERMAN["ClockworkIntroductionEnabled"] = "Clockwork Introduction Aktiviert";
CW_GERMAN["ClockworkIntroductionEnabledDesc"] = "Aktiviere die Clockwork Präsentierung für neue Spieler.";
CW_GERMAN["HealthRegenerationEnabled"] = "Health Regeneration Aktiviert";
CW_GERMAN["HealthRegenerationEnabledDesc"] = "Ob die Regenerations der Lebenspunkte aktiviert sein soll oder nicht.";
CW_GERMAN["PropProtectionEnabled"] = "Prop Protection Aktiviert";
CW_GERMAN["PropProtectionEnabledDesc"] = "Ob die Prop Protection aktiviert sein soll oder nicht.";
CW_GERMAN["UseLocalMachineDate"] = "Benutze Local Machine Date";
CW_GERMAN["UseLocalMachineDateDesc"] = "Ob der Local Machines Date wenn die Map geladen ist benutzt werden soll oder nicht.";
CW_GERMAN["UseLocalMachineTime"] = "Benutze Local Machine Time";
CW_GERMAN["UseLocalMachineTimeDesc"] = "Ob der Local Machines Time genutzt werden soll wenn die Map geladen ist oder nicht.";
CW_GERMAN["UseKeyOpensEntityMenus"] = "Benutze Key Opens Entity Menus";
CW_GERMAN["UseKeyOpensEntityMenusDesc"] = "Ob 'use' das Kontextmenu öffnet oder nicht.";
CW_GERMAN["ShootAfterRaiseDelay"] = "Shoot After Raise Delay";
CW_GERMAN["ShootAfterRaiseDelayDesc"] = "The time that it takes for players to be able to shoot after raising their weapon (seconds).\nSet to 0 for no time.";
CW_GERMAN["UseClockworksAdminSystem"] = "Benutze Clockworks Admin-System";
CW_GERMAN["UseClockworksAdminSystemDesc"] = "Whether or not you use a different group or admin system to Clockwork.";
CW_GERMAN["SavedRecognisedNames"] = "Speichere Erkannte Namen";
CW_GERMAN["SavedRecognisedNamesDesc"] = "Ob man erkannte Namen speichern soll oder nicht.";
CW_GERMAN["SaveAttributeBoosts"] = "Speichere Attribute Boosts";
CW_GERMAN["SaveAttributeBoostsDesc"] = "Ob Attribute Boost gespeichert werden soll oder nicht.";
CW_GERMAN["RagdollDamageImmunityTime"] = "Ragdoll Damage Immunity Time";
CW_GERMAN["RagdollDamageImmunityTimeDesc"] = "Die Zeit wo ein Spielers Radgoll immun gegen Schaden ist (Sekunden).";
CW_GERMAN["AdditionalCharacterCount"] = "Zusätzliche Character Count";
CW_GERMAN["AdditionalCharacterCountDesc"] = "Die zusätliche Menge von Charakteren das jeder Spieler haben kann.";
CW_GERMAN["ClassChangingInterval"] = "Class Changing Interval";
CW_GERMAN["ClassChangingIntervalDesc"] = "Die Zeit wo ein Spieler warten muss zum ihre Klasse nocheinmals zu ändern (Sekunden).";
CW_GERMAN["SprintingLowersWeapon"] = "Sprinting Lowers Weapon";
CW_GERMAN["SprintingLowersWeaponDesc"] = "Ob beim sprinten die Waffe des Spielers gesenkt sein soll oder nicht.";
CW_GERMAN["WeaponRaisingSystemEnabled"] = "Weapon Raising System Aktiviert";
CW_GERMAN["WeaponRaisingSystemEnabledDesc"] = "Ob das Raised Weapon System aktiviert sein soll oder nicht.";
CW_GERMAN["PropKillProtectionEnabled"] = "Prop Kill Protection Aktiviert";
CW_GERMAN["PropKillProtectionEnabledDesc"] = "Ob Prop Kill Protection akitviert sein soll oder nicht";
CW_GERMAN["UseSmoothServerRates"] = "Benutze Smooth Server Rates";
CW_GERMAN["UseSmoothServerRatesDesc"] = "Ob der Clockwork smooth rates genutzt werden soll oder nicht.";
CW_GERMAN["UseMediumPerformanceServerRates"] = "Benutze Medium Performance Server Rates";
CW_GERMAN["UseMediumPerformanceServerRatesDesc"] = "Ob der Clockwork mid performance rates genutzt werden soll oder nicht (Balken werden weniger glatter sein).";
CW_GERMAN["UseLagFreeServerRates"] = "Benutze Lag Free Server Rates";
CW_GERMAN["UseLagFreeServerRatesDesc"] = "Ob der Clockwork max performance rates genutzt werden soll oder nicht (tötet alle lags, macht die Balken fertig).";
CW_GERMAN["GeneratorInterval"] = "Generator Interval";
CW_GERMAN["GeneratorIntervalDesc"] = "Die Zeit die es braucht für einen Cash Generator die Sachen zu verteilen (Sekunden).";
CW_GERMAN["GravityGunPuntEnabled"] = "Gravity Gun Punt Aktiviert";
CW_GERMAN["GravityGunPuntEnabledDesc"] = "Ob man Entities mit der Gravity Gun stossen kann oder nicht.";
CW_GERMAN["DefaultInventoryWeight"] = "Default Inventory Weight";
CW_GERMAN["DefaultInventoryWeightDesc"] = "Das Standart Inventar Gewicht (kilogramm).";
CW_GERMAN["DefaultInventorySpace"] = "Default Inventory Space";
CW_GERMAN["DefaultInventorySpaceDesc"] = "Der Standart Inventar Platz (Liter).";
CW_GERMAN["DataSaveInterval"] = "Data Save Interval";
CW_GERMAN["DataSaveIntervalDesc"] = "Die Zeit die es braucht für das Speichern der Daten (Sekunden).";
CW_GERMAN["ViewPunchOnDamage"] = "View Punch On Damage";
CW_GERMAN["ViewPunchOnDamageDesc"] = "Ob die Sicht des Spielers geschlagen wird wenn sie Schaden nehmen.";
CW_GERMAN["ForceLanguage"] = "Sprache Zwingen";
CW_GERMAN["ForceLanguageDesc"] = "Setzen Sie das zu einer gültigen Sprache, um Spieler zu zwingen diese Sprache zu benutzen. Lass es leer, um die Spieler entscheiden zu lassen.";
CW_GERMAN["UnrecognisedName"] = "Unerkannter Name";
CW_GERMAN["UnrecognisedNameDesc"] = "Der Name das an unerkannten Spielern gegeben wird.";
CW_GERMAN["LimbDamageSystemEnabled"] = "Limb Damage System Aktiviert";
CW_GERMAN["LimbDamageSystemEnabledDesc"] = "Ob die Limb Damage aktiviert sein soll oder nicht.";
CW_GERMAN["FallDamageScale"] = "Fall Damage Scale";
CW_GERMAN["FallDamageScaleDesc"] = "Die Menge von der Skalierung des Fall Schadens.";
CW_GERMAN["StartingCurrency"] = "Starting Currency";
CW_GERMAN["StartingCurrencyDesc"] = "Der Standart Betrag von Cash mit dem jeder Spieler beginnt.";
CW_GERMAN["ArmorAffectsChestOnly"] = "Armor Affects Chest Only";
CW_GERMAN["ArmorAffectsChestOnlyDesc"] = "Ob die Rüstung nur bei der Brust Wirkung zeigt.";
CW_GERMAN["MinimumPhysicalDescriptionLength"] = "Minimum Physical Description Length";
CW_GERMAN["MinimumPhysicalDescriptionLengthDesc"] = "Das minimum der Anzahl Charaktere der ein Spieler bei seiner physikalischen Beschreibung haben muss.";
CW_GERMAN["WoodBreaksFall"] = "Wood Breaks Fall";
CW_GERMAN["WoodBreaksFallDesc"] = "Ob Wooden Physik Entities brechen soll wenn ein Spieler darauf fällt oder nicht.";
CW_GERMAN["VignetteEnabled"] = "Vignette Aktiviert";
CW_GERMAN["VignetteEnabledDesc"] = "Ob die Vignette aktiviert sein soll oder nicht.";
CW_GERMAN["HeartbeatSoundsEnabled"] = "Heartbeat Sounds Aktiviert";
CW_GERMAN["HeartbeatSoundsEnabledDesc"] = "Ob Heartbeat aktiviert sein soll oder nicht.";
CW_GERMAN["CrosshairEnabled"] = "Fadenkreuz Aktiviert";
CW_GERMAN["CrosshairEnabledDesc"] = "Ob das Fadenkreuz aktiviert sein soll oder nicht.";
CW_GERMAN["FreeAimingEnabled"] = "Free Aiming Aktiviert";
CW_GERMAN["FreeAimingEnabledDesc"] = "Ob Free Aiming aktiviert sein soll oder nicht.";
CW_GERMAN["RecogniseSystemEnabled"] = "Recognise System Aktiviert";
CW_GERMAN["RecogniseSystemEnabledDesc"] = "Ob das Recognise System aktiviert sein soll oder nicht.";
CW_GERMAN["CurrencyEnabled"] = "Währung Aktiviert";
CW_GERMAN["CurrencyEnabledDesc"] = "Ob Cash aktiviert ist oder nicht.";
CW_GERMAN["DefaultPhysicalDescription"] = "Standart Physikalische Beschreibung";
CW_GERMAN["DefaultPhysicalDescriptionDesc"] = "Die physikalische Beschreibung mit dem jeder Spieler beginnt.";
CW_GERMAN["ChestDamageScale"] = "Chest Damage Scale";
CW_GERMAN["ChestDamageScaleDesc"] = "Die Menge von der Skalierung der Chest Damage.";
CW_GERMAN["CorpseDecayTime"] = "Corpse Decay Time";
CW_GERMAN["CorpseDecayTimeDesc"] = "Die Zeit die es braucht für ein Spielers Radgoll zu verfallen (Sekunden).";
CW_GERMAN["BannedDisconnectMessage"] = "Banned Disconnect Message";
CW_GERMAN["BannedDisconnectMessageDesc"] = "Die Nachricht das ein Spieler erhält wenn er versucht sich mit dem Server zu verbinden währen er gebannt ist.\n!t für die Zeit die übrig bleibt, !f für das Zeitformat.";
CW_GERMAN["WagesInterval"] = "Wages Interval";
CW_GERMAN["WagesIntervalDesc"] = "Die Zeit die es braucht den Lohn den Cash zu verteilen (Sekunden).";
CW_GERMAN["PropCostScale"] = "Prop Cost Scale";
CW_GERMAN["PropCostScaleDesc"] = "Wie viel die skalierung für die kosten der Props sein soll.\nSetze auf 0 um Props Gratis zu machen.";
CW_GERMAN["FadeNPCCorpses"] = "Fade NPC Corpses";
CW_GERMAN["FadeNPCCorpsesDesc"] = "Ob Fade dead NPCs aktiviert sein soll oder nichts.";
CW_GERMAN["CashWeight"] = "Cash Gewicht";
CW_GERMAN["CashWeightDesc"] = "Das Gewicht von Cash (Kilogramm)).";
CW_GERMAN["CashSpace"] = "Cash Space";
CW_GERMAN["CashSpaceDesc"] = "Die Menge an Platz das Cash nimmt (Liter).";
CW_GERMAN["HeadDamageScale"] = "Head Damage Scale";
CW_GERMAN["HeadDamageScaleDesc"] = "Die Menge von der Skalierung für die Head Damage.";
CW_GERMAN["BlockInventoryBinds"] = "Block Inventory Binds";
CW_GERMAN["BlockInventoryBindsDesc"] = "Whether or not inventory binds should be blocked for players.";
CW_GERMAN["LimbDamageScale"] = "Limb Damage Scale";
CW_GERMAN["LimbDamageScaleDesc"] = "The amount to scale limb damage by.";
CW_GERMAN["TargetIDDelay"] = "Target ID Delay";
CW_GERMAN["TargetIDDelayDesc"] = "The delay before the Target ID is displayed when looking at an entity.";
CW_GERMAN["HeadbobEnabled"] = "Headbob Enabled";
CW_GERMAN["HeadbobEnabledDesc"] = "Whether or not to enable headbob.";
CW_GERMAN["ChatCommandPrefix"] = "Chat Command Prefix";
CW_GERMAN["ChatCommandPrefixDesc"] = "The prefix that is used for chat commands.";
CW_GERMAN["CrouchWalkSpeed"] = "Crouch Walk Speed";
CW_GERMAN["CrouchWalkSpeedDesc"] = "The speed that characters walk at when crouched.";
CW_GERMAN["MaximumChatLength"] = "Maximum Chat Length";
CW_GERMAN["MaximumChatLengthDesc"] = "The maximum amount of characters that can be typed in chat.";
CW_GERMAN["StartingFlags"] = "Starting Flags";
CW_GERMAN["StartingFlagsDesc"] = "The flags that each player begins with.";
CW_GERMAN["PlayerSprayEnabled"] = "Player Spray Enabled";
CW_GERMAN["PlayerSprayEnabledDesc"] = "Whether players can spray their tags.";
CW_GERMAN["HintInterval"] = "Hint Interval";
CW_GERMAN["HintIntervalDesc"] = "The time that a hint is displayed to each player (seconds).";
CW_GERMAN["OutOfCharacterChatInterval"] = "Out-Of-Character Chat Interval";
CW_GERMAN["OutOfCharacterChatIntervalDesc"] = "The time that a player has to wait to speak out-of-character again (seconds).\nSet to 0 for never.";
CW_GERMAN["MinuteTime"] = "Minute Time";
CW_GERMAN["MinuteTimeDesc"] = "The time that it takes for a minute to pass (seconds).";
CW_GERMAN["DoorUnlockInterval"] = "Door Unlock Interval";
CW_GERMAN["DoorUnlockIntervalDesc"] = "The time that a player has to wait to unlock a door (seconds).";
CW_GERMAN["VoiceChatEnabled"] = "Voice Chat Enabled.";
CW_GERMAN["VoiceChatEnabledDesc"] = "Whether or not voice chat is enabled.";
CW_GERMAN["LocalVoiceChat"] = "Local Voice Chat";
CW_GERMAN["LocalVoiceChatDesc"] = "Whether or not to enable local voice.";
CW_GERMAN["TalkRadius"] = "Talk Radius";
CW_GERMAN["TalkRadiusDesc"] = "The radius of each player that other characters have to be in to hear them talk (units).";
CW_GERMAN["GiveHands"] = "Give Hands";
CW_GERMAN["GiveHandsDesc"] = "Whether or not to give hands to each player.";
CW_GERMAN["CustomWeaponColor"] = "Custom Weapon Color";
CW_GERMAN["CustomWeaponColorDesc"] = "Whether or not to enable custom weapon colors.";
CW_GERMAN["GiveKeys"] = "Give Keys";
CW_GERMAN["GiveKeysDesc"] = "Whether or not to give keys to each player.";
CW_GERMAN["WagesName"] = "Wages Name";
CW_GERMAN["WagesNameDesc"] = "The name that is given to wages.";
CW_GERMAN["JumpPower"] = "Jump Power";
CW_GERMAN["JumpPowerDesc"] = "The power that characters jump at.";
CW_GERMAN["RespawnDelay"] = "Respawn Delay";
CW_GERMAN["RespawnDelayDesc"] = "The time that a player has to wait before they can spawn again (seconds).";
CW_GERMAN["MaximumWalkSpeed"] = "Maximum Walk Speed";
CW_GERMAN["MaximumWalkSpeedDesc"] = "The speed that characters walk at.";
CW_GERMAN["MaximumRunSpeed"] = "Maximum Run Speed";
CW_GERMAN["MaximumRunSpeedDesc"] = "The speed that characters run at.";
CW_GERMAN["DoorPrice"] = "Door Price";
CW_GERMAN["DoorPriceDesc"] = "The amount of cash that each door costs.";
CW_GERMAN["DoorLockInterval"] = "Door Lock Interval";
CW_GERMAN["DoorLockIntervalDesc"] = "The time that a player has to wait to lock a door (seconds).";
CW_GERMAN["MaximumOwnableDoors"] = "Maximum Ownable Doors";
CW_GERMAN["MaximumOwnableDoorsDesc"] = "The maximum amount of doors a player can own.";
CW_GERMAN["EnableSpaceSystem"] = "Enable Space System";
CW_GERMAN["EnableSpaceSystemDesc"] = "Whether or not to use the space system that affects inventories.";
CW_GERMAN["DrawIntroBars"] = "Draw Intro Bars";
CW_GERMAN["DrawIntroBarsDesc"] = "Whether or not to draw cinematic intro black bars on top and bottom of the screen.";
CW_GERMAN["EnableJogging"] = "Enable Jogging";
CW_GERMAN["EnableJoggingDesc"] = "Whether or not to enable jogging.";
CW_GERMAN["EnableLOOCIcons"] = "Enable LOOC Icons";
CW_GERMAN["EnableLOOCIconsDesc"] = "Whether or not to enable LOOC chat icons.";
CW_GERMAN["ShowBusinessMenu"] = "Show Business Menu";
CW_GERMAN["ShowBusinessMenuDesc"] = "Whether or not to show the business menu.";
CW_GERMAN["EnableChatMultiplier"] = "Enable Chat Multiplier";
CW_GERMAN["EnableChatMultiplierDesc"] = "Whether or not to change text size based on types of chat.";
CW_GERMAN["SteamAPIKey"] = "Steam API Key";
CW_GERMAN["SteamAPIKeyDesc"] = "Some non-essential features may require the usage of the Steam API.\nhttp://steamcommunity.com/dev/apikey";
CW_GERMAN["EnableMapPropsPhysgrab"] = "Enable Map Props Physgrab";
CW_GERMAN["EnableMapPropsPhysgrabDesc"] = "Whether or not players will be able to grab map props and doors with physguns.";
CW_GERMAN["EntityUseCooldown"] = "Entity Use Cooldown";
CW_GERMAN["EntityUseCooldownDesc"] = "The amount of time between entity uses a player has to wait.";
CW_GERMAN["EnableQuickRaise"] = "Enable Quick Raise";
CW_GERMAN["EnableQuickRaiseDesc"] = "Whether or not players can use quick raising to raise their weapons.";
CW_GERMAN["PlayersChangeThemes"] = "Players Change Themes";
CW_GERMAN["PlayersChangeThemesDesc"] = "Whether or not players can switch between available themes.";
CW_GERMAN["DefaultTheme"] = "Default Theme";
CW_GERMAN["DefaultThemeDesc"] = "The default theme that players will start with.";
CW_GERMAN["EnableDiseases"] = "Enable Diseases";
CW_GERMAN["EnableDiseasesDesc"] = "Whether or not you want use of the disease library to be enabled.";
CW_GERMAN["DiseaseInterval"] = "Disease Interval";
CW_GERMAN["DiseaseIntervalDesc"] = "The number of seconds between each run of the symptom function.";
CW_GERMAN["EnableIronsights"] = "Enable Ironsights";
CW_GERMAN["EnableIronsightsDesc"] = "Whether or not players can use ironsights on their weapons when available.";
CW_GERMAN["IronsightsSpreadReduction"] = "Ironsights Spread Reduction";
CW_GERMAN["IronsightsSpreadReductionDesc"] = "The amount that ironsights will reduce bullet spread by.";
CW_GERMAN["IronsightsSlowAmount"] = "Ironsights Slow Amount";
CW_GERMAN["IronsightsSlowAmountDesc"] = "The amount that using ironsights will decrease a player's movement speed by.";
CW_GERMAN["CraftingDescription"] = "Crafting Description";
CW_GERMAN["CraftingDescriptionDesc"] = "The description of what the crafting menu does.";
CW_GERMAN["CraftingEnabled"] = "Crafting Enabled";
CW_GERMAN["CraftingEnabledDesc"] = "Whether or not the crafting menu is enabled.";
CW_GERMAN["CraftingName"] = "Crafting Name";
CW_GERMAN["CraftingNameDesc"] = "The name of the button to open the crafting menu.";
CW_GERMAN["MaxCharName"] = "Character Name Limit";
CW_GERMAN["MaxCharNameDesc"] = "The maximum amount of characters someone can use in their name.";
CW_GERMAN["HintOOC"] = "Type // before your message to talk out-of-character.";
CW_GERMAN["HintLOOC"] = "Type .// or [[before your message to talk out-of-character locally.";
CW_GERMAN["HintDucking"] = "Toggle ducking by holding :+speed: and pressing :+walk: while standing still.";
CW_GERMAN["HintJogging"] = "Toggle jogging by pressing :+walk: while moving.";
CW_GERMAN["HintDirectory"] = "Halte down :+showscores: und klicke *name_directory* um Hilfe zu bekommen.";
CW_GERMAN["HintHotkeyF1"] = "Halte :gm_showhelp: to view your character and roleplay information.";
CW_GERMAN["HintHotkeyF2"] = "Drücke :gm_showteam: while looking at a door to view the door menu.";
CW_GERMAN["HintHotkeyTab"] = "Drücke :+showscores: to view the main menu, or hold :+showscores: to temporarily view it.";
CW_GERMAN["HintContextMenu"] = "Halte :+menu_context: and click on an entity to open its menu.";
CW_GERMAN["HintEntityMenu"] = "Drücle :+use: on an entity to open its menu.";
CW_GERMAN["HintPhysDesc"] = "Change your character's physical description by typing $command_prefix$CharPhysDesc.";
CW_GERMAN["HintGiveName"] = "Drücke :gm_showteam: to allow characters within a specific range to recognise you.";
CW_GERMAN["HintTargetRecognises"] = "A character's name will flash white if they do not recognise you.";
CW_GERMAN["YouHaveNotCompletedThe"] = "Du hast nicht die #3 abgeschlossen!";
CW_GERMAN["MenuQuizTitle"] = "Beitrits Prüfung";
CW_GERMAN["MenuQuizHelp"] = "If any answers are incorrect, you may be kicked from the server.";
CW_GERMAN["MenuDisconnect"] = "TRENNEN";
CW_GERMAN["MenuContinue"] = "FORTFAHREN";
CW_GERMAN["InteractWithThisEntity"] = "INTERAGIEREN...";
CW_GERMAN["DevelopedBy"] = "ENTWICKELT VON #1";
CW_GERMAN["Female"] = "Weiblich";
CW_GERMAN["Male"] = "Männlich";
CW_GERMAN["AttributeBoost"] = "+#1 (Boosted)";
CW_GERMAN["AttributeHinder"] = "-#1 (Hindered)";
CW_GERMAN["YouReachedMaxOfAttribute"] = "You have reached the maximum of this #1!";
CW_GERMAN["Attributes"] = "Attribute";
CW_GERMAN["YouWillRespawnSoon"] = "You will be respawned shortly";
CW_GERMAN["EntityBeingLocked"] = "You are locking it";
CW_GERMAN["EntityBeingUnlocked"] = "You are unlocking it";
CW_GERMAN["YouAreGainingStability"] = "Du bist am aufstehen";
CW_GERMAN["YouAreGainingConciousness"] = "You are gaining conciousness";
CW_GERMAN["PressJumpToGetUp"] = "Drücke 'jump' um aufzustehen";
CW_GERMAN["ChatPlayerNotifyAll"] = ":color1:#1";
CW_GERMAN["ChatPlayerNotify"] = ":color1:#1";
CW_GERMAN["ChatPlayerLocalEvent"] = ":color1:(LOCAL) #1";
CW_GERMAN["ChatPlayerConnect"] = ":color1:#1";
CW_GERMAN["ChatPlayerChat"] = ":color1:#1: #2";
CW_GERMAN["ChatPlayerDisconnect"] = ":color1:#1";
CW_GERMAN["ChatPlayerEvent"] = ":color1:#1";
CW_GERMAN["ChatPlayerPM"] = "[PM] :color1:#1: #2";
CW_GERMAN["ChatPlayerPriv"] = ":color1:@#1 :color2:#2: #3";
CW_GERMAN["ChatPlayerLOOC"] = ":color1:[LOOC] :color2:#1: #2";
CW_GERMAN["ChatPlayerItL"] = ":color1:*****' #1";
CW_GERMAN["ChatPlayerIt"] = ":color1:***' #1";
CW_GERMAN["ChatPlayerMeL"] = ":color1:***** #1 #2";
CW_GERMAN["ChatPlayerMeC"] = ":color1:* #1 #2";
CW_GERMAN["ChatPlayerMe"] = ":color1:*** #1 #2";
CW_GERMAN["ChatPlayerSays"] = ":color1:#1 says \"#2\"";
CW_GERMAN["ChatPlayerRoll"] = ":color1:** #1 #2";
CW_GERMAN["ChatPlayerOOC"] = ":color1:[OOC] :color2:#1: :color0:#2";
CW_GERMAN["ChatPlayerWhispers"] = ":color1:#1 flüstert \"#2\"";
CW_GERMAN["ChatPlayerRadios"] = ":color1:#1 funkt \"#2\"";
CW_GERMAN["ChatPlayerYells"] = ":color1:#1 schreit \"#2\"";
CW_GERMAN["PlayerConnected"] = "#1 hat den Server beigetreten.";
CW_GERMAN["PlayerDisconnected"] = "#1 hat die Verbindung getrennt.";
CW_GERMAN["LogPlayerDisconnected"] = "#1 (#2/#3) hat die Verbindung getrennt.";
CW_GERMAN["LogPlayerConnected"] = "#1 (#2/#3) hat den Server beigetreten.";
CW_GERMAN["LogPlayerSpawnedModel"] = "#1 hat '#2' gespawnt.";
CW_GERMAN["LogPlayerSaysLOOC"] = "[LOOC] #1: #2";
CW_GERMAN["LogPlayerSays"] = "#1 says \"#2\"";
CW_GERMAN["LogPlayerDealDamageWithKill"] = "#1 has dealt #2 damage to #3 with #4, killing them!";
CW_GERMAN["LogPlayerDealDamageKill"] = "#1 has dealt #2 damage to #3, killing them!";
CW_GERMAN["LogPlayerTakeDamageWith"] = "#1 has taken #2 damage from #3 with #4, leaving them at #5 health and #6 armor!";
CW_GERMAN["LogPlayerTakeDamage"] = "#1 has taken #2 damage from #3, leaving them at #4 health and #5 armor!";
CW_GERMAN["LogPlayerGainedItem"] = "#1 has gained a #2 #3.";
CW_GERMAN["LogPlayerLostItem"] = "#1 has lost a #2 #3.";
CW_GERMAN["LogPlayerOrdered"] = "#1 has ordered #1 #2.";
CW_GERMAN["LogPlayerDeletedChar"] = "#1 has deleted the character '#2'.";
CW_GERMAN["LogPlayerLoadedChar"] = "#1 has loaded the character '#2'.";
CW_GERMAN["LogPlayerUsedCommandArgs"] = "#1 has used '#2 #3'.";
CW_GERMAN["LogPlayerUsedCommand"] = "#1 has used '#2'.";
CW_GERMAN["LogPlayerRoll"] = "#1 hat eine #2 gerollt von #3.";
CW_GERMAN["PlayerRoll"] = "hat eine #1 gerollt von #2!";
CW_GERMAN["FaultDidNotChooseTraits"] = "You did not choose any of the available #1!";
CW_GERMAN["YouCannotCreateThisChar"] = "You cannot create this character!";
CW_GERMAN["MenuNameTraits"] = "Traits";
CW_GERMAN["MenuNameTrait"] = "Trait";
CW_GERMAN["LogPlayerCreateChar"] = "#1 has created a #2 character called '#3'."
CW_GERMAN["ItemInfoIsWearingYes"] = "Is Wearing: Yes";
CW_GERMAN["ItemInfoIsWearingNo"] = "Is Wearing: No";
CW_GERMAN["ItemInfoClipOne"] = "Clip One: #1";
CW_GERMAN["ItemInfoClipTwo"] = "Clip Two: #1";
CW_GERMAN["CashSellDoor"] = "selling a door";
CW_GERMAN["CashPropRefund"] = "prop refund";
CW_GERMAN["CashDroppingCash"] = "dropping #1";
CW_GERMAN["YourCharLostCashReason"] = "Your character has lost #1 (#2).";
CW_GERMAN["YourCharLostCash"] = "Your character has lost #1.";
CW_GERMAN["YourCharGainedCashReason"] = "Your character has gained #1 (#2).";
CW_GERMAN["YourCharGainedCash"] = "Your character has gained #1.";
CW_GERMAN["CharacterMenuTraits"] = "Traits";
CW_GERMAN["CreateCharacterStage5"] = "Traits";
CW_GERMAN["MaxTraitPoints"] = "Max Traits";
CW_GERMAN["MaxTraitPointsDesc"] = "The maximum amount of traits each character can have.";
CW_GERMAN["TraitPointsGain"] = "Points: +#1";
CW_GERMAN["TraitPointsLoss"] = "Points: -#1";
CW_GERMAN["CharacterMenuModelHelp"] = "Select an appropriate model for your character.";
CW_GERMAN["RequestFromMsg"] = "[REQUEST] #1: #2";
CW_GERMAN["ConsoleUser"] = "Console";
CW_GERMAN["AmountOfThing"] = "#1x #2";
CW_GERMAN["Shipment"] = "Shipment";
CW_GERMAN["CharNoDetailsToDisplay"] = "This character has no details to display.";
CW_GERMAN["CharTooltipDetailsTitle"] = "Details";
CW_GERMAN["HelpCommands"] = "Befehle";
CW_GERMAN["HelpPlugins"] = "Plugins";
CW_GERMAN["HelpFlags"] = "Flags";
CW_GERMAN["HelpCredits"] = "Mitwirkende";
CW_GERMAN["HelpClockwork"] = "Clockwork";
CW_GERMAN["HelpSelectCategory"] = "Wähle eine Kategorie";
CW_GERMAN["HelpPrivsMessage"] = "Some categories may only be available to users with special priviledges.";
CW_GERMAN["HelpTipClockwork"] = "Contains topics about the Clockwork framework.";
CW_GERMAN["HelpTipCommands"] = "Contains a list of commands and their syntax.";
CW_GERMAN["HelpFlagValue"] = "Flag";
CW_GERMAN["HelpFlagDetails"] = "Details";
CW_GERMAN["MenuNamePluginCenter"] = "Plugin Center";
CW_GERMAN["MenuDescPluginCenter"] = "Browse and Subscribe to Clockwork plugins for your server.";
CW_GERMAN["MenuNameCommunity"] = "Community";
CW_GERMAN["MenuDescCommunity"] = "Browse the official Clockwork forums and community.";
CW_GERMAN["LimbStatus"] = "#1: #2%";
CW_GERMAN["LimbRightArm"] = "Rechter Arm";
CW_GERMAN["LimbRightLeg"] = "Rechter Bein";
CW_GERMAN["LimbLeftArm"] = "Linker Arm";
CW_GERMAN["LimbLeftLeg"] = "Linker Bein";
CW_GERMAN["LimbStomach"] = "Magen";
CW_GERMAN["LimbChest"] = "Brust";
CW_GERMAN["LimbHead"] = "Kopf";
CW_GERMAN["ConfigNoHelpProvided"] = "Keine Informationen wurde für diese Config bereitgestellt!";
CW_GERMAN["ConfigClockworkCategory"] = "Clockwork";
CW_GERMAN["HelpBugsIssues"] = "Bugs/Probleme";
CW_GERMAN["HelpCloudSixteen"] = "Cloud Sixteen";
CW_GERMAN["HelpUpdates"] = "Cloud Sixteen";
CW_GERMAN["HelpCredits"] = "Mitwirkende";
CW_GERMAN["SystemPluginsHelpText"] = "Red plugins are unloaded, green ones are loaded and orange are disabled.";
CW_GERMAN["SystemPluginsNoneInstalled"] = "There are no plugins installed on your server.";
CW_GERMAN["SystemColorModHelpText"] = "Changing these values will affect the color for all players.";
CW_GERMAN["SystemColorModAdvOnly"] = "Please note that this is for advanced users only.";
CW_GERMAN["InvalidPluginAuthor"] = "Ungültiger Author Name";
CW_GERMAN["Color"] = "Farbe";
CW_GERMAN["ChatPlayerItC"] = ":color1:*' #1";
CW_GERMAN["StorageTransfer"] = "Transferieren";
CW_GERMAN["CraftErrorNotAllowed"] = "You do not have the required access to this!";
CW_GERMAN["YouCannotAffordToDoThat"] = "You cannot afford to do that!";
CW_GERMAN["MissingItemRequirements"] = "You are missing some requirements!";
CW_GERMAN["HintRaiseWeapon"] = "Halte :+reload: um deine Waffe zu erhöhern oder zu senken.";
CW_GERMAN["Equip"] = "Ausrüsten";
CW_GERMAN["Holster"] = "Holstern";
CW_GERMAN["Drink"] = "Trinken";
CW_GERMAN["CmdA"] = "Send a private message to all staff.";
CW_GERMAN["CmdADesc"] = "<string Msg>";
CW_GERMAN["CmdAnnounce"] = "Announce something to all players.";
CW_GERMAN["CmdAnnounceDesc"] = "<string Text>";
CW_GERMAN["CmdARequest"] = "Send a request to all online staff.";
CW_GERMAN["CmdARequestDesc"] = "<string Text>";
CW_GERMAN["CmdCfgListVars"] = "List the Clockwork config variables.";
CW_GERMAN["CmdCfgListVarsDesc"] = "[string Find]";
CW_GERMAN["CmdCfgSetVar"] = "Set a Clockwork config variable.";
CW_GERMAN["CmdCfgSetVarDesc"] = "<string Key> [all Value] [string Map]";
CW_GERMAN["CmdCharBan"] = "Ban a character from being used.";
CW_GERMAN["CmdCharBanDesc"] = "<string Name>";
CW_GERMAN["CmdCharCheckFlags"] = "Checks a character's flags.";
CW_GERMAN["CmdCharCheckFlagsDesc"] = "<string Name>";
CW_GERMAN["CmdCharFallOver"] = "Make your character fall to the floor.";
CW_GERMAN["CmdCharFallOverDesc"] = "[number Seconds]";
CW_GERMAN["CmdCharGetUp"] = "Get your character up from the floor.";
CW_GERMAN["CmdCharGiveFlags"] = "Give flags to a character.";
CW_GERMAN["CmdCharGiveFlagsDesc"] = "<string Name> <string Flag(s)>";
CW_GERMAN["CmdCharGiveItem"] = "Give an item to a character.";
CW_GERMAN["CmdCharGiveItemDesc"] = "<string Name> <string Item> [number Amount]";
CW_GERMAN["CmdCharPhysDesc"] = "Change your character's physical description.";
CW_GERMAN["CmdCharPhysDescDesc"] = "[string Text]";
CW_GERMAN["CmdCharSetDesc"] = "Set a character's description permanently.";
CW_GERMAN["CmdCharSetDescDesc"] = "<string Name> <string Description>";
CW_GERMAN["CmdCharSetFlags"] = "Set a character's flags.";
CW_GERMAN["CmdCharSetFlagsDesc"] = "<string Name> <string Flag(s)>";
CW_GERMAN["CmdCharSetModel"] = "Set a character's model permanently.";
CW_GERMAN["CmdCharSetModelDesc"] = "<string Name> <string Model>";
CW_GERMAN["CmdCharSetName"] = "Set a character's name permanently.";
CW_GERMAN["CmdCharSetNameDesc"] = "<string Name> <string Name>";
CW_GERMAN["CmdCharTakeFlags"] = "Take flags from a character.";
CW_GERMAN["CmdCharTakeFlagsDesc"] = "<string Name> <string Flag(s)>";
CW_GERMAN["CmdCharTransfer"] = "Transfer a character to a faction.";
CW_GERMAN["CmdCharTransferDesc"] = "<string Name> <string Faction> [string Data]";
CW_GERMAN["CmdCharUnban"] = "Unban a character from being used.";
CW_GERMAN["CmdCharUnbanDesc"] = "<string Name>";
CW_GERMAN["CmdCraftBlueprint"] = "Craft an item.";
CW_GERMAN["CmdCraftBlueprintDesc"] = "<string UniqueID>";
CW_GERMAN["CmdDropCash"] = "Drop cash at your target position.";
CW_GERMAN["CmdDropCashDesc"] = "<number Amount>";
CW_GERMAN["CmdDropWeapon"] = "Drop your weapon at your target position.";
CW_GERMAN["CmdEvent"] = "Send an event to all characters.";
CW_GERMAN["CmdEventDesc"] = "<string Text>";
CW_GERMAN["CmdEventLocal"] = "Send an event to characters around you.";
CW_GERMAN["CmdEventLocalDesc"] = "<string Text>";
CW_GERMAN["CmdGiveCash"] = "Give cash to the target character.";
CW_GERMAN["CmdGiveCashDesc"] = "<number Amount>";
CW_GERMAN["CmdInvAction"] = "Run an inventory action on an item.";
CW_GERMAN["CmdInvActionDesc"] = "<string Action> <string UniqueID> [string ItemID]";
CW_GERMAN["CmdIt"] = "Describe a local action or event.";
CW_GERMAN["CmdItDesc"] = "<string Text>";
CW_GERMAN["CmdItC"] = "Describe a close-range local action or event.";
CW_GERMAN["CmdItCDesc"] = "<string Text>";
CW_GERMAN["CmdItL"] = "Describe a long-range local action or event.";
CW_GERMAN["CmdItLDesc"] = "<string Text>";
CW_GERMAN["CmdMapChange"] = "Change the current map.";
CW_GERMAN["CmdMapChangeDesc"] = "<string Map> [number Delay]";
CW_GERMAN["CmdMapRestart"] = "Restart the current map.";
CW_GERMAN["CmdMapRestartDesc"] = "[number Delay]";
CW_GERMAN["CmdMe"] = "Speak in third person to others around you.";
CW_GERMAN["CmdMeDesc"] = "<string Text>";
CW_GERMAN["CmdMeC"] = "Speak in third person to others CLOSE around you.";
CW_GERMAN["CmdMeCDesc"] = "<string Text>";
CW_GERMAN["CmdMeL"] = "Speak in third person to others in a large area around you.";
CW_GERMAN["CmdMeLDesc"] = "<string Text>";
CW_GERMAN["CmdOrderShipment"] = "Order an item shipment at your target position.";
CW_GERMAN["CmdOrderShipmentDesc"] = "<string UniqueID>";
CW_GERMAN["CmdPluginLoad"] = "Attempt to load a plugin.";
CW_GERMAN["CmdPluginLoadDesc"] = "<string Name>";
CW_GERMAN["CmdPluginUnload"] = "Attempt to unload a plugin.";
CW_GERMAN["CmdPluginUnloadDesc"] = "<string Name>";
CW_GERMAN["CmdPlyBan"] = "Ban a player from the server.";
CW_GERMAN["CmdPlyBanDesc"] = "<string Name|SteamID|IPAddress> <number Minutes> [string Reason]";
CW_GERMAN["CmdPlyBring"] = "Bring a player to your crosshair position.";
CW_GERMAN["CmdPlyBringDesc"] = "<string Target> <bool IsSilent>";
CW_GERMAN["CmdPlyDemote"] = "Demote a player from their user group.";
CW_GERMAN["CmdPlyDemoteDesc"] = "<string Name>";
CW_GERMAN["CmdPlyGiveFlags"] = "Give flags to a player.";
CW_GERMAN["CmdPlyGiveFlagsDesc"] = "<string Name> <string Flag(s)>";
CW_GERMAN["CmdPlyGoTo"] = "Goto a player's location.";
CW_GERMAN["CmdPlyGoToDesc"] = "<string Name>";
CW_GERMAN["CmdPlyKick"] = "Kick a player from the server.";
CW_GERMAN["CmdPlyKickDesc"] = "<string Name> <string Reason>";
CW_GERMAN["CmdPlyRespawnStay"] = "Respawn a player at their position of death.";
CW_GERMAN["CmdPlyRespawnStayDesc"] = "<string Target>";
CW_GERMAN["CmdPlyRespawnTP"] = "Respawn a player and teleport them to your target location.";
CW_GERMAN["CmdPlyRespawnTPDesc"] = "<string Target> <bool IsSilent>";
CW_GERMAN["CmdPlySearch"] = "Search a players inventory.";
CW_GERMAN["CmdPlySearchDesc"] = "<string Name>";
CW_GERMAN["CmdPlySetFlags"] = "Set a player's flags.";
CW_GERMAN["CmdPlySetFlagsDesc"] = "<string Name> <string Flag(s)>";
CW_GERMAN["CmdPlySetGroup"] = "Set a player's user group.";
CW_GERMAN["CmdPlySetGroupDesc"] = "<string Name> <string UserGroup>";
CW_GERMAN["CmdPlySetHealth"] = "Set a player's health.";
CW_GERMAN["CmdPlySetHealthDesc"] = "<string Target> <number HP>";
CW_GERMAN["CmdPlySlay"] = "Slay another player.";
CW_GERMAN["CmdPlySlayDesc"] = "<string Target> <bool IsSilent>";
CW_GERMAN["CmdPlyTakeFlags"] = "Take flags from a player.";
CW_GERMAN["CmdPlyTakeFlagsDesc"] = "<string Name> <string Flag(s)>";
CW_GERMAN["CmdPlyTeleport"] = "Teleport a player to your target location.";
CW_GERMAN["CmdPlyTeleportDesc"] = "<string Name>";
CW_GERMAN["CmdPlyTeleportTo"] = "Teleport a player to another player.";
CW_GERMAN["CmdPlyTeleportToDesc"] = "<string Target> <string Other> <bool IsSilent>";
CW_GERMAN["CmdPlyUnban"] = "Unban a Steam ID from the server.";
CW_GERMAN["CmdPlyUnbanDesc"] = "<string SteamID|IPAddress>";
CW_GERMAN["CmdPlyUnwhitelist"] = "Remove a player from a whitelist.";
CW_GERMAN["CmdPlyUnwhitelistDesc"] = "<string Name> <string Faction>";
CW_GERMAN["CmdPlyVoiceBan"] = "Ban a player from using voice chat.";
CW_GERMAN["CmdPlyVoiceBanDesc"] = "<string Name|SteamID|IPAddress>";
CW_GERMAN["CmdPlyVoiceUnban"] = "Ban a player from using voice chat.";
CW_GERMAN["CmdPlyVoiceUnbanDesc"] = "<string Name|SteamID|IPAddress>";
CW_GERMAN["CmdPlyWhitelist"] = "Add a player to a whitelist.";
CW_GERMAN["CmdPlyWhitelistDesc"] = "<string Name> <string Faction>";
CW_GERMAN["CmdPM"] = "Send a private message to a player.";
CW_GERMAN["CmdPMDesc"] = "<string Name> <string Text>";
CW_GERMAN["CmdRadio"] = "Send a radio message out to other characters.";
CW_GERMAN["CmdRadioDesc"] = "<string Text>";
CW_GERMAN["CmdRankDemote"] = "Demote someone to the next rank down.";
CW_GERMAN["CmdRankDemoteDesc"] = "<string Name> [bool IsForced]";
CW_GERMAN["CmdRankPromote"] = "Promote someone to the next rank up.";
CW_GERMAN["CmdRankPromoteDesc"] = "<string Name> [bool IsForced]";
CW_GERMAN["CmdRoll"] = "Roll a number between 0 and the specified number.";
CW_GERMAN["CmdRollDesc"] = "[number Range]";
CW_GERMAN["CmdSetCash"] = "Set a character's cash.";
CW_GERMAN["CmdSetCashDesc"] = "<string Name> <number Amount>";
CW_GERMAN["CmdSetClass"] = "Set the class of your character.";
CW_GERMAN["CmdSetClassDesc"] = "<string Class>";
CW_GERMAN["CmdSetVoicemail"] = "Set your personal message voicemail.";
CW_GERMAN["CmdSetVoicemailDesc"] = "[string Text]";
CW_GERMAN["CmdStorageClose"] = "Close the active storage.";
CW_GERMAN["CmdStorageGiveCash"] = "Give some cash to storage.";
CW_GERMAN["CmdStorageGiveCashDesc"] = "<number Amount>";
CW_GERMAN["CmdStorageGiveItem"] = "Give an item to storage.";
CW_GERMAN["CmdStorageGiveItemDesc"] = "<string UniqueID> <string ItemID>";
CW_GERMAN["CmdStorageTakeCash"] = "Take some cash from storage.";
CW_GERMAN["CmdStorageTakeCashDesc"] = "<number Amount>";
CW_GERMAN["CmdStorageTakeItem"] = "Take an item from storage.";
CW_GERMAN["CmdStorageTakeItemDesc"] = "<string uniqueID> <string ItemID>";
CW_GERMAN["CmdSu"] = "Send a private message to all superadmins.";
CW_GERMAN["CmdSuDesc"] = "<string Msg>";
CW_GERMAN["CmdTranslate"] = "Translate given text to the specified language and print it in chat.";
CW_GERMAN["CmdTranslateDesc"] = "<string Source> <string Language> <string Text>";
CW_GERMAN["CmdW"] = "Whisper to characters near you.";
CW_GERMAN["CmdWDesc"] = "<string Text>";
CW_GERMAN["CmdY"] = "Yell to characters near you.";
CW_GERMAN["CmdYDesc"] = "<string Text>";
CW_GERMAN["PlayerInfoCash"] = "Cash: %1";
CW_GERMAN["PlayerInfoWages"] = "Wages: %1";
CW_GERMAN["PlayerInfoName"] = "%1";
CW_GERMAN["PlayerInfoClass"] = "%1";
CW_GERMAN["CashAmountSingular"] = "$%1";
CW_GERMAN["CashAmount"] = "%1 Cash";
CW_GERMAN["Cash"] = "Cash";
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.