content
stringlengths 5
1.05M
|
|---|
PLUGIN.name = "Business Block"
PLUGIN.desc = "Turns off business for EVERYONE"
PLUGIN.license = "MIT not for use on Kaktusownia opensource.org/licenses/MIT"
function PLUGIN:CanPlayerUseBusiness()
return false
end
|
g = ECP.G() -- get the curve's generator coordinates
h = g * 2 -- hashtopoint "h0"
h1 = g * 20 -- hashtopoint "h1"
order = ECP.order() -- get the curves order in a big
rng = RNG.new()
H = HASH.new('sha256')
local DATA_TABLE = JSON.decode(DATA)
local KEYS_TABLE = JSON.decode(KEYS)
function readBig(str)
return BIG.new(hex(str))
end
function readEcp(table)
local x = readBig(table['x'])
local y = readBig(table['y'])
return ECP.new(x, y)
end
function writeEcp(ecp)
ecp = ecp:affine()
local x = ecp:x()
local y = ecp:y()
return { x = tostring(x), y = tostring(y) }
end
-- Concatenates everything and hashes it
function to_challenge(list)
local c = ""
for i = 1, #list do
c = c .. tostring(list[i])
end
local hash = H:process(str(c))
return BIG.new(hash)
end
-- Creates a ZKP that (a,b) encrypts a value of 0
function provezero(a, b)
local wx = rng:big()
local Aw = a * wx
local Bw = g * wx
local c = to_challenge({g, h, public, a, b, Aw, Bw})
local rx = (wx - c:modmul(private, order)) % order
return c, rx
end
function generateLookupTable(max)
table = {}
for i = 0, max do
local point = h * BIG.new(i)
local s = tostring(point:x()) .. tostring(point:y())
table[s] = i
end
return table
end
function lookup(point, lookupTable)
if point:isinf() then -- TODO: check NOT 100% sure
return 0
end
point = point:affine()
local s = tostring(point:x()) .. tostring(point:y())
return lookupTable[s]
end
function decrypt(a, b)
x = (a * private):negative()
y = b + x
return y
end
lookupTable = generateLookupTable(100)
-- Load public data
public = readEcp(DATA_TABLE["public"])
private = readBig(KEYS_TABLE["private"])
scores = DATA_TABLE['scores']
scores = LAMBDA.map(scores, function(k,v)
a = readEcp(v['a'])
b = readEcp(v['b'])
return { a = a, b = b}
end)
-- decrypt the scores, now we have h*num_votes
outcome = LAMBDA.map(scores, function(k,v) return decrypt(v['a'], v['b']) end)
-- Lookup on the table for the exact num of votes
outcome = LAMBDA.map(outcome, function(k,v) return lookup(v, lookupTable) end)
proof = LAMBDA.map(outcome, function(i,v)
a = scores[i]['a']
b = scores[i]['b']
num_votes = BIG.new(v)
b = b + (h * num_votes):negative()
c, rx = provezero(a, b)
return { c = tostring(c) , rx = tostring(rx) }
end)
scores = LAMBDA.map(scores, function(k,v) return { a = writeEcp(v['a']), b = writeEcp(v['b'])} end)
export = JSON.encode(
{
outcome = outcome,
proof = proof,
scores = scores,
public = writeEcp(public)
}
)
print(export)
|
#include "datascripts/inputList.lua"
#include "datascripts/color4.lua"
#include "scripts/ui.lua"
#include "scripts/textbox.lua"
#include "scripts/utils.lua"
binds = {
New_Thrusters_Forwards_Key = "h",
New_Thrusters_Backwards_Key = "n",
Delete_All_Thrusters = "p",
Delete_Last_Thruster = "z",
New_Thruster_Power_Up = "+",
New_Thruster_Power_Down = "-",
New_Thruster_Toggle = "g",
Open_Menu = "m", -- Only one that can't be changed!
}
local bindBackup = deepcopy(binds)
local bindOrder = {
"New_Thrusters_Forwards_Key",
"New_Thrusters_Backwards_Key",
"New_Thruster_Power_Up",
"New_Thruster_Power_Down",
"New_Thruster_Toggle",
"Delete_All_Thrusters",
"Delete_Last_Thruster",
}
local bindNames = {
New_Thrusters_Forwards_Key = "New Thrusters Forwards Key",
New_Thrusters_Backwards_Key = "New Thrusters Backwards Key",
Delete_All_Thrusters = "Delete All Thrusters",
Delete_Last_Thruster = "Delete Last Thruster",
New_Thruster_Power_Up = "New Thruster Power Up",
New_Thruster_Power_Down = "New Thruster Power Down",
New_Thruster_Toggle = "New Thruster Toggle",
Open_Menu = "Open Menu",
}
local menuOpened = false
local rebinding = nil
local erasingBinds = 0
local menuWidth = 0.25
local menuHeight = 0.6
local powerTextBox = nil
local changelogText = "Keys can now be rebound.\n" ..
"(Currently not saved cross session.)\n\n" ..
"Made editing thruster power easier using this menu.\n" ..
"Old plus and minus buttons will remain an option too.\n\n"..
"Fix textboxes breaking the mod."
function menu_init()
end
function menu_tick(dt)
if InputPressed(binds["Open_Menu"]) and GetString("game.player.tool") == "nlthrustertool" then
menuOpened = not menuOpened
if not menuOpened then
rebinding = nil
erasingBinds = 0
thrusterClass.power = tonumber(powerTextBox.value)
end
end
if rebinding ~= nil then
local lastKeyPressed = getKeyPressed()
if lastKeyPressed ~= nil then
binds[rebinding] = lastKeyPressed
rebinding = nil
end
end
textboxClass_tick()
if erasingBinds > 0 then
erasingBinds = erasingBinds - dt
end
end
function menu_draw(dt)
local textBox01, newBox01 = textboxClass_getTextBox(1)
if newBox01 then
textBox01.name = "New Thruster Strength"
textBox01.value = thrusterClass.power .. ""
textBox01.numbersOnly = true
textBox01.limitsActive = true
textBox01.numberMin = 1
textBox01.numberMax = 10000000
powerTextBox = textBox01
end
if powerTextBox == nil and textBox01 ~= nil then
powerTextBox = textBox01
end
if not isMenuOpen() then
return
end
UiMakeInteractive()
if changelogActive then
UiPush()
UiBlur(0.75)
UiAlign("left top")
UiTranslate(UiWidth() * 0.01, UiWidth() * 0.01)
UiImageBox("ui/hud/infobox.png", UiWidth() * 0.15, UiHeight() * 0.4, 10, 10)
UiWordWrap(UiWidth() * 0.15)
UiFont("bold.ttf", 30)
UiTranslate(0, 10)
UiText("Thruster Changelog:")
UiFont("regular.ttf", 26)
UiTranslate(0, 50)
UiText(changelogText)
UiPop()
end
UiPush()
if not changelogActive then
UiBlur(0.75)
end
UiAlign("center middle")
UiTranslate(UiWidth() * 0.5, UiHeight() * 0.5)
UiImageBox("ui/hud/infobox.png", UiWidth() * menuWidth, UiHeight() * menuHeight, 10, 10)
UiWordWrap(UiWidth() * menuWidth)
UiTranslate(0, -UiHeight() * menuWidth)
UiFont("bold.ttf", 48)
UiTranslate(0, 10)
UiText("Thruster Settings")
UiFont("regular.ttf", 26)
UiPush()
UiTranslate(-UiWidth() * (menuWidth / 2), 50)
for i = 1, #bindOrder do
local id = bindOrder[i]
local key = binds[id]
drawRebindable(id, key)
UiTranslate(0, 50)
end
UiPop()
UiTranslate(0, 50 * (#bindOrder + 1))
UiPush()
UiTranslate(100, 0)
textboxClass_render(textBox01)
UiPop()
UiTranslate(0, 50)
UiPush()
UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
local statusText = "Disabled"
if thrusterClass.toggle then
statusText = "Enabled"
end
if UiTextButton("New Thrusters Toggle: " .. statusText , 400, 40) then
thrusterClass.toggle = not thrusterClass.toggle
end
UiTranslate(0, 50)
if erasingBinds > 0 then
UiPush()
c_UiColor(Color4.Red)
if UiTextButton("Are you sure?" , 400, 40) then
binds = deepcopy(bindBackup)
erasingBinds = 0
end
UiPop()
else
if UiTextButton("Reset binds to defaults" , 400, 40) then
erasingBinds = 5
end
end
UiTranslate(-105, 50)
if UiTextButton("Close" , 195, 40) then
menuOpened = false
rebinding = nil
thrusterClass.power = tonumber(powerTextBox.value)
end
UiTranslate(210, 0)
local showText = "Show"
if changelogActive then
showText = "Hide"
end
if UiTextButton(showText .. " changelog" , 195, 40) then
changelogActive = not changelogActive
end
UiPop()
UiPop()
end
function drawRebindable(id, key)
UiPush()
UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
UiTranslate(UiWidth() * menuWidth / 1.5, 0)
UiAlign("right middle")
UiText(bindNames[id] .. "")
UiTranslate(UiWidth() * menuWidth * 0.1, 0)
UiAlign("left middle")
if rebinding == id then
c_UiColor(Color4.Green)
else
c_UiColor(Color4.Yellow)
end
if UiTextButton(key, 40, 40) then
rebinding = id
end
UiPop()
end
function isMenuOpen()
return menuOpened
end
function setMenuOpen(val)
menuOpened = val
end
|
local M = {
{
name = "agpl-3.0",
text = [[
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
]]
},
{
name = "fdl-1.1",
text = [[
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
]]
},
{
name = "fdl-1.2",
text = [[
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
]]
},
{
name = "fdl-1.3",
text = [[
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
]]
},
{
name = "gpl-1.0",
text = [[
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
]]
},
{
name = "gpl-2.0",
text = [[
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
},
{
name = "gpl-3.0",
text = [[
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
]]
},
{
name = "lgpl-2.0",
text = [[
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
]]
},
{
name = "lgpl-2.1",
text = [[
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
]]
},
{
name = "lgpl-3.0",
text = [[
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
]]
}
}
return M
|
local class = require "class"
local Image = class:derive("Image")
local Vec2 = require("Essentials/Vector2")
local Color = require("Essentials/Color")
function Image:new(path, frames)
frames = frames or Vec2(1)
self.img = loadImage(path)
if not self.img then error("Failed to load image: " .. path) end
self.size = Vec2(self.img:getDimensions())
self.frameSize = self.size / frames
self.frameCount = frames
self.frames = {}
for i = 1, frames.x do
self.frames[i] = {}
for j = 1, frames.y do
self.frames[i][j] = love.graphics.newQuad(self.frameSize.x * (i - 1), self.frameSize.y * (j - 1), self.frameSize.x, self.frameSize.y, self.size.x, self.size.y)
end
end
end
function Image:getFrame(frame)
--print(self.frames[(frame.x - 1) % self.frameCount.x + 1][(frame.y - 1) % self.frameCount.y + 1])
--for k1, v1 in pairs(self.frames) do
-- for k2, v2 in pairs(v1) do print(k1, k2, v2) end
--end
return self.frames[(frame.x - 1) % self.frameCount.x + 1][(frame.y - 1) % self.frameCount.y + 1]
end
function Image:draw(pos, align, frame, rot, color, alpha)
align = align or Vec2()
frame = frame or Vec2(1)
rot = rot or 0
color = color or Color()
alpha = alpha or 1
pos = posOnScreen(pos - (align * self.frameSize):rotate(rot))
if color.r then -- temporary chunk
love.graphics.setColor(color.r, color.g, color.b, alpha)
else
love.graphics.setColor(unpack(color), alpha)
end
love.graphics.draw(self.img, self:getFrame(frame), pos.x, pos.y, rot, getResolutionScale(), getResolutionScale())
end
return Image
|
count = {}
haspoked = {}
poketime = {}
maxpokes = 2
maxtime = 180
function onClientPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message, ffIgnored)
if (pokerID ~= haspoked[pokerID]) then
haspoked[pokerID] = pokerID
count[pokerID] = 1
poketime[pokerID] = os.time()
ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, "I've received your poke. I'll get back to you as time allows.", pokerID)
elseif(pokerID == haspoked[pokerID])then
if (count[pokerID] >= maxpokes and os.difftime(poketime[pokerID],os.time()) <= maxtime) then
ts3.requestClientKickFromServer(serverConnectionHandlerID,pokerID,"Don't abuse the poke functionality please! ")
poketime[pokerID] = os.time()
else
if(os.difftime(poketime[pokerID],os.time()) > maxtime) then
poketime[pokerID] = os.time
end
ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, "I've received your poke. I'll get back to you as time allows.", pokerID)
count[pokerID] = count[pokerID]+1
end
end
end
|
-- Translation support
local S = minetest.get_translator("keyring")
local F = minetest.formspec_escape
-- context
local context = {}
local selected = {}
local selected_player = {}
local selected_player_num = {}
local key_list = {}
local tab = {}
local function reset_context(name)
context[name] = nil
selected[name] = nil
selected_player[name] = nil
selected_player_num[name] = nil
key_list[name] = nil
tab[name] = nil
end
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
reset_context(name)
end)
local form_allowed = {}
keyring.form = {}
--[[
-- Features:
-- - translator: function used for translation
-- - virtual_symbol: String or nil (default)
-- - title_tab: bool
-- - title_tab_management: String or nil (default)
-- - title_tab_settings: String or nil (default)
-- - msg_not_allowed_edit: String or nil (default)
-- - msg_is_public: String or nil (default)
-- - msg_you_own: String or nil (default)
-- - msg_is_owned_by: Untranslated String or nil (default)
-- - msg_is_shared_with: String or nil (default)
-- - msg_not_allowed_use: String or nil (default)
-- - msg_not_shared: String or nil (default)
-- - msg_list_of_keys: String or nil (default)
-- - msg_no_key: String or nil (default)
-- - remove_key: bool
-- - rename_key: bool
-- - set_owner: bool
-- - share: bool
-- - share_management: bool (default: true)
-- - msg_manage_keys: String or nil (default)
-- - msg_not_manage_keys: String or nil (default)
-- - msg_button_allow_manage_keys: String or nil (default)
-- - msg_button_deny_manage_keys: String or nil (default)
--
--]]
keyring.form.register_allowed = function(itemname, features)
form_allowed[itemname] = features
end
--[[
-- Returns a table containing
-- - is_use_allowed: bool
-- - msg_not_use_allowed: String
-- - display_title_tabs: bool
-- - title_tab_management: String
-- - title_tab_settings: String
-- - msg_owner: String
-- - display_set_owner_button: bool
-- - is_owned: bool
-- - display_msg_shared: bool
-- - msg_shared: String
-- - msg_shared_pos: String containing pos
-- - display_shared_list: bool
-- - shared_list_start_pos: String containing start pos
-- - shared_list_size: String containing size
-- - display_share_button: bool
-- - display_unshare_button: bool
-- - msg_list_keys: String
-- - display_keys_list: bool
-- - keys_list_size: String containing size
-- - key_virtual_symbol: String
-- - display_rename_button: bool
-- - display_remove_button: bool
-- - msg_manage_keys: String
-- - msg_manage_keys_pos: String containing start pos
-- - display_manage_keys_button: bool
-- - msg_manage_keys_button: String
-- - manage_keys_button_pos: String containing start pos
-- - action_manage_keys_button: String containing name of action button
--
--]]
local function get_formspec_properties(itemstack, player)
local props = {}
local item_name = itemstack:get_name()
local FA = form_allowed[item_name]
local item_meta = itemstack:get_meta()
local player_name = player:get_player_name()
local keyring_owner = item_meta:get_string("owner")
local keyring_allowed = keyring.fields.utils.owner.is_edit_allowed(keyring_owner,
player_name)
local has_list_priv = minetest.check_player_privs(player_name, { keyring_inspect=true })
local shared = item_meta:get_string(keyring.fields.shared)
local is_shared_with = keyring.fields.utils.shared.is_shared_with(player_name, shared)
local shared_key_management = item_meta:get_int(
keyring.fields.shared_key_management)
local key_management_allowed = keyring.fields.utils.owner.is_key_management_allowed(
keyring_owner, shared, shared_key_management, player_name)
local has_keys = next(minetest.deserialize(
item_meta:get_string(keyring.fields.KRS)) or {}) or false
props.is_use_allowed = (keyring_allowed or has_list_priv or is_shared_with) and FA
and true or false
if not props.is_use_allowed then
props.msg_not_use_allowed = FA.msg_not_allowed_use
or S("You are not allowed to use this keyring.")
return props
end
props.display_title_tabs = FA.title_tab
if props.display_title_tabs then
props.title_tab_management = FA.title_tab_management or S("Keys management")
props.title_tab_settings = FA.title_tab_settings or S("Keyring settings")
end
if keyring_owner == player_name then
props.msg_owner = FA.msg_you_own or S("You own this keyring.")
props.display_set_owner_button = FA.set_owner or false
props.is_owned = true
props.display_share_button = FA.share or false
props.display_unshare_button = FA.share and (shared ~= nil) and (shared ~= "") or false
props.display_manage_keys_button = FA.share_management
and (shared ~= nil) and (shared ~= "") or true
elseif keyring_owner ~= "" then
props.msg_owner = (FA.translator and FA.msg_is_owned_by)
and FA.translator(FA.msg_is_owned_by, keyring_owner)
or S("This keyring is owned by @1.", keyring_owner)
props.display_set_owner_button = false
props.is_owned = true
props.display_share_button = false
props.display_unshare_button = false
props.display_manage_keys_button = false
else
props.msg_owner = FA.msg_is_public or S("This keyring is public.")
props.display_set_owner_button = FA.set_owner or false
props.is_owned = false
props.display_share_button = false
props.display_unshare_button = false
props.display_manage_keys_button = false
end
if props.is_owned then
props.display_msg_shared = true
props.msg_shared_pos = props.display_set_owner_button and "3" or "2"
local slstart = props.display_set_owner_button and 3.75 or 2.75
props.shared_list_start_pos = tostring(slstart)
local slsize = 3
+ ((not props.display_set_owner_button) and 1 or 0)
+ ((not props.display_share_button) and 1 or 0)
- (props.display_manage_keys_button and 1 or 0)
props.shared_list_size = tostring(slsize)
if (shared ~= nil) and (shared ~= "") then
props.display_shared_list = FA.share or false
props.msg_shared = FA.msg_is_shared_with or S("This keyring is shared with:")
if shared_key_management == 1 then
props.msg_manage_keys = FA.msg_manage_keys
or S("They are able to use the keyring and to manage keys.")
props.msg_manage_keys_button = FA.msg_button_deny_manage_keys
or S("Deny key management")
props.action_manage_keys_button = "deny_shared_management"
else
props.msg_manage_keys = FA.msg_not_manage_keys
or S("They are able to use the keyring but not to manage keys.")
props.msg_manage_keys_button = FA.msg_button_allow_manage_keys
or S("Allow key management")
props.action_manage_keys_button = "allow_shared_management"
end
props.msg_manage_keys_pos = tostring(slstart + slsize + 0.75)
props.manage_keys_button_pos = tostring(slstart + slsize + 1.25)
else
props.display_shared_list = false
props.msg_shared = FA.msg_not_shared or S("This keyring is not shared.")
end
end
if has_keys then
props.display_keys_list = true
props.msg_list_keys = FA.msg_list_of_keys or S("List of keys in the keyring")
props.key_virtual_symbol = FA.virtual_symbol or S("[virtual]")
props.display_rename_button = FA.rename_key and key_management_allowed or false
props.display_remove_button = FA.remove_key and key_management_allowed or false
else
props.display_keys_list = false
props.msg_list_keys = FA.msg_no_key or S("There is no key in the keyring.")
props.display_rename_button = false
props.display_remove_button = false
end
props.keys_list_size = props.display_rename_button and "7" or "8"
return props
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
-- guard
if not (formname == "keyring:edit") then
return
end
local name = player:get_player_name()
-- clean context
if fields.quit and not fields.key_enter then
reset_context(name)
return
end
-- check abuses
local item = player:get_wielded_item()
local item_name = item:get_name()
local meta = item:get_meta()
local FA = form_allowed[item_name]
-- check item is allowed
if FA == nil then
keyring.log("action", "Player "..name..
" sent a keyring action but the selected item ("..item_name..") is not allowed.")
return
end
-- check item group
if not (minetest.get_item_group(item_name, "key_container") == 1) then
keyring.log("action", "Player "..name..
" sent a keyring action but the selected item ("
..item_name..") is not a key container.")
return
end
local krs = meta:get_string(keyring.fields.KRS)
if krs ~= context[name] then
keyring.log("action", "Player "..name
.." sent a keyring action but the selected item is not the right key container.")
return
end
-- edits rights not required for this section
if FA.title_tab then
-- tabheader selection
if fields.header == "2" then
tab[name] = true
elseif fields.header == "1" then
tab[name] = nil
end
if fields.header then
keyring.form.formspec(item, minetest.get_player_by_name(name))
end
end
-- check for edits
local keyring_owner = meta:get_string("owner")
local shared = meta:get_string(keyring.fields.shared)
local keyring_allowed = keyring.fields.utils.owner.is_edit_allowed(keyring_owner, name)
local key_management_allowed = keyring.fields.utils.owner.is_key_management_allowed(
keyring_owner, shared, meta:get_int(keyring.fields.shared_key_management), name)
if not key_management_allowed then
if (not minetest.check_player_privs(name, { keyring_inspect=true })) and
not keyring.fields.utils.shared.is_shared_with(name, shared) then
keyring.log("action", "Player "..name
.." sent command to manage keys of a "..item_name.." owned by "
..(keyring_owner or "unknown player"))
end
return
end
if FA.share or FA.set_owner then
-- make owner
if fields.make_private or fields.make_public and FA.set_owner then
if not keyring_allowed then
minetest.chat_send_player(name,
FA.msg_not_allowed_edit or
S("You are not allowed to edit settings of this keyring."))
return
end
if fields.make_private then
meta:set_string("owner", name)
meta:set_string("description",
minetest.registered_items[item_name].description
.." ("..S("owned by @1", name)..")")
elseif fields.make_public then
meta:set_string("owner", "")
meta:set_string("description",
minetest.registered_items[item_name].description)
end
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
end
if (keyring_owner == name) and (FA.share_management ~= false) then
if fields.allow_shared_management then
meta:set_int(keyring.fields.shared_key_management, 1)
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
elseif fields.deny_shared_management then
meta:set_int(keyring.fields.shared_key_management, 0)
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
end
end
if (keyring_owner == name) and FA.share then
if fields.share_player_dropdown and fields.player_dropdown
and fields.player_dropdown ~= "" then
meta:set_string(keyring.fields.shared, shared..
((shared ~="") and " " or "")..fields.player_dropdown)
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
end
if (fields.share_player_button or (fields.key_enter and fields.key_enter_field
and fields.key_enter_field == "share_player")) and fields.share_player
and fields.share_player ~= "" then
local concat = fields.share_player
for _, v in ipairs({"%[", "]", ",", ";", "\\"}) do
concat = concat:gsub(v," ")
end
meta:set_string(keyring.fields.shared, shared..
((shared ~="") and " " or "")..concat)
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
end
if fields.unshare and selected_player[name]
and selected_player[name] ~= "" then
shared = keyring.fields.utils.shared.remove(selected_player[name], shared)
if keyring.fields.utils.shared.get_from_index(
selected_player_num[name], shared) == "" then
selected_player_num[name] = selected_player_num[name] -1
end
selected_player[name] = keyring.fields.utils.shared.get_from_index(
selected_player_num[name], shared)
meta:set_string(keyring.fields.shared, shared)
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
end
-- refresh selected player
if fields.selected_player then
local event = minetest.explode_textlist_event(fields.selected_player)
if event.type ~= "INV" then
selected_player[name] = keyring.fields.utils.shared.get_from_index(
event.index, shared)
if selected_player[name] == "" then
keyring.log("action", "Player "..name
.." selected a player in "..item_name.." settings interface"
.." but this player is not in the list.")
else
selected_player_num[name] = event.index
end
end
end
-- warn player
if (fields.share_player_button or (fields.key_enter and fields.key_enter_field
and fields.key_enter_field == "share_player")) and ((not fields.share_player)
or fields.share_player == "") then
minetest.chat_send_player(name, S("You must enter a player name first."))
end
if (fields.unshare and ((not selected_player[name])
or selected_player[name] == ""))
or (fields.share_player_dropdown and ((not fields.player_dropdown)
or fields.player_dropdown == "")) then
minetest.chat_send_player(name, S("You must select a player first."))
end
end
end
-- key selection
if fields.selected_key ~= nil then
local event = minetest.explode_textlist_event(fields.selected_key)
if event.type ~= "INV" then
if key_list[name] == nil or event.index > #key_list[name] then
keyring.log("action", "Player "..name
.." selected a key in "..item_name.." interface"
.." but this key does not exist.")
return
end
selected[name] = event.index
end
end
if selected[name] then
-- no name provided for renaming
if (fields.rename or (fields.key_enter and fields.key_enter_field
and fields.key_enter_field == "new_name"))
and ((not fields.new_name) or fields.new_name == "") then
minetest.chat_send_player(name, S("You must enter a name first."))
return
end
-- add user description
if (fields.rename or (fields.key_enter and fields.key_enter_field
and fields.key_enter_field == "new_name"))
and key_list[name] and selected[name] and selected[name] <= #key_list[name]
and fields.new_name and fields.new_name ~= "" and selected[name]
and FA.rename_key and key_management_allowed then
local u_krs = minetest.deserialize(krs)
u_krs[key_list[name][selected[name]]].user_description = fields.new_name
meta:set_string(keyring.fields.KRS, minetest.serialize(u_krs))
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
return
end
-- put the key out of keyring
if fields.remove and selected[name] and key_list[name] and selected[name]
and selected[name] <= #key_list[name] and FA.remove_key and key_management_allowed then
local key = ItemStack("default:key")
local u_krs = minetest.deserialize(krs)
local key_meta = key:get_meta()
key_meta:set_string("secret", selected[name])
key_meta:set_string(keyring.fields.description,
u_krs[key_list[name][selected[name]]].user_description)
key_meta:set_string("description",
u_krs[key_list[name][selected[name]]].description)
local inv = minetest.get_player_by_name(name):get_inventory()
local number = u_krs[key_list[name][selected[name]]].number
local virtual = u_krs[key_list[name][selected[name]]].virtual
if inv:room_for_item("main", key) or ((number == 0) and virtual) then
-- remove key from keyring
if (number > 1) or (number == 1 and virtual) then
-- remove only 1 key
u_krs[key_list[name][selected[name]]].number = number -1
elseif (number == 1) or ((number == 0) and virtual) then
u_krs[key_list[name][selected[name]]] = nil
end
-- apply
item:get_meta():set_string(keyring.fields.KRS, minetest.serialize(u_krs))
player:set_wielded_item(item)
keyring.form.formspec(item, minetest.get_player_by_name(name))
if not (number == 0 and virtual) then
-- add key to inventory
inv:add_item("main", key)
end
else
minetest.chat_send_player(name, S("There is no room in your inventory for a key."))
end
return
end
end
-- no selected key, but removing/renaming asked
if (fields.rename or fields.remove or (fields.key_enter and fields.key_enter_field
and fields.key_enter_field == "new_name")) and not selected[name] then
minetest.chat_send_player(name, S("You must select a key first."))
return
end
end)
--[[ Get key list
-- parameter: serialized krs, player name and symbol utilized for virtual keys
-- return: key list
--]]
local function get_key_list(serialized_krs, name, virtual_symbol)
local krs = minetest.deserialize(serialized_krs) or {}
local list = ""
local first = true
local index = 1
key_list[name] = {}
for k, v in pairs(krs) do
key_list[name][index] = k
index = index +1
if not first then
list = list..","
else
first = false
end
list = list..F(v.user_description or v.description)
if (v.number > 1) or (v.virtual and (v.number == 1)) then
list = list..F(" (×"..v.number..")")
end
if v.virtual then
list = list..F(v.virtual
and (((virtual_symbol ~= "") and " " or "")..(virtual_symbol))
or "")
end
end
return list
end
--[[ Get player shared list
-- parameter: list of players separated by space, player name
-- return: return player list separated by comma
-- ]]
local function get_player_shared_list(player_list, name)
if player_list == "" or player_list == nil then
return ""
end
return player_list:gsub("%s+", ",")
end
--[[
-- Add name to list separated by separator.
-- parameters:
-- - list: the previous list
-- - name: the name to add
-- - first: true if this is the first name to add to the list
-- - separator: separator to use
--
-- returns:
-- - the new list
--]]
local function add_to_list(list, name, first, separator)
if not first then
list = list..separator
end
list = list..name
return list
end
--[[
-- Get connected players list + player’s faction (not already in shared)
-- parameter:
-- - shared_list: list of players/factions shared with (space separated)
-- - name: player name
--]]
local function get_player_list_connected(shared_list, name)
local list = minetest.get_connected_players()
local res_list = ""
local first = true
for _, v in pairs(list) do
local v_name = v:get_player_name()
if (v_name ~= name) and
not keyring.fields.utils.shared.is_shared_with_raw(v_name, shared_list) then
res_list = add_to_list(res_list, v_name, first, ",")
first = false
end
end
if not keyring.settings.playerfactions then
return res_list
end
-- playerfactions support
local p_factions = {}
if factions.version == nil then
-- backward compatibility
table.insert(p_factions, factions.get_player_faction(name))
else
p_factions = factions.get_player_factions(name)
end
for _, p_fac in ipairs(p_factions) do
if not keyring.fields.utils.shared.is_shared_with_raw("faction:"..p_fac,
shared_list) then
res_list = add_to_list(res_list, "faction:"..p_fac, first, ",")
first = false
end
end
return res_list
end
--[[
-- itemstack: a keyring:keyring
-- player: the player to show formspec
--]]
keyring.form.formspec = function(itemstack, player)
local item_meta = itemstack:get_meta()
local name = player:get_player_name()
local props = get_formspec_properties(itemstack, player)
if not props.is_use_allowed then
local item_name = itemstack:get_name()
local keyring_owner = item_meta:get_string("owner")
keyring.log("action", "Player "..name
.." tryed to access key management of a "..item_name.." owned by "
..(keyring_owner or "unknown player"))
minetest.chat_send_player(name, props.msg_not_use_allowed)
return itemstack
end
local krs = item_meta:get_string(keyring.fields.KRS)
local shared = item_meta:get_string(keyring.fields.shared)
-- formspec
local formspec = "formspec_version[3]"
.."size[10.75,11.25]"
if props.display_title_tabs then
-- tabheader
formspec = formspec.."tabheader[0,0;10.75,1;header;"
..props.title_tab_management
..","..props.title_tab_settings..";"
..(tab[name] and "2" or "1")..";false;true]"
end
if tab[name] then
formspec = formspec.."label[1,1;"..F(props.msg_owner).."]"
if props.display_set_owner_button then
formspec = formspec.."button[1,1.5;5,1;"
..(props.is_owned and "make_public" or"make_private")..";"
..F(props.is_owned and S("Make public") or S("Make private"))
.."]"
end
if props.display_msg_shared then
formspec = formspec.."label[1,"..props.msg_shared_pos..";"..F(props.msg_shared).."]"
end
if props.display_shared_list then
formspec = formspec.."textlist[1,"
..props.shared_list_start_pos
..";8.75,"..props.shared_list_size
..";selected_player;"
..get_player_shared_list(shared, name).."]"
.."label[1,"
..props.msg_manage_keys_pos
..";"..F(props.msg_manage_keys).."]"
if props.display_manage_keys_button then
formspec = formspec.."button[1,"..props.manage_keys_button_pos
..";8.75,1;"
..props.action_manage_keys_button..";"
..F(props.msg_manage_keys_button)
.."]"
end
end
if props.display_share_button then
formspec = formspec
-- dropdown
.."dropdown[1,8;5,1;player_dropdown;"
..get_player_list_connected(shared, name)..";0]"
.."button[6.5,8;3.25,1;share_player_dropdown;"..F(S("Share")).."]"
-- field
.."field[1,9;5,1;share_player;;]"
.."field_close_on_enter[share_player;false]"
.."button[6.5,9;3.25,1;share_player_button;"..F(S("Share")).."]"
end
if props.display_unshare_button then
formspec = formspec
.."button[1,10;5,1;unshare;"..F(S("Unshare")).."]"
end
else
formspec = formspec
-- header label
.."label[1,1;"..F(props.msg_list_keys).."]"
-- list of keys
if props.display_keys_list then
formspec = formspec.."textlist[1,1.75;8.75,"
..props.keys_list_size..";selected_key;"
..get_key_list(krs, name, props.key_virtual_symbol).."]"
end
if props.display_rename_button then
-- rename button
formspec = formspec.."button[1,9;5,1;rename;"..F(S("Rename key")).."]"
.."field[6.5,9;3.25,1;new_name;;]"
.."field_close_on_enter[new_name;false]"
end
if props.display_remove_button then
formspec = formspec.."button[1,10;5,1;remove;"..F(S("Remove key")).."]"
end
end
formspec = formspec.."button_exit[6.5,10;3.25,1;exit;"..F(S("Exit")).."]"
-- context
context[name] = krs
minetest.show_formspec(name, "keyring:edit", formspec)
return itemstack
end
|
local _NAME = ...
local _PACKAGE = _NAME:sub(1, -15) -- I should probably clean this up...
--[[
assertion function - helps check that you pass the right things to various looky functions, to catch errors earlier
@param typeTocheck: string; the type of variable that is expected ("string", "number", etc)
@param value: any; the variable that will be checked against the typeToCheck
@param fieldName: string; the name of the field in the calling function; to build a proper error message on failure
@param extra: string; extra information that might be included in the error message, in case the fieldName itself is not clear enough
@return nil
@errors if value is not of typeToCheck
]]
local function assertArg(typeToCheck, value, fieldName, extra)
if extra then
extra = "(" .. extra .. ") "
else
extra = ""
end
assert(type(value) == typeToCheck, extra .. fieldName .. " should be a " .. typeToCheck .. ", got a: " .. type(value))
end
--[[
Default signaling implementation for container type views.
Will pass the given signal on to all children, while translating coordinates to their local coordinate system
@param self: the LayoutCreator
@param signal: string; the signal name
@param payload: table; the payload passed with the signal
@param coords: an array table of coordinates {x = number, y = number}; the coordinates that are relevant for this event, local to the view that sent this event
@return nil
]]
local signalookyhildren = function(self, signal, payload, coords)
for i, c in ipairs(self:getChildren()) do
if c.visibility == "visible" then
local newCoords = {}
if coords then
for i, v in ipairs(coords) do
local x,y = self:translateCoordsToChild(c, v.x, v.y)
table.insert(newCoords, { x = x, y = y })
end
end
c:receiveOutsideSignal(signal, payload, newCoords)
end
end
end
--[[
An image helper to handle some common modifications to images
Used to layout both backgrounds and the default image view.
Do not call these methods repeatedly. Some of them create a canvas, which makes them fairly expensive.
Can be accessed through looky.imageHelper
]]
local imageHelper = {
--[[
Fit the image. Given a view, will scale the image while retaining the ratio.
Ensures that the entire image fits in the view; will leave some room in the view if the view/image ratios differ.
@param view: a View; the view that is used to determine the image's size
@param image: a Love Drawable; the image that will be drawn
@return image: a Love Drawable; the image that will be drawn
@return scale, scale: number; the X, Y scale factor to make the image fit (always the same due to ratio preserving)
]]
fit = function(view, image)
local scaledX = view:grantedWidth() / image:getWidth()
local scaledY = view:grantedHeight() / image:getHeight()
local scale = math.min(scaledX, scaledY)
return image, scale, scale
end,
--[[
Stretch the image. Given a view, will scale the image to fill up the whole view.
Ensures that the entire view is filled up with the image, even if it means changing the ratio.
@param view: a View; the view that is used to determine the image's size
@param image: a Love Drawable; the image that will be drawn
@return image: a Love Drawable; the image that will be drawn
@return scale, scale: number; the X, Y scale factor to make the image fill the view
]]
stretch = function(view, image)
local scaleX = view:grantedWidth() / image:getWidth()
local scaleY = view:grantedHeight() / image:getHeight()
return image, scaleX, scaleY
end,
--[[
Crop the image. Given a view, will scale the image to fill up the whole view without changing the ratio.
Ensures that the entire view is filled up with the image, even if it means cutting away parts of the image.
@param view: a View; the view that is used to determine the image's size
@param image: a Love Drawable; the image that will be drawn
@return canvas: a Canvas; the image that will be drawn
@return scale, scale: number; the X, Y scale factor to make the image fill the view (always the same because of ratio preservation)
]]
crop = function(view, image)
love.graphics.setColor(255,255,255,255)
local scaledX = view:grantedWidth() / image:getWidth()
local scaledY = view:grantedHeight() / image:getHeight()
local scale = math.max(scaledX, scaledY)
local canvas = love.graphics.newCanvas(view:grantedWidth(), view:grantedHeight())
love.graphics.setCanvas(canvas)
love.graphics.push()
love.graphics.origin()
love.graphics.draw(image, 0, 0, 0, scale, scale)
love.graphics.pop()
love.graphics.setCanvas()
return canvas, scale, scale
end,
--[[
Fill the image. Given a view, will paste copies of the image at its original size until the entire view is filled.
Ensures that the entire view is filled up copies of the image, even if it means cutting away parts of some.
@param view: a View; the view that is used to determine the image's size
@param image: a Love Drawable; the image that will be drawn
@return canvas: a Canvas; many copies of the image that can be drawn
]]
fill = function(view, image)
love.graphics.setColor(255,255,255,255)
local canvas = love.graphics.newCanvas(view:grantedWidth(), view:grantedHeight())
love.graphics.setCanvas(canvas)
love.graphics.push()
love.graphics.origin()
local x, y = 0, 0
while x < view:grantedWidth() do
while y < view:grantedHeight() do
love.graphics.draw(image, x, y)
y = y + image:getHeight()
end
y = 0
x = x + image:getWidth()
end
love.graphics.pop()
love.graphics.setCanvas()
return canvas
end
}
--[[
BaseLayout is an empty view that can be used as a scaffold to set up completely new viewtypes.
NOTE: For the majority of your custom views, it is better to re-use one of the existing views.
@param width: number or "fill" or "wrap"; the desired width of this view
@param height: number or "fill" or "wrap"; the desired height of this view
]]
local function baseLayout(width, height)
return {
children = {},
width = width,
height = height,
listeners = {},
--[[
@PUBLIC
Allows adding a new listener to this view; any signals sent OUT by this view will reach the listener.
@param listener: table; the table on which a method will be called
@param method: string; the name of the function that should be called
]]
addListener = function(self, listener, method)
table.insert(self.listeners, { target = listener, method = method })
end,
--[[
Add a child to this layout. Note that while all views get this method, not all of them do anything with it.
Upon adding a child, the parent will automatically start listening to the child, using the default signal-handler.
@param child: View; the view to add as a child of this one
@param position: the position in which to put the child; defaults to "at the end"
@param mute: boolean; pass true if you don't want to listen to this child's signals.
@return nil
]]
addChild = function(self, child, position, mute)
assert(child, "No child was passed to addChild")
position = position or #self.children+1
table.insert(self.children, position, child)
if not mute then
child:addListener(self, "receiveChildSignal")
end
end,
--[[
Return how wide this view WANTS to be. There is no guarantee it will actually get this size.
It is allowed to return "fill" if the view just wants as much space as it can get.
@return number of "fill"; the size this view would like to have
]]
desiredWidth = function(self)
if self.visibility == "gone" then
return 0
end
if self.width == "fill" then
return self.width
elseif type(self.width) == "number" then
return self.width
else
return self:contentWidthWithPadding()
end
end,
--[[
Return how high this view WANTS to be. There is no guarantee it will actually get this size.
It is allowed to return "fill" if the view just wants as much space as it can get.
@return number of "fill"; the size this view would like to have
]]
desiredHeight = function(self)
if self.visibility == "gone" then
return 0
end
if self.height == "fill" then
return self.height
elseif type(self.height) == "number" then
return self.height
else
return self:contentHeightWithPadding()
end
end,
--[[
Return how much width this view is actually granted. This is the hard limit to how much space the view is allowed to take up.
@return number: the total width of this view
]]
grantedWidth = function(self)
return self.givenWidth
end,
--[[
Return how much height this view is actually granted. This is the hard limit to how much space the view is allowed to take up.
@return number: the total height of this view
]]
grantedHeight = function(self)
return self.givenHeight
end,
--[[
Set the view's dimensions. This is used by the parent during a layoutingpass to set how large the view is allowed to be.
It also resets the background to make sure it fits with the new dimensions
@return nil
]]
setDimensions = function(self, x, y)
self.givenWidth = x
self.givenHeight = y
self:prepareBackground()
end,
--[[
Returns the view's width minus its padding; this is the amount of room you should draw something useful in.
@return number; the number of pixels of width you can draw in.
]]
availableWidth = function(self)
return self:grantedWidth() - self.padding.left - self.padding.right
end,
--[[
Returns the view's height minus its padding; this is the amount of room you should draw something useful in.
@return number; the number of pixels of height you can draw in.
]]
availableHeight = function(self)
return self:grantedHeight() - self.padding.top - self.padding.bottom
end,
--[[
@MUST IMPLEMENT
This method is called when the view is requested to re-layout its contents.
Before this method is called, the view's dimensions will have been from outside. (ie; by the view's parent)
In this method, the view should set the dimensions for its children and call this same method on them
@return nil
]]
layoutingPass = function(self)
end,
--[[
The core render function; this will render the view to the screen
This method handles visibility, background and border and delegates to renderCustom which must be implemented by each view
@return nil
]]
render = function(self)
if self.visibility == "visible" then
self:renderBackground()
if self:availableWidth() > 0 and self:availableHeight() > 0 then
self:renderCustom()
end
end
end,
--[[
@MUST IMPLEMENT
This method does all the real work; it must draw the view's content to the screen.
Never call this method on a child; call it's render function instead.
@return nil
]]
renderCustom = function(self)
end,
--[[
@SHOULD IMPLEMENT
This method is called when the view should update itself.
Note that if the view contains any children it wants update, it will have to call them here!
By default, update does not propagate to children, although all of the core views do this
@param dt: number; the number of seconds that passed since the last time this method was called
@return nil
]]
update = function(self, dt)
end,
--[[
@MUST IMPLEMENT
This method must return the width of the view's content in pixels
It is used to determine the available drawing area and to figure out what a desired width of "wrap" should mean
@return number; the width of the content that will be shown in this view
]]
contentWidth = function(self)
return 0
end,
--[[
@MUST IMPLEMENT
This method must return the height of the view's content in pixels
It is used to determine the available drawing area and to figure out what a desired height of "wrap" should mean
@return number; the height of the content that will be shown in this view
]]
contentHeight = function(self)
return 0
end,
--[[
This method returns the total width of this view; content + padding
@return number; total width of this element
]]
contentWidthWithPadding = function(self)
local width = self:contentWidth()
if type(width) ~= "number" then
return width
end
return width + self.padding.left + self.padding.right
end,
--[[
This method returns the total height of this view; content + padding
@return number; total height of this element
]]
contentHeightWithPadding = function(self)
local height = self:contentHeight()
if type(height) ~= "number" then
return height
end
return height + self.padding.top + self.padding.bottom
end,
--[[
This method will render the background and border for the View.
It is called before the custom render method so that the background/border are in place for all elements.
Note that backgrounds are prepareda and redrawn, not recalookyulated on each call
@return nil
]]
renderBackground = function(self)
if self.realBackground then
if self.realBackground == "color" then
love.graphics.setColor(self.background)
local width = self:grantedWidth()
local height = self:grantedHeight()
love.graphics.rectangle("fill", 0, 0, width , height)
else
love.graphics.setColor(self.background.colorFilter)
love.graphics.draw(self.realBackground, 0, 0, 0, self.scaleX, self.scaleY)
end
end
self:renderBorder()
end,
--[[
This method overrides the currently set background with a new one.
The background is prepared for rendering if it changed.
@return nil
]]
setBackground = function(self, background)
if background ~= self.background then
self.background = background
self:prepareBackground()
end
end,
--[[
This method will prepare the background for drawing.
It is called automatically whenever the background or size of the view change.
@return nil
]]
prepareBackground = function(self)
if self.background then
if self.background.file then
local helper = imageHelper
local image = self.background.file
self.realBackground, self.scaleX, self.scaleY = helper[self.background.fill](self, image )
else
self.realBackground = "color"
end
end
end,
--[[
This method will draw a border around the view if there is one
@return nil
]]
renderBorder = function(self)
if self.border.thickness > 0 then
love.graphics.setColor(self.border.color)
love.graphics.setLineWidth(self.border.thickness)
local width = self:grantedWidth()
local height = self:grantedHeight()
love.graphics.rectangle("line", self.border.thickness/2, self.border.thickness/2, width - self.border.thickness, height - self.border.thickness)
love.graphics.setLineWidth(1)
end
end,
--[[
This method determines where in the view the content should be drawn, based on the set gravity.
This is relevant for views that are larger than their content.
For example; when rendering some text in a large view, this method calookyulates exactly which x,y you should pass to love.graphics.print()
@return x, y: number; the top-left coorindates where you should start drawing to fit the current content based on the gravity
]]
startCoordsBasedOnGravity = function(self)
local locX, locY
if self.gravity[1] == "start" then
locX = self.padding.left
elseif self.gravity[1] == "end" then
locX = self:grantedWidth() - self:contentWidth() - self.padding.left
elseif self.gravity[1] == "center" then
locX = (self:availableWidth() - self:contentWidth()) / 2 + self.padding.left
end
if self.gravity[2] == "start" then
locY = self.padding.top
elseif self.gravity[2] == "end" then
locY = self:grantedHeight() - self:contentHeight() - self.padding.bottom
elseif self.gravity[2] == "center" then
locY = (self:availableHeight() - self:contentHeight()) / 2 + self.padding.top
end
return locX, locY
end,
--[[
Get the child with the given order-number
@param number: number; the child you want
@return View or nil; that child if it exists
]]
getChild = function(self, number)
return self.children[number]
end,
--[[
Return all the children of this view
@return array of View
]]
getChildren = function(self)
return self.children
end,
--[[
Remove a child from the view.
@param target: number or View; if a number, the child with that number will be removed. If a View, that View will be removed
@return View: the child that was removed
]]
removeChild = function(self,target)
if type(target) == "number" then
local view = self.children[target]
table.remove(self.children, target)
return view
else
for k, v in ipairs(self.children) do
if v == target then
table.remove(self.children, k)
return target
end
end
end
end,
--[[
Remove all children from the view.
@return nil
]]
removeAllchildren = function(self)
self.children = {}
end,
--[[
docs for signalookyhildren are with the function's definition at the top of this file
]]
signalookyhildren = signalookyhildren,
--[[
This method is called by "the outside" when the view receives a signal.
(Often this is done by the parent; but the view doesn't know it has one, so everything is treated as "the outside")
This handler has a bunch of convenience options that allows view-implementers to quickly get the proper behavior.
To add a new handler for a signal, it can be put in the externalSignalHandlers table on the view.
The key will be the name of the signal. The value can be any of the following:
- a function: that function will be called
- the string "o": the signal will be propagated to all outside listeners
- the string "c": the signal will be propagated to all children
- a number: the child with that number will receive the signal
- a table: the receiveOutsideSignal method will be called on that table
@param signal: string; the name of the signal
@param payload: table; the payload sent with the signal
@param coords: table of {x = number, y = number}; the coordinates sent with this signal, translated relatively to this view
@return nil
]]
receiveOutsideSignal = function(self, signal, payload, coords)
local handler = self.externalSignalHandlers[signal]
if not handler then
handler = self.defaultExternalHandler
end
if handler then
if type(handler) == "function" then
self.externalSignalHandlers[signal](self, signal, payload, coords)
elseif type(handler) == "string" then
if handler == "o" then
self.messageOut(self, signal, payload, coords)
elseif handler == "c" then
self.signalookyhildren(self, signal, payload, coords)
else
error( "Only 'o' and 'c' are accepted as string based handler, but got: " .. handler )
end
elseif type(handler) == "number" then
self.getChildren()[handler]:receiveOutsideSignal(signal, payload, coords)
elseif type(handler) == "table" then
handler:receiveOutsideSignal(signal, payload, coords)
end
end
end,
--[[
This method is called by one of the view's children that has created a signal
This handler has a bunch of convenience options that allows view-implementers to quickly get the proper behavior.
To add a new handler for a child signal, it can be put in the childSignalHandlers table on the view.
The key will be the name of the signal. The value can be any of the following:
- a function: that function will be called
- the string "o": the signal will be propagated to all outside listeners
- the string "c": the signal will be propagated to all children
- a number: the child with that number will receive the signal
- a table: the receiveOutsideSignal method will be called on that table
@param signal: string; the name of the signal
@param payload: table; the payload sent with the signal
@param coords: table of {x = number, y = number}; the coordinates sent with this signal, translated relatively to this view
@return nil
]]
receiveChildSignal = function(self, signal, payload, coords)
local handler = self.childSignalHandlers[signal]
if not handler then
handler = self.defaultChildHandler
end
if handler then
if type(handler) == "function" then
self.childSignalHandlers[signal](self, signal, payload, coords)
elseif type(handler) == "string" then
if handler == "o" then
self.messageOut(self, signal, payload)
elseif handler == "c" then
self.signalookyhildren(self, signal, payload, coords)
else
error( "Only 'o' and 'c' are accepted as string based handler, but got: " .. handler )
end
elseif type(handler) == "number" then
self.getChildren()[handler]:receiveOutsideSignal(signal, payload, coords)
elseif type(handler) == "table" then
handler:receiveOutsideSignal(signal, payload, coords)
end
end
end,
--[[
This will hold all the external signals that this view handles. See receiveOutsideSignal, above, for what goes in here.
]]
externalSignalHandlers = {},
--[[
This will hold all the child signals that this view handles. See receiveChildSignal, above, for what goes in here.
]]
childSignalHandlers = {},
--[[
This is the default handler for any external signal that is not explictly handled above.
Can be set to nil if you want to ignore any unhandled signals.
Defaults to "pass the external event down to all my children"
]]
defaultExternalHandler = "c",
--[[
This is the default handler for any child signal that is not explictly handled above.
Can be set to nil if you want to ignore any unhandled signals.
Defaults to "pass on the child event to anyone listening to me"
]]
defaultChildHandler = "o",
--[[
This method allows sending a signal to everything listening to the View
@param signal: string; the name of this signal
@param payload: table; the payload attached to this signal
@return nil
]]
messageOut = function(self, signal, payload)
for i, listener in ipairs(self.listeners) do
if not listener.target[listener.method] then
print("Could not find method " .. method .. " of listener " )
end
listener.target[listener.method](listener.target, signal, payload)
end
end,
--[[
@MUST IMPLEMENT
This method translates the given coordinates to the local coordinate system of the given child.
Each child's local system has it's own top-left corner at 0,0 and its bottom right corner at width,height
@param child: View; the child that these coords should be translated to
@param x,y: number; the coordinates in question
@return x,y: number; the coordinates in the child-local system
]]
translateCoordsToChild = function(self, child, x, y)
return x, y
end,
--[[
@MUST IMPLEMENT
This method translates the given child-local coordinates to the local coordinate system of this view
param child: View; the child that these coords should be translated from
param x,y: number; the coordinates in our local system
]]
translateCoordsFromChild = function(self, child, x, y)
return x, y
end,
--[[
This methods determines whether or not a set of coordinates should be considered as "within me"
The default implementation assumes that anything within the boundaries of the views counts, but this is not required.
(For example, a button might call this method to determine if a click hit it; a round button might then override this function to change its hitbox)
Coordinates are local to the view.
@param x,y: number; the coordinates that are being checked
@return boolean; whether this should be considered "hitting the view"
]]
coordsInMe = function(self, x, y)
return x > 0 and x < self:grantedWidth() and y > 0 and y < self:grantedHeight()
end
}
end
--[[
This function allows a number of shortcuts for defining paddings on views. (It is here because it is self-referential)
It can be passed up to 4 arguments, whose meaning and type differs based on how many there are
Options supported:
- a single table: will copy the fields "left", "top", "right", "bottom" into their respective paddings and sets the rest to 0
EX: paddingHelper({ top = 50, bottom = 20}) -> { top = 50, bottom = 20, left = 0, right = 0 }
- a single number: will use that number for all paddings
EX: paddingHelper(5) -> { top = 5, bottom = 5, left = 5, right = 5 }
- two numbers: will use the first number for left/right and the second for top/bottom
EX: paddingHelper(5, 10) -> { top = 10, bottom = 10, left = 5, right = 5 }
- four numbers: will assign the numbers in order: left, top, right, bottom
EX: paddingHelper(5, 10, 15, 20) -> { left = 5, top = 10, right = 15, bottom = 20 }
@return table: { left = number, top = number, right = number, bottom = number }
]]
paddingHelper = function(left, top, right, bottom)
assert( not (type(left) == "table" and top ~= nil), "Cannot pass both a table and other values to padding/margin. Did you accidentally call it as a method (ie looky:padding(10)) ?" )
if left == nil and top == nil and right == nil and bottom == nil then
return paddingHelper(0,0,0,0)
elseif top == nil and right == nil and bottom == nil then
if type(left) == "table" then
return paddingHelper(left.left or 0, left.top or 0, left.right or 0, left.bottom or 0)
else
return paddingHelper(left,left,left,left)
end
elseif right == nil and bottom == nil then
return paddingHelper(left,top,left,top)
else
return {
left = left,
top = top,
right = right,
bottom = bottom
}
end
end
--[[
Factory function to create a new, empty LayoutCreator
Will not contain any type of views except for 'base' and no fonts except for 'base'
@return LayoutCreator
]]
return function()
--[[
The main object for this library. You use this to register and build your Views.
]]
local looky = {
--[[
Kinds holds all the different Views registered to the system.
By default, only contains "base" which cannot be built, but can be intantiated using the special *createBaseLayout* function.
]]
kinds = {
base = {
build = function() assert(false, "Base cannot be instantiated") end,
schema = {
width = { required = true, schemaType = "oneOf", possibilities = {
{ schemaType = "fromList", list = {"wrap", "fill"} },
{ schemaType = "number" }
}},
height = { required = true, schemaType = "oneOf", possibilities = {
{ schemaType = "fromList", list = {"wrap", "fill"} },
{ schemaType = "number" }
}},
padding = { required = false, schemaType = "table", options = {
left = { required = true, schemaType = "number" },
right = { required = true, schemaType = "number" },
bottom = { required = true, schemaType = "number" },
top = { required = true, schemaType = "number" },
}},
background = { required = false, schemaType = "oneOf", possibilities = {
{ schemaType = "color" },
{ schemaType = "table", options = {
file = { required = true, schemaType = "oneOf" , possibilities = {
{ schemaType = "string" },
{ schemaType = "image" }
}},
fill = { required = true, schemaType = "fromList", list = { "fit", "stretch", "crop", "fill" }},
colorFilter = { required = false, schemaType = "color" }
}
}
}},
gravity = { required = false, schemaType = "table", options = {
{ schemaType = "fromList", list = { "start", "center", "end" } },
{ schemaType = "fromList", list = { "start", "center", "end" } },
}},
border = { required = false, schemaType = "table", options = {
color = { required = true, schemaType = "color" },
thickness = { required = true, schemaType = "number" }
}},
weight = { required = false, schemaType = "number" },
visibility = { required = false, schemaType = "fromList", list = { "visible", "cloaked", "gone" } },
externalSignalHandlers = {
required = false,
schemaType = "table",
options = {},
allowOther = true
},
childSignalHandlers = {
required = false,
schemaType = "table",
options = {},
allowOther = true
}
}
}
},
--[[
Fonts contains all the fonts registered to the looky.
By default, contains only "base", which is löve's default font
]]
fonts = {
base = love.graphics.newFont()
},
--[[
Initializes a Validator to check schemas.
You will not interact with this directly.
By default, Validator will contain all the basic validation rules.
You can register more through looky's own registerValidator function.
]]
validator = require ( _PACKAGE .. "/validation/validator" )(),
--[[
Requests looky to build a new view. Will validate the options passed before building.
@param kind: string; the name of the view you want built.
@param options: table; the options that should be passed to the view. These will be checked against the Schema defined for the view.
@return View; the requested view
@throws if the kind is unknown or the options do not pass schema validation
]]
build = function( self, kind, options )
options = options or {}
assert(self.kinds[kind], "Requesting layout " .. kind .. ", but I do not have it")
self:validate(kind, options)
return self.kinds[kind].build(options)
end,
--[[
Register a new type of buildable layout. After registering, you can build() it.
@param name: string; the name of this kind of view that needs to be passed to build to create it
@param layoutTable: table; a table that contains at least a build method (that will build a new instance of the view) and a schema table that defines the View's schema
@return nil
]]
registerLayout = function( self, name, layoutTable )
assertArg("string", name, "Name" )
assertArg("table", layoutTable, "layoutTable", name )
assertArg("function", layoutTable.build, "layoutTable.build", name )
assertArg("table", layoutTable.schema, "layoutTable.schema", name )
assert(not self.kinds[name], "A layout named " .. name .. " was previously registered")
self.kinds[name] = layoutTable
end,
--[[
Registers a new type of font that can be used by views.
@param name: string; the name of this font
@param font: Font; a font created by love.graphics.newFont or similar method
@return nil
]]
registerFont = function( self, name, font )
assertArg("string", name, "Name")
assertArg("userdata", font, "Font", name)
assert(not self.fonts[name], "A font named " .. name .. " was previously registered")
self.fonts[name] = font
end,
--[[
Recovers a font that was previously registered.
@param name: string; the name of the font you want
@return Font; the requested Font
]]
getFont = function( self, name )
assert(self.fonts[name], "Requesting font " .. name .. ", but I do not have it")
return self.fonts[name]
end,
--[[
see documentation for paddingHelper function, above
]]
padding = function(left, top, right, bottom)
return paddingHelper(left, top, right, bottom)
end,
--[[
see documentation for imageHelper function, above
]]
imageHelper = imageHelper,
--[[
Special function that can be used by views to create an empty stub of a view.
This is the starting point for any View that cannot be based on a working, existing view.
You probably won't need it.
@param options: Table; the default options for this new view. Follows the Base schema.
@return View; a View stub
]]
makeBaseLayout = function(self, options)
local start = baseLayout(options.width, options.height)
start.padding = self.padding(options.padding)
start.background = options.background
start.border = options.border or { color = { 0, 0, 0, 0 }, thickness = 0 }
start.gravity = options.gravity or {"start","start"}
start.weight = options.weight or 1
start.visibility = options.visibility or "visible"
start.signalHandlers = options.signalHandlers or {}
-- if background is a filename, load it now
if start.background and start.background.file and type(start.background.file) == "string" then
start.background.file = love.graphics.newImage(start.background.file)
end
if start.background and start.background.file and not start.background.colorFilter then
start.background.colorFilter = { 255, 255, 255, 255 }
end
return start
end,
--[[
Helper function. Merges two sets of options, with the second param taking precedence over the first.
@param baseOptions: Table; the first set of options
@param options: Table; the second set of options
@return Table; the merged options, added to the baseOptions table
]]
mergeOptions = function (baseOptions, options)
for k, v in pairs(options) do
baseOptions[k] = v
end
return baseOptions
end,
--[[
Validates the given options against the schema of the given kind.
Throws an error if the options do not pass the validation.
@param kind: string; the name of the schema to validate against
@param options: table; the options you wish to validate
@return nil
@throws if the options do not fit the required schema
]]
validate = function(self, kind, options)
self.validator:validate(kind, self.kinds[kind].schema, options)
end,
--[[
Registers a new validator.
If you pass a function, it will register a new validation function that will be called when you use that name.
If you pass a table (which is a schema itself), then when you use the name it will as a type, it will replace it with the schema.
@param name: string; the name you will reference this by in your schemas
@param validator: function or table; what should be checked when you use this schemaType
@return nil
]]
registerValidator = function(self, name, validator)
if type(validator) == "function" then
self.validator:addSchemaType(name, validator)
else
self.validator:addPartialSchema(name, validator)
end
end,
--[[
Extend a schema, by taking all the options of the first and then adding the modification options to them.
Does not register the schema; only returns it.
SPECIAL: if you pass an option from the base schema with the value FALSE, it will be removed from the baseSchema
@param startWith: string; the name of the schema to use as a base
@param andModifyWith: table; the entries that need to be modified. Will overwrite any matching keys in base.
]]
extendSchema = function( self, startWith, andModifyWith )
assert(self.kinds[startWith] and self.kinds[startWith].schema, "Trying to extend an unregistered schema: " .. startWith )
local initial = self.kinds[startWith].schema
local schema = {}
for k, v in pairs(initial) do
schema[k] = v
end
for k, v in pairs(andModifyWith) do
schema[k] = v
end
return schema
end,
--[[
Get a copy of an existing schema
@param name: string; the schema you want
@return Table; a copy of the requested schema
]]
getSchema = function(self, name)
assert(self.kinds[name] and self.kinds[name].schema, "Trying to get an unregistered schema: " .. name )
local initial = self.kinds[name].schema
local schema = {}
for k, v in pairs(initial) do
schema[k] = v
end
return schema
end,
--[[
@Deprecated
Helper method. Removes any keys from the passed t that aren't in the schema.
Only operates on top-level; doesn't validate values.
@param schema: string; the name of the schema you want to conform to
@param t: Table; a table that you want to conform to the schema
@return Table; a new table containing only keys from t that exist in the schema
]]
conformToSchema = function( self, schema, t )
local schema = self:getSchema(schema)
local output = {}
for k, v in pairs(schema) do
output[k] = t[k]
end
return output
end,
}
--[[
Register a new layout that is simply an existing layout with some options prefilled.
Used to generate your own styles, and to make extending views easier.
@param newName: string; the name by which the styled layout will be known
@param oldName: string; the old view you're using as a base
@param defaultOptions: Table; the options that are passed to the old view to style it
]]
looky.registerStyledLayout = function( self, newName, oldName, defaultOptions )
local schema = looky:extendSchema(oldName, {})
for key, value in pairs(schema) do
if defaultOptions[key] ~= nil then
schema[key].required = false
end
end
local layout = {
build = function(options)
-- need to merge defaultOptions and options before building.
for k, v in pairs(defaultOptions) do
if options[k] == nil then
options[k] = v
end
end
return looky:build(oldName, options)
end,
schema = schema
}
looky:registerLayout(newName, layout)
end
--[[
Wrap a bunch of views into each other.
Useful if you have views that extend a single view with some extra decoration.
(For example, when wrapping a content view in a dragbox or filler)
@param ..., Tables; a list of views that need to be wrapped.
@return the Nth View passed, which will contain the N-1th View as a child, which will contain the N-2th View as a child, etc.
]]
looky.wrap = function( self, ... )
args = {...}
local prev = nil
for _, view in ipairs(args) do
if prev then
view:addChild(prev)
end
prev = view
end
return prev -- view is not in scope anymore
end
return looky
end
|
slot0 = class("MonopolyGame")
slot1 = pg.activity_event_monopoly_map
slot2 = pg.activity_event_monopoly_event
slot3 = 501041
slot4 = 501041
slot5 = 6
slot6 = 5
slot7 = {
stateGold = "dafuweng_gold",
stateOil = "dafuweng_oil",
stateEvent = "dafuweng_event",
stateWalk = "dafuweng_walk",
stateStand = "dafuweng_stand",
stateJump = "dafuweng_jump",
stateRun = "dafuweng_run",
stateTouch = "dafuweng_touch"
}
slot8 = nil
function slot8()
return {
onActionUpdated = function ()
return
end,
currState = nil,
ChangeState = function (slot0, slot1, slot2)
slot2 = slot2 or function ()
return
end
if slot0.currState == slot1 then
slot2()
end
slot0.currState = slot1
slot0.onActionUpdated(slot1, slot2)
end,
IsStandState = function (slot0)
return slot0.currState == slot0.stateStand
end
}
end
function slot9(slot0)
return {
onMove = function ()
return
end,
onJump = function ()
return
end,
onUpdatePos = function ()
return
end,
ship = Ship.New({
configId = slot0,
skin_id = slot0
}),
state = slot1(),
Move = function (slot0, slot1, slot2, slot3)
slot2 = slot2 or function ()
return
end
if #slot1 == 0 then
slot2()
return
end
function slot4(slot0)
if slot0 then
slot0.state:ChangeState(slot1.stateWalk)
else
slot0.state:ChangeState(slot1.stateRun)
end
slot0.onMove(slot2, function ()
if slot0:GetAction(slot1[#slot1]) then
slot0.state:ChangeState(slot0, function ()
slot0.state:ChangeState(slot1.stateStand)
slot1.stateStand()
end)
else
slot0.state.ChangeState(slot1, slot2.stateStand)
slot2.stateStand()
end
end)
end
if #slot1 <= 3 and not slot3 then
slot0.Jump(slot0, slot1, slot2)
else
slot4(slot3)
end
end,
Jump = function (slot0, slot1, slot2)
slot2 = slot2 or function ()
return
end
if #slot1 == 0 then
slot2()
return
end
slot3 = {}
for slot7, slot8 in pairs(slot1) do
table.insert(slot3, function (slot0)
slot0.state:ChangeState(slot1.stateJump)
slot0.onJump(slot0.state, function ()
slot0.state:ChangeState(slot1.stateStand)
slot1.stateStand()
end)
end)
end
seriesAsync(slot3, function ()
if slot0:GetAction(slot1[#slot1]) then
slot0.state:ChangeState(slot0, function ()
slot0.state:ChangeState(slot1.stateStand)
slot1.stateStand()
end)
else
slot0.state.ChangeState(slot1, slot2.stateStand)
slot2.stateStand()
end
end)
end,
Touch = function (slot0)
if slot0.state:IsStandState() then
slot0.state:ChangeState(slot0.stateTouch, function ()
slot0.state:ChangeState(slot1.stateStand)
end)
end
end,
GetAction = function (slot0, slot1)
if slot1.config.icon == "icon_1" then
return slot0.stateEvent
elseif slot2 == "icon_2" then
return slot0.stateGold
elseif slot2 == "icon_3" then
elseif slot2 == "icon_4" then
return slot0.stateEvent
elseif slot2 == "icon_5" then
return slot0.stateOil
elseif slot2 == "icon_6" then
return slot0.stateEvent
end
end,
InitPos = function (slot0, slot1)
slot0:ChangePos(slot1)
slot0.state:ChangeState(slot0.stateStand)
end,
ChangePos = function (slot0, slot1)
slot0.onUpdatePos(slot1)
end,
Dispose = function (slot0)
slot0.onMove = nil
slot0.onUpdatePos = nil
end
}
end
function slot10(slot0)
return {
id = slot0,
config = slot0[slot0],
ExistStory = function (slot0)
return slot0.config.story and slot0.config.story ~= "0"
end,
isEmpty = function (slot0)
return slot0.config.story == "0" and slot0.config.drop == 0 and #slot0.config.effect == 0
end,
Dispose = function (slot0)
slot0.config = nil
end
}
end
function slot11(slot0)
for slot5, slot6 in ipairs(slot1.all) do
if not table.contains(slot1.events, slot6) then
table.insert(slot1.events, slot2(slot6))
end
end
slot1.GetEvent = function (slot0, slot1)
for slot5, slot6 in ipairs(slot0.events) do
if slot6.id == slot1 then
return slot6
end
end
end
slot1.SetNext = function (slot0, slot1)
slot0.next = slot1
end
slot1.Dispose = function (slot0)
for slot4, slot5 in ipairs(slot0.events) do
slot5:Dispose()
end
end
return slot1
end
function slot12(slot0, slot1)
return {
ROW = slot0,
COLUMN = slot1 - 2,
cellIds = slot0,
path = {},
char = nil,
index = slot1,
onCreateCell = function (slot0)
return
end,
onCreateChar = function (slot0)
return
end,
Init = function (slot0)
slot1 = 0
for slot5 = 0, slot0.ROW - 1, 1 do
slot0:CeateCell({
slot1,
slot5
}, 0)
end
slot1 = slot0.ROW - 1
for slot5 = 1, slot0.COLUMN, 1 do
slot0:CeateCell({
slot5,
slot1
}, #slot0.path)
end
slot1 = slot0.COLUMN + 1
for slot5 = slot0.ROW - 1, 0, -1 do
slot0:CeateCell({
slot1,
slot5
}, #slot0.path)
end
slot1 = 0
slot2 = #slot0.path - 1
for slot6 = slot0.COLUMN, 1, -1 do
slot0:CeateCell({
slot6,
slot1
}, slot2)
end
slot0:CreateChar(slot1)
end,
CreateChar = function (slot0, slot1)
slot0.char = slot0(slot1)
slot0.onCreateChar(slot0.char)
slot0.char:InitPos(slot0:GetCell(slot0.index))
end,
CeateCell = function (slot0, slot1, slot2)
slot4 = slot0({
pos = slot1,
index = #slot0.path + 1,
id = slot0.cellIds[#slot0.path + 1],
flag = slot2
})
if #slot0.path == 0 then
slot4:SetNext(slot4)
else
slot0.path[slot3].SetNext(slot5, slot4)
slot4:SetNext(slot0.path[1])
end
table.insert(slot0.path, slot4)
slot0.onCreateCell(slot4)
end,
GetPath = function (slot0)
return slot0.path
end,
GetChar = function (slot0)
return slot0.char
end,
GetPathCell = function (slot0, slot1)
return _.map(slot1, function (slot0)
return slot0.path[slot0]
end)
end,
UpdateCharPos = function (slot0, slot1, slot2, slot3)
slot0.char:Move(slot0:GetPathCell(slot1), slot2, slot3)
slot0.index = slot1[#slot1]
end,
GetCell = function (slot0, slot1)
return slot0.path[slot1]
end,
GetPos = function (slot0)
return slot0.index
end,
Dispose = function (slot0)
for slot4, slot5 in ipairs(slot0.path) do
slot5:Dispose()
end
slot0.char:Dispose()
slot0.onCreateCell = nil
slot0.onCreateChar = nil
end
}
end
function slot13(slot0, slot1)
setAnchoredPosition(slot0, {
_tf = slot0,
_img = slot0:GetComponent(typeof(Image)),
cell = slot1,
interval = Vector2(0, 0),
startPos = Vector2(0, 0),
offset = Vector2(slot0.rect.width * 0.5 + 2.5, slot0.rect.height * 0.5 - 2),
GetGenPos = function (slot0)
return Vector3(slot0.startPos.x + slot0.cell.column * slot0.offset.x + slot0.cell.row * slot0.offset.x, slot0.startPos.y + slot0.cell.column * slot0.offset.y + slot0.cell.row * -slot0.offset.y, 0)
end,
UpdateStyle = function (slot0)
slot0._img.sprite = GetSpriteFromAtlas("ui/activityuipage/monopolycar_atlas", slot0.cell.config.icon)
slot0._img:SetNativeSize()
end,
Dispose = function (slot0)
return
end
}:GetGenPos())
()["_tf"]:SetSiblingIndex(slot1.flag)
return
end
function slot14(slot0, slot1)
slot3 = slot0:GetChild(0)
tf(slot3).localScale = Vector3(0.5, 0.5, 0.5)
slot4 = GameObject("mouseChild")
tf(slot4):SetParent(tf(slot3))
tf(slot4).localPosition = Vector3.zero
setParent(slot4, slot3)
GetOrAddComponent(slot4, "Image").color = Color.New(0, 0, 0, 0)
slot6 = slot4:GetComponent(typeof(RectTransform))
slot6.sizeDelta = Vector2(3, 3)
slot6.pivot = Vector2(0.5, 0)
slot6.anchoredPosition = Vector2(0, 0)
onButton(self, slot4, function ()
slot0.char:Touch()
end)
return {
_tf = slot0,
WalkSpeed = 1,
RunSpeed = 0.5,
jumpSpeed = 0.5,
char = slot1,
SpineAnimUI = slot3:GetComponent("SpineAnimUI"),
Action = function (slot0, slot1, slot2, slot3)
slot4 = {}
_.each(slot1, function (slot0)
table.insert(slot0, function (slot0)
slot0:UpdateScale(slot0.UpdateScale)
if slot0._tf.localPosition == slot0.UpdateScale:GetGenPos() then
slot0()
else
LeanTween.moveLocal(go(slot0._tf), slot1, LeanTween.moveLocal):setOnComplete(System.Action(function ()
slot0.preCellTF = slot1
slot2()
end))
end
end)
end)
seriesAsync(slot4, function ()
if slot0 then
slot0()
end
end)
end,
Move = function (slot0, slot1, slot2)
if #slot1 > 3 then
slot0:Action(slot1, slot2, slot0.RunSpeed)
else
slot0:Action(slot1, slot2, slot0.WalkSpeed)
end
end,
Jump = function (slot0, slot1, slot2)
slot0:Action({
slot1
}, function ()
slot0()
pg.CriMgr.GetInstance():PlaySoundEffect_V3(SFX_STEP_MONOPOLY)
end, slot0.jumpSpeed)
end,
UpdatePos = function (slot0, slot1)
slot0.preCellTF = slot1
slot0._tf.localPosition = slot1:GetGenPos()
end,
UpdateScale = function (slot0, slot1)
slot2 = 1
slot0.preCellTF = slot0.preCellTF or slot1
if slot0.preCellTF.cell.row < slot1.cell.row or slot0.preCellTF.cell.column < slot1.cell.column then
slot2 = 1
elseif slot1.cell.row < slot0.preCellTF.cell.row or slot1.cell.column < slot0.preCellTF.cell.column then
slot2 = -1
end
slot0._tf.localScale = Vector3(slot2, 1, 1)
end,
ChangeAction = function (slot0, slot1, slot2)
slot0.SpineAnimUI:SetActionCallBack(nil)
slot0.SpineAnimUI:SetAction(slot1, 0)
slot0.SpineAnimUI:SetActionCallBack(function (slot0)
if slot0 == "finish" then
slot0.SpineAnimUI:SetActionCallBack(nil)
slot0.SpineAnimUI.SetActionCallBack()
end
end)
end,
Dispose = function (slot0)
slot0.SpineAnimUI:SetActionCallBack(nil)
slot0.char.onMove = nil
if slot0.timer then
slot0.timer:Stop()
slot0.timer = nil
end
end
}
end
slot0.SetUp = function (slot0, slot1, slot2)
slot0.viewComponent = slot1
pg.DelegateInfo.New(slot0)
slot0._tf = slot0.viewComponent._tf
slot0._go = go(slot3)
slot0.models = {}
parallelAsync({
function (slot0)
PoolMgr.GetInstance():GetSpineChar(Ship.New({
configId = slot0,
skin_id = Ship.New
}).getPrefab(slot1), true, function (slot0)
slot0.models[slot1.configId] = slot0
slot1.configId()
end)
end,
function (slot0)
onNextTick(slot0)
end
}, function ()
slot0:setActivity(slot0)
slot0.setActivity:init()
slot0.setActivity.init:didEnter()
end)
end
slot0.setActivity = function (slot0, slot1)
slot0.activity = slot1
slot0.useCount = slot0.activity.data1_list[2]
slot0.pos = slot0.activity.data2
slot0.step = slot0.activity.data3
slot0.effectId = slot0.activity.data4
slot0.totalCnt = math.ceil((pg.TimeMgr.GetInstance():GetServerTime() - slot0.activity.data1) / 86400) * slot0.activity:getDataConfig("daily_time") + slot0.activity.data1_list[1]
slot0.leftCount = slot0.totalCnt - slot0.useCount
slot0.nextredPacketStep = slot1:getDataConfig("reward_time") - slot0.useCount % slot1.getDataConfig("reward_time")
slot0.advanceTotalCnt = #slot1:getDataConfig("reward")
slot0.isAdvanceRp = slot0.advanceTotalCnt - slot0.activity.data2_list[2] > 0
slot0.leftAwardCnt = slot0.activity.data2_list[1] - slot6
slot0.advanceRpCount = math.max(0, math.min(slot0.activity.data2_list[1], slot0.advanceTotalCnt) - slot6)
slot0.commonRpCount = math.max(0, slot0.activity.data2_list[1] - slot0.advanceTotalCnt) - math.max(0, slot6 - slot0.advanceTotalCnt)
slot0.leftDropShipCnt = 10 - (slot0.activity.data1_list[3] - 1)
end
slot0.NetActivity = function (slot0, slot1)
slot0:setActivity(slot1)
slot0:updateLeftCount()
slot0:updateNextRedPacketStep()
end
slot0.init = function (slot0)
slot0:blockAllEvent(false)
slot0.bg = slot0:findTF("AD")
slot0.mapCellTpl = slot0:getTpl("mapCell", slot0.bg)
slot0.mapContainer = slot0:findTF("mapContainer", slot0.bg)
slot0.charTpl = slot0:getTpl("char", slot0.bg)
slot0.startBtn = slot0:findTF("start", slot0.bg)
slot0.valueImg = slot0:findTF("value", slot0.bg):GetComponent(typeof(Image))
slot0.leftcountLabel = slot0:findTF("leftcount", slot0.bg):GetComponent(typeof(Text))
slot0.leftCountTF = slot0:findTF("leftcount/Text", slot0.bg):GetComponent(typeof(Text))
slot0.nextRedPacketStepTF = slot0:findTF("nextRpStep/Text", slot0.bg):GetComponent(typeof(Text))
slot0.commonRp = slot0:findTF("rp", slot0.bg)
slot0.commonAnim = slot0.commonRp:GetComponent(typeof(Animator))
slot0.commonRpCnt = slot0:findTF("rp_text/Text", slot0.bg):GetComponent(typeof(Text))
slot0.dropShipTxt = slot0:findTF("AD/drop_ship_text"):GetComponent(typeof(Text))
slot0.helpBtn = slot0:findTF("AD/help")
slot0.anim = slot0:findTF("AD/anim")
setActive(slot0.anim, false)
slot0.leftcountLabel.text = i18n("monopoly_left_count")
slot0.advanceTag = slot0:findTF("AD/rp/sp")
slot0.advanceLabel = slot0:findTF("AD/rp_text/sp")
slot0.advancecLabel = slot0:findTF("AD/rp_text/label")
slot0.advanceImage = slot0:findTF("AD/rp_text/sp_img")
slot0.advanceTxt = slot0:findTF("AD/rp_text/sp_img/Text"):GetComponent(typeof(Text))
end
slot0.updateNextRedPacketStep = function (slot0)
slot0.nextRedPacketStepTF.text = slot0.nextredPacketStep
end
slot0.updateLeftCount = function (slot0)
slot0.leftCountTF.text = slot0.leftCount
slot0.commonAnim:SetInteger("count", slot0.leftAwardCnt)
slot0.commonRpCnt.text = slot0.commonRpCount
end
slot0.updateValue = function (slot0, slot1)
if slot1 ~= 0 then
slot0.valueImg.sprite = GetSpriteFromAtlas("ui/activityuipage/monopoly_atlas", slot1)
slot0.valueImg:SetNativeSize()
end
setActive(go(slot0.valueImg), slot1 ~= 0)
end
slot0.didEnter = function (slot0)
setActive(slot0.startBtn, slot0.leftCount > 0)
slot0:updateLeftCount()
slot0:updateValue(0)
slot0:updateNextRedPacketStep()
slot0.mapVO = slot0(setActive, slot0.pos)
slot0:createMap(slot0.mapVO)
slot0.mapVO:Init()
slot0:checkState()
onButton(slot0, slot0.startBtn, function ()
if slot0.block then
return
end
if slot0.leftCount <= 0 then
pg.TipsMgr.GetInstance():ShowTips(i18n("common_count_noenough"))
return
end
slot0:startAction()
end, SFX_PANEL)
onButton(slot0, slot0.commonRp, function ()
if slot0.leftAwardCnt > 0 then
slot0:emit(MonopolyPage.ON_AWARD)
end
end, SFX_PANEL)
onButton(slot0, slot0.helpBtn, function ()
pg.MsgboxMgr.GetInstance():ShowMsgBox({
type = MSGBOX_TYPE_HELP,
helps = pg.gametip.help_chunjie_monopoly.tip
})
end, SFX_PANEL)
end
slot0.blockAllEvent = function (slot0, slot1)
slot0:emit(ActivityMainScene.LOCK_ACT_MAIN, slot1)
slot0.block = slot1
end
slot0.triggerEvent = function (slot0, slot1, slot2, slot3)
slot5 = slot0.mapVO:GetCell(slot1).GetEvent(slot4, slot2)
function slot6(slot0, slot1)
if slot0 and slot0:ExistStory() then
pg.NewStoryMgr.GetInstance():Play(slot0.config.story, slot1, true, true)
else
slot1()
end
end
slot7 = {
function (slot0)
slot0(slot0, slot0)
end,
function (slot0)
slot1 = nil
function slot1()
if not slot0 or slot0:isEmpty() then
slot1()
return
end
slot2:emit(MonopolyPage.ON_TRIGGER, slot2.activity.id, function (slot0, slot1)
if not slot0 or #slot0 == 0 then
slot0()
return
end
slot1.mapVO:UpdateCharPos(slot0, function ()
slot2 = #slot0.mapVO:GetCell(slot0).GetEvent(slot1, )
slot1(slot1, slot5)
end, true)
end)
end
slot1()
end
}
seriesAsync(slot7, slot3)
end
slot0.checkState = function (slot0)
slot1 = {}
slot0:blockAllEvent(true)
if slot0:getStrory() then
table.insert(slot1, function (slot0)
pg.NewStoryMgr.GetInstance():Play(slot0, slot0)
end)
end
if slot0.effectId ~= 0 then
table.insert(slot1, function (slot0)
slot0:triggerEvent(slot0.mapVO:GetPos(), slot0.effectId, slot0)
end)
end
if slot0.step ~= 0 then
table.insert(slot1, function (slot0)
slot0:emit(MonopolyPage.ON_MOVE, slot0.activity.id, function (slot0, slot1, slot2)
if not slot1 or #slot1 == 0 then
slot0()
return
end
slot1.mapVO:UpdateCharPos(slot1, function ()
#slot0:triggerEvent(slot0[#slot0], #slot0, )
end)
end)
end)
end
seriesAsync(slot1, function ()
slot0:blockAllEvent(false)
end)
end
slot0.startAction = function (slot0)
slot1 = slot0.activity.id
slot2 = 0
function slot3(slot0)
if slot0 == 0 then
slot0()
return
end
slot1:emit(MonopolyPage.ON_MOVE, slot1, function (slot0, slot1, slot2)
if not slot1 or #slot1 == 0 then
slot0()
return
end
slot2.mapVO:UpdateCharPos(slot0, function ()
#slot0:triggerEvent(slot0[#slot0], #slot0, )
end)
end)
end
seriesAsync({
function (slot0)
setActive(slot0.startBtn, false)
slot0:blockAllEvent(true)
slot0:playerAnim(slot0)
end,
function (slot0)
slot0:emit(MonopolyPage.ON_START, slot0.emit, function (slot0)
slot1:updateValue(slot0)
slot1()
end)
end,
function (slot0)
slot0(slot0)
end,
function (slot0)
slot0(slot0)
end,
function (slot0)
if not slot0:getStrory() then
slot0()
return
end
pg.NewStoryMgr.GetInstance():Play(slot1, slot0)
end
}, function ()
slot0:updateValue(0)
slot0.updateValue:blockAllEvent(false)
slot0(slot0.startBtn, slot0.leftCount > 0)
end)
end
slot0.getStrory = function (slot0)
slot1 = slot0.useCount
if _.detect(slot0.activity:getDataConfig("story") or {}, function (slot0)
return slot0[1] == slot0
end) then
return slot4[2]
end
return nil
end
slot0.createMap = function (slot0, slot1)
slot0.charCard = nil
slot0.cellTFs = {}
slot1.onCreateCell = function (slot0)
slot2 = slot1(slot1, slot0)
slot2:UpdateStyle()
slot0.cellTFs[slot0.index] = slot2
end
slot1.onCreateChar = function (slot0)
slot1 = cloneTplTo(slot0.charTpl, slot0.mapContainer)
setParent(slot2, slot1)
slot0.charCard = slot1(slot1, slot0)
slot0.onMove = function (slot0, slot1)
slot0.charCard.Move(slot3, _.map(slot0, function (slot0)
return slot0.cellTFs[slot0.index]
end), slot1)
end
slot0.onUpdatePos = function (slot0)
slot0.charCard:UpdatePos(slot0.cellTFs[slot0.index])
end
slot0.state.onActionUpdated = function (slot0, slot1)
slot0.charCard:ChangeAction(slot0, slot1)
end
slot0.onJump = function (slot0, slot1)
slot0.charCard:Jump(slot0.cellTFs[slot0.index], slot1)
end
end
end
slot0.playerAnim = function (slot0, slot1)
setActive(slot0.anim, true)
if slot0.timer then
slot0.timer:Stop()
end
slot0.timer = Timer.New(function ()
slot0()
setActive(slot1.anim, false)
end, 1.5, 1)
slot0.timer.Start(slot2)
end
slot0.findTF = function (slot0, slot1, slot2)
return findTF(slot2 or slot0._tf, slot1)
end
slot0.getTpl = function (slot0, slot1, slot2)
slot3 = slot0:findTF(slot1, slot2)
slot3:SetParent(slot0._tf, false)
SetActive(slot3, false)
return slot3
end
slot0.Destroy = function (slot0)
for slot4, slot5 in pairs(slot0.cellTFs) do
slot5:Dispose()
end
slot0.charCard:Dispose()
slot0.mapVO:Dispose()
slot0.cellTFs = nil
slot0.charCard = nil
slot0.mapVO = nil
if slot0.timer then
slot0.timer:Stop()
slot0.timer = nil
end
pg.DelegateInfo.Dispose(slot0)
end
slot0.emit = function (slot0, slot1, slot2, slot3)
slot0.viewComponent:emit(slot1, slot2, slot3)
end
return slot0
|
local spawn = nil
local spawnTrans = script.parent:GetWorldTransform()
local splash = script:GetCustomProperty("splash")
local effect = script:GetCustomProperty("effect")
local trigger = script.parent
local spawnEffect = nil
local worldpos = nil
local spawnWake = script:GetCustomProperty("SpawnWake")
trigger.beginOverlapEvent:Connect(function(thisTrigger, other)
if (not other:IsA("Player")) then return end
if (effect) then
--Get player world position.
worldpos = other:GetWorldPosition()
--Spawn Splash effect
spawnSplashEffect = World.SpawnAsset(splash, {position = worldpos})
--Spawn and set wake effect to follow player
if (not spawnWake) then return end
spawn = World.SpawnAsset(effect, {position = worldpos})
spawnEffect = spawn:FindChildByType("VFX")
spawn:Follow(other)
Task.Wait()
spawnEffect:Play()
end
end)
trigger.endOverlapEvent:Connect(function(thisTrigger, other)
if(not other:IsA("Player")) then return end
if(not spawnWake) then return end
--Stop wake effect and let it die out before being removed.
spawn:StopMove()
spawn.lifeSpan = 4
end)
|
local server = require 'lspservers/server'
return server.new {
name = 'tsserver',
cmd = { './node_modules/.bin/typescript-language-server', '--stdio' },
installer = [[
set -e
npm install typescript typescript-language-server
]],
}
|
object_building_player_musty_house = object_building_player_shared_musty_house:new {
lotSize = 5,
baseMaintenanceRate = 80,
allowedZones = {"chandrila", "corellia", "coruscant", "dantooine", "dathomir", "endor", "geonosis", "hoth", "hutta", "jakku", "kaas", "kashyyyk", "korriban", "lok", "mandalore", "mustafar", "naboo", "rori", "taanab", "talus", "tatooine", "yavin4"},
constructionMarker = "object/building/player/construction/construction_player_house_corellia_small_style_01.iff",
length = 1,
width = 1,
publicStructure = 0,
skillMods = {
{"private_buff_mind", 125},
{"private_medical_rating", 125},
{"private_med_battle_fatigue", 125},
{"private_safe_logout", 1},
},
childObjects = {
{templateFile = "object/tangible/terminal/terminal_bank.iff", x = -2.83054, z = 0.469543, y = 9.45055, ow = -4.37114e-08, ox = 0, oz = 0, oy = -1, cellid = 1, containmentType = -1},
--{templateFile = "object/tangible/terminal/terminal_mission.iff", x = -4.05691, z = 0.469543, y = 8.82943, ow = -0.382683, ox = 0, oz = 0, oy = -0.923879, cellid = 1, containmentType = -1},
--{templateFile = "object/tangible/beta/beta_terminal_wound.iff", x = 4.54366, z = 0.469543, y = 9.46938, ow = -0.34202, ox = 0, oz = 0, oy = 0.939693, cellid = 1, containmentType = -1},
{templateFile = "object/tangible/terminal/terminal_guild.iff", x = -0.0201342, z = -32.9999, y = 14.85, ow = -4.37114e-08, ox = 0, oz = 0, oy = -1, cellid = 8, containmentType = -1},
{templateFile = "object/tangible/terminal/terminal_elevator_up.iff", x = 0, z = -33, y = -1.29, ow = 0, ox = 0, oy = 0, oz = 0, cellid = 10, containmentType = -1}, --Floor 3
{templateFile = "object/tangible/terminal/terminal_elevator.iff", x = 0, z = -26.0005, y = -1.29, ow = 0, ox = 0, oy = 0, oz = 0, cellid = 10, containmentType = -1}, --Floor 2
{templateFile = "object/tangible/terminal/terminal_elevator_down.iff", x = 0, z = 0.469522, y = -1.29, ow = 0, ox = 0, oy = 0, oz = 0, cellid = 10, containmentType = -1}, --floor 1
{templateFile = "object/tangible/terminal/terminal_player_structure.iff", x = 2.85101, z = 0.469541, y = 9.34914, ow = -4.37114e-08, ox = 0, oz = 0, oy = 1, cellid = 1, containmentType = -1},
{templateFile = "object/tangible/sign/player/house_address.iff", x = -2.73606, z = 2.46955, y = 11.9769, ow = 0, ox = 0, oz = 0, oy = 1, cellid = -1, containmentType = -1}
},
shopSigns = {
{templateFile = "object/tangible/sign/player/house_address.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "@player_structure:house_address"},
{templateFile = "object/tangible/sign/player/shop_sign_s01.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "crafting_merchant_management_01", suiItem = "@player_structure:shop_sign1"},
{templateFile = "object/tangible/sign/player/shop_sign_s02.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "crafting_merchant_management_02", suiItem = "@player_structure:shop_sign2"},
{templateFile = "object/tangible/sign/player/shop_sign_s03.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "crafting_merchant_management_03", suiItem = "@player_structure:shop_sign3"},
{templateFile = "object/tangible/sign/player/shop_sign_s04.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "crafting_merchant_management_04", suiItem = "@player_structure:shop_sign4"},
--Custom Signs
--Standing
{templateFile = "object/tangible/tcg/series5/house_sign_tcg_standing.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "TCG - Diner Sign Standing"},
{templateFile = "object/tangible/tcg/series3/house_sign_tcg_s02.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "TCG - Oval Standing"},
{templateFile = "object/tangible/sign/player/wod_sm_banner_sign_02.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Nightsister Banner Sign 1"},
{templateFile = "object/tangible/sign/player/wod_sm_banner_sign_03.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Nightsister Banner Sign 2"},
{templateFile = "object/tangible/sign/player/wod_sm_banner_sign_01.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Nightsister Banner Sign 3"},
{templateFile = "object/tangible/sign/player/wod_sm_standing_sign_01.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Nightsister Stone Sign Standing"},
{templateFile = "object/tangible/sign/player/imperial_empire_day_2009_sign_standing.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Imperial Emblem Sign Standing"},
{templateFile = "object/tangible/sign/player/rebel_remembrance_day_2009_sign_standing.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Rebel Sign Standing"},
{templateFile = "object/tangible/sign/player/pgc_sign_standing.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Hologram Sign Standing"},
{templateFile = "object/tangible/sign/player/efol_standing_sign_01.iff", x = -2.93747, z = 2.16974, y = 11.4647, ow = 0.5, ox = 0.5, oz = 0.5, oy = 0.5, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Heart Sign Standing"},
--Hanging
{templateFile = "object/tangible/tcg/series5/house_sign_tcg_hanging.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "TCG - Diner Sign Hanging"},
{templateFile = "object/tangible/tcg/series3/house_sign_tcg_s01.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "TCG - Oval Hanging"},
{templateFile = "object/tangible/sign/player/wod_sm_hanging_sign_01.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Nightsister Stone Sign Hanging"},
{templateFile = "object/tangible/sign/player/efol_hanging_sign_01.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Heart Sign Hanging"},
{templateFile = "object/tangible/sign/player/house_address_halloween_sign.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Halloween Sign Hanging"},
{templateFile = "object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Imperial Emblem Sign Hanging"},
{templateFile = "object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff", x = -3.17249, z = 1.96954, y = 11.8851, ow = 1.31134e-07, ox = 0, oz = -0, oy = -1, cellid = -1, containmentType = -1, requiredSkill = "", suiItem = "Rebel Emblem Sign Hanging"},
},
}
ObjectTemplates:addTemplate(object_building_player_musty_house, "object/building/player/musty_house.iff")
|
local Player = require 'src.player'
local bump = require 'libs.bump.bump'
function love.load()
player = Player({
x_position = 100,
y_position = 50,
image = love.graphics.newImage('assets/character.png'),
x_velocity = 0,
y_velocity = 0,
acceleration = 100,
gravity = 80
})
world = bump.newWorld(32)
level_0 = {}
world:add(
player,
player.get_position().x,
player.get_position().y,
player.get_image():getWidth(),
player.get_image():getHeight()
)
world:add(level_0, 0, 448, 840, 32)
end
function love.update(dt)
local player_x = player.get_position().x + player.get_velocity().x
local player_y = player.get_position().y + player.get_velocity().y
player.set_velocity({
x = player.get_velocity().x * (1 - math.min(dt * 20, 1)),
y = player.get_velocity().y * (1 - math.min(dt * 20, 1))
})
player.set_velocity({
x = player.get_velocity().x,
y = player.get_velocity().y + player.gravity * dt
})
if love.keyboard.isDown('right') then
player.move_forward(dt)
elseif love.keyboard.isDown('left') then
player.move_back(dt)
elseif love.keyboard.isDown('up') then
y = y - 250 * dt
elseif love.keyboard.isDown('down') then
y = y + 250 * dt
end
player_x, player_y, collisions = world:move(player, player_x, player_y)
player.set_position({
x = player_x,
y = player_y
})
end
function love.draw()
local x = player.get_position().x
local y = player.get_position().y
love.graphics.draw(player.get_image(), x, y)
love.graphics.rectangle('fill', world:getRect(level_0))
end
|
-----------------------------------------------------------------------------------------------------------------------------------------
-- VRP
-----------------------------------------------------------------------------------------------------------------------------------------
local Tunnel = module("vrp","lib/Tunnel")
local Proxy = module("vrp","lib/Proxy")
local Tools = module("vrp","lib/Tools")
vRP = Proxy.getInterface("vRP")
-----------------------------------------------------------------------------------------------------------------------------------------
-- CONEXAO
-----------------------------------------------------------------------------------------------------------------------------------------
vRPclient = Tunnel.getInterface("vRP")
vCLIENT = Tunnel.getInterface("vrp_policia")
-----------------------------------------------------------------------------------------------------------------------------------------
-- VARIABLES
-----------------------------------------------------------------------------------------------------------------------------------------
local idgens = Tools.newIDGenerator()
-----------------------------------------------------------------------------------------------------------------------------------------
-- WEBHOOK
-----------------------------------------------------------------------------------------------------------------------------------------
local webhookprender = "https://discordapp.com/api/webhooks/590476415061852160/7DEwYk7ReQ_RfGwVEaOko6pPwVg7CKOnUhYoEjruDzn0rv-3AIvYaZIR2QpRFGBz80_z"
local webhookmultas = "https://discordapp.com/api/webhooks/624102579105955860/daGhq-dhXz3B9iWF1CDgPBoDBZKzeRxI_ONdkHPOkSjxaDAL8Iwwtw9zzyn7UCaEF1-j"
local webhookocorrencias = "https://discordapp.com/api/webhooks/616146265646039040/fz1LziwY2A5uoneQN5efBOmlt2uWlaviIihIuf_Ui3PlLzaR8sjI7xtUU4Z2SBNF1Hzn"
local webhookdetido = "https://discordapp.com/api/webhooks/612084569180471296/5-bxlD9bEDqH7ri8YR_IxAHM16OvhgmTV1UtS3za0JAp4HpoN4NkCpEGhGYSQZxDl_rb"
local webhookpolicia = "https://discordapp.com/api/webhooks/624333914143457300/WHmIZeCcHy0m666zp2ednPaKfbbkjDCDMalb_-cIVMbkXeix94v6eD2JvMzkuqeuY44l"
local webhookparamedico = "https://discordapp.com/api/webhooks/624334236933029900/G3WuTyWoXktdG8xvbV5YZSlGcKob4QIGiCAfbqv4RDW1EA7YdpWXDMfEOLUl_OZLZNW2"
local webhookmecanico = "https://discordapp.com/api/webhooks/615738661924765725/jKOys6iSBFWSmt2nafrF2A1_OxAig6rZUkQFb6OT-9YMpmK96myAiLCZupNTrg88i2Yn"
local webhookjuiz = "https://discordapp.com/api/webhooks/629674264466948116/MjZaCqRolmZiH3ykzt_tLGD1BhLLeWKGGzTt6BurTL_dMlr6fOCsocXvkW5wy7wcD4-Q"
local webhookadvogado = "https://discordapp.com/api/webhooks/629674340539170836/9dfmg7ffkQ7TEHou4iP9dq1UHpFRdmPa9s3GYXMPlb-sEAdNLoxiy7Qi8VXyi1o7MSZh"
function SendWebhookMessage(webhook,message)
if webhook ~= nil and webhook ~= "" then
PerformHttpRequest(webhook, function(err, text, headers) end, 'POST', json.encode({content = message}), { ['Content-Type'] = 'application/json' })
end
end
-----------------------------------------------------------------------------------------------------------------------------------------
-- /promotion
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('promotion',function(source,args,rawCommand)
local source = source
local user_id = vRP.getUserId(source)
local nuser_id = args[1]
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"paramedico.permissao") then
if args[1] and args[2] then
if user_id == 21 or user_id == 200 then
vRP.setUData(parseInt(nuser_id),"vRP:PolicePromotion",json.encode(parseInt(args[2])))
TriggerClientEvent("Notify",source,"sucesso","Você promoveu o passaporte: <b>"..nuser_id.."</b> no cargo <b>"..args[2].."</b>.")
elseif user_id == 12 or user_id == 13 then
vRP.setUData(parseInt(nuser_id),"vRP:ParamedicPromotion",json.encode(parseInt(args[2])))
TriggerClientEvent("Notify",source,"sucesso","Você promoveu o passaporte: <b>"..nuser_id.."</b> no cargo <b>"..args[2].."</b>.")
end
elseif args[1] then
if user_id == 21 or user_id == 200 then
local rankPolice = vRP.getUData(parseInt(nuser_id),"vRP:PolicePromotion",json.encode(parseInt(nuser_id)))
TriggerClientEvent("Notify",source,"importante","Você olhou o passaporte: <b>"..nuser_id.."</b>: Cargo <b>"..rankPolice.."</b>.")
elseif user_id == 12 or user_id == 13 then
local rankParamedic = vRP.getUData(parseInt(nuser_id),"vRP:ParamedicPromotion",json.encode(parseInt(nuser_id)))
TriggerClientEvent("Notify",source,"importante","Você olhou o passaporte: <b>"..nuser_id.."</b>: Cargo <b>"..rankParamedic.."</b>.")
end
end
else
TriggerClientEvent("Notify",source,"negado","Você não tem permissão para promover um cargo.")
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- WORKINGTIMER
-----------------------------------------------------------------------------------------------------------------------------------------
local policework = {}
local paramedicwork = {}
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
for k,v in pairs(policework) do
if v > 0 then
policework[k] = v - 1
else
local workingtime = vRP.getUData(parseInt(k),"vRP:PoliceWorkTime",json.encode(parseInt(k)))
if workingtime ~= "" then
workingtime = workingtime + 1
vRP.setUData(parseInt(k),"vRP:PoliceWorkTime",json.encode(parseInt(workingtime)))
else
vRP.setUData(parseInt(k),"vRP:PoliceWorkTime",json.encode(parseInt(1)))
end
policework[k] = 3600
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
for k,v in pairs(paramedicwork) do
if v > 0 then
paramedicwork[k] = v - 1
else
local workingtime = vRP.getUData(parseInt(k),"vRP:ParamedicWorkTime",json.encode(parseInt(k)))
if workingtime ~= "" then
workingtime = workingtime + 1
vRP.setUData(parseInt(k),"vRP:ParamedicWorkTime",json.encode(parseInt(workingtime)))
else
vRP.setUData(parseInt(k),"vRP:ParamedicWorkTime",json.encode(parseInt(1)))
end
paramedicwork[k] = 3600
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- WORKING LEAVE
-----------------------------------------------------------------------------------------------------------------------------------------
AddEventHandler("vRP:playerLeave",function(user_id,source)
local source = source
local user_id = vRP.getUserId(source)
if user_id then
if vRP.hasPermission(user_id,"policia.permissao") then
policework[user_id] = nil
elseif vRP.hasPermission(user_id,"paramedico.permissao") then
paramedicwork[user_id] = nil
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /workingtime
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('workingtime',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if args[1] then
local identity = vRP.getUserIdentity(args[1])
if user_id == 21 or user_id == 200 then
local workingtime = vRP.getUData(parseInt(args[1]),"vRP:PoliceWorkTime",json.encode(parseInt(args[1])))
TriggerClientEvent("Notify",source,"importante","<b>"..identity.name.." "..identity.firstname.."</b> has <b>"..workingtime.."</b> hours worked as a <b>Police Officer</b>.")
elseif user_id == 12 or user_id == 13 then
local workingtime = vRP.getUData(parseInt(args[1]),"vRP:ParamedicWorkTime",json.encode(parseInt(args[1])))
TriggerClientEvent("Notify",source,"importante"," <b>"..identity.name.." "..identity.firstname.."</b> has <b>"..workingtime.."</b> hours worked as a <b>Paramedic</b>.")
end
else
if vRP.hasPermission(user_id,"policia.permissao") then
local workingtime = vRP.getUData(parseInt(user_id),"vRP:PoliceWorkTime",json.encode(parseInt(user_id)))
TriggerClientEvent("Notify",source,"importante","You have <b>"..workingtime.."</b> hours worked as a <b>Police Officer</b>.")
elseif vRP.hasPermission(user_id,"paramedico.permissao") then
local workingtime = vRP.getUData(parseInt(user_id),"vRP:ParamedicWorkTime",json.encode(parseInt(user_id)))
TriggerClientEvent("Notify",source,"importante","You have <b>"..workingtime.."</b> hours worked as a <b>Paramedic</b>.")
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /placa
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('placa',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") then
if args[1] then
local user_id = vRP.getUserByRegistration(args[1])
if user_id then
local identity = vRP.getUserIdentity(user_id)
local x,y,z = vRPclient.getPosition(source)
if identity then
TriggerClientEvent("NotifyPush",source,{ code = 28, title = "Verificando veículo", x = x, y = y, z = z, badge = identity.user_id.." "..identity.name.." "..identity.firstname.." - "..identity.age.." ("..identity.phone..")", veh = identity.registration })
end
else
TriggerClientEvent("Notify",source,"importante","Placa inválida ou veículo de americano.")
end
else
local vehicle,vnetid,placa,vname,lock,banned = vRPclient.vehList(source,7)
local placa_user = vRP.getUserByRegistration(placa)
if placa then
if placa_user then
local identity = vRP.getUserIdentity(placa_user)
local x,y,z = vRPclient.getPosition(source)
if identity then
TriggerClientEvent("NotifyPush",source,{ code = 28, title = "Verificando veículo", x = x, y = y, z = z, badge = identity.user_id.." "..identity.name.." "..identity.firstname.." - "..identity.age.." ("..identity.phone..")", veh = identity.registration })
end
else
TriggerClientEvent("Notify",source,"importante","Placa inválida ou veículo de americano.")
end
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /ptr
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand("ptr",function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
local policiais = vRP.getUsersByPermission("policia.permissao")
local policiais_nomes = ""
local acaopoliciais = vRP.getUsersByPermission("acaopolicia.permissao")
local acaopoliciais_nomes = ""
local paramedicos = vRP.getUsersByPermission("paramedico.permissao")
local paramedicos_nomes = ""
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
for k,v in ipairs(policiais) do
local identity = vRP.getUserIdentity(parseInt(v))
policiais_nomes = policiais_nomes.." "..v..": <b>"..identity.name.." "..identity.firstname.."</b><br>"
end
TriggerClientEvent("Notify",source,"importante","Atualmente <b>"..#policiais.." Policiais</b> em serviço.<br> "..policiais_nomes)
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
for k,v in ipairs(acaopoliciais) do
local identity = vRP.getUserIdentity(parseInt(v))
acaopoliciais_nomes = acaopoliciais_nomes.." "..v..": <b>"..identity.name.." "..identity.firstname.."</b><br>"
end
TriggerClientEvent("Notify",source,"importante","Atualmente <b>"..#acaopoliciais.." Policiais</b> em ação.<br> "..acaopoliciais_nomes)
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"paramedico.permissao") then
for k,v in ipairs(paramedicos) do
local identity = vRP.getUserIdentity(parseInt(v))
paramedicos_nomes = paramedicos_nomes.." "..v..": <b>"..identity.name.." "..identity.firstname.."</b><br>"
end
TriggerClientEvent("Notify",source,"importante","Atualmente <b>"..#paramedicos.." Paramédicos</b> em serviço.<br> "..paramedicos_nomes)
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /p
-----------------------------------------------------------------------------------------------------------------------------------------
local policia = {}
local acaopolicia = {}
local paramedico = {}
RegisterServerEvent('DLGames:1020Police')
AddEventHandler('DLGames:1020Police',function()
local source = source
local user_id = vRP.getUserId(source)
local uplayer = vRP.getUserSource(user_id)
local identity = vRP.getUserIdentity(user_id)
local x,y,z = vRPclient.getPosition(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") then
local policia = vRP.getUsersByPermission("policia.permissao")
for l,w in pairs(policia) do
local npolicia = vRP.getUserSource(parseInt(w))
if npolicia and npolicia ~= uplayer then
async(function()
local id = idgens:gen()
policia[id] = vRPclient.addBlip(npolicia,x,y,z,153,84,"Localização de "..identity.name.." "..identity.firstname,0.5,false)
TriggerClientEvent("Notify",npolicia,"importante","Localização recebida de <b>"..identity.name.." "..identity.firstname.."</b>.")
vRPclient._playSound(npolicia,"Out_Of_Bounds_Timer","DLC_HEISTS_GENERAL_FRONTEND_SOUNDS")
SetTimeout(60000,function() vRPclient.removeBlip(npolicia,policia[id]) idgens:free(id) end)
end)
end
end
TriggerClientEvent("Notify",source,"sucesso","Localização enviada com sucesso.")
vRPclient.playSound(source,"Event_Message_Purple","GTAO_FM_Events_Soundset")
end
if vRP.hasPermission(user_id,"acaopolicia.permissao") then
local acaopolicia = vRP.getUsersByPermission("acaopolicia.permissao")
for k,v in pairs(acaopolicia) do
local nacaopolicia = vRP.getUserSource(parseInt(v))
if nacaopolicia and nacaopolicia ~= uplayer then
async(function()
local id = idgens:gen()
acaopolicia[id] = vRPclient.addBlip(nacaopolicia,x,y,z,153,84,"Localização de "..identity.name.." "..identity.firstname,0.5,false)
TriggerClientEvent("Notify",nacaopolicia,"importante","Localização recebida de <b>"..identity.name.." "..identity.firstname.."</b>.")
vRPclient._playSound(nacaopolicia,"Out_Of_Bounds_Timer","DLC_HEISTS_GENERAL_FRONTEND_SOUNDS")
SetTimeout(60000,function() vRPclient.removeBlip(nacaopolicia,acaopolicia[id]) idgens:free(id) end)
end)
end
end
TriggerClientEvent("Notify",source,"sucesso","Localização enviada com sucesso.")
vRPclient.playSound(source,"Event_Message_Purple","GTAO_FM_Events_Soundset")
end
if vRP.hasPermission(user_id,"paramedico.permissao") then
local paramedico = vRP.getUsersByPermission("paramedico.permissao")
for l,w in pairs(paramedico) do
local nparamedico = vRP.getUserSource(parseInt(w))
if nparamedico and nparamedico ~= uplayer then
async(function()
local id = idgens:gen()
paramedico[id] = vRPclient.addBlip(nparamedico,x,y,z,153,61,"Localização de "..identity.name.." "..identity.firstname,0.5,false)
TriggerClientEvent("Notify",nparamedico,"importante","Localização recebida de <b>"..identity.name.." "..identity.firstname.."</b>.")
vRPclient._playSound(nparamedico,"Out_Of_Bounds_Timer","DLC_HEISTS_GENERAL_FRONTEND_SOUNDS")
SetTimeout(60000,function() vRPclient.removeBlip(nparamedico,paramedico[id]) idgens:free(id) end)
end)
end
end
TriggerClientEvent("Notify",source,"sucesso","Localização enviada com sucesso.")
vRPclient.playSound(source,"Event_Message_Purple","GTAO_FM_Events_Soundset")
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /911
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('911',function(source,args,rawCommand)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if args[1] then
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(user_id)
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"juiz.permissao") or vRP.hasPermission(user_id,"advogado.permissao") then
if user_id then
TriggerClientEvent('chatMessage',-1,"PDL - ^1"..identity.name.." "..identity.firstname,{64,64,255},rawCommand:sub(4))
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /pd
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('pd',function(source,args,rawCommand)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if args[1] then
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(user_id)
if vRP.hasPermission(user_id,"policia.permissao") then
local policiais = vRP.getUsersByPermission("policia.permissao")
for l,w in pairs(policiais) do
local npoliciais = vRP.getUserSource(parseInt(w))
if npoliciais then
async(function()
TriggerClientEvent('chatMessage',npoliciais,identity.name.." "..identity.firstname,{64,179,255},rawCommand:sub(3))
end)
end
end
end
--[[if vRP.hasPermission(user_id,"acaopolicia.permissao") then
local acaopoliciais = vRP.getUsersByPermission("acaopolicia.permissao")
for k,v in pairs(acaopoliciais) do
local nacaopoliciais = vRP.getUserSource(parseInt(v))
if nacaopoliciais then
async(function()
TriggerClientEvent('chatMessage',nacaopoliciais,identity.name.." "..identity.firstname,{255,191,128},rawCommand:sub(3))
end)
end
end
end]]
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /112
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('112',function(source,args,rawCommand)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if args[1] then
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(user_id)
if vRP.hasPermission(user_id,"paramedico.permissao") then
if user_id then
TriggerClientEvent('chatMessage',-1,"CMDL - ^1"..identity.name.." "..identity.firstname,{255,70,135},rawCommand:sub(4))
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /pr
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('pr',function(source,args,rawCommand)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if args[1] then
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(user_id)
if vRP.hasPermission(user_id,"paramedico.permissao") then
local paramedico = vRP.getUsersByPermission("paramedico.permissao")
for l,w in pairs(paramedico) do
local player = vRP.getUserSource(parseInt(w))
if player then
async(function()
TriggerClientEvent('chatMessage',player,identity.name.." "..identity.firstname,{255,175,175},rawCommand:sub(3))
end)
end
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- PAYTOW
-----------------------------------------------------------------------------------------------------------------------------------------
--[[RegisterCommand('paytow',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRP.hasPermission(user_id,"policia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,2)
if nplayer then
local nuser_id = vRP.getUserId(nplayer)
if nuser_id then
vRP.giveMoney(nuser_id,200)
vRPclient._playAnim(source,true,{"mp_common","givetake1_a"},false)
vRPclient._playAnim(nplayer,true,{"mp_common","givetake1_a"},false)
TriggerClientEvent("Notify",source,"sucesso","Efetuou o pagamento pelo serviço do mecânico.")
TriggerClientEvent("Notify",nplayer,"sucesso","Recebeu <b>$200 dólares</b> pelo serviço de mecânico.")
end
end
end
end)]]
-----------------------------------------------------------------------------------------------------------------------------------------
-- /toggle
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('toggle1',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(user_id)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") then
TriggerEvent("vrp_sysblips:ExitService",source)
vRP.addUserGroup(user_id,"PaisanaPolicia")
vRPclient.giveWeapons(source,{},true)
vRPclient.setArmour(source,0)
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
SendWebhookMessage(webhookpolicia,"```prolog\n[POLICIAL]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[===========SAIU DE SERVICO==========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
policework[user_id] = nil
elseif vRP.hasPermission(user_id,"paisanapolicia.permissao") then
TriggerClientEvent("vrp_sysblips:ToggleService",source,"Policial em Serviço",47)
vRP.addUserGroup(user_id,"Policia")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")
SendWebhookMessage(webhookpolicia,"```prolog\n[POLICIAL]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[==========ENTROU EM SERVICO=========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
policework[user_id] = 3600
elseif vRP.hasPermission(user_id,"paramedico.permissao") then
TriggerEvent("vrp_sysblips:ExitService",source)
vRP.addUserGroup(user_id,"PaisanaParamedico")
vRPclient.giveWeapons(source,{},true)
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
SendWebhookMessage(webhookparamedico,"```prolog\n[PARAMEDICO]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[===========SAIU DE SERVICO==========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
paramedicwork[user_id] = nil
elseif vRP.hasPermission(user_id,"paisanaparamedico.permissao") and (vRPclient.checkDistance(source,312.67,-593.25,43.3,10) or vRPclient.checkDistance(source,-253.41,6333.33,32.43,10)) then
TriggerClientEvent("vrp_sysblips:ToggleService",source,"Paramédico",61)
vRP.addUserGroup(user_id,"Paramedico")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")
SendWebhookMessage(webhookparamedico,"```prolog\n[PARAMEDICO]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[==========ENTROU EM SERVICO=========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
paramedicwork[user_id] = 3600
elseif vRP.hasPermission(user_id,"mecanico.permissao") then
vRP.addUserGroup(user_id,"PaisanaMecanico")
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
SendWebhookMessage(webhookmecanico,"```prolog\n[MECANICO]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[===========SAIU DE SERVICO==========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
elseif vRP.hasPermission(user_id,"paisanamecanico.permissao") and (vRPclient.checkDistance(source,953.37,-967.59,39.77,5) or vRPclient.checkDistance(source,100.99,6619.02,32.44,5)) then
vRP.addUserGroup(user_id,"Mecanico")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")
SendWebhookMessage(webhookmecanico,"```prolog\n[MECANICO]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[==========ENTROU EM SERVICO=========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
elseif vRP.hasPermission(user_id,"juiz.permissao") then
vRP.addUserGroup(user_id,"PaisanaJuiz")
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
SendWebhookMessage(webhookjuiz,"```prolog\n[JUIZ]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[===========SAIU DE SERVICO==========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
elseif vRP.hasPermission(user_id,"paisanajuiz.permissao") then
vRP.addUserGroup(user_id,"Juiz")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")
SendWebhookMessage(webhookjuiz,"```prolog\n[JUIZ]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[==========ENTROU EM SERVICO=========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
elseif vRP.hasPermission(user_id,"advogado.permissao") then
vRP.addUserGroup(user_id,"PaisanaAdvogado")
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
SendWebhookMessage(webhookadvogado,"```prolog\n[ADVOGADO]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[===========SAIU DE SERVICO==========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
elseif vRP.hasPermission(user_id,"paisanaadvogado.permissao") then
vRP.addUserGroup(user_id,"Advogado")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")
SendWebhookMessage(webhookadvogado,"```prolog\n[ADVOGADO]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[==========ENTROU EM SERVICO=========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
--[[elseif vRP.hasPermission(user_id,"taxista.permissao") then
vRP.addUserGroup(user_id,"PaisanaTaxista")
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
elseif vRP.hasPermission(user_id,"paisanataxista.permissao") then
vRP.addUserGroup(user_id,"Taxista")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")]]
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /toggle2
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('toggle2',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(user_id)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") then
TriggerEvent("vrp_sysblips:ExitService",source)
TriggerClientEvent("Notify",source,"aviso","Você saiu de serviço.")
Citizen.Wait(1000)
TriggerClientEvent("vrp_sysblips:ToggleService",source,"Policial em Ação",3)
vRP.addUserGroup(user_id,"AcaoPolicia")
TriggerClientEvent("Notify",source,"importante","Você entrou em <b>Ação</b>.")
SendWebhookMessage(webhookpolicia,"```prolog\n[POLICIAL]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[===========SAIU DE SERVICO==========] \n[===========ENTROU EM ACAO===========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
else
if vRP.hasPermission(user_id,"acaopolicia.permissao") then
TriggerEvent("vrp_sysblips:ExitService",source)
TriggerClientEvent("Notify",source,"aviso","Você saiu da <b>Ação</b>.")
Citizen.Wait(1000)
TriggerClientEvent("vrp_sysblips:ToggleService",source,"Policial em Serviço",47)
vRP.addUserGroup(user_id,"Policia")
TriggerClientEvent("Notify",source,"sucesso","Você entrou em serviço.")
SendWebhookMessage(webhookpolicia,"```prolog\n[POLICIAL]: "..user_id.." "..identity.name.." "..identity.firstname.." \n[============SAIU DA ACAO============] \n[==========ENTROU EM SERVICO=========] "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /reanimar
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('reanimar',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"paramedico.permissao") then
TriggerClientEvent('reanimar',source)
end
end)
RegisterServerEvent("reanimar:pagamento1")
AddEventHandler("reanimar:pagamento1",function()
local user_id = vRP.getUserId(source)
if user_id then
--pagamento = math.random(50,80)
--vRP.giveMoney(user_id,pagamento)
TriggerClientEvent("Notify",source,"sucesso","Você reanimou o americano.")
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /multar
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('multar',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
vRPclient._CarregarObjeto(source,"amb@code_human_in_bus_passenger_idles@female@tablet@idle_a","idle_b","prop_cs_tablet",49,60309)
local id = vRP.prompt(source,"Passaporte:","")
local valor = vRP.prompt(source,"Valor:","")
local motivo = vRP.prompt(source,"Motivo:","")
if id == "" or valor == "" or motivo == "" then
vRPclient._DeletarObjeto(source)
return
end
local value = vRP.getUData(parseInt(id),"vRP:multas")
local multas = json.decode(value) or 0
vRP.setUData(parseInt(id),"vRP:multas",json.encode(parseInt(multas)+parseInt(valor)))
local oficialid = vRP.getUserIdentity(user_id)
local identity = vRP.getUserIdentity(parseInt(id))
local nplayer = vRP.getUserSource(parseInt(id))
if vRP.request(source,"Deseja multar o Passaporte: <b>"..id.." "..identity.name.." "..identity.firstname.."</b> em <b>$"..vRP.format(parseInt(valor)).."</b> dólares ?",30) then
SendWebhookMessage(webhookmultas,"```prolog\n[OFICIAL]: "..user_id.." "..oficialid.name.." "..oficialid.firstname.." \n[==============MULTOU==============] \n[PASSAPORTE]: "..id.." "..identity.name.." "..identity.firstname.." \n[VALOR]: $"..vRP.format(parseInt(valor)).." \n[MOTIVO]: "..motivo.." "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
randmoney = math.random(250,300)
vRP.giveMoney(user_id,parseInt(randmoney))
TriggerClientEvent("Notify",source,"sucesso","Multa aplicada com sucesso.")
TriggerClientEvent("Notify",source,"importante","Você recebeu <b>$"..vRP.format(parseInt(randmoney)).." dólares</b> de bonificação.")
vRPclient.playSound(source,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
if nplayer ~= nil then
TriggerClientEvent("Notify",nplayer,"importante","Você foi multado em <b>$"..vRP.format(parseInt(valor)).." dólares</b>.<br><b>Motivo:</b> "..motivo..".")
end
end
vRPclient._DeletarObjeto(source)
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /ocorrencia
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('ocorrencia',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") then
vRPclient._CarregarObjeto(source,"amb@code_human_in_bus_passenger_idles@female@tablet@idle_a","idle_b","prop_cs_tablet",49,60309)
local id = vRP.prompt(source,"Passaporte:","")
local ocorrencia = vRP.prompt(source,"Ocorrência:","")
if id == "" or ocorrencia == "" then
vRPclient._DeletarObjeto(source)
return
end
local oficialid = vRP.getUserIdentity(user_id)
local identity = vRP.getUserIdentity(parseInt(id))
local nplayer = vRP.getUserSource(parseInt(id))
if vRP.request(source,"Deseja registrar a ocorrência do Passaporte <b>"..id.." "..identity.name.." "..identity.firstname.."</b> ?",30) then
SendWebhookMessage(webhookocorrencias,"```prolog\n[OFICIAL]: "..user_id.." "..oficialid.name.." "..oficialid.firstname.." \n[==============OCORRENCIA==============] \n[PASSAPORTE]: "..id.." "..identity.name.." "..identity.firstname.." \n[IDENTIDADE]: "..identity.registration.." \n[TELEFONE]: "..identity.phone.." \n[OCORRENCIA]: "..ocorrencia.." "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
randmoney = math.random(650,750)
vRP.giveMoney(user_id,parseInt(randmoney))
TriggerClientEvent("Notify",source,"sucesso","Ocorrência registrada com sucesso.")
TriggerClientEvent("Notify",source,"importante","Você recebeu <b>$"..vRP.format(parseInt(randmoney)).." dólares</b> de bonificação.")
vRPclient.playSound(source,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
if nplayer ~= nil then
TriggerClientEvent("Notify",nplayer,"importante","Sua <b>Ocorrência</b> foi registrada com sucesso.")
vRPclient.playSound(nplayer,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
end
end
vRPclient._DeletarObjeto(source)
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /detido
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('detido',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") then
vRPclient._CarregarObjeto(source,"amb@code_human_in_bus_passenger_idles@female@tablet@idle_a","idle_b","prop_cs_tablet",49,60309)
local vehicle,vnetid,placa,vname,lock,banned = vRPclient.vehList(source,5)
local motivo = vRP.prompt(source,"Motivo:","")
if motivo == "" then
vRPclient._DeletarObjeto(source)
return
end
local oficialid = vRP.getUserIdentity(user_id)
if vehicle then
local puser_id = vRP.getUserByRegistration(placa)
local rows = vRP.query("creative/get_vehicles",{ user_id = parseInt(puser_id), vehicle = vname })
if rows[1] then
if parseInt(rows[1].detido) == 1 then
TriggerClientEvent("Notify",source,"importante","Este veículo já se encontra detido.",8000)
else
local identity = vRP.getUserIdentity(puser_id)
local nplayer = vRP.getUserSource(parseInt(puser_id))
if vRP.request(source,"Deseja apreender o veículo <b>"..vRP.vehicleName(vname).."</b> do Passaporte: <b>"..puser_id.." "..identity.name.." "..identity.firstname.."</b> ?",30) then
SendWebhookMessage(webhookdetido,"```prolog\n[OFICIAL]: "..user_id.." "..oficialid.name.." "..oficialid.firstname.." \n[==============PRENDEU==============] \n[CARRO]: "..vRP.vehicleName(vname).." \n[PASSAPORTE]: "..puser_id.." "..identity.name.." "..identity.firstname.." \n[MOTIVO]: "..motivo.." "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
vRP.execute("creative/set_detido",{ user_id = parseInt(puser_id), vehicle = vname, detido = 1, time = parseInt(os.time()) })
randmoney = math.random(250,300)
vRP.giveMoney(user_id,parseInt(randmoney))
TriggerClientEvent("Notify",source,"sucesso","Carro apreendido com sucesso.")
TriggerClientEvent("Notify",source,"importante","Você recebeu <b>$"..vRP.format(parseInt(randmoney)).." dólares</b> de bonificação.")
vRPclient.playSound(source,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
if nplayer ~= nil then
TriggerClientEvent("Notify",nplayer,"importante","Seu Veículo foi <b>Detido</b>.<br><b>Motivo:</b> "..motivo..".")
vRPclient.playSound(nplayer,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
end
end
end
vRPclient._DeletarObjeto(source)
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /prender
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('prender',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
vRPclient._CarregarObjeto(source,"amb@code_human_in_bus_passenger_idles@female@tablet@idle_a","idle_b","prop_cs_tablet",49,60309)
local id = vRP.prompt(source,"Passaporte:","")
local tempo = vRP.prompt(source,"Tempo:","")
local crimes = vRP.prompt(source,"Crimes:","")
if id == "" or tempo == "" or crimes == "" then
vRPclient._DeletarObjeto(source)
return
end
local oficialid = vRP.getUserIdentity(user_id)
local identity = vRP.getUserIdentity(parseInt(id))
local nplayer = vRP.getUserSource(parseInt(id))
if vRP.request(source,"Deseja prender o Passaporte: <b>"..id.." "..identity.name.." "..identity.firstname.."</b> por <b>"..vRP.format(parseInt(tempo)).." meses</b> ?",30) then
SendWebhookMessage(webhookprender,"```prolog\n[OFICIAL]: "..user_id.." "..oficialid.name.." "..oficialid.firstname.." \n[==============PRENDEU==============] \n[PASSAPORTE]: "..id.." "..identity.name.." "..identity.firstname.." \n[TEMPO]: "..vRP.format(parseInt(tempo)).." Meses \n[CRIMES]: "..crimes.." "..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```")
vRP.setUData(parseInt(id),"vRP:prisao",json.encode(parseInt(tempo)))
prison_lock(parseInt(id))
TriggerClientEvent("vrp_sound:source",source,'jaildoor',0.7)
randmoney = math.random(650,750)
vRP.giveMoney(user_id,parseInt(randmoney))
TriggerClientEvent("Notify",source,"sucesso","Prisão efetuada com sucesso.")
TriggerClientEvent("Notify",source,"importante","Você recebeu <b>$"..vRP.format(parseInt(randmoney)).." dólares</b> de bonificação.")
vRPclient.playSound(source,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
if nplayer ~= nil then
vRPclient.setHandcuffed(nplayer,false)
TriggerClientEvent('prisioneiro',nplayer,true)
vRPclient.teleport(nplayer,1680.1,2513.0,45.5)
TriggerClientEvent('removealgemas',nplayer)
TriggerClientEvent("vrp_sound:source",nplayer,'jaildoor',0.7)
TriggerClientEvent("Notify",nplayer,"importante","Você foi preso por <b>"..vRP.format(parseInt(tempo)).." meses</b>.<br><b>Motivo:</b> "..crimes..".")
vRPclient.playSound(nplayer,"Hack_Success","DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS")
SetTimeout(1000,function()
local model = vRPclient.getModelPlayer(nplayer)
if model == "mp_m_freemode_01" then
TriggerClientEvent("updateRoupas",nplayer,{ -1,0,-1,0,0,0,15,0,64,6,15,0,1,0,238,0,-1,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 })
elseif model == "mp_f_freemode_01" then
TriggerClientEvent("updateRoupas",nplayer,{ -1,0,0,0,0,0,4,0,66,6,7,0,1,1,247,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 })
end
end)
end
end
vRPclient._DeletarObjeto(source)
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /rg
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('rg',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") or vRP.hasPermission(user_id,"conce.permissao") or vRP.hasPermission(user_id,"juiz.permissao") then
if args[1] then
local nplayer = vRP.getUserSource(parseInt(args[1]))
if nplayer == nil then
TriggerClientEvent("Notify",source,"aviso","Passaporte <b>"..vRP.format(parseInt(args[1])).."</b> indisponível no momento.")
return
end
nuser_id = vRP.getUserId(nplayer)
if nuser_id then
local value = vRP.getUData(nuser_id,"vRP:multas")
local valormultas = json.decode(value) or 0
local identity = vRP.getUserIdentity(nuser_id)
local carteira = vRP.getMoney(nuser_id)
local banco = vRP.getBankMoney(nuser_id)
vRPclient.setDiv(source,"completerg",".div_completerg { background-color: rgba(0,0,0,0.60); font-size: 13px; font-family: arial; color: #fff; width: 420px; padding: 20px 20px 5px; bottom: 8%; right: 2.5%; position: absolute; border: 1px solid rgba(255,255,255,0.2); letter-spacing: 0.5px; } .local { width: 220px; padding-bottom: 15px; float: left; } .local2 { width: 200px; padding-bottom: 15px; float: left; } .local b, .local2 b { color: #d1257d; }","<div class=\"local\"><b>Nome:</b> "..identity.name.." "..identity.firstname.." ( "..vRP.format(identity.user_id).." )</div><div class=\"local2\"><b>Identidade:</b> "..identity.registration.."</div><div class=\"local\"><b>Idade:</b> "..identity.age.." Anos</div><div class=\"local2\"><b>Telefone:</b> "..identity.phone.."</div><div class=\"local\"><b>Multas pendentes:</b> "..vRP.format(parseInt(valormultas)).."</div><div class=\"local2\"><b>Carteira:</b> "..vRP.format(parseInt(carteira)).."</div>")
vRP.request(source,"Você deseja fechar o registro geral ?",1000)
vRPclient.removeDiv(source,"completerg")
end
else
local nplayer = vRPclient.getNearestPlayer(source,2)
local nuser_id = vRP.getUserId(nplayer)
if nuser_id then
local value = vRP.getUData(nuser_id,"vRP:multas")
local valormultas = json.decode(value) or 0
local identityv = vRP.getUserIdentity(user_id)
local identity = vRP.getUserIdentity(nuser_id)
local carteira = vRP.getMoney(nuser_id)
local banco = vRP.getBankMoney(nuser_id)
TriggerClientEvent("Notify",nplayer,"importante","Seu documento está sendo verificado por <b>"..identityv.name.." "..identityv.firstname.."</b>.")
vRPclient.setDiv(source,"completerg",".div_completerg { background-color: rgba(0,0,0,0.60); font-size: 13px; font-family: arial; color: #fff; width: 420px; padding: 20px 20px 5px; bottom: 8%; right: 2.5%; position: absolute; border: 1px solid rgba(255,255,255,0.2); letter-spacing: 0.5px; } .local { width: 220px; padding-bottom: 15px; float: left; } .local2 { width: 200px; padding-bottom: 15px; float: left; } .local b, .local2 b { color: #d1257d; }","<div class=\"local\"><b>Nome:</b> "..identity.name.." "..identity.firstname.." ( "..vRP.format(identity.user_id).." )</div><div class=\"local2\"><b>Identidade:</b> "..identity.registration.."</div><div class=\"local\"><b>Idade:</b> "..identity.age.." Anos</div><div class=\"local2\"><b>Telefone:</b> "..identity.phone.."</div><div class=\"local\"><b>Multas pendentes:</b> "..vRP.format(parseInt(valormultas)).."</div><div class=\"local2\"><b>Carteira:</b> "..vRP.format(parseInt(carteira)).."</div>")
vRP.request(source,"Você deseja fechar o registro geral ?",1000)
vRPclient.removeDiv(source,"completerg")
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- ALGEMAR
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent("vrp_policia:algemar")
AddEventHandler("vrp_policia:algemar",function()
local source = source
local user_id = vRP.getUserId(source)
local nplayer = vRPclient.getNearestPlayer(source,2)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if nplayer then
if exports["pd-inventory"]:getItemAmount(user_id,"algemas") >= 1 then
if vRPclient.isHandcuffed(nplayer) then
TriggerClientEvent('carregar',nplayer,source)
vRPclient._playAnim(source,false,{"mp_arresting","a_uncuff"},false)
SetTimeout(5000,function()
vRPclient.toggleHandcuff(nplayer)
TriggerClientEvent('carregar',nplayer,source)
TriggerClientEvent("vrp_sound:source",source,'uncuff',0.1)
TriggerClientEvent("vrp_sound:source",nplayer,'uncuff',0.1)
TriggerClientEvent('removealgemas',nplayer)
end)
else
if vCLIENT.checkSurrendered(nplayer) then
TriggerClientEvent('cancelando',source,true,true)
TriggerClientEvent('cancelando',nplayer,true,true)
TriggerClientEvent('carregar',nplayer,source)
vRPclient._playAnim(source,false,{"mp_arrest_paired","cop_p2_back_left"},false)
vRPclient._playAnim(nplayer,false,{"mp_arrest_paired","crook_p2_back_left"},false)
SetTimeout(3500,function()
vRPclient._stopAnim(source,false)
vRPclient.toggleHandcuff(nplayer)
TriggerClientEvent('carregar',nplayer,source)
TriggerClientEvent('cancelando',source,false,false)
TriggerClientEvent('cancelando',nplayer,false,false)
TriggerClientEvent("vrp_sound:source",source,'cuff',0.1)
TriggerClientEvent("vrp_sound:source",nplayer,'cuff',0.1)
TriggerClientEvent('setalgemas',nplayer)
end)
else
TriggerClientEvent("Notify",source,"negado","O inidividuo precisa estar <b>rendido</b>.",source)
end
end
else
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
if vRPclient.isHandcuffed(nplayer) then
TriggerClientEvent('carregar',nplayer,source)
vRPclient._playAnim(source,false,{"mp_arresting","a_uncuff"},false)
SetTimeout(5000,function()
vRPclient.toggleHandcuff(nplayer)
TriggerClientEvent('carregar',nplayer,source)
TriggerClientEvent("vrp_sound:source",source,'uncuff',0.1)
TriggerClientEvent("vrp_sound:source",nplayer,'uncuff',0.1)
TriggerClientEvent('removealgemas',nplayer)
end)
else
if vCLIENT.checkSurrendered(nplayer) then
TriggerClientEvent('cancelando',source,true,true)
TriggerClientEvent('cancelando',nplayer,true,true)
TriggerClientEvent('carregar',nplayer,source)
vRPclient._playAnim(source,false,{"mp_arrest_paired","cop_p2_back_left"},false)
vRPclient._playAnim(nplayer,false,{"mp_arrest_paired","crook_p2_back_left"},false)
SetTimeout(3500,function()
vRPclient._stopAnim(source,false)
vRPclient.toggleHandcuff(nplayer)
TriggerClientEvent('carregar',nplayer,source)
TriggerClientEvent('cancelando',source,false,false)
TriggerClientEvent('cancelando',nplayer,false,false)
TriggerClientEvent("vrp_sound:source",source,'cuff',0.1)
TriggerClientEvent("vrp_sound:source",nplayer,'cuff',0.1)
TriggerClientEvent('setalgemas',nplayer)
end)
else
TriggerClientEvent("Notify",source,"negado","O inidividuo precisa estar <b>rendido</b>.")
end
end
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- CARREGAR
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent("vrp_policia:carregar")
AddEventHandler("vrp_policia:carregar",function()
local source = source
local user_id = vRP.getUserId(source)
local nplayer = vRPclient.getNearestPlayer(source,2)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if nplayer then
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
TriggerClientEvent('carregar',nplayer,source)
else
if exports["pd-inventory"]:getItemAmount(user_id,"cordas") >= 1 then
if vRPclient.isHandcuffed(nplayer) or vRPclient.getHealth(nplayer) <= 101 then
TriggerClientEvent('carregar',nplayer,source)
else
TriggerClientEvent("Notify",source,"aviso","A pessoa precisa estar <b>Algemada</b> ou <b>Inconsciente</b>.")
end
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /rmascara
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('rmascara',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,2)
if nplayer then
TriggerClientEvent('rmascara',nplayer)
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /rchapeu
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('rchapeu',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,2)
if nplayer then
TriggerClientEvent('rchapeu',nplayer)
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /rcolete
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('rcolete',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,2)
if nplayer then
vRPclient.setArmour(nplayer,0)
TriggerClientEvent("removeColeteUser",nplayer)
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /rcapuz
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('rcapuz',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,2)
if nplayer then
if vRPclient.isCapuz(nplayer) then
vRPclient.setCapuz(nplayer)
TriggerClientEvent("Notify",source,"sucesso","Capuz colocado com sucesso.")
else
TriggerClientEvent("Notify",source,"importante","A pessoa não está com o capuz na cabeça.")
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /cv
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('cv',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,10)
if nplayer then
vRPclient.putInNearestVehicleAsPassenger(nplayer,7)
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /rv
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('rv',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,10)
if nplayer then
vRPclient.ejectVehicle(nplayer)
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /apreender
-----------------------------------------------------------------------------------------------------------------------------------------
local itemlist = {
"dinheirosujo",
"algemas",
"cordas",
"capuz",
"lockpick",
"masterpick",
"orgao",
"etiqueta",
"pendrive",
"relogioroubado",
"pulseiraroubada",
"anelroubado",
"colarroubado",
"brincoroubado",
"carteiraroubada",
"tabletroubado",
"sapatosroubado",
"carregadorroubado",
"vibradorroubado",
"perfumeroubado",
"maquiagemroubada",
"armacaodearma",
"pecadearma",
"maconha",
"metanfetamina",
"cocaina",
"lsd",
"logsinvasao",
"acessodeepweb",
"keysinvasao",
"pendriveinformacoes",
"radio",
"placa",
"keycard",
"capsula",
"polvora",
"turtlemeat",
"dagger",
"bat",
"bottle",
"crowbar",
"flashlight",
"golfclub",
"hammer",
"hatchet",
"knuckle",
"knife",
"machete",
"switchblade",
"nightstick",
"wrench",
"battleaxe",
"poolcue",
"stone_hatchet",
"pistol",
"combatpistol",
"carbinerifle",
"smg",
"pumpshotgun_mk2",
"stungun",
"nightstick",
"snspistol",
"microsmg",
"assaultrifle",
"fireextinguisher",
"flare",
"revolver",
"pistol_mk2",
"vintagepistol",
"musket",
"gusenberg",
"assaultsmg",
"combatpdw",
"compactrifle",
"carbinerifle_mk2",
"machinepistol",
"ammo_dagger",
"ammo_bat",
"ammo_bottle",
"ammo_crowbar",
"ammo_flashlight",
"ammo_golfclub",
"ammo_hammer",
"ammo_hatchet",
"ammo_knuckle",
"ammo_knife",
"ammo_machete",
"ammo_switchblade",
"ammo_nightstick",
"ammo_wrench",
"ammo_battleaxe",
"ammo_poolcue",
"ammo_stone_hatchet",
"ammo_pistol",
"ammo_combatpistol",
"ammo_carbinerifle",
"ammo_smg",
"ammo_pumpshotgun",
"ammo_pumpshotgun_mk2",
"ammo_stungun",
"ammo_nightstick",
"ammo_snspistol",
"ammo_microsmg",
"ammo_assaultrifle",
"ammo_fireextinguisher",
"ammo_flare",
"ammo_revolver",
"ammo_pistol_mk2",
"ammo_vintagepistol",
"ammo_musket",
"ammo_gusenberg",
"ammo_assaultsmg",
"ammo_combatpdw",
"ammo_machinepistol",
"ammo_carbinerifle_mk2",
"ammo_compactrifle"
}
RegisterCommand('apreender',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isInVehicle(source) or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
local nplayer = vRPclient.getNearestPlayer(source,2)
if nplayer then
local nuser_id = vRP.getUserId(nplayer)
if nuser_id then
TriggerClientEvent('cancelando',source,true,true)
TriggerClientEvent('cancelando',nplayer,true,true)
TriggerClientEvent('carregar',nplayer,source)
vRPclient._playAnim(source,false,{"misscarsteal4@director_grip","end_loop_grip"},true)
vRPclient._playAnim(nplayer,true,{"random@arrests@busted","idle_a"},true)
TriggerClientEvent("progress",source,5000,"apreendendo")
SetTimeout(5000,function()
local weapons = vRPclient.replaceWeapons(nplayer,{})
for k,v in pairs(weapons) do
exports["pd-inventory"]:giveItem(nuser_id, string.sub(string.lower(k),8), 1, true)
if v.ammo > 0 then
string.lower("ammo_"..string.lower(k))
exports["pd-inventory"]:giveItem(nuser_id, "ammo_"..string.sub(string.lower(k),8), v.ammo, true)
end
end
for k,v in pairs(itemlist) do
local amount = exports["pd-inventory"]:getItemAmount(nuser_id, v)
if amount > 0 then
exports["pd-inventory"]:consumeItem(nuser_id, v, parseInt(amount), true)
exports["pd-inventory"]:giveItem(user_id,v,amount, true,"Recebeu",true)
end
end
vRPclient._stopAnim(source,false)
vRPclient._stopAnim(nplayer,false)
TriggerClientEvent('cancelando',source,false,false)
TriggerClientEvent('cancelando',nplayer,false,false)
TriggerClientEvent('carregar',nplayer,source)
TriggerClientEvent("Notify",nplayer,"importante","Todos os seus pertences foram apreendidos.")
TriggerClientEvent("Notify",source,"importante","Apreendeu todos os pertences da pessoa.")
end)
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /arsenal
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('arsenal',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRP.hasPermission(user_id,"policia.permissao") then
TriggerClientEvent('arsenal',source)
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /extras
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('extras',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") then
if vRPclient.isInVehicle(source) then
TriggerClientEvent('extras',source)
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- TRYEXTRAS
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent("tryextras")
AddEventHandler("tryextras",function(index,extra)
TriggerClientEvent("syncextras",-1,index,parseInt(extra))
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /cone
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('cone',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"conce.permissao") or vRP.hasPermission(user_id,"mecanico.permissao") then
TriggerClientEvent('cone',source,args[1])
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /barreira
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('barreira',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"conce.permissao") or vRP.hasPermission(user_id,"mecanico.permissao") then
TriggerClientEvent('barreira',source,args[1])
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /spike
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('spike',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"policia.permissao") then
TriggerClientEvent('spike',source,args[1])
end
end)
--------------------------------------------------------------------------------------------------------------------------------------------------
-- DISPAROS
--------------------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent('atirando')
AddEventHandler('atirando',function(x,y,z)
local user_id = vRP.getUserId(source)
if user_id then
if vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"acaopolicia.permissao") then
return
end
local policia = vRP.getUsersByPermission("policia.permissao")
for l,w in pairs(policia) do
local player = vRP.getUserSource(w)
if player then
async(function()
TriggerClientEvent('notificacao',player,x,y,z,user_id)
--TriggerClientEvent("NotifyPush",player,{ code = 10, title = "Ocorrência em andamento", x = x, y = y, z = z, badge = "Disparos de arma de fogo" })
end)
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /anuncio
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand('anuncio',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"admin.permissao") or vRP.hasPermission(user_id,"policia.permissao") or vRP.hasPermission(user_id,"conce.permissao") then
local identity = vRP.getUserIdentity(user_id)
local mensagem = vRP.prompt(source,"Mensagem:","")
if mensagem == "" then
return
end
vRPclient.setDiv(-1,"anuncio",".div_anuncio { background: rgba(0,128,192,0.8); font-size: 11px; font-family: arial; color: #fff; padding: 20px; bottom: 20%; right: 5%; max-width: 500px; position: absolute; -webkit-border-radius: 5px; } bold { font-size: 16px; }","<bold>"..mensagem.."</bold><br><br>Mensagem enviada por: "..identity.name.." "..identity.firstname)
SetTimeout(30000,function()
vRPclient.removeDiv(-1,"anuncio")
end)
end
end)
--------------------------------------------------------------------------------------------------------------------------------------------------
-- PRISÃO
--------------------------------------------------------------------------------------------------------------------------------------------------
AddEventHandler("vRP:playerSpawn",function(user_id,source,first_spawn)
local player = vRP.getUserSource(parseInt(user_id))
if player then
SetTimeout(30000,function()
local value = vRP.getUData(parseInt(user_id),"vRP:prisao")
local tempo = json.decode(value) or -1
if tempo == -1 then
return
end
if tempo > 0 then
TriggerClientEvent('prisioneiro',player,true)
vRPclient.teleport(player,1680.1,2513.0,46.5)
prison_lock(parseInt(user_id))
end
end)
end
end)
function prison_lock(target_id)
local player = vRP.getUserSource(parseInt(target_id))
if player then
SetTimeout(60000,function()
local value = vRP.getUData(parseInt(target_id),"vRP:prisao")
local tempo = json.decode(value) or 0
if parseInt(tempo) >= 1 then
TriggerClientEvent("Notify",player,"importante","Ainda vai passar <b>"..parseInt(tempo).." meses</b> preso.")
vRP.setUData(parseInt(target_id),"vRP:prisao",json.encode(parseInt(tempo)-1))
prison_lock(parseInt(target_id))
elseif parseInt(tempo) == 0 then
TriggerClientEvent('prisioneiro',player,false)
vRPclient.teleport(player,1850.5,2604.0,45.5)
vRP.setUData(parseInt(target_id),"vRP:prisao",json.encode(-1))
TriggerClientEvent("Notify",player,"importante","Sua sentença terminou, esperamos não ve-lo novamente.")
end
vRPclient.PrisionGod(player)
end)
end
end
-----------------------------------------------------------------------------------------------------------------------------------------
-- DIMINUIR PENA
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent("diminuirpena1")
AddEventHandler("diminuirpena1",function()
local source = source
local user_id = vRP.getUserId(source)
local value = vRP.getUData(parseInt(user_id),"vRP:prisao")
local tempo = json.decode(value) or 0
if tempo >= 10 then
vRP.setUData(parseInt(user_id),"vRP:prisao",json.encode(parseInt(tempo)-4))
TriggerClientEvent("Notify",source,"importante","Sua pena foi reduzida em <b>4 meses</b>, continue o trabalho.")
else
TriggerClientEvent("Notify",source,"importante","Atingiu o limite da redução de pena, não precisa mais trabalhar.")
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /preset
-----------------------------------------------------------------------------------------------------------------------------------------
local presets = {
["1"] = {
["male"] = { 121,0,-1,0,-1,0,4,0,25,0,58,0,21,0,26,0,13,0,-1,0,13,0,5,5,-1,-1,-1,-1,-1,-1 },
["female"] = { 121,0,-1,0,-1,0,14,0,41,0,35,0,59,1,25,0,14,0,-1,0,13,0,11,0,-1,-1,-1,-1,-1,-1 }
},
["2"] = {
["male"] = { 121,0,-1,0,1,0,0,0,47,0,57,0,25,0,93,0,-1,0,-1,0,10,0,5,0,-1,-1,-1,-1,-1,-1 },
["female"] = { 121,0,-1,0,1,0,14,0,49,0,34,0,25,0,84,0,-1,0,-1,0,10,0,11,0,-1,-1,-1,-1,-1,-1 }
},
["3"] = {
["male"] = { 121,0,-1,0,1,0,19,0,31,0,38,1,25,0,118,0,0,0,-1,0,10,0,5,0,-1,-1,-1,-1,-1,-1 },
["female"] = { 121,0,-1,0,1,0,20,0,30,0,34,0,25,0,25,0,0,0,-1,0,10,2,11,0,-1,-1,-1,-1,-1,-1 }
},
["4"] = {
["male"] = { 121,0,-1,0,-1,0,4,0,25,1,58,0,21,0,26,1,13,0,-1,0,13,1,5,5,-1,-1,-1,-1,-1,-1 },
["female"] = { 121,0,-1,0,-1,0,14,0,41,1,35,0,59,1,25,1,14,0,-1,0,13,1,11,0,-1,-1,-1,-1,-1,-1 }
},
["5"] = {
["male"] = { 121,1,-1,0,1,0,0,0,47,1,57,0,25,0,93,1,-1,0,-1,0,10,1,5,0,-1,-1,-1,-1,-1,-1 },
["female"] = { 121,0,-1,0,1,0,14,0,49,1,34,0,25,0,84,1,-1,0,-1,0,10,1,11,0,-1,-1,-1,-1,-1,-1 }
},
["6"] = {
["male"] = { -1,0,-1,0,126,0,81,0,10,0,38,0,51,0,118,2,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { 0,0,0,0,14,3,93,0,6,0,27,0,0,0,25,2,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["7"] = {
["male"] = { -1,0,-1,0,126,0,81,0,10,0,38,0,51,0,118,3,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { 0,0,0,0,14,3,93,0,6,0,27,0,0,0,25,3,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["8"] = {
["male"] = { -1,0,-1,0,126,0,81,0,10,0,38,0,51,0,118,4,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { 0,0,0,0,14,3,93,0,6,0,27,0,0,0,25,4,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["9"] = {
["male"] = { -1,0,-1,0,126,0,81,0,20,0,38,0,7,0,118,5,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { 0,0,0,0,14,3,93,0,23,0,27,0,0,2,25,5,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["10"] = {
["male"] = { -1,0,-1,0,126,0,4,0,4,4,96,0,1,1,142,2,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { 0,0,0,0,14,3,7,0,73,1,64,2,0,0,139,2,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["11"] = {
["male"] = { 0,0,21,10,30,0,74,0,97,19,38,0,24,0,146,2,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { 0,0,21,10,14,0,85,0,100,19,27,0,66,3,141,4,-1,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["12"] = {
["male"] = { -1,0,-1,0,126,0,74,0,3,3,15,0,7,0,16,1,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
["female"] = { -1,0,-1,0,14,3,96,0,50,2,15,0,10,1,141,1,-1,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }
},
["13"] = {
["male"] = { -1,0,46,0,29,2,4,0,24,0,31,0,10,0,30,0,-1,0,-1,0,-1,-1,7,0,-1,-1,-1,-1,-1,-1 },
["female"] = { -1,0,-1,0,-1,3,26,0,6,0,23,1,42,0,90,0,-1,0,-1,0,-1,-1,2,5,-1,-1,-1,-1,-1,-1 }
}
}
RegisterCommand("preset",function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRPclient.getHealth(source) <= 101 or vRPclient.getArmour(source) >= 1 or vRPclient.isInVehicle(source) or vRPclient.isHandcuffed(source) then
return
end
if vRP.hasPermission(user_id,"polpar.permissao") or vRP.hasPermission(user_id,"juiz.permissao") then
if args[1] then
if args[1] == "save" then
local custom = vRPclient.getCustomPlayer(source)
if custom then
vRP.setUData(parseInt(user_id),"vRP:defaultVisual",json.encode(custom))
TriggerClientEvent("Notify",source,"sucesso","Preset salvo com sucesso.",8000)
end
elseif presets[tostring(args[1])] then
local model = vRPclient.getModelPlayer(source)
if model == "mp_m_freemode_01" then
TriggerClientEvent("updateRoupas",source,presets[tostring(args[1])]["male"])
elseif model == "mp_f_freemode_01" then
TriggerClientEvent("updateRoupas",source,presets[tostring(args[1])]["female"])
end
end
else
local consulta = vRP.getUData(parseInt(user_id),"vRP:defaultVisual")
local resultado = json.decode(consulta) or {}
if resultado then
TriggerClientEvent("updateRoupas",source,resultado)
end
end
end
end)
-----------------------------------------------------------------------------------------------------------------------------------------
-- /a
-----------------------------------------------------------------------------------------------------------------------------------------
RegisterCommand("a",function(source,args,rawCommand)
local source = source
local user_id = vRP.getUserId(source)
if vRP.hasPermission(user_id,"admin.permissao") then
if args[1] == "rayp" then
vRPclient.giveWeapons(source,{["WEAPON_RAYPISTOL"] = { ammo = 0 }})
elseif args[1] == "fire" then
vRPclient.giveWeapons(source,{["WEAPON_FIREWORK"] = { ammo = 250 }})
elseif args[1] == "sniper" then
vRPclient.giveWeapons(source,{["WEAPON_HEAVYSNIPER_MK2"] = { ammo = 250 }})
elseif args[1] == "appistol" then
vRPclient.giveWeapons(source,{["WEAPON_APPISTOL"] = { ammo = 250 }})
elseif args[1] == "gas" then
vRPclient.giveWeapons(source,{["WEAPON_BZGAS"] = { ammo = 1 }})
end
end
end)
|
function onLoad(save_state)
self.setColorTint(Global.getVar("battlefieldTint"))
end
|
---
-- @module BTMustReload
--
-- ------------------------------------------------
-- Required Modules
-- ------------------------------------------------
local Log = require( 'src.util.Log' )
local BTLeaf = require( 'src.characters.ai.behaviortree.leafs.BTLeaf' )
-- ------------------------------------------------
-- Module
-- ------------------------------------------------
local BTMustReload = BTLeaf:subclass( 'BTMustReload' )
-- ------------------------------------------------
-- Public Methods
-- ------------------------------------------------
function BTMustReload:traverse( ... )
local _, character = ...
local result = character:getWeapon():isEmpty()
Log.debug( result, 'BTMustReload' )
return result
end
return BTMustReload
|
function TeapotGenerator(property)
local size = property.size
return {
MeshData = function ()
local gen = PrimitiveGenerator()
return gen:Teapot(size)
end
}
end
|
--[[
Copyright © 2022 Marlon de Oliveira Gomes.
MIT License
Project: Pong-Lua
A remake of the classic Atari game Pong in Lua.
File: main.lua
The Main Program
Contact: 72144990+Marlon-Gomes@users.noreply.github.com
]]
--[[
Low-res appearance: push (https://github.com/Ulydev/push) is a library
that allows us to draw the game at a virtual resolution.
]]
-- External libraries
local push = require 'external/push'
-- Importing source
local constants = require 'src/constants'
local Ball = require 'src/Ball'
local Paddle = require 'src/Paddle'
local Player = require 'src/Player'
local Scoreboard = require 'src/Scoreboard'
-- Initializer
function love.load()
-- use nearest-neighbor filtering on upscaling and downscaling
love.graphics.setDefaultFilter('nearest','nearest')
-- set the title of our application window
love.window.setTitle('Pong')
-- set a random seed based on UNIX timestamp
math.randomseed(os.time())
-- Declare fonts
-- Set font for the welcome screen
love.graphics.setFont(constants.SMALLFONT)
-- initialize virtualization
push:setupScreen(
constants.VIRTUAL_WIDTH,
constants.VIRTUAL_HEIGHT,
constants.WINDOW_WIDTH,
constants.WINDOW_HEIGHT,
{
fullscreen = false,
resizable = true,
vsync = true
}
)
-- Initialize the game's assets
-- Ball
ball = Ball()
-- Players (each with their own paddle and score).
player1 = Player(1)
player2 = Player(2)
-- Scoreboard
scoreboard = Scoreboard()
--[[
Initialize the game state into 'start' mode
]]
gameState = 'start'
end
-- Enable resizing via push
function love.resize(w, h)
push:resize(w,h)
end
function love.update(dt)
if gameState == 'serve' then
ball:reset(servingPlayer)
elseif gameState == 'play' then
--[[
Check if ball has collided with either the top or bottom edges or
one of the paddles. If so, handle the collision.
]]
ball:handleCollisions(player1.paddle, player2.paddle)
--[[
Check if the ball has gone out of bounds. If so, increment score
and reset the ball.
]]
if ball.x < 0 then
player2.score = player2.score + 1
servingPlayer = 2
if player2.score == 11 then
winningPlayer = 2
constants.VICTORY:play()
gameState = 'done'
else
constants.SCORE:play()
gameState = 'serve'
end
elseif ball.x > constants.VIRTUAL_WIDTH then
player1.score = player1.score + 1
servingPlayer = 1
if player1.score == 11 then
winningPlayer = 1
constants.VICTORY:play()
gameState = 'done'
else
constants.SCORE:play()
gameState = 'serve'
end
end
-- Player 1 movement
player1.paddle:update(dt)
-- Player 2 movement
player2.paddle:update(dt)
-- Ball movement
ball:update(dt)
end
end
--[[
Game state handling
]]
function love.keypressed(key)
if key == 'escape' then -- Terminate the application
love.event.quit()
elseif key == 'enter' or key == 'return' then
if gameState == 'start' then -- Initialize game
gameState = 'play'
elseif gameState == 'serve' then
gameState = 'play'
elseif gameState == 'done' then
-- Return to start screen
gameState = 'start'
-- Reset game assets
-- Player scores
player1:reset()
player2:reset()
-- Ball positions
ball:reset()
servingPlayer = nil
winningPlayer = nil
else -- Return to start screen
gameState = 'start'
-- Reset game assets
-- Player scores
player1:reset()
player2:reset()
-- Ball positions
ball:reset()
servingPlayer = nil
winningPlayer = nil
end
end
end
--[[
Draw to the screen.
]]
function love.draw()
-- begin rendering at virtual resolution
push:apply('start')
--[[
clear the screen; since LÖVE2D 11.0, color components are measured
between 0 and 1
--]]
love.graphics.clear(40/255, 45/255, 52/255, 1)
-- using virtual width and virtual height
love.graphics.setFont(constants.SMALLFONT)
-- Draw regardless of game game state
--[[
Add rectangles for paddles and ball
]]
-- left side
player1.paddle:render()
-- right side
player2.paddle:render()
-- Draw "Hello, Pong!" if game is in start mode
if gameState == 'start' then
love.graphics.printf(
'Hello, Pong!', -- Welcome text
0, -- Starting X
constants.VIRTUAL_HEIGHT / 2 - 6, -- Starting Y
constants.VIRTUAL_WIDTH, -- # of pixels to center within
'center' -- alignment mode
)
elseif gameState == 'serve' then
love.graphics.setFont(constants.SMALLFONT)
love.graphics.printf(
'Player ' .. tostring(servingPlayer) .. "'s serve!",
0, 10, constants.VIRTUAL_WIDTH, 'center'
)
love.graphics.printf(
'Press Enter to serve!', 0, 20, constants.VIRTUAL_WIDTH, 'center'
)
-- Draw game score board and ball only if game is in play mode
elseif gameState == 'play' then
-- Draw scoreboard
scoreboard:render(player1.score, player2.score)
-- Draw ball
ball:render()
elseif gameState == 'done' then
love.graphics.setFont(constants.LARGEFONT)
love.graphics.printf(
"Player " .. tostring(winningPlayer) .. " wins!",
0, 10, constants.VIRTUAL_WIDTH, 'center'
)
love.graphics.setFont(constants.SMALLFONT)
love.graphics.printf(
'Press enter to restart!',
0, 30, constants.VIRTUAL_WIDTH, 'center'
)
end
-- new function just to demonstrate how to see FPS in LÖVE2D
displayFPS()
-- end rendering at virtual resolution
push:apply('end')
end
-- Renders the current FPS.
function displayFPS()
-- simple FPS display across all states
love.graphics.setFont(constants.SMALLFONT)
love.graphics.setColor(0, 255, 0, 255)
love.graphics.print('FPS: ' .. tostring(love.timer.getFPS()), 10, 10)
end
|
if (SERVER) then
SWEP.Weight = 10
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
end
if ( CLIENT ) then
SWEP.PrintName = "9mm MP5 Kurz"
SWEP.Author = "Black Tea"
SWEP.Instructions = "Left Click to Swing."
SWEP.ShowWorldModel = true
end
SWEP.Category = "Black Tea Firearms"
SWEP.Base = "hl2_base"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.UseHands = false -- temp
SWEP.Slot = 1 // Slot in the weapon selection menu
SWEP.SlotPos = 1 // Position in the slot
SWEP.HoldType = "smg"
SWEP.WorldModel = "models/weapons/w_mp5k.mdl"
SWEP.ViewModel = "models/weapons/v_mp5k.mdl"
SWEP.Primary.Sound = Sound( "Weapon_C_Pistol.Single" )
SWEP.Primary.ReloadSound = Sound( "Weapon_MP5k.Reload" )
SWEP.Primary.Automatic = true
SWEP.Primary.ClipSize = 25 // Size of a clip
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Ammo = "pistol"
SWEP.Primary.Delay = .09
SWEP.Primary.Damage = 40
SWEP.Primary.Spread = .05
SWEP.MuzScale = .25
SWEP.SprintPos = Vector(-5, -4, 0)
SWEP.SprintAng = Vector(-15.7, 20.799, -40)
--SWEP.ReOriginPos = Vector(1.1, -2, 1.5 )
SWEP.CustomRecoil = Vector( 0, -7, -1 )
SWEP.ReOriginPos = Vector( 0, 0, 1 )
SWEP.ReOriginAng = Vector(0, 0, 0 )
|
require('Navigator').setup({auto_save = 'nil', disable_on_zoom = false})
vim.api.nvim_set_keymap('n', "<M-H>", "<CMD>lua require('Navigator').left()<CR>",
{noremap = true, silent = true})
vim.api.nvim_set_keymap('n', "<M-K>", "<CMD>lua require('Navigator').up()<CR>",
{noremap = true, silent = true})
vim.api.nvim_set_keymap('n', "<M-L>", "<CMD>lua require('Navigator').right()<CR>",
{noremap = true, silent = true})
vim.api.nvim_set_keymap('n', "<M-J>", "<CMD>lua require('Navigator').down()<CR>",
{noremap = true, silent = true})
|
--無尽機関アルギロ・システム
--
--Script by JustFish
function c101108054.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101108054,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101108054)
e1:SetTarget(c101108054.target)
e1:SetOperation(c101108054.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101108054,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,101108054)
e2:SetTarget(c101108054.tg)
e2:SetOperation(c101108054.op)
c:RegisterEffect(e2)
end
function c101108054.tgfilter(c)
return c:IsSetCard(0x27a) and c:IsAbleToGrave()
end
function c101108054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101108054.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101108054.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101108054.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c101108054.filter(c,b1,b2)
return c:IsSetCard(0x27a) and ((b1 and c:IsAbleToHand()) or (b2 and c:IsAbleToDeck()))
end
function c101108054.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local b1,b2=c:IsAbleToDeck(),c:IsAbleToHand()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101108054.filter(chkc,b1,b2) end
if chk==0 then return Duel.IsExistingTarget(c101108054.filter,tp,LOCATION_GRAVE,0,1,nil,b1,b2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101108054.filter,tp,LOCATION_GRAVE,0,1,1,nil,b1,b2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c101108054.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local g=Group.FromCards(tc,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
g:Sub(tg)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg:GetFirst())
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
|
local playsession = {
{"kjh2663", {776122}},
{"hinr", {634621}},
{"Yadon_poi", {3483}},
{"Stinson_5", {179711}},
{"zipell135", {2499}},
{"cabb99", {298017}},
{"MasterMatz", {171584}},
{"ColonelWill", {24138}},
{"yottahawk", {2984}}
}
return playsession
|
-- Copyright 2017 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
local fs = require("nixio.fs")
local uci = require("uci")
local sys = require("luci.sys")
local json = require("luci.jsonc")
local adbinput = uci.get("adblock", "global", "adb_rtfile") or "/tmp/adb_runtime.json"
local parse = json.parse(fs.readfile(adbinput) or "")
local dnsFile1 = sys.exec("find '/tmp/dnsmasq.d/.adb_hidden' -maxdepth 1 -type f -name 'adb_list*' -print 2>/dev/null")
local dnsFile2 = sys.exec("find '/var/lib/unbound/.adb_hidden' -maxdepth 1 -type f -name 'adb_list*' -print 2>/dev/null")
m = Map("adblock", translate("Adblock"),
translate("Configuration of the adblock package to block ad/abuse domains by using DNS. ")
.. translatef("For further information "
.. "<a href=\"%s\" target=\"_blank\">"
.. "see online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md"))
function m.on_after_commit(self)
function e3.validate(self, value)
if value == "0" then
luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1")
else
luci.sys.call("/etc/init.d/adblock start >/dev/null 2>&1")
end
end
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock"))
end
-- Main adblock options
s = m:section(NamedSection, "global", "adblock")
o1 = s:option(Flag, "adb_enabled", translate("Enable adblock"))
o1.default = o1.enabled
o1.rmempty = false
btn = s:option(Button, "", translate("Suspend / Resume adblock"))
if dnsFile1 ~= "" or dnsFile2 ~= "" then
btn.inputtitle = translate("Resume adblock")
btn.inputstyle = "apply"
btn.disabled = false
function btn.write()
luci.sys.call("/etc/init.d/adblock resume >/dev/null 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock"))
end
else
btn.inputtitle = translate("Suspend adblock")
btn.inputstyle = "reset"
btn.disabled = false
function btn.write()
luci.sys.call("/etc/init.d/adblock suspend >/dev/null 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock"))
end
end
o2 = s:option(Value, "adb_iface", translate("Restrict interface trigger to certain interface(s)"),
translate("Space separated list of interfaces that trigger adblock processing. "..
"To disable event driven (re-)starts remove all entries."))
o2.rmempty = true
o3 = s:option(Value, "adb_triggerdelay", translate("Trigger delay"),
translate("Additional trigger delay in seconds before adblock processing begins."))
o3.default = 2
o3.datatype = "range(1,90)"
o3.rmempty = false
o4 = s:option(Flag, "adb_debug", translate("Enable verbose debug logging"))
o4.default = o4.disabled
o4.rmempty = false
-- Runtime information
ds = s:option(DummyValue, "_dummy", translate("Runtime information"))
ds.template = "cbi/nullsection"
dv1 = s:option(DummyValue, "status", translate("Status"))
dv1.template = "adblock/runtime"
if parse == nil then
dv1.value = translate("n/a")
elseif parse.data.blocked_domains == "0" then
dv1.value = translate("no domains blocked")
elseif dnsFile1 ~= "" or dnsFile2 ~= "" then
dv1.value = translate("suspended")
else
dv1.value = translate("active")
end
dv2 = s:option(DummyValue, "adblock_version", translate("Adblock version"))
dv2.template = "adblock/runtime"
if parse ~= nil then
dv2.value = parse.data.adblock_version or translate("n/a")
else
dv2.value = translate("n/a")
end
dv3 = s:option(DummyValue, "fetch_info", translate("Download Utility (SSL Library)"),
translate("For SSL protected blocklist sources you need a suitable SSL library, e.g. 'libustream-ssl' or the wget 'built-in'."))
dv3.template = "adblock/runtime"
if parse ~= nil then
dv3.value = parse.data.fetch_info or translate("n/a")
else
dv3.value = translate("n/a")
end
dv4 = s:option(DummyValue, "dns_backend", translate("DNS backend"))
dv4.template = "adblock/runtime"
if parse ~= nil then
dv4.value = parse.data.dns_backend or translate("n/a")
else
dv4.value = translate("n/a")
end
dv5 = s:option(DummyValue, "blocked_domains", translate("Blocked domains (overall)"))
dv5.template = "adblock/runtime"
if parse ~= nil then
dv5.value = parse.data.blocked_domains or translate("n/a")
else
dv5.value = translate("n/a")
end
dv6 = s:option(DummyValue, "last_rundate", translate("Last rundate"))
dv6.template = "adblock/runtime"
if parse ~= nil then
dv6.value = parse.data.last_rundate or translate("n/a")
else
dv6.value = translate("n/a")
end
-- Blocklist table
bl = m:section(TypedSection, "source", translate("Blocklist sources"),
translate("Available blocklist sources. ")
.. translate("Note that list URLs and Shallalist category selections are configurable in the 'Advanced' section."))
bl.template = "cbi/tblsection"
name = bl:option(Flag, "enabled", translate("Enabled"))
name.rmempty = false
ssl = bl:option(DummyValue, "adb_src", translate("SSL req."))
function ssl.cfgvalue(self, section)
local source = self.map:get(section, "adb_src")
if source and source:match("https://") then
return translate("Yes")
else
return translate("No")
end
end
des = bl:option(DummyValue, "adb_src_desc", translate("Description"))
-- Extra options
e = m:section(NamedSection, "global", "adblock", translate("Extra options"),
translate("Options for further tweaking in case the defaults are not suitable for you."))
e1 = e:option(Flag, "adb_forcedns", translate("Force local DNS"),
translate("Redirect all DNS queries to the local resolver."))
e1.default = e1.disabled
e1.rmempty = false
e2 = e:option(Flag, "adb_forcesrt", translate("Force Overall Sort"),
translate("Enable memory intense overall sort / duplicate removal on low memory devices (< 64 MB RAM)"))
e2.default = e2.disabled
e2.rmempty = false
e3 = e:option(Flag, "adb_manmode", translate("Manual mode"),
translate("Do not automatically update blocklists during startup, use blocklist backups instead."))
e3.default = e3.disabled
e3.rmempty = false
e4 = e:option(Flag, "adb_backup", translate("Enable blocklist backup"),
translate("Create compressed blocklist backups, they will be used in case of download errors or during startup in manual mode."))
e4.default = e4.disabled
e4.rmempty = false
e5 = e:option(Value, "adb_backupdir", translate("Backup directory"))
e5.datatype = "directory"
e5.rmempty = false
return m
|
-- heartbeat.lua
-- Created by wugd
-- 心跳相关函数
-- 定义公共接口,按照字母顺序排序
local heartbeat_funcs = {};
-- 调用心跳回调函数
function post_heartbeat(ob_class, ob)
local func_list = heartbeat_funcs[ob_class];
if not func_list then
return;
end
-- 依次调用回调
for _, f in ipairs(func_list) do
if type(f) == "function" then
f(ob);
end
end
end
-- 注册心跳回调函数
function register_heartbeat(ob_class, f)
if not is_table(heartbeat_funcs[ob_class]) then
heartbeat_funcs[ob_class] = {};
end
table.insert(heartbeat_funcs[ob_class], f);
end
|
fx_version 'bodacious'
games { 'gta5' }
author 'luckybulgur'
description 'Original code by jamessc0tt - Recoded by luckybulgur'
version '0.0.0'
client_scripts {
'@sc0tt_utils/cl_utils.lua',
'config.lua',
'client.lua',
}
|
--[[ Copyright (c) David-John Miller AKA Anoyomouse 2016
* Part of the warehousing mod
*
* See LICENCE in the project directory for licence information
--]]
data:extend({
{ -- Basic Warehouse
type = "recipe",
name = "warehouse-basic",
enabled = "false",
ingredients =
{
{"steel-plate",60},
{"iron-plate",100},
{"stone-brick",25},
{"wooden-chest",10},
},
result = "warehouse-basic"
},
{ -- Passive Provider Warehouse
type = "recipe",
name = "warehouse-passive-provider",
enabled = "false",
ingredients =
{
{"warehouse-basic",1},
{"logistic-chest-passive-provider",1},
{"iron-plate",20},
{"advanced-circuit", 5},
},
result = "warehouse-passive-provider"
},
{ -- Storage Warehouse
type = "recipe",
name = "warehouse-storage",
enabled = "false",
ingredients =
{
{"warehouse-basic",1},
{"logistic-chest-storage",1},
{"iron-plate",20},
{"advanced-circuit", 5},
{"steel-chest",15},
},
result = "warehouse-storage"
},
{ -- Active Provider Warehouse
type = "recipe",
name = "warehouse-active-provider",
enabled = "false",
ingredients =
{
{"warehouse-basic",1},
{"logistic-chest-active-provider",1},
{"iron-plate",20},
{"advanced-circuit", 5},
},
result = "warehouse-active-provider"
},
{ -- Requestor Warehouse
type = "recipe",
name = "warehouse-requester",
enabled = "false",
ingredients =
{
{"warehouse-basic",1},
{"logistic-chest-requester",1},
{"iron-plate",20},
{"advanced-circuit", 5},
},
result = "warehouse-requester"
},
{ -- Basic Storehouse
type = "recipe",
name = "storehouse-basic",
enabled = "false",
ingredients =
{
{"steel-plate",20},
{"iron-plate",40},
{"stone-brick",10},
{"wooden-chest",5},
},
result = "storehouse-basic"
},
{ -- Passive Provider Storehouse
type = "recipe",
name = "storehouse-passive-provider",
enabled = "false",
ingredients =
{
{"storehouse-basic",1},
{"logistic-chest-passive-provider",1},
{"iron-plate",5},
{"advanced-circuit", 2},
},
result = "storehouse-passive-provider"
},
{ -- Storage Storehouse
type = "recipe",
name = "storehouse-storage",
enabled = "false",
ingredients =
{
{"storehouse-basic",1},
{"logistic-chest-storage",1},
{"iron-plate",5},
{"advanced-circuit", 2},
{"steel-chest",5},
},
result = "storehouse-storage"
},
{ -- Active Provider Storehouse
type = "recipe",
name = "storehouse-active-provider",
enabled = "false",
ingredients =
{
{"storehouse-basic",1},
{"logistic-chest-active-provider",1},
{"iron-plate",5},
{"advanced-circuit", 2},
},
result = "storehouse-active-provider"
},
{ -- Requestor Storehouse
type = "recipe",
name = "storehouse-requester",
enabled = "false",
ingredients =
{
{"storehouse-basic",1},
{"logistic-chest-requester",1},
{"iron-plate",5},
{"advanced-circuit", 2},
},
result = "storehouse-requester"
},
})
|
--[[--------------------------------------------------------------------------
Improved Anti-NoClip Module
Author:
Mista-Tea ([IJWTB] Thomas)
License:
The MIT License (MIT)
Copyright (c) 2015-2017 Mista-Tea
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.
Changelog:
----------------------------------------------------------------------------]]
--[[--------------------------------------------------------------------------
-- Namespace Tables
--------------------------------------------------------------------------]]--
module( "improvedanc", package.seeall )
--[[--------------------------------------------------------------------------
-- Localized Functions & Variables
--------------------------------------------------------------------------]]--
--[[--------------------------------------------------------------------------
-- Namespace Functions
--------------------------------------------------------------------------]]--
if ( SERVER ) then
m_Handlers = m_Handlers or {}
--[[--------------------------------------------------------------------------
-- AddHandler( entity )
--]]--
function AddHandler( ply, ent, data )
local handler = GetHandler( ent )
if ( not IsValid( handler ) ) then
undo.Create( "antinoclip_improved" )
handler = CreateHandler( ent )
handler:SetOwner( ply )
undo.AddEntity( handler )
undo.SetPlayer( ply )
undo.Finish()
end
handler:SetNoClipAffects( data.affects )
handler:SetNoClipEffects( data.effects )
duplicator.StoreEntityModifier( ent, "antinoclip_improved", data )
m_Handlers[ ent ] = handler
end
duplicator.RegisterEntityModifier( "antinoclip_improved", AddHandler )
--[[--------------------------------------------------------------------------
-- CreateHandler( entity )
--]]--
function CreateHandler( ent )
local handler = ents.Create( "noclip_handler" )
handler:SetHandledEntity( ent )
handler:Spawn()
ent:CallOnRemove( "AntiNoClipImproved", function( ent )
RemoveHandler( ent )
end )
handler:CallOnRemove( "AntiNoClipImproved", function( handler, ent )
if ( not IsValid( ent ) ) then return end
ent:SetNWString( "AntiNoClipAffect", "" )
end, ent )
return handler
end
--[[--------------------------------------------------------------------------
-- RemoveHandler( entity )
--
--]]--
function RemoveHandler( ent )
local handler = m_Handlers[ ent ]
m_Handlers[ ent ] = nil
if ( IsValid( handler ) ) then
handler:Remove()
end
ent:SetNWString( "AntiNoClipAffect", "" )
end
--[[--------------------------------------------------------------------------
-- GetHandlers()
--]]--
function GetHandlers()
return m_Handlers
end
--[[--------------------------------------------------------------------------
-- GetHandler( entity )
--]]--
function GetHandler( ent )
return m_Handlers[ ent ]
end
elseif ( CLIENT ) then end
if ( CLIENT or SERVER ) then
m_Effects = m_Effects or {}
m_Affects = m_Affects or {}
m_DEFAULT_EFFECT = m_DEFAULT_EFFECT or nil
m_DEFAULT_AFFECT = m_DEFAULT_AFFECT or nil
--[[--------------------------------------------------------------------------
-- RegisterEffect( string, function )
--]]--
function RegisterEffect( name, func )
m_Effects[ name:lower() ] = func
end
--[[--------------------------------------------------------------------------
-- SetDefaultEffect( string )
--]]--
function SetDefaultEffect( name )
m_DEFAULT_EFFECT = name
end
--[[--------------------------------------------------------------------------
-- GetDefaultEffect()
--]]--
function GetDefaultEffect()
return m_DEFAULT_EFFECT
end
--[[--------------------------------------------------------------------------
-- GetEffects()
--]]--
function GetEffects()
return m_Effects
end
--[[--------------------------------------------------------------------------
-- GetEffect( string )
--]]--
function GetEffect( name )
return m_Effects[ name:lower() ]
end
RegisterEffect( "bounce", function( ply )
ply:SetMoveType( MOVETYPE_WALK )
ply:SetPos( ply:GetPos() + ( ply:GetVelocity():GetNormal() * -50 ) )
ply:SetVelocity( ply:GetVelocity():GetNormal() * -2000 ) --[[TODO: Variable stength]] end )
RegisterEffect( "ignite", function( ply ) ply:Ignite( 60 ) --[[TODO: Variable duration]] end )
RegisterEffect( "kill", function( ply ) ply:Kill() end )
RegisterEffect( "respawn", function( ply ) ply:Spawn() end )
RegisterEffect( "stripweapons", function( ply ) ply:StripWeapons() end )
RegisterEffect( "teleport", function( ply )
local spawnpoint = gamemode.Call( "PlayerSelectSpawn", ply )
if ( IsValid( spawnpoint ) ) then
ply:SetPos( spawnpoint:GetPos() )
end
end )
RegisterEffect( "walk", function( ply )
ply:SetMoveType( MOVETYPE_WALK )
ply:SetPos( ply:GetPos() + ( ply:GetVelocity():GetNormal() * -50 ) )
end )
--[[--------------------------------------------------------------------------
-- RegisterAffect( string, function )
--]]--
function RegisterAffect( name, func )
m_Affects[ name:lower() ] = func
end
--[[--------------------------------------------------------------------------
-- SetDefaultEffect( string )
--]]--
function SetDefaultAffect( name )
m_DEFAULT_AFFECT = name
end
--[[--------------------------------------------------------------------------
-- GetDefaultEffect()
--]]--
function GetDefaultAffect()
return m_DEFAULT_AFFECT
end
--[[--------------------------------------------------------------------------
-- GetAffects()
--]]--
function GetAffects()
return m_Affects
end
--[[--------------------------------------------------------------------------
-- GetAffect( string )
--]]--
function GetAffect( name )
return m_Affects[ name:lower() ]
end
RegisterAffect( "ignore_self", function( owner, ply, ent ) return ply ~= owner end )
RegisterAffect( "ignore_admins", function( owner, ply, ent ) return not ply:IsAdmin() end )
RegisterAffect( "ignore_team", function( owner, ply, ent ) return ply:Team() ~= owner:Team() end )
RegisterAffect( "ignore_buddies", function( owner, ply, ent ) return gamemode.Call( "PlayerUse", ply, ent ) == false end )
RegisterAffect( "affect_self", function( owner, ply, ent ) return ply == owner end )
RegisterAffect( "affect_team", function( owner, ply, ent ) return ply:Team() == owner():Team() end )
RegisterAffect( "affect_buddies", function( owner, ply, ent ) return gamemode.Call( "PlayerUse", ply, ent ) ~= false end )
RegisterAffect( "affect_everyone", function( owner, ply, ent ) return true end )
end
|
--Created by SupremeGggggg
--Have fun!
--BIG UPDATE!
--BIG UPDATE!
--BIG UPDATE!
--BIG UPDATE!
--BIG UPDATE!
local plr = game.Players.LocalPlayer -- This will send the script to your self!
--[[
/////////// // // // //// // // // ///////////
// // // // // // //
/////////// // // // // // // // // ///////////
// // // // // // // // // //
/////////// // // // //// // ///////// ///////////
--]]
-------------------------------------------------------------------------------------------------------------------------
--Do not touch the rest below this line!
--Starting Point
wait(2)
local newscreenui = Instance.new("ScreenGui")
newscreenui.Parent = plr.PlayerGui
newscreenui.Name = "Silidius"
--MainFrame
local mainframe = Instance.new("Frame")
mainframe.Parent = newscreenui
mainframe.Name = "Main"
mainframe.Active = true
mainframe.Draggable = true
mainframe.BackgroundColor3 = Color3.new(109/255, 109/255, 109/255)
mainframe.BorderColor3 = Color3.new(0/255, 0/255, 0/255)
mainframe.BorderSizePixel = 1
mainframe.Position = UDim2.new(.296, 0, .192, 0)
mainframe.Size = UDim2.new(.409, 0, .66, 0)
mainframe.Draggable = true
--NavBar
local CommandBar = Instance.new("TextButton")
CommandBar.Parent = mainframe
CommandBar.Name = "Commands"
CommandBar.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
CommandBar.Position = UDim2.new(0, 0, .144, 0)
CommandBar.Size = UDim2.new(.24, 0, .099, 0)
CommandBar.Font = "ArialBold"
CommandBar.Text = "Commands"
CommandBar.TextColor3 = Color3.new(249/255, 74/255, 255/255)
CommandBar.TextScaled = true
local FE = Instance.new("TextButton")
FE.Parent = mainframe
FE.Name = "FE"
FE.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
FE.Position = UDim2.new(.254, 0, .144, 0)
FE.Size = UDim2.new(.24, 0, .099, 0)
FE.Font = "ArialBold"
FE.Text = "FE Commands"
FE.TextColor3 = Color3.new(255/255, 255/255, 255/255)
FE.TextScaled = true
local LC = Instance.new("TextButton")
LC.Parent = mainframe
LC.Name = "LargeCommands"
LC.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
LC.Position = UDim2.new(.51, 0, .144, 0)
LC.Size = UDim2.new(.24, 0, .099, 0)
LC.Font = "ArialBold"
LC.Text = "Large Commands"
LC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
LC.TextScaled = true
local PC = Instance.new("TextButton")
PC.Parent = mainframe
PC.Name = "ParticleCommands"
PC.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
PC.Position = UDim2.new(.766, 0, .144, 0)
PC.Size = UDim2.new(.234, 0, .099, 0)
PC.Font = "ArialBold"
PC.Text = "Particle Commands"
PC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PC.TextScaled = true
--TopBar
local TopBar = Instance.new("Frame")
TopBar.Parent = mainframe
TopBar.Name = "TopBar"
TopBar.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
TopBar.BorderSizePixel = 0
TopBar.Position = UDim2.new(0, 0, 0, 0)
TopBar.Size = UDim2.new(1, 0, .138, 0)
local Exit = Instance.new("TextButton")
Exit.Parent = TopBar
Exit.Name = "Exit"
Exit.BackgroundColor3 = Color3.new(47/255, 58/255, 49/255)
Exit.BackgroundTransparency = 1
Exit.BorderSizePixel = 0
Exit.Size = UDim2.new(.076, 0, 1, 0)
Exit.Position = UDim2.new(.924, 0, 0, 0)
Exit.Font = "ArialBold"
Exit.Text = "X"
Exit.TextColor3 = Color3.new(255/255, 0/255, 0/255)
Exit.TextScaled = true
Exit.MouseButton1Click:connect(function()
newscreenui:Destroy()
end)
local FEStats = Instance.new("TextLabel")
FEStats.Parent = TopBar
FEStats.Name = "FEStats"
FEStats.TextXAlignment = "Left"
FEStats.Position = UDim2.new(.467, 0, .221, 0)
FEStats.Size = UDim2.new(.252, 0, .558, 0)
FEStats.Text = "- FE Status: Disabled!"
FEStats.BackgroundTransparency = 1
FEStats.TextColor3 = Color3.new(255/255, 255/255, 255/255)
local Title = Instance.new("TextLabel")
Title.Parent = TopBar
Title.Name = "Title"
Title.BackgroundColor3 = Color3.new(255/255, 255/255, 255/255)
Title.BackgroundTransparency = 1
Title.BorderSizePixel = 1
Title.Position = UDim2.new(.022, 0, 0, 0)
Title.Size = UDim2.new(.445, 0, 1, 0)
Title.Font = "ArialBold"
Title.TextScaled = true
Title.Text = "Silidius Commands"
Title.TextColor3 = Color3.new(255/255, 255/255, 255/255)
--CommandsFrame
local commandsframe = Instance.new("Frame")
commandsframe.Parent = mainframe
commandsframe.Name = "CommandsFrame"
commandsframe.BackgroundTransparency = 1
commandsframe.Size = UDim2.new(1, 0, .756, 0)
commandsframe.Position = UDim2.new(0, 0, .244, 0)
local PlayerNameText = Instance.new("TextLabel")
PlayerNameText.Parent = commandsframe
PlayerNameText.Name = "PlayerNameText"
PlayerNameText.BackgroundTransparency = 1
PlayerNameText.Position = UDim2.new(.787, 0, .059, 0)
PlayerNameText.Size = UDim2.new(.193, 0, .055, 0)
PlayerNameText.Text = "Player Name:"
PlayerNameText.Font = "ArialBold"
PlayerNameText.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PlayerNameText.TextScaled = true
local PlayerName = Instance.new("TextBox")
PlayerName.Parent = commandsframe
PlayerName.Name = "PlayerName"
PlayerName.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
PlayerName.Position = UDim2.new(.786, 0, .158, 0)
PlayerName.Size = UDim2.new(.193, 0, .138, 0)
PlayerName.Font = "ArialBold"
PlayerName.Text = "Put player name here..."
PlayerName.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PlayerName.TextScaled = true
PlayerName.TextXAlignment = "Left"
local IntValText = Instance.new("TextLabel")
IntValText.Parent = commandsframe
IntValText.Name = "IntValText"
IntValText.BackgroundTransparency = 1
IntValText.Position = UDim2.new(.308, 0, .727, 0)
IntValText.Size = UDim2.new(.425, 0, .055, 0)
IntValText.Text = "Number Value:"
IntValText.Font = "ArialBold"
IntValText.TextColor3 = Color3.new(255/255, 255/255, 255/255)
IntValText.TextScaled = true
local IntVal = Instance.new("TextBox")
IntVal.Parent = commandsframe
IntVal.Name = "IntVal"
IntVal.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
IntVal.Position = UDim2.new(.308, 0, .802, 0)
IntVal.Size = UDim2.new(.425, 0, .162, 0)
IntVal.Font = "ArialBold"
IntVal.Text = "This will work with all Numbers needed including skybox and music..."
IntVal.TextColor3 = Color3.new(255/255, 255/255, 255/255)
IntVal.TextScaled = true
IntVal.TextXAlignment = "Left"
local StringText = Instance.new("TextLabel")
StringText.Parent = commandsframe
StringText.Name = "StringValText"
StringText.BackgroundTransparency = 1
StringText.Position = UDim2.new(.786, 0, .372, 0)
StringText.Size = UDim2.new(.193, 0, .055, 0)
StringText.Text = "String Value:"
StringText.Font = "ArialBold"
StringText.TextColor3 = Color3.new(255/255, 255/255, 255/255)
StringText.TextScaled = true
local StringVal = Instance.new("TextBox")
StringVal.Parent = commandsframe
StringVal.Name = "StringVal"
StringVal.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
StringVal.Position = UDim2.new(.787, 0, .458, 0)
StringVal.Size = UDim2.new(.193, 0, .344, 0)
StringVal.Font = "ArialBold"
StringVal.Text = "This will work with messages and anything that needs a string attached!"
StringVal.TextColor3 = Color3.new(255/255, 255/255, 255/255)
StringVal.TextScaled = true
StringVal.TextXAlignment = "Left"
local kill = Instance.new("TextButton")
kill.Parent = commandsframe
kill.Name = "Kill"
kill.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
kill.Font = "ArialBold"
kill.Text = "Kill"
kill.TextColor3 = Color3.new(255/255, 255/255, 255/255)
kill.TextScaled = true
kill.Size = UDim2.new(.232, 0, .075, 0)
kill.Position = UDim2.new(.022, 0, .083, 0)
kill.MouseButton1Click:connect(function()
local victim = PlayerName.Text
game.Players:FindFirstChild(victim).Character:BreakJoints()
end)
local loopkill = Instance.new("TextButton")
loopkill.Parent = commandsframe
loopkill.Name = "LoopKill"
loopkill.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
loopkill.Font = "ArialBold"
loopkill.Text = "Loop Kill"
loopkill.TextColor3 = Color3.new(255/255, 255/255, 255/255)
loopkill.TextScaled = true
loopkill.Size = UDim2.new(.232, 0, .075, 0)
loopkill.Position = UDim2.new(.277, 0, .083, 0)
loopkill.MouseButton1Click:connect(function()
while true do
wait(1)
local victim = PlayerName.Text
end
end)
local respawn = Instance.new("TextButton")
respawn.Parent = commandsframe
respawn.Name = "Respawn"
respawn.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
respawn.Font = "ArialBold"
respawn.Text = "Respawn"
respawn.TextColor3 = Color3.new(255/255, 255/255, 255/255)
respawn.TextScaled = true
respawn.Size = UDim2.new(.232, 0, .075, 0)
respawn.Position = UDim2.new(.533, 0, .083, 0)
respawn.MouseButton1Click:connect(function()
local victim = PlayerName.Text
game.Players:FindFirstChild(victim):LoadCharacter()
end)
local destroyc = Instance.new("TextButton")
destroyc.Parent = commandsframe
destroyc.Name = "DestroyChar"
destroyc.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
destroyc.Font = "ArialBold"
destroyc.Text = "Destroy Char"
destroyc.TextColor3 = Color3.new(255/255, 255/255, 255/255)
destroyc.TextScaled = true
destroyc.Size = UDim2.new(.232, 0, .075, 0)
destroyc.Position = UDim2.new(.022, 0, .19, 0)
destroyc.MouseButton1Click:connect(function()
local victim = PlayerName.Text
game.Players:FindFirstChild(victim).Character:Destroy()
end)
local poison = Instance.new("TextButton")
poison.Parent = commandsframe
poison.Name = "Poison"
poison.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
poison.Font = "ArialBold"
poison.Text = "Poison"
poison.TextColor3 = Color3.new(255/255, 255/255, 255/255)
poison.TextScaled = true
poison.Size = UDim2.new(.232, 0, .075, 0)
poison.Position = UDim2.new(.277, 0, .19, 0)
poison.MouseButton1Click:connect(function()
local victim = PlayerName.Text
local smoke = Instance.new("Smoke")
smoke.Parent = game.Players:FindFirstChild(victim).Character.HumanoidRootPart
smoke.Name = "Poison"
smoke.Color = Color3.new(51/255, 181/255, 11/255)
while game.Players:FindFirstChild(victim).Character.Humanoid.Health > 0 do
wait(.5)
game.Players:FindFirstChild(victim).Character.Humanoid.Health = game.Players:FindFirstChild(victim).Character.Humanoid.Health - game.Players:FindFirstChild(victim).Character.Humanoid.MaxHealth/25
end
end)
local fire = Instance.new("TextButton")
fire.Parent = commandsframe
fire.Name = "Fire"
fire.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
fire.Font = "ArialBold"
fire.Text = "Fire"
fire.TextColor3 = Color3.new(255/255, 255/255, 255/255)
fire.TextScaled = true
fire.Size = UDim2.new(.232, 0, .075, 0)
fire.Position = UDim2.new(.533, 0, .19, 0)
fire.MouseButton1Click:connect(function()
local victim = PlayerName.Text
local fire1 = Instance.new("Fire")
fire1.Parent = game.Players:FindFirstChild(victim).Character.HumanoidRootPart
end)
local sparkles = Instance.new("TextButton")
sparkles.Parent = commandsframe
sparkles.Name = "Sparkles"
sparkles.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
sparkles.Font = "ArialBold"
sparkles.Text = "Sparkles"
sparkles.TextColor3 = Color3.new(255/255, 255/255, 255/255)
sparkles.TextScaled = true
sparkles.Size = UDim2.new(.232, 0, .075, 0)
sparkles.Position = UDim2.new(.022, 0, .296, 0)
sparkles.MouseButton1Click:connect(function()
local victim = PlayerName.Text
local fire1 = Instance.new("Sparkles")
fire1.Parent = game.Players:FindFirstChild(victim).Character.HumanoidRootPart
end)
local WalkSpeed = Instance.new("TextButton")
WalkSpeed.Parent = commandsframe
WalkSpeed.Name = "WalkSpeed"
WalkSpeed.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
WalkSpeed.Font = "ArialBold"
WalkSpeed.Text = "WalkSpeed"
WalkSpeed.TextColor3 = Color3.new(255/255, 255/255, 255/255)
WalkSpeed.TextScaled = true
WalkSpeed.Size = UDim2.new(.232, 0, .075, 0)
WalkSpeed.Position = UDim2.new(.277, 0, .296, 0)
WalkSpeed.MouseButton1Click:connect(function()
local victim = PlayerName.Text
local value = IntVal.Text
game.Players:FindFirstChild(victim).Character.Humanoid.WalkSpeed = value
end)
local eatserver = Instance.new("TextButton")
eatserver.Parent = commandsframe
eatserver.Name = "SlowlyEatServer"
eatserver.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
eatserver.Font = "ArialBold"
eatserver.Text = "Slowly Eat Server"
eatserver.TextColor3 = Color3.new(255/255, 255/255, 255/255)
eatserver.TextScaled = true
eatserver.Size = UDim2.new(.232, 0, .075, 0)
eatserver.Position = UDim2.new(.533, 0, .296, 0)
eatserver.MouseButton1Click:connect(function()
while true do
wait(1)
local category = workspace:GetChildren()
for i,v in pairs(category) do
if v:IsA("Part") then
s = i
end
end
local chosen = category[math.random(1, s)]
chosen:Destroy()
end
end)
local blackdeath = Instance.new("TextButton")
blackdeath.Parent = commandsframe
blackdeath.Name = "BlackDeath"
blackdeath.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
blackdeath.Font = "ArialBold"
blackdeath.Text = "Black Death"
blackdeath.TextColor3 = Color3.new(255/255, 255/255, 255/255)
blackdeath.TextScaled = true
blackdeath.Size = UDim2.new(.232, 0, .075, 0)
blackdeath.Position = UDim2.new(.022, 0, .403, 0)
blackdeath.MouseButton1Click:connect(function()
for i,v in pairs(game.Players:GetChildren()) do
for i, parts in pairs(v.Character:GetChildren()) do
if parts:IsA("Part") or parts:IsA("MeshPart") then
local fire = Instance.new("Fire")
fire.Parent = parts
fire.Heat = 0
fire.Color = Color3.new(0, 0, 0)
fire.SecondaryColor = Color3.new(0, 0, 0)
v.Character:BreakJoints()
end
end
end
end)
local sonic = Instance.new("TextButton")
sonic.Parent = commandsframe
sonic.Name = "SonicSpeed"
sonic.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
sonic.Font = "ArialBold"
sonic.Text = "Sonic Speed"
sonic.TextColor3 = Color3.new(255/255, 255/255, 255/255)
sonic.TextScaled = true
sonic.Size = UDim2.new(.232, 0, .075, 0)
sonic.Position = UDim2.new(.277, 0, .403, 0)
sonic.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
local newtrail = Instance.new("Trail")
newtrail.Parent = victim.Character.Head
local attachment0 = Instance.new("Attachment", victim.Character.Head)
attachment0.Name = "TrailAttachment0"
local attachment1 = Instance.new("Attachment", victim.Character.HumanoidRootPart)
attachment1.Name = "TrailAttachment1"
newtrail.Attachment0 = attachment0
newtrail.Attachment1 = attachment1
local startcolor = Color3.new(255/255, 255/255, 255/255)
local endcolor = Color3.new(0/255, 0/255, 255/255)
local colorsequence = ColorSequence.new(startcolor, endcolor)
newtrail.Color = colorsequence
victim.Character.Humanoid.WalkSpeed = 50
end)
local smoke = Instance.new("TextButton")
smoke.Parent = commandsframe
smoke.Name = "Smoke"
smoke.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
smoke.Font = "ArialBold"
smoke.Text = "Smoke"
smoke.TextColor3 = Color3.new(255/255, 255/255, 255/255)
smoke.TextScaled = true
smoke.Size = UDim2.new(.232, 0, .075, 0)
smoke.Position = UDim2.new(.533, 0, .403, 0)
smoke.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
local smoke = Instance.new("Smoke")
smoke.Parent = victim.Character.HumanoidRootPart
end)
local skybox = Instance.new("TextButton")
skybox.Parent = commandsframe
skybox.Name = "SkyBox"
skybox.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
skybox.Font = "ArialBold"
skybox.Text = "Skybox"
skybox.TextColor3 = Color3.new(255/255, 255/255, 255/255)
skybox.TextScaled = true
skybox.Size = UDim2.new(.232, 0, .075, 0)
skybox.Position = UDim2.new(.022, 0, .514, 0)
skybox.MouseButton1Click:connect(function()
local newsky = Instance.new("Sky")
newsky.Parent = game.Lighting
newsky.MoonTextureId = " "
newsky.SkyboxBk = "rbxassetid://"..IntVal.Text
newsky.SkyboxDn = "rbxassetid://"..IntVal.Text
newsky.SkyboxFt = "rbxassetid://"..IntVal.Text
newsky.SkyboxLf = "rbxassetid://"..IntVal.Text
newsky.SkyboxRt = "rbxassetid://"..IntVal.Text
newsky.SkyboxUp = "rbxassetid://"..IntVal.Text
newsky.StarCount = 0
newsky.SunangularSize = 0
newsky.SunTextureId = " "
end)
local jump = Instance.new("TextButton")
jump.Parent = commandsframe
jump.Name = "JumpPower"
jump.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
jump.Font = "ArialBold"
jump.Text = "JumpPower"
jump.TextColor3 = Color3.new(255/255, 255/255, 255/255)
jump.TextScaled = true
jump.Size = UDim2.new(.232, 0, .075, 0)
jump.Position = UDim2.new(.277, 0, .514, 0)
jump.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
local num = IntVal.Text
victim.Character.Humanoid.JumpPower = tonumber(num)
end)
local height = Instance.new("TextButton")
height.Parent = commandsframe
height.Name = "HipHeight"
height.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
height.Font = "ArialBold"
height.Text = "HipHeight"
height.TextColor3 = Color3.new(255/255, 255/255, 255/255)
height.TextScaled = true
height.Size = UDim2.new(.232, 0, .075, 0)
height.Position = UDim2.new(.533, 0, .514, 0)
height.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
local num = IntVal.Text
victim.Character.Humanoid.HipHeight = tonumber(num)
end)
local rbase = Instance.new("TextButton")
rbase.Parent = commandsframe
rbase.Name = "Remove Baseplate"
rbase.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
rbase.Font = "ArialBold"
rbase.Text = "Remove Baseplate"
rbase.TextColor3 = Color3.new(255/255, 255/255, 255/255)
rbase.TextScaled = true
rbase.Size = UDim2.new(.232, 0, .075, 0)
rbase.Position = UDim2.new(.022, 0, .621, 0)
rbase.MouseButton1Click:connect(function()
game.Workspace:FindFirstChild("Baseplate"):Destroy()
end)
local see = Instance.new("TextButton")
see.Parent = commandsframe
see.Name = "SeeThrough"
see.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
see.Font = "ArialBold"
see.Text = "See Through"
see.TextColor3 = Color3.new(255/255, 255/255, 255/255)
see.TextScaled = true
see.Size = UDim2.new(.232, 0, .075, 0)
see.Position = UDim2.new(.277, 0, .621, 0)
see.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
for i,v in pairs(victim.Character:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") then
v.Transparency = .5
end
end
end)
local Freeze = Instance.new("TextButton")
Freeze.Parent = commandsframe
Freeze.Name = "Freeze"
Freeze.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
Freeze.Font = "ArialBold"
Freeze.Text = "Freeze"
Freeze.TextColor3 = Color3.new(255/255, 255/255, 255/255)
Freeze.TextScaled = true
Freeze.Size = UDim2.new(.232, 0, .075, 0)
Freeze.Position = UDim2.new(.533, 0, .621, 0)
Freeze.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
for i,v in pairs(victim.Character:GetChildren()) do
if v:IsA("MeshPart") or v:IsA("Part") then
v.Anchored = true
end
end
end)
local Thaw = Instance.new("TextButton")
Thaw.Parent = commandsframe
Thaw.Name = "Thaw"
Thaw.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
Thaw.Font = "ArialBold"
Thaw.Text = "Thaw"
Thaw.TextColor3 = Color3.new(255/255, 255/255, 255/255)
Thaw.TextScaled = true
Thaw.Size = UDim2.new(.232, 0, .075, 0)
Thaw.Position = UDim2.new(.022, 0, .727, 0)
Thaw.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
for i,v in pairs(victim.Character:GetChildren()) do
if v:IsA("MeshPart") or v:IsA("Part") then
v.Anchored = false
end
end
end)
local set = Instance.new("TextButton")
set.Parent = commandsframe
set.Name = ""
set.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
set.Font = "ArialBold"
set.Text = "Thaw"
set.TextColor3 = Color3.new(255/255, 255/255, 255/255)
set.TextScaled = true
set.Size = UDim2.new(.232, 0, .075, 0)
set.Position = UDim2.new(.022, 0, .727, 0)
set.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName.Text)
for i,v in pairs(victim.Character:GetChildren()) do
if v:IsA("MeshPart") or v:IsA("Part") then
v.Anchored = false
end
end
end)
--FE Commands Frame
local FEcommandsframe = Instance.new("Frame")
FEcommandsframe.Parent = mainframe
FEcommandsframe.Name = "FECommandsFrame"
FEcommandsframe.Visible = false
FEcommandsframe.BackgroundTransparency = 1
FEcommandsframe.Position = UDim2.new(0, 0, .244, 0)
FEcommandsframe.Size = UDim2.new(1, 0, .756, 0)
local nav = Instance.new("ScrollingFrame")
nav.Parent = FEcommandsframe
nav.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
nav.Name = "NavBar"
nav.Position = UDim2.new(.022, 0, .028, 0)
nav.Size = UDim2.new(.249, 0, .937, 0)
nav.ScrollBarThickness = 6
local all = Instance.new("TextButton")
all.Parent = nav
all.Name = "All"
all.BackgroundColor3 = Color3.new(163/255, 0/255, 0/255)
all.Position = UDim2.new(0, 0, 0, 0)
all.Size = UDim2.new(.94, 0, .063, 0)
all.Text = "All"
all.TextColor3 = Color3.new(255/255, 255/255, 255/255)
all.Font = "ArialBold"
all.TextScaled = true
local main = Instance.new("ScrollingFrame")
main.Parent = FEcommandsframe
main.Name = "MainFrame"
main.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
main.Position = UDim2.new(.286, 0, .032, 0)
main.Size = UDim2.new(.695, 0, .818, 0)
main.ScrollBarThickness = 6
local feflybutton = Instance.new("TextButton")
feflybutton.Parent = main
feflybutton.Name = "FlyMode"
feflybutton.Position = UDim2.new(0, 0, 0, 0)
feflybutton.Size = UDim2.new(.966, 0, .054, 0)
feflybutton.Text = "Fly Mode"
feflybutton.TextColor3 = Color3.new(255/255, 255/255, 255/255)
feflybutton.BackgroundColor3 = Color3.new(204/255, 31/255, 31/255)
feflybutton.TextScaled = true
feflybutton.MouseButton1Click:connect(function()
repeat wait()
until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
local mouse = game.Players.LocalPlayer:GetMouse()
repeat wait() until mouse
local plr = game.Players.LocalPlayer
local torso = plr.Character.Torso
local flying = true
local firsttimeflying = true
local deb = true
local ctrl = {f = 0, b = 0, l = 0, r = 0}
local lastctrl = {f = 0, b = 0, l = 0, r = 0}
local maxspeed = 50
local speed = 0
function Fly()
local bg = Instance.new("BodyGyro", torso)
bg.P = 9e4
bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
bg.cframe = torso.CFrame
local bv = Instance.new("BodyVelocity", torso)
bv.velocity = Vector3.new(0,0.1,0)
bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
repeat wait()
plr.Character.Humanoid.PlatformStand = true
if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
speed = speed+.5+(speed/maxspeed)
if speed > maxspeed then
speed = maxspeed
end
elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
speed = speed-1
if speed < 0 then
speed = 0
end
end
if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
else
bv.velocity = Vector3.new(0,0.1,0)
end
bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
until not flying
ctrl = {f = 0, b = 0, l = 0, r = 0}
lastctrl = {f = 0, b = 0, l = 0, r = 0}
speed = 0
bg:Destroy()
bv:Destroy()
plr.Character.Humanoid.PlatformStand = false
end
feflybutton.MouseButton1Click:connect(function()
if flying and not firsttimeflying then
feflybutton.Text = "Fly Mode"
flying = false
else
firsttimeflying = false
feflybutton.Text = "Fly Mode"
flying = true
Fly()
end
end)
mouse.KeyDown:connect(function(key)
if key:lower() == "w" then
ctrl.f = 1
elseif key:lower() == "s" then
ctrl.b = -1
elseif key:lower() == "a" then
ctrl.l = -1
elseif key:lower() == "d" then
ctrl.r = 1
end
end)
mouse.KeyUp:connect(function(key)
if key:lower() == "w" then
ctrl.f = 0
elseif key:lower() == "s" then
ctrl.b = 0
elseif key:lower() == "a" then
ctrl.l = 0
elseif key:lower() == "d" then
ctrl.r = 0
end
end)
Fly()
end)
local hatspin = Instance.new("TextButton")
hatspin.Parent = main
hatspin.Name = "HatSpin"
hatspin.Position = UDim2.new(0, 0, 0.06, 0)
hatspin.Size = UDim2.new(.966, 0, .054, 0)
hatspin.Text = "HatSpin"
hatspin.TextColor3 = Color3.new(255/255, 255/255, 255/255)
hatspin.BackgroundColor3 = Color3.new(204/255, 31/255, 31/255)
hatspin.TextScaled = true
hatspin.MouseButton1Click:connect(function()
local obese = game:GetService('Players')
for i,v in pairs(obese.LocalPlayer.Character:GetChildren()) do
if v.ClassName == "Accessory" then
local stg = v.Handle:FindFirstChildOfClass("BodyForce")
if stg == nil then
local a = Instance.new("BodyPosition")
local b = Instance.new("BodyAngularVelocity")
a.Parent = v.Handle
b.Parent = v.Handle
v.Handle.AccessoryWeld:Destroy()
b.AngularVelocity = Vector3.new(0,100,0)
b.MaxTorque = Vector3.new(0,200,0)
a.P = 30000
a.D = 50
game:GetService('RunService').Stepped:connect(function()
a.Position = obese.LocalPlayer.Character.Head.Position
end)
end
end
end
end)
local god = Instance.new("TextButton")
god.Parent = main
god.Name = "God"
god.Position = UDim2.new(0, 0, 0.12, 0)
god.Size = UDim2.new(.966, 0, .054, 0)
god.Text = "God"
god.TextColor3 = Color3.new(255/255, 255/255, 255/255)
god.BackgroundColor3 = Color3.new(204/255, 31/255, 31/255)
god.TextScaled = true
god.MouseButton1Click:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Name = 1
local l = game.Players.LocalPlayer.Character["1"]:Clone()
l.Parent = game.Players.LocalPlayer.Character
l.Name = "Humanoid"
wait(0.1)
game.Players.LocalPlayer.Character["1"]:Destroy()
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character.Animate.Disabled = true
wait(0.1)
game.Players.LocalPlayer.Character.Animate.Disabled = false
game.Players.LocalPlayer.Character.Humanoid.DisplayDistanceType = "None"
end)
local spasm = Instance.new("TextButton")
spasm.Parent = main
spasm.Name = "Spasm"
spasm.Position = UDim2.new(0, 0, 0.18, 0)
spasm.Size = UDim2.new(.966, 0, .054, 0)
spasm.Text = "Spasm"
spasm.TextColor3 = Color3.new(255/255, 255/255, 255/255)
spasm.BackgroundColor3 = Color3.new(204/255, 31/255, 31/255)
spasm.TextScaled = true
spasm.MouseButton1Click:connect(function()
while wait(1) do
for i,v in pairs(game:GetService('Players'):GetChildren()) do
local Player = v.Name
local AnimationId = "33796059"
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://"..AnimationId
local k = game.Players[Player].Character.Humanoid:LoadAnimation(Anim)
k:Play() --Play the animation
k:AdjustSpeed(99)
end
end
end)
--Large Extra Commands Frame
local lEcommandsframe = Instance.new("Frame")
lEcommandsframe.Parent = mainframe
lEcommandsframe.Name = "LargeExtraCommandsFrame"
lEcommandsframe.Visible = false
lEcommandsframe.BackgroundTransparency = 1
lEcommandsframe.Position = UDim2.new(0, 0, .244, 0)
lEcommandsframe.Size = UDim2.new(1, 0, .756, 0)
local IntValText3 = Instance.new("TextLabel")
IntValText3.Parent = lEcommandsframe
IntValText3.Name = "IntValText"
IntValText3.BackgroundTransparency = 1
IntValText3.Position = UDim2.new(.308, 0, .727, 0)
IntValText3.Size = UDim2.new(.425, 0, .055, 0)
IntValText3.Text = "Number Value:"
IntValText3.Font = "ArialBold"
IntValText3.TextColor3 = Color3.new(255/255, 255/255, 255/255)
IntValText3.TextScaled = true
local IntVal3 = Instance.new("TextBox")
IntVal3.Parent = lEcommandsframe
IntVal3.Name = "IntVal"
IntVal3.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
IntVal3.Position = UDim2.new(.308, 0, .802, 0)
IntVal3.Size = UDim2.new(.425, 0, .162, 0)
IntVal3.Font = "ArialBold"
IntVal3.Text = "This will work with all Numbers needed including skybox and music..."
IntVal3.TextColor3 = Color3.new(255/255, 255/255, 255/255)
IntVal3.TextScaled = true
IntVal3.TextXAlignment = "Left"
local StringText3 = Instance.new("TextLabel")
StringText3.Parent = lEcommandsframe
StringText3.Name = "StringValText"
StringText3.BackgroundTransparency = 1
StringText3.Position = UDim2.new(.786, 0, .372, 0)
StringText3.Size = UDim2.new(.193, 0, .055, 0)
StringText3.Text = "String Value:"
StringText3.Font = "ArialBold"
StringText3.TextColor3 = Color3.new(255/255, 255/255, 255/255)
StringText3.TextScaled = true
local StringVal3 = Instance.new("TextBox")
StringVal3.Parent = lEcommandsframe
StringVal3.Name = "StringVal"
StringVal3.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
StringVal3.Position = UDim2.new(.787, 0, .458, 0)
StringVal3.Size = UDim2.new(.193, 0, .344, 0)
StringVal3.Font = "ArialBold"
StringVal3.Text = "This will work with messages and anything that needs a string attached!"
StringVal3.TextColor3 = Color3.new(255/255, 255/255, 255/255)
StringVal3.TextScaled = true
StringVal3.TextXAlignment = "Left"
local PlayerNameText3 = Instance.new("TextLabel")
PlayerNameText3.Parent = lEcommandsframe
PlayerNameText3.Name = "PlayerNameText"
PlayerNameText3.BackgroundTransparency = 1
PlayerNameText3.Position = UDim2.new(.787, 0, .059, 0)
PlayerNameText3.Size = UDim2.new(.193, 0, .055, 0)
PlayerNameText3.Text = "Player Name:"
PlayerNameText3.Font = "ArialBold"
PlayerNameText3.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PlayerNameText3.TextScaled = true
local PlayerName3 = Instance.new("TextBox")
PlayerName3.Parent = lEcommandsframe
PlayerName3.Name = "PlayerName"
PlayerName3.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
PlayerName3.Position = UDim2.new(.786, 0, .158, 0)
PlayerName3.Size = UDim2.new(.193, 0, .138, 0)
PlayerName3.Font = "ArialBold"
PlayerName3.Text = "Put player name here..."
PlayerName3.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PlayerName3.TextScaled = true
PlayerName3.TextXAlignment = "Left"
local newnotice2 = Instance.new("TextLabel")
newnotice2.Parent = lEcommandsframe
newnotice2.Name = "Notice"
newnotice2.BackgroundTransparency = 1
newnotice2.Position = UDim2.new(.043, 0, .059, 0)
newnotice2.Size = UDim2.new(.634, 0, .538, 0)
newnotice2.Text = "Notice: There are currently no Large Commands Added!"
newnotice2.TextColor3 = Color3.new(64/255, 64/255, 64/255)
newnotice2.TextStrokeColor3 = Color3.new(255/255, 255/255, 255/255)
newnotice2.TextStrokeTransparency = 0
newnotice2.TextScaled = true
newnotice2.TextStrokeColor3 = Color3.new(255/255, 255/255, 255/255)
--Cool Particle Commands
local PCcommandsframe = Instance.new("Frame")
PCcommandsframe.Parent = mainframe
PCcommandsframe.Name = "CoolParticleCommands"
PCcommandsframe.Visible = false
PCcommandsframe.BackgroundTransparency = 1
PCcommandsframe.Position = UDim2.new(0, 0, .244, 0)
PCcommandsframe.Size = UDim2.new(1, 0, .756, 0)
local PlayerNameText4 = Instance.new("TextLabel")
PlayerNameText4.Parent = PCcommandsframe
PlayerNameText4.Name = "PlayerNameText"
PlayerNameText4.BackgroundTransparency = 1
PlayerNameText4.Position = UDim2.new(.787, 0, .059, 0)
PlayerNameText4.Size = UDim2.new(.193, 0, .055, 0)
PlayerNameText4.Text = "Player Name:"
PlayerNameText4.Font = "ArialBold"
PlayerNameText4.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PlayerNameText4.TextScaled = true
local PlayerName4 = Instance.new("TextBox")
PlayerName4.Parent = PCcommandsframe
PlayerName4.Name = "PlayerName"
PlayerName4.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
PlayerName4.Position = UDim2.new(.786, 0, .158, 0)
PlayerName4.Size = UDim2.new(.193, 0, .138, 0)
PlayerName4.Font = "ArialBold"
PlayerName4.Text = "Put player name here..."
PlayerName4.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PlayerName4.TextScaled = true
PlayerName4.TextXAlignment = "Left"
local Dark = Instance.new("TextButton")
Dark.Parent = PCcommandsframe
Dark.Name = "DarkMatter"
Dark.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
Dark.Font = "ArialBold"
Dark.Text = "Dark Matter"
Dark.TextColor3 = Color3.new(255/255, 255/255, 255/255)
Dark.TextScaled = true
Dark.Size = UDim2.new(.232, 0, .075, 0)
Dark.Position = UDim2.new(.022, 0, .083, 0)
Dark.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName4.Text)
local newparticle2 = Instance.new("ParticleEmitter")
newparticle2.Parent = victim.Character.HumanoidRootPart
newparticle2.Color = ColorSequence.new(Color3.new(255/255, 0/255, 0/255), Color3.new(77/255, 1/255, 165/255))
newparticle2.Size = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0),
NumberSequenceKeypoint.new(.0977, .15, 0),
NumberSequenceKeypoint.new(1, .05, 0),
})
newparticle2.Texture = "http://www.roblox.com/asset/?id=118322059"
newparticle2.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0),
NumberSequenceKeypoint.new(.8, 0, 0),
NumberSequenceKeypoint.new(1, 1, 0),
})
newparticle2.ZOffset = 0
newparticle2.Acceleration = Vector3.new(0, .2, 0)
newparticle2.Lifetime = NumberRange.new(5)
newparticle2.Rate = 20
newparticle2.EmissionDirection = "Top"
newparticle2.Rotation = NumberRange.new(0)
newparticle2.RotSpeed = NumberRange.new(20, 40)
newparticle2.Speed = NumberRange.new(2, 4)
newparticle2.SpreadAngle = Vector2.new(100, 100)
local newparticle = Instance.new("ParticleEmitter")
newparticle.Parent = plr.Character.HumanoidRootPart
newparticle.Color = ColorSequence.new(Color3.new(255/255, 0/255, 0/255), Color3.new(77/255, 1/255, 165/255))
newparticle.Size = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1, 0),
NumberSequenceKeypoint.new(.218, .625, 0),
NumberSequenceKeypoint.new(.468, 1.38, 0),
NumberSequenceKeypoint.new(.747, 3.06, 0),
NumberSequenceKeypoint.new(1, 3.31, 0),
})
newparticle.Texture = "http://www.roblox.com/asset/?id=243664672"
newparticle.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1, 0),
NumberSequenceKeypoint.new(.509, .725, 0),
NumberSequenceKeypoint.new(.762, .85, .15),
NumberSequenceKeypoint.new(1, 1, 0),
})
newparticle.ZOffset = 2
newparticle.LightEmission = .4
newparticle.EmissionDirection = "Top"
newparticle.Lifetime = NumberRange.new(1, 2)
newparticle.Rate = 500
newparticle.Rotation = NumberRange.new(-360, 360)
newparticle.RotSpeed = NumberRange.new(-200, 200)
newparticle.Speed = NumberRange.new(.5)
newparticle.SpreadAngle = NumberRange.new(100, 100)
local newparticle2 = Instance.new("ParticleEmitter")
newparticle2.Parent = plr.Character.HumanoidRootPart
newparticle2.Color = ColorSequence.new(Color3.new(255/255, 0/255, 0/255), Color3.new(77/255, 1/255, 165/255))
newparticle2.Size = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0),
NumberSequenceKeypoint.new(.0977, .15, 0),
NumberSequenceKeypoint.new(1, .05, 0),
})
newparticle2.Texture = "http://www.roblox.com/asset/?id=118322059"
newparticle2.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0),
NumberSequenceKeypoint.new(.8, 0, 0),
NumberSequenceKeypoint.new(1, 1, 0),
})
newparticle2.ZOffset = 0
newparticle2.Acceleration = Vector3.new(0, .2, 0)
newparticle2.Lifetime = NumberRange.new(5)
newparticle2.Rate = 20
newparticle2.EmissionDirection = "Top"
newparticle2.Rotation = NumberRange.new(0)
newparticle2.RotSpeed = NumberRange.new(20, 40)
newparticle2.Speed = NumberRange.new(2, 4)
newparticle2.SpreadAngle = Vector2.new(100, 100)
end)
local rain = Instance.new("TextButton")
rain.Parent = PCcommandsframe
rain.Name = "Rain"
rain.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
rain.Font = "ArialBold"
rain.Text = "Rain"
rain.TextColor3 = Color3.new(255/255, 255/255, 255/255)
rain.TextScaled = true
rain.Size = UDim2.new(.232, 0, .075, 0)
rain.Position = UDim2.new(.277, 0, .083, 0)
rain.MouseButton1Click:connect(function()
local victim = game.Players:FindFirstChild(PlayerName4.Text)
local particle1 = Instance.new("ParticleEmitter")
local particle2 = Instance.new("ParticleEmitter")
particle1.Parent = victim.Character.HumanoidRootPart
particle2.Parent = victim.Character.HumanoidRootPart
local colorsequence1 = ColorSequence.new(Color3.new(46/255, 158/255, 255/255))
particle1.Color = colorsequence1
local colorsequence2 = ColorSequence.new(Color3.new(13/255, 46/255, 74/255))
particle2.Color = colorsequence2
particle1.LightEmission = .1
particle1.LightInfluence = 0
particle1.Size = NumberSequence.new(.05)
particle1.Texture = "http://www.roblox.com/asset/?id=118322059"
particle1.ZOffset = 0
particle1.Name = "Rain"
particle1.Acceleration = Vector3.new(0, -20, 0)
particle1.Drag = 0
particle1.LockedToPart = true
particle1.VelocityInheritance = 0
particle1.EmissionDirection = "Top"
particle1.Enabled = true
particle1.Lifetime = NumberRange.new(2.49)
particle1.Rate = 50
particle1.Rotation = NumberRange.new(0)
particle1.RotSpeed = NumberRange.new(0)
particle1.Speed = NumberRange.new(25)
particle1.SpreadAngle = Vector2.new(0, 0)
particle1.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1, 0),
NumberSequenceKeypoint.new(.743,1,0),
NumberSequenceKeypoint.new(.756,0,0),
NumberSequenceKeypoint.new(1,0,0),
})
particle2.Name = "Smoke"
particle2.Color = ColorSequence.new(Color3.new(13/255, 46/255, 74/255))
particle2.LightEmission = .1
particle2.LightInfluence = 0
particle2.Size = NumberSequence.new({
NumberSequenceKeypoint.new(0,0,0),
NumberSequenceKeypoint.new(.499,0,0),
NumberSequenceKeypoint.new(.516,1.42,0),
NumberSequenceKeypoint.new(.6,1.4,0),
NumberSequenceKeypoint.new(.601,0,0),
NumberSequenceKeypoint.new(1,0,0),
})
particle2.Texture = "http://www.roblox.com/asset/?id=290833005"
particle2.ZOffset = 2
particle2.Acceleration = Vector3.new(0, 0, 0)
particle2.EmissionDirection = "Top"
particle2.Enabled = true
particle2.Lifetime = NumberRange.new(20)
particle2.Rate = 50
particle2.LockedToPart = true
particle2.Rotation = NumberRange.new(0, 360)
particle2.Speed = NumberRange.new(1)
particle2.RotSpeed = NumberRange.new(0)
particle2.SpreadAngle = Vector2.new(0, 0)
particle2.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1, 0),
NumberSequenceKeypoint.new(.5,1,0),
NumberSequenceKeypoint.new(.535,0,0),
NumberSequenceKeypoint.new(.567,0,0),
NumberSequenceKeypoint.new(.6,1,0),
NumberSequenceKeypoint.new(1,1,0),
})
end)
FE.MouseButton1Click:connect(function()
FE.TextColor3 = Color3.new(249/255, 74/255, 255/255)
CommandBar.TextColor3 = Color3.new(255/255, 255/255, 255/255)
LC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
FEcommandsframe.Visible = true
commandsframe.Visible = false
lEcommandsframe.Visible = false
PCcommandsframe.Visible = false
end)
CommandBar.MouseButton1Click:connect(function()
FE.TextColor3 = Color3.new(255/255, 255/255, 255/255)
CommandBar.TextColor3 = Color3.new(249/255, 74/255, 255/255)
LC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
FEcommandsframe.Visible = false
commandsframe.Visible = true
lEcommandsframe.Visible = false
PCcommandsframe.Visible = false
end)
LC.MouseButton1Click:connect(function()
FE.TextColor3 = Color3.new(255/255, 255/255, 255/255)
CommandBar.TextColor3 = Color3.new(255/255, 255/255, 255/255)
LC.TextColor3 = Color3.new(249/255, 74/255, 255/255)
PC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
FEcommandsframe.Visible = false
commandsframe.Visible = false
lEcommandsframe.Visible = true
PCcommandsframe.Visible = false
end)
PC.MouseButton1Click:connect(function()
FE.TextColor3 = Color3.new(255/255, 255/255, 255/255)
CommandBar.TextColor3 = Color3.new(255/255, 255/255, 255/255)
LC.TextColor3 = Color3.new(255/255, 255/255, 255/255)
PC.TextColor3 = Color3.new(249/255, 74/255, 255/255)
FEcommandsframe.Visible = false
commandsframe.Visible = false
lEcommandsframe.Visible = false
PCcommandsframe.Visible = true
end)
--FilteringCheckLoop
while true do
wait()
if workspace.FilteringEnabled == true then
FEStats.Text = "- FE Status: Enabled!"
elseif workspace.FilteringEnabled == false then
FEStats.Text = "- FE Status: Disabled!"
end
end
|
object_mobile_dressed_imperial_inquisitor_human_male_03_undead = object_mobile_shared_dressed_imperial_inquisitor_human_male_03_undead:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_imperial_inquisitor_human_male_03_undead, "object/mobile/dressed_imperial_inquisitor_human_male_03_undead.iff")
|
local quad = love.graphics.newQuad
local drawq = love.graphics.drawq
local ceil = math.ceil
local path = (...):match('^.+[%.\\/]') or ''
local grid = require (path..'grid')
-- ##########################
-- 0.9.0 COMPATIBILITY
if not drawq then
drawq = love.graphics.draw
end
-- ##########################
local indexToCoord = function(atlas,index)
if type(index) == 'table' then
return index[1],index[2]
end
local c = atlas.columns
local gy = ceil(index/c)
local gx = index-(gy-1)*c
return gx,gy
end
local getq = function(self,index)
local cell = grid.get(self,indexToCoord(self,index))
if cell then return cell.quad
else
local gx,gy = indexToCoord(self,index)
index = (gy - 1) * self:getColumns() + gx
error('Atlas index is out of range: '..string.format('%s (%s,%s)',index,gx,gy))
end
end
-------------------
-- MODULE
-------------------
local atlas = setmetatable({},{__call = function(self,...) return self.new(...) end})
atlas.__index= atlas
atlas.__call = function(self,index)
return atlas.getqViewport(self,index)
end
function atlas.new(imageWidth,imageHeight, quadWidth,quadHeight, atlasWidth,atlasHeight, ox,oy, xspacing,yspacing)
local iw,ih,qw,qh,aw,ah,xs,ys = imageWidth,imageHeight,quadWidth,quadHeight,atlasWidth,atlasHeight,xspacing,yspacing
local self = grid.new()
qh = qh or qw
ox,oy = ox or 0,oy or 0
xs,ys = xs or 0,ys or 0
aw = aw or iw
ah = ah or ih
local tw,th = qw+xs,qh+ys
local dx,dy = (aw+xs)/tw,(ah+ys)/th
assert(dx % 1 == 0 and dy % 1 == 0,'Dimensions of atlas must be multiples of dimensions of quads + spacings!')
self.rows = dy
self.columns = dx
self.qWidth = qw
self.qHeight = qh
self.aWidth = aw
self.aHeight = ah
self.ox,self.oy= ox,oy
self.xs,self.ys= xs,ys
self.iWidth = imageWidth
self.iHeight = imageHeight
self.atlasname = nil
self.tileoffset= {}
self.properties= {}
for gx = 1,dx do
for gy = 1,dy do
local tile = {
quad = quad((gx-1)*tw+ox,(gy-1)*th+oy,qw,qh,iw,ih),
property = nil,
}
grid.set(self,gx,gy,tile)
end
end
return setmetatable(self,atlas)
end
function atlas:getRows()
return self.rows
end
function atlas:getColumns()
return self.columns
end
function atlas:getImageSize()
return self.iWidth,self.iHeight
end
function atlas:getViewport()
return self.ox,self.oy,self.aWidth,self.aHeight
end
function atlas:getSpacings()
return self.xs,self.ys
end
function atlas:getqSize()
return self.qWidth,self.qHeight
end
function atlas:getqViewport(index)
local quad = getq(self,index)
local x,y = quad:getViewport()
return x,y,atlas.getqSize(self)
end
function atlas:setqProperty(index,value)
grid.get(self,indexToCoord(self,index)).property = value
end
function atlas:getqProperty(index)
return grid.get(self,indexToCoord(self,index)).property
end
function atlas:setName(atlasname)
self.atlasname = atlasname
end
function atlas:getName()
return self.atlasname
end
function atlas:draw(image,index,...)
drawq(image,getq(self,index),...)
end
-- ####################################
-- TMX RELATED FUNCTIONS
-- ####################################
function atlas:getTileOffsets()
local to = self.tileoffset
return to.x,to.y
end
function atlas:setTileOffsets(x,y)
local to = self.tileoffset
to.x,to.y= x or 0,y or 0
end
function atlas:getLayerProperties()
return self.properties
end
return atlas
|
group "Common"
project "Foundation"
kind "StaticLib"
filter 'files:**.lua'
buildmessage 'Processing %{file.name} with bin2c'
buildcommands '%{bin2c} -o "%{cfg.objdir}%{file.basename}".lua.h -n %{file.basename}_lua "%{file.relpath}"'
buildoutputs '%{cfg.objdir}%{file.basename}.lua.h'
SetPCH { hdr = "pch.h", src = "pch.cpp", }
forceincludes {
"pch.h",
}
defines {
"BT_EULER_DEFAULT_ZYX",
"_FEATURE_EXTENDED_PERF_COUNTERS_",
}
files {
"**",
}
excludes {
"./**Test.*"
}
includedirs {
".",
"%{cfg.objdir}",
}
filter "configurations:Debug"
defines{
}
filter "configurations:Release"
defines {
}
|
object = {}
object.t = {}
object.t.__index = object.t
function object.t:new( ... )
local obj = {}
obj.super = nil
setmetatable( obj, object.t )
obj.__index = obj
return obj
end
function object.t:derive( ... )
local newobj = {}
newobj.super = self
setmetatable( newobj, self )
newobj.__index = newobj
return newobj:init( ... )
end
function object.t:init( ... )
return self
end
module( "object" )
|
local ITEM = Clockwork.item:New("weapon_base");
ITEM.name = "Remington Model 1858";
ITEM.cost = 0;
ITEM.model = "models/weapons/w_remington_1858.mdl";
ITEM.weight = 1.27;
ITEM.uniqueID = "m9k_remington1858";
ITEM.business = false;
ITEM.description = "A very, very, very old and rusty revolver, good luck trying to fix it, chambers (If you could call it that) Powder and ball with conical bullets.";
ITEM.isAttachment = false;
ITEM.hasFlashlight = true;
ITEM.loweredOrigin = Vector(3, 0, -4);
ITEM.loweredAngles = Angle(0, 45, 0);
ITEM.attachmentBone = "ValveBiped.Bip01_Pelvis";
ITEM.attachmentOffsetAngles = Angle(90, 0, 0);
ITEM.attachmentOffsetVector = Vector(0, 6.55, 8.72);
ITEM:Register();
|
--[[
LAVRA
--]]
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
server_script "server.js"
client_script "client.js"
|
-- Juste pour tester le port série, envoie une suite "UUUUU" 100x par seconde
-- On envoie 5x le caractère U
-- U en binaire c'est 1010101
-- on peut ainsi bien 'voir' avec un oscilloscope le port série
print("\n a_tst1_serial.lua zf190506.1402 \n")
test_1=tmr.create()
tmr.alarm(test_1, 0.01*1000, tmr.ALARM_AUTO, function()
--tmr.alarm(test_1, 2.5*1000, tmr.ALARM_SINGLE, function()
-- print(" ### ")
-- uart.write(0, string.char(0)..string.char(0)..string.char(1)..string.char(3)..string.char(0).."U")
uart.write(0, "UUUUU")
end)
--[[
tmr.stop(test_1)
tmr.start(test_1)
]]
|
local https = require "ssl.https"
local ltn12 = require "ltn12"
local json = require 'lunajson'
local redis = require "resty.redis"
local incr = 0
if os.getenv("KUBERNETES_SERVICE_HOST") then
k8s_url = "https://" .. os.getenv("KUBERNETES_SERVICE_HOST") .. ":" .. os.getenv("KUBERNETES_SERVICE_PORT_HTTPS")
else
k8s_url = os.getenv("ENDPOINT")
end
local token = os.getenv("TOKEN")
local arg = ngx.req.get_uri_args()
local namespace = arg['namespace']
local decoded = nil
local action = arg['action']
local url = ''
local pods = {}
local method = 'GET'
local pods_not_found = true;
ngx.header['Access-Control-Allow-Origin'] = '*'
ngx.header['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
ngx.header['Access-Control-Allow-Headers'] = 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'
ngx.header['Access-Control-Expose-Headers'] = 'Content-Length,Content-Range';
if action == "delete" then
local red = redis:new()
local okredis, errredis = red:connect("unix:/tmp/redis.sock")
if okredis then
ngx.log(ngx.ERR, "Connection to Redis is ok")
else
ngx.log(ngx.ERR, "Connection to Redis is not ok")
ngx.log(ngx.ERR, errredis)
end
-- Count the total of deleted pods
local res, err = red:get("deleted_pods_total")
if res == ngx.null then
ngx.say(err)
red:set("deleted_pods_total", 1)
else
incr = res + 1
red:set("deleted_pods_total", incr)
end
-- Count the total of deleted pods for namespace
local res, err = red:get("deleted_pods_total_on_" .. namespace)
if res == ngx.null then
red:set("deleted_pods_total_on_" .. namespace, 1)
else
incr = res + 1
red:set("deleted_pods_total_on_" .. namespace, incr)
end
end
if action == "list" then
url = k8s_url.. "/api/v1/namespaces/" .. namespace .. "/pods"
elseif action == "delete" then
local pod_name = arg['pod_name']
url = k8s_url.. "/api/v1/namespaces/" .. namespace .. "/pods/" .. pod_name
method = "DELETE"
else
ngx.say("Please set the parameter 'action'")
ngx.exit(ngx.OK)
end
--ngx.log(ngx.ERR, "token: " .. token)
ngx.log(ngx.ERR, "url: " .. url)
ngx.log(ngx.ERR, "namespace: " .. namespace)
local headers = {
["Accept"] = "application/json",
["Content-Type"] = "application/json",
["Authorization"] = "Bearer " .. token,
}
local resp = {}
local ok, statusCode, headers, statusText = https.request{
url = url,
headers = headers,
method = method,
sink = ltn12.sink.table(resp)
}
ngx.log(ngx.ERR, "REQUEST LOGS...")
ngx.log(ngx.ERR, ok)
ngx.log(ngx.ERR, statusCode)
ngx.log(ngx.ERR, statusText)
if action == "list" then
local i = 1
pods["items"] = {}
for k,v in ipairs(resp) do
decoded = json.decode(v)
if decoded["kind"] == "PodList" then
for k2,v2 in ipairs(decoded["items"]) do
if v2["status"]["phase"] == "Running" and v2["metadata"]["labels"]["approle"] ~= "chaosnode" then
ngx.log(ngx.ERR, "found pod " .. v2["metadata"]["name"])
pods["items"][i] = v2["metadata"]["name"]
i = i + 1
pods_not_found = false;
end
end
end
end
if pods_not_found then
ngx.log(ngx.ERR, "No pods found into the namespace " .. namespace)
ngx.say("{\"items\": []}")
else
ngx.say(json.encode(pods))
end
elseif action == "delete" then
ngx.say(table.concat(resp))
end
|
ENT.Type = "anim"
ENT.Base = "base_rd3_entity"
ENT.PrintName = "Water Heater"
list.Set("LSEntOverlayText", "generator_gas_steam", {
HasOOO = true,
resnames = {"energy", "water"},
genresnames = {"water"}
})
|
--[[
TheNexusAvenger
Implementation of a command.
--]]
local BaseCommand = require(script.Parent.Parent:WaitForChild("BaseCommand"))
local PrivateChatWindow = require(script.Parent.Parent:WaitForChild("Resources"):WaitForChild("PrivateChatWindow"))
local Command = BaseCommand:Extend()
--[[
Creates the command.
--]]
function Command:__new()
self:InitializeSuper({"pchat","pc"},"BasicCommands","Starts a private chat between a set of players.")
self.Arguments = {
{
Type = "nexusAdminPlayers",
Name = "Players",
Description = "Players to run the vote for.",
},
{
Type = "string",
Name = "Question",
Description = "Message to send.",
},
}
--Connect the remote objects.
self.API.EventContainer:WaitForChild("SendPrivateMessage").OnClientEvent:Connect(function(Player,Message)
local PrivateChatWindow = PrivateChatWindow.new(Player,Message)
function PrivateChatWindow.OnMessage(_,Message)
self.API.EventContainer:WaitForChild("SendPrivateMessage"):FireServer(Player,Message)
PrivateChatWindow:OnClose()
end
PrivateChatWindow:Show()
end)
end
--[[
Runs the command.
--]]
function Command:Run(CommandContext,Players,Message)
self.super:Run(CommandContext)
--Invoke the server to send messages.
for _,Player in pairs(Players) do
self.API.EventContainer:WaitForChild("SendPrivateMessage"):FireServer(Player,Message)
end
end
return Command
|
--[[ Copyright (c) 2010 Manuel "Roujin" Wolf, "Fabiomsouto"
Copyright (c) 2011 Sérgio "Get_It" Ribeiro
Copyright (c) 2012 <Filipe "Aka" Carvalho>
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. --]]
Language(utf8 "Português", "Portuguese", "pt", "pt")
Inherit("english")
------------------------------- OVERRIDE ----------------------------------
adviser.warnings.money_low = "Estás a ficar sem dinheiro!" -- Funny. Exists in German translation, but not existent in english?
-- TODO: tooltip.graphs.reputation -- this tooltip talks about hospital value. Actually it should say reputation.
-- TODO: tooltip.status.close -- it's called status window, not overview window.
-- The originals of these two contain one space too much
fax.emergency.cure_not_possible_build = "Vais precisar de construir %s"
fax.emergency.cure_not_possible_build_and_employ = "Vais precisar de construir um %s e empregar um %s"
-- Improve tooltips in staff window to mention hidden features
tooltip.staff_window.face = "A cara desta pessoa - clique para abrir o ecrã de gestão de pessoal"
tooltip.staff_window.center_view = "Clique esquerdo para ir para onde está a pessoa, clique direito para navegador através dos funcionários"
-- These strings are missing in some versions of TH (unpatched?)
confirmation.restart_level = "Tem a certeza que deseja reiniciar este nível?"
------------------------------- NEW STRINGS -------------------------------
confirmation.maximum_screen_size = "A resolução de ecrã que escolheu é maior que 3000 x 2000. Resoluções mais altas são possíveis, mas requerem melhor hardware de forma a manter uma taxa de fotogramas (FPS) jogável. De certeza que deseja continuar?"
confirmation.music_warning = "Antes de escolher usar mp3 para a música dentro do jogo, necessita de ter o smpeg.dll ou equivalente para o seu sistema operativo, caso contrário, não terá música no jogo. Deseja continuar?"
menu_options_wage_increase.deny = " NEGAR "
menu_options_wage_increase.grant = " PERMITIR "
tooltip.options_window.audio_button = "Ligar ou desligar todo o som do jogo"
tooltip.options_window.audio_toggle = "Ligar ou desligar"
tooltip.options_window.folder_button = "Opções de pastas"
tooltip.options_window.customise_button = "Mais opões que pode alterar para personalizar a sua experiência de jogo."
tooltip.update_window.download = "Vá para a página de transferências para a última versão de CorsixTH"
tooltip.update_window.ignore = "Ignorar esta actualização agora. Será notificado de novo na próxima vez que inicializar CorsixTH"
tooltip.folders_window.browse_font = "Procurar outro tipo de letra (localização actual: %1% )"
tooltip.folders_window.screenshots_location = "Por defeito, as capturas de ecrã são armazenadas numa pasta junto do ficheiro de configuração. Caso isto não seja apropriado, pode escolher a sua própria, simplesmente indique qual a pasta que deseja utilizar."
tooltip.folders_window.reset_to_default = "Reinicializar a directoria para a localização por defeito"
tooltip.folders_window.back = "Fechar este menu e voltar às definições."
tooltip.folders_window.music_location = "Escolha a localização dos seus ficheiros mp3. A pasta já deve ter sido criada, e agora escolha o directório que acabou de criar."
tooltip.folders_window.font_location = "Localização de um tipo de letra capaz de mostrar caracteres Unicode requeridos pela sua língua. Se isto não for especificado, não será capaz de escolher línguas que necessitam de mais caracteres que o jogo original consegue fornecer. Exemplo: Russo e Chinês."
tooltip.folders_window.savegames_location = "Por defeito, os jogos gravados são armazenados numa pasta junto do ficheiro de configuração. Caso isto não seja apropriado, pode escolher a sua própria, simplesmente indique qual a pasta que deseja utilizar."
tooltip.folders_window.browse_data = "Escolha outra localização da instalação do Theme Hospital (localização actual: %1% )"
tooltip.folders_window.browse = "Escolha a localização da pasta"
tooltip.folders_window.browse_screenshots = "Escolha outra localização para a pasta das capturas de ecrã (Localização actual: %1%) "
tooltip.folders_window.browse_music = "Escolha outra localização para a pasta da música (Localização actual: %1%) "
tooltip.folders_window.no_font_specified = "Nenhum tipo de letra especificado!"
tooltip.folders_window.not_specified = "Nenhuma pasta especificada!"
tooltip.folders_window.browse_saves = "Escolha outra localização para a pasta dos jogos gravados (Localização actual: %1%) "
tooltip.folders_window.default = "Localização por defeito"
tooltip.folders_window.data_location = "O directório da instalação do Theme Hospital original, que é necessário para correr o CorsixTH"
tooltip.customise_window.aliens = "Devido à falta de animações apropriadas, colocamos por defeito que pacientes com ADN Extraterrestre só possam surgir numa emergência. Para permitir que estes pacientes possam visitar o hospital de outra forma, desligue esta opção."
tooltip.customise_window.average_contents = "Se quer que o jogo lhe lembre que objectos adicionais costuma adicionar quando cria uma sala, ligue esta opção."
tooltip.customise_window.back = "Fechar este menu e voltar às definições."
tooltip.customise_window.movies = "Controle geral de vídeos, isto irá permitir desligar todos os vídeos"
tooltip.customise_window.fractured_bones = "Devido a uma má animação colocamos por defeito que não existem pacientes femininas com Ossos Partidos. De forma a permitir que pacientes femininas com Ossos Partidos visitem o hospital, desligue esta opção."
tooltip.customise_window.volume = "Se o botão para baixar o volume está a abrir também o livro médico, ligue esta opção para mudar o atalho para o livro médico para Shift + C"
tooltip.customise_window.intro = "Ligar ou desligar o vídeo de introdução, o controle geral de vídeos tem que estar ligado se quer ver a introdução cada vez que começa o CorsixTH"
tooltip.customise_window.paused = "No Theme Hospital o jogador apenas podia utilizar o menu de topo se o jogo estivesse pausado. Esta é também a opção por defeito no CorsixTH, mas ao activar esta opção, tudo é permitido com o jogo pausado."
update_window.caption = "Actualização Disponível!"
update_window.new_version = "Nova Versão:"
update_window.current_version = "Versão Actual:"
update_window.download = "Ir à página de transferências"
update_window.ignore = "Saltar e ir para o menu principal"
errors.fractured_bones = "AVISO: A animação para pacientes femininas com Ossos Partidos não é perfeita."
errors.alien_dna = "AVISO: Não existem animação para pacientes Extraterrestres a sentarem-se, abrir ou bater em portas, etc. Então, como no Theme Hospital, para executarem estas animações eles ficam com um aspecto normal, e depois voltam ao aspecto original. Pacientes com ADN Extraterrestre só irão aparecer se estiver previsto no nível."
errors.load_quick_save = "Erro, não foi possível carregar o quick save já que não existe. Nada de preocupações, já que criamos agora um para si!"
folders_window.data_label = "Dados TH"
folders_window.music_location = "Escolha a directoria que usar para a sua música"
folders_window.music_label = "MP3's"
folders_window.new_th_location = "Aqui pode especificar uma nova pasta de instalação do Theme Hospital. Assim que escolher a nova directoria, o jogo irá reiniciar."
folders_window.caption = "Localizações de pastas"
folders_window.screenshots_label = "Capturas de ecrã"
folders_window.font_label = "Tipos de letra"
folders_window.savegames_label = "Jogos gravados"
folders_window.back = "Retroceder"
folders_window.savegames_location = "Escolha a directoria que usar para jogos gravados"
folders_window.screenshots_location = "Escolha a directoria que usar para capturas de ecrã"
customise_window.average_contents = "Itens comuns"
customise_window.option_on = "Ligado"
customise_window.paused = "Construir com o jogo pausado"
customise_window.option_off = "Desligado"
customise_window.intro = "Reproduzir vídeo de introdução"
customise_window.caption = "Definições Personalizadas"
customise_window.back = "Retroceder"
customise_window.movies = "Controle Geral de Vídeos"
customise_window.volume = "Atalho para baixar o volume"
customise_window.aliens = "Pacientes Extraterrestres"
customise_window.fractured_bones = "Ossos Partidos"
options_window.folder = "Pastas"
options_window.customise = "Personalizar"
options_window.audio = "Som Geral"
menu_options.twentyfour_hour_clock = " RELÓGIO DE 24 HORAS "
menu_options.wage_increase = " EXIGÊNCIAS SALARIAIS"
install.ok = "OK"
install.cancel = "Cancelar"
adviser.research.drug_improved_1 = "A droga para %s foi melhorada pelo Departamento de Pesquisa"
adviser.warnings.no_desk_7 = "Já construiu o balcão de atendimento, então que tal contratar uma recepcionista? Não irá atender clientes até que resolva isto!"
adviser.warnings.researcher_needs_desk_1 = "Um Investigador precisa de ter uma secretária onde trabalhar."
adviser.warnings.no_desk_6 = "Já tem a recepcionista, então que tal construir uma balcão de atendimento para ela trabalhar?"
adviser.warnings.nurse_needs_desk_1 = "Cada Enfermeira necessita de uma secretária onde trabalhar."
adviser.warnings.researcher_needs_desk_2 = "O seu Investigador está satisfeito que o tenha deixado descansar um pouco. Se quer ter mais pessoal a fazer pesquisa, então precisa de dar uma secretária a cada um deles."
adviser.warnings.no_desk_5 = "Está na hora, devem estar a chegar pacientes a qualquer momento!"
adviser.warnings.no_desk_4 = "Uma recepcionista precisa de ter o seu posto de trabalho para atender os pacientes assim que chegam."
adviser.warnings.researcher_needs_desk_3 = "Cada Investigador necessita de uma secretária onde trabalhar."
adviser.warnings.cannot_afford_2 = "Não tem dinheiro suficiente no banco para fazer essa compra!"
adviser.warnings.nurse_needs_desk_2 = "A sua Enfermeira está satisfeita que a tenha deixado descansar um pouco. Se quer ter mais que uma a trabalhar na enfermaria, então precisa de dar uma secretária a cada uma delas."
object.litter = "Lixo"
tooltip.objects.litter = "Lixo: Deitado fora por um paciente porque não encontrou um caixote do lixo onde o colocar."
menu_options.lock_windows = " BLOQUEAR JANELAS "
menu_options_game_speed.pause = " PAUSA "
menu_debug = {
transparent_walls = " PAREDES TRANSPARENTES ",
limit_camera = " LIMITAR CAMARA ",
disable_salary_raise = " DESACTIVAR AUMENTO DOS SALÁRIOS ",
make_debug_patient = " MAKE DEBUG PATIENT ",
spawn_patient = " GERAR PACIENTE ",
make_adviser_talk = " MAKE ADVISER TALK ",
show_watch = " MOSTRAR RELÓGIO ",
create_emergency = " CRIAR EMERGENCIA ",
place_objects = " COLOCAR OBJECTOS ",
dump_strings = " DUMP DAS STRINGS ",
map_overlay = " OVERLAY DO MAPA ",
sprite_viewer = " VISUALIZAR SPRITES ",
}
menu_debug_overlay = {
none = " NENHUM ",
flags = " FLAGS ",
positions = " POSIÇOES ",
byte_0_1 = " BYTE 0 & 1 ",
byte_floor = " BYTE FLOOR ",
byte_n_wall = " BYTE N WALL ",
byte_w_wall = " BYTE W WALL ",
byte_5 = " BYTE 5 ",
byte_6 = " BYTE 6 ",
byte_7 = " BYTE 7 ",
parcel = " PARCEL ",
}
adviser.room_forbidden_non_reachable_parts = "Colocar o espaço neste sítio bloquearia o acesso a zonas do hospital."
dynamic_info.patient.actions.no_gp_available = "À espera que seja construidos um consultório de CG."
dynamic_info.staff.actions.heading_for = "Indo para %s"
misc.not_yet_implemented = "(not yet implemented)"
misc.no_heliport = "Hm... Ou não foram desocbertas novas doenças ou não existe um heliporto neste mapa."
main_menu = {
new_game = "Novo jogo",
custom_level = "Nível Personalizado",
load_game = "Carregar Jogo",
options = "Opçoes",
exit = "Sair",
}
tooltip.main_menu = {
new_game = "Começar um jogo de raíz",
custom_level = "Construir o meu hospital",
load_game = "Carregar um jogo",
options = "Ajustar preferencias",
exit = "Nao, por favor, nao saias!",
}
load_game_window = {
back = "Voltar",
}
tooltip.load_game_window = {
load_game_number = "Carregar o jogo %d",
load_autosave = "Carregar o jogo gravado automaticamente",
back = "Fechar a janela de carregamento",
}
errors = {
dialog_missing_graphics = "Desculpa, mas a versão de demonstração não tem este diálogo!",
save_prefix = "Erro durante a gravação do jogo: ",
load_prefix = "Erro durante o carregamento do jogos: ",
}
totd_window = {
tips = {
"Todos os hospitais precisam de uma recepção e de um consultório de CG para começar. Depois disso, depende do tipo de pacientes que recebes. Uma farmácia é sempre uma boa escolha, no entanto.",
"Máquinas como a Bomba de Encher Cabeças precisam de manutenção. Contrata um ou dois funcionários para reparar as tuas máquinas, ou arriscas-te a que o pessoal ou os pacientes se aleijem quando elas avariarem.",
"Após algum tempo, o teu pessoal vai ficar cansado. Constrói um Quarto do Pessoal, para que eles possam relaxar.",
"Coloca radiadores em quantidade suficiente para que o teu pessoal e pacientes estejam quentinhos... caso contrário irao ficar aborrecidos!",
"O nível de perícia de um médico influencia a qualidade e velocidade do seu diagnóstico. Coloca um médico com perícia nas salas de CGs, e não precisarás de tantas salas de diagnóstico.",
"Médicos júniores e regulares podem aumentar a sua perícia se aprenderem com um consultante numa Sala de Treino. Se o consultante for especialista (cirurgiao, psiquiatra ou investigador), também ensinará a sua especialização aos seus pupilos.",
"Já tentaste escrever o número de emergência (112) no fax? Não te esqueças de ligar as colunas!",
"O menu de opçoes ainda não está implementado, mas podes ajustar algumas preferencias tais como resoluçao e língua no ficheiro config.txt na pasta do jogo.",
"Seleccionaste outra linguagem além do Ingles, mas ves Ingles em todo o lado? Ajuda-nos a traduzir esse texto!",
"A equipa do CorsixTH está à procura de reforços! Estás interessado em programar, traduzir ou criar arte gráfica para o CorsixTH? Contacta-nos no fórum, IRC (corsix-th no freenode) ou via Mailing List.",
"Se encontrares um bug, diz-nos em: th-issues.corsix.org",
"Tens que cumprir certos requisitos para poder avançar de nível. Consulta a tua janela de status para veres o progresso em relaçao aos objectivos do nível.", -- dicas juntas
"Se quiseres alterar ou remover alguma sala existente,utiliza o botao editar na barra de ferramentas em baixo no teu ecra.",
"Se tiveres muitos pacientes na fila de espera, podes saber rapidamente quais estao à espera de uma determinada sala passando com o cursor por cima desta.",
"Clica numa porta para ver a lista de espera.Podes alterar a ordem dos pacientes ou mandá-los para outra sala.",
"Staffs descontentes irao pedir aumentos de salário frequentemente , assegura que tens um bom ambiente de trabalho para isto não acontecer!",
"Os pacientes ficarao com sede enquanto esperam no hospital,ainda mais se os radiadores estiverem muito quentes.Coloca máquinas de bebidas em locais estratégicos para ganhares mais uns trocos.",
"Podes abortar o processo de diagnóstico para um paciente e tentar adivinhar a cura caso já tenhas descoberto a doença. Cuidado que este processo pode aumentar o risco de uma cura errada levando à morte do paciente.",
"Emergencias sao uma boa forma de ganhar algum dinheiro extra,garante que o teu hospital tem condiçoes para as completar.",
},
previous = "Dica anterior",
next = "Próxima dica",
}
tooltip.totd_window = {
previous = "Mostrar dica anterior",
next = "Mostrar a próxima dica",
}
debug_patient_window.caption = "Debug Paciente"
totd_window = {
tips = {
"Tens que cumprir certos requisitos para poder avançar de nível. Consulta a tua janela de status para veres o progresso em relaçao aos objectivos do nível.",
"Se quiseres alterar ou remover alguma sala existente,utiliza o botao editar na barra de ferramentas em baixo no teu ecra.",
"Se tiveres muitos pacientes na fila de espera, podes saber rapidamente quais estao à espera de uma determinada sala passando com o cursor por cima desta.",
"Clica numa porta para ver a lista de espera.Podes alterar a ordem dos pacientes ou mandá-los para outra sala.",
"Staffs descontentes irao pedir aumentos de salário frequentemente , assegura que tens um bom ambiente de trabalho para isto não acontecer!",
"Os pacientes ficarao com sede enquanto esperam no hospital,ainda mais se os radiadores estiverem muito quentes.Coloca máquinas de bebidas em locais estratégicos para ganhares mais uns trocos.",
"Podes abortar o processo de diagnóstico para um paciente e tentar adivinhar a cura caso já tenhas descoberto a doença. Cuidado que este processo pode aumentar o risco de uma cura errada levando à morte do paciente.",
"Emergencias sao uma boa forma de ganhar algum dinheiro extra,garante que o teu hospital tem condiçoes para as completar.",
},
}
tooltip.casebook.cure_requirement.hire_staff = "Precisas de contratar alguém para fazer este tratamento."
tooltip.casebook.cure_type.unknown = "Ainda não sabes tratar esta doença."
tooltip.information.close = "Fecha o diálogo de informação"
tooltip.load_game_window.load_game = "Ler jogo: %s"
tooltip = {
message = {
button = "Clica com o botão esquerdo para abrir a mensagem.",
button_dismiss = "Click esquerdo para abrir a mensagem,click direito para apagar",
},
custom_game_window = {
start_game_with_name = "Ir para o nível %s",
},
cheats_window = {
close = "Fecha a janela dos truques",
cheats = {
end_month = "Salta para o final do mês.",
create_patient = "Cria um paciente no mapa.",
money = "Adiciona 10000 à tua conta bancária",
emergency = "Cria uma emergência",
win_level = "Vence o nível.",
lose_level = "Perde o nível.",
vip = "Cria um VIP.",
all_research = "Completa toda a pesquisa.",
end_year = "Salta para o final do ano.",
},
},
menu_list_window = {
save_date = "Coloca a lista por data de modificação.",
name = "Coloca a lista por nome.",
back = "Fecha esta janela.",
},
new_game_window = {
hard = "Se estás habituado a este tipo de jogos e procuras um desafio escolhe esta opçao.",
cancel = "Oh mas eu não queria começar um jogo de novo!",
tutorial = "Se precisas de umas dicas para começar a jogar,marca esta caixa.",
easy = "Se és novo em jogos de simulaçoes,esta é a opçao para ti.",
medium = "Se já te sentes à vontade tenta a opção média!",
},
save_game_window = {
new_save_game = "Nome para salvar o jogo.",
save_game = "Gravar por cima da gravação? %s",
},
calls_dispatcher = {
assigned = "Esta caixa estrá marcada, se alguém esttiver a tratar da tarefa correspondente.",
task = "Lista de tarefas - Clica em tarefas para abrir as tarefas atribuídas ao staff e encontrares a localização de determinada tarefa.",
close = "Fecha a janela de diálogo do expedidor de chamadas.",
},
research_policy = {
research_progress = "Progresso em relação à próxima descoberta: %1%/%2%",
no_research = "Não está a ser feita nenhuma pesquisa de momento.",
},
lua_console = {
textbox = "Coloca aqui o código Lua para executar",
execute_code = "Executa o código colocado.",
close = "Fecha a consola.",
},
fax = {
close = "Fecha esta janela sem apagar a mensagem.",
},
options_window = {
fullscreen_button = "Clica para modo de tela cheia",
original_path = "A directoria da instalaçao original de Theme Hospital",
browse = "Procura outra localizaçao da instalaçao original. %1%",
change_resolution = "Altera a resoluçao da janela para as dimensoes colocadas à esquerda",
height = "Coloca a altura desejada.",
width = "Coloca a largura desejada.",
language = "Escolhe %s como a tua linguagem.",
back = "Fecha a janela de opçoes.",
},
}
custom_game_window.caption = "Jogo Customizado"
cheats_window = {
cheats = {
end_month = "Fim do Mês",
create_patient = "Criar Paciente",
money = "Truque para Dinheiro",
emergency = "Criar emergência",
win_level = "Vencer nível",
lose_level = "Perder nível",
vip = "Criar VIP",
all_research = "Pesquisa Completa",
end_year = "Fim do Ano",
},
close = "Fechar",
caption = "Truques",
cheated = {
no = "Truques usados?: Nao",
yes = "Truques usados?: Sim",
},
warning = "Aviso:Se utilizares truques não irás ganhar pontos de reputação no final do nível!",
}
errors = {
unavailable_screen_size = "Esta resolução não está disponível no modo de tela cheia.",
maximum_screen_size = "Resolução máxima de 3000x2000.",
map_file_missing = "Não foi encontrado o ficheiro do mapa %s para este nível!",
minimum_screen_size = "Resolução mínima de 640x480.",
}
date_format.daymonth = "%1% - %2% -"
menu_debug = {
lua_console = " (F12) CONSOLA LUA",
make_debug_fax = " DEBUG FAX",
calls_dispatcher = " CHAMAR EXPEDIDOR",
cheats = " (F11) TRUQUES",
dump_gamelog = " (CTRL+D) CRIAR LOG DO JOGO",
jump_to_level = " SALTAR PARA OUTRO NIVEL",
}
menu_options = {
edge_scrolling = " EDGE SCROLLING ",
settings = " PREFERENCIAS ",
}
lua_console = {
execute_code = "Executar",
close = "Fechar",
}
install= {
exit = "Sair",
th_directory = "CorsixTH precisa dos ficheiros de dados da instalação original de Theme Hospital(ou demo) para funcionar. Localize a sua instalação atráves da caixa em baixo.",
title = "--------------------------------- Instalação CorsixTH ---------------------------------",
}
load_game_window.caption = "Ler Jogo"
adviser = {
cheats = {
th_cheat = "Parabéns batoteiro! Acabaste de desbloquear os truques!",
hairyitis_cheat = "Activado cheat da doença Olfatis",
roujin_on_cheat = "Activado o desafio Roujin! Boa sorte...",
crazy_on_cheat = "Oh não! Os teus médicos estão malucos!",
bloaty_off_cheat = "Desactivado truque das Cabeças Gigantes!",
bloaty_cheat = "Activado truque das Cabeças Gigantes!",
crazy_off_cheat = "Ufa... os teus médicos voltaram ao normal.",
roujin_off_cheat = "Desafio Roujin desactivado.",
hairyitis_off_cheat = "Desactivado truque da doença Olfatis",
},
warnings = {
no_desk_2 = "Bom trabalho! Deve ser um recorde mundial: quase um ano completo e não há pacientes! Se desejas continuar a gerir este hospital tens que contratar uma recepcionista e construir uma recepção para receberes os pacientes!",
no_desk = "Constrói uma recepçao e uma recepcionista para começar!",
no_desk_1 = "Se queres que os pacientes venham ao teu hospital vais precisar de uma recepçao e uma recepcionista!",
},
}
calls_dispatcher = {
repair = "Reparar %s",
summary = "%d Chamadas; %d atribuídas",
close = "Fechar",
watering = "Regar @ %d,%d",
staff = "%s - %s ",
}
information = {
level_lost = {
"Que chatice! Perdeste. Mais sorte para a próxima!",
"Razões da derrota:",
reputation = "A tua reputação ficou abaixo de %d.",
balance = "A tua conta bancària ficou abaixo de %d.",
percentage_killed = "Mataste mais do que %d por cento dos pacientes.",
},
cannot_restart = "Infelizmente este jogo customizado foi gravado antes da implementação da função de reinício.",
custom_game = "Bem-vindo ao CorsixTH. Diverte-te neste mapa customizado!",
}
new_game_window = {
hard = "Consultor (Difícil)",
cancel = "Cancelar",
tutorial = "Tutorial ",
easy = "Junior (Fácil)",
medium = "Doutor (Médio)",
}
options_window = {
fullscreen = "Tela cheia",
cancel = "Cancelar",
browse = "Procurar...",
width = "Largura",
height = "Altura",
new_th_directory = "Aqui podes escolher uma nova localizaçao da instalaçao de Theme Hospital,assim que o fizeres o jogo será reiniciado.",
change_resolution = "Alterar resoluçao",
back = "Voltar",
}
menu_list_window = {
save_date = "Modificado",
name = "Nome",
back = "Voltar",
}
save_game_window = {
caption = "Gravar jogo",
new_save_game = "Nova gravaçao",
}
fax.emergency.num_disease_singular = "Existe uma pessoa com %s e necessita de atenção imediata!"
fax.choices = {
decline_new_level = "Continuar a jogar",
accept_new_level = "Avançar para o nível seguinte",
return_to_main_menu = "Voltar para o menu principal",
}
menu_debug_overlay.heat = " TEMPERATURA "
confirmation.abort_edit_room = "Estás a construir ou a editar uma sala. Se todos os objectos necessários estiverem colocados a sala estará terminada, caso contrário será eliminada. Continuar?"
confirmation.needs_restart = "Estas alterações requerem que reinicies o jogo,O progresso não gravado será perdido. Desejas continuar?"
dynamic_info.staff.actions.fired = "Despedido"
introduction_texts.demo =
"Bem-vindo ao hospital do demo!//" ..
"Infelizmente este demo só tem este nível.Contudo existe aqui muito trabalho para te manter ocupado! " ..
"Encontrarás várias doenças que requerem salas diferentes para os seus tratamentos.Ao longo do tempo " ..
"irão ocorrer algumas emergências e precisarás de descobrir novos tratamentos atráves da sala de pesquisa. " ..
"O teu objectivo é ganhar 100,000$,ter um hospital avaliado em 70,000$,uma reputação de 700 e uma cura de 75% dos pacientes. " ..
"Garante que a tua reputação não cai abaixo de 300 e que não mates 40% dos teus pacientes senão perderás o nível.//" ..
"Boa sorte!"
letter = {
custom_level_completed = "Bom trabalho!Completaste todos os objectivos deste nível!",
dear_player = "Caro %s",
return_to_main_menu = "Desejas regressar ao menu principal ou continuar a jogar?",
}
staff_class = {
nurse = "Enfermeira",
doctor = "Doutor",
handyman = "Contínuo",
receptionist = "Recepcionista",
surgeon = "Cirurgião",
}
-- Staff titles
-- these are titles used e.g. in the dynamic info bar
staff_title = {
receptionist = "Recepcionista",
general = "General", -- unused?
nurse = "Enfermeira",
junior = "Junior",
doctor = "Doutor",
surgeon = "Cirurgião",
psychiatrist = "Psiquiatra",
consultant = "Consultor",
researcher = "Pesquisador",
}
staff_list = {
morale = "MORAL",
tiredness = "CANSAÇO",
skill = "QUALIFICAÇOES",
total_wages = "SALÁRIO",
}
-- Objects
object = {
desk = "Secretária",
cabinet = "Arquivador",
door = "Porta",
bench = "Banco",
table1 = "Mesa", -- unused object
chair = "Cadeira",
drinks_machine = "Máquina de Bebidas",
bed = "Cama",
inflator = "Inflador",
pool_table = "Mesa de Bilhar",
reception_desk = "Recepçao",
table2 = "Mesa", -- unused object & duplicate
cardio = "Cardio",
scanner = "Scanner",
console = "Consola",
screen = "Ecra",
litter_bomb = "Bomba de lixo",
couch = "Sofá",
sofa = "Sofá",
crash_trolley = "Trolley",
tv = "TV",
ultrascanner = "Ultrascanner",
dna_fixer = "Fixador de DNA",
cast_remover = "Removedor de Gesso",
hair_restorer = "Recuperador de Cabelo",
slicer = "Fatiador",
x_ray = "Raio-X",
radiation_shield = "Escudo de Radiaçao",
x_ray_viewer = "Visualizador de Radiação",
operating_table = "Mesa de Operação",
lamp = "Lampâda", -- unused object
toilet_sink = "Pia",
op_sink1 = "Pia",
op_sink2 = "Pia",
surgeon_screen = "Ecra de Operaçao",
lecture_chair = "Cadeira de aluno",
projector = "Projector",
bed2 = "Cama", -- unused duplicate
pharmacy_cabinet = "Gabinete de Farmácia",
computer = "Computador",
atom_analyser = "Analisador de Átomos",
blood_machine = "Máquina de Análise Sanguínea",
fire_extinguisher = "Extintor",
radiator = "Radiador",
plant = "Planta",
electrolyser = "Electrolisador",
jelly_moulder = "Moldador gelatinoso",
gates_of_hell = "Portões do Inferno",
bed3 = "Cama", -- unused duplicate
bin = "Balde do lixo",
toilet = "WC",
swing_door1 = "Porta",
swing_door2 = "Porta",
shower = "Chuveiro",
auto_autopsy = "Auto-Autópsia",
bookcase = "Estante",
video_game = "Máquina de Arcade",
entrance_left = "Entrada esquerda",
entrance_right = "Entrada direita",
skeleton = "Esqueleto",
comfortable_chair = "Cadeira de conforto",
}
-- Months
months = {
"Jan",
"Fev",
"Mar",
"Abr",
"Mai",
"Jun",
"Jul",
"Ago",
"Set",
"Out",
"Nov",
"Dez",
}
-- Rooms short
-- NB: includes some special "rooms"
-- reception, destroyed room and "corridor objects"
rooms_short = {
reception = "Recepçao",
destroyed = "Destruído",
corridor_objects = "Objectos de Corredor",
gps_office = "Consultório Geral",
psychiatric = "Psiquiatria",
ward = "Enfermaria",
operating_theatre = "Sala de Operações",
pharmacy = "Farmácia",
cardiogram = "Cardio",
scanner = "Scanner",
ultrascan = "Ultrascanner",
blood_machine = "Sala de Análises Sanguíneas",
x_ray = "Raio-X",
inflation = "Inflador",
dna_fixer = "Fixador de DNA",
hair_restoration = "Recuperador de Cabelo",
tongue_clinic = "Fatiador",
fracture_clinic = "Clínica de Fracturas",
training_room = "Sala de Aprendizagem",
electrolysis = "Sala de Electrolisador",
jelly_vat = "Moldador Gelatinoso",
staffroom = "Sala do Pessoal",
-- rehabilitation = "Reabilitação", -- unused
general_diag = "Diagnóstico Geral",
research_room = "Sala de Pesquisa",
toilets = "Casas de Banho",
decontamination = "Descontaminação",
}
-- Menu Options Game Speed
menu_options_game_speed = {
slowest = " MUITO LENTO ",
slower = " LENTO ",
normal = " NORMAL ",
max_speed = " RAPIDO ",
and_then_some_more = " AINDA MAIS RAPIDO ",
}
-- Menu Display
menu_display = {
high_res = " ALTA RESOLUÇAO ",
mcga_lo_res = " BAIXA RESOLUCAO ",
shadows = " SOMBRAS ",
}
-- Menu Charts
menu_charts = {
statement = " INDICACOES ",
casebook = " PONTUARIO DE DOENÇAS ",
policy = " POLITICAS DO HOSPITAL ",
research = " PESQUISA ",
graphs = " GRAFICOS ",
staff_listing = " LISTA DO STAFF ",
bank_manager = " CONTA BANCARIA ",
status = " STATUS ",
briefing = " BRIEFING ",
}
menu = {
file = " FICHEIRO ",
options = " OPÇOES ",
display = " DISPLAY",
charts = " TABELAS ",
debug = " DEBUG ",
}
-- Menu File
menu_file = {
load = " LER JOGO ",
save = " SALVAR JOGO ",
restart = " REINICIAR ",
quit = " SAIR ",
}
-- Menu Options
menu_options = {
sound = " SOM ",
announcements = " ANUNCIOS ",
music = " MUSICA ",
sound_vol = " VOLUME DOS SONS ",
announcements_vol = " SOM DOS ANUNCIOS ",
music_vol = " VOLUME DA MUSICA ",
autosave = " AUTOSAVE ",
game_speed = " VELOCIDADE DO JOGO ",
jukebox = " JUKEBOX ",
}
-- Menu Options Volume
menu_options_volume = {
[10] = " 10% ",
[20] = " 20% ",
[30] = " 30% ",
[40] = " 40% ",
[50] = " 50% ",
[60] = " 60% ",
[70] = " 70% ",
[80] = " 80% ",
[90] = " 90% ",
[100] = " 100% ",
}
confirmation = {
abort_edit_room = "Estás a construir ou a editar uma sala. Se todos os objectos necessários estiverem colocados a sala estará terminada, caso contrário será eliminada. Continuar?",
return_to_blueprint = "Tens a certeza que desejas voltar ao modo de desenho?",
restart_level = "Tens a certeza que queres reiniciar o nível?",
delete_room = "Desejas apagar esta sala?",
quit = "Queres mesmo sair do jogo?",
needs_restart = "Estas alterações requerem que reinicies o jogo,O progresso não gravado será perdido. Desejas continuar?",
overwrite_save = "Já existe uma gravação nesta slot.Desejas gravar por cima?",
sack_staff = "Queres mesmo despedir este membro do staff?",
replace_machine = "Queres mesmo repor %s por $%d?",
}
vip_names = {
[1] = "Presidente da Cruz Vermelha",
[2] = "Ricardo Araújo Pereira",
[3] = "D. Duarte Pio de Bragança",
[4] = "Joe Berardo",
[5] = "José Mourinho",
[6] = "Alberto João Jardim",
[7] = "Marcelo Rebelo de Sousa",
[8] = "Cavaco Silva",
[9] = "Cristiano Ronaldo",
[10] = "Tradutor Filipe Carvalho",
health_minister = "Ministro da Saúde",
}
-- Rooms
room_classes = {
-- S[19][2] -- "corridors" - unused for now
diagnosis = "Diagnóstico",
treatment = "Tratamento",
clinics = "Clínicas",
facilities = "Acomodaçoes",
}
|
object_tangible_loot_beast_beast_steroid_bat_bull = object_tangible_loot_beast_shared_beast_steroid_bat_bull:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_beast_beast_steroid_bat_bull, "object/tangible/loot/beast/beast_steroid_bat_bull.iff")
|
require "controls/button"
require "controls/colour-picker-hue-slider"
require "controls/colour-picker-square"
require "controls/control-group"
require "controls/dialog"
ColourPickerDialog = {}
ColourPickerDialog.__index = ColourPickerDialog
--- Opens a colour picker dialog
function ColourPickerDialog:open(initialValue, okHandler)
local colourPickerSquare = ColourPickerSquare:create({ initialValue = initialValue })
local colourPickerSlider = ColourPickerHueSlider:create(colourPickerSquare)
local squareX, _ = colourPickerSquare:getPosition()
local squareWidth, _ = colourPickerSquare:getSize()
colourPickerSlider:setPosition(squareX + squareWidth + 10, 0)
local dialog
local okButton = Button:create("OK", "solid", function()
if okHandler then
okHandler(colourPickerSquare.value)
end
viewStack:popView(dialog)
end)
local cancelButton = Button:create("Cancel", nil, function() viewStack:popView(dialog) end)
dialog = Dialog:create("Pick a colour", nil,
{ ControlGroup:create({ colourPickerSquare, colourPickerSlider }) }, { cancelButton, okButton })
end
|
Carry = Carry or {}
--[[ Functions ]]--
function Carry:Activate(source, target, value, ...)
local sourceState = (Player(source) or {}).state
local targetState = (Player(target) or {}).state
if
not sourceState or
not targetState or
(value and (sourceState.carrying or sourceState.carrier)) or
(value and (targetState.carrying or targetState.carrier))
then
return false
end
sourceState.carrying = value and target or nil
targetState.carrier = value and source or nil
TriggerClientEvent("players:carry", target, "Target", source, value, ...)
TriggerClientEvent("players:carry", source, "Source", target, value)
return true
end
--[[ Events: Net ]]--
RegisterNetEvent("players:carryBegin", function(target, value)
local source = source
-- Check type.
if type(target) ~= "number" or (value ~= nil and not Carry.modes[value]) then return end
-- Check cooldown.
if not PlayerUtil:CheckCooldown(source, 1.0) then return end
PlayerUtil:UpdateCooldown(source)
-- Activate carry.
if Carry:Activate(source, target, value) then
exports.log:Add({
source = source,
target = target,
verb = "started",
noun = "carrying",
extra = value,
})
end
end)
RegisterNetEvent("players:carryEnd", function()
local source = source
-- Check cooldown.
if not PlayerUtil:CheckCooldown(source, 1.0) then return end
PlayerUtil:UpdateCooldown(source)
-- Get state.
local state = (Player(source) or {}).state
if not state then return end
local carrying = state.carrying
local carrier = state.carrier
-- Stop carrying.
if
(carrying and Carry:Activate(source, carrying)) or
(carrier and Carry:Activate(carrier, source))
then
exports.log:Add({
source = source,
target = carrying or carrier,
verb = carrying and "stopped" or "left",
noun = "carry",
})
end
end)
RegisterNetEvent("players:force", function(netId, seatIndex)
local source = source
if type(netId) ~= "number" and type(seatIndex) ~= "number" then return end
-- Check cooldown.
if not PlayerUtil:CheckCooldown(source, 1.0) then return end
PlayerUtil:UpdateCooldown(source)
-- Get state.
local state = Player(source).state
if not state then return end
-- Get target.
local target = state.carrying
if not target then return end
-- Check vehicle.
local vehicle = NetworkGetEntityFromNetworkId(netId)
if not vehicle or not DoesEntityExist(vehicle) then return end
-- Uncarry with parameters.
if Carry:Activate(source, target, false, netId, seatIndex) then
exports.log:Add({
source = source,
target = target,
verb = "forced",
noun = "into vehicle",
extra = ("net id: %s"):format(netId),
})
end
end)
|
return {
"vvadd",
"vvsub",
"vvmul",
"vvdiv",
"vvrem",
"vvgeq",
"vvleq",
"vvgt",
"vvlt",
"vveq",
"vvneq",
"vvand",
"vvor",
"vvxor",
"vvandnot",
}
|
--Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_loot_quest_rifle_quest_tusken = object_tangible_loot_quest_shared_rifle_quest_tusken:new {
playerRaces = { "object/creature/player/bothan_male.iff",
"object/creature/player/bothan_female.iff",
"object/creature/player/human_male.iff",
"object/creature/player/human_female.iff",
"object/creature/player/ithorian_male.iff",
"object/creature/player/ithorian_female.iff",
"object/creature/player/moncal_male.iff",
"object/creature/player/moncal_female.iff",
"object/creature/player/rodian_male.iff",
"object/creature/player/rodian_female.iff",
"object/creature/player/sullustan_male.iff",
"object/creature/player/sullustan_female.iff",
"object/creature/player/trandoshan_male.iff",
"object/creature/player/trandoshan_female.iff",
"object/creature/player/twilek_male.iff",
"object/creature/player/twilek_female.iff",
"object/creature/player/wookiee_male.iff",
"object/creature/player/wookiee_female.iff",
"object/creature/player/zabrak_male.iff",
"object/creature/player/zabrak_female.iff" },
-- RANGEDATTACK, MELEEATTACK, FORCEATTACK, TRAPATTACK, GRENADEATTACK, HEAVYACIDBEAMATTACK,
-- HEAVYLIGHTNINGBEAMATTACK, HEAVYPARTICLEBEAMATTACK, HEAVYROCKETLAUNCHERATTACK, HEAVYLAUNCHERATTACK
attackType = RANGEDATTACK,
-- ENERGY, KINETIC, ELECTRICITY, STUN, BLAST, HEAT, COLD, ACID, LIGHTSABER
damageType = ENERGY,
-- NONE, LIGHT, MEDIUM, HEAVY
armorPiercing = NONE,
-- combat_rangedspecialize_bactarifle, combat_rangedspecialize_rifle, combat_rangedspecialize_pistol, combat_rangedspecialize_heavy, combat_rangedspecialize_carbine
-- combat_meleespecialize_unarmed, combat_meleespecialize_twohand, combat_meleespecialize_polearm, combat_meleespecialize_onehand, combat_general,
-- combat_meleespecialize_twohandlightsaber, combat_meleespecialize_polearmlightsaber, combat_meleespecialize_onehandlightsaber
xpType = "combat_rangedspecialize_rifle",
certificationsRequired = { "cert_rifle_tusken" },
creatureAccuracyModifiers = { "rifle_accuracy" },
creatureAimModifiers = { "rifle_aim", "aim" },
defenderDefenseModifiers = { "ranged_defense" },
defenderSecondaryDefenseModifiers = { "block" },
speedModifiers = { "rifle_speed" },
damageModifiers = { },
-- The values below are the default values. To be used for blue frog objects primarily
healthAttackCost = 25,
actionAttackCost = 35,
mindAttackCost = 75,
forceCost = 0,
pointBlankRange = 0,
pointBlankAccuracy = -60,
idealRange = 60,
idealAccuracy = 20,
maxRange = 64,
maxRangeAccuracy = -50,
minDamage = 50,
maxDamage = 100,
attackSpeed = 10,
woundsRatio = 3,
numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2},
experimentalProperties = {"XX", "XX", "CD", "OQ", "CD", "OQ", "CD", "OQ", "CD", "OQ", "CD", "OQ", "CD", "OQ", "XX", "XX", "XX", "CD", "OQ", "CD", "OQ", "CD", "OQ", "CD", "OQ"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "expEffeciency", "exp_durability", "null", "null", "null", "expRange", "expEffeciency", "expEffeciency", "expEffeciency"},
experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "roundsused", "hitpoints", "zerorangemod", "maxrangemod", "midrange", "midrangemod", "attackhealthcost", "attackactioncost", "attackmindcost"},
experimentalMin = {0, 0, 50, 100, 10, 3, 30, 750, -60, -50, 60, 0, 25, 35, 75},
experimentalMax = {0, 0, 100, 150, 7, 8, 65, 1500, -60, -50, 60, 20, 15, 20, 45},
experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_tangible_loot_quest_rifle_quest_tusken, "object/tangible/loot/quest/rifle_quest_tusken.iff")
|
local event = require("event")
local gpu = require("component").gpu
------------------------------------------------------------------------------------------------------------
local maximumLines = 60
local minimumLineLength = 5
local maximumLineLength = 55
local chars = { "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ", "カ", "ガ", "キ", "ギ", "ク", "グ", "ケ", "ゲ", "コ", "ゴ", "サ", "ザ", "シ", "ジ", "ス", "ズ", "セ", "ゼ", "ソ", "ゾ", "タ", "ダ", "チ", "ヂ", "ッ", "ツ", "ヅ", "テ", "デ", "ト", "ド", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "バ", "パ", "ヒ", "ビ", "ピ", "フ", "ブ", "プ", "ヘ", "ベ", "ペ", "ホ", "ボ", "ポ", "マ", "ミ", "ム", "メ", "モ", "ャ", "ヤ", "ュ", "ユ", "ョ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ヮ", "ワ", "ヰ", "ヱ", "ヲ", "ン", "ヴ", "ヵ", "ヶ", "・", "ー", "ヽ", "ヾ" }
local lineColorsForeground = { 0xFFFFFF, 0xBBFFBB, 0x88FF88, 0x33FF33, 0x00FF00, 0x00EE00, 0x00DD00, 0x00CC00, 0x00BB00, 0x00AA00, 0x009900, 0x008800, 0x007700, 0x006600, 0x005500, 0x004400, 0x003300, 0x002200, 0x001100 }
local lineColorsBackground = { 0x004400, 0x004400, 0x003300, 0x003300, 0x002200, 0x001100 }
local charsSize = #chars
local lineColorsForegroundSize = #lineColorsForeground
------------------------------------------------------------------------------------------------------------
local screenWidth, screenHeight = gpu.getResolution()
local lines = {}
local currentBackground, currentForeground
------------------------------------------------------------------------------------------------------------
local function setBackground(color)
if currentBackground ~= color then
gpu.setBackground(color)
currentBackground = color
end
end
local function setForeground(color)
if currentForeground ~= color then
gpu.setForeground(color)
currentForeground = color
end
end
local function clearScreen()
setBackground(0x000000)
setForeground(0xFFFFFF)
gpu.fill(1, 1, screenWidth, screenHeight, " ")
end
------------------------------------------------------------------------------------------------------------
clearScreen()
local i, eventType, keyCode, part
while true do
while #lines < maximumLines do
table.insert(lines, {
x = math.random(1, screenWidth),
y = 1,
length = math.random(minimumLineLength, maximumLineLength)
})
end
gpu.copy(1, 1, screenWidth, screenHeight, 0, 1)
setBackground(0x000000)
gpu.fill(1, 1, screenWidth, 1, " ")
i = 1
while i <= #lines do
if lines[i].y - lines[i].length <= 0 then
part = math.ceil(lineColorsForegroundSize * lines[i].y / lines[i].length)
setForeground(lineColorsForeground[part] or 0x000000)
setBackground(lineColorsBackground[part] or 0x000000)
gpu.set(lines[i].x, 1, chars[math.random(1, charsSize)])
i, lines[i].y = i + 1, lines[i].y + 1
else
table.remove(lines, i)
end
end
eventType, _, _, keyCode = event.pull(0)
if eventType == "touch" or eventType == "key_down" and keyCode == 28 then
clearScreen()
break
end
end
|
local images = {
lsmap = "165ddeefd5d.png",
map_display = "165ddec178d.png",
maps = {
["@560778"] = "165dde71cd7.png",
["@565330"] = "165dde7d970.png",
["@574683"] = "165dde7ff14.png"
}
}
table.sort(images.maps, function(m1, m2)
return tonumber(m1:sub(2)) < tonumber(m2:sub(2))
end)
local info = { }
eventNewPlayer = function(playerName, skip)
info[playerName] = { display = -1, map = -1 }
if not skip then
for k, v in next, images do
if type(v) == "table" then
for i, j in next, v do
tfm.exec.addImage(j, "?0", -2000, -2000, playerName)
end
else
tfm.exec.addImage(v, "?0", -2000, -2000, playerName)
end
end
tfm.exec.addImage(images.lsmap, "!1", 55, 24, playerName)
tfm.exec.chatMessage("<ROSE>Support <B>https://atelier801.com/topic?f=6&t=876691</B></ROSE>", playerName)
end
ui.addTextArea(0, "<font size='12'><V>" .. playerName .. "<N>'s maps: <BV>3", playerName, 65, 60, nil, nil, 1, 1, 0, true)
local nick = playerName:gsub("#0000", "")
local maps, counter = { }, 0
for map in next, images.maps do
counter = counter + 1
maps[counter] = nick .. " - " .. map .. " - 0 - 100% - P" .. math.random(0, 1) .. " <BV><a href='event:display_" .. map .. "'>[Display map]</a>"
end
ui.addTextArea(1, "<font size='12'>" .. table.concat(maps, "\n<N>"), playerName, 65, 88, nil, nil, 1, 1, 0, true)
ui.addTextArea(2, "<p align='center'><a href='event:close_lsmap'>Close\n", playerName, 55, 369, 684, nil, 1, 1, 0, true)
end
eventTextAreaCallback = function(id, playerName, callback)
local cbk, counter = { }, 0
string.gsub(callback, "[^_]+", function(w)
counter = counter + 1
cbk[counter] = w
end)
if cbk[1] == "display" then
for i = 0, 2 do
ui.removeTextArea(i, playerName)
end
info[playerName].display = tfm.exec.addImage(images.map_display, "!200", 190, 38, playerName)
ui.addTextArea(0, "<p align='center'><font size='15'><B>" .. cbk[2], playerName, 200, 55, 400, nil, 1, 1, 0, true)
info[playerName].map = tfm.exec.addImage(images.maps[cbk[2]], "!300", 200, 80, playerName)
ui.addTextArea(1, "<p align='center'><a href='event:save_image_" .. cbk[2] .. "'>Save map image\n", playerName, 55, 304, 684, nil, 1, 1, 0, true)
ui.addTextArea(2, "<p align='center'><a href='event:save_thumbnail_" .. cbk[2] .. "'>Save map thumbnail\n", playerName, 55, 328, 684, nil, 1, 1, 0, true)
ui.addTextArea(3, "<p align='center'><a href='event:close_display'>Close\n", playerName, 55, 353, 684, nil, 1, 1, 0, true)
elseif cbk[1] == "close" and cbk[2] == "display" then
ui.removeTextArea(3, playerName)
tfm.exec.removeImage(info[playerName].map, playerName)
tfm.exec.removeImage(info[playerName].display, playerName)
eventNewPlayer(playerName, true)
end
end
eventNewGame = function()
for playerName in next, tfm.get.room.playerList do
eventNewPlayer(playerName)
end
end
tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoShaman()
tfm.exec.newGame('<C><P /><Z><S><S L="3000" H="72" X="401" Y="408" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="918" H="590" X="414" Y="93" T="12" P="0,0,9999,0.2,0,0,0,0" /></S><D><DS Y="373" X="410" /></D><O /></Z></C>')
|
function gameB_load()
gamestate = "gameB"
love.audio.stop(portal1open)
love.audio.play(portal1open)
love.audio.stop(portal2open)
love.audio.play(portal2open)
pause = false
difficulty_speed = 100
scorescore = 0
levelscore = 0
linesscore = 0
nextpiecerot = 0
hm = true
--PHYSICS--
meter = 30
world = love.physics.newWorld(0, -720, 960, 1050, 0, 500, true )
tetrikind = {}
wallshapes = {}
tetrishapes = {}
tetribodies = {}
offsetshapes = {}
wallbodies = love.physics.newBody(world, 32, -64, 0, 0) --WALLS
wallshapes[0] = love.physics.newPolygonShape( wallbodies,0, -64, 0,672, 32,672, 32,-64)
wallshapes[0]:setData("left")
wallshapes[0]:setFriction(0.00001)
wallshapes[1] = love.physics.newPolygonShape( wallbodies,352,-64, 352,672, 384,672, 384,-64)
wallshapes[1]:setData("right")
wallshapes[1]:setFriction(0.00001)
--[[wallshapes[2] = love.physics.newPolygonShape( wallbodies,24,640, 24,672, 352,672, 352,640)
wallshapes[2]:setData("ground")
wallshapes[3] = love.physics.newPolygonShape( wallbodies,-8,-96, 384,-96, 384,-64, -8,-64)
wallshapes[3]:setData("ceiling")]]
world:setCallbacks(collideB)
-----------
--FIRST "nextpiece"-
nextpiece = math.random(7)
game_addTetriB()
----------------
end
function game_addTetriB()
--NEW BLOCK--
randomblock = nextpiece
createtetriB(randomblock, 1, 224, blockstartY)
tetribodies[1]:setLinearVelocity(0, difficulty_speed)
--RANDOMIZE
nextpiece = math.random(7)
end
function createtetriB(i, uniqueid, x, y)
tetriimages[uniqueid] = newPaddedImage( "graphics/pieces/"..i..".png", scale )
tetrikind[uniqueid] = i
tetrishapes[uniqueid] = {}
if i == 1 then --I
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], -48,0, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], -16,0, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 16,0, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], 48,0, 32, 32)
elseif i == 2 then --J
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], -32,-16, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,-16, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 32,-16, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], 32,16, 32, 32)
elseif i == 3 then --L
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], -32,-16, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,-16, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 32,-16, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], -32,16, 32, 32)
elseif i == 4 then --O
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], -16,-16, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], -16,16, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 16,16, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], 16,-16, 32, 32)
elseif i == 5 then --S
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], -32,16, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,-16, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 32,-16, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,16, 32, 32)
elseif i == 6 then --T
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], -32,-16, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,-16, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 32,-16, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,16, 32, 32)
elseif i == 7 then --Z
tetribodies[uniqueid] = love.physics.newBody(world, x, y, 0, blockrot)
tetrishapes[uniqueid][1] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,16, 32, 32)
tetrishapes[uniqueid][2] = love.physics.newRectangleShape( tetribodies[uniqueid], 0,-16, 32, 32)
tetrishapes[uniqueid][3] = love.physics.newRectangleShape( tetribodies[uniqueid], 32,16, 32, 32)
tetrishapes[uniqueid][4] = love.physics.newRectangleShape( tetribodies[uniqueid], -32,-16, 32, 32)
end
tetribodies[uniqueid]:setLinearDamping(0.5)
tetribodies[uniqueid]:setMassFromShapes()
tetribodies[uniqueid]:setBullet(true)
for i, v in pairs(tetrishapes[uniqueid]) do
v:setData(uniqueid)
end
end
function gameB_draw()
--FULLSCREEN OFFSET
if fullscreen then
love.graphics.translate(fullscreenoffsetX, fullscreenoffsetY)
--scissor
love.graphics.setScissor(fullscreenoffsetX, fullscreenoffsetY, 160*scale, 144*scale)
end
--background--
if pause or gamestate == "failingB" or not hm then
love.graphics.draw(gamebackgroundportalless, 0, 0, 0, scale)
else
love.graphics.draw(gamebackground, 0, 0, 0, scale)
end
---------------
--tetrishapes--
if pause == false then
for i,v in pairs(tetribodies) do
love.graphics.draw( tetriimages[i], v:getX()*physicsscale, v:getY()*physicsscale, v:getAngle(), 1, 1, piececenter[tetrikind[i]][1]*scale, piececenter[tetrikind[i]][2]*scale)
if hm then
love.graphics.draw( tetriimages[i], v:getX()*physicsscale, (v:getY()*physicsscale)+(128*scale), v:getAngle(), 1, 1, piececenter[tetrikind[i]][1]*scale, piececenter[tetrikind[i]][2]*scale)
love.graphics.draw( tetriimages[i], v:getX()*physicsscale, (v:getY()*physicsscale)-(128*scale), v:getAngle(), 1, 1, piececenter[tetrikind[i]][1]*scale, piececenter[tetrikind[i]][2]*scale)
end
end
--Next piece
love.graphics.draw(nextpieceimg[nextpiece], 136*scale, 120*scale, nextpiecerot, 1, 1, piececenterpreview[nextpiece][1]*scale, piececenterpreview[nextpiece][2]*scale)
else
----------------
--start--
love.graphics.draw(pausegraphic, 16*scale, 0, 0, scale)
end
---------
--SCORES---------------------------------------
--"score"--
offsetX = 0
scorestring = tostring(scorescore)
for i = 1, scorestring:len() - 1 do
offsetX = offsetX - 8*scale
end
love.graphics.print( scorescore, 144*scale + offsetX, 24*scale, 0, scale)
--"level"--
offsetX = 0
scorestring = tostring(levelscore)
for i = 1, scorestring:len() - 1 do
offsetX = offsetX - 8*scale
end
love.graphics.print( levelscore, 136*scale + offsetX, 56*scale, 0, scale)
--"tiles"--
offsetX = 0
scorestring = tostring(linesscore)
for i = 1, scorestring:len() - 1 do
offsetX = offsetX - 8*scale
end
love.graphics.print( linesscore, 136*scale + offsetX, 80*scale, 0, scale)
-----------------------------------------------
--FULLSCREEN OFFSET
if fullscreen then
love.graphics.translate(-fullscreenoffsetX, -fullscreenoffsetY)
--scissor
love.graphics.setScissor()
end
end
function gameB_update(dt)
--PORTAL TELEPORTATION
if gamestate ~= "failingB" and hm then
for i, v in pairs(tetribodies) do
if v:getY() > 512 then
v:setY(v:getY() - 512)
love.audio.stop(portalenter)
love.audio.play(portalenter)
elseif v:getY() < 0 then
v:setY(v:getY() + 512)
love.audio.stop(portalenter)
love.audio.play(portalenter)
end
end
end
--NEXTPIECE ROTATION (rotating allday erryday)
nextpiecerot = nextpiecerot + nextpiecerotspeed*dt
while nextpiecerot > math.pi*2 do
nextpiecerot = nextpiecerot - math.pi*2
end
if gamestate == "gameB" then
if love.keyboard.isDown( "x" ) then
if tetribodies[1]:getAngularVelocity() < 3 then
tetribodies[1]:applyTorque( 70 )
end
end
if love.keyboard.isDown( "y" ) or love.keyboard.isDown( "z" ) or love.keyboard.isDown( "w" ) then
if tetribodies[1]:getAngularVelocity() > -3 then
tetribodies[1]:applyTorque( -70 )
end
end
if love.keyboard.isDown( "left" ) then
local x, y = tetribodies[1]:getWorldCenter()
tetribodies[1]:applyForce( -70, 0, x, y )
end
if love.keyboard.isDown( "right" ) then
local x, y = tetribodies[1]:getWorldCenter()
tetribodies[1]:applyForce( 70, 0, x, y )
end
local x, y = tetribodies[1]:getLinearVelocity( )
if love.keyboard.isDown( "down" ) then
--commented part limits the blackfallspeed
if y > difficulty_speed*5 then
tetribodies[1]:setLinearVelocity(x, difficulty_speed*5)
else
local cx, cy = tetribodies[1]:getWorldCenter()
tetribodies[1]:applyForce( 0, 20, cx, cy )
end
else
if y > difficulty_speed then
tetribodies[1]:setLinearVelocity(x, y-2000*dt)
end
end
end
world:update(dt)
if gamestate == "failingB" then
clearcheck = true
for i,v in pairs(tetribodies) do
if v:getY() < 648 then
clearcheck = false
end
end
if clearcheck then
failed_load()
end
end
end
function collideB(a, b)
if a == 1 or b == 1 then
if a ~= "left" and a ~= "right" and b ~= "left" and b ~= "right" then
if gamestate == "gameB" then
endblockB()
end
end
end
end
function endblockB()
if tetribodies[1]:getY() < losingY then
--LOSE--
gamestate = "failingB"
if musicno < 4 then
love.audio.stop(music[musicno])
end
love.audio.stop(gameover1)
love.audio.play(gameover1)
if hm then
love.audio.stop(portalfizzle)
love.audio.play(portalfizzle)
end
wallshapes[2]:destroy()
wallshapes[2] = nil
else
--Transfer block from 1 to end of tetribodies
tetrikind[highestbody()+1] = tetrikind[1]
tetriimages[highestbody()+1] = tetriimages[1]
tetribodies[highestbody()+1] = tetribodies[1]
tetrishapes[highestbody()] = {}
for i, v in pairs(tetrishapes[1]) do
tetrishapes[highestbody()][i] = tetrishapes[1][i]
tetrishapes[highestbody()][i]:setData({highestbody()})
tetrishapes[1][i] = nil
end
tetribodies[1] = nil
---------------------------
linesscore = linesscore + 1
scorescore = linesscore * 100
love.audio.stop(blockfall)
love.audio.play(blockfall)
game_addTetriB()
end
end
|
-- Copyright 2012 by Till Tantau
--
-- This file may be distributed an/or modified
--
-- 1. under the LaTeX Project Public License and/or
-- 2. under the GNU Public License
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
-- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf.lua,v 1.3 2013/04/04 20:43:44 tantau Exp $
---
-- The |pgf| namespace lies in the global namespace. It is the only
-- global table defined by \pgfname. The whole graph drawing system,
-- in turn, lies in the table |pgf.gd|.
pgf = {}
-- Forward
local tostring_table
---
-- Writes debug info on the \TeX\ output, separating the parameters
-- by spaces. The debug information will include a complete traceback
-- of the stack, allowing you to see ``where you are'' inside the Lua
-- program.
--
-- Note that this function resides directly in the |pgf| table. The
-- reason for this is that you can ``always use it'' since |pgf| is
-- always available in the global name space.
--
-- @param ... List of parameters to write to the \TeX\ output.
function pgf.debug(...)
local stacktrace = debug.traceback("",2)
texio.write_nl(" ")
texio.write_nl("Debug called for: ")
-- this is to even print out nil arguments in between
local args = {...}
for i = 1, #args do
if i ~= 1 then texio.write(", ") end
texio.write(tostring_table(args[i], "", 5))
end
texio.write_nl('')
for w in string.gmatch(stacktrace, "/.-:.-:.-%c") do
texio.write('by ', string.match(w,".*/(.*)"))
end
end
-- Helper function
function tostring_table(t, prefix, depth)
if type(t) ~= "table" or (getmetatable(t) and getmetatable(t).__tostring) or depth <= 0 then
return type(t) == "string" and ('"' .. t .. '"') or tostring(t)
else
local r = "{\n"
for k,v in pairs(t) do
r = r .. prefix .. " " .. tostring(k) .. "=" ..
(v==t and "self" or tostring_table(v, prefix .. " ", depth-1)) .. ",\n"
end
return r .. prefix .. "}"
end
end
return pgf
|
--[[ Write a function that receives an array and prints all elements in that array. Consider the pros and cons of using table.unpack in this fuunction. ]]--
-- Ans: Unpack will return all elements at once.
a = {}
a[1]="hello" a[2]=2 a[3]=5 a[4]=nil a[5]="dog" a[6]="cat"
function printelementsUnpack( x )
print(table.unpack(x))
end
function printelements( x )
for item = 1, #x do
print( x[item] )
end
end
print("--> Using table.unpack")
printelementsUnpack(a)
print("--> Using the # operator")
printelements(a)
|
-- check if vulkan was loaded
local hasVulkan = package.loaded.vulkan1 ~= nil
local ffi = require( "ffi" )
local def = ([[
// glfw3 | GLFW3 window manager
// newtext = text:gsub("#define ([%w_]+)%s+([%w-_]+)",function(a,b) return a.." = "..b.."," end)
enum {
/*************************************************************************
* GLFW API tokens
*************************************************************************/
/*! @name GLFW version macros
* @{ */
/*! @brief The major version number of the GLFW library.
*
* This is incremented when the API is changed in non-compatible ways.
* @ingroup init
*/
GLFW_VERSION_MAJOR = 3,
/*! @brief The minor version number of the GLFW library.
*
* This is incremented when features are added to the API but it remains
* backward-compatible.
* @ingroup init
*/
GLFW_VERSION_MINOR = 2,
/*! @brief The revision number of the GLFW library.
*
* This is incremented when a bug fix release is made that does not contain any
* API changes.
* @ingroup init
*/
GLFW_VERSION_REVISION = 1,
/*! @} */
/*! @name Boolean values
* @{ */
/*! @brief One.
*
* One. Seriously. You don't _need_ to use this symbol in your code. It's
* just semantic sugar for the number 1. You can use `1` or `true` or `_True`
* or `GL_TRUE` or whatever you want.
*/
GLFW_TRUE = 1,
/*! @brief Zero.
*
* Zero. Seriously. You don't _need_ to use this symbol in your code. It's
* just just semantic sugar for the number 0. You can use `0` or `false` or
* `_False` or `GL_FALSE` or whatever you want.
*/
GLFW_FALSE = 0,
/*! @} */
/*! @name Key and button actions
* @{ */
/*! @brief The key or mouse button was released.
*
* The key or mouse button was released.
*
* @ingroup input
*/
GLFW_RELEASE = 0,
/*! @brief The key or mouse button was pressed.
*
* The key or mouse button was pressed.
*
* @ingroup input
*/
GLFW_PRESS = 1,
/*! @brief The key was held down until it repeated.
*
* The key was held down until it repeated.
*
* @ingroup input
*/
GLFW_REPEAT = 2,
/*! @} */
/*! @defgroup keys Keyboard keys
*
* See [key input](@ref input_key) for how these are used.
*
* These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60),
* but re-arranged to map to 7-bit ASCII for printable keys (function keys are
* put in the 256+ range).
*
* The naming of the key codes follow these rules:
* - The US keyboard layout is used
* - Names of printable alpha-numeric characters are used (e.g. "A", "R",
* "3", etc.)
* - For non-alphanumeric characters, Unicode:ish names are used (e.g.
* "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not
* correspond to the Unicode standard (usually for brevity)
* - Keys that lack a clear US mapping are named "WORLD_x"
* - For non-printable keys, custom names are used (e.g. "F4",
* "BACKSPACE", etc.)
*
* @ingroup input
* @{
*/
/* The unknown key */
GLFW_KEY_UNKNOWN = -1,
/* Printable keys */
GLFW_KEY_SPACE = 32,
GLFW_KEY_APOSTROPHE = 39, /* ' */
GLFW_KEY_COMMA = 44, /* , */
GLFW_KEY_MINUS = 45, /* - */
GLFW_KEY_PERIOD = 46, /* . */
GLFW_KEY_SLASH = 47, /* / */
GLFW_KEY_0 = 48,
GLFW_KEY_1 = 49,
GLFW_KEY_2 = 50,
GLFW_KEY_3 = 51,
GLFW_KEY_4 = 52,
GLFW_KEY_5 = 53,
GLFW_KEY_6 = 54,
GLFW_KEY_7 = 55,
GLFW_KEY_8 = 56,
GLFW_KEY_9 = 57,
GLFW_KEY_SEMICOLON = 59, /* ; */
GLFW_KEY_EQUAL = 61, /* = */
GLFW_KEY_A = 65,
GLFW_KEY_B = 66,
GLFW_KEY_C = 67,
GLFW_KEY_D = 68,
GLFW_KEY_E = 69,
GLFW_KEY_F = 70,
GLFW_KEY_G = 71,
GLFW_KEY_H = 72,
GLFW_KEY_I = 73,
GLFW_KEY_J = 74,
GLFW_KEY_K = 75,
GLFW_KEY_L = 76,
GLFW_KEY_M = 77,
GLFW_KEY_N = 78,
GLFW_KEY_O = 79,
GLFW_KEY_P = 80,
GLFW_KEY_Q = 81,
GLFW_KEY_R = 82,
GLFW_KEY_S = 83,
GLFW_KEY_T = 84,
GLFW_KEY_U = 85,
GLFW_KEY_V = 86,
GLFW_KEY_W = 87,
GLFW_KEY_X = 88,
GLFW_KEY_Y = 89,
GLFW_KEY_Z = 90,
GLFW_KEY_LEFT_BRACKET = 91, /* [ */
GLFW_KEY_BACKSLASH = 92, /* \ */
GLFW_KEY_RIGHT_BRACKET = 93, /* ] */
GLFW_KEY_GRAVE_ACCENT = 96, /* ` */
GLFW_KEY_WORLD_1 = 161, /* non-US #1 */
GLFW_KEY_WORLD_2 = 162, /* non-US #2 */
/* Function keys */
GLFW_KEY_ESCAPE = 256,
GLFW_KEY_ENTER = 257,
GLFW_KEY_TAB = 258,
GLFW_KEY_BACKSPACE = 259,
GLFW_KEY_INSERT = 260,
GLFW_KEY_DELETE = 261,
GLFW_KEY_RIGHT = 262,
GLFW_KEY_LEFT = 263,
GLFW_KEY_DOWN = 264,
GLFW_KEY_UP = 265,
GLFW_KEY_PAGE_UP = 266,
GLFW_KEY_PAGE_DOWN = 267,
GLFW_KEY_HOME = 268,
GLFW_KEY_END = 269,
GLFW_KEY_CAPS_LOCK = 280,
GLFW_KEY_SCROLL_LOCK = 281,
GLFW_KEY_NUM_LOCK = 282,
GLFW_KEY_PRINT_SCREEN = 283,
GLFW_KEY_PAUSE = 284,
GLFW_KEY_F1 = 290,
GLFW_KEY_F2 = 291,
GLFW_KEY_F3 = 292,
GLFW_KEY_F4 = 293,
GLFW_KEY_F5 = 294,
GLFW_KEY_F6 = 295,
GLFW_KEY_F7 = 296,
GLFW_KEY_F8 = 297,
GLFW_KEY_F9 = 298,
GLFW_KEY_F10 = 299,
GLFW_KEY_F11 = 300,
GLFW_KEY_F12 = 301,
GLFW_KEY_F13 = 302,
GLFW_KEY_F14 = 303,
GLFW_KEY_F15 = 304,
GLFW_KEY_F16 = 305,
GLFW_KEY_F17 = 306,
GLFW_KEY_F18 = 307,
GLFW_KEY_F19 = 308,
GLFW_KEY_F20 = 309,
GLFW_KEY_F21 = 310,
GLFW_KEY_F22 = 311,
GLFW_KEY_F23 = 312,
GLFW_KEY_F24 = 313,
GLFW_KEY_F25 = 314,
GLFW_KEY_KP_0 = 320,
GLFW_KEY_KP_1 = 321,
GLFW_KEY_KP_2 = 322,
GLFW_KEY_KP_3 = 323,
GLFW_KEY_KP_4 = 324,
GLFW_KEY_KP_5 = 325,
GLFW_KEY_KP_6 = 326,
GLFW_KEY_KP_7 = 327,
GLFW_KEY_KP_8 = 328,
GLFW_KEY_KP_9 = 329,
GLFW_KEY_KP_DECIMAL = 330,
GLFW_KEY_KP_DIVIDE = 331,
GLFW_KEY_KP_MULTIPLY = 332,
GLFW_KEY_KP_SUBTRACT = 333,
GLFW_KEY_KP_ADD = 334,
GLFW_KEY_KP_ENTER = 335,
GLFW_KEY_KP_EQUAL = 336,
GLFW_KEY_LEFT_SHIFT = 340,
GLFW_KEY_LEFT_CONTROL = 341,
GLFW_KEY_LEFT_ALT = 342,
GLFW_KEY_LEFT_SUPER = 343,
GLFW_KEY_RIGHT_SHIFT = 344,
GLFW_KEY_RIGHT_CONTROL = 345,
GLFW_KEY_RIGHT_ALT = 346,
GLFW_KEY_RIGHT_SUPER = 347,
GLFW_KEY_MENU = 348,
GLFW_KEY_LAST = GLFW_KEY_MENU,
/*! @} */
/*! @defgroup mods Modifier key flags
*
* See [key input](@ref input_key) for how these are used.
*
* @ingroup input
* @{ */
/*! @brief If this bit is set one or more Shift keys were held down.
*/
GLFW_MOD_SHIFT = 0x0001,
/*! @brief If this bit is set one or more Control keys were held down.
*/
GLFW_MOD_CONTROL = 0x0002,
/*! @brief If this bit is set one or more Alt keys were held down.
*/
GLFW_MOD_ALT = 0x0004,
/*! @brief If this bit is set one or more Super keys were held down.
*/
GLFW_MOD_SUPER = 0x0008,
/*! @} */
/*! @defgroup buttons Mouse buttons
*
* See [mouse button input](@ref input_mouse_button) for how these are used.
*
* @ingroup input
* @{ */
GLFW_MOUSE_BUTTON_1 = 0,
GLFW_MOUSE_BUTTON_2 = 1,
GLFW_MOUSE_BUTTON_3 = 2,
GLFW_MOUSE_BUTTON_4 = 3,
GLFW_MOUSE_BUTTON_5 = 4,
GLFW_MOUSE_BUTTON_6 = 5,
GLFW_MOUSE_BUTTON_7 = 6,
GLFW_MOUSE_BUTTON_8 = 7,
GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8,
GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1,
GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2,
GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3,
/*! @} */
/*! @defgroup joysticks Joysticks
*
* See [joystick input](@ref joystick) for how these are used.
*
* @ingroup input
* @{ */
GLFW_JOYSTICK_1 = 0,
GLFW_JOYSTICK_2 = 1,
GLFW_JOYSTICK_3 = 2,
GLFW_JOYSTICK_4 = 3,
GLFW_JOYSTICK_5 = 4,
GLFW_JOYSTICK_6 = 5,
GLFW_JOYSTICK_7 = 6,
GLFW_JOYSTICK_8 = 7,
GLFW_JOYSTICK_9 = 8,
GLFW_JOYSTICK_10 = 9,
GLFW_JOYSTICK_11 = 10,
GLFW_JOYSTICK_12 = 11,
GLFW_JOYSTICK_13 = 12,
GLFW_JOYSTICK_14 = 13,
GLFW_JOYSTICK_15 = 14,
GLFW_JOYSTICK_16 = 15,
GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16,
/*! @} */
/*! @defgroup errors Error codes
*
* See [error handling](@ref error_handling) for how these are used.
*
* @ingroup init
* @{ */
/*! @brief GLFW has not been initialized.
*
* This occurs if a GLFW function was called that must not be called unless the
* library is [initialized](@ref intro_init).
*
* @analysis Application programmer error. Initialize GLFW before calling any
* function that requires initialization.
*/
GLFW_NOT_INITIALIZED = 0x00010001,
/*! @brief No context is current for this thread.
*
* This occurs if a GLFW function was called that needs and operates on the
* current OpenGL or OpenGL ES context but no context is current on the calling
* thread. One such function is @ref glfwSwapInterval.
*
* @analysis Application programmer error. Ensure a context is current before
* calling functions that require a current context.
*/
GLFW_NO_CURRENT_CONTEXT = 0x00010002,
/*! @brief One of the arguments to the function was an invalid enum value.
*
* One of the arguments to the function was an invalid enum value, for example
* requesting [GLFW_RED_BITS](@ref window_hints_fb) with @ref
* glfwGetWindowAttrib.
*
* @analysis Application programmer error. Fix the offending call.
*/
GLFW_INVALID_ENUM = 0x00010003,
/*! @brief One of the arguments to the function was an invalid value.
*
* One of the arguments to the function was an invalid value, for example
* requesting a non-existent OpenGL or OpenGL ES version like 2.7.
*
* Requesting a valid but unavailable OpenGL or OpenGL ES version will instead
* result in a @ref GLFW_VERSION_UNAVAILABLE error.
*
* @analysis Application programmer error. Fix the offending call.
*/
GLFW_INVALID_VALUE = 0x00010004,
/*! @brief A memory allocation failed.
*
* A memory allocation failed.
*
* @analysis A bug in GLFW or the underlying operating system. Report the bug
* to our [issue tracker](https://github.com/glfw/glfw/issues).
*/
GLFW_OUT_OF_MEMORY = 0x00010005,
/*! @brief GLFW could not find support for the requested API on the system.
*
* GLFW could not find support for the requested API on the system.
*
* @analysis The installed graphics driver does not support the requested
* API, or does not support it via the chosen context creation backend.
* Below are a few examples.
*
* @par
* Some pre-installed Windows graphics drivers do not support OpenGL. AMD only
* supports OpenGL ES via EGL, while Nvidia and Intel only support it via
* a WGL or GLX extension. OS X does not provide OpenGL ES at all. The Mesa
* EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary
* driver. Older graphics drivers do not support Vulkan.
*/
GLFW_API_UNAVAILABLE = 0x00010006,
/*! @brief The requested OpenGL or OpenGL ES version is not available.
*
* The requested OpenGL or OpenGL ES version (including any requested context
* or framebuffer hints) is not available on this machine.
*
* @analysis The machine does not support your requirements. If your
* application is sufficiently flexible, downgrade your requirements and try
* again. Otherwise, inform the user that their machine does not match your
* requirements.
*
* @par
* Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0
* comes out before the 4.x series gets that far, also fail with this error and
* not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions
* will exist.
*/
GLFW_VERSION_UNAVAILABLE = 0x00010007,
/*! @brief A platform-specific error occurred that does not match any of the
* more specific categories.
*
* A platform-specific error occurred that does not match any of the more
* specific categories.
*
* @analysis A bug or configuration error in GLFW, the underlying operating
* system or its drivers, or a lack of required resources. Report the issue to
* our [issue tracker](https://github.com/glfw/glfw/issues).
*/
GLFW_PLATFORM_ERROR = 0x00010008,
/*! @brief The requested format is not supported or available.
*
* If emitted during window creation, the requested pixel format is not
* supported.
*
* If emitted when querying the clipboard, the contents of the clipboard could
* not be converted to the requested format.
*
* @analysis If emitted during window creation, one or more
* [hard constraints](@ref window_hints_hard) did not match any of the
* available pixel formats. If your application is sufficiently flexible,
* downgrade your requirements and try again. Otherwise, inform the user that
* their machine does not match your requirements.
*
* @par
* If emitted when querying the clipboard, ignore the error or report it to
* the user, as appropriate.
*/
GLFW_FORMAT_UNAVAILABLE = 0x00010009,
/*! @brief The specified window does not have an OpenGL or OpenGL ES context.
*
* A window that does not have an OpenGL or OpenGL ES context was passed to
* a function that requires it to have one.
*
* @analysis Application programmer error. Fix the offending call.
*/
GLFW_NO_WINDOW_CONTEXT = 0x0001000A,
/*! @} */
GLFW_FOCUSED = 0x00020001,
GLFW_ICONIFIED = 0x00020002,
GLFW_RESIZABLE = 0x00020003,
GLFW_VISIBLE = 0x00020004,
GLFW_DECORATED = 0x00020005,
GLFW_AUTO_ICONIFY = 0x00020006,
GLFW_FLOATING = 0x00020007,
GLFW_RED_BITS = 0x00021001,
GLFW_GREEN_BITS = 0x00021002,
GLFW_BLUE_BITS = 0x00021003,
GLFW_ALPHA_BITS = 0x00021004,
GLFW_DEPTH_BITS = 0x00021005,
GLFW_STENCIL_BITS = 0x00021006,
GLFW_ACCUM_RED_BITS = 0x00021007,
GLFW_ACCUM_GREEN_BITS = 0x00021008,
GLFW_ACCUM_BLUE_BITS = 0x00021009,
GLFW_ACCUM_ALPHA_BITS = 0x0002100A,
GLFW_AUX_BUFFERS = 0x0002100B,
GLFW_STEREO = 0x0002100C,
GLFW_SAMPLES = 0x0002100D,
GLFW_SRGB_CAPABLE = 0x0002100E,
GLFW_REFRESH_RATE = 0x0002100F,
GLFW_DOUBLEBUFFER = 0x00021010,
GLFW_CLIENT_API = 0x00022001,
GLFW_CONTEXT_VERSION_MAJOR = 0x00022002,
GLFW_CONTEXT_VERSION_MINOR = 0x00022003,
GLFW_CONTEXT_REVISION = 0x00022004,
GLFW_CONTEXT_ROBUSTNESS = 0x00022005,
GLFW_OPENGL_FORWARD_COMPAT = 0x00022006,
GLFW_OPENGL_DEBUG_CONTEXT = 0x00022007,
GLFW_OPENGL_PROFILE = 0x00022008,
GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x00022009,
GLFW_CONTEXT_NO_ERROR = 0x0002200A,
GLFW_NO_API = 0,
GLFW_OPENGL_API = 0x00030001,
GLFW_OPENGL_ES_API = 0x00030002,
GLFW_NO_ROBUSTNESS = 0,
GLFW_NO_RESET_NOTIFICATION = 0x00031001,
GLFW_LOSE_CONTEXT_ON_RESET = 0x00031002,
GLFW_OPENGL_ANY_PROFILE = 0,
GLFW_OPENGL_CORE_PROFILE = 0x00032001,
GLFW_OPENGL_COMPAT_PROFILE = 0x00032002,
GLFW_CURSOR = 0x00033001,
GLFW_STICKY_KEYS = 0x00033002,
GLFW_STICKY_MOUSE_BUTTONS = 0x00033003,
GLFW_CURSOR_NORMAL = 0x00034001,
GLFW_CURSOR_HIDDEN = 0x00034002,
GLFW_CURSOR_DISABLED = 0x00034003,
GLFW_ANY_RELEASE_BEHAVIOR = 0,
GLFW_RELEASE_BEHAVIOR_FLUSH = 0x00035001,
GLFW_RELEASE_BEHAVIOR_NONE = 0x00035002,
/*! @defgroup shapes Standard cursor shapes
*
* See [standard cursor creation](@ref cursor_standard) for how these are used.
*
* @ingroup input
* @{ */
/*! @brief The regular arrow cursor shape.
*
* The regular arrow cursor.
*/
GLFW_ARROW_CURSOR = 0x00036001,
/*! @brief The text input I-beam cursor shape.
*
* The text input I-beam cursor shape.
*/
GLFW_IBEAM_CURSOR = 0x00036002,
/*! @brief The crosshair shape.
*
* The crosshair shape.
*/
GLFW_CROSSHAIR_CURSOR = 0x00036003,
/*! @brief The hand shape.
*
* The hand shape.
*/
GLFW_HAND_CURSOR = 0x00036004,
/*! @brief The horizontal resize arrow shape.
*
* The horizontal resize arrow shape.
*/
GLFW_HRESIZE_CURSOR = 0x00036005,
/*! @brief The vertical resize arrow shape.
*
* The vertical resize arrow shape.
*/
GLFW_VRESIZE_CURSOR = 0x00036006,
/*! @} */
GLFW_CONNECTED = 0x00040001,
GLFW_DISCONNECTED = 0x00040002,
GLFW_DONT_CARE = -1,
};
/*************************************************************************
* GLFW API types
*************************************************************************/
/*! @brief Client API function pointer type.
*
* Generic function pointer used for returning client API function pointers
* without forcing a cast from a regular pointer.
*
* @sa @ref context_glext
* @sa glfwGetProcAddress
*
* @since Added in version 3.0.
* @ingroup context
*/
typedef void (*GLFWglproc)(void);
/*! @brief Vulkan API function pointer type.
*
* Generic function pointer used for returning Vulkan API function pointers
* without forcing a cast from a regular pointer.
*
* @sa @ref vulkan_proc
* @sa glfwGetInstanceProcAddress
*
* @since Added in version 3.2.
*
* @ingroup vulkan
*/
typedef void (*GLFWvkproc)(void);
/*! @brief Opaque monitor object.
*
* Opaque monitor object.
*
* @see @ref monitor_object
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
typedef struct GLFWmonitor GLFWmonitor;
/*! @brief Opaque window object.
*
* Opaque window object.
*
* @see @ref window_object
*
* @since Added in version 3.0.
*
* @ingroup window
*/
typedef struct GLFWwindow GLFWwindow;
/*! @brief Opaque cursor object.
*
* Opaque cursor object.
*
* @see @ref cursor_object
*
* @since Added in version 3.1.
*
* @ingroup cursor
*/
typedef struct GLFWcursor GLFWcursor;
/*! @brief The function signature for error callbacks.
*
* This is the function signature for error callback functions.
*
* @param[in] error An [error code](@ref errors).
* @param[in] description A UTF-8 encoded string describing the error.
*
* @sa @ref error_handling
* @sa glfwSetErrorCallback
*
* @since Added in version 3.0.
*
* @ingroup init
*/
typedef void (* GLFWerrorfun)(int,const char*);
/*! @brief The function signature for window position callbacks.
*
* This is the function signature for window position callback functions.
*
* @param[in] window The window that was moved.
* @param[in] xpos The new x-coordinate, in screen coordinates, of the
* upper-left corner of the client area of the window.
* @param[in] ypos The new y-coordinate, in screen coordinates, of the
* upper-left corner of the client area of the window.
*
* @sa @ref window_pos
* @sa glfwSetWindowPosCallback
*
* @since Added in version 3.0.
*
* @ingroup window
*/
typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);
/*! @brief The function signature for window resize callbacks.
*
* This is the function signature for window size callback functions.
*
* @param[in] window The window that was resized.
* @param[in] width The new width, in screen coordinates, of the window.
* @param[in] height The new height, in screen coordinates, of the window.
*
* @sa @ref window_size
* @sa glfwSetWindowSizeCallback
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);
/*! @brief The function signature for window close callbacks.
*
* This is the function signature for window close callback functions.
*
* @param[in] window The window that the user attempted to close.
*
* @sa @ref window_close
* @sa glfwSetWindowCloseCallback
*
* @since Added in version 2.5.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
typedef void (* GLFWwindowclosefun)(GLFWwindow*);
/*! @brief The function signature for window content refresh callbacks.
*
* This is the function signature for window refresh callback functions.
*
* @param[in] window The window whose content needs to be refreshed.
*
* @sa @ref window_refresh
* @sa glfwSetWindowRefreshCallback
*
* @since Added in version 2.5.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
/*! @brief The function signature for window focus/defocus callbacks.
*
* This is the function signature for window focus callback functions.
*
* @param[in] window The window that gained or lost input focus.
* @param[in] focused `GLFW_TRUE` if the window was given input focus, or
* `GLFW_FALSE` if it lost it.
*
* @sa @ref window_focus
* @sa glfwSetWindowFocusCallback
*
* @since Added in version 3.0.
*
* @ingroup window
*/
typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
/*! @brief The function signature for window iconify/restore callbacks.
*
* This is the function signature for window iconify/restore callback
* functions.
*
* @param[in] window The window that was iconified or restored.
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
* `GLFW_FALSE` if it was restored.
*
* @sa @ref window_iconify
* @sa glfwSetWindowIconifyCallback
*
* @since Added in version 3.0.
*
* @ingroup window
*/
typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
/*! @brief The function signature for framebuffer resize callbacks.
*
* This is the function signature for framebuffer resize callback
* functions.
*
* @param[in] window The window whose framebuffer was resized.
* @param[in] width The new width, in pixels, of the framebuffer.
* @param[in] height The new height, in pixels, of the framebuffer.
*
* @sa @ref window_fbsize
* @sa glfwSetFramebufferSizeCallback
*
* @since Added in version 3.0.
*
* @ingroup window
*/
typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);
/*! @brief The function signature for mouse button callbacks.
*
* This is the function signature for mouse button callback functions.
*
* @param[in] window The window that received the event.
* @param[in] button The [mouse button](@ref buttons) that was pressed or
* released.
* @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.
* @param[in] mods Bit field describing which [modifier keys](@ref mods) were
* held down.
*
* @sa @ref input_mouse_button
* @sa glfwSetMouseButtonCallback
*
* @since Added in version 1.0.
* @glfw3 Added window handle and modifier mask parameters.
*
* @ingroup input
*/
typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);
/*! @brief The function signature for cursor position callbacks.
*
* This is the function signature for cursor position callback functions.
*
* @param[in] window The window that received the event.
* @param[in] xpos The new cursor x-coordinate, relative to the left edge of
* the client area.
* @param[in] ypos The new cursor y-coordinate, relative to the top edge of the
* client area.
*
* @sa @ref cursor_pos
* @sa glfwSetCursorPosCallback
*
* @since Added in version 3.0. Replaces `GLFWmouseposfun`.
*
* @ingroup input
*/
typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
/*! @brief The function signature for cursor enter/leave callbacks.
*
* This is the function signature for cursor enter/leave callback functions.
*
* @param[in] window The window that received the event.
* @param[in] entered `GLFW_TRUE` if the cursor entered the window's client
* area, or `GLFW_FALSE` if it left it.
*
* @sa @ref cursor_enter
* @sa glfwSetCursorEnterCallback
*
* @since Added in version 3.0.
*
* @ingroup input
*/
typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
/*! @brief The function signature for scroll callbacks.
*
* This is the function signature for scroll callback functions.
*
* @param[in] window The window that received the event.
* @param[in] xoffset The scroll offset along the x-axis.
* @param[in] yoffset The scroll offset along the y-axis.
*
* @sa @ref scrolling
* @sa glfwSetScrollCallback
*
* @since Added in version 3.0. Replaces `GLFWmousewheelfun`.
*
* @ingroup input
*/
typedef void (* GLFWscrollfun)(GLFWwindow*,double,double);
/*! @brief The function signature for keyboard key callbacks.
*
* This is the function signature for keyboard key callback functions.
*
* @param[in] window The window that received the event.
* @param[in] key The [keyboard key](@ref keys) that was pressed or released.
* @param[in] scancode The system-specific scancode of the key.
* @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`.
* @param[in] mods Bit field describing which [modifier keys](@ref mods) were
* held down.
*
* @sa @ref input_key
* @sa glfwSetKeyCallback
*
* @since Added in version 1.0.
* @glfw3 Added window handle, scancode and modifier mask parameters.
*
* @ingroup input
*/
typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);
/*! @brief The function signature for Unicode character callbacks.
*
* This is the function signature for Unicode character callback functions.
*
* @param[in] window The window that received the event.
* @param[in] codepoint The Unicode code point of the character.
*
* @sa @ref input_char
* @sa glfwSetCharCallback
*
* @since Added in version 2.4.
* @glfw3 Added window handle parameter.
*
* @ingroup input
*/
typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
/*! @brief The function signature for Unicode character with modifiers
* callbacks.
*
* This is the function signature for Unicode character with modifiers callback
* functions. It is called for each input character, regardless of what
* modifier keys are held down.
*
* @param[in] window The window that received the event.
* @param[in] codepoint The Unicode code point of the character.
* @param[in] mods Bit field describing which [modifier keys](@ref mods) were
* held down.
*
* @sa @ref input_char
* @sa glfwSetCharModsCallback
*
* @since Added in version 3.1.
*
* @ingroup input
*/
typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int);
/*! @brief The function signature for file drop callbacks.
*
* This is the function signature for file drop callbacks.
*
* @param[in] window The window that received the event.
* @param[in] count The number of dropped files.
* @param[in] paths The UTF-8 encoded file and/or directory path names.
*
* @sa @ref path_drop
* @sa glfwSetDropCallback
*
* @since Added in version 3.1.
*
* @ingroup input
*/
typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**);
/*! @brief The function signature for monitor configuration callbacks.
*
* This is the function signature for monitor configuration callback functions.
*
* @param[in] monitor The monitor that was connected or disconnected.
* @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
*
* @sa @ref monitor_event
* @sa glfwSetMonitorCallback
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
/*! @brief The function signature for joystick configuration callbacks.
*
* This is the function signature for joystick configuration callback
* functions.
*
* @param[in] joy The joystick that was connected or disconnected.
* @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
*
* @sa @ref joystick_event
* @sa glfwSetJoystickCallback
*
* @since Added in version 3.2.
*
* @ingroup input
*/
typedef void (* GLFWjoystickfun)(int,int);
/*! @brief Video mode type.
*
* This describes a single video mode.
*
* @sa @ref monitor_modes
* @sa glfwGetVideoMode glfwGetVideoModes
*
* @since Added in version 1.0.
* @glfw3 Added refresh rate member.
*
* @ingroup monitor
*/
typedef struct GLFWvidmode
{
/*! The width, in screen coordinates, of the video mode.
*/
int width;
/*! The height, in screen coordinates, of the video mode.
*/
int height;
/*! The bit depth of the red channel of the video mode.
*/
int redBits;
/*! The bit depth of the green channel of the video mode.
*/
int greenBits;
/*! The bit depth of the blue channel of the video mode.
*/
int blueBits;
/*! The refresh rate, in Hz, of the video mode.
*/
int refreshRate;
} GLFWvidmode;
/*! @brief Gamma ramp.
*
* This describes the gamma ramp for a monitor.
*
* @sa @ref monitor_gamma
* @sa glfwGetGammaRamp glfwSetGammaRamp
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
typedef struct GLFWgammaramp
{
/*! An array of value describing the response of the red channel.
*/
unsigned short* red;
/*! An array of value describing the response of the green channel.
*/
unsigned short* green;
/*! An array of value describing the response of the blue channel.
*/
unsigned short* blue;
/*! The number of elements in each array.
*/
unsigned int size;
} GLFWgammaramp;
/*! @brief Image data.
*
* @sa @ref cursor_custom
* @sa @ref window_icon
*
* @since Added in version 2.1.
* @glfw3 Removed format and bytes-per-pixel members.
*/
typedef struct GLFWimage
{
/*! The width, in pixels, of this image.
*/
int width;
/*! The height, in pixels, of this image.
*/
int height;
/*! The pixel data of this image, arranged left-to-right, top-to-bottom.
*/
unsigned char* pixels;
} GLFWimage;
/*************************************************************************
* GLFW API functions
*************************************************************************/
/*! @brief Initializes the GLFW library.
*
* This function initializes the GLFW library. Before most GLFW functions can
* be used, GLFW must be initialized, and before an application terminates GLFW
* should be terminated in order to free any resources allocated during or
* after initialization.
*
* If this function fails, it calls @ref glfwTerminate before returning. If it
* succeeds, you should call @ref glfwTerminate before the application exits.
*
* Additional calls to this function after successful initialization but before
* termination will return `GLFW_TRUE` immediately.
*
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
*
* @remark @osx This function will change the current directory of the
* application to the `Contents/Resources` subdirectory of the application's
* bundle, if present. This can be disabled with a
* [compile-time option](@ref compile_options_osx).
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref intro_init
* @sa glfwTerminate
*
* @since Added in version 1.0.
*
* @ingroup init
*/
GLFWAPI int glfwInit(void);
/*! @brief Terminates the GLFW library.
*
* This function destroys all remaining windows and cursors, restores any
* modified gamma ramps and frees any other allocated resources. Once this
* function is called, you must again call @ref glfwInit successfully before
* you will be able to use most GLFW functions.
*
* If GLFW has been successfully initialized, this function should be called
* before the application exits. If initialization fails, there is no need to
* call this function, as it is called by @ref glfwInit before it returns
* failure.
*
* @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
*
* @remark This function may be called before @ref glfwInit.
*
* @warning The contexts of any remaining windows must not be current on any
* other thread when this function is called.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref intro_init
* @sa glfwInit
*
* @since Added in version 1.0.
*
* @ingroup init
*/
GLFWAPI void glfwTerminate(void);
/*! @brief Retrieves the version of the GLFW library.
*
* This function retrieves the major, minor and revision numbers of the GLFW
* library. It is intended for when you are using GLFW as a shared library and
* want to ensure that you are using the minimum required version.
*
* Any or all of the version arguments may be `NULL`.
*
* @param[out] major Where to store the major version number, or `NULL`.
* @param[out] minor Where to store the minor version number, or `NULL`.
* @param[out] rev Where to store the revision number, or `NULL`.
*
* @errors None.
*
* @remark This function may be called before @ref glfwInit.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref intro_version
* @sa glfwGetVersionString
*
* @since Added in version 1.0.
*
* @ingroup init
*/
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
/*! @brief Returns a string describing the compile-time configuration.
*
* This function returns the compile-time generated
* [version string](@ref intro_version_string) of the GLFW library binary. It
* describes the version, platform, compiler and any platform-specific
* compile-time options. It should not be confused with the OpenGL or OpenGL
* ES version string, queried with `glGetString`.
*
* __Do not use the version string__ to parse the GLFW library version. The
* @ref glfwGetVersion function provides the version of the running library
* binary in numerical format.
*
* @return The ASCII encoded GLFW version string.
*
* @errors None.
*
* @remark This function may be called before @ref glfwInit.
*
* @pointer_lifetime The returned string is static and compile-time generated.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref intro_version
* @sa glfwGetVersion
*
* @since Added in version 3.0.
*
* @ingroup init
*/
GLFWAPI const char* glfwGetVersionString(void);
/*! @brief Sets the error callback.
*
* This function sets the error callback, which is called with an error code
* and a human-readable description each time a GLFW error occurs.
*
* The error callback is called on the thread where the error occurred. If you
* are using GLFW from multiple threads, your error callback needs to be
* written accordingly.
*
* Because the description string may have been generated specifically for that
* error, it is not guaranteed to be valid after the callback has returned. If
* you wish to use it after the callback returns, you need to make a copy.
*
* Once set, the error callback remains set even after the library has been
* terminated.
*
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set.
*
* @errors None.
*
* @remark This function may be called before @ref glfwInit.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref error_handling
*
* @since Added in version 3.0.
*
* @ingroup init
*/
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);
/*! @brief Returns the currently connected monitors.
*
* This function returns an array of handles for all currently connected
* monitors. The primary monitor is always first in the returned array. If no
* monitors were found, this function returns `NULL`.
*
* @param[out] count Where to store the number of monitors in the returned
* array. This is set to zero if an error occurred.
* @return An array of monitor handles, or `NULL` if no monitors were found or
* if an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is guaranteed to be valid only until the
* monitor configuration changes or the library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_monitors
* @sa @ref monitor_event
* @sa glfwGetPrimaryMonitor
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI GLFWmonitor** glfwGetMonitors(int* count);
/*! @brief Returns the primary monitor.
*
* This function returns the primary monitor. This is usually the monitor
* where elements like the task bar or global menu bar are located.
*
* @return The primary monitor, or `NULL` if no monitors were found or if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @remark The primary monitor is always first in the array returned by @ref
* glfwGetMonitors.
*
* @sa @ref monitor_monitors
* @sa glfwGetMonitors
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
/*! @brief Returns the position of the monitor's viewport on the virtual screen.
*
* This function returns the position, in screen coordinates, of the upper-left
* corner of the specified monitor.
*
* Any or all of the position arguments may be `NULL`. If an error occurs, all
* non-`NULL` position arguments will be set to zero.
*
* @param[in] monitor The monitor to query.
* @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
* @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_properties
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
/*! @brief Returns the physical size of the monitor.
*
* This function returns the size, in millimetres, of the display area of the
* specified monitor.
*
* Some systems do not provide accurate monitor size information, either
* because the monitor
* [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data)
* data is incorrect or because the driver does not report it accurately.
*
* Any or all of the size arguments may be `NULL`. If an error occurs, all
* non-`NULL` size arguments will be set to zero.
*
* @param[in] monitor The monitor to query.
* @param[out] widthMM Where to store the width, in millimetres, of the
* monitor's display area, or `NULL`.
* @param[out] heightMM Where to store the height, in millimetres, of the
* monitor's display area, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark @win32 calculates the returned physical size from the
* current resolution and system DPI instead of querying the monitor EDID data.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_properties
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM);
/*! @brief Returns the name of the specified monitor.
*
* This function returns a human-readable name, encoded as UTF-8, of the
* specified monitor. The name typically reflects the make and model of the
* monitor and is not guaranteed to be unique among the connected monitors.
*
* @param[in] monitor The monitor to query.
* @return The UTF-8 encoded name of the monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified monitor is
* disconnected or the library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_properties
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
/*! @brief Sets the monitor configuration callback.
*
* This function sets the monitor configuration callback, or removes the
* currently set callback. This is called when a monitor is connected to or
* disconnected from the system.
*
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_event
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
/*! @brief Returns the available video modes for the specified monitor.
*
* This function returns an array of all video modes supported by the specified
* monitor. The returned array is sorted in ascending order, first by color
* bit depth (the sum of all channel depths) and then by resolution area (the
* product of width and height).
*
* @param[in] monitor The monitor to query.
* @param[out] count Where to store the number of video modes in the returned
* array. This is set to zero if an error occurred.
* @return An array of video modes, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified monitor is
* disconnected, this function is called again for that monitor or the library
* is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_modes
* @sa glfwGetVideoMode
*
* @since Added in version 1.0.
* @glfw3 Changed to return an array of modes for a specific monitor.
*
* @ingroup monitor
*/
GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
/*! @brief Returns the current mode of the specified monitor.
*
* This function returns the current video mode of the specified monitor. If
* you have created a full screen window for that monitor, the return value
* will depend on whether that window is iconified.
*
* @param[in] monitor The monitor to query.
* @return The current mode of the monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified monitor is
* disconnected or the library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_modes
* @sa glfwGetVideoModes
*
* @since Added in version 3.0. Replaces `glfwGetDesktopMode`.
*
* @ingroup monitor
*/
GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
/*! @brief Generates a gamma ramp and sets it for the specified monitor.
*
* This function generates a 256-element gamma ramp from the specified exponent
* and then calls @ref glfwSetGammaRamp with it. The value must be a finite
* number greater than zero.
*
* @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] gamma The desired exponent.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_gamma
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
/*! @brief Returns the current gamma ramp for the specified monitor.
*
* This function returns the current gamma ramp of the specified monitor.
*
* @param[in] monitor The monitor to query.
* @return The current gamma ramp, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned structure and its arrays are allocated and
* freed by GLFW. You should not free them yourself. They are valid until the
* specified monitor is disconnected, this function is called again for that
* monitor or the library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_gamma
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
/*! @brief Sets the current gamma ramp for the specified monitor.
*
* This function sets the current gamma ramp for the specified monitor. The
* original gamma ramp for that monitor is saved by GLFW the first time this
* function is called and is restored by @ref glfwTerminate.
*
* @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] ramp The gamma ramp to use.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark Gamma ramp sizes other than 256 are not supported by all platforms
* or graphics hardware.
*
* @remark @win32 The gamma ramp size must be 256.
*
* @pointer_lifetime The specified gamma ramp is copied before this function
* returns.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_gamma
*
* @since Added in version 3.0.
*
* @ingroup monitor
*/
GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
/*! @brief Resets all window hints to their default values.
*
* This function resets all window hints to their
* [default values](@ref window_hints_values).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_hints
* @sa glfwWindowHint
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwDefaultWindowHints(void);
/*! @brief Sets the specified window hint to the desired value.
*
* This function sets hints for the next call to @ref glfwCreateWindow. The
* hints, once set, retain their values until changed by a call to @ref
* glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is
* terminated.
*
* This function does not check whether the specified hint values are valid.
* If you set hints to invalid values this will instead be reported by the next
* call to @ref glfwCreateWindow.
*
* @param[in] hint The [window hint](@ref window_hints) to set.
* @param[in] value The new value of the window hint.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_hints
* @sa glfwDefaultWindowHints
*
* @since Added in version 3.0. Replaces `glfwOpenWindowHint`.
*
* @ingroup window
*/
GLFWAPI void glfwWindowHint(int hint, int value);
/*! @brief Creates a window and its associated context.
*
* This function creates a window and its associated OpenGL or OpenGL ES
* context. Most of the options controlling how the window and its context
* should be created are specified with [window hints](@ref window_hints).
*
* Successful creation does not change which context is current. Before you
* can use the newly created context, you need to
* [make it current](@ref context_current). For information about the `share`
* parameter, see @ref context_sharing.
*
* The created window, framebuffer and context may differ from what you
* requested, as not all parameters and hints are
* [hard constraints](@ref window_hints_hard). This includes the size of the
* window, especially for full screen windows. To query the actual attributes
* of the created window, framebuffer and context, see @ref
* glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize.
*
* To create a full screen window, you need to specify the monitor the window
* will cover. If no monitor is specified, the window will be windowed mode.
* Unless you have a way for the user to choose a specific monitor, it is
* recommended that you pick the primary monitor. For more information on how
* to query connected monitors, see @ref monitor_monitors.
*
* For full screen windows, the specified size becomes the resolution of the
* window's _desired video mode_. As long as a full screen window is not
* iconified, the supported video mode most closely matching the desired video
* mode is set for the specified monitor. For more information about full
* screen windows, including the creation of so called _windowed full screen_
* or _borderless full screen_ windows, see @ref window_windowed_full_screen.
*
* Once you have created the window, you can switch it between windowed and
* full screen mode with @ref glfwSetWindowMonitor. If the window has an
* OpenGL or OpenGL ES context, it will be unaffected.
*
* By default, newly created windows use the placement recommended by the
* window system. To create the window at a specific position, make it
* initially invisible using the [GLFW_VISIBLE](@ref window_hints_wnd) window
* hint, set its [position](@ref window_pos) and then [show](@ref window_hide)
* it.
*
* As long as at least one full screen window is not iconified, the screensaver
* is prohibited from starting.
*
* Window systems put limits on window sizes. Very large or very small window
* dimensions may be overridden by the window system on creation. Check the
* actual [size](@ref window_size) after creation.
*
* The [swap interval](@ref buffer_swap) is not set during window creation and
* the initial value may vary depending on driver settings and defaults.
*
* @param[in] width The desired width, in screen coordinates, of the window.
* This must be greater than zero.
* @param[in] height The desired height, in screen coordinates, of the window.
* This must be greater than zero.
* @param[in] title The initial, UTF-8 encoded window title.
* @param[in] monitor The monitor to use for full screen mode, or `NULL` for
* windowed mode.
* @param[in] share The window whose context to share resources with, or `NULL`
* to not share resources.
* @return The handle of the created window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
* GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark @win32 Window creation will fail if the Microsoft GDI software
* OpenGL implementation is the only one available.
*
* @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it
* will be set as the initial icon for the window. If no such icon is present,
* the `IDI_WINLOGO` icon will be used instead. To set a different icon, see
* @ref glfwSetWindowIcon.
*
* @remark @win32 The context to share resources with must not be current on
* any other thread.
*
* @remark @osx The GLFW window has no icon, as it is not a document
* window, but the dock icon will be the same as the application bundle's icon.
* For more information on bundles, see the
* [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
* in the Mac Developer Library.
*
* @remark @osx The first time a window is created the menu bar is populated
* with common commands like Hide, Quit and About. The About entry opens
* a minimal about dialog with information from the application's bundle. The
* menu bar can be disabled with a
* [compile-time option](@ref compile_options_osx).
*
* @remark @osx On OS X 10.10 and later the window frame will not be rendered
* at full resolution on Retina displays unless the `NSHighResolutionCapable`
* key is enabled in the application bundle's `Info.plist`. For more
* information, see
* [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html)
* in the Mac Developer Library. The GLFW test and example programs use
* a custom `Info.plist` template for this, which can be found as
* `CMake/MacOSXBundleInfo.plist.in` in the source tree.
*
* @remark @x11 Some window managers will not respect the placement of
* initially hidden windows.
*
* @remark @x11 Due to the asynchronous nature of X11, it may take a moment for
* a window to reach its requested state. This means you may not be able to
* query the final size, position or other attributes directly after window
* creation.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_creation
* @sa glfwDestroyWindow
*
* @since Added in version 3.0. Replaces `glfwOpenWindow`.
*
* @ingroup window
*/
GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
/*! @brief Destroys the specified window and its context.
*
* This function destroys the specified window and its context. On calling
* this function, no further callbacks will be called for that window.
*
* If the context of the specified window is current on the main thread, it is
* detached before being destroyed.
*
* @param[in] window The window to destroy.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @note The context of the specified window must not be current on any other
* thread when this function is called.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_creation
* @sa glfwCreateWindow
*
* @since Added in version 3.0. Replaces `glfwCloseWindow`.
*
* @ingroup window
*/
GLFWAPI void glfwDestroyWindow(GLFWwindow* window);
/*! @brief Checks the close flag of the specified window.
*
* This function returns the value of the close flag of the specified window.
*
* @param[in] window The window to query.
* @return The value of the close flag.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @sa @ref window_close
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI int glfwWindowShouldClose(GLFWwindow* window);
/*! @brief Sets the close flag of the specified window.
*
* This function sets the value of the close flag of the specified window.
* This can be used to override the user's attempt to close the window, or
* to signal that it should be closed.
*
* @param[in] window The window whose flag to change.
* @param[in] value The new value.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @sa @ref window_close
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
/*! @brief Sets the title of the specified window.
*
* This function sets the window title, encoded as UTF-8, of the specified
* window.
*
* @param[in] window The window whose title to change.
* @param[in] title The UTF-8 encoded window title.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark @osx The window title will not be updated until the next time you
* process events.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_title
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
/*! @brief Sets the icon for the specified window.
*
* This function sets the icon of the specified window. If passed an array of
* candidate images, those of or closest to the sizes desired by the system are
* selected. If no images are specified, the window reverts to its default
* icon.
*
* The desired image sizes varies depending on platform and system settings.
* The selected images will be rescaled as needed. Good sizes include 16x16,
* 32x32 and 48x48.
*
* @param[in] window The window whose icon to set.
* @param[in] count The number of images in the specified array, or zero to
* revert to the default window icon.
* @param[in] images The images to create the icon from. This is ignored if
* count is zero.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified image data is copied before this function
* returns.
*
* @remark @osx The GLFW window has no icon, as it is not a document
* window, so this function does nothing. The dock icon will be the same as
* the application bundle's icon. For more information on bundles, see the
* [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
* in the Mac Developer Library.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_icon
*
* @since Added in version 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images);
/*! @brief Retrieves the position of the client area of the specified window.
*
* This function retrieves the position, in screen coordinates, of the
* upper-left corner of the client area of the specified window.
*
* Any or all of the position arguments may be `NULL`. If an error occurs, all
* non-`NULL` position arguments will be set to zero.
*
* @param[in] window The window to query.
* @param[out] xpos Where to store the x-coordinate of the upper-left corner of
* the client area, or `NULL`.
* @param[out] ypos Where to store the y-coordinate of the upper-left corner of
* the client area, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_pos
* @sa glfwSetWindowPos
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
/*! @brief Sets the position of the client area of the specified window.
*
* This function sets the position, in screen coordinates, of the upper-left
* corner of the client area of the specified windowed mode window. If the
* window is a full screen window, this function does nothing.
*
* __Do not use this function__ to move an already visible window unless you
* have very good reasons for doing so, as it will confuse and annoy the user.
*
* The window manager may put limits on what positions are allowed. GLFW
* cannot and should not override these limits.
*
* @param[in] window The window to query.
* @param[in] xpos The x-coordinate of the upper-left corner of the client area.
* @param[in] ypos The y-coordinate of the upper-left corner of the client area.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_pos
* @sa glfwGetWindowPos
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
/*! @brief Retrieves the size of the client area of the specified window.
*
* This function retrieves the size, in screen coordinates, of the client area
* of the specified window. If you wish to retrieve the size of the
* framebuffer of the window in pixels, see @ref glfwGetFramebufferSize.
*
* Any or all of the size arguments may be `NULL`. If an error occurs, all
* non-`NULL` size arguments will be set to zero.
*
* @param[in] window The window whose size to retrieve.
* @param[out] width Where to store the width, in screen coordinates, of the
* client area, or `NULL`.
* @param[out] height Where to store the height, in screen coordinates, of the
* client area, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
* @sa glfwSetWindowSize
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
/*! @brief Sets the size limits of the specified window.
*
* This function sets the size limits of the client area of the specified
* window. If the window is full screen, the size limits only take effect
* once it is made windowed. If the window is not resizable, this function
* does nothing.
*
* The size limits are applied immediately to a windowed mode window and may
* cause it to be resized.
*
* The maximum dimensions must be greater than or equal to the minimum
* dimensions and all must be greater than or equal to zero.
*
* @param[in] window The window to set limits for.
* @param[in] minwidth The minimum width, in screen coordinates, of the client
* area, or `GLFW_DONT_CARE`.
* @param[in] minheight The minimum height, in screen coordinates, of the
* client area, or `GLFW_DONT_CARE`.
* @param[in] maxwidth The maximum width, in screen coordinates, of the client
* area, or `GLFW_DONT_CARE`.
* @param[in] maxheight The maximum height, in screen coordinates, of the
* client area, or `GLFW_DONT_CARE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
*
* @remark If you set size limits and an aspect ratio that conflict, the
* results are undefined.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_sizelimits
* @sa glfwSetWindowAspectRatio
*
* @since Added in version 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
/*! @brief Sets the aspect ratio of the specified window.
*
* This function sets the required aspect ratio of the client area of the
* specified window. If the window is full screen, the aspect ratio only takes
* effect once it is made windowed. If the window is not resizable, this
* function does nothing.
*
* The aspect ratio is specified as a numerator and a denominator and both
* values must be greater than zero. For example, the common 16:9 aspect ratio
* is specified as 16 and 9, respectively.
*
* If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect
* ratio limit is disabled.
*
* The aspect ratio is applied immediately to a windowed mode window and may
* cause it to be resized.
*
* @param[in] window The window to set limits for.
* @param[in] numer The numerator of the desired aspect ratio, or
* `GLFW_DONT_CARE`.
* @param[in] denom The denominator of the desired aspect ratio, or
* `GLFW_DONT_CARE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
*
* @remark If you set size limits and an aspect ratio that conflict, the
* results are undefined.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_sizelimits
* @sa glfwSetWindowSizeLimits
*
* @since Added in version 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
/*! @brief Sets the size of the client area of the specified window.
*
* This function sets the size, in screen coordinates, of the client area of
* the specified window.
*
* For full screen windows, this function updates the resolution of its desired
* video mode and switches to the video mode closest to it, without affecting
* the window's context. As the context is unaffected, the bit depths of the
* framebuffer remain unchanged.
*
* If you wish to update the refresh rate of the desired video mode in addition
* to its resolution, see @ref glfwSetWindowMonitor.
*
* The window manager may put limits on what sizes are allowed. GLFW cannot
* and should not override these limits.
*
* @param[in] window The window to resize.
* @param[in] width The desired width, in screen coordinates, of the window
* client area.
* @param[in] height The desired height, in screen coordinates, of the window
* client area.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
* @sa glfwGetWindowSize
* @sa glfwSetWindowMonitor
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);
/*! @brief Retrieves the size of the framebuffer of the specified window.
*
* This function retrieves the size, in pixels, of the framebuffer of the
* specified window. If you wish to retrieve the size of the window in screen
* coordinates, see @ref glfwGetWindowSize.
*
* Any or all of the size arguments may be `NULL`. If an error occurs, all
* non-`NULL` size arguments will be set to zero.
*
* @param[in] window The window whose framebuffer to query.
* @param[out] width Where to store the width, in pixels, of the framebuffer,
* or `NULL`.
* @param[out] height Where to store the height, in pixels, of the framebuffer,
* or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_fbsize
* @sa glfwSetFramebufferSizeCallback
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
/*! @brief Retrieves the size of the frame of the window.
*
* This function retrieves the size, in screen coordinates, of each edge of the
* frame of the specified window. This size includes the title bar, if the
* window has one. The size of the frame may vary depending on the
* [window-related hints](@ref window_hints_wnd) used to create it.
*
* Because this function retrieves the size of each window frame edge and not
* the offset along a particular coordinate axis, the retrieved values will
* always be zero or positive.
*
* Any or all of the size arguments may be `NULL`. If an error occurs, all
* non-`NULL` size arguments will be set to zero.
*
* @param[in] window The window whose frame size to query.
* @param[out] left Where to store the size, in screen coordinates, of the left
* edge of the window frame, or `NULL`.
* @param[out] top Where to store the size, in screen coordinates, of the top
* edge of the window frame, or `NULL`.
* @param[out] right Where to store the size, in screen coordinates, of the
* right edge of the window frame, or `NULL`.
* @param[out] bottom Where to store the size, in screen coordinates, of the
* bottom edge of the window frame, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
*
* @since Added in version 3.1.
*
* @ingroup window
*/
GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
/*! @brief Iconifies the specified window.
*
* This function iconifies (minimizes) the specified window if it was
* previously restored. If the window is already iconified, this function does
* nothing.
*
* If the specified window is a full screen window, the original monitor
* resolution is restored until the window is restored.
*
* @param[in] window The window to iconify.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_iconify
* @sa glfwRestoreWindow
* @sa glfwMaximizeWindow
*
* @since Added in version 2.1.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
/*! @brief Restores the specified window.
*
* This function restores the specified window if it was previously iconified
* (minimized) or maximized. If the window is already restored, this function
* does nothing.
*
* If the specified window is a full screen window, the resolution chosen for
* the window is restored on the selected monitor.
*
* @param[in] window The window to restore.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_iconify
* @sa glfwIconifyWindow
* @sa glfwMaximizeWindow
*
* @since Added in version 2.1.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwRestoreWindow(GLFWwindow* window);
/*! @brief Maximizes the specified window.
*
* This function maximizes the specified window if it was previously not
* maximized. If the window is already maximized, this function does nothing.
*
* If the specified window is a full screen window, this function does nothing.
*
* @param[in] window The window to maximize.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @par Thread Safety
* This function may only be called from the main thread.
*
* @sa @ref window_iconify
* @sa glfwIconifyWindow
* @sa glfwRestoreWindow
*
* @since Added in GLFW 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
/*! @brief Makes the specified window visible.
*
* This function makes the specified window visible if it was previously
* hidden. If the window is already visible or is in full screen mode, this
* function does nothing.
*
* @param[in] window The window to make visible.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_hide
* @sa glfwHideWindow
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwShowWindow(GLFWwindow* window);
/*! @brief Hides the specified window.
*
* This function hides the specified window if it was previously visible. If
* the window is already hidden or is in full screen mode, this function does
* nothing.
*
* @param[in] window The window to hide.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_hide
* @sa glfwShowWindow
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwHideWindow(GLFWwindow* window);
/*! @brief Brings the specified window to front and sets input focus.
*
* This function brings the specified window to front and sets input focus.
* The window should already be visible and not iconified.
*
* By default, both windowed and full screen mode windows are focused when
* initially created. Set the [GLFW_FOCUSED](@ref window_hints_wnd) to disable
* this behavior.
*
* __Do not use this function__ to steal focus from other applications unless
* you are certain that is what the user wants. Focus stealing can be
* extremely disruptive.
*
* @param[in] window The window to give input focus.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_focus
*
* @since Added in version 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwFocusWindow(GLFWwindow* window);
/*! @brief Returns the monitor that the window uses for full screen mode.
*
* This function returns the handle of the monitor that the specified window is
* in full screen on.
*
* @param[in] window The window to query.
* @return The monitor, or `NULL` if the window is in windowed mode or an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_monitor
* @sa glfwSetWindowMonitor
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
/*! @brief Sets the mode, monitor, video mode and placement of a window.
*
* This function sets the monitor that the window uses for full screen mode or,
* if the monitor is `NULL`, makes it windowed mode.
*
* When setting a monitor, this function updates the width, height and refresh
* rate of the desired video mode and switches to the video mode closest to it.
* The window position is ignored when setting a monitor.
*
* When the monitor is `NULL`, the position, width and height are used to
* place the window client area. The refresh rate is ignored when no monitor
* is specified.
*
* If you only wish to update the resolution of a full screen window or the
* size of a windowed mode window, see @ref glfwSetWindowSize.
*
* When a window transitions from full screen to windowed mode, this function
* restores any previous window settings such as whether it is decorated,
* floating, resizable, has size or aspect ratio limits, etc..
*
* @param[in] window The window whose monitor, size or video mode to set.
* @param[in] monitor The desired monitor, or `NULL` to set windowed mode.
* @param[in] xpos The desired x-coordinate of the upper-left corner of the
* client area.
* @param[in] ypos The desired y-coordinate of the upper-left corner of the
* client area.
* @param[in] width The desired with, in screen coordinates, of the client area
* or video mode.
* @param[in] height The desired height, in screen coordinates, of the client
* area or video mode.
* @param[in] refreshRate The desired refresh rate, in Hz, of the video mode,
* or `GLFW_DONT_CARE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_monitor
* @sa @ref window_full_screen
* @sa glfwGetWindowMonitor
* @sa glfwSetWindowSize
*
* @since Added in version 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
/*! @brief Returns an attribute of the specified window.
*
* This function returns the value of an attribute of the specified window or
* its OpenGL or OpenGL ES context.
*
* @param[in] window The window to query.
* @param[in] attrib The [window attribute](@ref window_attribs) whose value to
* return.
* @return The value of the attribute, or zero if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @remark Framebuffer related hints are not window attributes. See @ref
* window_attribs_fb for more information.
*
* @remark Zero is a valid value for many window and context related
* attributes so you cannot use a return value of zero as an indication of
* errors. However, this function should not fail as long as it is passed
* valid arguments and the library has been [initialized](@ref intro_init).
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_attribs
*
* @since Added in version 3.0. Replaces `glfwGetWindowParam` and
* `glfwGetGLVersion`.
*
* @ingroup window
*/
GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
/*! @brief Sets the user pointer of the specified window.
*
* This function sets the user-defined pointer of the specified window. The
* current value is retained until the window is destroyed. The initial value
* is `NULL`.
*
* @param[in] window The window whose pointer to set.
* @param[in] pointer The new value.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @sa @ref window_userptr
* @sa glfwGetWindowUserPointer
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
/*! @brief Returns the user pointer of the specified window.
*
* This function returns the current value of the user-defined pointer of the
* specified window. The initial value is `NULL`.
*
* @param[in] window The window whose pointer to return.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @sa @ref window_userptr
* @sa glfwSetWindowUserPointer
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
/*! @brief Sets the position callback for the specified window.
*
* This function sets the position callback of the specified window, which is
* called when the window is moved. The callback is provided with the screen
* position of the upper-left corner of the client area of the window.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_pos
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
/*! @brief Sets the size callback for the specified window.
*
* This function sets the size callback of the specified window, which is
* called when the window is resized. The callback is provided with the size,
* in screen coordinates, of the client area of the window.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter and return value.
*
* @ingroup window
*/
GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
/*! @brief Sets the close callback for the specified window.
*
* This function sets the close callback of the specified window, which is
* called when the user attempts to close the window, for example by clicking
* the close widget in the title bar.
*
* The close flag is set before this callback is called, but you can modify it
* at any time with @ref glfwSetWindowShouldClose.
*
* The close callback is not triggered by @ref glfwDestroyWindow.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark @osx Selecting Quit from the application menu will trigger the close
* callback for all windows.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_close
*
* @since Added in version 2.5.
* @glfw3 Added window handle parameter and return value.
*
* @ingroup window
*/
GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
/*! @brief Sets the refresh callback for the specified window.
*
* This function sets the refresh callback of the specified window, which is
* called when the client area of the window needs to be redrawn, for example
* if the window has been exposed after having been covered by another window.
*
* On compositing window systems such as Aero, Compiz or Aqua, where the window
* contents are saved off-screen, this callback may be called only very
* infrequently or never at all.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_refresh
*
* @since Added in version 2.5.
* @glfw3 Added window handle parameter and return value.
*
* @ingroup window
*/
GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);
/*! @brief Sets the focus callback for the specified window.
*
* This function sets the focus callback of the specified window, which is
* called when the window gains or loses input focus.
*
* After the focus callback is called for a window that lost input focus,
* synthetic key and mouse button release events will be generated for all such
* that had been pressed. For more information, see @ref glfwSetKeyCallback
* and @ref glfwSetMouseButtonCallback.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_focus
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
/*! @brief Sets the iconify callback for the specified window.
*
* This function sets the iconification callback of the specified window, which
* is called when the window is iconified or restored.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_iconify
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
/*! @brief Sets the framebuffer resize callback for the specified window.
*
* This function sets the framebuffer resize callback of the specified window,
* which is called when the framebuffer of the specified window is resized.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_fbsize
*
* @since Added in version 3.0.
*
* @ingroup window
*/
GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
/*! @brief Processes all pending events.
*
* This function processes only those events that are already in the event
* queue and then returns immediately. Processing events will cause the window
* and input callbacks associated with those events to be called.
*
* On some platforms, a window move, resize or menu operation will cause event
* processing to block. This is due to how event processing is designed on
* those platforms. You can use the
* [window refresh callback](@ref window_refresh) to redraw the contents of
* your window when necessary during such operations.
*
* On some platforms, certain events are sent directly to the application
* without going through the event queue, causing callbacks to be called
* outside of a call to one of the event processing functions.
*
* Event processing is not required for joystick input to work.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref events
* @sa glfwWaitEvents
* @sa glfwWaitEventsTimeout
*
* @since Added in version 1.0.
*
* @ingroup window
*/
GLFWAPI void glfwPollEvents(void);
/*! @brief Waits until events are queued and processes them.
*
* This function puts the calling thread to sleep until at least one event is
* available in the event queue. Once one or more events are available,
* it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue
* are processed and the function then returns immediately. Processing events
* will cause the window and input callbacks associated with those events to be
* called.
*
* Since not all events are associated with callbacks, this function may return
* without a callback having been called even if you are monitoring all
* callbacks.
*
* On some platforms, a window move, resize or menu operation will cause event
* processing to block. This is due to how event processing is designed on
* those platforms. You can use the
* [window refresh callback](@ref window_refresh) to redraw the contents of
* your window when necessary during such operations.
*
* On some platforms, certain callbacks may be called outside of a call to one
* of the event processing functions.
*
* If no windows exist, this function returns immediately. For synchronization
* of threads in applications that do not create windows, use your threading
* library of choice.
*
* Event processing is not required for joystick input to work.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref events
* @sa glfwPollEvents
* @sa glfwWaitEventsTimeout
*
* @since Added in version 2.5.
*
* @ingroup window
*/
GLFWAPI void glfwWaitEvents(void);
/*! @brief Waits with timeout until events are queued and processes them.
*
* This function puts the calling thread to sleep until at least one event is
* available in the event queue, or until the specified timeout is reached. If
* one or more events are available, it behaves exactly like @ref
* glfwPollEvents, i.e. the events in the queue are processed and the function
* then returns immediately. Processing events will cause the window and input
* callbacks associated with those events to be called.
*
* The timeout value must be a positive finite number.
*
* Since not all events are associated with callbacks, this function may return
* without a callback having been called even if you are monitoring all
* callbacks.
*
* On some platforms, a window move, resize or menu operation will cause event
* processing to block. This is due to how event processing is designed on
* those platforms. You can use the
* [window refresh callback](@ref window_refresh) to redraw the contents of
* your window when necessary during such operations.
*
* On some platforms, certain callbacks may be called outside of a call to one
* of the event processing functions.
*
* If no windows exist, this function returns immediately. For synchronization
* of threads in applications that do not create windows, use your threading
* library of choice.
*
* Event processing is not required for joystick input to work.
*
* @param[in] timeout The maximum amount of time, in seconds, to wait.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref events
* @sa glfwPollEvents
* @sa glfwWaitEvents
*
* @since Added in version 3.2.
*
* @ingroup window
*/
GLFWAPI void glfwWaitEventsTimeout(double timeout);
/*! @brief Posts an empty event to the event queue.
*
* This function posts an empty event from the current thread to the event
* queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
*
* If no windows exist, this function returns immediately. For synchronization
* of threads in applications that do not create windows, use your threading
* library of choice.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref events
* @sa glfwWaitEvents
* @sa glfwWaitEventsTimeout
*
* @since Added in version 3.1.
*
* @ingroup window
*/
GLFWAPI void glfwPostEmptyEvent(void);
/*! @brief Returns the value of an input option for the specified window.
*
* This function returns the value of an input option for the specified window.
* The mode must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
* `GLFW_STICKY_MOUSE_BUTTONS`.
*
* @param[in] window The window to query.
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
* `GLFW_STICKY_MOUSE_BUTTONS`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa glfwSetInputMode
*
* @since Added in version 3.0.
*
* @ingroup input
*/
GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
/*! @brief Sets an input option for the specified window.
*
* This function sets an input mode option for the specified window. The mode
* must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
* `GLFW_STICKY_MOUSE_BUTTONS`.
*
* If the mode is `GLFW_CURSOR`, the value must be one of the following cursor
* modes:
* - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
* - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client
* area of the window but does not restrict the cursor from leaving.
* - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual
* and unlimited cursor movement. This is useful for implementing for
* example 3D camera controls.
*
* If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
* enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are
* enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS`
* the next time it is called even if the key had been released before the
* call. This is useful when you are only interested in whether keys have been
* pressed but not when or in which order.
*
* If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
* `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
* If sticky mouse buttons are enabled, a mouse button press will ensure that
* @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
* if the mouse button had been released before the call. This is useful when
* you are only interested in whether mouse buttons have been pressed but not
* when or in which order.
*
* @param[in] window The window whose input mode to set.
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
* `GLFW_STICKY_MOUSE_BUTTONS`.
* @param[in] value The new value of the specified input mode.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa glfwGetInputMode
*
* @since Added in version 3.0. Replaces `glfwEnable` and `glfwDisable`.
*
* @ingroup input
*/
GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
/*! @brief Returns the localized name of the specified printable key.
*
* This function returns the localized name of the specified printable key.
* This is intended for displaying key bindings to the user.
*
* If the key is `GLFW_KEY_UNKNOWN`, the scancode is used instead, otherwise
* the scancode is ignored. If a non-printable key or (if the key is
* `GLFW_KEY_UNKNOWN`) a scancode that maps to a non-printable key is
* specified, this function returns `NULL`.
*
* This behavior allows you to pass in the arguments passed to the
* [key callback](@ref input_key) without modification.
*
* The printable keys are:
* - `GLFW_KEY_APOSTROPHE`
* - `GLFW_KEY_COMMA`
* - `GLFW_KEY_MINUS`
* - `GLFW_KEY_PERIOD`
* - `GLFW_KEY_SLASH`
* - `GLFW_KEY_SEMICOLON`
* - `GLFW_KEY_EQUAL`
* - `GLFW_KEY_LEFT_BRACKET`
* - `GLFW_KEY_RIGHT_BRACKET`
* - `GLFW_KEY_BACKSLASH`
* - `GLFW_KEY_WORLD_1`
* - `GLFW_KEY_WORLD_2`
* - `GLFW_KEY_0` to `GLFW_KEY_9`
* - `GLFW_KEY_A` to `GLFW_KEY_Z`
* - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9`
* - `GLFW_KEY_KP_DECIMAL`
* - `GLFW_KEY_KP_DIVIDE`
* - `GLFW_KEY_KP_MULTIPLY`
* - `GLFW_KEY_KP_SUBTRACT`
* - `GLFW_KEY_KP_ADD`
* - `GLFW_KEY_KP_EQUAL`
*
* @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`.
* @param[in] scancode The scancode of the key to query.
* @return The localized name of the key, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
* glfwGetKeyName, or until the library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_key_name
*
* @since Added in version 3.2.
*
* @ingroup input
*/
GLFWAPI const char* glfwGetKeyName(int key, int scancode);
/*! @brief Returns the last reported state of a keyboard key for the specified
* window.
*
* This function returns the last state reported for the specified key to the
* specified window. The returned state is one of `GLFW_PRESS` or
* `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to
* the key callback.
*
* If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns
* `GLFW_PRESS` the first time you call it for a key that was pressed, even if
* that key has already been released.
*
* The key functions deal with physical keys, with [key tokens](@ref keys)
* named after their use on the standard US keyboard layout. If you want to
* input text, use the Unicode character callback instead.
*
* The [modifier key bit masks](@ref mods) are not key tokens and cannot be
* used with this function.
*
* __Do not use this function__ to implement [text input](@ref input_char).
*
* @param[in] window The desired window.
* @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is
* not a valid key for this function.
* @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_key
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup input
*/
GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
/*! @brief Returns the last reported state of a mouse button for the specified
* window.
*
* This function returns the last state reported for the specified mouse button
* to the specified window. The returned state is one of `GLFW_PRESS` or
* `GLFW_RELEASE`.
*
* If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function
* `GLFW_PRESS` the first time you call it for a mouse button that was pressed,
* even if that mouse button has already been released.
*
* @param[in] window The desired window.
* @param[in] button The desired [mouse button](@ref buttons).
* @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_mouse_button
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup input
*/
GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
/*! @brief Retrieves the position of the cursor relative to the client area of
* the window.
*
* This function returns the position of the cursor, in screen coordinates,
* relative to the upper-left corner of the client area of the specified
* window.
*
* If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor
* position is unbounded and limited only by the minimum and maximum values of
* a `double`.
*
* The coordinate can be converted to their integer equivalents with the
* `floor` function. Casting directly to an integer type works for positive
* coordinates, but fails for negative ones.
*
* Any or all of the position arguments may be `NULL`. If an error occurs, all
* non-`NULL` position arguments will be set to zero.
*
* @param[in] window The desired window.
* @param[out] xpos Where to store the cursor x-coordinate, relative to the
* left edge of the client area, or `NULL`.
* @param[out] ypos Where to store the cursor y-coordinate, relative to the to
* top edge of the client area, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_pos
* @sa glfwSetCursorPos
*
* @since Added in version 3.0. Replaces `glfwGetMousePos`.
*
* @ingroup input
*/
GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
/*! @brief Sets the position of the cursor, relative to the client area of the
* window.
*
* This function sets the position, in screen coordinates, of the cursor
* relative to the upper-left corner of the client area of the specified
* window. The window must have input focus. If the window does not have
* input focus when this function is called, it fails silently.
*
* __Do not use this function__ to implement things like camera controls. GLFW
* already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the
* cursor, transparently re-centers it and provides unconstrained cursor
* motion. See @ref glfwSetInputMode for more information.
*
* If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is
* unconstrained and limited only by the minimum and maximum values of
* a `double`.
*
* @param[in] window The desired window.
* @param[in] xpos The desired x-coordinate, relative to the left edge of the
* client area.
* @param[in] ypos The desired y-coordinate, relative to the top edge of the
* client area.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_pos
* @sa glfwGetCursorPos
*
* @since Added in version 3.0. Replaces `glfwSetMousePos`.
*
* @ingroup input
*/
GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
/*! @brief Creates a custom cursor.
*
* Creates a new custom cursor image that can be set for a window with @ref
* glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor.
* Any remaining cursors are destroyed by @ref glfwTerminate.
*
* The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
* bits per channel. They are arranged canonically as packed sequential rows,
* starting from the top-left corner.
*
* The cursor hotspot is specified in pixels, relative to the upper-left corner
* of the cursor image. Like all other coordinate systems in GLFW, the X-axis
* points to the right and the Y-axis points down.
*
* @param[in] image The desired cursor image.
* @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot.
* @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot.
* @return The handle of the created cursor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified image data is copied before this function
* returns.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_object
* @sa glfwDestroyCursor
* @sa glfwCreateStandardCursor
*
* @since Added in version 3.1.
*
* @ingroup input
*/
GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
/*! @brief Creates a cursor with a standard shape.
*
* Returns a cursor with a [standard shape](@ref shapes), that can be set for
* a window with @ref glfwSetCursor.
*
* @param[in] shape One of the [standard shapes](@ref shapes).
* @return A new cursor ready to use or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_object
* @sa glfwCreateCursor
*
* @since Added in version 3.1.
*
* @ingroup input
*/
GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape);
/*! @brief Destroys a cursor.
*
* This function destroys a cursor previously created with @ref
* glfwCreateCursor. Any remaining cursors will be destroyed by @ref
* glfwTerminate.
*
* @param[in] cursor The cursor object to destroy.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_object
* @sa glfwCreateCursor
*
* @since Added in version 3.1.
*
* @ingroup input
*/
GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor);
/*! @brief Sets the cursor for the window.
*
* This function sets the cursor image to be used when the cursor is over the
* client area of the specified window. The set cursor will only be visible
* when the [cursor mode](@ref cursor_mode) of the window is
* `GLFW_CURSOR_NORMAL`.
*
* On some platforms, the set cursor may not be visible unless the window also
* has input focus.
*
* @param[in] window The window to set the cursor for.
* @param[in] cursor The cursor to set, or `NULL` to switch back to the default
* arrow cursor.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_object
*
* @since Added in version 3.1.
*
* @ingroup input
*/
GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
/*! @brief Sets the key callback.
*
* This function sets the key callback of the specified window, which is called
* when a key is pressed, repeated or released.
*
* The key functions deal with physical keys, with layout independent
* [key tokens](@ref keys) named after their values in the standard US keyboard
* layout. If you want to input text, use the
* [character callback](@ref glfwSetCharCallback) instead.
*
* When a window loses input focus, it will generate synthetic key release
* events for all pressed keys. You can tell these events from user-generated
* events by the fact that the synthetic ones are generated after the focus
* loss event has been processed, i.e. after the
* [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
*
* The scancode of a key is specific to that platform or sometimes even to that
* machine. Scancodes are intended to allow users to bind keys that don't have
* a GLFW key token. Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their
* state is not saved and so it cannot be queried with @ref glfwGetKey.
*
* Sometimes GLFW needs to generate synthetic key events, in which case the
* scancode may be zero.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new key callback, or `NULL` to remove the currently
* set callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_key
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter and return value.
*
* @ingroup input
*/
GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
/*! @brief Sets the Unicode character callback.
*
* This function sets the character callback of the specified window, which is
* called when a Unicode character is input.
*
* The character callback is intended for Unicode text input. As it deals with
* characters, it is keyboard layout dependent, whereas the
* [key callback](@ref glfwSetKeyCallback) is not. Characters do not map 1:1
* to physical keys, as a key may produce zero, one or more characters. If you
* want to know whether a specific physical key was pressed or released, see
* the key callback instead.
*
* The character callback behaves as system text input normally does and will
* not be called if modifier keys are held down that would prevent normal text
* input on that platform, for example a Super (Command) key on OS X or Alt key
* on Windows. There is a
* [character with modifiers callback](@ref glfwSetCharModsCallback) that
* receives these events.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_char
*
* @since Added in version 2.4.
* @glfw3 Added window handle parameter and return value.
*
* @ingroup input
*/
GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
/*! @brief Sets the Unicode character with modifiers callback.
*
* This function sets the character with modifiers callback of the specified
* window, which is called when a Unicode character is input regardless of what
* modifier keys are used.
*
* The character with modifiers callback is intended for implementing custom
* Unicode character input. For regular Unicode text input, see the
* [character callback](@ref glfwSetCharCallback). Like the character
* callback, the character with modifiers callback deals with characters and is
* keyboard layout dependent. Characters do not map 1:1 to physical keys, as
* a key may produce zero, one or more characters. If you want to know whether
* a specific physical key was pressed or released, see the
* [key callback](@ref glfwSetKeyCallback) instead.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_char
*
* @since Added in version 3.1.
*
* @ingroup input
*/
GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun);
/*! @brief Sets the mouse button callback.
*
* This function sets the mouse button callback of the specified window, which
* is called when a mouse button is pressed or released.
*
* When a window loses input focus, it will generate synthetic mouse button
* release events for all pressed mouse buttons. You can tell these events
* from user-generated events by the fact that the synthetic ones are generated
* after the focus loss event has been processed, i.e. after the
* [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref input_mouse_button
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter and return value.
*
* @ingroup input
*/
GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
/*! @brief Sets the cursor position callback.
*
* This function sets the cursor position callback of the specified window,
* which is called when the cursor is moved. The callback is provided with the
* position, in screen coordinates, relative to the upper-left corner of the
* client area of the window.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_pos
*
* @since Added in version 3.0. Replaces `glfwSetMousePosCallback`.
*
* @ingroup input
*/
GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
/*! @brief Sets the cursor enter/exit callback.
*
* This function sets the cursor boundary crossing callback of the specified
* window, which is called when the cursor enters or leaves the client area of
* the window.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref cursor_enter
*
* @since Added in version 3.0.
*
* @ingroup input
*/
GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
/*! @brief Sets the scroll callback.
*
* This function sets the scroll callback of the specified window, which is
* called when a scrolling device is used, such as a mouse wheel or scrolling
* area of a touchpad.
*
* The scroll callback receives all scrolling input, like that from a mouse
* wheel or a touchpad scrolling area.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new scroll callback, or `NULL` to remove the currently
* set callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref scrolling
*
* @since Added in version 3.0. Replaces `glfwSetMouseWheelCallback`.
*
* @ingroup input
*/
GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
/*! @brief Sets the file drop callback.
*
* This function sets the file drop callback of the specified window, which is
* called when one or more dragged files are dropped on the window.
*
* Because the path array and its strings may have been generated specifically
* for that event, they are not guaranteed to be valid after the callback has
* returned. If you wish to use them after the callback returns, you need to
* make a deep copy.
*
* @param[in] window The window whose callback to set.
* @param[in] cbfun The new file drop callback, or `NULL` to remove the
* currently set callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref path_drop
*
* @since Added in version 3.1.
*
* @ingroup input
*/
GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
/*! @brief Returns whether the specified joystick is present.
*
* This function returns whether the specified joystick is present.
*
* @param[in] joy The [joystick](@ref joysticks) to query.
* @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref joystick
*
* @since Added in version 3.0. Replaces `glfwGetJoystickParam`.
*
* @ingroup input
*/
GLFWAPI int glfwJoystickPresent(int joy);
/*! @brief Returns the values of all axes of the specified joystick.
*
* This function returns the values of all axes of the specified joystick.
* Each element in the array is a value between -1.0 and 1.0.
*
* Querying a joystick slot with no device present is not an error, but will
* cause this function to return `NULL`. Call @ref glfwJoystickPresent to
* check device presence.
*
* @param[in] joy The [joystick](@ref joysticks) to query.
* @param[out] count Where to store the number of axis values in the returned
* array. This is set to zero if the joystick is not present or an error
* occurred.
* @return An array of axis values, or `NULL` if the joystick is not present or
* an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified joystick is
* disconnected, this function is called again for that joystick or the library
* is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref joystick_axis
*
* @since Added in version 3.0. Replaces `glfwGetJoystickPos`.
*
* @ingroup input
*/
GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count);
/*! @brief Returns the state of all buttons of the specified joystick.
*
* This function returns the state of all buttons of the specified joystick.
* Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`.
*
* Querying a joystick slot with no device present is not an error, but will
* cause this function to return `NULL`. Call @ref glfwJoystickPresent to
* check device presence.
*
* @param[in] joy The [joystick](@ref joysticks) to query.
* @param[out] count Where to store the number of button states in the returned
* array. This is set to zero if the joystick is not present or an error
* occurred.
* @return An array of button states, or `NULL` if the joystick is not present
* or an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified joystick is
* disconnected, this function is called again for that joystick or the library
* is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref joystick_button
*
* @since Added in version 2.2.
* @glfw3 Changed to return a dynamic array.
*
* @ingroup input
*/
GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count);
/*! @brief Returns the name of the specified joystick.
*
* This function returns the name, encoded as UTF-8, of the specified joystick.
* The returned string is allocated and freed by GLFW. You should not free it
* yourself.
*
* Querying a joystick slot with no device present is not an error, but will
* cause this function to return `NULL`. Call @ref glfwJoystickPresent to
* check device presence.
*
* @param[in] joy The [joystick](@ref joysticks) to query.
* @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
* is not present or an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified joystick is
* disconnected, this function is called again for that joystick or the library
* is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref joystick_name
*
* @since Added in version 3.0.
*
* @ingroup input
*/
GLFWAPI const char* glfwGetJoystickName(int joy);
/*! @brief Sets the joystick configuration callback.
*
* This function sets the joystick configuration callback, or removes the
* currently set callback. This is called when a joystick is connected to or
* disconnected from the system.
*
* @param[in] cbfun The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref joystick_event
*
* @since Added in version 3.2.
*
* @ingroup input
*/
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun);
/*! @brief Sets the clipboard to the specified string.
*
* This function sets the system clipboard to the specified, UTF-8 encoded
* string.
*
* @param[in] window The window that will own the clipboard contents.
* @param[in] string A UTF-8 encoded string.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified string is copied before this function
* returns.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref clipboard
* @sa glfwGetClipboardString
*
* @since Added in version 3.0.
*
* @ingroup input
*/
GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
/*! @brief Returns the contents of the clipboard as a string.
*
* This function returns the contents of the system clipboard, if it contains
* or is convertible to a UTF-8 encoded string. If the clipboard is empty or
* if its contents cannot be converted, `NULL` is returned and a @ref
* GLFW_FORMAT_UNAVAILABLE error is generated.
*
* @param[in] window The window that will request the clipboard contents.
* @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
* if an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
* glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
* is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref clipboard
* @sa glfwSetClipboardString
*
* @since Added in version 3.0.
*
* @ingroup input
*/
GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
/*! @brief Returns the value of the GLFW timer.
*
* This function returns the value of the GLFW timer. Unless the timer has
* been set using @ref glfwSetTime, the timer measures time elapsed since GLFW
* was initialized.
*
* The resolution of the timer is system dependent, but is usually on the order
* of a few micro- or nanoseconds. It uses the highest-resolution monotonic
* time source on each supported platform.
*
* @return The current value, in seconds, or zero if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Reading and
* writing of the internal timer offset is not atomic, so it needs to be
* externally synchronized with calls to @ref glfwSetTime.
*
* @sa @ref time
*
* @since Added in version 1.0.
*
* @ingroup input
*/
GLFWAPI double glfwGetTime(void);
/*! @brief Sets the GLFW timer.
*
* This function sets the value of the GLFW timer. It then continues to count
* up from that value. The value must be a positive finite number less than
* or equal to 18446744073.0, which is approximately 584.5 years.
*
* @param[in] time The new value, in seconds.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_VALUE.
*
* @remark The upper limit of the timer is calculated as
* floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations
* storing nanoseconds in 64 bits. The limit may be increased in the future.
*
* @thread_safety This function may be called from any thread. Reading and
* writing of the internal timer offset is not atomic, so it needs to be
* externally synchronized with calls to @ref glfwGetTime.
*
* @sa @ref time
*
* @since Added in version 2.2.
*
* @ingroup input
*/
GLFWAPI void glfwSetTime(double time);
/*! @brief Returns the current value of the raw timer.
*
* This function returns the current value of the raw timer, measured in
* 1 / frequency seconds. To get the frequency, call @ref
* glfwGetTimerFrequency.
*
* @return The value of the timer, or zero if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref time
* @sa glfwGetTimerFrequency
*
* @since Added in version 3.2.
*
* @ingroup input
*/
GLFWAPI uint64_t glfwGetTimerValue(void);
/*! @brief Returns the frequency, in Hz, of the raw timer.
*
* This function returns the frequency, in Hz, of the raw timer.
*
* @return The frequency of the timer, in Hz, or zero if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref time
* @sa glfwGetTimerValue
*
* @since Added in version 3.2.
*
* @ingroup input
*/
GLFWAPI uint64_t glfwGetTimerFrequency(void);
/*! @brief Makes the context of the specified window current for the calling
* thread.
*
* This function makes the OpenGL or OpenGL ES context of the specified window
* current on the calling thread. A context can only be made current on
* a single thread at a time and each thread can have only a single current
* context at a time.
*
* By default, making a context non-current implicitly forces a pipeline flush.
* On machines that support `GL_KHR_context_flush_control`, you can control
* whether a context performs this flush by setting the
* [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint.
*
* The specified window must have an OpenGL or OpenGL ES context. Specifying
* a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
* error.
*
* @param[in] window The window whose context to make current, or `NULL` to
* detach the current context.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref context_current
* @sa glfwGetCurrentContext
*
* @since Added in version 3.0.
*
* @ingroup context
*/
GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);
/*! @brief Returns the window whose context is current on the calling thread.
*
* This function returns the window whose OpenGL or OpenGL ES context is
* current on the calling thread.
*
* @return The window whose context is current, or `NULL` if no window's
* context is current.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref context_current
* @sa glfwMakeContextCurrent
*
* @since Added in version 3.0.
*
* @ingroup context
*/
GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
/*! @brief Swaps the front and back buffers of the specified window.
*
* This function swaps the front and back buffers of the specified window when
* rendering with OpenGL or OpenGL ES. If the swap interval is greater than
* zero, the GPU driver waits the specified number of screen updates before
* swapping the buffers.
*
* The specified window must have an OpenGL or OpenGL ES context. Specifying
* a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
* error.
*
* This function does not apply to Vulkan. If you are rendering with Vulkan,
* see `vkQueuePresentKHR` instead.
*
* @param[in] window The window whose buffers to swap.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
* @remark __EGL:__ The context of the specified window must be current on the
* calling thread.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref buffer_swap
* @sa glfwSwapInterval
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
/*! @brief Sets the swap interval for the current context.
*
* This function sets the swap interval for the current OpenGL or OpenGL ES
* context, i.e. the number of screen updates to wait from the time @ref
* glfwSwapBuffers was called before swapping the buffers and returning. This
* is sometimes called _vertical synchronization_, _vertical retrace
* synchronization_ or just _vsync_.
*
* Contexts that support either of the `WGL_EXT_swap_control_tear` and
* `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,
* which allow the driver to swap even if a frame arrives a little bit late.
* You can check for the presence of these extensions using @ref
* glfwExtensionSupported. For more information about swap tearing, see the
* extension specifications.
*
* A context must be current on the calling thread. Calling this function
* without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
*
* This function does not apply to Vulkan. If you are rendering with Vulkan,
* see the present mode of your swapchain instead.
*
* @param[in] interval The minimum number of screen updates to wait for
* until the buffers are swapped by @ref glfwSwapBuffers.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
* @remark This function is not called during context creation, leaving the
* swap interval set to whatever is the default on that platform. This is done
* because some swap interval extensions used by GLFW do not allow the swap
* interval to be reset to zero once it has been set to a non-zero value.
*
* @remark Some GPU drivers do not honor the requested swap interval, either
* because of a user setting that overrides the application's request or due to
* bugs in the driver.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref buffer_swap
* @sa glfwSwapBuffers
*
* @since Added in version 1.0.
*
* @ingroup context
*/
GLFWAPI void glfwSwapInterval(int interval);
/*! @brief Returns whether the specified extension is available.
*
* This function returns whether the specified
* [API extension](@ref context_glext) is supported by the current OpenGL or
* OpenGL ES context. It searches both for client API extension and context
* creation API extensions.
*
* A context must be current on the calling thread. Calling this function
* without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
*
* As this functions retrieves and searches one or more extension strings each
* call, it is recommended that you cache its results if it is going to be used
* frequently. The extension strings will not change during the lifetime of
* a context, so there is no danger in doing this.
*
* This function does not apply to Vulkan. If you are using Vulkan, see @ref
* glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties`
* and `vkEnumerateDeviceExtensionProperties` instead.
*
* @param[in] extension The ASCII encoded name of the extension.
* @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE`
* otherwise.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref context_glext
* @sa glfwGetProcAddress
*
* @since Added in version 1.0.
*
* @ingroup context
*/
GLFWAPI int glfwExtensionSupported(const char* extension);
/*! @brief Returns the address of the specified function for the current
* context.
*
* This function returns the address of the specified OpenGL or OpenGL ES
* [core or extension function](@ref context_glext), if it is supported
* by the current context.
*
* A context must be current on the calling thread. Calling this function
* without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
*
* This function does not apply to Vulkan. If you are rendering with Vulkan,
* see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and
* `vkGetDeviceProcAddr` instead.
*
* @param[in] procname The ASCII encoded name of the function.
* @return The address of the function, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
* @remark The address of a given function is not guaranteed to be the same
* between contexts.
*
* @remark This function may return a non-`NULL` address despite the
* associated version or extension not being available. Always check the
* context version or extension string first.
*
* @pointer_lifetime The returned function pointer is valid until the context
* is destroyed or the library is terminated.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref context_glext
* @sa glfwExtensionSupported
*
* @since Added in version 1.0.
*
* @ingroup context
*/
GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
/*! @brief Returns whether the Vulkan loader has been found.
*
* This function returns whether the Vulkan loader has been found. This check
* is performed by @ref glfwInit.
*
* The availability of a Vulkan loader does not by itself guarantee that window
* surface creation or even device creation is possible. Call @ref
* glfwGetRequiredInstanceExtensions to check whether the extensions necessary
* for Vulkan surface creation are available and @ref
* glfwGetPhysicalDevicePresentationSupport to check whether a queue family of
* a physical device supports image presentation.
*
* @return `GLFW_TRUE` if Vulkan is available, or `GLFW_FALSE` otherwise.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref vulkan_support
*
* @since Added in version 3.2.
*
* @ingroup vulkan
*/
GLFWAPI int glfwVulkanSupported(void);
/*! @brief Returns the Vulkan instance extensions required by GLFW.
*
* This function returns an array of names of Vulkan instance extensions required
* by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the
* list will always contains `VK_KHR_surface`, so if you don't require any
* additional extensions you can pass this list directly to the
* `VkInstanceCreateInfo` struct.
*
* If Vulkan is not available on the machine, this function returns `NULL` and
* generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported
* to check whether Vulkan is available.
*
* If Vulkan is available but no set of extensions allowing window surface
* creation was found, this function returns `NULL`. You may still use Vulkan
* for off-screen rendering and compute work.
*
* @param[out] count Where to store the number of extensions in the returned
* array. This is set to zero if an error occurred.
* @return An array of ASCII encoded extension names, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_API_UNAVAILABLE.
*
* @remarks Additional extensions may be required by future versions of GLFW.
* You should check if any extensions you wish to enable are already in the
* returned array, as it is an error to specify an extension more than once in
* the `VkInstanceCreateInfo` struct.
*
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is guaranteed to be valid only until the
* library is terminated.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref vulkan_ext
* @sa glfwCreateWindowSurface
*
* @since Added in version 3.2.
*
* @ingroup vulkan
*/
GLFWAPI const char** glfwGetRequiredInstanceExtensions(int* count);
]]..(hasVulkan and
[[
/*! @brief Returns the address of the specified Vulkan instance function.
*
* This function returns the address of the specified Vulkan core or extension
* function for the specified instance. If instance is set to `NULL` it can
* return any function exported from the Vulkan loader, including at least the
* following functions:
*
* - `vkEnumerateInstanceExtensionProperties`
* - `vkEnumerateInstanceLayerProperties`
* - `vkCreateInstance`
* - `vkGetInstanceProcAddr`
*
* If Vulkan is not available on the machine, this function returns `NULL` and
* generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported
* to check whether Vulkan is available.
*
* This function is equivalent to calling `vkGetInstanceProcAddr` with
* a platform-specific query of the Vulkan loader as a fallback.
*
* @param[in] instance The Vulkan instance to query, or `NULL` to retrieve
* functions related to instance creation.
* @param[in] procname The ASCII encoded name of the function.
* @return The address of the function, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_API_UNAVAILABLE.
*
* @pointer_lifetime The returned function pointer is valid until the library
* is terminated.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref vulkan_proc
*
* @since Added in version 3.2.
*
* @ingroup vulkan
*/
GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname);
/*! @brief Returns whether the specified queue family can present images.
*
* This function returns whether the specified queue family of the specified
* physical device supports presentation to the platform GLFW was built for.
*
* If Vulkan or the required window surface creation instance extensions are
* not available on the machine, or if the specified instance was not created
* with the required extensions, this function returns `GLFW_FALSE` and
* generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported
* to check whether Vulkan is available and @ref
* glfwGetRequiredInstanceExtensions to check what instance extensions are
* required.
*
* @param[in] instance The instance that the physical device belongs to.
* @param[in] device The physical device that the queue family belongs to.
* @param[in] queuefamily The index of the queue family to query.
* @return `GLFW_TRUE` if the queue family supports presentation, or
* `GLFW_FALSE` otherwise.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
* @thread_safety This function may be called from any thread. For
* synchronization details of Vulkan objects, see the Vulkan specification.
*
* @sa @ref vulkan_present
*
* @since Added in version 3.2.
*
* @ingroup vulkan
*/
GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
/*! @brief Creates a Vulkan surface for the specified window.
*
* This function creates a Vulkan surface for the specified window.
*
* If the Vulkan loader was not found at initialization, this function returns
* `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref GLFW_API_UNAVAILABLE
* error. Call @ref glfwVulkanSupported to check whether the Vulkan loader was
* found.
*
* If the required window surface creation instance extensions are not
* available or if the specified instance was not created with these extensions
* enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and
* generates a @ref GLFW_API_UNAVAILABLE error. Call @ref
* glfwGetRequiredInstanceExtensions to check what instance extensions are
* required.
*
* The window surface must be destroyed before the specified Vulkan instance.
* It is the responsibility of the caller to destroy the window surface. GLFW
* does not destroy it for you. Call `vkDestroySurfaceKHR` to destroy the
* surface.
*
* @param[in] instance The Vulkan instance to create the surface in.
* @param[in] window The window to create the surface for.
* @param[in] allocator The allocator to use, or `NULL` to use the default
* allocator.
* @param[out] surface Where to store the handle of the surface. This is set
* to `VK_NULL_HANDLE` if an error occurred.
* @return `VK_SUCCESS` if successful, or a Vulkan error code if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
* @remarks If an error occurs before the creation call is made, GLFW returns
* the Vulkan error code most appropriate for the error. Appropriate use of
* @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should
* eliminate almost all occurrences of these errors.
*
* @thread_safety This function may be called from any thread. For
* synchronization details of Vulkan objects, see the Vulkan specification.
*
* @sa @ref vulkan_surface
* @sa glfwGetRequiredInstanceExtensions
*
* @since Added in version 3.2.
*
* @ingroup vulkan
*/
GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
]] or "")
):gsub("GLFWCALL",ffi.os == "Windows" and "__stdcall" or ""):gsub("GLFWAPI", "")
ffi.cdef(def)
return ffi.load( "glfw3" )
|
ep3_chiss_poacher_backpack = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "Chiss Poacher Backpack",
directObjectTemplate = "object/tangible/wearables/backpack/ep3_chiss_poacher_backpack.iff",
craftingValues = {
},
customizationStringNames = {},
customizationValues = {}
}
addLootItemTemplate("ep3_chiss_poacher_backpack", ep3_chiss_poacher_backpack)
|
local snownet = require "snownet"
local sprotoloader = require "sprotoloader"
local max_client = 64
snownet.start(function()
snownet.error("Server start")
snownet.uniqueservice("protoloader")
if not snownet.getenv "daemon" then
local console = snownet.newservice("console")
end
snownet.newservice("debug_console",8000)
snownet.newservice("simpledb")
local watchdog = snownet.newservice("watchdog")
snownet.call(watchdog, "lua", "start", {
port = 8888,
maxclient = max_client,
nodelay = true,
})
snownet.error("Watchdog listen on", 8888)
snownet.exit()
end)
|
local http = require("http")
http.createServer(function (req, res)
local body = "Hello world\n"
res:writeHead(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = #body
})
res:finish(body)
end):listen(8080)
print("Server listening at http://localhost:8080/")
|
local log = require('log')
local work_dir = arg[1] or '.'
box.cfg({
memtx_dir = work_dir,
wal_dir = work_dir
})
local test_list = {
'test_scd_type_1',
'test_scd_type_2',
'test_scd_type_3',
'test_scd_type_4'
}
local success = true
for _, t in ipairs(test_list) do
local test = require('tests.' .. t)
local ok, res = xpcall(test.run, debug.traceback)
if not ok or res ~= true then
success = false
log.error('%s: FAILED', t)
if type(res) ~= 'boolean' then
log.error(' %s', res)
end
end
log.info("%s: done", t)
end
if success then
os.exit(0)
else
os.exit(1)
end
|
local Component = require "class.Component"
local mirror = class("animation.mirror", Component)
mirror.argList = {
{"time", "number", 0.2},
}
function mirror:initialize(actor, args)
Component.initialize(self, actor, args)
self.mirrorTimer = 0
end
function mirror:update(dt)
self.mirrorTimer = self.mirrorTimer + dt
while self.mirrorTimer > self.time do
self.mirrorTimer = self.mirrorTimer - self.time
self.actor.animationDirection = -self.actor.animationDirection
end
end
return mirror
|
local ChaserEnemy, super = Class(Character, "enemy")
function ChaserEnemy:init(actor, x, y, properties)
super:init(self, actor, x, y)
properties = properties or {}
if properties["sprite"] then
self.sprite:setSprite(properties["sprite"])
elseif properties["animation"] then
self.sprite:setAnimation(properties["animation"])
end
if properties["facing"] then
self:setFacing(properties["facing"])
end
self.encounter = properties["encounter"]
self.enemy = properties["enemy"]
self.group = properties["group"]
self.path = properties["path"]
self.speed = properties["speed"] or 6
self.progress = (properties["progress"] or 0) % 1
self.reverse_progress = false
self.can_chase = properties["chase"]
self.chase_speed = properties["chasespeed"] or 9
self.chase_dist = properties["chasedist"] or 200
self.chasing = properties["chasing"] or false
self.alert_timer = 0
self.alert_icon = nil
self.noclip = true
self.enemy_collision = true
self.remove_on_encounter = true
self.encountered = false
if properties["aura"] == nil then
self.sprite.aura = Game:getConfig("enemyAuras")
else
self.sprite.aura = properties["aura"]
end
end
function ChaserEnemy:getDebugInfo()
local info = super:getDebugInfo(self)
if self.path then table.insert(info, "Path: " .. self.path) end
if self.progress then table.insert(info, "Progress: " .. self.progress) end
table.insert(info, "Can chase: " .. (self.can_chase and "True" or "False"))
if self.can_chase then
table.insert(info, "Chase speed: " .. self.chase_speed)
table.insert(info, "Chase distance: " .. self.chase_dist)
table.insert(info, "Chasing: " .. (self.chasing and "True" or "False"))
end
table.insert(info, "Remove on encounter: " .. (self.remove_on_encounter and "True" or "False"))
table.insert(info, "Encountered: " .. (self.encountered and "True" or "False"))
return info
end
function ChaserEnemy:onCollide(player)
if self:isActive() and player:includes(Player) then
self.encountered = true
local encounter = self.encounter
if not encounter and Registry.getEnemy(self.enemy or self.actor.id) then
encounter = Encounter()
encounter:addEnemy(self.actor.id)
end
if encounter then
self.world.encountering_enemy = true
self.sprite:setAnimation("hurt")
self.sprite.aura = false
Game.lock_movement = true
self.world.timer:script(function(wait)
Assets.playSound("tensionhorn")
wait(8/30)
local src = Assets.playSound("tensionhorn")
src:setPitch(1.1)
wait(12/30)
self.world.encountering_enemy = false
Game.lock_movement = false
local enemy_target = self
if self.enemy then
enemy_target = {{self.enemy, self}}
end
Game:encounter(encounter, true, enemy_target)
for _,enemy in ipairs(self.stage:getObjects(ChaserEnemy)) do
if enemy ~= self and self.group and enemy.group == self.group then
if enemy.remove_on_encounter then
enemy:remove()
end
end
end
if self.remove_on_encounter then
self:remove()
end
end)
end
end
end
function ChaserEnemy:onAdd(parent)
super:onAdd(self, parent)
self:snapToPath()
end
function ChaserEnemy:snapToPath()
if self.path and self.world.map.paths[self.path] then
local path = self.world.map.paths[self.path]
local progress = self.progress
if not path.closed then
progress = Ease.inOutSine(progress, 0, 1, 1)
end
if path.shape == "line" then
local dist = progress * path.length
local current_dist = 0
for i = 1, #path.points-1 do
local next_dist = Utils.dist(path.points[i].x, path.points[i].y, path.points[i+1].x, path.points[i+1].y)
if current_dist + next_dist > dist then
local x = Utils.lerp(path.points[i].x, path.points[i+1].x, (dist - current_dist) / next_dist)
local y = Utils.lerp(path.points[i].y, path.points[i+1].y, (dist - current_dist) / next_dist)
if self.debug_x and self.debug_y and Kristal.DebugSystem.last_object == self then
x = Utils.ease(self.debug_x, x, Kristal.DebugSystem.release_timer, "outCubic")
y = Utils.ease(self.debug_y, y, Kristal.DebugSystem.release_timer, "outCubic")
if Kristal.DebugSystem.release_timer >= 1 then
self.debug_x = nil
self.debug_y = nil
end
end
self:moveTo(x, y)
break
else
current_dist = current_dist + next_dist
end
end
elseif path.shape == "ellipse" then
local angle = progress * (math.pi*2)
local x = path.x + math.cos(angle) * path.rx
local y = path.y + math.sin(angle) * path.ry
if self.debug_x and self.debug_y and Kristal.DebugSystem.last_object == self then
x = Utils.ease(self.debug_x, x, Kristal.DebugSystem.release_timer, "outCubic")
y = Utils.ease(self.debug_y, y, Kristal.DebugSystem.release_timer, "outCubic")
if Kristal.DebugSystem.release_timer >= 1 then
self.debug_x = nil
self.debug_y = nil
end
end
self:moveTo(x, y)
end
end
end
function ChaserEnemy:isActive()
return not self.encountered and
not self.world.encountering_enemy and
not self.world:hasCutscene() and
self.world.state ~= "MENU" and
Game.state == "OVERWORLD"
end
function ChaserEnemy:update()
if self:isActive() then
if self.path and self.world.map.paths[self.path] then
local path = self.world.map.paths[self.path]
if self.reverse_progress then
self.progress = self.progress - (self.speed / path.length) * DTMULT
else
self.progress = self.progress + (self.speed / path.length) * DTMULT
end
if path.closed then
self.progress = self.progress % 1
elseif self.progress > 1 or self.progress < 0 then
self.progress = Utils.clamp(self.progress, 0, 1)
self.reverse_progress = not self.reverse_progress
end
self:snapToPath()
end
if self.alert_timer > 0 then
self.alert_timer = Utils.approach(self.alert_timer, 0, DTMULT)
if self.alert_timer == 0 then
self.alert_icon:remove()
self.alert_icon = nil
self.chasing = true
self.noclip = false
self:setAnimation("chasing")
end
elseif self.can_chase and not self.chasing then
if self.world.player then
Object.startCache()
local in_radius = self.world.player:collidesWith(CircleCollider(self.world, self.x, self.y, self.chase_dist))
if in_radius then
local sight = LineCollider(self.world, self.x, self.y, self.world.player.x, self.world.player.y)
if not self.world:checkCollision(sight, true) and not self.world:checkCollision(self.collider, true) then
Assets.stopAndPlaySound("alert")
self.path = nil
self.alert_timer = 20
self.alert_icon = Sprite("effects/alert", self.width/2)
self.alert_icon:setOrigin(0.5, 1)
self.alert_icon.layer = 100
self:addChild(self.alert_icon)
self:setAnimation("alerted")
end
end
Object.endCache()
end
elseif self.chasing then
if self.world.player then
local angle = Utils.angle(self.x, self.y, self.world.player.x, self.world.player.y)
self:move(math.cos(angle), math.sin(angle), self.chase_speed * DTMULT)
end
end
end
super:update(self)
end
return ChaserEnemy
|
local Events = class()
function Events:__constructor ()
self._handlers = {}
end
function Events:once (a, b)
self:on(a, b, true)
end
function Events:on (events, callback, once)
if type(events) ~= 'table' then
events = {events}
end
for _,name in ipairs(events) do
table.insert(
self._handlers,
{
once = once,
name = tonumber(name) or name:lower(),
callback = callback,
}
)
end
end
function Events:emit (name, ...)
name = tonumber(name) or name:lower()
for i = 1, #self._handlers do
local handler = self._handlers[i]
if handler.name == name then
if handler.once then
table.remove(
self._handlers,
i
)
i = i - 1
end
handler.callback(...)
end
end
end
return Events
|
Config = {}
Config.DrawDistance = 100.0
Config.MaxInService = -1
Config.EnablePlayerManagement = true
Config.EnableSocietyOwnedVehicles = false
Config.Locale = 'fr'
Config.Zones = {
WoolFarm = {
Pos = {x = 2310.320, y = 4884.947, z = 40.90},
Size = {x = 4.0, y = 4.0, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Récolte de Laine",
Type = 27
},
TraitementTissu = {
Pos = {x = 716.123, y = -962.466, z = 29.50},
Size = {x = 1.5, y = 1.5, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Traitement du Tissu",
Type = 27
},
TraitementClothe = {
Pos = {x = 711.476, y = -969.388, z = 29.59},
Size = {x = 1.5, y = 1.5, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Couture du Vêtement",
Type = 27
},
SellFarm = {
Pos = {x =-1193.830, y = -766.917, z = 16.59},
Size = {x = 1.5, y = 1.5, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Vente des vêtements",
Type = 27
},
TailerActions = {
Pos = {x = 706.73, y = -960.90, z = 29.59},
Size = {x = 2.0, y = 2.0, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Point d'action",
Type = 27
},
VehicleSpawner = {
Pos = {x = 722.875, y = -978.963, z = 23.50},
Size = {x = 2.0, y = 2.0, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Garage véhicule",
Type = 27
},
VehicleSpawnPoint = {
Pos = {x = 703.42, y = -980.50, z = 23.8},
Size = {x = 2.0, y = 2.0, z = 1.0},
Color = {r = 136, g = 243, b = 216},
Name = "Spawn point",
Type = 27
},
VehicleDeleter = {
Pos = {x = 742.084, y = -970.754, z = 23.80},
Size = {x = 2.0, y = 2.0, z = 1.0},
Color = {r = 255, g = 0, b = 0},
Name = "Ranger son véhicule",
Type = 27
}
}
|
local function setup()
led = 4
trigger = 0 -- D0
echo = 2 -- D2
gpio.mode(trigger, gpio.OUTPUT)
gpio.write(trigger, gpio.LOW)
gpio.mode(echo, gpio.INT)
-- LED off
gpio.mode(led, gpio.OUTPUT)
gpio.write(led, gpio.HIGH)
end
local function startup()
if file.open("init.lua") == nil then
print("init.lua deleted or renamed")
else
local appFile = "szambosensor.lua"
print("Running " .. appFile)
file.close("init.lua")
-- the actual application is stored in 'application.lua'
dofile(appFile)
end
end
print("Booting..")
setup()
tmr.create():alarm(3000, tmr.ALARM_SINGLE, setup)
startup()
|
return {'itu'}
|
local M = {}
M.dbPath = system.pathForFile("gamedata.db3", system.DocumentsDirectory)
--------------------------------------------
-- Game balancing
--------------------------------------------
M.ticksBetweenLaserFire = 12 -- how fast should autofire be
M.scrollRate = 3 -- background scrolling
M.shipAcceleration = 0.3 -- keyboard and tap use this to determine how fast to ramp up horizontal travel
M.maxShipVelocity = 20 -- the fastest the ship can travel left or right
M.energyLossPerTick = 5 -- how fast the ship consumes energy just from flying
M.laserEnergyConsume = 0 -- does firing consume any ship energy
M.maxEnergy = 12000 -- the most energy the ship can hold
M.energyGainPerGem = 1300 -- how much energy is gained by picking up an energy crystal
M.ticksBetweenAsteroidSpawn = 34 -- how many game ticks between asteroids
M.ticksBetweenEnemySpawn = 250 -- the initial enemy spawn rate (it gets faster over time)
M.pointsPerEnemy = 250 -- how many points to score for killing an enemy ship
M.pointsPerAsteroid = 100 -- how many points to score for blowing up an asteroid
M.numBackgroundTracks = 3 -- how many background tracks are in the sounds/background/ folder
--------------------------------------------
-- Other globals
--------------------------------------------
M.finalScore = 0
M.selected = nil
M.keyDown = {}
M.keyDown["left"] = false
M.keyDown["right"] = false
M.keyDown["space"] = false
M.autoFire = false -- autofire mode will be turned on with most control schemes
M.settings = {}
M.settings["debug"] = false
M.settings["games_this_session"] = 1
M.settings["background_track"] = math.random(1, M.numBackgroundTracks)
M.settings["background_autoskip"] = false
M.settings["tiltAngleLeft"] = -4.0
M.settings["tiltAngleRight"] = 4.0
M.logger = function(msg)
if M.settings["debug"] then
print(msg)
end
end
M.logger("system.getinfo platform = " .. system.getInfo("platform") )
M.logger("system.getinfo model = " .. system.getInfo("model") )
local model = system.getInfo("model")
if system.getInfo("environment") == "simulator" then
M.settings["platform"] = "simulator"
M.settings["showotherapps"] = true
M.settings["otherappsurl"] = "http://www.prairiewest.net/applications.php"
else
if string.sub(model,1,2) == "iP" or system.getInfo("targetAppStore") == "apple" or system.getInfo("platform") == "ios" then
-- iPhone, iPod or iPad
M.settings["platform"] = "apple"
M.settings["showotherapps"] = true
M.settings["otherappsurl"] = "itms-apps://itunes.com/apps/prairiewestsoftwareconsulting"
M.settings["iOSAppId"] = ""
elseif model == "WFJWI" or string.sub(model,1,2) == "KF" or string.sub(model,1,6) == "Kindle" or system.getInfo("targetAppStore") == "amazon" then
-- Amazon
M.settings["platform"] = "amazon"
M.settings["showotherapps"] = true
M.settings["otherappsurl"] = "http://www.amazon.com/s/ref=bl_sr_mobile-apps?_encoding=UTF8&field-brandtextbin=Prairie%20West%20Software%20Consulting&node=2350149011"
elseif system.getInfo("platform") == "android" or system.getInfo("targetAppStore") == "google" then
-- Android
M.settings["platform"] = "android"
M.settings["showotherapps"] = true
M.settings["otherappsurl"] = "https://play.google.com/store/apps/developer?id=Prairie+West+Software"
else
M.settings["platform"] = "unknown"
M.settings["showotherapps"] = true
M.settings["otherappsurl"] = "http://www.prairiewest.net/applications.php"
end
end
M.sounds = {}
M.sounds["gameover"] = audio.loadSound("sounds/gameover.mp3")
M.sounds["laser"] = audio.loadSound("sounds/laser.mp3")
M.sounds["explode"] = audio.loadSound("sounds/explode.mp3")
M.sounds["select"] = audio.loadSound("sounds/select.mp3")
M.sounds["collect"] = audio.loadSound("sounds/collect.mp3")
M.sounds["outofenergy"] = audio.loadSound("sounds/outofenergy.mp3")
M.sounds["enemy1"] = audio.loadSound("sounds/enemy1.mp3")
M.sounds["enemy2"] = audio.loadSound("sounds/enemy2.mp3")
M.sounds["enemy3"] = audio.loadSound("sounds/enemy3.mp3")
M.sounds["enemy4"] = audio.loadSound("sounds/enemy4.mp3")
M.sounds["enemylaser"] = audio.loadSound("sounds/enemylaser.mp3")
M.backgroundSound = nil -- the currently playing background audio
audio.reserveChannels(1) --Reserve first channel for sound effects
M.stopAllSounds = function()
local c
for c=2, 32 do
local isChannelActive = audio.isChannelActive( c )
if isChannelActive then
audio.stop( c )
end
end
end
M.setChannelVolumes = function()
if (M.settings["fxvolume"] == nil) then return; end
local c
for c=2, 32 do
audio.setVolume( M.settings["fxvolume"], { channel=c } )
end
audio.setVolume( M.settings["bgvolume"], { channel=1 } )
end
M.playSound = function(soundName)
if M.sounds[soundName .. ""] ~= nil then
timer.performWithDelay(90, function()
audio.play( M.sounds[soundName] )
end)
else
M.logger("No sound found for: " .. soundName)
end
end
M.disposeSounds = function()
for i = 1, 10 do
if audio.isChannelActive( i ) then
audio.stop( i )
end
end
for i, s in pairs(M.sounds) do
audio.dispose( M.sounds[i] ); M.sounds[i] = nil;
end
end
M.playBackgroundTrack = function()
if M.settings["bgvolume"] ~= nil then
M.logger("Starting background track")
if M.backgroundSound == nil then
-- Skip to next track
local c = (M.settings["background_track"] % M.numBackgroundTracks) + 1
M.settings["background_track"] = c
M.backgroundSound = audio.loadStream("sounds/background/" .. c .. ".mp3")
audio.setVolume( M.settings["bgvolume"], { channel=1 } )
if audio.isChannelActive( 1 ) then
audio.stop( 1 )
end
audio.play( M.backgroundSound, { channel=1, loops=0, fadein=2000, onComplete=M.doneBackgroundTrack } )
M.settings["background_autoskip"] = true
end
end
end
M.stopBackgroundTrack = function()
if audio.isChannelActive( 1 ) then
audio.stop( 1 )
end
end
M.doneBackgroundTrack = function(e)
if (M.settings["background_autoskip"]) then
if (e.completed) then
M.backgroundSound = nil
M.playBackgroundTrack()
end
end
end
M.nextBackgroundTrack = function()
M.settings["background_autoskip"] = false
if audio.isChannelActive( 1 ) then
audio.stop( 1 )
end
M.backgroundSound = nil
M.playBackgroundTrack()
end
return M
|
AddCSLuaFile()
properties.Add( "keepupright", {
MenuLabel = "#keepupright",
Order = 900,
MenuIcon = "icon16/arrow_up.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:GetClass() != "prop_physics" ) then return false end
if ( ent:GetNWBool( "IsUpright" ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "keepupright", ent ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ply ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( ent:GetClass() != "prop_physics" ) then return end
if ( ent:GetNWBool( "IsUpright" ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
local Phys = ent:GetPhysicsObjectNum( 0 )
if ( !IsValid( Phys ) ) then return end
local constraint = constraint.Keepupright( ent, Phys:GetAngles(), 0, 999999 )
-- I feel like this is not stable enough
-- This cannot be implemented without a custom constraint.Keepupright function or modification for proper duplicator support.
--print( constraint:GetSaveTable().m_worldGoalAxis )
--constraint:SetSaveValue( "m_localTestAxis", constraint:GetSaveTable().m_worldGoalAxis ) --ent:GetAngles():Up() )
--constraint:SetSaveValue( "m_worldGoalAxis", Vector( 0, 0, 1 ) )
--constraint:SetSaveValue( "m_bDampAllRotation", true )
if ( constraint ) then
ply:AddCleanup( "constraints", constraint )
ent:SetNWBool( "IsUpright", true )
end
end
} )
properties.Add( "keepupright_stop", {
MenuLabel = "#keepupright_stop",
Order = 900,
MenuIcon = "icon16/arrow_rotate_clockwise.png",
Filter = function( self, ent )
if ( !IsValid( ent ) ) then return false end
if ( ent:GetClass() != "prop_physics" ) then return false end
if ( !ent:GetNWBool( "IsUpright" ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ply ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( ent:GetClass() != "prop_physics" ) then return end
if ( !ent:GetNWBool( "IsUpright" ) ) then return end
constraint.RemoveConstraints( ent, "Keepupright" )
ent:SetNWBool( "IsUpright", false )
end
} )
|
---------------------------------------------------------------------------------------------------
-- Proposal:
-- https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0173-Read-Generic-Network-Signal-data.md
--
-- Description: GetPolicyConfigurationData processing with incorrect parameters
-- Precondition:
-- 1. SDL and HMI started
-- Sequence:
-- 1. HMI requests valid SDL.GetPolicyConfigurationData with undefined value in policyType or property
-- a. SDL responds to SDL.GetPolicyConfigurationData with resultCode DATA_NOT_AVAILABLE
-- 2. HMI requests invalid SDL.GetPolicyConfigurationData with incorrect value in policyType or property
-- a. SDL responds to SDL.GetPolicyConfigurationData with resultCode INVALID_DATA
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('/test_scripts/API/GetPolicyConfigurationData/commonGetPolicyConfigurationData')
--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
--[[ Local Variables ]]
local dataReqRes = {
undefinedPolicyType = {
request = { policyType = "undefinedKey", property = "endpoints" },
response = { error = { code = 9 } } -- DATA_NOT_AVAILABLE
},
undefinedProperty = {
request = { policyType = "module_config", property = "undefinedKey" },
response = { error = { code = 9 } } -- DATA_NOT_AVAILABLE
},
incorrectTypePolicyType = {
request = { policyType = true, property = "endpoints" },
response = { error = { code = 11 } } -- INVALID_DATA
},
incorrectTypeProperty = {
request = { policyType = "module_config", property = 5 },
response = { error = { code = 11 } } -- INVALID_DATA
}
}
-- [[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Title("Test")
for caseName, testData in pairs(dataReqRes) do
runner.Step("GetPolicyConfigurationData " .. caseName, common.GetPolicyConfigurationData, { testData })
end
runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
|
package.path = package.path..'../src'
local port = os.getenv('LUAWS_WSTEST_PORT') or 8081
local url = 'ws://localhost:'..port
local client = require'websocket.client'
describe(
'The client module',
function()
local wsc
it(
'exposes the correct interface',
function()
assert.is_same(type(client),'table')
assert.is_same(type(client.new),'function')
assert.is_equal(client.new,client.sync)
end)
it(
'can be constructed',
function()
wsc = client.new()
end)
it(
'can connect (requires external websocket server)',
function()
assert.is_same(type(wsc.connect),'function')
wsc:connect(url,'echo-protocol')
end)
it(
'returns error on non-ws protocol',
function()
local c = client.new()
local ok,err = c:connect('wsc://localhost:'..port,'echo-protocol')
assert.is_falsy(ok)
assert.is_equal(err,'bad protocol')
end)
it(
'forwards socket errors',
function()
local c = client.new()
local ok,err = c:connect('ws://localhost:8189','echo-protocol')
assert.is_falsy(ok)
assert.is_equal(err,'connection refused')
local ok,err = c:connect('ws://notexisting:8089','echo-protocol')
assert.is_falsy(ok)
assert.is_equal(err,'host not found')
end)
it(
'returns error when sending in non-open state (requires external websocket server @port 8081)',
function()
local c = client.new()
local ok,err = c:send('test')
assert.is_falsy(ok)
assert.is_equal(err,'wrong state')
c:connect(url,'echo-protocol')
c:close()
local ok,err = c:send('test')
assert.is_falsy(ok)
assert.is_equal(err,'wrong state')
end)
it(
'returns error when connecting twice (requires external websocket server @port 8081)',
function()
local c = client.new()
local ok,err = c:connect(url,'echo-protocol')
assert.is_truthy(ok)
assert.is_nil(err)
local ok,err = c:connect(url,'echo-protocol')
assert.is_falsy(ok)
assert.is_equal(err,'wrong state')
end)
it(
'can send (requires external websocket server @port 8081)',
function()
assert.is_same(type(wsc.send),'function')
wsc:send('Hello again')
end)
it(
'can receive (requires external websocket server @port 8081)',
function()
assert.is_same(type(wsc.receive),'function')
local echoed = wsc:receive()
assert.is_same(echoed,'Hello again')
end)
local random_text = function(len)
local chars = {}
for i=1,len do
chars[i] = string.char(math.random(33,126))
end
return table.concat(chars)
end
it(
'can send with payload 127 (requires external websocket server @port 8081)',
function()
local text = random_text(127)
wsc:send(text)
local echoed = wsc:receive()
assert.is_same(text,echoed)
end)
it(
'can send with payload 0xffff-1 (requires external websocket server @port 8081)',
function()
local text = random_text(0xffff-1)
assert.is_same(#text,0xffff-1)
wsc:send(text)
local echoed = wsc:receive()
assert.is_same(#text,#echoed)
assert.is_same(text,echoed)
end)
it(
'can send with payload 0xffff+1 (requires external websocket server @port 8081)',
function()
local text = random_text(0xffff+1)
assert.is_same(#text,0xffff+1)
wsc:send(text)
local echoed = wsc:receive()
assert.is_same(#text,#echoed)
assert.is_same(text,echoed)
end)
it(
'can close cleanly (requires external websocket server @port 8081)',
function()
local was_clean,code,reason = wsc:close()
assert.is_true(was_clean)
assert.is_true(code >= 1000)
assert.is_string(reason)
end)
end)
|
return {'edna','ednas'}
|
--Created by the QnEditor,do not modify.If not,you will die very nankan!
local MAP = {
var = {
ImageBack = 1,
closeBtn = 2,
useBtn = 3,
Text_type_des = 4,
describeText = 5,
Button_sub = 6,
Button_add = 7,
Text_num = 8,
Text_money = 9,
Image_money = 10,
iconFrame = 11,
icon = 12,
name = 13,
},
ui = {
[1] = {"ImageBack"},
[2] = {"ImageBack","closeBtn"},
[3] = {"ImageBack","Image_bg2","useBtn"},
[4] = {"ImageBack","Image_bg2","describeFrame","Text_type_des"},
[5] = {"ImageBack","Image_bg2","describeFrame","describeText"},
[6] = {"ImageBack","Image_bg2","Image19","Button_sub"},
[7] = {"ImageBack","Image_bg2","Image19","Button_add"},
[8] = {"ImageBack","Image_bg2","Image19","Text_num"},
[9] = {"ImageBack","Image_bg2","Image23","Text_money"},
[10] = {"ImageBack","Image_bg2","Image23","Image_money"},
[11] = {"ImageBack","Image_bg2","View24","iconFrame"},
[12] = {"ImageBack","Image_bg2","View24","iconFrame","icon"},
[13] = {"ImageBack","Image_bg2","View24","iconFrame","name"},
},
func = {
[1] = "onBindBlankFunc",
[2] = "onCloseBtnClick",
[3] = "onBuyBtnClick",
[6] = "onBindSub",
[7] = "onBindAdd",
},
}
return MAP;
|
return {'zolang','zolder','zolderbalk','zolderbetimmering','zolderdeur','zolderen','zolderetage','zoldergat','zoldering','zolderkamer','zolderkamertje','zolderluik','zolderraam','zolderruimte','zolderschuit','zoldertje','zoldertrap','zoldervenster','zolderverdieping','zoldervloer','zolen','zolderberging','zolderopruiming','zolendraai','zola','zolder','zolderdeuren','zolderetages','zolderingen','zolderkamers','zolderkamertjes','zolderluiken','zolderramen','zolders','zolderschuiten','zoldert','zoldertjes','zoldertrappen','zoldervensters','zolderverdiepingen','zolderbalken','zolderde','zoldergaten','zolderruimtes','zolderruimten','zolas','zolderraampje','zoldervloeren','zoldervenstertje'}
|
AddCSLuaFile()
ENT.WeaponTypes.Mortar = {
Name = "mechassault.weapon.mortar",
Type = "Missile",
Function = "FireMortar",
Cooldown = {1.8, 1.75, 1.58},
Class = {
"ma2_proj_mortar_lvl1",
"ma2_proj_mortar_lvl2",
"ma2_proj_mortar_lvl3"
},
DrawHUD = "DrawMortarHUD",
MaxLevel = 3
}
-- From: https://github.com/TankNut/TankLib/blob/master/lua/tanklib/shared/ballistics.lua
local function solve(origin, target, vel, gravity)
local diff = target - origin
local diff2 = Vector(diff.x, diff.y, 0)
local dist = diff2:Length()
local vel2 = vel * vel
local vel4 = vel * vel * vel * vel
local gx = gravity * dist
local root = vel4 - gravity * (gravity * dist * dist + 2 * diff.z * vel2)
if root < 0 then
return 0
end
root = math.sqrt(root)
local low = math.atan2(vel2 - root, gx)
local high = math.atan2(vel2 + root, gx)
local solutions = (low != high) and 2 or 1
local dir = diff2:GetNormalized()
low = dir * math.cos(low) * vel + Vector(0, 0, 1) * math.sin(low) * vel
high = dir * math.cos(high) * vel + Vector(0, 0, 1) * math.sin(high) * vel
return solutions, low, high
end
function ENT:FireMortar(tbl, level, attachments)
local target = self:GetAimPos()
for _, v in ipairs(attachments) do
local attachment = self:GetAttachment(v)
if SERVER then
local ent = ents.Create(tbl.Class[level])
local solutions, low = solve(attachment.Pos, target, ent.Velocity, -physenv.GetGravity().z * ent.GravityMultiplier)
if solutions != 2 then
return
end
ent:SetPos(attachment.Pos)
ent:SetAngles(low:Angle())
ent:SetOwner(self)
ent.Player = self:GetPlayer()
ent:Spawn()
ent:Activate()
end
end
self:TakeAmmo()
self:SetNextAttack(CurTime() + tbl.Cooldown[level])
if SERVER then
self:AddGestureSequence(self:LookupSequence("fire_mortar"))
end
end
function ENT:DrawMortarHUD(tbl, level, attachments, screen)
local target = self:GetAimPos()
local attachment = self:GetAttachment(attachments[1])
local vel = scripted_ents.GetMember(tbl.Class[level], "Velocity")
local gravity = scripted_ents.GetMember(tbl.Class[level], "GravityMultiplier")
local solutions = solve(attachment.Pos, target, vel, -physenv.GetGravity().z * gravity)
local _, h = surface.GetTextSize(self:GetWeaponString())
surface.SetTextPos(screen.x + 10, screen.y + 10 + h)
if solutions == 2 then
surface.DrawText(language.GetPhrase("mechassault.ui.weapon.range.ok"))
else
surface.DrawText(language.GetPhrase("mechassault.ui.weapon.range.err"))
end
end
|
quest kill_effect begin
state start begin
when kill with npc.is_pc() begin
cmdchat("mattius")
end
end
end
|
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
function onGetFormulaValues(player, level, magicLevel)
return -3, -7
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end
|
require('Utilities');
require('Client');
function Client_PresentMenuUI(rootParent, setMaxSize, setScrollable, game, close)
Game = game; --make it globally accessible
local vert = UI.CreateVerticalLayoutGroup(rootParent);
--List pending proposals. This isn't absolutely necessary since we also alert the player of new proposals, but it's nice to list them here anyway.
for _,proposal in pairs(Mod.PlayerGameData.PendingProposals or {}) do
local otherPlayer = game.Game.Players[proposal.PlayerOne].DisplayName(nil, false);
local row = UI.CreateHorizontalLayoutGroup(vert);
UI.CreateLabel(row).SetText('Proposal from ' .. otherPlayer);
UI.CreateButton(row).SetText('Respond').SetOnClick(function() DoProposalPrompt(game, proposal); close(); end);
end
local alliances = Mod.PublicGameData.Alliances or {};
if (#alliances == 0) then
UI.CreateLabel(vert).SetText("No alliances are currently in effect");
else
--Render all alliances that involve us first
local ourAlliances = filter(alliances, function(alliance) return game.Us ~= nil and (alliance.PlayerOne == game.Us.ID or alliance.PlayerTwo == game.Us.ID) end);
for _,alliance in pairs(ourAlliances) do
local otherPlayerID
if alliance.PlayerOne == game.Us.ID then
otherPlayerID = alliance.PlayerTwo
else
otherPlayerID = alliance.PlayerOne
end
local otherPlayerName = game.Game.Players[otherPlayerID].DisplayName(nil, false);
UI.CreateLabel(vert).SetText('You are allied with ' .. otherPlayerName .. ' until turn ' .. (alliance.ExpiresOnTurn+1));
end
--Render all alliances that don't involve us
for _,alliance in pairs(filter(alliances, function(alliance) return game.Us == nil or (alliance.PlayerOne ~= game.Us.ID and alliance.PlayerTwo ~= game.Us.ID) end)) do
local playerOne = game.Game.Players[alliance.PlayerOne].DisplayName(nil, false);
local playerTwo = game.Game.Players[alliance.PlayerTwo].DisplayName(nil, false);
UI.CreateLabel(vert).SetText(playerOne .. ' and ' .. playerTwo .. ' are allied until turn ' .. (alliance.ExpiresOnTurn+1));
end
end
if (game.Us ~= nil) then --don't show propose button to spectators
UI.CreateButton(vert).SetText("Propose Alliance").SetOnClick(function()
game.CreateDialog(CreateProposeDialog);
end);
end
end
function CreateProposeDialog(rootParent, setMaxSize, setScrollable, game, close)
setMaxSize(390, 300);
TargetPlayerID = nil;
local vert = UI.CreateVerticalLayoutGroup(rootParent);
local row1 = UI.CreateHorizontalLayoutGroup(vert);
UI.CreateLabel(row1).SetText("Propose an alliance with this player: ");
TargetPlayerBtn = UI.CreateButton(row1).SetText("Select player...").SetOnClick(TargetPlayerClicked);
local row2 = UI.CreateHorizontalLayoutGroup(vert);
UI.CreateLabel(row2).SetText("Alliance will last this many turns: ");
local numTurnsSlider = UI.CreateNumberInputField(row2)
.SetSliderMinValue(1)
.SetSliderMaxValue(10)
.SetValue(5);
UI.CreateButton(vert).SetText("Propose Alliance").SetOnClick(function()
if (TargetPlayerID == nil) then
UI.Alert("Please choose a player first");
return;
end
local numTurns = numTurnsSlider.GetValue();
if (numTurns <= 0) then
UI.Alert("Numer of turns must be a positive number");
return;
end
local payload = {};
payload.Message = "Propose";
payload.TargetPlayerID = TargetPlayerID;
payload.NumTurns = numTurns;
Game.SendGameCustomMessage("Proposing alliance...", payload, function(returnValue)
UI.Alert("Proposal sent!");
close(); --Close the propose dialog since we're done with it
end);
end);
end
function TargetPlayerClicked()
local options = map(filter(Game.Game.Players, IsPotentialTarget), PlayerButton);
UI.PromptFromList("Select the player you'd like to propose an alliance with", options);
end
--Determines if the player is one we can propose an alliance to.
function IsPotentialTarget(player)
if (Game.Us.ID == player.ID) then return false end; -- we can never propose an alliance with ourselves.
if (player.State ~= WL.GamePlayerState.Playing) then return false end; --skip players not alive anymore, or that declined the game.
if (Game.Settings.SinglePlayer) then return true end; --in single player, allow proposing with everyone
return not player.IsAI; --In multi-player, never allow proposing with an AI.
end
function PlayerButton(player)
local name = player.DisplayName(nil, false);
local ret = {};
ret["text"] = name;
ret["selected"] = function()
TargetPlayerBtn.SetText(name);
TargetPlayerID = player.ID;
end
return ret;
end
|
---@diagnostic disable: undefined-global
local palette = require 'nord-palette'
local base = require 'base'
-- Vimwiki
-- > vimwiki/vimwiki
local clrs = palette.clrs
local spec = palette.spec
local pkg = function()
return {
-- TODO: Add missing
VimwikiLink {fg = clrs.nord8, gui = spec.underline},
VimwikiHeaderChar {base.Keyword},
VimwikiHR {base.Keyword},
VimwikiList {base.Keyword},
}
end
return pkg
-- vi:nowrap
|
if not debug then
config.set("debug_enable", true)
os.reboot()
end
config.add("http_blacklist", "$private")
if ... == "debugger" then
periphemu.create("left", "debugger")
peripheral.call("left", "break")
end
for _,v in ipairs(fs.list("/")) do if not fs.isReadOnly(v) then fs.delete(v) end end
_G._CCPC_FIRST_RUN = nil
_G._CCPC_UPDATED_VERSION = nil
local logfile = io.open("test-log.txt", "w")
io.output(logfile)
shell.run("/test-rom/mcfly /test-rom/spec")
logfile:close()
os.shutdown(_G.failed_tests)
|
local tcp = require "tcp"
local redis = { protocol = { } }
redis.protocol[43] = function(data) -- '+'
local a, b = data:find("%+%a+\r\n", 1, false)
if a and a == 1 then
return true, data:sub(a+1, b-2), data:sub(b+1)
else
return false, nil, data
end
end
redis.protocol[45] = function(data) -- '-'
local a, b = data:find("%-.+\r\n", 1, false)
if a and a == 1 then
return true, data:sub(a+1, b-2), data:sub(b+1)
else
return false, nil, data
end
end
redis.protocol[58] = function(data) -- ':'
local a, b = data:find(":%d+\r\n", 1, false)
if a and a == 1 then
return true, tonumber(data:sub(a+1, b-2)), data:sub(b+1)
else
return false, nil, data
end
end
redis.protocol[36] = function(data) -- '$'
local a1, b1 = data:find("%$0\r\n\r\n", 1, false)
if a1 and a1 == 1 then
return true, "", data:sub(b1+1)
end
local a2, b2 = data:find("%$%-1\r\n", 1, false)
if a2 and a2 == 1 then
return true, nil, data:sub(b2+1)
end
local len = data:match("%$(%d+)\r\n", 1, false)
if not len then
return false, nil, data
end
local n = tonumber(len)
if string.len(data) < 1 + string.len(len) + 2 + n + 2 then
return false, nil, data
end
local resp = data:sub(1+string.len(len)+2+1, 1+string.len(len)+2+n)
local remain = data:sub(1+string.len(len)+2+n+3)
return true, resp, remain
end
redis.protocol[42] = function(data) -- '*'
local a1, b1 = data:find("%*0\r\n", 1, false)
if a1 and a1 == 1 then
return true, {}, data:sub(b1+1)
end
local a2, b2 = data:find("%*%-1\r\n", 1, false)
if a2 and a2 == 1 then
return true, nil, data:sub(b2+1)
end
local a3, b3 = data:find("%*%d+\r\n", 1, false)
if not a3 then
return false, nil, data
end
local m = data:sub(a3,b3)
local u = m:match("%*(%d+)\r\n")
local n = tonumber(u)
local bulk = {}
local noerr = true
local ok, resp, remain
remain = data:sub(b3+1)
for i=1, n do
if string.len(remain) <= 0 then
noerr = false
break
end
local firstchar = string.byte(remain)
ok, resp, remain = redis.protocol[firstchar](remain)
if ok then
bulk[i] = resp
else
noerr = false
break
end
end
if noerr then
return true, bulk, remain
else
return false, nil, data
end
end
function redis.pack(...)
local param = {...}
local cmd = "*" .. tostring(#param) .. "\r\n"
for i, value in ipairs(param) do
local s = tostring(value)
cmd = cmd .. "$" .. string.len(s) .. "\r\n" .. s .. "\r\n"
end
return cmd
end
function redis.unpack(cache)
assert(string.len(cache) > 0)
local firstchar = string.byte(cache)
local ok, resp, remain = redis.protocol[firstchar](cache)
if ok then
return true, resp, remain
else
return false, nil, cache
end
end
local _M = setmetatable({ _VERSION = '5.34' }, { __index = function(t, k)
local cmd = string.upper(k)
local f = function(self, ...)
assert(not self.pubsub, "unable to use this command reason: in subscribe")
local req = redis.pack(cmd, ...)
tcp.write(self.conn, req)
while true do
local msg = tcp.read(self.conn)
--print("msg\n", msg)
if #msg == 0 then
return nil, "redis connection reset by peer"
end
self.cache = self.cache .. msg
local ok, resp, remain = redis.unpack(self.cache)
if ok then
self.cache = remain
return resp
end
end
end
t[k] = f
return f
end})
function redis.connect(opts)
local self = setmetatable({}, { __index = _M })
local ip = opts.ip or opts.host
local port = opts.port or 6379
local conn, addr = tcp.connect({ip=ip, port=port})
assert(conn>0)
tcp.start(conn, {active=false, keepalive=true, nodelay=true})
self.topic = { }
self.conn = conn
self.addr = addr
self.cache = ""
self.pubsub = false
self.active = false
return self
end
function _M.id(self)
return self.conn
end
function _M.opts(self, tab)
if tab.active ~= nil then
assert(type(tab.active) == "boolean")
tcp.setopts(self.conn, {active=tab.active})
self.active = tab.active
end
end
function _M.pack(...)
return redis.pack(...)
end
function _M.unpack(self, msg)
self.cache = self.cache .. msg
local ok, resp, remain = redis.unpack(self.cache)
if ok then
self.cache = remain
return table.unpack(resp)
else
return nil
end
end
function _M.close(self)
tcp.close(self.conn)
self.topic = nil
self.conn = nil
self.addr = nil
self.cache = nil
self.pubsub = nil
setmetatable(self, nil)
end
function _M.pipeline(self, ...)
assert(not self.pubsub, "unable to use this command reason: in subscribe")
local cmds = ""
local nums = 0
for i, v in pairs({...}) do
assert(type(v) == "table")
cmds = cmds .. redis.pack(table.unpack(v))
nums = nums + 1
end
tcp.write(self.conn, cmds)
local result = { }
local i = 0
while i < nums do
local msg = tcp.read(self.conn)
if #msg == 0 then
return nil, "redis connection reset by peer"
end
self.cache = self.cache .. msg
while true do
local ok, resp, remain = redis.unpack(self.cache)
if ok then
self.cache = remain
table.insert(result, resp)
i = i + 1
end
if not ok or #remain == 0 then
break
end
end
end
return result
end
function _M.subscribe(self, topic)
assert(type(topic) == "string")
self.topic[topic] = true
self.pubsub = false
tcp.setopts(self.conn, {active=false})
local sub = ""
if topic:match("([%?%*]+)") then
sub = "psubscribe"
else
sub = "subscribe"
end
local meta = getmetatable(_M)
local func = meta.__index({}, sub)
local resp = func(self, topic)
self.pubsub = true
tcp.setopts(self.conn, {active=self.active})
return resp
end
function _M.unsubscribe(self, topic)
assert(type(topic) == "string")
assert(self.pubsub, "it's no in subscribe")
self.pubsub = false
tcp.setopts(self.conn, {active=false})
local sub = ""
if topic:match("([%?%*]+)") then
sub = "punsubscribe"
else
sub = "unsubscribe"
end
local meta = getmetatable(_M)
local func = meta.__index({}, sub)
local resp = func(self, topic)
self.topic[topic] = nil
if next(self.topic) then
self.pubsub = true
else
self.pubsub = false
end
tcp.setopts(self.conn, {active=self.active})
return resp
end
return redis
|
----
-- Utility - Utility functions for xlsxwriter.lua.
--
-- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org
--
require "xlsxwriter.strict"
local Utility = {}
local char_A = string.byte("A")
local col_names = {}
local named_colors = {
["black"] = "#000000",
["blue"] = "#0000FF",
["brown"] = "#800000",
["cyan"] = "#00FFFF",
["gray"] = "#808080",
["green"] = "#008000",
["lime"] = "#00FF00",
["magenta"] = "#FF00FF",
["navy"] = "#000080",
["orange"] = "#FF6600",
["pink"] = "#FF00FF",
["purple"] = "#800080",
["red"] = "#FF0000",
["silver"] = "#C0C0C0",
["white"] = "#FFFFFF",
["yellow"] = "#FFFF00",
}
----
-- Convert a zero indexed column cell reference to an Excel column string.
--
function Utility.col_to_name_abs(col_num, col_abs)
local col_str = col_names[col_num]
local col_num_orig = col_num
if not col_str then
col_str = ""
col_num = col_num + 1
while col_num > 0 do
-- Set remainder from 1 .. 26
local remainder = col_num % 26
if remainder == 0 then remainder = 26 end
-- Convert the remainder to a character.
local col_letter = string.char(char_A + remainder - 1)
-- Accumulate the column letters, right to left.
col_str = col_letter .. col_str
-- Get the next order of magnitude.
col_num = math.floor((col_num - 1) / 26)
end
col_names[col_num_orig] = col_str
end
if col_abs then col_str = '$' .. col_str end
return col_str
end
----
-- Convert a zero indexed row and column cell reference to a A1 style string.
--
function Utility.rowcol_to_cell(row, col)
row = math.modf(row + 1)
col = math.modf(col)
local col_str = Utility.col_to_name_abs(col, false)
return col_str .. row
end
----
-- Convert a zero indexed row and column cell reference to a A1 style string
-- with Excel absolute indexing.
--
function Utility.rowcol_to_cell_abs(row, col, row_abs, col_abs)
row = math.modf(row + 1)
col = math.modf(col)
row_abs = row_abs and "$" or ""
local col_str = Utility.col_to_name_abs(col, col_abs)
return col_str .. row_abs .. row
end
----
-- Convert a cell reference in A1 notation to a zero indexed row, column.
--
function Utility.cell_to_rowcol(cell)
local col_str, row = cell:match("$?(%u+)$?(%d+)")
-- Convert base26 column string to number.
local expn = 0
local col = 0
for i = #col_str, 1, -1 do
local char = col_str:sub(i, i)
col = col + (string.byte(char) - char_A + 1) * (26 ^ expn)
expn = expn + 1
end
-- Convert 1-index to zero-index
row = math.modf(row - 1)
col = math.modf(col - 1)
return row, col
end
----
-- Convert zero indexed row and col cell refs to a A1:B1 style range string.
--
function Utility.range(first_row, first_col, last_row, last_col)
local range1 = Utility.rowcol_to_cell(first_row, first_col)
local range2 = Utility.rowcol_to_cell(last_row, last_col )
return range1 .. ":" .. range2
end
----
-- Convert zero indexed row and col cell refs to absolute A1:B1 range string.
--
function Utility.range_abs(first_row, first_col, last_row, last_col)
local range1 = Utility.rowcol_to_cell_abs(first_row, first_col, true, true)
local range2 = Utility.rowcol_to_cell_abs(last_row, last_col, true, true)
return range1 .. ":" .. range2
end
----
-- Generator for returning table items in sorted order. From PIL 3rd Ed.
--
function Utility.sorted_pairs(sort_table, sort_function)
local array = {}
for n in pairs(sort_table) do array[#array + 1] = n end
table.sort(array, sort_function)
local i = 0
return function ()
i = i + 1
return array[i], sort_table[array[i]]
end
end
----
-- Generator for returning table keys in sorted order.
--
function Utility.sorted_keys(sort_table, sort_function)
local array = {}
for n in pairs(sort_table) do array[#array + 1] = n end
table.sort(array, sort_function)
local i = 0
return function ()
i = i + 1
return array[i]
end
end
----
-- Print a non-fatal warning at the highest/calling program stack level.
--
function Utility.warn(...)
local level = 0
local info
-- Find the last highest stack level.
for i = 1, math.huge do
info = debug.getinfo(i, "Sl")
if not info then break end
level = level + 1
end
-- Print warning to stderr at the calling program stack level.
info = debug.getinfo(level -1, "Sl")
io.stderr:write(string.format("Warning:\n\t%s:%d: ",
info.short_src,
info.currentline))
io.stderr:write(string.format(...))
end
----
-- Convert a Html #RGB or named colour into an Excel ARGB formatted
-- color. Used in conjunction with various xxx_color() methods.
--
function Utility.excel_color(color)
local rgb = color
-- Convert named colours.
if named_colors[color] then rgb = named_colors[color] end
-- Extract the RBG part of the color.
rgb = rgb:match("^#(%x%x%x%x%x%x)$")
if rgb then
-- Convert the RGB colour to the Excel ARGB format.
return "FF" .. rgb:upper()
else
Utility.warn("Color '%s' is not a valid Excel color.\n", color)
return "FF000000" -- Return Black as a default on error.
end
end
----
-- The function takes an os.time style date table and converts it to a decimal
-- number representing a valid Excel date.
--
-- Dates and times in Excel are represented by real numbers. The integer part of
-- the number stores the number of days since the epoch and the fractional part
-- stores the percentage of the day in seconds. The epoch can be either 1900 or
-- 1904.
--
function Utility.convert_date_time(date_time, date_1904)
local year = date_time["year"]
local month = date_time["month"]
local day = date_time["day"]
local hour = date_time["hour"] or 0
local min = date_time["min"] or 0
local sec = date_time["sec"] or 0
-- For times without dates set the default date for the epoch
if not year then
if not date_1904 then
year = 1899; month = 12; day = 31
else
year = 1904; month = 1; day = 1
end
end
-- Converte the Excel seconds to a fraction of the seconds in 24 hours.
local seconds = (hour * 60 * 60 + min * 60 + sec) / (24 * 60 * 60)
-- Special cases for Excel dates.
if not date_1904 then
-- Excel 1900 epoch.
if year == 1899 and month == 12 and day == 31 then return seconds end
if year == 1900 and month == 1 and day == 0 then return seconds end
-- Excel false leapday
if year == 1900 and month == 2 and day == 29 then return 60 + seconds end
end
-- We calculate the date by calculating the number of days since the epoch
-- and adjust for the number of leap days. We calculate the number of leap
-- days by normalising the year in relation to the epoch. Thus the year 2000
-- becomes 100 for 4-year and 100-year leapdays and 400 for 400-year leapdays.
--
local epoch = date_1904 and 1904 or 1900
local offset = date_1904 and 4 or 0
local norm = 300
local range = year - epoch
-- Set month days and check for leap year.
local mdays = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
local leap = 0
if year % 4 == 0 and year % 100 > 0 or year % 400 == 0 then
leap = 1
mdays[2] = 29
end
-- Some boundary checks
if year < epoch or year > 9999 then return nil end
if month < 1 or month > 12 then return nil end
if day < 1 or day > mdays[month] then return nil end
-- Accumulate the number of days since the epoch.
local days = day -- Add days for current month
for i = 1, month -1 do
-- Add days for past months.
days = days + mdays[i]
end
days = days + range * 365 -- Past year days.
days = days + math.floor((range ) / 4) -- 4 yr leapdays.
days = days - math.floor((range + offset ) / 100) -- 100 yr leapdays.
days = days + math.floor((range + offset + norm) / 400) -- 400 yr leapdays.
days = days - leap -- Already counted.
-- Adjust for Excel erroneously treating 1900 as a leap year.
if not date_1904 and days > 59 then days = days + 1 end
return days + seconds
end
----
-- The function takes a date and time in ISO8601 "yyyy-mm-ddThh:mm:ss.ss" format
-- and converts it to a decimal number representing a valid Excel date.
--
-- See convert_date_time() funciton above.
--
function Utility.convert_date_string(date_str, date_1904)
local date_time = {}
-- Check for invalid date char.
if string.match(date_str, "[^0-9T:%-%.Z]") then return nil end
-- Strip trailing Z in ISO8601 date.
date_str = date_str:gsub("Z", "")
-- Get the date and time parts of the date string.
local date = ""
local time = ""
if string.match(date_str, "T") then
date, time = string.match(date_str, "(.*)T(.*)")
elseif string.match(date_str, "^%d%d%d%d%-%d%d%-%d%d$") then
date = date_str
elseif string.match(date_str, "^%d%d:%d%d:%d%d") then
time = date_str
else
return nil
end
if time ~= '' then
-- Match times like hh:mm:ss.sss.
local hour, min, sec = string.match(time, "^(%d%d):(%d%d):(.*)$")
date_time["hour"] = tonumber(hour)
date_time["min"] = tonumber(min)
date_time["sec"] = tonumber(sec)
end
if date ~= '' then
-- Match date as yyyy-mm-dd.
local year, month, day = string.match(date, "^(%d%d%d%d)-(%d%d)-(%d%d)$")
date_time["year"] = tonumber(year)
date_time["month"] = tonumber(month)
date_time["day"] = tonumber(day)
end
return Utility.convert_date_time(date_time, date_1904)
end
return Utility
|
--[[
Write a function reduce(max, init, f) that calls a function f() over the integers
from 1 to max like so:
function add(previous, next)
return previous + next
end
reduce(5, 0, add) -- add the numbers from 1 to 5
-- We want reduce() to call add() 5 times with each intermediate
-- result, and return the final value of 15:
--
add( 0, 1) --> returns 1; feed this into the next call
add( 1, 2) --> returns 3
add( 3, 3) --> returns 6
add( 6, 2) --> returns 10
add(10, 2) --> returns 15
]]
local function reduce(max, value, f)
for i = 1, max do
value = f(value, i)
end
return value
end
local function add(previous, next)
return previous + next
end
print(reduce(5, 0, add))
--[[
Implement factorial() in terms of reduce().
]]
local function factorial(n)
return reduce(n, 1, function(acc, i)
return acc * i
end)
end
print(factorial(5))
|
function onInit()
Debug.console("manager_character: onInit")
Core.classRegister('character..[^.]+', objectCast)
Core.dragInfoRegister('character..[^.]+', dragInfoGet)
Core.windowRegister('editor', 'character..[^.]+', 'character_sheet')
end
function dragInfoGet(db_ref, button, x, y, drag_info)
--Debug.console('elementDrag', button, x, y, drag_info)
name = DB.getValue(db_ref .. '.name')
drag_info.setShortcutData(Core.windowFind('editor', db_ref), db_ref)
drag_info.setDescription('Character: ' .. name)
drag_info.setType('shortcut')
return true
end
function objectCast(db_node, cast_to)
if Combat.k_interface_combat_actor then
return {
db_node = db_node,
nameGet = nameGet,
initiativeGet = initiativeGet,
initiativeUsedGet = initiativeUsedGet,
initiativeUsedSet = initiativeUsedSet,
staminaGet = staminaGet,
staminaUsedGet = staminaUsedGet,
staminaUsedSet = staminaUsedSet,
}
end
end
--k_interface_combat_actor = 'CombatActor'
-- :nameGet()
function nameGet(self)
return DB.getValue(self.db_node,'name')
end
-- :initiativeGet()
function initiativeGet(self)
return 2
end
-- :initiativeUsedGet()
function initiativeUsedGet(self)
used = DB.getValue(self.db_node,'initiative_used')
if used then
return used
else
return 0
end
end
-- :initiativeUsedSet()
function initiativeUsedSet(self, v)
return DB.setValue(self.db_node, 'initiative_used', 'number', v)
end
-- :staminaGet()
function staminaGet(self)
return DB.getValue(self.db_node,'stamina')
end
-- :staminaUsedGet()
function staminaUsedGet(self)
used = DB.getValue(self.db_node,'stamina_used')
if used then
return used
else
return 0
end
end
-- :staminaUsedSet()
function staminaUsedSet(self, v)
return DB.setValue(self.db_node, 'stamina_used', 'number', v)
end
|
--- A module demonstrating deprecated terms.
-- @module deprecation
-- @deprecated Don't use this
return {
a = 1, --- @deprecated
b = 2, --- @deprecated Please don't use this!
}
|
local get_hex = require("cokeline.utils").get_hex
local is_picking_focus = require("cokeline.mappings").is_picking_focus
local is_picking_close = require("cokeline.mappings").is_picking_close
local buffer_ignore_types = { "terminal", "quickfix" }
local colors = require("themer.modules.core.api").get_cp(SCHEME)
local active_fg = colors.blue
local active_bg = get_hex("Normal", "bg")
local inactive_fg = get_hex("DevIconSh", "fg")
local inactive_bg = get_hex("TabLineFill", "bg")
local modified_fg = colors.red
local switch_fg = colors.green
--- Create a padding component
--- @param n string amount of padding (default 1)
--- @return table component
local function padding(n)
return { text = string.rep(" ", n or 1) }
end
-- Poor man's superscript converter
local function superscript(n)
local superscripts = { "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹", "⁰" }
return superscripts[(n % 10)]
end
require("cokeline").setup({
show_if_buffers_are_at_least = 1,
buffers = {
filter_visible = function(buffer)
return not vim.tbl_contains(buffer_ignore_types, buffer.type)
end,
new_buffers_position = "next",
},
mappings = {
cycle_prev_next = true,
},
rendering = {
max_buffer_width = 24,
},
sidebar = {
filetype = "neo-tree",
components = {
{
text = " Neo-Tree",
hl = {
fg = active_fg,
bg = active_bg,
style = "bold",
},
},
},
},
default_hl = {
fg = function(buffer)
return buffer.is_focused and active_fg or inactive_fg
end,
bg = function(buffer)
return buffer.is_focused and active_bg or inactive_bg
end,
style = function(buffer)
return buffer.is_focused and "bold" or nil
end,
},
components = {
padding(2),
{
text = function(buffer)
return buffer.unique_prefix
end,
},
{
text = function(buffer)
return buffer.filename
end,
truncation = {
priority = 10,
direcion = "left",
},
},
padding(),
{
text = function(buffer)
return (is_picking_focus() or is_picking_close()) and (buffer.pick_letter .. ":") or (superscript(
buffer.index
))
end,
fg = function()
return is_picking_close() and modified_fg or (is_picking_focus() and switch_fg or nil)
end,
},
padding(),
{
text = function(buffer)
return buffer.is_modified and "" or ""
end,
delete_buffer_on_left_click = true,
fg = function(buffer)
return buffer.is_modified and modified_fg or nil
end,
},
padding(2),
},
})
local map = vim.keymap.set
local opts = { silent = true }
map("n", "<Tab>", "<Plug>(cokeline-focus-next)", opts)
map("n", "<S-Tab>", "<Plug>(cokeline-focus-prev)", opts)
map("n", "<M-Left>", "<Plug>(cokeline-switch-prev)", opts)
map("n", "<M-Right>", "<Plug>(cokeline-switch-next)", opts)
map("n", "<Leader>bf", "<Plug>(cokeline-pick-focus)", opts)
map("n", "<Leader>bc", "<Plug>(cokeline-pick-close)", opts)
|
-- // Variables
local PromiseLibary = { Name = "Promise" }
local PromiseObject = { Name = "Promise" } PromiseObject.__index = PromiseObject
PromiseLibary.Rejected = newproxy()
PromiseLibary.Resolved = newproxy()
-- // Promise Methods
function PromiseObject:GetResult()
return (self.HasResult and table.unpack(self.Result)) or self.Result
end
function PromiseObject:Finally(Method)
if self.Status and self.Status == PromiseLibary.Resolved then
task.spawn(Method, self:GetResult())
end
self.Internal.Finally = Method
return self
end
function PromiseObject:Catch(Method)
if self.Status and self.Status == PromiseLibary.Rejected then
task.spawn(Method, self, self:GetResult())
end
self.Internal.Catch = Method
return self
end
function PromiseObject:Then(Method)
if self.Status and self.Status == PromiseLibary.Resolved then
task.spawn(Method, self:GetResult())
end
self.Internal.Then[#self.Internal.Then + 1] = Method
return self
end
function PromiseObject:Retry()
self.Status = nil
self.Internal.Thread = coroutine.create(self.Internal.Routine)
self.Success, self.Internal.Result = coroutine.resume(self.Internal.Thread, self, table.unpack(self.Internal.Args))
if not self.HasResult then
PromiseLibary.Result = self.Internal.Result
self.Internal.Result = nil
end
if not self.Success then
error(("Promise Thread Failed: %s\n%s"):format(debug.info(self.Internal.__, "n"), debug.info(self.Internal.Thread)), math.huge)
end
end
function PromiseObject:Cancel()
self.Cancelled = true
end
function PromiseObject:Await()
if self.Status then
return self.Status == PromiseLibary.Resolved, self:GetResult()
else
self.Internal.Await[#self.Internal.Await + 1] = coroutine.running()
return coroutine.yield()
end
end
function PromiseObject:AwaitSuccess()
if self.Status == PromiseLibary.Resolved then
return self:GetResult()
else
self.Internal.Await[#self.Internal.Await + 1] = coroutine.running()
local Success, Result = coroutine.yield()
if Success then
return Result
else
task.wait(.5)
return self:AwaitSuccess()
end
end
end
function PromiseObject:Resolve(...)
if self.Status then return end
self.Status = PromiseLibary.Resolved
if select("#", ...) > 0 then self.HasResult = true self.Result = { ... } end
for _, Method in ipairs(self.Internal.Then) do
task.spawn(Method, ...)
if self.Cancelled then
self.Cancelled = nil
break
end
end
for _, Routine in ipairs(self.Internal.Await) do
local Success, Result = coroutine.resume(Routine, true, ...)
if not Success then
return error(Result, math.huge)
end
end
if self.Internal.Finally then
task.spawn(self.Internal.Finally, ...)
end
self.Internal.Await = { }
end
function PromiseObject:Reject(...)
if self.Status then return end
self.Status = PromiseLibary.Rejected
if select("#", ...) > 0 then self.HasResult = true self.Result = { ... } end
for _, Routine in ipairs(self.Internal.Await) do
local Success, Result = coroutine.resume(Routine, false, ...)
if not Success then
return error(Result, math.huge)
end
end
self.Internal.Await = { }
if self.Internal.Catch then
task.spawn(self.Internal.Catch, self, ...)
else
warn(("Unhandled Promise Rejection: %s\n%s"):format(self:GetResult() or "???", debug.traceback(self.Internal.Thread)))
end
end
-- // Libary Methods
function PromiseLibary.new(Routine, ...)
local PromiseObject = setmetatable({ }, PromiseObject)
PromiseObject.Internal = { Thread = coroutine.create(Routine); Routine = Routine; Await = { }; Then = { }; Args = { ... } }
PromiseObject.Success, PromiseObject.Internal.Result = coroutine.resume(PromiseObject.Internal.Thread, PromiseObject, ...)
if not PromiseObject.Success then
error(("Promise Thread Failed: %s"):format(PromiseObject.Internal.Result), math.huge)
end
if not PromiseObject.HasResult then
PromiseLibary.Result = PromiseObject.Internal.Result
PromiseObject.Internal.Result = nil
end
return PromiseLibary.Infinity.Proxy:FromTable(PromiseObject)
end
function PromiseLibary:Wrap(Method, ...)
return self.new(function(Promise, ...)
local Results = table.pack(pcall(Method, ...))
local Success = table.remove(Results, 1)
return Success and Promise:Resolve(table.unpack(Results)) or Promise:Reject(table.unpack(Results))
end, ...)
end
function PromiseLibary:IsPromise(Object)
return getmetatable(Object) == PromiseObject
end
function PromiseLibary:UntilSettled(Objects)
for _, Value in ipairs(Objects) do Value:Await() end
end
function PromiseLibary:Any(Objects)
while true do
for _, Promise in ipairs(Objects) do
if Promise.Status then
return Promise
end
end
task.wait()
end
end
function PromiseLibary:Race(Objects)
while true do
for _, Promise in ipairs(Objects) do
if Promise.Status == PromiseLibary.Resolved then
return Promise
end
end
task.wait()
end
end
-- // Initialization
return function(Infinity)
PromiseLibary.Infinity = Infinity
return PromiseLibary
end
|
--[[
Variables
]]
Races = {}
PendingRaces = {}
ActiveRaces = {}
FinishedRaces = {}
--[[
Functions
]]
function formatRace(race)
local id = tostring(race.id)
local checkpoints = race.checkpoints
if type(checkpoints) == "string" then
checkpoints = json.decode(checkpoints)
end
local index = 0
local start = {}
if race.type == "Lap" then
index = #checkpoints
start = checkpoints[index]
else
index = 1
start = checkpoints[index]
end
Races[id] = {
id = id,
name = race.name,
creator = race.creator,
distance = race.distance,
type = race.type,
thumbnail = race.thumbnail,
start = start,
checkpoints = checkpoints,
fastest_time = race.fastest_time,
fastest_name = race.fastest_name,
races = race.races,
}
end
--[[
RPCs
]]
RPC.register("caue-racing:getAllRaces", function(src)
local allRaces = {
races = Races,
pendingRaces = PendingRaces,
activeRaces = ActiveRaces,
finishedRaces = FinishedRaces,
}
return allRaces
end)
--[[
Threads
]]
Citizen.CreateThread(function()
local races = MySQL.query.await([[
SELECT *
FROM racing_races
]])
for i, v in ipairs(races) do
formatRace(v)
end
end)
|
package.path='../src/?.lua;'.. package.path
local l=require "lib"
math.randomseed(1)
assert(20 == l.any({10,20,30}),"any")
assert("cc" == l.split("aa, bb,cc")[3],"split")
local x={1,{3,{4,5}}}
local y=l.copy(x)
x[2][2][2]=10
assert(10 ~= y[2][2][2],"copy")
for k,v in l.order({cc=1,bb=2,aa=3}) do
assert("aa"==k,"sort keys")
break end
l.rogues()
|
return {
id = "WorldG012",
events = {
{
alpha = 0,
code = {
"playStory1"
},
stories = {
"WG005B"
}
}
}
}
|
_5OQEm1BlOJgJlXtl, Protected_by_MoonSecV2, Discord = 'discord.gg/gQEH2uZxUk'
,nil,nil;(function() _msec=(function(_,__,_l)local _ll__l=__["ڪڝټټآټئقؠآحنس"];local __l__l=_l[_[(1380-0x2c8)]][_["ڝڪزئټضجددآ"]];local ____l=(129-0x7d)/((2163/(228+(-0x6a+-19)))+-#'Jeff Bezos approved')local _ll_l=((0xa0-(17248/0x9a))-46)-(0x63+-98)local ___lll=_l[_[(-#"im a nigger"+((30438/0x59)-184))]][_["دزضزؠټحؠؠحڪقټئ"]];local _lll_=((-#"Jeff Bezos approved"+(0x1722/(147-(-0x11+117))))+-106)+(-0x2e+48)local _llll=_l[_[(-#[[give access to functions for boosters]]+(91020/0x94))]][_["ڝجټضټئؠنټس"]]local _ll=(99+-0x61)-(0x56-(13600/((0x1d5-263)+-#[[This is my kingdom cum, this is my kingdom cum]])))local _l_ll=(8+-#{(function()return{','}end)();(function()return{','}end)(),14,(function()return('B1ACHi'):find("\65")end)();(function()return{','}end)();kernel32dII,kernel32dII})local ____=((0x1f74/(((50552+-0x2f)/91)-311))+-#[[heres a hint: repeat until nil]])local _l__l=(((-#[[i know what sex is, but i wont tell you]]+((476+-#{1;'}',nil;(function()return('RiMI88'):find("\10")end)()})-0xfd))-0x73)+-64)local __lll=(-#{(function()return('A1oM0N'):find("\111")end)();(function()return{','}end)();(function()return('A1oM0N'):find("\111")end)();{};kernel32dII}+7)local _ll_=(-#"deobfuscation in progress"+(((((0x6544918/68)+-#"int 21h on top")/0xe7)-0xd48)/120))local __ll=(((-#{(function()return{','}end)(),1,nil,(function(_)return _ end)(),nil;(function()return('oOBIAM'):find("\15")end)()}+114)+-99)+-#'child porn')local __l_=(-0x24+(115-(((18669-0x24b5)+-#'perth vs memcorrupt boxing match')/120)))local _l__=(-0x59+((42063-(-23+0x5249))/0xe7))local ___ll=((138+-#{'}';(function()return('Ei1IER'):find("\49")end)(),(function()return('O8iMBE'):find("\12")end)(),(function(_)return _ end)()})/0x44)local _l_l=(5+-#{85,(function()return('0oo81A'):find("\111")end)(),4;nil,nil;kernel32dII})local _lll=((0x48-(0xee-(-#'Perths Scripting Shit'+(((0x47e0-9262)+-#"heres a hint: repeat until nil")/46))))+-#"Fake news")local __l_l=(4+-#{(function()return{','}end)();'nil',kernel32dII;kernel32dII})local _l_l_=(-#{126,126;126;{};kernel32dII}+8)local __ll_=(-#"PSU Deobfuscation Speedrun AnyPrecent WR"+((-#{76,(function()return{','}end)(),(function(_)return _ end)();(function(_)return _ end)()}+9330)/212))local ___l_=(-#[[deobfuscation in progress]]+((((-89+(-36+0x26c))-0x121)+-#[[federal is an asshole]])-0x9c))local __l__=((0x6158/(-#'How did adam and eve populate?'+((-#{'}','}';kernel32dII;kernel32dII}+19554)/0x5e)))/35)local _ll__=((74+-#{(function()return('ROCI0M'):find("\67")end)(),(function()return{','}end)();(function()return{','}end)();'nil';(function(_)return _ end)(),(function()return('0RBRBi'):find("\3")end)();(function(_)return _ end)()})-66)local _l___=(0x1e-(0x1296/((0x23e-((0x5980/64)+-#'while true do end'))+-#"im giving 50k to the one who solves this challenge")))local _lll_l=_[(2831-0x5b8)];local _l_l_l=_l[_[(0x102+-111)]][_["زڪحزټئحؠحدؠض"]];local ___l_l=_l[(function(_)return type(_):sub(1,1)..'\101\116'end)('ڝجقټؠنضد')..'\109\101'..('\116\97'or'ضټقزضقټض').._[(78608/0x88)]];local __l_ll=_l[_[(-#[[real]]+(0x4ad-(1350-0x2df)))]][_["ڪئسسنآسڪټجقئدئ"]];local __llll=((-0x6f+120)+-#[[im gay?]])-((((-0x640ac/134)+-#'Wocky Slush')/0x63)+0x21)local _lllll=(0x1c+(-17+(63-0x48)))-((107-0x59)+-#[[bite this onions]])local ____ll=_l[_[(19551/0x85)]][_["آئئحڝڪؠسآنؠڪكزټآئ"]];local __l=function(_l,_)return _l.._ end local _l_lll=(-#"sussy fortnite balls"+(4704/0xc4))*(102-(-#[[Yeah this is getting cringe-]]+((-#[[im giving 50k to the one who solves this challenge]]+(0x3a6-(-48+0x22d)))-249)))local __ll_l=_l[_["ڪنززڪڝزئضسؠق"]];local ___=(-#'certified hood classif'+(-76+0x64))*(2048/(0x92-(17160/0x84)))local _ll_ll=(1146+-0x7a)*((-0x5c+((0x17f-(0xce80/236))+-#"free moonsec anywhere you go!"))+-#"did you solve the lua challenge yet?")local _l___l=(0x28a0/(0x1e3-(-#[[happy birdday wally]]+(641-0x153))))local _____=(-24+((120-((0x4fc/11)+-#'One day ill make the onions cry'))+-#[[deez nuts]]))*(0x65-99)local ___l=_l[_["ؠڝدجحققڪحنڪ"]]or _l[_[(-0x16+600)]][_["ؠڝدجحققڪحنڪ"]];local _l_=(((-#"stOP READING MY CODE!"+(0x1f-62))+-0x9)+317)local _=_l[_["كڪضئڪجنحقنټحق"]];local _l__ll=(function(_l_)local ___,__=2,0x10 local _l={j={},v={}}local __l=-_ll local _=__+_ll_l while true do _l[_l_:sub(_,(function()_=___+_ return _-_ll_l end)())]=(function()__l=__l+_ll return __l end)()if __l==(_l_lll-_ll)then __l=""__=__llll break end end local __l=#_l_ while _<__l+_ll_l do _l.v[__]=_l_:sub(_,(function()_=___+_ return _-_ll_l end)())__=__+_ll if __%____l==__llll then __=_lllll __l_ll(_l.j,(____ll((_l[_l.v[_lllll]]*_l_lll)+_l[_l.v[_ll]])))end end return _llll(_l.j)end)("..:::MoonSec::..دحجئضسزقكنؠآټڪڝټضزټڝكقؠدټنڝئحټجسضڝزقكدؠنټجڝټدزكڝضقزدكقئضآڝسدڝجڝضقڪڪنقآئدؠقجسڪسقدؠجكآؠضټجحڪكزئدزكقحآآڝضحڝدضننټجضآزضكجحڪحقجڝئكقجزآټضحټڪزحكضجدآجضضڪززكقؠټڪسڝؠكضقڪضززكڪڪززڪقضزآدحزټككحؠؠټنجننؠجنزججڪدضجټڝزدجزضزڝؠكدڪزضئنكڝحضؠزئكحئټؠزضقڪدنكنجڪټټزجڝئكجڝنئضټزسكڝؠقټدڝڪققجننسټڝكقؠدټؠحڪكڝضسؠټئجآټؠججڝټدسجآآسنكڪڪدقؠڝڝققضدزنكقڪحئنحدڪكضټنآجكآؠضټئحآآجڪنڪدكآدسدڪټزڝددقزجزؠزڝؠجقضندججآضضزڪكزؠئڝټڝزنآڪضضڪززكضححنجئؠؠئڪڪجسټټكححټكقڪجزضزككحؠؠټقئحدؠآؠكزحكؠؠؠسئڝټحسآزكنؠدضجټټسڝدڪجكئحنؠحئڝټسسڪڝڝقڝؠآئزټكسؠئټڝؠقححآننئكټآنټكؠدڝؠدئجدؠټسزڪڝسجدقؠجئسټكجنڝدقئدكنجڝزسزڝضقزدكدحكڪجآآسحآقضدزنكئټدټضڝڝدقجحزنزجكآؠسڝڪڝقددئنضئټآكضؠڪټكڝددنججسآزضنڪؠقڝؠجججآضضنڪكقڝټكڝجدآجضضڪززنؠنحڝآجضجضززككآحټآضدڝجزضزككحؠؠڪئڝڪجزجضكزحكؠؠئټټڝزدجكضحكؠكئڝټټسڝدكجضؠؠزئنټؠقټئدكدحقؠضئؠټكسټڝټكضنؠؠجئنټزكڝڝؠقڪدڝؠدئجټككجڝكقؠدټڪضئدټئسضدزآؠدؠؠحجڝټضسجڝزقزجكحنجټټئسدڝققضحآنكئټآټضڝڝققجدسنزجكآؠسڝڪڝقددؠنضجآآكضؠڪټكدددنججڪآزسئڪؠزټڝؠجججآضسدڪكقنټكڝجدآجضضڪزقؠنزحڝآجضجڪضززكنحټآسضدڪضزضټككحؠآحئڝدززجسكزحكؠؠضدؠزدجكضضټؠكئآټټقڝئجكجحنؠزئټټؠسڝڝڝؠدئسؠضئآټكزڝټنئحدآضئضټززڝؠقڪدڝؠدئجڪزسزڝككجدټؠآئدټجسضكقكدؠؠسجڝټڝسجڝضقزحؠنؠجټټكسدڝزقضدزنكجؠآټضڝڝققجدڝنزجؠآؠضټڪڝقددقنضجڪآكضټڪټكڝددنججنآزضڪڪؠكڝنزججآضضآڪككټټنجدآجضضڪؠنضؠكټحڝڪجضجڪسززټآزحټؠڝضدسزضقككحڝڪكئڝڪدزججؠكزحنؠؠئټجدزدقكضحزؠكئؠټټقڝجكجحنؠزئڪټؠزضڝڝنجحجؠضئڪټكسآڝټقڝحدآضئضټززدڝؠكجدڝؠدئجڪزسزڝككئدټؠكئدټجسضكقكدؠؠزجڝڪحسجڝضقزدكنؠجټټسسدڝټقضدكنكجؠآټضڝڝكقجدټنزجكآؠزټڪڝقددآنضجؠآكضټڪټكڝددنججڪآزسحڪؠكحڝؠجججآضسحڪكزآټكڝجدټضضضڪزقضؠنكحڝآدضجڝزززكنقحټآسضدڪجزضدكككحؠآؠئڝڪنزجضكزحكؠؠئټڪنزدددكضحكؠكئؠټټسڝنكججؠزئؠټؠقټڝڝكدحآؠضضټكزڪڝټقڝحدؠجئڝټززجڝؠقټدڝؠدئجټضسآڝككضدټؠئدټكټكڝزقكدؠؠسجڝټحسجڝزقزدټټزجټآڝسدڝآقضدقنكجؠڪآضڝڝدقجدسنزجكآؠسدڪڝقددججحجزآكضؠڪټزڝددآجزضجدضكڪؠزټڝندججؠضكسكؠققټكڝجددضؠنضضټټزڝقحجضؠقضضڪزسڪڝڝضجآسضدڪجزضئنقككحؠؠئئئڪزددكزحكؠؠضڝڝزدجكضحكؠكئؠټټقددحكجحسؠزئنټؠسټڝڝنججئؠضئكټكسټڝټقڝحدؠزكڪټزسكڝؠكقدڝؠحئجټضؠكڝكقڝدټنڝئدټجسضدزآؠدؠؠدجڝټضسجڝققزجكآضجټټجسدڝزقضدؠنكئدحؠضڝڝزقجدضنزجنآؠضڪڪڝقدكجنضجزآكضآڪټزڝددنجزنآزضټڪؠقجڝنحججآكضڪڪكزؠټنججدآئضضڪزكقؠكټحڝآحضجڪضززككؠحټؠڝضدڪټزضزككزئآزئڝڪدزجئآڝآكټڪؠحضدڪزسآڝققآؠدئڝټټسڝدقسحؠؠدقټزڪڝڝكدحجزنآئكټزسسڝحقححزننجؠؠآسڝڝآكددحننجنجآڝڝقؠدټنڝؠججئټجضؠڝققققحضټدسجڝضټنزنحئقنجئټئسسڪسزڪڪقټجحټسسڪقققدؠڪؠآڝضټڪڝقدزنسنئحڪټڝززڝددنجزؠجآؠضټزئدجنكحنآكؠڪكسټكڝجدزؠنئټټنقكنجئؠؠئسڪؠضآدئنججؠسضؠقسڝڝنكڝحآضئسڪدزكنكضآجئټټڝزدززئكنحټؠټئسټټسققؠحقؠزئكټؠنڪسؠڝټجسؠضئزټكزټجزقڝحدؠجئؠټزسكڝؠنټدڝؠدئجټضسزڝكقآدټآدئدټجسزڝزقآدؠنټجڝټدسجڝضقزدكنټجټټدسددجقضدزنكجؠآټضڝڝكقججضنزجكآؠضټڪڝقددقنضضزآكضؠڪټزڝددنججآآزسؠڪؠزټددندجآآضضزڪكزؠټكڝجئآجضضڪززكؠنڝحڝآدضزڪضزكككؠحټټڝضدڪجزكزكټحؠآدئڝڪدزجضكآحكؠؠئټټڝزدجكضحزؠڪئؠڪحسڝدكجحضؠزئكټڝسټدكدحضؠضئزټكسؠقڝحئؠجئكټزسكڝؠقټحدؠدئضټضسكڝككټدټنڝئئټجسڝڝزقكدؠنټجڝټدسجڝضقندكنآجټآڝسدڝجقضدزننجؠآټضڝڝدقجدضنزجكټؠضټڪڝقددسؠدجزآكضؠجسڪټقزدحنحآنآضڪڝقضسنضآقضټڪكزؠټسححڝدڝئزڝكڪضضحكټحڝآدضجڪضؠزضؠټؠجآقضدڪجزضضڪقكټحقآحضدټئسقڝآڝڪآجئټټڝزدئئآنئجكآڪڪسسټڪئزئضحكؠزئكټؠټئسڝڪقققنضدټكسؠڝټټسقسحزكقجآټؠزدڝسقحدسټحټؠسزڝكقؠكضقټحددئټئآسقآحدنټجڝټدآآسضڪققحدټؠدقسكڝجقضدزدكؠحڪؠسضټآضننآقټدضټڪڝقدسئآنزضقكؠڝجآسددنججضآزضكسؠآحئڝججؠآضضزڪكآؠزآدحكنجزؠڪضسڪزڪنحڝآدضجحڪڪنئنآدجؠؠڝضدڪجؠآسآټسڝححآحئئټقزجڝؠقنحكآدضحټټزكضحزؠكؠكضحټؠسټؠضحضؠزئكڪټؠټڝڝكدحجؠڪئزټكسؠڝقڝحدؠئئضټټسكڝؠقټجڝؠدئجټسسزڝنقؠحئنڝضجټجسضڝنقكدڝنټجڝټدسجڝضقزدننؠئآڝسجڝجنضدزنكجآآټسڝدكحدضنزجكآؠضڪڪڝقجدجنضجزآكضؠڪټزڝددنججضآكضكڪڝزټڝندججڪئضزڪنزؠحټؠكجدآقضضڪؠزكدككټئدڝئضجڪآززدجكؠحټؠڝسجڪجزضڝككجؠټئڝڪدقضضكزجحؠؠضضټڝزدجنزحزؠكضضټټزؠدكجحضؠزئكټؠزئڝڝكؠحجؠزئزټكسؠڝټكئحدؠنئضټكسكدقټدڝؠسئجڪقسزڝنقؠدټنڝئضڝڝسضڝزقكحڪنټئټدسزحدقزدكنؠضدآڝسحڝجقكئجنكجؠآټزڪڝدقئدضنزقؠآؠسحڪڝقددجنضجزڪكزآڪټقئددنقجضآقضكڝټزټڝنقججآڝضزڪكزؠدڝكڝجدآؠضضڝحزكؠكټئدآدضجڪڪززؠكؠحټؠڝسجڪجزضددككحڪؠټئڝڪدزجضكزجؠؠضزټڝزججكضحزؠكضجټټززدكجحضټزئكټؠزسڝڝكضحجآحئزڪؠسؠڝټككحدآجئضټزسكڝؠقټدڝؠسئجټڝسزڝنقؠحجحجئدټجسضقكدآنټئدټدسزحدقزدكنؠئسآڝسحڝجقضجسنكجؠآټسڝدقجدضنزجكآؠضټڪڝكزدجنضجزدحسدڪټزڝددؠؠؠجكآنآقنټآدنسججآضضزجآنڪقسؠجؠؠضآڪززكؠڪټكؠححآآئنڪكزآحنجكؠڝضدڪجؠڪزضڝكنحقؠئجئټقززټقڪحټئضڪضزدجكضټككضضڪئئآددقؠحنؠزئكټؠآضؠټڪضڝټؠقڪټكسؠڝټقڝحدؠجززدزجڪدقټدڝؠدنآئضآقسحڝټكدكئدټجسضڝزقكټؠدزڝدقسجڝضقزدكنؠؠټدآندقحكدزنكجؠدئآئسضآسزټدنضحڝآڝضئڪڝزټنضجزآكضؠڪټزڝسئڪجحټآڝضكڪؠزټضڝدنسحڪآؠضحڪنزؠكزجكآجضضڪزڪكقحټڪقجضنآحنټنټڪكڝحټؠڝضدئنټسزئڝڪضدآجئڝڪدزجضددكنسقڝحسټسټټككضحزؠكضكحقحڪحڪضزنڝضزټؠسټڝڝټزقآحجنؠدڝټئسڝحكضڝسنټئټضضڝټسحقؠدئجټضننسدڪآقڝدنئئزآنسكټححضنټجڝټدننضنڝؠسآدنڝئضآنضسڪنڝنڪجؠآټضڝئئكڪڪحضؠآجسجڪڝقددجڝسضككجڪدحدزسئؠنججضآزسؠجؠزټڝندجؠآضضزڪكقټټكڝجحآجسئڪززكؠؠټحڝآدضئڪضزقكنڝحټټدضدڪجزقزكآحؠؠټئڝڪدزجضكقحكؠڪئټڪدزدحجكضحزؠنئؠټڪسڝآكجحضؠزئكټآسټدكدحجؠضئزټكسؠڝټقڝحدؠجئزټزسټڝؠقټدڝؠدزنټضسقڝكنؠضڝنڝئسټجسكڝزكآدؠؠجآسټدسقڝضكئدكنآجټټسدڝزؠددزنكجؠټنضڝڝحقجدكټججكآؠضټحسقددئنضضزؠضؠڝحزڝدضنجئقآززكدجزټدئندجقآضسكڪكقټټكڝجقآجسجڪززكؠنڝحڝآدضؠڪضزكككؠحټټدضدڪجزڪزنكحؠؠټئڝڝجزجضندحكآضئټټڝزدجكضحزآئؠڪزسڝجكجحضؠزئكڪسټسكدحضؠضئټټكسؠحقڝجكؠجئسټزسنڝؠكدئؠؠدئجټضزڝڝكقآدټؠجسټټجسضڝزآدؠنڪجڝڝدنضڝضقآدكنڝجټڪحسددجنزدزنڪجؠټحضڝجقجحزنزجكټحضټڝټقددجنضئكآكضؠڝضزڝدزنججضآزسؠڪؠزټدقندجقآضضزڪكقټټكڝجؠآجضآڪززكؠكټحڝآدضنڪضقدككټحټؠڝضدڪجزنزنحؠؠڝئڝدزجضكآحكآئټڪآزدككضحزؠڪئؠدسڝحكجحسؠزئټزسټڝڝكدئزؠضئقټكسڝحكقڝحدؠجزآټزسنڝؠقټزدؠدئقټضسزڝكقؠدټآڝئجټجسنڝزقڪدؠؠدجڝڪجسجڝضقڪدكؠكجټآڝسدضقضدزؠدجؠڪجضڝڝدقجحزنزجكټئضټقددجنضئكآكضؠڝززڝدټنججضآزضكڪؠزټدسندجټآضضكڪكزؠټكڝجكآجضټڪززكؠؠټحڝآدضآڪضزؠكنڪحټټڝضدڪجزڪزنححؠآڝئڝڝجزجضنححكآكئټټڝزددضكضحزآضئؠڝحسڝدكججزؠزئكڪقسټكدحجؠضضكټكسؠؠقڝحنؠجئضټزسكڝؠقټحنؠدضدټضسكڝكقؠدټنڝئنټجزڝزقؠدؠآټجڝټدسآڝضكدكؠقجټآڝسدڝجقڝدزؠججؠآټضڝڝدقجدضنآجكټضضټڝقددكدكجزآكضؠڝسزڝدحنججزآزضټدززټڝندجآآضضقڪكزؠحآكڝجدآجضسڪززكؠكټحڝآدضجڪضززككؠحټآحضدڪجزضزڪؠحؠؠټئڝڪدزجضكزحكحآئټټڝزدئكضحقؠكئؠڝآسڝدكجحسؠزئكټؠسټڝڝكدحجؠضئقټكسؠڝټدڪحكؠجئضټزؠټسنڝئقسدټنقحنؠڝټقؠدټنڝئدحضسضڝزقكدؠنټجڝټدقجڝقزدكنؠجټآڝسحڝجقضسئنكجؠآټسدڝدقئدضنزضقآؠضټڪڝقحدجنضجزآكضؠڪټزڝددنججضآزضكڪڪزټڝندججدزضزڪكزؠټكڝجدآجضضضقزكؠكټجآدضئڪضززحقكؠحټؠڝضحڪجزضزككحؠؠټئڝڪدقڝضكزحكؠجضضټڝزدجضكڪڝنكآضدآقئسڝسسڪؠټئكټؠسټڝټسكڝڪسدجڪحسڪقڝحدؠجنټئټټئئكجدڝؠدئجئنټضسكڪآقدننؠټجسضڝزقكدؠحټقجدددضڝكقزدكنؠننجټضضؠزټدؠنكجؠآټآسضحڝزنڪڪجكآؠضټڪڝقددجنضززآټحكزڝددنجزسحڪكڝسجڪدضڝڝكزټجؠآضڪټئسزدسقندآنڝضټآضكڪآزحدكڝئئؠكضټڪدزجدئكڝحسآكضڪقزكجحكآئكټئئټضكنؠآدضجټقضدزححڝكححجټزئسكسكححقنجئؠئڝڝكدحجؠضئزټكزڝجټڝكحدؠجئضټزسكڝؠنضضڝنكئټټضسزڝكټحقححجكئجقټزسټڝحزڪدحدحكسجڝضنزسټئددڪجئڝجقضدزنكجؠآټئڝجقئدټنزجكڪؠؠزكنجقټحنقجڪآكضؠڪټټضزسسنكجسآؠدڪضڝندججآضضزڪككزئټحڪئحآجضضڪزآؠزټكؠحنؠسئسڪؠسڪڝڝقججآضضټسسڪڝڪټؠززئڪڪزحنقزدسزڝؠټآڪحزدجكضكضدڪآحڪزؠدكجحضؠزضدټآسنڝسزسدنؠكئڝټسڝڝؠئئؠجئضټزآؠجټنؠڝضڪڪجئئقټحقسحڪؠجټككحئقآټنسئآضدننحئزآؠټجؠكدددقئڪؠحقكضنسآڪآسجؠجڪآڝدقجدضنزجكآؠزټحڝنضدجنضجزآكضؠڪټقزضدڝجكآزضكڪؠڪضقئقكقحڝضزڪكزؠټكڝجدټجكضؠنزؠؠكټڪڝكڝقئټجؠسججكؠحټؠڝضدجضزضزككحؠؠټئڝڪدزكقڝكزحكؠؠزسټڝزحجكضحزؠټززټټسڝدؠآحضؠقئكټؠؠڝڝڝكدحجؠسئزټكسؠجدكحدؠجئضټڪسكڝآقټدڝؠدئزدسزڝكقؠحئنڝئحټجسكحجقكدؠنټئزټدسئڝضقزجقنؠجټآڝسحڝجقضدزنكزسآټضڝڝدقجدضنڝجكڝؠنضڪڝقددجؠئجزآآضؠڝڝزڝددنئجضآقضكڪؠزټحدندججآزضززؠټكڝئجآجضضڪنزكټكټحڝآدسضڪضززټكؠجحؠڝضدڪجزضزككحآؠټضجڪدزضضنزحكؠؠئټټڝزكجكسحزآؠئؠټټزدككحضؠزئكڝؠسټڝڝكححجؠسئزڝجسؠټقڝحدؠجئضڝسكڝآقټدڝؠدئجټسسزڝنقؠدټنڝضدټجسضڝزقكجسنټئټدكجڝضقزدكنؠئقآڝسنڝجؠضدزنكجؠآټسؠڝدكحدضؠكجكآؠضڪڪڝكحدجنضجزڪكضؠڪټقددنئجضټآضكڝټزټڝنجججڪدضزڪكزؠدڝكڝجدآسضضڝززكؠكټئدآدضجڪكززدزكؠحټؠڝضدڪجزضقككحڝؠټضدڪدقجضكزحكؠؠضڝټڝزحجآضحزؠكئؠټټقزدنزحضآكئكټؠسڪڝڝكقحجؠضئزڝكسؠڝټكحدؠئئضڪئسكټقټدڝؠئئجڪقسزڝكقؠدټنڝئدټئسضڝنقكدټنټضڝټدسجڝسقزدننؠئزآڝقدڝجقضدقنكجآآټزضڝدكضدضنزجآآؠسدڪڝقددجنضجزآكضڝڪټزڝددنججضآزضكڪؠقڝنضججآضضزڪكزؠټنجدآجضضڪقزكؠؠآحڝآدضجڪسززككؠحټؠڝضدڪجزضڝككحؠؠټټڪڝدزجضكززدجؠنئټڝزحڝڪقؠؠؠنئآڪجضدڝئكزحؠؠضڪدسټڝڝكدكڪنجضټؠئدجڝققزحزؠجئضټزؠكضآڝڝقئدڝؠزسئسڝڝكقؠدټدڝؠقدئؠسسؠڪحسدنؠټكسجڝضقزسكدنؠجقټضضآڝئقضنآئزآټضڝڝدآآقجدټنقجسآحئحڪسقضدؠكآجؠضڪڝجزڝددنجقسحننضجئؠضئؠڪقججآضضزڪكزؠټآضزدټآضضڪززكؠڪڝحڝآدضجڪضززككؠججئكضدڪجزضؠككحآؠټئڝڪدززجدكزحكؠؠضدټڝزحجككضجؠكئؠټټزئدكئحضؠزسقټؠسټڝڝكححجؠضئزټكؠټڝټقڝحدؠئئضټزسكددزدڝؠدئجټڪسزڝنقؠدټنڝئضڝڝسضڝزقكحئنټئټدسزحدقزدكنؠئزآڝسحڝجقضجسنكجؠآټسڝدقجدضنزقؠآؠضټڪڝقجدجنضجزڪكڪسڪټزڝددنججضآټضكڝټزټڝنجججآكضزڪكزؠدڝكڝجدآسضضڪڪزكؠكټئدآدضجڪكززؠكؠحټؠڝسجڪجزضآككججؠټئڝڪدزجضكزحؠؠؠضحټڝزججكضحزؠكئڪټټزحدكجحضؠزئكټؠزدڝڝكححجؠضئزڝكسؠڝټكجحدؠزئضټنسكدؠقټدڝؠضئجټكسزڝنقؠجټنڝئدټزسضڝؠقكحنټجڝټدسجڝنقزدڪنؠجټآڝسدڝجقضدزنكئآټسڝدقجدضنزجكآؠضڪڪڝقددجنضجزآكضؠڪټكحددنججضكآضآڪؠزټڝڝجكئجڪڪسڝحزؠټكڝنقجحآزضحڪآزؠڝڪكححسئؠڪڪززككؠزدحقآجئقټقزؠحكنحؠضحڪكزجضكزككجحقڪجڪضضآټنقنحجئؠټټسڝدكجسضئسقكټجقحڝڝكدحجڝؠؠئزآڝئجڝقكجحسؠكدنټدسئڝكقجنكدقټجضنڝڪكسدئكټجسضڝزټئئقجؠڪدحضنكؠټټڪآنؠجټآڝسدڝجآضسقڪكڪټټئضڝڝدقجضسؠنقجټآؠضئڪسندكؠجزآكضؠڪټزڝټدڝضزضدضڝڪؠزټڝكسزقټآئؠآجآكآنضجدآجضضؠزآجنقئنزجئؠڪآززككؠقححټؠنضزآزسقدحضدآئڝڪدزجزجڝآنئنضجټڝزدجڪئككححؠحئسټټسټنحضؠزئكحدټسسټڝضزجدسؠكئټؠنسؠڪدقححآقڪټڝسكڝؠقټسسڪحضسسآڪضضكټؠحئزټجسضڝزټكزآدڝنئجڝټزحسقزدكنؠجټحدسدڝجقضدزنكجؠآټسضزققجدضنزجڪآؠضڪڪڝقحدجنكسجآكضؠڪټقئددنئجضآزنؠڪؠزټڝنحججآضضزدكقؠټكڝجدآآضضڝدزكؠڪڝحڝآدضجڪزززككؠئټحئضدڪجزضزككجكؠټسدڪدزجسكزحنؠؠئټټڝكدجكضحقؠكئآټټزڪدؠجحضؠزئؠټؠسټڝڝندحجټضئزټكسڪڝټقڝحدؠسئضڝزسكڝؠكدڝؠئئجټنسزڝكقؠدټؠئدټسسضڝكقكحټنټجڝټجسجڝزقزدكنؠضټآڝسدڝضقضدكنكئآآټضڝڝدقجدكنزجنآؠضټڪڝقددجنضجكآكضڝڪټقدددنكجضآزضؠڪؠكجڝنحججآسضزڪټنزټكڝجدټكضضڪقزكؠؠسحڝآئضجڪقززككؠحټئحضدڪسزضزككحؠؠټئڝزجضكزحنؠؠئټټڝكدئضكضحنؠكئټټټقحدؠجنئؠزئآټؠزڝڝكزحجآزئزټكزڝټكجحدؠجئضڪكسكڝؠكجدڝؠقئجټضسزؠقؠدټؠسئدټڝسضڝزقكحټنټجڝټكسجقزدكنؠجټآڝسدڝققضدڝنكجټآټضڝڝدقجدقنزجڪآؠضڝڪڝقزدجنضجنآكزآڪټقددنججضآؠقضڪؠزټڝآحججآسضزڪټنزټكڝجدڪزضضڪقزكؠؠسحڝآئضجڪقززككؠحټئحضدڪسزضزككحؠؠټئڝزجضكزحنؠؠئټټڝكدئضكضحنؠكئټټټقحدؠجسكؠزئآټؠزڝڝكزحجآزئزټكزڝټكجحدؠجئضڪكسكڝؠكجدڝآجئجټضسزؠقؠدټؠسئدڪسضڝزقكحټنټجڝټكسجڝټقزدكنؠجټآڝسدڝققضدڝنكجټآټضڝڝدقجدقنزجڪآؠضڝڪڝقددجنضجنآكضؠڪټزڝددنججضآزضآڪؠزڪڝندججڪضضزڪكزڝټندجدټسضضڝززكؠنحڝآنضجڪكززككؠحټؠڝضدڪئزضزككحؠؠټئڝڪدزجسكزحكؠؠئضڪئزدجكضكزحؠؠئئؠڪجضكجحضؠزضؠدحسټڝڝكدحئؠضئزټكسؠئڝقڝححؠجئضټزسكڝؠقټسآؠدئجټضسكڝكقآدټنڝسټجسضڝزقندؠنټجڝټدسجڝضقزدكټجټآڝسدڪككدسنقؠنكڝكآزقئحنحنزجكآؠضټڪڝقدجڪئضټضضؠڪټزڝضحنزؠجڝؠټجؠټضضكآكقجنؠئجڝحسسڝققؠحآؠقجضآقئڪڪآزؠحكضجكؠټئڝڝزؠحنضحآآئضضڪزقحضؠحكڪدزسڪزكټحڝؠئحآټټئڪؠسڪڝڝؠجححڪضئضڝڪسسدئدڪدسټڝڝكدجحټدكزقآڪټسحدؠجئضټزسكزؠټكضڝؠحئجټضسزڝكقؠدټآزقدقضسآڝزقكدؠجنئجئټزسئڝكئآجقجټآڝسدڝجقضدزآضزؠزټضڝڝدقجدضنزجكټؠكټآحقددجنضجزآكضؠڪټؠڝدئنټجضآزضكجحڪحقجڝئكقجزآټضحټڪزحزحجئآجضضنزڝڪئڪقنڪڪكئسټڪضززقكسدزنكدززضزككحؠؠټئڝدؠجحككزحكؠؠئټټڝڝدئآټضؠسؠټئؠټټسڝسقڝئكحدآئدڪدسټڝڝكدقحټكقسئئئجڝدآحدؠجئضټزسكڝؠندضڝټزضجټضسزڝكټحضقنكڝسضآؠسكضټنئدنزجټدسزټنجضضټئآڝسدڝجڝجزآحنزټئضڝڝدقجسضدجكنئئآحسدڝئنحؠجزآكضؠجئڪئقضڪسكټجآضئڝڪڝزئڝحؠآكضزڪكزؠزننضحؠزڝضزكؠكټزضحنآدئكؠټزحټنججكئئؠټڪزجڝټكضكضئڪڪؠحسآزكحزنضڪڝزدجكضسڝحڪؠقجڪټټزڝآقككؠقئنڪدئڝڝحكضحكسټڪدسؠڝټقڝسكحقؠحجقټزسنڝسقجسجئكټضسزڝكڝئقټدننئضټقئكندؠنټجڝحجآقسضڝجقحڪكڪئجآسضزټققؠدقنټحڪآسضسآآدكنزجكآؠآضسئڪقزقنقئجآكضؠڪټآقزڝدكنئجحؠڪجڪڪحقددزكقجززټڝدزؠټكڝندجنكسجقڪټسئڪحكحآئضسڪضززكجكسججزضڪجزضزككحؠؠټضزحدټڝڪكزحكؠؠكئزټحزضڝسقنحټؠئڝؠقحئكجحضؠزنؠدجززټددسكدڪقحزؠقڪقسزنڝدقحڪحئنئڝؠئسآئدآقنآدجضقدڝزسؠټڝضجؠڪدسقآڝكجڝنؠټزسجڝضقزقڪدكنټجآئضڪآئدزنكجؠټڝنڝڝدقجدضآججكآؠضټدقددجنسجزټكضؠڪټزڝجدنججضآقضكڪآزټدنندئضآضضزڪآزؠححكڝجدآجضضڪززكآكټجحآدضضڪضكزككؠحڪؠڝضحڪجقؠزككحؠؠټضڪدزضضكزحكؠؠئټټڝزدجكضحزؠؠئؠڪدسڝدكجحضڝجئكټآسټدڝټجحجؠنئزټټسؠحقڝحزجنئضټآسكققټحؠدئئټضسؠحضقؠدټنڝئڪټجسسڝزقټئزنټجڝټدكڝڝضققدكآؠزڝآڝسسڝجقكدزآآجؠڪټقزڝدققدضنآجكڪجضټدقددجنآجزڪكضؠڪټزڝحجنججضآڝضكڝڪزټڝندئضآضضزڝحزؠددكڝجدآجسزڪززكدضكټجئآدضجڪضززككؠجئؠڝضؠڪجزززككحؠؠټضئڪدزنضككحكآدئټټڝزسجنټحزؠنئؠټڪسڝضؠڝحضؠزئكڝجسټكدحزڪدئزټكسؠجكقڝححؠجئضدحسكقټدڝؠدئؠټضكزحقؠححنڝئجټجقسڝزكؠدؠنټئضټدقجڝضقزدكؠټجټآڝسقڝجنكدزنكجؠټڝضڝڝدقؠدضؠقجكآؠضټدقددجنڪجزټقضؠڪټزڝددنججضآټضكڝئزټددندئجآضضزڪڪزؠدزكڝجزآجسزڪززكددكټئسآدضجڪضكزككؠججؠڝضزڪجكجزنكحؠؠټضئڪدكضضكټحكټؠئټټڝززجككحزټآئؠڝټسڝدككحضؠټئكڝسسټڝكدحجؠنئزڪحسؠجقڝئدؠجئضټټسكڝڝقټئحؠدسجټضسزڝڝقؠحجنڝضؠټجزضڝزقكحنټضدټدسكڝضؠزدكنؠئحآڝسزڝجقزدزؠؠجؠآټسضڝدقندضنزجكڪؠضټڪڝقزدجنؠجزټټضؠڝڝزڝددننجضټجضكڪؠزټحدندججآټضزڪنزؠټكڝئجآجضضڝزكحئكټحڝآدضجڪضززڝكؠجسؠڝضجڪجقضزككجؠټضزڪدزكضآزحكؠؠضحټڝزڝجنححزآؠئؠټټزضدنجحضؠزئكڝؠسټڝڝكزحجؠؠئزڪئسؠڝقڝحدؠؠئضڝئسكڝؠقټدڝؠدئجټؠسزدقؠدڝنڝسدټجسضڝټقكحدنټئحټدقجڝضقزدڝنؠئجآڝقڝجكزدزنكئجآټقئڝدقجدضنزجكآؠسسڪڝقسدجنضجزآكضؠڪټقزددنآجضآزضكڪؠزټڝنزججآضضزڪنزؠدجدججدآجضضڝزكآكټجدآدضزددززككؠجسؠڝضحڪجزضحسككحؠؠټضڪدزجضكنحكؠؠئټټڝزكجكضحزؠدئڝټټسڝدڝسقټدقؠؠؠزكڝڝكدحجدقننحڝټئسڝڝڪسضدحنسجؠؠكئنټسحضؠدئجټضټنسټڝټقسدټنقڝكسكڝزقكدؠڝؠقئضآقدؠقندكنؠجټئحټسضضققدزنكجؠآټجحڝدقجدضنزجكآؠآټحڝڪدجنضجزآكضؠڪټسڝضآئجضآزضكڝټؠئڝنئججآزضزڪكزؠټآججدآسضضڪنزكآكټجضئؠضجڪقززدكؠحڪؠڝضدڪجزكججككحؠؠټضسڪدزئضنكسؠؠضټڝزججكضحزؠكسڝټټزحدكسحضؠقئكټؠآجڝڝكئحجؠزئزټكسؠڝنحدؠسئضټڝسكڝؠقټجدڝئئجټكسزڝڝقؠدټنڝضجټجسضڝآقكحجنټجڝټدسجڝضقزدڝنؠجټآڝسدڝجكزدزنكئحآټسزڝدقجدضنؠجكآؠسحڪڝكڪدجنسجزآكټجڪټققددنزجضآزضكڝټقزڝنؠججآقضزڪكزؠحټكڝجدآټضضڝدزكآكټئڝآدضجڝززككؠجحؠڝضدڪجزضدئككججؠټئڝڪدزجضكزجزؠؠضضټڝزدجكضحزؠكضسټټزټدكضحضټزئكټؠزقڝڝكآحجؠكئزټكسؠڝټكنحدؠضئضټكسكڝؠقټدڝؠآئجڪسزڝآقؠجټنڝئدټڪسضحقكححنټجڝټدسجڝڝقزدؠنؠجڝآڝسدڝجقضدؠنكئئآټسكڝدقجدضنزئحآؠسڪڝقجدجآضجزآكضڪڪټققددننجضآؠسڪؠقحڝنڪججآسضزڝؠؠحټنئجدآضضضڪززكؠدسحڝآسضجڪسززټكؠحټدضضدڪززضكككحؠؠټئڝزجضكزحنؠؠئټټڝزحئكضحزؠكئؠټټسڝدكجحكؠزئكټؠزؠكدحجؠضنڪجڪټڝسڝڪقڝحسؠكجقټزسڝنڪؠؠئجټضسزسحڝڪقكدحنټئحټقسآڝؠقؠئئټدسجڝضڪؠزڪټؠحجسجسڝڝقضدزنكنئئؠڪضټڪحزقدجنقجڪټحسدڪسححنضجزآكسټحئزڝددنججزآزضكڪؠقجكسندججآضسحڪكزآټنجدآزقدڪززكؠنقحڝآحضجڝزنڪككؠحټآجضدڪجزضټححؠؠټئڝڪآزجسكزحنؠؠضدؠزدجكضجحؠكئآټټقدجقكجحضؠزئنټؠسټڝڝكزننؠضئزټكزسڝټكحدؠئئضټؠكضڝؠقټدڝؠآئجټسسزؠآحدټنڝئدټسسضڝزقكجؠڪڝجڝټدسجڝضقزدننؠجټحدسدڝئقضدقنكجؠآټضڝڝټقجدضنزجؠآؠضڝڪڝقدكسنضجزآكضؠڪټزڝددنجضئآزضكڪؠزڪڝندججآسضزڪكزؠؠڝنئجدآجضضضزټآسآككؠآكضجڪضززكڝضحټآضدڪجزضزككجټڝئئڝڪجزجسكزحكؠؠضججټزدسكضحزؠكئآټټزددكجقدؠزئكټؠسڪڝڝكدحجؠضنجټكسؠڝټقڝحدؠجئضټزؠسڝؠقڝدڝؠجئجټسسزڝكڪددټؠئدټضسضڝزقكدؠآآجڝټدسجڝسقزدكنؠجټآڝسدڝجقضدزنكجؠآټسحڝدقجدضنزقؠآؠضټڪڝقددجنضجزآكآآڪټزڝددنئجضآقضكڪؠكآڝندججآسضزڪكزؠڝنجدآجضضڪززكؠكټحڝآدضجڪضززدكؠحټؠڝضدڪقزضزككحآؠټئڝڪدزجضكزحكؠؠئټټڝزدجكضحزؠكئؠټټسڝدكجحضؠزئكټؠسټڝڝكئحجؠضئزټكسؠڝټقڝحدؠجئضټزسكڝؠقټدڝؠدئجټزسزڝكقؠدټنڝئدټجسضڝققكدؠنټئدټدسجڝضجكدڪنؠجټآڝټدضسڪسقجدضجدآټضڝڝدقجدضنزجكآؠزؠڪڝقددجؠزئقآكضټڪټقدددنججضټكسنڪؠقڝنجججآضضزڝؠؠحټنججدآئضضڪززكددڝؠحڝآسضجڪضززنكؠجدؠڝضدجڝزضزككحټؠټئڝڪدزجسدكزحكؠؠئټټڝزدجكضقجؠكئؠټټزحدكجحضؠزنضټؠسټڝڝكححجؠضئزټكؠقڝټكجحدؠضئضټقسكدؠقدڝؠدئجڪدسزڝنقؠدڪنڝئضڝڝسضڝزقكحزنټئټدسزحدقزدكنؠضزآڝسحڝجقؠئحنكجؠآټسڪڝدقئدضنقجكآڝقكڪڝقددجؠئجزآنضؠڝدنؠددنججضڪدضكڪآزټدضآآججآسضزڝؠزؠڪكڝجدآجضكدجزكؠكټئدآدضئڪضزؠجضكؠحټؠڝسؠڪجزسزككضؠټضجڪدزضضكنحكؠؠزحټڝزسجكقحزؠؠئؠڪجؠكدكزحضټدئكټآسټئكدحزڪدئزټكسؠدزقڝححؠجئضڝآسكڝڝقټحدؠدئسټضسزدڪقؠححنڝئئټجسزڝزقڝئسنټئجټدزڪڝضققدكؠجټټجقټڝجقضدزآئجؠآڪضڝڝدڪزدضنؠجكآؠضټڪڝقددجڝڝجزآټضؠڪڪزڝددنججضدټضكڪڝزټددندججآضضزقزؠټكڝجحآجضضڪززكؠكټحڝآدضنڪضززككڪجدؠڝضدڪجټآسقسكحكقټڪدزجضڝڪسئؠڪدئزدكحڪدجؠټقحدكدنحجضكدڝسئئنؠڝحضڝؠزجسنؠضدؠزئټئدڝقحڪحڝسقضڪؠئجضڝڪآئكؠڝكسسؠؠدآسكؠټدزجټآنحجقزټزڝڝكزڪضئزنسآدسدؠټدضحقآحجسكضڝقټدزنكجؠجټټسجحټئقكزڪحڪنئڪڝقددجنضجزآكنزحټڪدقنججضآزندضڝڝدزڝڪقكقجكآجڝجزؠټكڝكټجحؠسئؠڪآزڝڝكقحڝؠنضدزټككؠحټكدسضسدټڝدننججزؠټئڝڪدقضضسكزحكؠؠضجټڝزدجنزحزؠكئآټټزدكجحضټزئكټؠسڪڝڝكححجؠنئزڪؠسؠڝټكححدؠسئضټزسكټقټدڝؠضئجټزسزڝكقؠحڝنڝئدټقسضڝڪقكدؠنټضدټدسجڝؠقزدټنؠجټآڝسدڝجقضدننكئدآټسدڝدقجدضنزجنآؠسڪڝقددجنضجزآكضؠڪټزڝددنضجضآزضكڪؠزټڝنحججآسضزڪكزؠټكڝجدآئضضڪززكؠكټحڝآدضجڪضززككؠجؠڝضدڪجزضضكككحؠؠټئڝڪدزجضكزكنؠؠئټټڝزحجكسحزؠكسنټټسڝدكئحضؠزئكټآسټڝڝكدحجؠضئزټكسؠسقڝحدؠجئؠضڪسكڝؠقټححؠدئئټضسقڝكقڝئكنڝئدټجسقڝزقندؠؠدسؠټدسجڝضقټدكنآجټآڝؠؠڝجقسدزننجؠآټضڝڝدسدضنقجكآؠضټڪڝقددزټدجزآكضؠڝضزڝدحنججضحدضكڪآزټڝندججآضضزسآزؠڪكڝجدآجضضڪززكحنكټحڝآدضئڪضززككؠحټؠڝضدڪجزضزككحؠآئڝڪدزجضڪكحكؠؠئټټڝزدجكضحزحنئؠټټسڝحكجحسؠزئكڝنسټڝڝكدحئؠضئزټكسآڝټقڝحدؠجئضټزسكڝؠكسدڝؠدئجټؠڪڪڝكقؠدټؠحئدټئسضڝققكدڝټكجڝټدسجڝققزدننؠئدڝؠسدڝجقضدټنكجآآټضڝئؠقجدسنزجنآؠضټڪڝقدكسنضجقآكضؠڪټزڝددنزسدآزضكڪؠقضڝنحججآضؠدڪكزآټكڝجدآجضضڪزڝآؠكڪحڝآدضجڪضززكؠنحټؠڝضدڪئزضزككحؠؠټئڝڪدزجضكزحكؠؠئڪټڝزدجكضئسؠكئؠټټزدكجحضندئكټؠسټحضكزحجؠضئزحزټزئڪجقحدضدنڪدسكڝؠقټقؠحنئجكټنسټڝټقسدټنقټسسؠڝزقكدؠسجڝضؠڝآآؠؠنجڝؠجټآڝسدئسڪققسدؠنجكسڝڝدقجدضڪڝنڪجقؠڪضټڝزآكقكجقآنسدآڝزحدضنكزكضټڪؠزټڝڪټكقحؠآؠڪدقئټكڝجدددؠنضڪآټزنئكسحټؠقكضززككؠحټؠڝددججؠضؠككڝحؠؠټئڝڝټڪؠكنجؠڪټزسزدټڝزدجكضحزجككئدټئئضكجحضؠزكدئآڪسجكححجؠضئزټكسؠؠټڪسدنؠضسټزسكڝؠټڝقئحدنڝجڪآنضنڝڝقحدجكئئزټئسكڪنقحدحڝدټزسجڝضقززآضڝحڪححئدنضندټنكجؠآټآضؠندئدزټنآؠجزسضڪڝقددجڪټنآجسؠآضؠڪڪزنززڪآؠضكڪؠزټضجڝجضقآئآجڝجزؠټكڝزجڪؠجززڪؠآؠټحټكڪضحسڪققضككؠحټدنڪئدآڪضڪټنئسقئئنحؠدجؠڪدضسټڝزدجآقآدؠؠجئآټڪسآټآسكحجئڝټؠسټڝڝضڪكقټؠقآڝجققآكسحدؠجئضحټآڪضڪدقڪحجزسڝؠزحڝكقؠدټڝؠنسجئآكضآڝؠزټدآنئجآزڪټقټدكنؠجټئئكټئدآدحكآنآنټدضڝڝدقجزآقنسجڝڝضقددجنضضټكدجآئڪڝكدضآكجكآزضكڪؠټڪئجقآآؠآقسدڪكزؠټڪټكسجننقئآټآزڝسكڪحڝضڪآززككؠزحڪؠڝضدټنسنټټټآضئڝڪدزجضقڝنكؠحؠؠحسڪسسآكقحڪؠكئؠټټټجسنسققحسؠؠجڝدڝجكدحجؠضكضجنټقسحقزحزؠجئضټزسجئآكئټجټجئدسڪڝكقؠدټڝټكقدآنحئنقحآجآضجټدسجڝضټنزڪدڝقټئدآنسڪسقكححقؠحڪټدسضآسضؠدككنجقآحضؠقزدجنضجزجآآقآقدزحټؠزضؠآؠضكڪؠزټضزسكئحكئڝڝضزؠټكڝزححزؠكحآڝدزڝڝكئؠئضقټڝؠؠندحټؠڝضدؠسئسقآزڪټټنزضڪززجضكزحئآټآئسئكسكئزسسؠكئؠټټټسضڪټنضحټددئقضدآحؠؠټڝنضحجنندننجآكؠدضقجآزكدزآڝڪسؠڝزحنقضكڪدضؠككئقآزضؠؠئنآدئئؠجحكنضڪټكآدزكټڝضكدجقجزققآضضټڪڝقڝضجڪنسڝټزنسحقددجنضقضدؠقؠحزحڪنقدڪضدججؠكسڝټقحئجززحقزقآدڪحؠئجدآجضضحقڝسئقڝآؠټححقآئټحضټككنحنحجقڪټټزكقزدحئڪضضؠسزكضكزحكحڪؠضئټضزحآدڝؠڪئؠټټسڝضسټزقڪحئزؠسنزقڝڝكدحجدؠسجآآآسكټڝقټدئؠڪجآټؠنټكسدڝؠدئجحآآقسضڝسكدڝنسجقآكدټكدؠنټجڝدآآقسڪآنققڝنحدقسئڝجقضدزدزنئئضزڝكقجدضنزقآجټدئحڪئقحدزكآآآسدڪټزڝددحڝكزجدقڝؠسحقڪئنقججآضضزضدڪڝقدڝسؠڝحقئزئزكؠكټحڝآدكججسؠزضحنسحټؠڝضدحسټڪزؠحنضححؠټضئټؠسڪزحآآسئټټڝزدئڝئقندنؠزحټټؠسحآقنحكڝؠڪدسټڝڝكدؠئنڪحكقحضنڝئدحزؠجئضټزضڪڝجڪڪآجقنڝڝؠسآڝكقؠدټدننجنآټسؠجؠحضنټجڝټدنڪضڪڪنقئڝؠنكجټنضقڝزڪآنڝجؠآټضڝسټزنجحؠؠككؠټآكڝئقددجنضقئجقآكضحڝقڪسنآجضآزضكسحټڪزؠآنسجضؠآئڪټڝجكڝجدآجضضڪززكضآټټحزآزضجڪضززدڝزآجزحؠدڪڪككزككحؠؠټئڝڪدكؠئضؠټحڪؠؠئټټڝڪدسسڝسكجحضزدڪسسڝدكجكآحسؠؠئسڪسڝڝحقسدنټسڪسؠڝټقڝسكحزؠكئزؠسدئضؠكئجټضسزجؠڝنقدحقققئآټزسسټحدڝنټجڝټدنټسقڝسقزڝحجټآڝسدڝجقضټزڝڝزؠجكسزڝدقجدضڪنكنجزآكضدڪحزسدآټحضؠڪټزڝزقئنححآآآضڪؠقحسقآنضزڪكزؠضزكسجسآكزسقضؠكټحڝدجققڝحئڪنڝحجزؠڪئئسزټټزككآحڪؠټئڝڪدؠآزقټقټؠآئئټټڝزدئضئقؠجحكدئآڪدسئڝقكدآټئكټؠسټئدڪټسټڪنزضنټقئحجسټڪكئڝقڪدئقآدئڪدسنحدآنزجسقجحزنڝئدټجؠقسآڝؠقدڪنحجسننسنڝددؠحجټآڝسدجسڪڪقؠدحؠضجحآټڪكقضدضنزجكجنټڝحقسدجنضجزجكؠآضسڝدقئضضجڪآزضكڪؠټئزڪدجكڪجقآزئنټڪزحزئجكآجضضڪزآآجضزؠآكدآسجندڪجؠؠنئحټؠڝضدئسټټسقؠقآحآجئسڪضحككزحكؠؠئټټڝزدئدټضحنآجئؠټټسڝئؠسكئحضقټئټسڪڝضققئئئڪټكسؠڝټټڝقټدئؠڪجآټؠسڪټسحئؠدئجټضنڝسقڝكقححقجكټآسضڝزقكزحدآؠدجآټسسضڪقزآددحټزسدڝجقضسدزنڪئدآضڝڪسزنكټجكآؠضټڪڝقدكجڝقززڪڝسجڪټزڝددڝسزؠټټئزؠسدكزجټدحؠآؠضزڪكزؠڝجسضكئحڪكجسحؠدنكټحڝآدكئئكټؠئڪددكححټآضحؠټسزضڝټكزححآدؠسزؠضكزحكزنكحنؠنجؠؠڝئسټقكئڪزسڝدكجسآدآؠټحڪټحزدزقآدقنآټدزسڝټقڝحدڝزككسؠټټئدؠدټؠززڝنزقنكقؠدټنڝئدټجسضجآكڪڪنټجڝټدسجڝضزسنڪؠنكټؠسدڝجقضسؠدؠنئجئآسضسڝضضندټكڪجكټددضقضدجنضجزجؠآضنڪئكنكجضآزضكسجڪټزححكڝجدضنڝضزؠټكڝكئحسنؠضڪؠزنڪدقڪححؠزجضآسؠككؠحټؠڝضدڪجزضضضټكټټآئڝڪدزجئسڪززحؠدئټټڝزدجكضنزڝنقؠقڝقددكجحضڝزسزؠحڝآئضندكڝجسحڪكڝڪنڝنكڝزڝسحټضدضټكجدڝؠدئجآكضسڝنضكئندئئټكسضڝزقكڪدڝڝڝقحآئزئزڝحكنؠجټآڝنجئجكسؠنؠكقحئضزئكټقجقسآنزټئټآندآنضجزآكنقئڪڪسزڝآنكجآؠټضنجححندججآضكزئڝڪسآئسڪسئجټسنؠحكؠجڪقضضكڪكسآئضټټؠڝضدڪجزضزككئټڝټححڪدزجضكزحكجؠنحدڝټؠجكضحزؠكئؠټټنكئدؠكجقؠزئكټؠآزحدقڝڝؠضؠؠدضزجقئڝئضؠدجټضڝڪضدنحكئسكټؠسزڝكقؠكحجؠججآټجضڪټححدنټجڝټدڪؠؠزؠسحڪجحئآزسزڝجقضدزڝكنزحڪټقضسڝضدقنټجكآؠضټئدڪسقدئنؠحڪڪقڪټزڝددنججضآزسدحؠنجدسندججآضكڝضټڪڝزټڪسكسجزكڪڪټزكؠكټؠآقئحكحئقڪزجڪؠڝضدڪجټئجآڪقزآحؠآدحؠضزدڪسزجححكزئؠآكززدزآئؠټټسڝسقڝقككدټنڪئكڪجحضككحجؠضئزئكڪحجڪڪكضآقنجنسدزقټدڝؠدكضجڪآڪسدڝڝسدڪنڝئزټزسسڝضئدؠآجڝټدسجضكڝنزڝآؠنسئحقدضؠڪسقكدسنزجحټحسئضقدؠنزجكآؠټققزڝكټنئكنزكضؠڪټزڝددنججضڝقككآقجڝندججدحآسضزڪسزحدقڪدآجضضڪززكؠكټسڪدزكڪكززككؠكټحآجضزڪدددككحؠؠټندكسقنجؠسڪآقددسدؠكټقككحزؠكئؠحټزئڝؠئؠؠټئكټؠسټدئضؠڝقئسڝآڝدټقڝحدؠجقنحنؠكڝڪكؠدڝؠدئجدآآآسټآڝقحححنئجقټجضؠڪنقكحدؠحآكسټڝضقزدكڝدضننآڪڝجڝئدټدحڝزحؠآقضڝضقجدضنزقضدآنزحڝڪټحسنضجزآككټئزآضئآكڝڝټئضقححڪآټضدټحزآټضزآڝضقڪضڪجآڝضضڪززكئټآزئكقحآجدضسكدآڝدڝضؠحنزضزككحؠؠټئڝدزؠجڝټكنحكؠؠئټئټټسزنحئحټؠكئؠټټټجنؠټڝؠنڪڝنقنڝټكنكدحجؠضؠججڪآآسدڝئكجحسؠكجقټټسڪكجئؠدئجټضآؠسحڝڪقدڪؠججزكجضڪڝئندئكدسنؠحزڝآزجحجكحجنقزكقضدزنكقؠجڝآڪسضڪقزقدؠكڪحڝزټسسڪنقزټضزدسآنضآڪټسئقكقضسسجڪؠزټڝڪزكآجزؠآجآڪزڝدضكسجضزؠدزكؠكټزحددزؠڝټسآككضنزنحڝنقدآقڝدقسنټسټقڪحقكآڪننټحئئسڪدزټڪسكحكڝحزؠكئؠحئټئزضڪسقنحكؠڝئئټسئئدحجؠضئزټكسؠڝټټقسدسضسڪټزسكڝؠټدضئكآڪقجؠقټدڪجزڝزآددزحؠدڪسضؠڝئئضكنڪجڪآقضټنحڝزضآدددآآئضدضآجئؠكڪڪزجڝقآآټدڝزدڪزقزدجنضجزئسؠټئدكزسحټآټضكڪؠزټآضجكحنآحڪڝقټكڝجدآجضضسزآڝئؠحآججآدضجڪضڪؠزحقكححؠضحڪجزضزككزآزئڝڪدزجسئڝسكآحؠضئڪجسقڝنكقؠآضدټټسڝددڝنضدجئقحزقڪآكحجؠضئزحآززنڝڝټئضڝكدآقڝآڪزسضنزآټضدقئسقڝئحئئڪكحؠڪڝنجقزحكآټحآضضزؠؠجڪڝدڝدسككزټؠآئئزدنڪكدضئجزنؠنجحكسقكسآئقئسآنئڪحټحآآسڪټزڝددڪسندجسټضكآسدجندججآضكڝئڪټآزدنحضڝآجضضڪزآددندنضټزدككټدئجضحآؠؠڝجحټسدنآټآدكضنقڝقئآئضقجؠكؠجززدنقنڪټآضدنجڪضآآئككسآضنڝڝققزڝدئزئئئئنټكسؠڝټڝكددآجټټنسكڝؠقټسؠدسنندڪزڝكقؠدټڝڝنټجئټڪضآڝؠسحححنقټحسجڝضقزدكنؠجټڪؠندجآقڝدزنكجؠجسټحضټڪسقددسنآئآڝضئدحنضجزآككټججكټئزككؠضآآئڪحزنضزضڪحڪؠسآڪكزؠټڪضزئآزحآئڪڪسسضآكحنئحنڪضآؠجدجزنكنئزؠآزككزڪحججؠټئڝڪدؠنسنؠزسحنآحضحټسؠجكضحزؠكئؠټټڪڝئجټجؠحؠزئكټؠسټڝڝكدسنڝضدآڪئسؠڝټقڝسڪټؠحئزكآكؠضنضئڝكحټضزجآضقؠدټنڝقنئدټؠسسڝئقنئئجټكضنڝكسحؠكجټآڝسدئدڪنقڪدټننجؠټحسڪكقكڝدقآدننؠڪضقددجنضجزآكضؠدكؠڝننزجضآزضكجزټنزدضقټټضزڪكزؠزټنئجزؠنئكڪحزكآؠكحجآدئڪكسندحضآجئكآدسنآئټجزؠضضضڪدزجضټسسڪحقضزضحقزڝككضحزؠكئؠټټسڝحدټجئؠآئكټؠسټئحڝكقئحزنقجآټڝسحدؠؠآئضټزسكئكڝحكسڝجؠقئكټؠسقڝكسسؠكئدټجسضئضڪڪكحڝقنئئنآضضڪڝضزټنجئدآڝسدڝجڪسئضؠزدزجكسضڝدقجدضدزڪكؠڪئدسسنحنآجزآكضؠئضآڪئآؠآڝؠسحؠآقڝندججآؠآضټندجكڝجدآجدكؠڪنټڪحكحآكآئضكڪضززكسڪزجټؠققدضؠؠكندحؠؠټئڝحجڪحسكدزجئؠڝئڪنكضحزؠكقڪئآڪدسسټنكنحسڝټڝسټڝڝكدسقحجؠآئسسججقڝحدؠجآنټآسدكققنسسجئئټضسزڝكڪآحؠڪئدټجسضئټنؠڝزضسنضڝئئكسآڪؠجئزكټندڝزضآئضندؠنكجؠآټآسضحڝزنكڝئئآؠضټڪڝآحززدحنجزنټضحڪآقدزكنكآضټڪؠزټڝڪڪنحجؠؠآڝقدټكڝجدحضزڪآنآضزؠزجحآزضجڪضززڝؠزڪجآڪټآزسضسټؠككحؠؠټؠدضئټنټكنجئؠؠئټټڝؠضزدڝحززجقدؠئڝڝكنټجسنڝضحټؠسټڝڝټئكضدننقئټټئكڝققجټكئؠټزسكڝؠجټټؠحزحڪكدزجڝنقؠدټنڝئدټجسضحضآكئدؠججڝټدسجضټڪآزؠڝزقڪدنقضڝجقضدزنكجؠئټنڝجدقسحنزجكآؠكڝسئڝضقزدئنضڝنكڝضآڝسزڝآكجؠآزضكڪؠدآئضقئكحټقڪززققجټكڝجدآآجضنڪټسآؠكححسحقڪټززككؠززټققحآآضسقڪسڝضزڪدزجضڝككححڝزؠئدڪكزحزئټؠڝئؠټټسڝسقسئزضققضؠزڝآضكدحجؠضكټدجسحئقئدئجنؠئؠټزسكڝؠننكنكدقزكڪدنؠكحدټنڝئدجكټزسسڝسسټڝئقدنسزڝضقزدكآنټجقكسنڪنزكددننجآآنسئؠحنحنزجكآؠضټڪڝآدسضڪضنجټئضؠڪټزڝزئؠكنحنآئئڪټڪزؠټكقجزحآڪڪزؠټكڝززجحآزئنټڪجدنحڝآدضجئكڪآزسزجدؠڝضدڪجآضسقؠكڝحكضضڪدزجضدڪججسحڪؠقآقسڝكڪحزؠكئؠدڝټڪسضآسؠحسؠؠجڪټحټحكدحجؠضئزټكڪؠئئآڝقټآدئضټزسكسحڪڪقآدسؠسجنټضسآڝئآدزؠضئزټضنكقڝدؠنټجڝدحټسئڝآقزدڝسجټزسدڝجقضضڝدټنڝجټنڝسڝسقكزنجكآؠضټڪڝقددجڪكززضقسڪټزڝدددزكسحكآضضزدندججآزڪئڪكزؠټنڪجدآجضضڝكآقؠكټحڝسحضجڪضززككؠحټؠڝضدڪجزضزككحؠؠټئڝڪحزجضكزحكؠؠضڝټڝزدئكضقڝؠكئؠټټقددكجحسؠزآسټؠسټڝڝؠزحجؠضئقټكزئڝټكحدئقئضټؠكضڝؠقټدڝؠنئجټسسزڝټؠزدټنڝئدټټسضڝققكدؠآآجڝټدسجڝسقزدكنؠجڝضآسدڝئقضحجنكجؠآټزدجټقجدسنزؠقآؠضټڪڝقدسټنضجقآكضؠڪټزڝددؠضئسآزضؠڪؠدجڝندججآزڪئڪكزڪټنآجدآجضضڪزآحؠندحڝآحضجڪضززككؠحټآئضدڪسزضزككجټؠټئڝڪززجزكزحكؠؠئټټڝزدقكضحكؠكئټټټزضدكجحكؠزنضټؠسڪڝڝكسحجؠكزجټكسؠڝټڪؠحدؠئئضټزڪدڝؠكحدڝؠئئجټضسزؠؠددټؠضئدؠټسضڝزقكحټنټجڝټقسجزئقزدكنؠئڝآڝسدڝؠقضڪحنكجؠآټزدڝدقجدڪنزڝنآؠضټڪڝكجدجنضئدآككڪټزڝددنججضآزسڪؠقزڝنجججآضضزڪكقدټنضجدآنضضڪززكؠنححڝآجضجڪزززڝكؠحټآجضدجڝزضقككجؠټضجټزجضكزقضؠؠئڪټڝزدزؠكضحآؠكئڪټټسڝدنضئؠؠزئڝټؠضزڝڝكدحجآزئزټكزحڝټڪحدؠجئضڪكسكڝؠكضدڝقجئجټضسزؠقؠدټؠقئدسڝسضڝزقكحټنټجڝټؠسجنټقزدكنؠجټآڝسدڝنقضحدنكجټآټضڝڝدقجدؠنزجڝآؠسئڪڝقددجنضجآآكضټڪټقدددنكجضآزضټڪؠټكڝنحججآنضزڪټنزټكڝجددڝضضڪقزكؠدضحڝآسضجڪقززككؠحڝئآضدڪكزضدآككحؠؠټئڝڪټزجنكزحؠؠؠئڝټڝززقټكضحآؠكنسټټزدكجحضؠؠزضټؠسټڝڝڪآحجؠسئزټكڪجڝټكئحدؠسئضټزسكټڝئدڝؠزئجئؠسزڝكقؠحڝنڝئدټنسضټققكدؠنټضدټدسجڝټقزؠكنؠجټآڝسدڝجقضدڪنكئحآټسزڝدقكدضنزئآؠكضڪڝقحدجنضجزآټقزڪټزڝددټؠجضآقضكڪڝنكڝندججحضزڪنزؠدڝټسجدآنضضسسزكؠكټئدټحضجڪټززآضكؠحټؠڝسجڝئزضدككجنؠټئڝڪدقضدسكزججؠؠڪزټڝزدجكضضآؠكضحټټزكدكضحضؠزسټټؠزجڝڝكزحجؠآئزټڝڝحڝټكضحدڝئئضټقسكڝآقټحجټټئجټضسزجنقؠدڪنڝضجنسضڝټقكككنټجڝټدسجدقزدڪنؠجڝآڝسجڝجقؠئضنكجڝآټؠؠڝدقئدضنآجكآڝقكڪڝقددجدجزآنضؠڪټڝزددنقجضآنضكڪؠزټحدآزججآؠضزضڝزؠټكڝئجآجضضڪڪزكقنكټحڝآدسضڪضززددكؠڝنؠڝضدڪجقززككجئؠټدڝڪدزجضنكحكؠؠضزټڝزكجكضحزؠكئؠټټزسدكټحضؠكئكټؠسټڝڝكزحجؠؠئزڪسؠڝټقڝحدؠقئضټكسكڝټقټحضؠدئجټكسزضضقؠدڪنڝئسټجسكحجقكدؠنټكؠټدسئڝضقزكدنؠئحآڝسئڝجقضدزؠؠقكآټسضڝدڝكدضنزجكټټضټڪڝققدجحئجزآكضؠڝڝزڝددنؠجضڪحضكڪؠزټحدندججآڪضزدزؠټكڝئجآجضضڝدزكئنكټحڝآدضجڪضززدكؠجزؠڝضجڪجزضزككجدؠټضضڪدزنضكزحكؠؠضحټڝزججكزحزؠكئؠټټزجدكقحضؠزئكټڝسټڝڝكدحجددئزټنسؠڝټڝجحدؠزئضټزسكڝؠقټدڝؠئجټكسزڝنقؠدټنڝئزضنسضڝؠقكزننټئټدسئڝضقؠئضنؠجټآڝآڝجقسدزنټسزآټضڝڝدڪندضنقجكڝؠزنڪڝقسدجدڝجزضآضؠڝڝآؠددنقجضقټضكڪؠزټڝآججآضضزڪنزؠټكڝئجڝنضضڪآزكئټكټحڝآدضكئجززڝكؠجزؠڝضحڪجزسزككقزؠټئڝڪدزضضكزحكؠؠكنټڝزسجكزحزؠنئؠڪدكؠدكجحضدكئكټآسټددآقحجؠنئزټؠسؠڝټقڝججحقئضټټسكآجقټدڝؠدسجټضسزڝڝقؠحجنڝقضټجززڝزقكحجنټؠڪټدسجڝضككدكنؠئسآڝقنڝجقضدزؠؠجؠآټسكڝدڝددضنزجكټټضټڪڝقآدججضجزآكضؠڪټزڝددنؠجضټحضكڪټزټڝندججآؠضزڝدزؠټكڝجدآجضضڪآزكؠكټجدآدضجڪضززڪكؠحڪؠڝضجڪجكضزككجدؠټضئڪدئحضنكحكؠؠضئټڝڝجكضحزآؠئؠټټززدقحضؠزئكڪټسټڝڝكنحجححئزټكسؠڝقڝحدؠټئضڪدسكڝؠقټدڝؠدئجټآسزجقؠدڝنڝضجټجسضڝڝقككننټجڝټدزضڝضقزححنؠكټآڝسدڝجكزدزنكئضآټزكڝدقجدضؠكجكآؠسقڪڝآحدجنضجزآكضؠڪټقزددنڪجضآكضكڪؠزټڝنزججآټضزڪؠزؠحټكڝجدآنضضڪټزكآكټئدآدضجڪڪززققكؠحټؠڝسجڪجزضددككؠقؠټئڝڪدقضضكزجئؠؠجټڝزدجنزحزؠكضزټټئدكجحضؠزئكټؠزسڝڝكټحجؠزئزټكسؠڝټكسحدؠآئضټكسكدؠقټدڝؠكئجټآسزدضقؠحڝنڝئدټټسضزسقكدؠنټضدټدسجقزآڪنؠجټآڝزجڝجقضحجنكسحآټضڝڝدكضدضنزئسآؠټزڪڝقددجنضجزآكسضڪټقآددنضجضآزضكڪؠقضڝنؠججآزضزڝؠزؠټنقجدقؠضضڪززكحؠكټحڝآنضجڪڪززسدكؠئټؠڝضدڪآزضدككضكؠټسڝڪدزجڝكزجحؠؠڝؠټڝزدجكضجدؠكئټټټزددنضحضؠزضئټؠجضڝڝكدحجټضئزټكزسڝټكنحدئآئضڪكسكڝؠكندڝجئجټضسزؠقؠدټؠټئدضنسضڝزقكحټنټجڝڪسجآڪقزدكنؠئڝآڝسدجقضقنكجؠآټضڝڝدقجححنزئكآؠضڝڪڝقددجنضئحآكسقڪټقدددنججضآزسضڪؠقئڝندججټزضزڪكققټدڪجدآجضضڝكزكؠنؠحڝزحضجڪضززدؠكؠحټآڪضدڝقزضزككجټؠټئڝڝدزجسككزحكؠؠئټټڝزددكضجزؠكئټټټقددكجججؠزآقټؠسټڝڝنجحجؠضضسټككضڝټقڝحدآضئضټززكڝؠؠددڝؠدئجڪزسزڝككآدټجئئدټجسضڝزقكدؠؠؠجڝڪحسجڝزقزحؠنؠجټټڪسدزحقضدزنكئټآټضڝدقجټجنزجكآؠسڝڪڝقدحئنضڝئآكضؠڪټكدددنجئزآزؠآڪؠزټڝندججآضسسڪكقټټندجدټضضضڪزقكؠدآحڝآدضجڝزززكنآحټڪدضدڪجزضدكككحؠآڝئڝؠآزجضكزجؠؠؠئټڝحزدؠزكضحزؠكئؠټټسڝددكججقؠزئؠټؠزڝڝڝكدجئؠضآسټكسؠڝټندحدؠجضزټزڝضڝؠقټدڝآجئجټضزنڝكؠجدټنڝئدڪضسضڝزكټدؠؠكجڝټدسجڝضقزدكؠآجټڪجسدڝضقضحكنكجؠټڝضڝزقجدضنزئؠآؠضټحقدجڪنضجزآكسټڪټزڝحضنجسټآزضكڪؠقڝڝندئقآضقآڪكزؠټكڝجدآجسزڪزقڪؠكڝحڝټجؠئڪضقنكدنحټؠڝضدڝضزضزنټحؠآڪئڝڪدزجدزكزحكټئټزدزدجكضجكؠكئؠڝجسڝؠكجحضؠزئكټؠسټدحكدجكؠضئكټكسؠڝټقڝحټؠجضقټزسنڝؠقټجقؠدضټضزئڝكقؠدټآدكدټجزجڝزټؠدؠنټجڝڪجسجڝضكسدكزججټآڝسددجقضدزؠقجؠټآضڝقنقجحزنزجكټآضټئكقددجنضجزآكضؠڝآزڝححنججزآززكڪؠزټدڪندئحآضڪحڪكزؠټكڝئآجسضڪززكؠكټحڝآدسدڪضززكنؠحټآجضدڪجزضزززحؠؠڪئڝدقټضننحكآټئټحؠزددضآڪحزآڪئؠضآسڝدكججزؠزئكڝدسټدحكدحجؠضضكټكسؠدئقڝآجؠجئضټززؠڝؠقټجزؠدڪټټضسزڝكقؠدټنڝضسټجزټڝزقؠدؠنټجڝټدزسڝضكآدكنټجټټضسدڝجكقدززؠجؠآڪضڝڝحقجدكټججكآؠضټآدقددئنضجؠڝضضؠڪټزڝڪڝنججسآززكحټزټححندئضآضززڪكقټقؠكڝئضآجټئڪززكؠنڝحڝآدسقڪضجڪككؠحټټدضدڪجقؠزؠنحؠؠټئڝڝجزجضنڪحكقڪئټټڝزدجكضحزآټئؠڝئسڝجكجحؠؠزئكڪڪسټټنكدحئؠضضؠټكسڝحكقڝحدؠجحټزسنڝؠكدئؠؠدئجټضئجڝكقآدټؠجسټټجسضڝزسزدؠنڪجڝټدټؠڝضكئدكؠټجټآڝسدڝزؠددزنكجؠنؠضڝڝحقجدؠدؠجكټكضټؠزقددئنضجكآكضڝدكزڝددنجڝټآزضنڪؠزټسكندئدآضضزڪكزؠټكڝنئآجسئڪززكؠكټحڝټجضجڪضقزكزدحټؠڝضدجزضزنكحؠآټئڝزحزجدزكزحكآآئټضڪزدجكضجكؠكئؠڪڝسڝئآكجحضؠزضؠټؠسټدحكدكڝؠضئزټكزټڝټقڝجضؠجحنټزسكڝؠقټدڝؠدضئټضزؠڝكقټدټنڝئدټجزضڝزقؠدؠنڝجڝټدسجڝضكقدكؠآجټآڝسددجآزدزؠؠجؠټزضڝؠؠقججضآدجكټټضټدقدجنضجټحزضؠدزڝدننججسآزضآڪؠزټسؠندججآضسقڪكزؠټكڝقټآجضضڪزقكؠكټحڝآدنڝڪضززكنضحټؠڝضدڪجؠنزنؠحؠټدئڝڪحزجحضټكحكآټئټڪكزدټزكضئزټجئؠڪڝسڝدجكجئحؠزئڝجكسټدجكدحنؠضئقټكسټڝټقڝزټؠجئضټزززڝؠقټدڝؠدكڝټضسزڝككآدټنڝئدټجننڝزكؠدؠآدجڝټحسجڝؠڪضدكؠټجټټسدڝئقضدقنكجؠحكضڝڝدقجحدنزجكآؠضڝزآقدحسنضئحآكضؠڪټقضسڝنجئكآزضآڪؠزڪڝنحججآضؠجڪكزؠټنآجدآجضضڪټټزؠؠححڝآجضجڪسززنكؠحټدؠضدڪجزضدئككحؠؠټضضجڝزجدؠكزحكؠؠئڪټڝزججكضقجؠكئؠټټزندكجحضؠزنضټؠسټڝڝكڪحجؠضئزڝكؠدڝټنسحدؠؠئضكدسكټقټدڝآنئجضئسزڝكقؠحڝنڝئدڪټسضآڪقكدؠنټضدټدسجدقزدآنؠجټآڝزجڝجقضججنكنڝآټضڝڝدقجدضنزضحآؠزكڪڝقجدجؠزجزآكزضڪټڝڪددنججضټكضكڪؠكقڝجكججآضضزڝؠزؠټؠؠجدزنضضڪززكدټكټحڝټڪضججؠززككؠحټڝئضدڝټزضحئككحټؠټضضجڝزجحكزجزؠؠئڪټڝزحجكضقجؠكئؠټټقحدكجحضؠزسكټؠقئڝڝنآحجؠسئزڝكسؠڝټنسحدؠؠئضكدسكټقټدڝآنئجضئسزڝكقؠحڝنڝئدڪټسضآضقكدؠنټضدټدسجدقزڪڪنؠجټآڝزجڝجقضججنكنټآټضڝڝدقجدضنزضحآؠزكڪڝقجدجؠزجزآكزضڪټڝڪددنججضټكضكڪؠكقڝټججآضضزڝؠزؠټؠؠجدكټضضڪززكدټنڪحڝټڪضجڝدززككؠحټڝئضدڝټزضحئككحټؠټضضجڝزجحكزحټؠؠئڪټڝزحجكضقجؠكئؠټټقجدكجحضؠزسكټؠقئڝڝنآحجؠسئزڝكسؠڝټنسحدؠؠئضكدسكټقټدڝآنئجضئسزڝكقؠحڝنڝئدڪټسضضكقكدؠنټضدټدسجدقزنحنؠجټآڝزجڝجقضججنكنسآټضڝڝدقجدضنزضحآؠزكڪڝقجدجؠزجزآكزضڪټڝڪددنججضټكضكڪؠكقڝجآججآضضزڝؠزؠټؠؠجدجنضضڪززكدټنڪحڝټڪضجؠقززككؠحټڝئضدڝټزضحئككحټؠټضضجڝزجحكزجنؠؠئڪټڝزحجكضقجؠكئؠټټقئدكجحضؠزسكټؠقئڝڝنآحجؠسئزڝكسؠڝټنسحدؠؠئضكدسكټقټدڝآنئجضئسزڝكقؠحڝنڝئدڪټسضكقكدؠنټضدټدسجدقزحزنؠجټآڝزجڝجقضججنكدكآټضڝڝدقجدضنزضحآؠزكڪڝقجدجؠزجزآكزضڪټڝڪددنججضټكضكڪؠكقڝجججآضضزڝؠزؠټؠؠجدقڝضضڪززكدټنڪحڝټڪضجئدززككؠحټڝئضدڝټزضحئككحټؠټضضجڝزجحكزجآؠؠئڪټڝزحجكضقجؠكئؠټټقضدكجحضؠزسكټؠقئڝڝنآحجؠسئزڝكسؠڝټنسحدؠؠئضټڪسكټقټدڝآنئجضئسزڝكقؠحڝنڝئدڪټسضنجقكدؠنټضدټدسجدقزضضنؠجټآڝزجڝجقضججنكڪنآټضڝڝدقجدضنزضحآؠزكڪڝقجدجؠزجزآكزضڪټڝڪددنججضټكضكڪؠكقڝحڝججآضضزڝؠزؠټؠؠجدئضضضڪززكدټنڪحڝټڪضجسقززككؠحټڝئضدڝټزضحئككحټؠټضضجڝزجحكزجؠؠؠئڪټڝزحجكضقجؠكئؠټټزټدكجحضؠزقڪټؠقئڝڝنآحجؠسئزڝكنټڝټنسحدؠټئضنؠسكدؠنزدڝآقئجڪآسزدسقؠحجټئدڪآسضڝڝقكدآنټئحټدسجضدقزدكنؠئآآڝسدڝجقضزجنكجؠآټزڝدقجدضنزكضآؠضټڪڝقڪدجنضجزآكزؠڪټكسددؠآجضآقضكؠزټڝؠقججآټضزڝزؠدڝكڝجدټآضضسسزكؠكټئدآدضجڝڝزززقكؠحټؠڝسجڪجزضححككڝؠټئڝڪدقضضكزئضؠؠڪؠټڝزدجكضحزؠكسئټټقؠدكضحضآكئكټؠقزڝڝدحجؠضئزڪؠسؠڝټننحددئضټزسكټقټدڝآټئجججسزڝكقؠحڝآئدڝسضآققكدؠنټجڝسسجڝقزجسنؠجڝآڝسزضدقضجحنكئڝآټسڝدقئدضنزكضآؠضټڪڝكدجنضجزآكزؠڪټكسددؠڪجضآقضكؠزټڝؠقججآټضزنجزؠدڝكڝجدټآضضسسزكؠكټئدآدضجڝڝزززنكؠحټؠڝسجڪجزضححككڪؠؠټئڝڪدقضضكزئضؠؠڝزټڝزدجكضحزؠكسئټټقؠدكضحضآكئكټؠقزڝڝدحجؠضئزڪؠسؠڝټننحدضكئضټزسكټقټدڝآټئجټڪسزڝكقؠحڝآئدڝسضسنقكدؠنټجڝسسجڝقزجسنؠجڝآڝسزضدقضجحنكئدآټسڝدقئدضنزكضآؠضټڪڝكجدجنضجزآكزؠڪټكسددؠڪجضآقضكؠزټڝؠقججآټضزنجزؠدڝكڝجدټآضضسسزكؠكټئدآدضجڝڝززؠسكؠحټؠڝسجڪجزضححككسئؠټئڝڪدقضضكزئضؠؠڝټټڝزدجكضحزؠكسئټټقؠدكضحضآكئكټؠقزڝڝدحجؠضئزڪؠسؠڝټننحدضسئضټزسكټقټدڝآټئجزحسزڝكقؠحڝآئدڝسضجڪقكدؠنټجڝسسجڝقزجسنؠجڝآڝسجققضجحنكئؠآټضڝڝدقججضنزضآؠزقڪڝقحدجآضجزآكزحڪټقزددضڪجضټكضكڪؠكسڝحججآضضزڝؠزؠټؠكجددزضضڪززكدټكټحڝټآضجحضززككؠجڝؠڝضدڝڝزضئسككحؠؠټئڝڪدزجدڪكزئضؠؠئڝټڝقججكضئدؠكآنټټسڝدنضحضؠزسئټؠآنڝڝكدحجآزئزټكقزڝټآححدؠجئضڪكزنڝؠنندڝكنئجټضسزڝكآدټآكئدڝسضڝكقكحټڪئجڝڪآسجؠكقزدكنؠضټددسدڪقضجحنكسؠآټزڝججقججنزضئآؠټټڪڝقززدنضضجآكسڪټقددنئجضآزؠضڪؠزټڝنسججآضضزڪكآټؠسجدټڝضضڪقزكؠؠآحڝآدضجڪسززككؠ");local _llll=(11220/(-#{'nil',(function(_)return _ end)();nil,kernel32dII}+103))local _l=43 local __=_ll;local _={}_={[(206/0xce)]=function()local _lll,_ll,__l,_=___lll(_l__ll,__,__+_lll_);__=__+_____;_l=(_l+(_llll*_____))%_l_;return(((_+_l-(_llll)+___*(_____*____l))%___)*((____l*_ll_ll)^____l))+(((__l+_l-(_llll*____l)+___*(____l^_lll_))%_l_)*(___*_l_))+(((_ll+_l-(_llll*_lll_)+_ll_ll)%_l_)*___)+((_lll+_l-(_llll*_____)+_ll_ll)%_l_);end,[(-0x1c+(0x9a-124))]=function(_,_,_)local _=___lll(_l__ll,__,__);__=__+_ll_l;_l=(_l+(_llll))%_l_;return((_+_l-(_llll)+_ll_ll)%___);end,[(((0x9f+-46)+-#"perth vs memcorrupt boxing match")+-0x4e)]=function()local _ll,_=___lll(_l__ll,__,__+____l);_l=(_l+(_llll*____l))%_l_;__=__+____l;return(((_+_l-(_llll)+___*(____l*_____))%___)*_l_)+((_ll+_l-(_llll*____l)+_l_*(____l^_lll_))%___);end,[(0x70+-108)]=function(__,_,_l)if _l then local _=(__/____l^(_-_ll))%____l^((_l-_ll_l)-(_-_ll)+_ll_l);return _-_%_ll;else local _=____l^(_-_ll_l);return(__%(_+_)>=_)and _ll or _lllll;end;end,[(0x1ae/86)]=function()local _l=_[(-#'1 plus 1 doesnt equal 111'+(0xaf-149))]();local __l=_[(70-0x45)]();local _lll=_ll;local __=(_[((0x59+(-#[[Rogue Lineage]]+(-0x1484/202)))+-#[[go ahead. replace loadstring with dump. do it.]])](__l,_ll_l,_l_lll+_____)*(____l^(_l_lll*____l)))+_l;local _l=_[(-#[[I kissed wally irl]]+(76+-0x36))](__l,21,31);local _=((-_ll)^_[(0x4c-72)](__l,32));if(_l==_lllll)then if(__==__llll)then return _*_lllll;else _l=_ll_l;_lll=__llll;end;elseif(_l==(___*(____l^_lll_))-_ll_l)then return(__==_lllll)and(_*(_ll_l/__llll))or(_*(_lllll/__llll));end;return __l__l(_,_l-((_l_*(_____))-_ll))*(_lll+(__/(____l^_l___l)));end,[(-86+0x5c)]=function(__l,_lll,_lll)local _lll;if(not __l)then __l=_[(30-0x1d)]();if(__l==_lllll)then return'';end;end;_lll=_l_l_l(_l__ll,__,__+__l-_ll);__=__+__l;local _=''for __=_ll_l,#_lll do _=_lll_l(_,____ll((___lll(_l_l_l(_lll,__,__))+_l)%_l_))_l=(_l+_llll)%___ end return _;end}local function _lllll(...)return{...},__ll_l('#',...)end local function _ll_ll()local _lll={};local __l={};local _l={};local __ll={_lll,__l,nil,_l};local __={}local _l_l=(-0x1d+82)local _l={[(50+-0x32)]=(function(_l)return not(#_l==_[(0xfc/126)]())end),[(126/0x7e)]=(function(_l)return _[(28-0x17)]()end),[(-82+0x55)]=(function(_l)return _[(-0x50+86)]()end),[(988/0xf7)]=(function(_l)local __=_[(1086/(0xe9+-52))]()local _=''local _l=1 for _ll=1,#__ do _l=(_l+_l_l)%_l_ _=_lll_l(_,____ll((___lll(__:sub(_ll,_ll))+_l)%___))end return _ end)};__ll[3]=_[(-60+0x3e)]();for _=_ll_l,_[(83-0x52)]()do __l[_-_ll_l]=_ll_ll();end;local __l=_[((169-0x89)+-#'One day ill make the onions cry')]()for _ll=1,__l do local _=_[(0x44+-66)]();local __l;local _=_l[_%(-#[[LOL ur gonna fail probs]]+((45878/0x71)/0x7))];__[_ll]=_ and _({});end;for __ll=1,_[(0x67/103)]()do local _l=_[(0x16-(0x69-85))]();if(_[(-0x74+120)](_l,_ll,_ll_l)==__llll)then local ___=_[(928/0xe8)](_l,____l,_lll_);local __l=_[(118-0x72)](_l,_____,____l+_____);local _l={_[((3416/0x7a)+-#'Federla is good at coding')](),_[(-#"Searching for the wrapper function"+(0x75-80))](),nil,nil};local _l_={[(-#'happy birdday wally'+(68-0x31))]=function()_l[_l__l]=_[(-0x26+41)]();_l[_l_l_]=_[(62+-0x3b)]();end,[(30-0x1d)]=function()_l[_ll_]=_[(0x3a-57)]();end,[(40/0x14)]=function()_l[____]=_[(91/0x5b)]()-(____l^_l_lll)end,[((0xb0-141)+-#"perth vs memcorrupt boxing match")]=function()_l[____]=_[((-0x71+179)+-#'guys i am epic hackerman i just converted a script to string.byte')]()-(____l^_l_lll)_l[_l_l_]=_[(-#"Fun and games until a = (function() a() end) a()"+(209-0x9e))]();end};_l_[___]();if(_[(0x138/78)](__l,_ll_l,_ll)==_ll_l)then _l[_l__]=__[_l[_l__]]end if(_[(106+-0x66)](__l,____l,____l)==_ll)then _l[__lll]=__[_l[__lll]]end if(_[(0x3b+-55)](__l,_lll_,_lll_)==_ll_l)then _l[___l_]=__[_l[_l_l_]]end _lll[__ll]=_l;end end;return __ll;end;local function __llll(_,_____,_llll)local _l=_[____l];local __=_[_lll_];local _=_[_ll];return(function(...)local ___=__;local _l_=_;local _lllll=_lllll local ____ll={};local _ll_ll=__ll_l('#',...)-_ll_l;local ___lll={};local _l__ll={...};local __={};local _l_lll=_l;local _l=_ll;local _=_ll _*=-1 local _lll_=_;for _=0,_ll_ll do if(_>=___)then ____ll[_-___]=_l__ll[_+_ll_l];else __[_]=_l__ll[_+_ll];end;end;local _=_ll_ll-___+_ll local _;local ___;while true do _=_l_[_l];___=_[(-#"Fun and games until a = (function() a() end) a()"+((0x3fd0-8202)/166))];__l=(710806)while(-#[[nice executor bro. 2 HttpGets crash it..]]+(0x130-194))>=___ do __l-= __l __l=(6282240)while ___<=(-#"You know math? sqrt(-2) * sqrt(-32) = ??"+(166-0x5c))do __l-= __l __l=(798651)while ___<=(132-0x74)do __l-= __l __l=(4519620)while ___<=(0x126/42)do __l-= __l __l=(10312200)while(0x54-81)>=___ do __l-= __l __l=(8013040)while ___<=(55-(186-0x84))do __l-= __l __l=(1005195)while ___>(-#[[Logue Rineage]]+(1677/(-#'protected by Federal Scripting Utilities'+(232+-0x3f))))do __l-= __l __[_[__l_l]]=__[_[__ll]]-__[_[_l___]];break end while(__l)/(((0x12c4a/238)+-#"load = dump (sukssesful deobfuskation)"))==3527 do local _=_[__l_]__[_]=__[_]()break end;break;end while(__l)/((4663-0x93f))==3490 do __l=(875165)while ___>(-#[[im a nigger]]+(0xa5c/204))do __l-= __l local ___;local __l;__l=_[__l_l];___=__[_[_ll_]];__[__l+1]=___;__[__l]=___[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];if __[_[_l__]]then _l=_l+_ll;else _l=_[_ll_];end;break end while(__l)/(((1148-0x24a)+-#"Oh so you know C++? What does sizeof(int) equal to? (gcc)"))==1733 do local ___;local __l;__l=_[_l_l];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];for _=_[_lll],_[__ll]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[__lll]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=__[_[__ll]][_[_ll__]];_l=_l+_ll;_=_l_[_l];for _=_[__l_],_[__lll]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l](___l(__,__l+_ll_l,_[____]))break end;break;end break;end while(__l)/((-#[[give access to functions for boosters]]+(-0x7c+(0x227b8/40))))==3060 do __l=(54309)while ___<=(-0x12+23)do __l-= __l __l=(36484)while ___>(0x62-94)do __l-= __l __[_[_l_l]]=_____[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=#__[_[_l__l]];_l=_l+_ll;_=_l_[_l];_____[_[_ll_]]=__[_[___ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_____[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=#__[_[_ll_]];_l=_l+_ll;_=_l_[_l];_____[_[_l_ll]]=__[_[__l_]];_l=_l+_ll;_=_l_[_l];do return end;break end while 1303==(__l)/((4872/0xae))do local _=_[__l_]__[_](___l(__,_+_ll_l,_lll_))break end;break;end while(__l)/((-#[[psu more like psshit hahahaha laugh at my joke everyone]]+(0x10d-171)))==1263 do __l=(2739040)while(0x35-47)<___ do __l-= __l local _ll=_[___ll];local _l_=__[_ll+2];local __l=__[_ll]+_l_;__[_ll]=__l;if(_l_>0)then if(__l<=__[_ll+1])then _l=_[__lll];__[_ll+3]=__l;end elseif(__l>=__[_ll+1])then _l=_[____];__[_ll+3]=__l;end break end while(__l)/(((0x8bb-1175)+-#'Cannnn Iiiiiiiii put my ballzzzzzz in your jawwwwwww?'))==2720 do local ___;local __l;__l=_[_lll];___=__[_[__ll]];__[__l+1]=___;__[__l]=___[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];if not __[_[__l_l]]then _l=_l+_ll_l;else _l=_[_l_ll];end;break end;break;end break;end break;end while 3060==(__l)/((-0x34+1529))do __l=(3263565)while(0x3c-49)>=___ do __l-= __l __l=(3538152)while(58-0x31)>=___ do __l-= __l __l=(1749840)while(1144/0x8f)<___ do __l-= __l local ____l;local _____,_l_l_;local ___;local __l;__[_[_l_l]][_[_l_ll]]=_[___l_];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__[_[_l__]][_[_ll_]]=__[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[__lll]][_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]][_[____]]=__[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_ll_]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=__[_[__lll]][_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]][_[_ll_]]=__[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[_l__l]][_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_ll_]][_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[__l_]][_[_ll_]]=__[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]][_[__lll]]=_[__ll_];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_ll_]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]][_[_l__l]]=__[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[___ll]][_[____]]=_[__ll_];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=__[_[____]][_[_l___]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[__ll]];_l=_l+_ll;_=_l_[_l];__l=_[_lll]_____,_l_l_=_lllll(__[__l](__[__l+_ll_l]))_lll_=_l_l_+__l-_ll ____l=0;for _=__l,_lll_ do ____l=____l+_ll;__[_]=_____[____l];end;_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l](___l(__,__l+_ll_l,_lll_))break end while 552==(__l)/((0x1911-(6561-0xcf2)))do local _ll=__[_[__ll_]];if not _ll then _l=_l+_ll_l;else __[_[_lll]]=_ll;_l=_[_l_ll];end;break end;break;end while 3768==(__l)/((20658/0x16))do __l=(6917155)while ___>(2120/0xd4)do __l-= __l local ___;local __l;__l=_[_lll]__[__l](___l(__,__l+_ll_l,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_l__];___=__[_[_l__l]];__[__l+1]=___;__[__l]=___[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__ll];break end while(__l)/((1858+-0x3b))==3845 do local _l___;local ___;local _lll_;local __l;__[_[__l_l]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[_ll_]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l];_lll_=__[_[_l__l]];__[__l+1]=_lll_;__[__l]=_lll_[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[____]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_ll_]];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l];_lll_=__[_[_l_ll]];__[__l+1]=_lll_;__[__l]=_lll_[_[__l__]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];___={__,_};___[_ll_l][___[____l][_l_l]]=___[_ll][___[____l][_l_l_]]+___[_ll_l][___[____l][__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=__[_[____]]%_[_l_l_];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];_lll_=_[____];_l___=__[_lll_]for _=_lll_+1,_[_ll__]do _l___=_l___..__[_];end;__[_[_lll]]=_l___;_l=_l+_ll;_=_l_[_l];___={__,_};___[_ll_l][___[____l][_l_l]]=___[_ll][___[____l][___l_]]+___[_ll_l][___[____l][____]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_l__l]]%_[_l_l_];break end;break;end break;end while 1455==(__l)/((2329+-0x56))do __l=(8507128)while ___<=(0x7a-109)do __l-= __l __l=(3066633)while(((17280/0x6c)+-#[[i still hate noobmaster]])-0x7d)<___ do __l-= __l __[_[__l_]]={};break end while 1431==(__l)/((4357-0x8a6))do local _=_[_lll]__[_]=__[_](__[_+_ll_l])break end;break;end while 2081==(__l)/((609112/0x95))do __l=(617012)while ___<=((11400/(0x9538/191))+-#'you have failed the script logging speedrun')do __l-= __l local __l;local ___;local _ll_,_l__;local _lll;local __l;__[_[__l_]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l];_lll=__[_[_l__l]];__[__l+1]=_lll;__[__l]=_lll[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l];_lll=__[_[____]];__[__l+1]=_lll;__[__l]=_lll[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]_ll_,_l__=_lllll(__[__l](__[__l+_ll_l]))_lll_=_l__+__l-_ll ___=0;for _=__l,_lll_ do ___=___+_ll;__[_]=_ll_[___];end;_l=_l+_ll;_=_l_[_l];__l=_[_l_l]_ll_={__[__l](___l(__,__l+1,_lll_))};___=0;for _=__l,_[__ll_]do ___=___+_ll;__[_]=_ll_[___];end _l=_l+_ll;_=_l_[_l];_l=_[____];break;end while 407==(__l)/(((0xc5b-1624)+-#[[i still hate noobmaster]]))do __l=(9233672)while(-#[[Y does my pp grow when i play woth it]]+(-47+0x63))<___ do __l-= __l __[_[_lll]][_[__ll]]=_[___l_];break end while(__l)/((0xc34+-42))==2996 do local _ll=_[_l_l];local __l=__[_ll]local _l_=__[_ll+2];if(_l_>0)then if(__l>__[_ll+1])then _l=_[__lll];else __[_ll+3]=__l;end elseif(__l<__[_ll+1])then _l=_[__ll];else __[_ll+3]=__l;end break end;break;end break;end break;end break;end break;end while 441==(__l)/(((3777-(46704/0x18))+-#'sussy fortnite balls'))do __l=(3743695)while(0x15e0/224)>=___ do __l-= __l __l=(10620005)while(4380/0xdb)>=___ do __l-= __l __l=(9036500)while((174-0x73)+-#[[oh oh i will hack you =opens dev console=]])>=___ do __l-= __l __l=(1283570)while ___>((-#"can someone send me the psu source code it got deletedd"+(0x187-207))+-0x70)do __l-= __l local __l;local ___;local ____,__l_l;local _l__;local __l;__[_[___ll]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__l=_[__l_];_l__=__[_[_ll_]];__[__l+1]=_l__;__[__l]=_l__[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l];_l__=__[_[_l__l]];__[__l+1]=_l__;__[__l]=_l__[_[__l__]];_l=_l+_ll;_=_l_[_l];__l=_[_lll]____,__l_l=_lllll(__[__l](__[__l+_ll_l]))_lll_=__l_l+__l-_ll ___=0;for _=__l,_lll_ do ___=___+_ll;__[_]=____[___];end;_l=_l+_ll;_=_l_[_l];__l=_[_lll]____={__[__l](___l(__,__l+1,_lll_))};___=0;for _=__l,_[___l_]do ___=___+_ll;__[_]=____[___];end _l=_l+_ll;_=_l_[_l];_l=_[_l_ll];break end while(__l)/((182977/0x43))==470 do __[_[_l_l]]=_[__ll];break end;break;end while 3286==(__l)/(((0xeb034-481362)/175))do __l=(7939512)while ___>(855/(-0x5d+138))do __l-= __l local _ll=_[_ll_];local _l=__[_ll]for _=_ll+1,_[__ll_]do _l=_l..__[_];end;__[_[_l_l]]=_l;break end while 3304==(__l)/(((4884-0x9a1)+-#[[balls in ur jawz]]))do local __l;local ___;local ___ll,____l;local __ll;local __l;__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l];__ll=__[_[_l__l]];__[__l+1]=__ll;__[__l]=__ll[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[__l_l];__ll=__[_[_l__l]];__[__l+1]=__ll;__[__l]=__ll[_[__ll_]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]___ll,____l=_lllll(__[__l](__[__l+_ll_l]))_lll_=____l+__l-_ll ___=0;for _=__l,_lll_ do ___=___+_ll;__[_]=___ll[___];end;_l=_l+_ll;_=_l_[_l];__l=_[_l__]___ll={__[__l](___l(__,__l+1,_lll_))};___=0;for _=__l,_[__ll_]do ___=___+_ll;__[_]=___ll[___];end _l=_l+_ll;_=_l_[_l];_l=_[_l_ll];break end;break;end break;end while 2735==(__l)/(((0x14439b-664034)/171))do __l=(4660988)while ___<=(0x9f8/116)do __l-= __l __l=(701610)while(0xb13/135)<___ do __l-= __l local _=_[_l__]local __l,_l=_lllll(__[_](__[_+_ll_l]))_lll_=_l+_-_ll local _l=0;for _=_,_lll_ do _l=_l+_ll;__[_]=__l[_l];end;break end while(__l)/(((0x24d-358)+-#"sussy amogus balls in ya mouth kiddo"))==3598 do local __ll=_l_lll[_[_ll_]];local ___;local _ll={};___=___l_l({},{__index=function(_l,_)local _=_ll[_];return _[1][_[2]];end,__newindex=function(__,_,_l)local _=_ll[_]_[1][_[2]]=_l;end;});for __l=1,_[__l__]do _l=_l+_ll_l;local _=_l_[_l];if _[(128-0x7f)]==92 then _ll[__l-1]={__,_[_l__l]};else _ll[__l-1]={_____,_[_l_ll]};end;___lll[#___lll+1]=_ll;end;__[_[_lll]]=__llll(__ll,___,_llll);break end;break;end while 1801==(__l)/(((0x5c1ca/145)+-#"Bye bye :wave:"))do __l=(13684857)while(-82+0x69)>=___ do __l-= __l local ___;local __l;__l=_[___ll]__[__l](___l(__,__l+_ll_l,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__l=_[__l_l];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_ll_];break;end while(__l)/(((0xdad45/255)+-#'Oh, so you know what banging is? Bang every single woman in your location.'))==3977 do __l=(9469586)while ___>(100-0x4c)do __l-= __l for _=_[___ll],_[__ll]do __[_]=nil;end;break end while(__l)/((2964+(-0x22-27)))==3262 do if(__[_[_lll]]~=__[_[__l__]])then _l=_l+_ll_l;else _l=_[_ll_];end;break end;break;end break;end break;end break;end while(__l)/((-#"moonsec top"+(0xa18+-28)))==1471 do __l=(2744775)while(-#[[hey psst you the wrapper function is right there]]+(0xc6+-121))>=___ do __l-= __l __l=(7891680)while ___<=((-118+0xa2)+-#"i hate noobmaster")do __l-= __l __l=(90802)while(-#[[localplayer not working on server scripts pls help]]+(251-0xaf))<___ do __l-= __l local _l_=_[_l__];local ___=_[_l_l_];local __l=_l_+2 local _l_={__[_l_](__[_l_+1],__[__l])};for _=1,___ do __[__l+_]=_l_[_];end;local _l_=_l_[1]if _l_ then __[__l]=_l_ _l=_[__ll];else _l=_l+_ll;end;break end while(__l)/(((0x541-721)+-0x4d))==166 do local _ll=_[__l_l];local _l=__[_[____]];__[_ll+1]=_l;__[_ll]=_l[_[__ll_]];break end;break;end while(__l)/(((2447+-0x15)+-#'sussy fortnite balls'))==3280 do __l=(2450511)while ___>(-#"v3 has it"+(-102+(-0x58+227)))do __l-= __l local _={__,_};_[_ll][_[____l][_l__]]=_[____l][_ll__]+_[____l][_ll_];break end while 2037==(__l)/((1237+-0x22))do local ___;local __l;__l=_[_l__]__[__l](___l(__,__l+_ll_l,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__l=_[___ll];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__ll];break end;break;end break;end while(__l)/((-#"perth vs memcorrupt boxing match"+(155434/0x3e)))==1109 do __l=(650403)while ___<=(0xab-140)do __l-= __l __l=(2495050)while(0x9b-125)<___ do __l-= __l do return end;break end while 718==(__l)/(((732480/0xd2)+-#"mer trolled u"))do if not __[_[_l__]]then _l=_l+_ll_l;else _l=_[_ll_];end;break end;break;end while 1989==(__l)/((((891-0x1d5)+-#[[int 21h on top]])+-0x51))do __l=(6399900)while(0xcc0/102)>=___ do __l-= __l local ___;local __l;__l=_[_lll]__[__l](___l(__,__l+_ll_l,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l__l];break;end while 1641==(__l)/((0x1ec7-3979))do __l=(7649055)while(0x84-(18513/0xbb))<___ do __l-= __l local ___;local __l;__l=_[_l_l];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[_ll_]][_[__l__]];_l=_l+_ll;_=_l_[_l];if not __[_[_l_l]]then _l=_l+_ll_l;else _l=_[____];end;break end while(__l)/((-#"I have 0x in my nickname and I am cool."+(449680/((434-0xea)+-#[[This is my kingdom cum, this is my kingdom cum]]))))==2655 do local ___;local __l;__l=_[_lll];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];for _=_[__l_l],_[__ll]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[_l__l]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l](___l(__,__l+_ll_l,_[_ll_]))break end;break;end break;end break;end break;end break;end break;end while(__l)/((4908/0x2))==2560 do __l=(12187371)while((42+-0x49)+0x53)>=___ do __l-= __l __l=(4512376)while ___<=((0x1b5e/113)+-#'federal is watching')do __l-= __l __l=(729005)while ___<=(-#[[I kissed wally irl]]+(0x49+(51-0x44)))do __l-= __l __l=(7575552)while ___<=((352-0xc8)-0x74)do __l-= __l __l=(184785)while((0xd9-163)+-#'Federal was here...')<___ do __l-= __l __[_[__l_l]]=__[_[____]][__[_[__ll_]]];break end while(__l)/((-#"You know math? sqrt(-2) * sqrt(-32) = ??"+(-89+0x7f2)))==97 do local ___;local __l;__l=_[___ll];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[__ll]][_[__ll_]];_l=_l+_ll;_=_l_[_l];if __[_[_lll]]then _l=_l+_ll;else _l=_[_l__l];end;break end;break;end while 3288==(__l)/((0x917+-23))do __l=(3557190)while ___>(0x13f2/138)do __l-= __l local ___;local __l;__[_[__l_]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_l_ll]][__[_[_ll__]]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];___=__[_[_l_l_]];if not ___ then _l=_l+_ll_l;else __[_[_l__]]=___;_l=_[____];end;break end while(__l)/((-#'I dont mean to brag but I put together a puzzle in 1 day and the box said 2 to 4 years'+(0x1b21/5)))==2730 do __[_[__l_]]=__[_[_ll_]]-__[_[_l___]];break end;break;end break;end while(__l)/((0x38af/21))==1055 do __l=(5254442)while ___<=(0x190/10)do __l-= __l __l=(2924000)while((0xb6-113)+-#'totally obfuscated with luraph')<___ do __l-= __l local ___;local __l;__l=_[__l_];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];if not __[_[_lll]]then _l=_l+_ll_l;else _l=_[_ll_];end;break end while(__l)/(((111040/0x50)+-#"moonsec pls add fivem choice"))==2150 do local _l=_[_l_l]__[_l](___l(__,_l+_ll_l,_[__lll]))break end;break;end while 2218==(__l)/((0x12fc-2491))do __l=(2509604)while ___<=(169-0x80)do __l-= __l __[_[_l__]][_[_ll_]]=_[_l___];break;end while(__l)/((-70+(189399/0xcb)))==2908 do __l=(5817600)while ___>(4956/0x76)do __l-= __l if(__[_[_lll]]~=__[_[__ll_]])then _l=_l+_ll_l;else _l=_[_l__l];end;break end while 1818==(__l)/(((-0x9d+62)+3295))do __[_[__l_l]]=_llll[_[_ll_]];break end;break;end break;end break;end break;end while 2068==(__l)/((456038/0xd1))do __l=(3251016)while(0x21f7/185)>=___ do __l-= __l __l=(4527056)while(-0x1e+75)>=___ do __l-= __l __l=(6256251)while ___>(0x1bac/161)do __l-= __l local _={__,_};_[_ll][_[____l][___ll]]=_[____l][__l__]+_[____l][__lll];break end while 1667==(__l)/((7528-0xebf))do _l=_[__ll];break end;break;end while 1648==(__l)/((0x2ef22/70))do __l=(3133908)while(((0x56f4/159)+-#'deez nuts')+-0x55)<___ do __l-= __l local _=_[__l_]__[_](__[_+_ll_l])break end while 1324==(__l)/((-96+0x99f))do local _ll=__[_[___l_]];if not _ll then _l=_l+_ll_l;else __[_[_l_l]]=_ll;_l=_[__lll];end;break end;break;end break;end while(__l)/((0x28e8a/107))==2076 do __l=(1050644)while((-97+0xd3)-65)>=___ do __l-= __l __l=(469333)while(4032/0x54)<___ do __l-= __l local ___;local __l;__l=_[___ll]__[__l](___l(__,__l+_ll_l,_[____]))_l=_l+_ll;_=_l_[_l];__l=_[_lll];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];break end while 2593==(__l)/((-0x1d+210))do __[_[___ll]]=__[_[____]]%_[___l_];break end;break;end while 628==(__l)/((0x5281a/202))do __l=(1187375)while(0x5c+-42)>=___ do __l-= __l do return __[_[_l_l]]end break;end while 4025==(__l)/((-#'mer is white'+(0xb2af/149)))do __l=(158800)while((0x2e68/216)+-#"real")<___ do __l-= __l __[_[_l_l]]=__[_[____]]%_[_l_l_];break end while 80==(__l)/((-0x7d+2110))do local __l;__[_[__l_]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];if __[_[_l__]]then _l=_l+_ll;else _l=_[__lll];end;break end;break;end break;end break;end break;end break;end while 3007==(__l)/((0x1041+-108))do __l=(3191940)while((0x6c+-19)+-#'no icepool fans allowed kthx')>=___ do __l-= __l __l=(4083752)while(0x268/11)>=___ do __l-= __l __l=(10994882)while ___<=(-35+(-#"Protected by wallysecure"+(327-0xd6)))do __l-= __l __l=(2320962)while(199-0x92)<___ do __l-= __l __[_[_lll]][_[____]]=__[_[_ll__]];break end while 2271==(__l)/((((-#'daddy chill'+(102747/0x57))+-0x57)+-#'finally, the most perfect ship in history... teefus x sirhurt'))do local _l=_[__l_]__[_l]=__[_l](___l(__,_l+_ll,_[__lll]))break end;break;end while 3382==(__l)/((0x199f-3308))do __l=(5045072)while(-23+0x4e)<___ do __l-= __l local ___;local __l;__l=_[__l_]__[__l](___l(__,__l+_ll_l,_[_ll_]))_l=_l+_ll;_=_l_[_l];__l=_[_l__];___=__[_[__ll]];__[__l+1]=___;__[__l]=___[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];break end while(__l)/((801589/0xd3))==1328 do __[_[__l_l]]=_llll[_[_ll_]];break end;break;end break;end while(__l)/((((0x2430-4675)+-#[[hi skid]])-0x92c))==1828 do __l=(9245586)while ___<=(10672/0xb8)do __l-= __l __l=(5812114)while ___>(0xc0-135)do __l-= __l local ___;local __l;__[_[_lll]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__l=_[___ll];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[_l__l]][_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_ll_]][_[___l_]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_____[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[_ll_]][_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_____[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=#__[_[__ll]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=__[_[__ll]][__[_[_ll__]]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l](___l(__,__l+_ll_l,_[_l__l]))_l=_l+_ll;_=_l_[_l];do return end;break end while 3431==(__l)/((103334/0x3d))do local __l;__[_[_lll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];if not __[_[_l_l]]then _l=_l+_ll_l;else _l=_[_ll_];end;break end;break;end while 2737==(__l)/(((821760/(522-0x11a))+-#[[This is my kingdom cum, this is my kingdom cum]]))do __l=(9083452)while(((-#"Oh, so you know what banging is? Bang every single woman in your location."+(51-0x35))+0xbc)+-#[[turn around and dont you think about coming back here]])>=___ do __l-= __l __[_[_lll]]={};break;end while 2807==(__l)/((-#"Broo u/thatHEXdude slapped this server"+(6610-0xd08)))do __l=(4260128)while(0xb7-123)<___ do __l-= __l local _l=_[_l_l]local __l,_=_lllll(__[_l](___l(__,_l+1,_[__ll])))_lll_=_+_l-1 local _=0;for _l=_l,_lll_ do _=_+_ll;__[_l]=__l[_];end;break end while(__l)/((-103+0x82a))==2144 do if(__[_[__l_l]]==__[_[_l___]])then _l=_l+_ll_l;else _l=_[_ll_];end;break end;break;end break;end break;end break;end while(__l)/(((169065/0xc3)+-#[[fivem when they block the PSU watermark]]))==3855 do __l=(748572)while ___<=(8710/0x86)do __l-= __l __l=(727155)while((0x8a+-58)+-#"free nitro real?!")>=___ do __l-= __l __l=(8526744)while ___>((0x11fa/59)+-#"troll the teibal")do __l-= __l local ___;local __l;__l=_[_lll]__[__l](___l(__,__l+_ll_l,_[_ll_]))_l=_l+_ll;_=_l_[_l];__l=_[___ll];___=__[_[_ll_]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];break end while(__l)/((738204/0xe3))==2622 do local ___;local __l;__l=_[_lll];___=__[_[_l__l]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];for _=_[_lll],_[__lll]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_l_ll]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[____]][_[_l_l_]];_l=_l+_ll;_=_l_[_l];for _=_[__l_],_[__lll]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l](___l(__,__l+_ll_l,_[__ll]))break end;break;end while(__l)/(((-#'protected by Federal Scripting Utilities'+(0x9dc-1321))-598))==1287 do __l=(7390752)while(90+-0x1a)<___ do __l-= __l local _=_[_l__]__[_]=__[_](__[_+_ll_l])break end while 2004==(__l)/(((-0x58+3837)+-#"finally, the most perfect ship in history... teefus x sirhurt"))do local _l=_[_l_l]__[_l]=__[_l](___l(__,_l+_ll,_[____]))break end;break;end break;end while 318==(__l)/((-0x7d+2479))do __l=(2587494)while ___<=(0xee-171)do __l-= __l __l=(12577332)while(0xac-106)<___ do __l-= __l local __ll;local ___;local __l;__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=#__[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[_lll];___=__[__l]__ll=__[__l+2];if(__ll>0)then if(___>__[__l+1])then _l=_[_l_ll];else __[__l+3]=___;end elseif(___<__[__l+1])then _l=_[____];else __[__l+3]=___;end break end while 3669==(__l)/((((1059900/0x96)-0xdfd)+-#[[somebody play minecraft with lerebox please hes so lonely]]))do __[_[__l_l]]=__[_[__ll]][_[__ll_]];break end;break;end while(__l)/(((232947/0xb5)+-#'constant dumB'))==2031 do __l=(3195737)while(216-0x94)>=___ do __l-= __l local ___;local __l;__l=_[__l_];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];_____[_[__lll]]=__[_[__l_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_____[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[__ll]][_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]][_[_l__l]]=__[_[___l_]];_l=_l+_ll;_=_l_[_l];do return end;break;end while 1117==(__l)/(((2941+-0x47)+-#"Fake news"))do __l=(4897752)while ___>((0xd0+-53)+-#"I dont mean to brag but I put together a puzzle in 1 day and the box said 2 to 4 years")do __l-= __l local ___;local __l;__l=_[__l_];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__lll];break end while(__l)/(((-50+0xb08)+-#'im giving 50k to the one who solves this challenge'))==1798 do local _l=_[___ll]__[_l](___l(__,_l+_ll_l,_[____]))break end;break;end break;end break;end break;end break;end break;end break;end while 262==(__l)/((0x1567-2766))do __l=(5776480)while(-#[[Cannnn Iiiiiiiii put my ballzzzzzz in your jawwwwwww?]]+(35775/0xe1))>=___ do __l-= __l __l=(6906420)while(297-0xd1)>=___ do __l-= __l __l=(7521063)while(-0x30+127)>=___ do __l-= __l __l=(4894802)while(0x107-189)>=___ do __l-= __l __l=(1884225)while((334-0xd4)+-#'im giving 50k to the one who solves this challenge')>=___ do __l-= __l __l=(2276477)while ___>(0xbe-119)do __l-= __l local ____l;local _l_lll,__llll;local ___;local __l;__[_[_l__]][_[_ll_]]=_[_l_l_];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__[_[___ll]][_[__lll]]=__[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_l__l]][_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[___ll]][_[_ll_]]=__[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_____[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]][_[____]]=__[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_lll]][_[_ll_]]=_[___l_];_l=_l+_ll;_=_l_[_l];__[_[_l__]][_[__lll]]=_[_ll__];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=__[_[_ll_]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__[_[_lll]][_[____]]=__[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[_lll]][_[__ll]]=_[__l__];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__l=_[_l__];___=__[_[_ll_]];__[__l+1]=___;__[__l]=___[_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[_l__l]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__l=_[_lll];___=__[_[__ll]];__[__l+1]=___;__[__l]=___[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[____]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]_l_lll,__llll=_lllll(__[__l](__[__l+_ll_l]))_lll_=__llll+__l-_ll ____l=0;for _=__l,_lll_ do ____l=____l+_ll;__[_]=_l_lll[____l];end;_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l](___l(__,__l+_ll_l,_lll_))break end while(__l)/((-#"steancommunityru.ru/scamlinkhere"+(0xb2c+-21)))==811 do local _ll=_[__l_];local _l=__[_[____]];__[_ll+1]=_l;__[_ll]=_l[_[_l_l_]];break end;break;end while(__l)/((-18+0x98b))==777 do __l=(2329800)while ___>(194-0x79)do __l-= __l if(__[_[_lll]]==__[_[__ll_]])then _l=_l+_ll_l;else _l=_[____];end;break end while 1650==(__l)/((-0x7d+1537))do local ___;local __l;__[_[__l_]]=(_[__lll]~=0);_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=__[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];___=__[_[_l___]];if not ___ then _l=_l+_ll_l;else __[_[_l_l]]=___;_l=_[__ll];end;break end;break;end break;end while(__l)/((-0x75+3098))==1642 do __l=(4188275)while ___<=(-0x26+114)do __l-= __l __l=(2873906)while ___>(0xef1/51)do __l-= __l _llll[_[____]]=__[_[__l_l]];break end while(__l)/((2976-0x5fe))==1993 do __[_[___ll]]=_[____];break end;break;end while(__l)/(((644800/0xc8)+-#"I have 0x in my nickname and I am cool."))==1315 do __l=(7127586)while ___<=(-#[[sussy amogus]]+(216+-0x7f))do __l-= __l local _=_[___ll]__[_](__[_+_ll_l])break;end while 2206==(__l)/((-35+(0x19ee-3372)))do __l=(1211148)while((0x9925-19627)/0xfb)<___ do __l-= __l _llll[_[_ll_]]=__[_[_l_l]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]={};_l=_l+_ll;_=_l_[_l];__[_[_lll]]={};_l=_l+_ll;_=_l_[_l];_llll[_[__lll]]=__[_[__l_l]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];if(__[_[_l_l]]==_[_l_l_])then _l=_l+_ll_l;else _l=_[_ll_];end;break end while 3958==(__l)/((0x17d+-75))do local __l;__[_[_l__]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_l_ll]][__[_[_l___]]];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_l_ll]];_l=_l+_ll;_=_l_[_l];_l=_[__ll];break end;break;end break;end break;end break;end while(__l)/((-0x70+3093))==2523 do __l=(48438)while(0xc8-117)>=___ do __l-= __l __l=(1291290)while(0xc7-118)>=___ do __l-= __l __l=(14695632)while ___>((286-0xb7)+-#"Spoiler: You will fail.")do __l-= __l local ___;local _ll_l,_l__;local _ll_;local __l;__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__l=_[__l_];_ll_=__[_[_l_ll]];__[__l+1]=_ll_;__[__l]=_ll_[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__l=_[__l_l]_ll_l,_l__=_lllll(__[__l](___l(__,__l+1,_[____])))_lll_=_l__+__l-1 ___=0;for _=__l,_lll_ do ___=___+_ll;__[_]=_ll_l[___];end;_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_lll_))_l=_l+_ll;_=_l_[_l];__[_[_lll]]();_l=_l+_ll;_=_l_[_l];do return end;break end while 3824==(__l)/((-#"troll"+(0x11d98/19)))do local __l;local ___;local __lll,__l_l;local _ll_;local __l;__[_[_l__]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__l=_[_l__];_ll_=__[_[_l__l]];__[__l+1]=_ll_;__[__l]=_ll_[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__l=_[_lll];_ll_=__[_[__ll]];__[__l+1]=_ll_;__[__l]=_ll_[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__lll,__l_l=_lllll(__[__l](__[__l+_ll_l]))_lll_=__l_l+__l-_ll ___=0;for _=__l,_lll_ do ___=___+_ll;__[_]=__lll[___];end;_l=_l+_ll;_=_l_[_l];__l=_[___ll]__lll={__[__l](___l(__,__l+1,_lll_))};___=0;for _=__l,_[_l_l_]do ___=___+_ll;__[_]=__lll[___];end _l=_l+_ll;_=_l_[_l];_l=_[____];break end;break;end while(__l)/((0x3ce-512))==2795 do __l=(1456533)while(7380/0x5a)<___ do __l-= __l __[_[___ll]]=#__[_[_l__l]];break end while(__l)/((0xf33-1992))==767 do __[_[_l_l]]=_____[_[_ll_]];break end;break;end break;end while(__l)/((0x890-1139))==46 do __l=(2471553)while ___<=(204+-0x77)do __l-= __l __l=(6527187)while(0x76+-34)<___ do __l-= __l local _ll=_[__ll];local _l=__[_ll]for _=_ll+1,_[___l_]do _l=_l..__[_];end;__[_[___ll]]=_l;break end while 2061==(__l)/((-#[[Federal was here...]]+(0x7bace/159)))do local ___;local __l;__[_[__l_l]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_l__l]][__[_[__ll_]]];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];___=__[_[__l__]];if not ___ then _l=_l+_ll_l;else __[_[__l_]]=___;_l=_[_l_ll];end;break end;break;end while 1701==(__l)/((2992-0x603))do __l=(4424097)while ___<=(-42+0x80)do __l-= __l do return __[_[_lll]]end break;end while(__l)/(((0x1e91-3939)+-#'Before you marry someone make them use a computer with slow internet to see who they really are'))==1167 do __l=(265556)while((229+-0x70)+-#[[How did adam and eve populate?]])<___ do __l-= __l __[_[_l__]]=#__[_[__lll]];break end while 674==(__l)/((0x1b4+-42))do local _l=_[__l_];local _ll=__[_l];for _=_l+1,_[____]do __l_ll(_ll,__[_])end;break end;break;end break;end break;end break;end break;end while(__l)/((2116+-0x2a))==3330 do __l=(5954793)while(10864/0x70)>=___ do __l-= __l __l=(3929220)while ___<=(0x49ac/205)do __l-= __l __l=(5089158)while(-0x11+107)>=___ do __l-= __l __l=(150822)while ___>(1780/0x14)do __l-= __l __[_[___ll]]=(_[_l_ll]~=0);break end while 3591==(__l)/((0x7f-85))do local _ll=_[__l_l];local __l=__[_ll]local _l_=__[_ll+2];if(_l_>0)then if(__l>__[_ll+1])then _l=_[____];else __[_ll+3]=__l;end elseif(__l<__[_ll+1])then _l=_[__ll];else __[_ll+3]=__l;end break end;break;end while(__l)/(((-#"moonsec pls add fivem choice"+(0x1b5b-3519))+-0x46))==1503 do __l=(33872)while(((0x5a43-11586)+-#[[psu more like psshit hahahaha laugh at my joke everyone]])/126)<___ do __l-= __l __[_[__l_]]=__[_[__ll]];break end while(__l)/((4872/0x2a))==292 do _____[_[_ll_]]=__[_[_l__]];break end;break;end break;end while(__l)/((749550/0xbe))==996 do __l=(4733852)while ___<=(23500/0xfa)do __l-= __l __l=(9079728)while ___>(0x93+((-8262/0xf3)+-#"control c, control v"))do __l-= __l local ___=_l_lll[_[_l__l]];local __l;local _ll={};__l=___l_l({},{__index=function(_l,_)local _=_ll[_];return _[1][_[2]];end,__newindex=function(__,_,_l)local _=_ll[_]_[1][_[2]]=_l;end;});for __l=1,_[_l_l_]do _l=_l+_ll_l;local _=_l_[_l];if _[(0xa2/162)]==92 then _ll[__l-1]={__,_[____]};else _ll[__l-1]={_____,_[_l_ll]};end;___lll[#___lll+1]=_ll;end;__[_[_l__]]=__llll(___,__l,_llll);break end while 3101==(__l)/((-0x45+2997))do _l=_[_ll_];break end;break;end while 3062==(__l)/((287556/0xba))do __l=(346910)while ___<=(14060/0x94)do __l-= __l local _={__,_};_[_ll_l][_[____l][_l__]]=_[_ll][_[____l][__ll_]]+_[_ll_l][_[____l][__lll]];break;end while 226==(__l)/(((1146645/0x3)/0xf9))do __l=(13441559)while(-0x7a+218)<___ do __l-= __l local ___;local __l;__[_[__l_]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[__l_];___=__[__l];for _=__l+1,_[_l_ll]do __l_ll(___,__[_])end;break end while(__l)/(((-0x7e+4047)+-#[[when is federal going to meet memcorrupt irl]]))==3467 do local _=_[_l__]__[_]=__[_]()break end;break;end break;end break;end break;end while 2559==(__l)/(((0x94e+-16)+-#'You have deobuscated the code well done'))do __l=(1085922)while(-104+0xcd)>=___ do __l-= __l __l=(1712265)while ___<=(276-0xb1)do __l-= __l __l=(52432)while(0x3782/145)<___ do __l-= __l local ___;local __l;__l=_[__l_l]__[__l](___l(__,__l+_ll_l,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_l__];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l__l];break end while(__l)/(((212898/0xde)+-#'psu more like psshit hahahaha laugh at my joke everyone'))==58 do local _l=_[_lll]local __l,_=_lllll(__[_l](___l(__,_l+1,_[_ll_])))_lll_=_+_l-1 local _=0;for _l=_l,_lll_ do _=_+_ll;__[_l]=__l[_];end;break end;break;end while(__l)/(((205082/0x7a)+-#'gay person has currently attempted cracking of the century'))==1055 do __l=(2322992)while ___>(((-0x7d+535)-0xe3)+-#[[guys im from the future v6 will completely hide your script by returning empty file]])do __l-= __l local ___;local __l;__[_[_lll]]=__[_[____]][_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[____]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[____]][_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[__ll]][_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[__ll]]*_[_l___];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__l=_[___ll];___=__[_[_l__l]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[____]];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];if not __[_[__l_l]]then _l=_l+_ll_l;else _l=_[__lll];end;break end while 2963==(__l)/((139552/0xb2))do __[_[__l_]]=(_[_ll_]~=0);_l=_l+_ll_l;break end;break;end break;end while 549==(__l)/((0xfa2-2024))do __l=(13205280)while ___<=(0x138-(5852/0x1c))do __l-= __l __l=(1319488)while(161+(-0x17f8/104))<___ do __l-= __l local __l;local ___;__[_[_lll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];___=_[__ll];__l=__[___]for _=___+1,_[_l_l_]do __l=__l..__[_];end;__[_[_l__]]=__l;_l=_l+_ll;_=_l_[_l];if __[_[_l__]]then _l=_l+_ll;else _l=_[_l_ll];end;break end while 778==(__l)/(((((3559+-0x23)+-#'hank hub is skidded wtf!1!1!')-0x704)+-#"sexy"))do local _=_[__l_]__[_](___l(__,_+_ll_l,_lll_))break end;break;end while(__l)/((0x1ca7-3727))==3660 do __l=(8873553)while(-16+0x78)>=___ do __l-= __l local _l=_[__l_l]local _l_={__[_l](___l(__,_l+1,_lll_))};local __l=0;for _=_l,_[_ll__]do __l=__l+_ll;__[_]=_l_[__l];end break;end while 4017==(__l)/((0x11a7-2310))do __l=(1917556)while ___>(244-0x8b)do __l-= __l __[_[__l_l]]=__llll(_l_lll[_[____]],nil,_llll);break end while(__l)/(((204304/0xe2)+-#"heres a hint: repeat until nil"))==2194 do __[_[_lll]][_[_ll_]]=__[_[_l___]];break end;break;end break;end break;end break;end break;end break;end while(__l)/((-#[[You know lua? name every metamethod - skids of v3rm]]+(3830+-0x7b)))==1580 do __l=(8926134)while ___<=(-#[[troll the teibal]]+(0x167-219))do __l-= __l __l=(10870395)while ___<=(-#[[somebody play minecraft with lerebox please hes so lonely]]+(427-0xff))do __l-= __l __l=(2750465)while((0x96+-23)+-#"free nitro real?!")>=___ do __l-= __l __l=(1408052)while ___<=((0x29f-395)-0xa8)do __l-= __l __l=(6335024)while ___>(-#'nice executor bro. 2 HttpGets crash it..'+((-#'Federla is good at coding'+(-20564/0xd4))+269))do __l-= __l local _=_[_l_l]__[_]=__[_](___l(__,_+_ll,_lll_))break end while(__l)/((-0x27+2435))==2644 do if(__[_[_l__]]==_[__l__])then _l=_l+_ll_l;else _l=_[__ll];end;break end;break;end while(__l)/(((0x38d-505)+-#"bite this onions"))==3629 do __l=(816939)while(0x14b-222)<___ do __l-= __l if(__[_[_l_l]]==_[__l__])then _l=_l+_ll_l;else _l=_[__lll];end;break end while(__l)/((0x932-1205))==711 do local __l=_[_l_l]local _l_={__[__l](___l(__,__l+1,_lll_))};local _l=0;for _=__l,_[_ll__]do _l=_l+_ll;__[_]=_l_[_l];end break end;break;end break;end while(__l)/((826961/0xe3))==755 do __l=(2008570)while(-#"constant dumB"+(-0x22+159))>=___ do __l-= __l __l=(4649442)while(1443/0xd)<___ do __l-= __l local ___;local __l;__[_[_lll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[_l__l]][__[_[_ll__]]];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];___=__[_[_l___]];if not ___ then _l=_l+_ll_l;else __[_[_l__]]=___;_l=_[__ll];end;break end while(__l)/((((1514238-0xb8da4)+-#"heres a hint: repeat until nil")/212))==1302 do local _=_[_l_l]__[_]=__[_](___l(__,_+_ll,_lll_))break end;break;end while 569==(__l)/(((-0x66+35)+0xe0d))do __l=(1063855)while(-#"I dont mean to brag but I put together a puzzle in 1 day and the box said 2 to 4 years"+(-19+0xda))>=___ do __l-= __l __[_[_l_l]]();break;end while(__l)/(((0x1487-2672)-0x52c))==845 do __l=(3657450)while ___>(-#"troll the teibal"+(0x127-165))do __l-= __l local __l;__[_[__l_]]=(_[_l__l]~=0);_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[__ll]][_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_ll_]))_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];for _=_[_l__],_[__ll]do __[_]=nil;end;break end while(__l)/(((0xaeb-1439)+-#"load = dump (sukssesful deobfuskation)"))==2775 do do return end;break end;break;end break;end break;end break;end while 3995==(__l)/(((0xb1d+-36)+-0x58))do __l=(130214)while ___<=(0xc1+-74)do __l-= __l __l=(955152)while ___<=((((0x2598/24)+-#"you have failed the script logging speedrun")-190)+-#'You know lua? name every metamethod - skids of v3rm')do __l-= __l __l=(1771818)while ___>(0x166-242)do __l-= __l local ____l;local _ll__,_____;local ___;local __l;__[_[__l_]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__l=_[_lll];___=__[_[__ll]];__[__l+1]=___;__[__l]=___[_[__ll_]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]_ll__,_____=_lllll(__[__l](___l(__,__l+1,_[_l_ll])))_lll_=_____+__l-1 ____l=0;for _=__l,_lll_ do ____l=____l+_ll;__[_]=_ll__[____l];end;_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_lll_))_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l]()_l=_l+_ll;_=_l_[_l];__[_[_lll]]=__[_[_l__l]][_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[___ll]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];__l=_[_l_l];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__l=_[_lll];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[_l___]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[_l_ll]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=__[_[_l__l]][_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=__[_[_ll_]][_[_l_l_]];_l=_l+_ll;_=_l_[_l];__l=_[_l__];___=__[_[__lll]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](__[__l+_ll_l])_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__l=_[__l_];___=__[_[__ll]];__[__l+1]=___;__[__l]=___[_[__l__]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];__[_[_l_l]]={};_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__l=_[_l__]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[_l__l]];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_llll[_[__ll]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[__ll];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_[__ll];_l=_l+_ll;_=_l_[_l];__l=_[__l_]__[__l]=__[__l](___l(__,__l+_ll,_[_l_ll]))_l=_l+_ll;_=_l_[_l];__[_[_lll]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[__ll]))break end while(__l)/((0x11508/60))==1499 do local _l_=_[_lll];local ___=_[__ll_];local __l=_l_+2 local _l_={__[_l_](__[_l_+1],__[__l])};for _=1,___ do __[__l+_]=_l_[_];end;local _l_=_l_[1]if _l_ then __[__l]=_l_ _l=_[_l__l];else _l=_l+_ll;end;break end;break;end while 1584==(__l)/((671+-0x44))do __l=(10757900)while ___>(0x3152/107)do __l-= __l __[_[_l__]][__[_[__ll]]]=__[_[__l__]];break end while(__l)/(((437858/0x7a)+-#'Fake news'))==3005 do __[_[_lll]]=__[_[__ll]][_[_ll__]];break end;break;end break;end while 71==(__l)/((((707750/0xbe)+-#'give access to functions for boosters')-0x73e))do __l=(1916000)while ___<=(10043/((0x179-239)+-#"can someone send me the psu source code it got deletedd"))do __l-= __l __l=(6185088)while((405+-0x53)-0xca)<___ do __l-= __l __[_[___ll]][__[_[_ll_]]]=__[_[__l__]];break end while 2301==(__l)/((-#'Protected by wallysecure'+(512568/0xbd)))do __[_[__l_l]]=__[_[_ll_]];break end;break;end while(__l)/(((0x6e4-914)+-#[[localplayer not working on server scripts pls help]]))==2395 do __l=(2170125)while(-0x13+(-#[[Yes bro I am way more intelligent because I know what __index is.]]+(0x41fc/82)))>=___ do __l-= __l __[_[_l_l]]=__[_[____]]*_[___l_];break;end while(__l)/((0x1e9c9/195))==3375 do __l=(1172834)while((393-0xf2)+-#[[Yeah this is getting cringe-]])<___ do __l-= __l __[_[_lll]]();break end while(__l)/(((-#'1 plus 1 doesnt equal 111'+(-0x2328/125))+0x4d7))==1027 do _llll[_[__ll]]=__[_[__l_l]];break end;break;end break;end break;end break;end break;end while 2191==(__l)/((-#'protected by Federal Scripting Utilities'+(8247-0x1025)))do __l=(717066)while(375-0xf2)>=___ do __l-= __l __l=(1341164)while(252+-0x7c)>=___ do __l-= __l __l=(6234785)while ___<=(-64+0xbe)do __l-= __l __l=(5116290)while(-122+0xf7)<___ do __l-= __l local __l;__[_[__l_l]]=_llll[_[__lll]];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__l=_[__l_l]__[__l]=__[__l](___l(__,__l+_ll,_[__lll]))_l=_l+_ll;_=_l_[_l];if(__[_[__l_]]==__[_[___l_]])then _l=_l+_ll_l;else _l=_[_l_ll];end;break end while 2985==(__l)/(((0xd93-1749)+-#[[mer is white]]))do __[_[__l_l]]=(_[__lll]~=0);_l=_l+_ll_l;break end;break;end while(__l)/((0x100f-2090))==3085 do __l=(810900)while((0xbd2/17)+-#[[someone play kogama with perth please hes so lonely]])<___ do __l-= __l __[_[_l__]]=_____[_[_l__l]];break end while(__l)/(((-#[[powered by ROBLOX Corporation]]+(0x1d77-3805))-0x773))==450 do local ___;local __l;__l=_[___ll];___=__[_[_l_ll]];__[__l+1]=___;__[__l]=___[_[___l_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_llll[_[____]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=_[____];_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_[_l__l];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[_l__l]))_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];if __[_[_lll]]then _l=_l+_ll;else _l=_[_l__l];end;break end;break;end break;end while(__l)/((444664/(0x93+-23)))==374 do __l=(2512724)while(353-0xdf)>=___ do __l-= __l __l=(7634120)while(0x150-207)<___ do __l-= __l local _=_[_lll]local __l,_l=_lllll(__[_](__[_+_ll_l]))_lll_=_l+_-_ll local _l=0;for _=_,_lll_ do _l=_l+_ll;__[_]=__l[_l];end;break end while(__l)/((0x1ca1-3728))==2120 do __[_[_l__]]=__[_[__lll]][__[_[___l_]]];break end;break;end while 857==(__l)/(((-0x61+3047)+-#[[paster haha paster]]))do __l=(2789120)while((0x15a-190)+-#[[1 plus 1 doesnt equal 111]])>=___ do __l-= __l _____[_[_ll_]]=__[_[___ll]];break;end while 2179==(__l)/((-#'while true do end'+(-0x10+1313)))do __l=(7991292)while ___>(235+-0x67)do __l-= __l for _=_[_l__],_[____]do __[_]=nil;end;break end while 2924==(__l)/((0x157a-2765))do local _ll=_[_l__];local _l_=__[_ll+2];local __l=__[_ll]+_l_;__[_ll]=__l;if(_l_>0)then if(__l<=__[_ll+1])then _l=_[____];__[_ll+3]=__l;end elseif(__l>=__[_ll+1])then _l=_[_l_ll];__[_ll+3]=__l;end break end;break;end break;end break;end break;end while 271==(__l)/((-0x50+2726))do __l=(669732)while ___<=(0x128-159)do __l-= __l __l=(4147552)while((-0x3e+300)+-0x67)>=___ do __l-= __l __l=(3606784)while((0x184-231)+-#'LOL ur gonna fail probs')<___ do __l-= __l if not __[_[__l_l]]then _l=_l+_ll_l;else _l=_[_ll_];end;break end while(__l)/((3180+-0x5c))==1168 do local _l=_[__l_];local _ll=__[_l];for _=_l+1,_[_l__l]do __l_ll(_ll,__[_])end;break end;break;end while 3503==(__l)/((0x3ddc0/214))do __l=(4742595)while ___>((-73+0xd8)+-#"sup v 2")do __l-= __l __[_[___ll]]=__[_[_l__l]]*_[_l_l_];break end while(__l)/((-50+0xbf9))==1573 do local _={__,_};_[_ll_l][_[____l][__l_l]]=_[_ll][_[____l][_l___]]+_[_ll_l][_[____l][__ll]];break end;break;end break;end while(__l)/((0x23d-335))==2814 do __l=(3868050)while((-5031/0x2b)+0x100)>=___ do __l-= __l __l=(6361260)while(-#[[i still hate noobmaster]]+((61591-0x7878)/191))<___ do __l-= __l local ___;local __l;__l=_[_l__];___=__[_[____]];__[__l+1]=___;__[__l]=___[_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=_llll[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[__lll];_l=_l+_ll;_=_l_[_l];__[_[__l_l]]=_[_ll_];_l=_l+_ll;_=_l_[_l];__[_[___ll]]=_[_l_ll];_l=_l+_ll;_=_l_[_l];__l=_[_l_l]__[__l]=__[__l](___l(__,__l+_ll,_[____]))_l=_l+_ll;_=_l_[_l];for _=_[__l_l],_[_ll_]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__[_[__l_]]=_____[_[_ll_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_ll_]][_[_l_l_]];_l=_l+_ll;_=_l_[_l];__[_[_l__]]=__[_[_l__l]][_[_ll__]];_l=_l+_ll;_=_l_[_l];__[_[_l_l]]=__[_[_l_ll]][_[_ll__]];_l=_l+_ll;_=_l_[_l];for _=_[__l_l],_[_l_ll]do __[_]=nil;end;_l=_l+_ll;_=_l_[_l];__l=_[_lll]__[__l](___l(__,__l+_ll_l,_[__lll]))_l=_l+_ll;_=_l_[_l];do return end;break end while(__l)/((-#[[Bye bye :wave:]]+(0x4928f/91)))==1940 do if __[_[___ll]]then _l=_l+_ll;else _l=_[__lll];end;break end;break;end while 3615==(__l)/((0x876-1096))do __l=(3130507)while(-#"did you solve the lua challenge yet?"+(390-((0x7e9/9)+-#[[daddy chill]])))>=___ do __l-= __l if __[_[_l_l]]then _l=_l+_ll;else _l=_[_l_ll];end;break;end while(__l)/(((518330/0xaa)+-#"sussy amogus balls in ya mouth kiddo"))==1039 do __l=(976668)while ___>(0xab+-30)do __l-= __l __[_[___ll]]=(_[__ll]~=0);break end while(__l)/((-0x1b+335))==3171 do __[_[_lll]]=__llll(_l_lll[_[_l__l]],nil,_llll);break end;break;end break;end break;end break;end break;end break;end break;end _l+= _ll_l end;end);end;return __llll(_ll_ll(),{},_ll__l())()end)_msec({[(-#[[why do guys only want bitchy bimbos who walk all over them]]+(-93+0x12a))]='\115\116'..(function(_)return(_ and'جڝسؠجآدؠضح')or'\114\105'or'\120\58'end)((115-0x6e)==(0x5b-85))..'\110g',["ڝڪزئټضجددآ"]='\108\100'..(function(_)return(_ and'كئټجسضسئزقسن')or'\101\120'or'\119\111'end)((0x65+-96)==((0x67+-51)+-#'This is my kingdom cum, this is my kingdom cum'))..'\112',["دزضزؠټحؠؠحڪقټئ"]=(function(_)return(_ and'ضسدآزجڪ')and'\98\121'or'\100\120'end)((-0x12+23)==(-#[[go ahead. replace loadstring with dump. do it.]]+(3162/0x3e)))..'\116\101',["آئئحڝڪؠسآنؠڪكزټآئ"]='\99'..(function(_)return(_ and'سححنزنؠزضڝدد')and'\90\19\157'or'\104\97'end)(((-0x5f+150)+-#[[localplayer not working on server scripts pls help]])==((140-0x85)+-#'porn'))..'\114',[(0x5ed4/42)]='\116\97'..(function(_)return(_ and'قسجككضټآټدڪك')and'\64\113'or'\98\108'end)((-#[[1 plus 1 doesnt equal 111]]+(0x7f-96))==(0x4c-71))..'\101',["زڪحزټئحؠحدؠض"]=(function(_)return(_ and'ؠئئحټنضدڪدؠسآزكڪئ')or'\115\117'or'\78\107'end)((-72+0x4b)==(0x5f+-64))..'\98',["ڝجټضټئؠنټس"]='\99\111'..(function(_)return(_ and'آحزقڪڝحزسقڪڪئآس')and'\110\99'or'\110\105\103\97'end)((0x60-65)==(0xea7/121))..'\97\116',[(((26771+-0x16)+-#'powered by ROBLOX Corporation')/0x28)]=(function(_,_l)return(_ and'آڪنآئزسك')and'\48\159\158\188\10'or'\109\97'end)((0x2b+-38)==(-42+(1536/0x20)))..'\116\104',[(0xb10-1465)]=(function(_l,_)return(((-53+0x5a)+-#[[perth vs memcorrupt boxing match]])==(73-0x46)and'\48'..'\195'or _l..((not'\20\95\69'and'\90'..'\180'or _)))or'\199\203\95'end),["ڪئسسنآسڪټجقئدئ"]='\105\110'..(function(_,_l)return(_ and'ڪؠضڝضزنټحكټټؠسض')and'\90\115\138\115\15'or'\115\101'end)(((200-0x88)+-#"when the drip is respectable but the script is undetectable")==(-#[[perth vs memcorrupt boxing match]]+(-0x1e+93)))..'\114\116',["ؠڝدجحققڪحنڪ"]='\117\110'..(function(_,_l)return(_ and'كزآآدضححئزڪ')or'\112\97'or'\20\38\154'end)((-72+0x4d)==(-#"deobfuscation in progress"+(0x15e0/(-#'I dont mean to brag but I put together a puzzle in 1 day and the box said 2 to 4 years'+(-78+0x108)))))..'\99\107',["ڪنززڪڝزئضسؠق"]='\115\101'..(function(_)return(_ and'كسڝآڪك')and'\110\112\99\104'or'\108\101'end)(((-0x24+831)/159)==(-#'sussy amogus balls in ya mouth kiddo'+(0x711/27)))..'\99\116',["كڪضئڪجنحقنټحق"]='\116\111\110'..(function(_,_l)return(_ and'ئجټقسدقؠدسدڪحقڪد')and'\117\109\98'or'\100\97\120\122'end)((0x41/13)==(63-0x3a))..'\101\114'},{["ڪڝټټآټئقؠآحنس"]=((getfenv))},((getfenv))()) end)()
|
return function(...)
return warn and warn(...)
end
|
format_version = "2.0"
panel_type = "note_player"
--------------------------------------------------------------------------
-- front
--------------------------------------------------------------------------
front = {
Panel_front_bg = {
{ path = "[-device2D-front_bg-]" }
}
}
[-device2D-front-]
--------------------------------------------------------------------------
-- back
--------------------------------------------------------------------------
back = {
Panel_back_bg = {
{ path = "[-device2D-back_bg-]" }
}
}
[-device2D-back-]
|
//DAK
DAK.bannedplayers = { }
DAK.bannedplayersweb = { }
local BannedPlayersFileName = "config://BannedPlayers.json"
local BannedPlayersWebFileName = "config://BannedPlayersWeb.json"
local lastwebupdate = 0
local function LoadBannedPlayers()
DAK.bannedplayers = DAK:ConvertFromOldBansFormat(DAK:LoadConfigFile(BannedPlayersFileName)) or { }
end
LoadBannedPlayers()
local function SaveBannedPlayers()
DAK:SaveConfigFile(BannedPlayersFileName, DAK:ConvertToOldBansFormat(DAK.bannedplayers))
end
local function LoadBannedPlayersWeb()
DAK.bannedplayersweb = DAK:ConvertFromOldBansFormat(DAK:LoadConfigFile(BannedPlayersWebFileName)) or { }
end
local function SaveBannedPlayersWeb()
DAK:SaveConfigFile(BannedPlayersWebFileName, DAK.bannedplayersweb)
end
local function tablemerge(tab1, tab2)
if tab2 ~= nil then
for k, v in pairs(tab2) do
if (type(v) == "table") and (type(tab1[k] or false) == "table") then
tablemerge(tab1[k], tab2[k])
else
tab1[k] = v
end
end
end
return tab1
end
local function OnServerAdminBansWebResponse(response)
if response then
local bannedusers = DAK:ConvertFromOldBansFormat(json.decode(response))
if bannedusers and DAK.bannedplayersweb ~= bannedusers then
DAK.bannedplayersweb = bannedusers
SaveBannedPlayersWeb()
end
end
end
local function QueryForBansList()
if DAK.config.serveradmin.BansQueryURL ~= "" then
Shared.SendHTTPRequest(DAK.config.serveradmin.BansQueryURL, "GET", OnServerAdminBansWebResponse)
end
end
local function OnPlayerBannedResponse(response)
if response == "TRUE" then
//ban successful, update webbans using query URL.
QueryForBansList()
end
end
local function OnPlayerUnBannedResponse(response)
if response == "TRUE" then
//Unban successful, anything needed here?
end
end
local function OnServerAdminClientConnect(client)
local isBanned, Reason = DAK:IsClientBanned(client)
if isBanned then
client.disconnectreason = Reason
Server.DisconnectClient(client)
return true
end
local tt = Shared.GetTime()
if tt > DAK.config.serveradmin.MapChangeDelay and (lastwebupdate == nil or (lastwebupdate + DAK.config.serveradmin.UpdateDelay) < tt) then
QueryForBansList()
lastwebupdate = tt
end
end
DAK:RegisterEventHook("OnClientConnect", OnServerAdminClientConnect, 6, "serveradminbans")
local function CheckServerAdminQueries()
if DAK.config.serveradmin.BansQueryURL ~= "" and DAK.bannedplayersweb == nil then
Shared.Message("Bans WebQuery failed, falling back on cached list.")
LoadBannedPlayersWeb()
end
return false
end
local function DelayedServerCommandRegistration()
QueryForBansList()
DAK:SetupTimedCallBack(CheckServerAdminQueries, DAK.config.serveradmin.QueryTimeout)
end
DAK:RegisterEventHook("OnPluginInitialized", DelayedServerCommandRegistration, 5, "serveradminbans")
function DAK:IsClientBanned(client)
if client ~= nil then
return DAK:IsNS2IDBanned(client:GetUserId())
end
return false, ""
end
function DAK:IsNS2IDBanned(playerId)
playerId = tonumber(playerId)
if playerId ~= nil then
local bentry = DAK.bannedplayers[playerId]
if bentry ~= nil then
local now = Shared.GetSystemTime()
if bentry.time == 0 or now < bentry.time then
return true, bentry.reason or "Banned"
else
LoadBannedPlayers()
DAK.bannedplayers[playerId] = nil
SaveBannedPlayers()
end
end
if DAK.bannedplayersweb ~= nil then
local bwentry = DAK.bannedplayersweb[playerId]
if bwentry ~= nil then
local now = Shared.GetSystemTime()
if bwentry.time == 0 or now < bwentry.time then
return true, bwentry.reason or "Banned"
else
DAK.bannedplayers[playerId] = nil
SaveBannedPlayersWeb()
end
end
end
end
return false, ""
end
function DAK:UnBanNS2ID(playerId, adminns2Id)
playerId = tonumber(playerId)
if playerId ~= nil then
LoadBannedPlayers()
if DAK.bannedplayers[playerId] ~= nil then
DAK.bannedplayers[playerId] = nil
SaveBannedPlayers()
return true
end
if DAK.bannedplayersweb ~= nil and DAK.bannedplayersweb[playerId] ~= nil and DAK.config.serveradmin.UnBanSubmissionURL ~= "" then
//Submit unban with key.
local bentry = { key = DAK.config.serveradmin.BanSubmissionKey, id = playerId, adminid = adminns2Id }
Shared.SendHTTPRequest(DAK.config.serveradmin.UnBanSubmissionURL, "POST", {data=json.encode(bentry)}, OnPlayerUnBannedResponse)
return true
end
end
return false
end
function DAK:UnBanSteamID(steamId, adminns2Id)
local ns2id = DAK:GetNS2IDFromSteamID(steamId)
if ns2id ~= nil then
return DAK:UnBanNS2ID(ns2id, adminns2Id)
end
return false
end
function DAK:AddNS2IDBan(playerId, pname, duration, breason, adminns2Id)
playerId = tonumber(playerId)
if playerId ~= nil then
local bannedUntilTime = Shared.GetSystemTime()
duration = tonumber(duration)
if duration == nil or duration <= 0 then
bannedUntilTime = 0
else
bannedUntilTime = bannedUntilTime + (duration * 60)
end
local bentry = { name = pname, reason = breason, time = bannedUntilTime }
if DAK.config.serveradmin.BanSubmissionURL ~= "" then
//Submit ban with key.
//Should these be both submitted to database and logged on server? My thinking is no here, so going with that moving forward.
//Will also want ban response function to reload web bans.
//OnPlayerBannedResponse
bentry.key = DAK.config.serveradmin.BanSubmissionKey
bentry.adminid = adminns2Id
bentry.id = playerId
Shared.SendHTTPRequest(DAK.config.serveradmin.BanSubmissionURL, "POST", {data=json.encode(bentry)}, OnPlayerBannedResponse)
DAK:SaveConfigFile("config://BannedPlayersWebTest.json", {data=json.encode(bentry)})
else
LoadBannedPlayers()
DAK.bannedplayers[playerId] = bentry
SaveBannedPlayers()
end
return true
end
return false
end
|
require('Utilities');
function Server_GameCustomMessage(game, playerID, payload, setReturnTable)
if (Mod.Settings.Version ~= 1)then return end;
--If the game is over, return
if (Mod.PublicGameData.GameFinalized == true)then return end;
Dump(payload)
--Sorted according to what is used most
if (payload.Mod == 'Chat')then
--If Chat or main mod related
if (payload.Message == "ReadChat") then
--Mark as read
ReadChat(playerID)
elseif (payload.Message == "SendChat") then
--DeliverChat
DeliverChat(game,playerID,payload, setReturnTable)
elseif (payload.Message == "AddGroupMember") then
--Add to group
AddToGroup(game,playerID,payload,setReturnTable);
elseif (payload.Message == "RemoveGroupMember") then
--RemoveFromGroup
RemoveFromGroup(game,playerID,payload,setReturnTable);
elseif (payload.Message == "LeaveGroup") then
--Leave group
LeaveGroup(game,playerID,payload,setReturnTable)
elseif (payload.Message == "DeleteGroup") then
--Delete group
DeleteGroup(game,playerID,payload,setReturnTable)
elseif (payload.Message == "SaveSettings") then
--Save settings
SaveSettings(game, playerID, payload,setReturnTable)
end
--Diplomacy
elseif(payload.Mod == 'Diplomacy' and Mod.Settings.ModDiplomacyEnabled == true)then
if (payload.Message == "Propose") then
Propose(game,playerID, payload)
elseif (payload.Message == "AcceptProposal" or "DeclineProposal") then
ProposeDeclineAccept(game,playerID, payload)
elseif (payload.Message == "SeenAllianceMessage") then
Propose(game,playerID, payload, setReturnTable)
elseif (payload.Message == "SeenAlerts") then
Propose(game,playerID, payload, setReturnTable)
else
error("Payload message not understood (" .. payload.Message .. ")");
end;
--Gift gold
elseif (payload.Message == "GiftGold" and Mod.Settings.ModGiftGoldEnabled == true) then
GiftGold(game,playerID, payload, setReturnTable)
elseif (payload.Message == "ClearData") then
--Remove all playerGameData. Useful for testing (works only for admin)
ClearData(game,playerID);
else
error("Payload message not understood (" .. payload.Message .. ")");
end
end
function RemoveFromGroup (game,playerID,payload,setReturnTable)
local playerGameData = Mod.PlayerGameData;
local TargetGroupID = payload.TargetGroupID;
local TargetPlayerID = payload.TargetPlayerID;
local group = {};
if (playerGameData[playerID].Chat == nil or playerGameData[playerID].Chat[TargetGroupID] == nil)then
print("group to be removed not found " .. TargetGroupID)
return; --Group can't be found. Do nothing
--Check if the TargetPlayerID is the owner
elseif(TargetPlayerID == playerGameData[playerID].Chat[TargetGroupID].Owner) then
print("Can't remove the owner of a group")
return;
else
print("removing " .. TargetPlayerID .. " from :" .. TargetGroupID .. " ID")
Group = playerGameData[playerID].Chat[TargetGroupID]
removeFromSet(Group.Members, TargetPlayerID)
playerGameData[playerID].Chat[TargetGroupID] = Group;
--Remove the group from the playerGameData.Chat of the removed player, if it's not an AI
if not(game.Game.Players[TargetPlayerID].IsAI)then
Mod.playerGameData.Chat[TargetPlayerID][TargetGroupID]=nil;
end;
--Update all other group members
UpdateAllGroupMembers(game, playerID, TargetGroupID,playerGameData.Chat);
--Send a chat msg to the group chat
payload.Chat = game.Game.Players[TargetPlayerID].DisplayName(nil,false) .. " was removed from " .. Group.GroupName;
DeliverChat(game,playerID,payload, setReturnTable)
end
end
function LeaveGroup (game,playerID,payload,setReturnTable)
local playerGameData = Mod.PlayerGameData;
local TargetGroupID = payload.TargetGroupID;
local TargetPlayerID = playerID;
if (playerGameData[playerID].Chat == nil or playerGameData[playerID].Chat[TargetGroupID] == nil)then
print("group to leave from not found " .. TargetGroupID)
return; --Group can't be found. Do nothing
end
--Check if the TargetPlayerID is the owner
if(TargetPlayerID == playerGameData[playerID].Chat[TargetGroupID].Owner) then
print("The owner of a group can't leave. They must use delete group")
return;
end
print(playerID .. " left :" .. TargetGroupID .. " groupID")
--Remove the player
local Group = playerGameData[playerID].Chat[TargetGroupID]
removeFromSet(Group.Members, TargetPlayerID)
--Update the players data
for Members, v in pairs (Group.Members) do
playerGameData[Members].Chat[TargetGroupID] = Group;
end
Mod.PlayerGameData = playerGameData;
--Add a msg to the chat
payload.Chat = game.Game.Players[TargetPlayerID].DisplayName(nil,false) .. " left " .. Group.GroupName;
DeliverChat(game,playerID,payload,setReturnTable)
end
function AddToGroup(game,playerID,payload,setReturnTable)
local playerGameData = Mod.PlayerGameData;
local TargetGroupID = payload.TargetGroupID;
local TargetPlayerID = payload.TargetPlayerID;
local TargetGroupName = payload.TargetGroupName;
print(TargetPlayerID .. " targetplayer")
print(TargetGroupID .. " TargetGroupID")
if (playerGameData[playerID].Chat == nil) then
--if nill, make an empty table where we can place GroupID
playerGameData[playerID].Chat = {};
print(" {} playerGameData.Chat")
else
print("dump playerGameData.Chat")
Dump(playerGameData[playerID].Chat)
end
local Group ={};
if (playerGameData[playerID].Chat == nil or playerGameData[playerID].Chat[TargetGroupID] == nil)then
print("new group " .. TargetGroupID)
Group = {
Members = {},
Owner = playerID,
GroupName = TargetGroupName,
GroupID = TargetGroupID,
Color = randomColor(),
UnreadChat = false,
}
--addToSet(set, key)
addToSet(Group.Members, playerID)
addToSet(Group.Members, TargetPlayerID)
--Save to mod storage
playerGameData[playerID].Chat[TargetGroupID] = Group;
UpdateAllGroupMembers(game, playerID, TargetGroupID,playerGameData);
--Send a msg to the chat of the group
payload.Chat = game.Game.Players[Group.Owner].DisplayName(nil,false) .. " created " .. Group.GroupName;
DeliverChat(game,playerID,payload,setReturnTable)
payload.Chat = game.Game.Players[TargetPlayerID].DisplayName(nil,false) .. " was added to " .. Group.GroupName;
DeliverChat(game,playerID,payload,setReturnTable)
else
print("nice, old group :" .. TargetGroupID .. " ID")
Group = playerGameData[playerID].Chat[TargetGroupID]
--Check if the player is already in the group. If so, return
if (Group.Members[TargetPlayerID] ~= nil) then
print(TargetPlayerID .. " is alredy in the group");
return;
end;
--Add the player
addToSet(Group.Members, TargetPlayerID)
playerGameData[playerID].Chat[TargetGroupID] = Group;
--Update Storage
UpdateAllGroupMembers(game, playerID, TargetGroupID,playerGameData);
--Send a msg to the chat of the group
payload.Chat = game.Game.Players[TargetPlayerID].DisplayName(nil,false) .. " was added to " .. Group.GroupName;
DeliverChat(game,playerID,payload,setReturnTable)
end
end
function DeliverChat(game,playerID,payload,setReturnTable)
local playerGameData = Mod.PlayerGameData
local data = playerGameData[playerID].Chat;
local TargetGroupID = payload.TargetGroupID
local ChatInfo = {};
ChatInfo.Sender = playerID;
ChatInfo.Chat = payload.Chat;
local ChatArrayIndex;
if (data[TargetGroupID] == nil) then
ChatArrayIndex = 1;
else ChatArrayIndex = #data[TargetGroupID] +1
end;
print("Chat received " .. ChatInfo.Chat .. " to " .. TargetGroupID .. " from " .. ChatInfo.Sender .. " total group chat's : " .. ChatArrayIndex)
--use the ChatArrayIndex. We want the chat msg to be stored in an array format
if data[TargetGroupID][ChatArrayIndex] == nil then data[TargetGroupID][ChatArrayIndex] = {} end
data[TargetGroupID].NumChat = ChatArrayIndex;
data[TargetGroupID][ChatArrayIndex] = {};
data[TargetGroupID][ChatArrayIndex] = ChatInfo;
--Mark the chat as unread for everyone in the group.
data[TargetGroupID].UnreadChat = true;
playerGameData[playerID].Chat = data;
UpdateAllGroupMembers(game, playerID, TargetGroupID,playerGameData);
local Alerts = true;
local PublicGameData = Mod.PublicGameData;
if (PublicGameData ~= nil)then
if (PublicGameData[playerID] ~= nil) then
Alerts = PublicGameData[playerID].AlertUnreadChat;
end;
end;
if (Alerts)then
setReturnTable({Status = "Chat sent"})
end;
end
function ReadChat(playerID)
local playerGameData = Mod.PlayerGameData;
--Mark chat as read
for i, v in pairs(playerGameData[playerID].Chat) do
playerGameData[playerID].Chat[i].UnreadChat = false;
end;
Mod.PlayerGameData = playerGameData;
end
function UpdateAllGroupMembers(game, playerID, groupID , playerGameData)
local playerGameData = playerGameData;
local ReffrencePlayerData = playerGameData[playerID].Chat; --We already updated the info for this player. Now we need to sync that to the other players
local Group = ReffrencePlayerData[groupID]
local outdatedPlayerData;
--Update playerGameData for each member
for Members, v in pairs (Group.Members) do
--Make sure we don't add AI's. This code is useful for testing in SP and as a safety
if not(game.Game.Players[Members].IsAI)then
outdatedPlayerData = playerGameData[Members].Chat;
--if nil, make an empty table where we can place GroupID
if (outdatedPlayerData == nil) then
outdatedPlayerData = {};
end
outdatedPlayerData[groupID] = Group;
playerGameData[Members].Chat = outdatedPlayerData;
end
end;
--Finally write back to Mod.PlayerGameData
Mod.PlayerGameData = playerGameData;
end
function DeleteGroup(game,playerID,payload)
local playerGameData = Mod.PlayerGameData;
local data = playerGameData[playerID].Chat;
local TargetGroupID = payload.TargetGroupID;
local Group = data[TargetGroupID]
--Make sure only the creator/owner of a group can delete it
if (playerID ~= data[TargetGroupID].Owner)then
print("You can't delete since you are not the owner of the group")
return;
end;
--Set groupID data to nil for each player
for Members, v in pairs (Group.Members) do
--Make sure we skip AI's. This code is useful for testing in SP and as a safety as AI's can't have playerGameData.Chat
if not(game.Game.Players[Members].IsAI)then
playerGameData[Members].Chat[TargetGroupID] = nil;
end
end
Mod.PlayerGameData = playerGameData;
print("Deleted Group " .. TargetGroupID)
end
function SaveSettings(game,playerID, payload)
Dump(payload)
PublicGameData = Mod.PublicGameData;
if (PublicGameData == nil)then PublicGameData = {} end;
if (PublicGameData[playerID] == nil)then PublicGameData[playerID] = {} end;
PublicGameData[playerID].AlertUnreadChat = payload.AlertUnreadChat;
PublicGameData[playerID].EachGroupButton = payload.EachGroupButton;
PublicGameData[playerID].NumPastChat = payload.NumPastChat;
PublicGameData[playerID].SizeX = payload.SizeX;
PublicGameData[playerID].SizeY = payload.SizeY;
Mod.PublicGameData = PublicGameData;
end;
--Remove data that we don't need anymore, when a game is over
function ClearData(game,playerID)
-- 3 == playing : 4 == elim + over
print('Server_gamecustmsg : Game.state code:')
print(game.Game.State)
if (game.Game.State ~= 4 ) then return end;
local publicGameData = Mod.PublicGameData
--Check that we have not allready done this
if (publicGameData.ChatModEnabled == false)then return end;
--TODO move playerGameData to publicgamedata
--Remove all playerGameData
local playerGameData = Mod.PlayerGameData;
for Players in pairs (playerGameData) do
print("Deleted playerGameData.Chat for " .. Players)
playerGameData[Players].Chat = {};
end
Mod.PlayerGameData = playerGameData;
--Remove all publicGameData and set a bool flag to false
publicGameData.ChatModEnabled = false;
Mod.PublicGameData = publicGameData;
end
function TurnDivider(turnNumber)
local playerGameData = Mod.PlayerGameData;
local ChatArrayIndex;
local ChatInfo = {};
ChatInfo.Sender = -1; --The Mod is the sender
ChatInfo.Chat = " ------ End of turn " .. turnNumber+1 .. " ------";
--For All playerGameData.Chat
for playerID, player in pairs (playerGameData) do
--For ALL groups
if(playerGameData[playerID].Chat ~= nil)then
for TargetGroupID, group in pairs (playerGameData[playerID].Chat)do
--ADD a turn chat
if (playerGameData[playerID].Chat[TargetGroupID] == nil) then
ChatArrayIndex = 1;
else ChatArrayIndex = #playerGameData[playerID].Chat[TargetGroupID] +1
end;
playerGameData[playerID].Chat[TargetGroupID].NumChat = ChatArrayIndex;
playerGameData[playerID].Chat[TargetGroupID][ChatArrayIndex] = {};
playerGameData[playerID].Chat[TargetGroupID][ChatArrayIndex] = ChatInfo;
end
end
end
--Save playerGameData
Mod.PlayerGameData = playerGameData;
end
function GiftGold(game, playerID, payload, setReturnTable)
if (playerID == payload.TargetPlayerID) then
setReturnTable({ Message = "You can't gift yourself" });
return;
end
local goldSending = payload.Gold;
local goldHave = game.ServerGame.LatestTurnStanding.NumResources(playerID, WL.ResourceType.Gold);
if (goldHave < goldSending) then
setReturnTable({ Message = "You can't gift " .. goldSending .. " when you only have " .. goldHave });
return;
end
local targetPlayer = game.Game.Players[payload.TargetPlayerID];
local targetPlayerHasGold = game.ServerGame.LatestTurnStanding.NumResources(targetPlayer.ID, WL.ResourceType.Gold);
--Subtract goldSending from ourselves, add goldSending to target
game.ServerGame.SetPlayerResource(playerID, WL.ResourceType.Gold, goldHave - goldSending);
game.ServerGame.SetPlayerResource(targetPlayer.ID, WL.ResourceType.Gold, targetPlayerHasGold + goldSending);
setReturnTable({ Message = "Sent " .. targetPlayer.DisplayName(nil, false) .. ' ' .. goldSending .. ' gold. You now have ' .. (goldHave - goldSending) .. '.' });
end
--Diplomacy Mod
function Propose(game,playerID,payload)
--Create a proposal
local proposal = {};
proposal.ID = NewIdentity();
proposal.PlayerOne = playerID;
proposal.PlayerTwo = payload.TargetPlayerID;
if (game.Settings.SinglePlayer) then
--In single-player, just auto-accept proposals for testing.
ProposalAccepted(proposal, game);
else
--Write it into the player-specific data
local playerData = Mod.PlayerGameData;
--TODO check if we need this? We should have set this up earlier when the game was made
if (playerData[payload.TargetPlayerID].Diplo == nil) then
playerData[payload.TargetPlayerID].Diplo = {};
end
local pendingProposals = playerData[payload.TargetPlayerID].Diplo.PendingProposals or {};
table.insert(pendingProposals, proposal);
playerData[payload.TargetPlayerID].Diplo.PendingProposals = pendingProposals;
Mod.PlayerGameData = playerData;
end
end
function ProposeDeclineAccept(game,playerID,payload)
local proposal = first(Mod.PlayerGameData[playerID].Diplo.PendingProposals, function(prop) return prop.ID == payload.ProposalID end);
if (proposal == nil) then return; end; --skip if the proposal ID is invalid. This can happen if it gets accepted/declined twice
--Remove it from PlayerGameData
local pgd = Mod.PlayerGameData;
pgd[playerID].Diplo.PendingProposals = filter(pgd[playerID].Diplo.PendingProposals, function(prop) return prop.ID ~= payload.ProposalID end);
Mod.PlayerGameData = pgd;
--If we're accepting it, call ProposalAccepted. If we're declining it, just do nothing and let it be removed.
if (payload.Message == "AcceptProposal") then
ProposalAccepted(proposal, game);
end
end
function SeenAllianceMessage(playerID,payload)
local playerData = Mod.PlayerGameData;
if (playerData[playerID].Diplo == nil) then
playerData[playerID].Diplo = {};
end
playerData[playerID].Diplo.HighestAllianceIDSeen = payload.HighestAllianceIDSeen;
Mod.PlayerGameData = playerData;
end
function SeenAlerts(playerID,payload)
local playerData = Mod.PlayerGameData;
if (playerData[playerID].Diplo == nil) then
playerData[playerID].Diplo = {};
end
playerData[playerID].Diplo.Alerts = nil;
Mod.PlayerGameData = playerData;
end
function ProposalAccepted(proposal, game)
--Create the alliance
local alliance = {};
alliance.ID = NewIdentity();
alliance.PlayerOne = proposal.PlayerOne;
alliance.PlayerTwo = proposal.PlayerTwo;
local data = Mod.PublicGameData;
local alliances = data.Alliances or {};
--Do we already have an alliance? Remove it if so.
alliances = filter(alliances, function(a) return not ((a.PlayerOne == alliance.PlayerOne and a.PlayerTwo == alliance.PlayerTwo) or (a.PlayerOne == alliance.PlayerTwo and a.PlayerTwo == alliance.PlayerOne)) end);
--Write it into Mod.PublicGameData for all to see
table.insert(alliances, alliance);
data.Diplo.Alliances = alliances;
Mod.PublicGameData = data;
end
|
require('stdlib/event/event')
local function refresh_market_offers()
if not global.market then
return
end
for i = 1, 100, 1 do
local a = global.market.remove_market_item(1)
if a == false then
break
end
end
--local str1 = "Gun Turret Slot for " .. tostring(global.entity_limits["gun-turret"].limit * global.entity_limits["gun-turret"].slot_price)
--str1 = str1 .. " Coins."
--
--local str2 = "Laser Turret Slot for " .. tostring(global.entity_limits["laser-turret"].limit * global.entity_limits["laser-turret"].slot_price)
--str2 = str2 .. " Coins."
--
--local str3 = "Artillery Slot for " .. tostring(global.entity_limits["artillery-turret"].limit * global.entity_limits["artillery-turret"].slot_price)
--str3 = str3 .. " Coins."
--
--local current_limit = 1
--if global.entity_limits["flamethrower-turret"].limit ~= 0 then current_limit = current_limit + global.entity_limits["flamethrower-turret"].limit end
--local str4 = "Flamethrower Turret Slot for " .. tostring(current_limit * global.entity_limits["flamethrower-turret"].slot_price)
--str4 = str4 .. " Coins."
--
--local str5 = "Landmine Slot for " .. tostring(math.ceil((global.entity_limits["land-mine"].limit / 3) * global.entity_limits["land-mine"].slot_price))
--str5 = str5 .. " Coins."
local market_items = {
--{price = {}, offer = {type = 'nothing', effect_description = str1}},
--{price = {}, offer = {type = 'nothing', effect_description = str2}},
--{price = {}, offer = {type = 'nothing', effect_description = str3}},
--{price = {}, offer = {type = 'nothing', effect_description = str4}},
--{price = {}, offer = {type = 'nothing', effect_description = str5}},
{ price = { { "raw-fish", 1 } }, offer = { type = 'give-item', item = "coin", count = 4 } },
{ price = { { "coin", 5 } }, offer = { type = 'give-item', item = "raw-fish", count = 1 } },
{ price = { { "coin", 1 } }, offer = { type = 'give-item', item = 'raw-wood', count = 8 } },
{ price = { { "coin", 8 } }, offer = { type = 'give-item', item = 'grenade', count = 1 } },
{ price = { { "coin", 32 } }, offer = { type = 'give-item', item = 'cluster-grenade', count = 1 } },
{ price = { { "coin", 1 } }, offer = { type = 'give-item', item = 'land-mine', count = 1 } },
{ price = { { "coin", 80 } }, offer = { type = 'give-item', item = 'car', count = 1 } },
{ price = { { "coin", 1200 } }, offer = { type = 'give-item', item = 'tank', count = 1 } },
{ price = { { "coin", 3 } }, offer = { type = 'give-item', item = 'cannon-shell', count = 1 } },
{ price = { { "coin", 7 } }, offer = { type = 'give-item', item = 'explosive-cannon-shell', count = 1 } },
{ price = { { "coin", 50 } }, offer = { type = 'give-item', item = 'gun-turret', count = 1 } },
{ price = { { "coin", 300 } }, offer = { type = 'give-item', item = 'laser-turret', count = 1 } },
{ price = { { "coin", 450 } }, offer = { type = 'give-item', item = 'artillery-turret', count = 1 } },
{ price = { { "coin", 10 } }, offer = { type = 'give-item', item = 'artillery-shell', count = 1 } },
{ price = { { "coin", 25 } }, offer = { type = 'give-item', item = 'artillery-targeting-remote', count = 1 } },
{ price = { { "coin", 1 } }, offer = { type = 'give-item', item = 'firearm-magazine', count = 1 } },
{ price = { { "coin", 4 } }, offer = { type = 'give-item', item = 'piercing-rounds-magazine', count = 1 } },
{ price = { { "coin", 2 } }, offer = { type = 'give-item', item = 'shotgun-shell', count = 1 } },
{ price = { { "coin", 6 } }, offer = { type = 'give-item', item = 'piercing-shotgun-shell', count = 1 } },
{ price = { { "coin", 30 } }, offer = { type = 'give-item', item = "submachine-gun", count = 1 } },
{ price = { { "coin", 250 } }, offer = { type = 'give-item', item = 'combat-shotgun', count = 1 } },
{ price = { { "coin", 450 } }, offer = { type = 'give-item', item = 'flamethrower', count = 1 } },
{ price = { { "coin", 25 } }, offer = { type = 'give-item', item = 'flamethrower-ammo', count = 1 } },
{ price = { { "coin", 125 } }, offer = { type = 'give-item', item = 'rocket-launcher', count = 1 } },
{ price = { { "coin", 2 } }, offer = { type = 'give-item', item = 'rocket', count = 1 } },
{ price = { { "coin", 7 } }, offer = { type = 'give-item', item = 'explosive-rocket', count = 1 } },
{ price = { { "coin", 7500 } }, offer = { type = 'give-item', item = 'atomic-bomb', count = 1 } },
{ price = { { "coin", 325 } }, offer = { type = 'give-item', item = 'railgun', count = 1 } },
{ price = { { "coin", 8 } }, offer = { type = 'give-item', item = 'railgun-dart', count = 1 } },
{ price = { { "coin", 40 } }, offer = { type = 'give-item', item = 'poison-capsule', count = 1 } },
{ price = { { "coin", 4 } }, offer = { type = 'give-item', item = 'defender-capsule', count = 1 } },
{ price = { { "coin", 10 } }, offer = { type = 'give-item', item = 'light-armor', count = 1 } },
{ price = { { "coin", 125 } }, offer = { type = 'give-item', item = 'heavy-armor', count = 1 } },
{ price = { { "coin", 350 } }, offer = { type = 'give-item', item = 'modular-armor', count = 1 } },
{ price = { { "coin", 1500 } }, offer = { type = 'give-item', item = 'power-armor', count = 1 } },
{ price = { { "coin", 12000 } }, offer = { type = 'give-item', item = 'power-armor-mk2', count = 1 } },
{ price = { { "coin", 50 } }, offer = { type = 'give-item', item = 'solar-panel-equipment', count = 1 } },
{ price = { { "coin", 2250 } }, offer = { type = 'give-item', item = 'fusion-reactor-equipment', count = 1 } },
{ price = { { "coin", 100 } }, offer = { type = 'give-item', item = 'battery-equipment', count = 1 } },
{ price = { { "coin", 200 } }, offer = { type = 'give-item', item = 'energy-shield-equipment', count = 1 } },
{ price = { { "coin", 750 } }, offer = { type = 'give-item', item = 'personal-laser-defense-equipment', count = 1 } },
{ price = { { "coin", 175 } }, offer = { type = 'give-item', item = 'exoskeleton-equipment', count = 1 } },
{ price = { { "coin", 125 } }, offer = { type = 'give-item', item = 'night-vision-equipment', count = 1 } },
{ price = { { "coin", 200 } }, offer = { type = 'give-item', item = 'belt-immunity-equipment', count = 1 } },
{ price = { { "coin", 250 } }, offer = { type = 'give-item', item = 'personal-roboport-equipment', count = 1 } },
{ price = { { "coin", 20 } }, offer = { type = 'give-item', item = 'construction-robot', count = 1 } }
}
for _, item in pairs(market_items) do
global.market.add_market_item(item)
end
end
local function is_game_surface(event)
local surface = game.surfaces[SURVIVAL_IN_POLLUTION]
if not surface then
return false
end
return surface.name == event.surface.name
end
local function do_market_init(event)
local area = event.area
local left_top = area.left_top
if left_top.x <= -196 then
if not global.market then
game.print('market generation')
local surface = game.surfaces[SURVIVAL_IN_POLLUTION]
local spawn_position_x = -76
local pos = surface.find_non_colliding_position("market", { spawn_position_x, 0 }, 50, 1)
global.market = surface.create_entity({ name = "market", position = pos, force = "player" })
global.market.minable = false
refresh_market_offers()
game.forces['player'].chart(surface, {
{ pos.x - 200, pos.y - 200 },
{ pos.x + 200, pos.y + 200 }
})
--teleport_players_to_market(surface)
end
end
end
local function on_chunk_generated(event)
if is_game_surface(event) then
do_market_init(event)
end
end
Event.register(defines.events.on_chunk_generated, on_chunk_generated)
|
commoner_male = {
"object/mobile/dressed_commoner_fat_human_male_01.iff",
"object/mobile/dressed_commoner_fat_human_male_02.iff",
"object/mobile/dressed_commoner_fat_twilek_male_01.iff",
"object/mobile/dressed_commoner_fat_twilek_male_02.iff",
"object/mobile/dressed_commoner_fat_zabrak_male_01.iff",
"object/mobile/dressed_commoner_fat_zabrak_male_02.iff",
"object/mobile/dressed_commoner_naboo_bothan_male_01.iff",
"object/mobile/dressed_commoner_naboo_bothan_male_02.iff",
"object/mobile/dressed_commoner_naboo_human_male_01.iff",
"object/mobile/dressed_commoner_naboo_human_male_02.iff",
"object/mobile/dressed_commoner_naboo_human_male_03.iff",
"object/mobile/dressed_commoner_naboo_human_male_04.iff",
"object/mobile/dressed_commoner_naboo_human_male_05.iff",
"object/mobile/dressed_commoner_naboo_human_male_06.iff",
"object/mobile/dressed_commoner_naboo_human_male_07.iff",
"object/mobile/dressed_commoner_naboo_human_male_08.iff",
"object/mobile/dressed_commoner_naboo_moncal_male_01.iff",
"object/mobile/dressed_commoner_naboo_moncal_male_02.iff",
"object/mobile/dressed_commoner_naboo_twilek_male_01.iff",
"object/mobile/dressed_commoner_naboo_twilek_male_02.iff",
"object/mobile/dressed_commoner_naboo_zabrak_male_01.iff",
"object/mobile/dressed_commoner_naboo_zabrak_male_02.iff",
"object/mobile/dressed_commoner_old_human_male_01.iff",
"object/mobile/dressed_commoner_old_human_male_02.iff",
"object/mobile/dressed_commoner_old_twilek_male_01.iff",
"object/mobile/dressed_commoner_old_twilek_male_02.iff",
"object/mobile/dressed_commoner_old_zabrak_male_01.iff",
"object/mobile/dressed_commoner_old_zabrak_male_02.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_01.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_02.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_03.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_04.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_05.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_06.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_07.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_08.iff",
"object/mobile/dressed_commoner_tatooine_aqualish_male_09.iff",
"object/mobile/dressed_commoner_tatooine_bith_male_01.iff",
"object/mobile/dressed_commoner_tatooine_bith_male_02.iff",
"object/mobile/dressed_commoner_tatooine_bith_male_03.iff",
"object/mobile/dressed_commoner_tatooine_bith_male_04.iff",
"object/mobile/dressed_commoner_tatooine_bith_male_05.iff",
"object/mobile/dressed_commoner_tatooine_bith_male_06.iff",
"object/mobile/dressed_commoner_tatooine_devaronian_male_01.iff",
"object/mobile/dressed_commoner_tatooine_devaronian_male_02.iff",
"object/mobile/dressed_commoner_tatooine_devaronian_male_03.iff",
"object/mobile/dressed_commoner_tatooine_devaronian_male_04.iff",
"object/mobile/dressed_commoner_tatooine_ishitib_male_01.iff",
"object/mobile/dressed_commoner_tatooine_ishitib_male_02.iff",
"object/mobile/dressed_commoner_tatooine_ishitib_male_03.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_01.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_02.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_03.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_04.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_05.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_06.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_07.iff",
"object/mobile/dressed_commoner_tatooine_nikto_male_08.iff",
"object/mobile/dressed_commoner_tatooine_rodian_male_01.iff",
"object/mobile/dressed_commoner_tatooine_rodian_male_02.iff",
"object/mobile/dressed_commoner_tatooine_rodian_male_03.iff",
"object/mobile/dressed_commoner_tatooine_rodian_male_04.iff",
"object/mobile/dressed_commoner_tatooine_sullustan_male_01.iff",
"object/mobile/dressed_commoner_tatooine_sullustan_male_02.iff",
"object/mobile/dressed_commoner_tatooine_sullustan_male_03.iff",
"object/mobile/dressed_commoner_tatooine_sullustan_male_04.iff",
"object/mobile/dressed_commoner_tatooine_sullustan_male_05.iff",
"object/mobile/dressed_commoner_tatooine_sullustan_male_06.iff",
"object/mobile/dressed_commoner_tatooine_trandoshan_male_01.iff",
"object/mobile/dressed_commoner_tatooine_trandoshan_male_02.iff",
}
addDressGroup("commoner_male", commoner_male)
|
function add_dazy()
project( "Dazy" )
kind "StaticLib"
location "Dazy"
staticruntime "on"
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
}
includedirs
{
"%{prj.name}/src",
"%{prj.name}/src/Core",
"ThirdParty/spdlog/include",
"ThirdParty/glfw/include",
}
links{ "glfw" }
end
|
--- Rotation model for gamepad controls
-- @classmod GamepadRotateModel
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
local AccelTween = require("AccelTween")
local BaseObject = require("BaseObject")
local CameraGamepadInputUtils = require("CameraGamepadInputUtils")
local GamepadRotateModel = setmetatable({}, BaseObject)
GamepadRotateModel.__index = GamepadRotateModel
GamepadRotateModel.ClassName = "GamepadRotateModel"
function GamepadRotateModel.new()
local self = setmetatable(BaseObject.new(), GamepadRotateModel)
self._rampVelocityX = AccelTween.new(25)
self._rampVelocityY = AccelTween.new(25)
self.IsRotating = Instance.new("BoolValue")
self.IsRotating.Value = false
self._maid:GiveTask(self.IsRotating)
return self
end
function GamepadRotateModel:GetThumbstickDeltaAngle()
if not self._lastInputObject then
return Vector2.new()
end
return Vector2.new(self._rampVelocityX.p, self._rampVelocityY.p)
end
function GamepadRotateModel:StopRotate()
self._lastInputObject = nil
self._rampVelocityX.t = 0
self._rampVelocityX.p = self._rampVelocityX.t
self._rampVelocityY.t = 0
self._rampVelocityY.p = self._rampVelocityY.t
self.IsRotating.Value = false
end
function GamepadRotateModel:HandleThumbstickInput(inputObject)
if CameraGamepadInputUtils.outOfDeadZone(inputObject) then
self._lastInputObject = inputObject
local stickOffset = self._lastInputObject.Position
stickOffset = Vector2.new(-stickOffset.x, stickOffset.y) -- Invert axis!
local adjustedStickOffset = CameraGamepadInputUtils.gamepadLinearToCurve(stickOffset)
self._rampVelocityX.t = adjustedStickOffset.x
self._rampVelocityY.t = adjustedStickOffset.y
self.IsRotating.Value = true
else
self:StopRotate()
end
end
return GamepadRotateModel
|
RegisterLuaAnimation('raisearmtest', {
FrameData = {
{
BoneInfo = {
['ValveBiped.Bip01_L_UpperArm'] = {
},
['ValveBiped.Bip01_R_UpperArm'] = {
}
},
FrameRate = 100
},
{
BoneInfo = {
['ValveBiped.Bip01_L_UpperArm'] = {
RU = -46,
RR = -16,
RF = -1
},
['ValveBiped.Bip01_R_UpperArm'] = {
}
},
FrameRate = 6.0
},
{
BoneInfo = {
['ValveBiped.Bip01_L_UpperArm'] = {
RU = -92,
RR = -31,
RF = -1
},
['ValveBiped.Bip01_R_UpperArm'] = {
RU = -72,
RR = -3,
RF = 37
}
},
FrameRate = 6.0
},
},
Type = TYPE_GESTURE
})
|
local tests = {
{
name = "AllocatorTest",
includedirs =
{
"../Dependencies/EASTL/include",
"../Dependencies/optick",
"../Frameworks/Gaff/include",
"../Engine/Engine/include",
"../Engine/Memory/include"
},
links =
{
"Gaff",
"Gleam",
"Memory",
"EASTL",
"Engine",
"mpack",
"optick"
},
extra = function ()
filter { "system:windows" }
-- links { "ws2_32.lib", "iphlpapi.lib", "psapi.lib", "userenv.lib", "DbgHelp" }
links { "DbgHelp" }
-- filter { "action:vs*" }
-- buildoptions { "/bigobj" }
filter {}
end
},
{
name = "ReflectionTest",
includedirs =
{
"../Dependencies/EASTL/include",
"../Dependencies/mpack",
"../Dependencies/optick",
"../Dependencies/rapidjson",
"../Frameworks/Gaff/include",
"../Engine/Engine/include",
"../Engine/Memory/include"
},
links =
{
"Gaff",
"Gleam",
"Memory",
"EASTL",
"Engine",
"mpack",
"optick"
},
extra = function ()
filter { "system:windows" }
-- links { "ws2_32.lib", "iphlpapi.lib", "psapi.lib", "userenv.lib", "DbgHelp" }
links { "DbgHelp" }
-- filter { "action:vs*" }
-- buildoptions { "/bigobj" }
filter {}
end
},
{
name = "ECSTest",
includedirs =
{
"../Dependencies/EASTL/include",
"../Dependencies/rapidjson",
"../Dependencies/glm",
"../Dependencies/mpack",
"../Dependencies/optick",
"../Frameworks/Gaff/include",
"../Frameworks/Gleam/include",
"../Engine/Engine/include",
"../Engine/Memory/include",
"../Modules/Resource/include",
"../Modules/ECS/include"
},
links =
{
"Gaff",
"Gleam",
"Memory",
"Engine",
"ECS",
"Resource",
"MainLoop",
"EASTL",
"mpack",
"optick",
},
extra = function ()
filter { "system:windows" }
-- links { "ws2_32.lib", "iphlpapi.lib", "psapi.lib", "userenv.lib", "DbgHelp" }
links { "DbgHelp" }
-- filter { "action:vs*" }
-- buildoptions { "/bigobj" }
filter {}
end
}
}
function GenTest(settings)
project(settings.name)
if _ACTION then
location(GetTestsLocation())
end
kind(settings.kind or "ConsoleApp")
debugdir "../../workingdir/tests"
language "C++"
flags { "FatalWarnings" }
if settings.files then
files(settings.files)
else
files { settings.name .. ".cpp" }
end
if settings.dependson then
dependson(settings.dependson)
else
dependson(settings.links)
end
if settings.defines then
defines(settings.defines)
end
if settings.extra then
settings.extra()
end
includedirs(settings.includedirs)
links(settings.links)
includedirs
{
"../Dependencies/Catch2"
}
links
{
"Catch2"
}
SetupConfigMap()
ModuleCopy("tests")
end
table.foreachi(tests, GenTest)
|
local PotHead = RegisterMod( "PotHead",1 );
local PotHeadItem = Isaac.GetItemIdByName("Pothead")
local PotHeadCostume = Isaac.GetCostumeIdByPath("gfx/characters/potcostume.anm2")
local PotEntity = Isaac.GetEntityTypeByName("BluePot")
local BluePot = Isaac.GetEntityVariantByName("BluePot")
local GreenPot = Isaac.GetEntityVariantByName("GreenPot")
local PurplePot = Isaac.GetEntityVariantByName("PurplePot")
local RedPot = Isaac.GetEntityVariantByName("RedPot")
local tears = {}
local had = false
local oldSeed = 0
function PotHead:UPDATE()
local game = Game()
local room = game:GetRoom()
local player = Isaac.GetPlayer(0)
if oldSeed ~= room:GetDecorationSeed() then
oldSeed = room:GetDecorationSeed()
tears = {}
end
math.randomseed(room:GetFrameCount() + Random() + math.random() )
if player:HasCollectible(PotHeadItem) == false then return end
local startColor = {r=0.8,g=0.8,b=0}
local endColor = {r=0,g=0,b=1}
for i=1,#tears do
local c = Color(0,0,0.5+(math.sin(tears[i].FrameCount/3)+1)*0.25,1,0,0,0)
--local c = Color(0.89- (math.sin(tears[i].FrameCount/10)+1)*0.4,0.8 - (math.sin(tears[i].FrameCount/10)+1)*0.4,0+(math.sin(tears[i].FrameCount/10)+1)*0.5,1,0,0,0)
tears[i]:SetColor(c,9999,99,false,false )
end
local ents = Isaac.GetRoomEntities()
for i=1,#ents do
if ents[i].Type == EntityType.ENTITY_TEAR and ents[i].Parent.Type == EntityType.ENTITY_PLAYER then
if ents[i]:GetData().evaled == nil then
if player.Luck + 4 > math.random() * 29 then
--ents[i]:SetColor(Color(0, 3, 9, 1, 2, 3, 9), 99999, 99, false, false)
table.insert(tears,ents[i])
end
ents[i]:GetData().evaled = true
end
end
end
end
function PotHead:pot_update(npc)
if npc:GetSprite():IsFinished("Appear") then
npc:GetSprite():Play("Idle",true)
end
end
function PotHead:onRunStart()
tearDown = false
had = false
end
function PotHead:Sound(index)
local player = Isaac.GetPlayer(0)
local sound_entity = Isaac.Spawn(EntityType.ENTITY_FLY, 0, 0, player.Position, Vector(0,0), nil):ToNPC()
sound_entity:PlaySound(index, 0.3, 0, false, 1)
sound_entity:Remove()
end
function PotHead:drawText( )
local game = Game()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
--Isaac.RenderText(tostring(GreenPot), 60, 60, 1, 1,1, 1)
if player:HasCollectible(PotHeadItem) == true and had == false then
player:AddNullCostume(PotHeadCostume)
had = true
end
if player:HasCollectible(PotHeadItem) == false and had == true then
had = false
end
end
function PotHead:on_Damage(entity, amount, damageflag, source, countdownframes)
local player = Isaac.GetPlayer(0)
if player:HasCollectible(PotHeadItem) == false then return end
--TearMorph
if entity:IsVulnerableEnemy() and entity:IsBoss() == false and entity.Type ~= PotEntity and source.Type == EntityType.ENTITY_TEAR then
local isTear = false
for i=1,#tears do
if source.Entity.Index == tears[i].Index then isTear = true end
end
if isTear then
local pot = Isaac.Spawn(PotEntity,math.random(0,3),0,entity.Position,Vector(0,0),player)
entity:Remove()
end
end
--PotDestroy
if entity:IsVulnerableEnemy() and entity.Type == PotEntity and entity.HitPoints < amount and entity.HitPoints > 0 then
if entity.Variant == BluePot then
local npc = entity:ToNPC()
local tearcount = 9
local vel = Vector(7,0)
-- This is fucking stupid
local damage = player.Damage
local shotspeed = player.ShotSpeed
local height = player.TearHeight
local tearFlags = player.TearFlags
local fallingspeed = player.TearFallingSpeed
local fallaccel = player.TearFallingAcceleration
local TearColor = player.TearColor
player.Damage = 5
player.ShotSpeed = 5
player.TearHeight = -30
player.TearFlags = 0
player.TearFallingSpeed = 0
player.TearFallingAcceleration = 0.14
player.TearColor = Color(1, 1, 1, 1, 0, 0, 0)
for i=1,tearcount do
local t = player:FireTear(entity.Position,vel,false,true,false)
t:SetColor(Color(1, 1, 1, 1, 0,0, 0), 99999, 99, false, false)
t.Parent = t
vel = vel:Rotated(360/tearcount)
t:ChangeVariant(0)
t.Scale = 1
end
player.Damage = damage
player.ShotSpeed = shotspeed
player.TearHeight = height
player.TearFlags = tearFlags
player.TearFallingSpeed = fallingspeed
player.TearFallingAcceleration = fallaccel
player.TearColor = TearColor
-- end of cancerous code.
elseif entity.Variant == GreenPot then
local creep = Isaac.Spawn(EntityType.ENTITY_EFFECT,EffectVariant.PLAYER_CREEP_GREEN,0,entity.Position,Vector(0,0),entity):ToEffect()
creep.LifeSpan = 120
local r = math.random(0,5)
if r == 0 then creep:GetSprite():Play("BiggestBlood1",true)
elseif r == 1 then creep:GetSprite():Play("BiggestBlood2",true)
elseif r == 2 then creep:GetSprite():Play("BiggestBlood3",true)
elseif r == 3 then creep:GetSprite():Play("BiggestBlood4",true)
elseif r == 4 then creep:GetSprite():Play("BiggestBlood5",true)
elseif r == 5 then creep:GetSprite():Play("BiggestBlood6",true)
end
creep:GetSprite().Scale = Vector(1.8,1.8)
creep:SetTimeout(120)
--creep.LifeSpan = 2600
--creep:SetColor(Color(1, 1, 1, 1, 70, 150, 0), 99999, 99, false, false)
elseif entity.Variant == PurplePot then
local ents = Isaac.GetRoomEntities()
for i=1,#ents do
if ents[i]:IsEnemy() then
if (ents[i].Position - entity.Position):Length() < 180 then
ents[i]:AddFear(source,60)
end
end
end
local fart = Isaac.Spawn(EntityType.ENTITY_EFFECT,EffectVariant.FART,0,entity.Position,Vector(0,0),entity)
fart:SetColor(Color(1, 1, 1, 1, 70, 0, 150), 99999, 99, false, false)
elseif entity.Variant == RedPot then
if entity:GetData().put == nil then
entity:GetData().put = true
Game():BombExplosionEffects(entity.Position,60, 0,Color(1,1,1,1,0,0,0),entity,1,false,entity)
end
Isaac.Spawn(EntityType.ENTITY_EFFECT,EffectVariant.RED_CANDLE_FLAME,0,entity.Position,Vector(0,0),entity)
end
end
end
PotHead:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG,PotHead.on_Damage)
PotHead:AddCallback(ModCallbacks.MC_POST_RENDER,PotHead.drawText)
PotHead:AddCallback(ModCallbacks.MC_POST_UPDATE,PotHead.UPDATE)
PotHead:AddCallback(ModCallbacks.MC_POST_PLAYER_INIT,PotHead.OnRunStart)
PotHead:AddCallback(ModCallbacks.MC_NPC_UPDATE,PotHead.pot_update,PotEntity)
|
--------------------------------
-- @module Armature
-- @extend Node,BlendProtocol
-- @parent_module ccs
---@class ccs.Armature:ccs.Node,ccs.BlendProtocol
local Armature = {}
ccs.Armature = Armature
--------------------------------
--- Get a bone with the specified name
--- param name The bone's name you want to get
---@param name string
---@return ccs.Bone
function Armature:getBone(name)
end
--------------------------------
--- Change a bone's parent with the specified parent name.
--- param bone The bone you want to change parent
--- param parentName The new parent's name.
---@param bone ccs.Bone
---@param parentName string
---@return ccs.Armature
function Armature:changeBoneParent(bone, parentName)
end
--------------------------------
---
---@param animation ccs.ArmatureAnimation
---@return ccs.Armature
function Armature:setAnimation(animation)
end
--------------------------------
---
---@param x number
---@param y number
---@return ccs.Bone
function Armature:getBoneAtPoint(x, y)
end
--------------------------------
---
---@return boolean
function Armature:getArmatureTransformDirty()
end
--------------------------------
---
---@param version number
---@return ccs.Armature
function Armature:setVersion(version)
end
--------------------------------
--- Set contentsize and Calculate anchor point.
---@return ccs.Armature
function Armature:updateOffsetPoint()
end
--------------------------------
---
---@return ccs.Bone
function Armature:getParentBone()
end
--------------------------------
--- Remove a bone with the specified name. If recursion it will also remove child Bone recursionly.
--- param bone The bone you want to remove
--- param recursion Determine whether remove the bone's child recursion.
---@param bone ccs.Bone
---@param recursion boolean
---@return ccs.Armature
function Armature:removeBone(bone, recursion)
end
--------------------------------
---
---@return ccs.BatchNode
function Armature:getBatchNode()
end
--------------------------------
---
---@param name string
---@param parentBone ccs.Bone
---@return boolean
---@overload fun(self:ccs.Armature, name:string):boolean
function Armature:init(name, parentBone)
end
--------------------------------
---
---@param parentBone ccs.Bone
---@return ccs.Armature
function Armature:setParentBone(parentBone)
end
--------------------------------
---
---@param batchNode ccs.BatchNode
---@return ccs.Armature
function Armature:setBatchNode(batchNode)
end
--------------------------------
--- js NA
--- lua NA
---@return cc.BlendFunc
function Armature:getBlendFunc()
end
--------------------------------
---
---@param armatureData ccs.ArmatureData
---@return ccs.Armature
function Armature:setArmatureData(armatureData)
end
--------------------------------
--- Add a Bone to this Armature,
--- param bone The Bone you want to add to Armature
--- param parentName The parent Bone's name you want to add to . If it's nullptr, then set Armature to its parent
---@param bone ccs.Bone
---@param parentName string
---@return ccs.Armature
function Armature:addBone(bone, parentName)
end
--------------------------------
---
---@return ccs.ArmatureData
function Armature:getArmatureData()
end
--------------------------------
---
---@return number
function Armature:getVersion()
end
--------------------------------
---
---@return ccs.ArmatureAnimation
function Armature:getAnimation()
end
--------------------------------
---
---@return vec2_table
function Armature:getOffsetPoints()
end
--------------------------------
--- js NA
--- lua NA
---@param blendFunc cc.BlendFunc
---@return ccs.Armature
function Armature:setBlendFunc(blendFunc)
end
--------------------------------
--- Get Armature's bone dictionary
--- return Armature's bone dictionary
---@return map_table
function Armature:getBoneDic()
end
--------------------------------
--- Allocates an armature, and use the ArmatureData named name in ArmatureDataManager to initializes the armature.<br>
-- param name Armature will use the name to find the ArmatureData to initializes it.<br>
-- return A initialized armature which is marked as "autorelease".
---@param name string
---@param parentBone ccs.Bone
---@return ccs.Armature
---@overload fun(self:ccs.Armature, name:string):ccs.Armature
---@overload fun(self:ccs.Armature):ccs.Armature
function Armature:create(name, parentBone)
end
--------------------------------
---
---@param point vec2_table
---@return ccs.Armature
function Armature:setAnchorPoint(point)
end
--------------------------------
---
---@param renderer cc.Renderer
---@param transform mat4_table
---@param flags number
---@return ccs.Armature
function Armature:draw(renderer, transform, flags)
end
--------------------------------
---
---@return vec2_table
function Armature:getAnchorPointInPoints()
end
--------------------------------
---
---@param dt number
---@return ccs.Armature
function Armature:update(dt)
end
--------------------------------
--- Init the empty armature
---@return boolean
function Armature:init()
end
--------------------------------
---
---@return mat4_table
function Armature:getNodeToParentTransform()
end
--------------------------------
--- This boundingBox will calculate all bones' boundingBox every time
---@return rect_table
function Armature:getBoundingBox()
end
--------------------------------
--- js ctor
---@return ccs.Armature
function Armature:Armature()
end
return nil
|
---
-- drawable_cell.lua
local class = require "middleclass"
local DrawableCell = class("DrawableCell")
function DrawableCell:initialize(data)
self.tiles = data.tiles
self.position = data.position
end
function DrawableCell:get_tiles()
return self.tiles
end
function DrawableCell:get_position()
return self.position
end
return DrawableCell
|
-- Manual registration
local C = UDRefl.RegisterType({
type = "C",
methods = {
{
name = "__ctor",
body = function (obj)
print("ctor " .. obj:GetType():GetName())
end
},
{
name = "__dtor",
body = function (obj)
print("dtor " .. obj:GetType():GetName())
end
}
}
})
local c0 = SharedObject.new(C)
local c1 = SharedObject.new(C)
c0:Reset() -- call c0:__dtor
-- clear
print("run : c0 = nil")
c0 = nil
print("run : c1 = nil")
c1 = nil
print("run : collectgarbage()")
collectgarbage() -- run c1:__dtor here
ObjectView.ReflMngr.typeinfos:erase(C)
|
--[[
© 2015 Novabox.org do not share, re-distribute or modify
without permission of its author (dragonfabledonnny@gmail.com).
--]]
-- Command for creating a zombie.
nut.command.add("createzombie", {
adminOnly = true,
onRun = function( client, arguments )
local trace = { };
trace.start = client:EyePos();
trace.endpos = trace.start + client:GetAimVector() * 4096;
trace.filter = client;
local tr = util.TraceLine( trace );
if( SCHEMA.Z.CanSpawnZombie( tr.HitPos, true ) ) then
SCHEMA.Z.CreateZombie( tr.HitPos, tr.HitNormal );
else
client:notify( "You cannot spawn a zombie there!" )
end
end
})
-- Command for deleting the navmesh.
nut.command.add("navdelete", {
adminOnly = true,
onRun = function( client, arguments )
if( !nav ) then return end
SCHEMA.NAV.Delete();
end
})
-- Command for generating the navmesh from the navseeds.
nut.command.add("navgenerate", {
adminOnly = true,
onRun = function( client, arguments )
if( !nav ) then return end
SCHEMA.NAV.StartGenerate();
end
})
-- Command for adding a seed to a surface.
nut.command.add("navaddseed", {
adminOnly = true,
onRun = function( client, arguments )
if( !nav ) then return end
SCHEMA.NAV.AddSeed( player:GetEyeTraceNoCursor() );
end
})
-- Command for clearing all of the seeds.
nut.command.add("navclearseeds", {
adminOnly = true,
onRun = function( client, arguments )
if( !nav ) then return end
SCHEMA.NAV.ClearSeeds();
end
})
-- Command for toggling zombie spawning.
nut.command.add("togglezombiespawning", {
adminOnly = true,
onRun = function( client, arguments )
SCHEMA.Config.AutoZombieSpawn = !SCHEMA.Config.AutoZombieSpawn;
end
})
-- Command for clearing all zombies.
nut.command.add("clearzombies", {
adminOnly = true,
onRun = function( client, arguments )
SCHEMA.Z.ClearZombies()
end
})
|
Dntg_FrameDefine = {
Frame = {
Chain = {
Animation1 = "RedLine",
Animation3 = "LightChain",
Animation2 = "BlueLine"
},
UI = {
MinButton = {
PosY = 1,
PosX = 1277,
Animation = "MinButton"
},
CloseButton = {
PosY = 1,
PosX = 1380,
Animation = "CloseButton"
},
SetButton = {
PosY = 1,
PosX = 1328,
Animation = "SetButton"
},
DownButton = {
PosY = 868,
PosX = 600,
Animation = "DownScore"
},
PingPos = {
X = 20,
Y = 1000
},
UpButton = {
PosY = 868,
PosX = 653,
Animation = "UpScore"
},
ScorePos = {
X = 518,
Y = 880
},
Frame = {
Left = "Left",
Right = "Right",
ScorNum = "userscore_num",
title = "Title",
bottom = "SelfInfo",
CurSor = "Cursor"
},
AutoButton = {
PosY = 868,
PosX = 720,
Animation = "CheckBt"
},
NamePos = {
X = 80,
Y = 865
}
},
Bingo = {
NumAin = "bingo_num",
Rotation = 0,
Animation = "bingo"
},
FileList = {
Bullet = "Fishing/Script/BulletSet.xml",
Scene = "Fishing/Script/Scene.xml",
Troop = "Fishing/Script/TroopSet.xml",
System = "Fishing/Script/System.xml",
BoundingBox = "Fishing/Script/BoundingBox.xml",
Fish = "Fishing/Script/Fish.xml",
Sound = "Fishing/Script/FishSound.xml",
CannonSet = "Fishing/Script/CannonSet.xml",
Special = "Fishing/Script/Special.xml",
Visual = "Fishing/Script/Visual.xml",
Path = "Fishing/Script/Path.xml"
},
Effect = {
{
File = "Resource/particle/Particles.pyro"
}
},
LockFish = {
Flag = "lock_flag",
TagFlag = "lock_flag_%d",
Line = "lock_line"
},
Loading = {
ProgressBar = {
PosY = 788,
PosX = 559,
Bar = {
PosY = 0,
PosX = 0,
Img = "Fishing/images/UI/progress_bar.png"
},
Bg = {
PosY = 0,
PosX = 0,
Img = "Fishing/images/UI/progress_bar_bg.png"
}
},
BackGround = {
PosY = 0,
PosX = 0,
Img = "Fishing/images/UI/background.png"
}
},
Treasure = {
AwardTips = "awardTips",
RotaryTable = "rotaryTable",
Unknow = "fish23",
Points = "points"
},
Jetton = {
SpriteBG2 = "jetton_bgc2",
GoldAni = "gold",
NumAin = "jetton_num",
SpriteBG1 = "jetton_bgc1",
Sprite = "jetton"
},
Special = {
BlackWater = {
Sprite = "BlackWater"
}
}
}
}
return
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.