content
stringlengths
5
1.05M
DEFAULT_CHAT_FRAME:AddMessage('[IncompleteAchievements] "Incomplete" option has been selected by default in achievements dropdown menu', 1,1,0) local frame = CreateFrame ("Button", "IncompleteAchievementsFrame", UIParent) frame:RegisterEvent("ADDON_LOADED") frame:SetScript("OnEvent", function (self,event,arg1,...) if (event == "ADDON_LOADED" and arg1 == "Blizzard_AchievementUI") then SelectIncompleteAchievements() end end) function SelectIncompleteAchievements() AchievementFrame_SetFilter(ACHIEVEMENT_FILTER_INCOMPLETE); end
-- test reconnecting a socket, should return an error "already connected" -- test based on Windows behaviour, see comments in `copas.connect()` function local copas = require("copas") local socket = require("socket") local skt = copas.wrap(socket.tcp()) local done = false copas.addthread(function() copas.sleep(0) print("First try... (should succeed)") local ok, err = skt:connect("google.com", 80) if ok then print("Success") else print("Failed: "..err) os.exit(1) end print("\nSecond try... (should error as already connected)") ok, err = skt:connect("thijsschreijer.nl", 80) if ok then print("Unexpected success") os.exit(1) else print("Failed: "..err) end done = true end) copas.loop() if not done then print("Loop completed with test not finished") os.exit(1) end
-- -- Name: monodevelop/monodevelop.lua -- Purpose: Define the MonoDevelop action. -- Author: Manu Evans -- Created: 2013/10/28 -- Copyright: (c) 2013-2015 Manu Evans and the Premake project -- local p = premake p.modules.monodevelop = {} local m = p.modules.monodevelop m._VERSION = p._VERSION m.elements = {} local vs2010 = p.vstudio.vs2010 local vstudio = p.vstudio local sln2005 = p.vstudio.sln2005 local project = p.project local config = p.config -- -- Write out contents of the SolutionProperties section; currently unused. -- function m.MonoDevelopProperties(wks) _p('\tGlobalSection(MonoDevelopProperties) = preSolution') if wks.startproject then for prj in p.workspace.eachproject(wks) do if prj.name == wks.startproject then -- TODO: fix me! -- local prjpath = vstudio.projectfile_ng(prj) -- prjpath = path.translate(path.getrelative(slnpath, prjpath)) -- _p('\t\tStartupItem = %s', prjpath ) end end end -- NOTE: multiline descriptions, or descriptions with tab's (/n, /t, etc) need to be escaped with @ -- Looks like: description = @descriptopn with\nnewline and\ttab's. -- _p('\t\tdescription = %s', 'workspace description') -- _p('\t\tversion = %s', '0.1') _p('\tEndGlobalSection') end -- -- Patch some functions -- p.override(vstudio, "projectPlatform", function(oldfn, cfg) if _ACTION == "monodevelop" then if cfg.platform then return cfg.buildcfg .. " " .. cfg.platform else return cfg.buildcfg end end return oldfn(cfg) end) p.override(vstudio, "archFromConfig", function(oldfn, cfg, win32) if _ACTION == "monodevelop" then return "Any CPU" end return oldfn(cfg, win32) end) p.override(sln2005, "solutionSections", function(oldfn, wks) if _ACTION == "monodevelop" then return { "ConfigurationPlatforms", -- "SolutionProperties", -- this doesn't seem to be used by MonoDevelop "MonoDevelopProperties", "NestedProjects", } end return oldfn(prj) end) p.override(sln2005.elements, "sections", function(oldfn, wks) local elements = oldfn(wks) elements = table.join(elements, { m.MonoDevelopProperties, }) return elements end) p.override(vstudio, "projectfile", function(oldfn, prj) if _ACTION == "monodevelop" then if project.iscpp(prj) then return p.filename(prj, ".cproj") end end return oldfn(prj) end) p.override(vstudio, "tool", function(oldfn, prj) if _ACTION == "monodevelop" then if project.iscpp(prj) then return "2857B73E-F847-4B02-9238-064979017E93" end end return oldfn(prj) end) --- -- Identify the type of project being exported and hand it off -- the right generator. --- function m.generateProject(prj) p.eol("\r\n") p.indent(" ") p.escaper(vs2010.esc) if project.isdotnet(prj) then p.generate(prj, ".csproj", vstudio.cs2005.generate) p.generate(prj, ".csproj.user", vstudio.cs2005.generateUser) elseif project.iscpp(prj) then p.generate(prj, ".cproj", m.generate) end end include("monodevelop_cproj.lua") return m
WADemoLuaAlertView = {} function WADemoLuaAlertView.show(title,message,cancelButtonTitle,otherButtonTitles,cancelFunc,otherFunc) local param = {title = title,message = message,cancelButtonTitle = cancelButtonTitle,otherButtonTitles = otherButtonTitles,cancelFunc = cancelFunc ,otherFunc = otherFunc} luaoc.callStaticMethod("WADemoLuaAlertViewAdapter","show",param) end
AuctionatorItemKeyCellTemplateMixin = CreateFromMixins(AuctionatorCellMixin, AuctionatorRetailImportTableBuilderCellMixin) function AuctionatorItemKeyCellTemplateMixin:Init() self.Text:SetJustifyH("LEFT") end function AuctionatorItemKeyCellTemplateMixin:Populate(rowData, index) AuctionatorCellMixin.Populate(self, rowData, index) self.Text:SetText(rowData.itemName or "") if rowData.iconTexture ~= nil then self.Icon:SetTexture(rowData.iconTexture) self.Icon:Show() end self.Icon:SetAlpha(rowData.noneAvailable and 0.5 or 1.0) end function AuctionatorItemKeyCellTemplateMixin:OnEnter() AuctionHouseUtil.LineOnEnterCallback(self, self.rowData) AuctionatorCellMixin.OnEnter(self) end function AuctionatorItemKeyCellTemplateMixin:OnLeave() AuctionHouseUtil.LineOnLeaveCallback(self, self.rowData) AuctionatorCellMixin.OnLeave(self) end
--[[ Placeholder page for SettingsHub that manages top level Roact view This page is a container and controller for the Roact app --]] local CoreGui = game:GetService("CoreGui") local RobloxGui = CoreGui:WaitForChild("RobloxGui") local ShareGame = RobloxGui.Modules.Settings.Pages.ShareGame local Constants = require(ShareGame.Constants) local OpenPage = require(ShareGame.Actions.OpenPage) local ClosePage = require(ShareGame.Actions.ClosePage) local settingsPageFactory = require(RobloxGui.Modules.Settings.SettingsPageFactory) local this = settingsPageFactory:CreateNewPage() this.TabHeader = nil -- no tab for this page this.PageListLayout.Parent = nil -- no list layout for this page this.ShouldShowBottomBar = false this.ShouldShowHubBar = false this.IsPageClipped = false this.Page.Name = "ShareGameDummy" this.Page.Size = UDim2.new(1, 0, 0, 0) function this:ConnectHubToApp(settingsHub, shareGameApp) this:SetHub(settingsHub) shareGameApp.store.changed:connect(function(state, prevState) local page = state.Page local wasOpen = prevState.Page.IsOpen -- Check if the user closed the page via the Roact app. if page.Route == Constants.PageRoute.SHARE_GAME and (wasOpen and not page.IsOpen) then -- Close the page to sync up Settings Hub with the state change this.HubRef:PopMenu(nil, true) end end) this.Displayed.Event:Connect(function() local state = shareGameApp.store:getState() if not state.Page.IsOpen then -- Tell Roact app that the page was opened via Settings Hub shareGameApp.store:dispatch(OpenPage(Constants.PageRoute.SETTINGS_HUB)) end end) this.Hidden.Event:Connect(function() -- The user closed the page via the Settings Hub (instead of -- pressing back on the page), so we have to sync the app state up -- with the Settings Hub action. local state = shareGameApp.store:getState() if state.Page.IsOpen then shareGameApp.store:dispatch(ClosePage(Constants.PageRoute.SETTINGS_HUB)) end end) shareGameApp.store:dispatch(ClosePage(Constants.PageRoute.SETTINGS_HUB)) end return this
--[[ Provides: autocrafting, resource limits, on-demand crafting. Turtle crafting: 1. The turtle must have a crafting table equipped. 2. Equip the turtle with an introspection module. ]]-- _G.requireInjector(_ENV) local Config = require('config') local Event = require('event') local Milo = require('milo') local Sound = require('sound') local Storage = require('storage') local UI = require('ui') local Util = require('util') local device = _G.device local fs = _G.fs local multishell = _ENV.multishell local os = _G.os local shell = _ENV.shell local turtle = _G.turtle if multishell then multishell.setTitle(multishell.getCurrent(), 'Milo') end local nodes = Config.load('milo', { }) -- TODO: remove - temporary if nodes.remoteDefaults then nodes.nodes = nodes.remoteDefaults nodes.remoteDefaults = nil end -- TODO: remove - temporary if nodes.nodes then local categories = { input = 'custom', trashcan = 'custom', machine = 'machine', brewingStand = 'machine', activity = 'display', jobs = 'display', ignore = 'ignore', hidden = 'ignore', manipulator = 'custom', storage = 'storage', } for _, node in pairs(nodes.nodes) do if node.lock and type(node.lock) == 'string' then node.lock = { [ node.lock ] = true, } end if not node.category then node.category = categories[node.mtype] if not node.category then Util.print(node) error('invalid node') end end end nodes = nodes.nodes end local function Syntax(msg) print([[ Turtle must be equipped with: * Introspection module * Workbench Turtle must be connected to: * Wired modem ]]) error(msg) end local modem for _,v in pairs(device) do if v.type == 'wired_modem' then if modem then Syntax('Only 1 wired modem can be connected') end modem = v end end if not modem or not modem.getNameLocal then Syntax('Wired modem missing') end if not modem.getNameLocal() then Syntax('Wired modem is not active') end local introspection = device['plethora:introspection'] or turtle.equip('left', 'plethora:module:0') and device['plethora:introspection'] or Syntax('Introspection module missing') if not device.workbench then turtle.equip('right', 'minecraft:crafting_table:0') if not device.workbench then Syntax('Workbench missing') end end local localName = modem.getNameLocal() local context = { resources = Util.readTable(Milo.RESOURCE_FILE) or { }, state = { }, craftingQueue = { }, tasks = { }, queue = { }, storage = Storage(nodes), turtleInventory = { name = localName, mtype = 'hidden', adapter = introspection.getInventory(), } } nodes[localName] = context.turtleInventory nodes[localName].adapter.name = localName _G._p = context --debug Milo:init(context) context.storage:initStorage() -- TODO: fix context.storage.turtleInventory = context.turtleInventory local function loadDirectory(dir) for _, file in pairs(fs.list(dir)) do local s, m = Util.run(_ENV, fs.combine(dir, file)) if not s and m then _G.printError('Error loading: ' .. file) error(m or 'Unknown error') end end end local programDir = fs.getDir(shell.getRunningProgram()) loadDirectory(fs.combine(programDir, 'core')) loadDirectory(fs.combine(programDir, 'plugins')) table.sort(context.tasks, function(a, b) return a.priority < b.priority end) _debug('Tasks\n-----') for _, task in ipairs(context.tasks) do _debug('%d: %s', task.priority, task.name) end Milo:clearGrid() UI:setPage(UI:getPage('listing')) Sound.play('ui.toast.challenge_complete') local processing Event.on('milo_cycle', function() if not processing and not Milo:isCraftingPaused() then processing = true Milo:resetCraftingStatus() for _, task in ipairs(context.tasks) do local s, m = pcall(function() task:cycle(context) end) if not s and m then _G._debug(task.name .. ' crashed') _G._debug(m) -- _G.printError(task.name .. ' crashed') -- _G.printError(m) end end processing = false if not Util.empty(context.queue) then os.queueEvent('milo_queue') end end end) Event.on('milo_queue', function() if not processing and context.storage:isOnline() then processing = true for _, key in pairs(Util.keys(context.queue)) do local entry = context.queue[key] entry.callback(entry.request) context.queue[key] = nil end processing = false end end) Event.on('turtle_inventory', function() if not processing and not Milo:isCraftingPaused() then Milo:clearGrid() end end) Event.onInterval(5, function() if not Milo:isCraftingPaused() then os.queueEvent('milo_cycle') end end) Event.on({ 'storage_offline', 'storage_online' }, function() if context.storage:isOnline() then Milo:resumeCrafting({ key = 'storageOnline' }) else Milo:pauseCrafting({ key = 'storageOnline', msg = 'Storage offline' }) end end) os.queueEvent( context.storage:isOnline() and 'storage_online' or 'storage_offline', context.storage:isOnline()) UI:pullEvents()
class 'DateTime' function DateTime:__init() self.CLtime = os.date( "%X" ) self.CLdate = os.date("%d/%m/%Y") Events:Subscribe( "Render", self, self.Render ) end function DateTime:Render() if Game:GetState() ~= GUIState.Game or Game:GetSetting(4) <= 1 then return end if not LocalPlayer:GetValue( "ClockVisible" ) then return end if LocalPlayer:GetValue( "ClockPendosFormat" ) then self.CLtime = os.date("%I:%M:%S %p") else self.CLtime = os.date( "%X" ) end self.CLdate = os.date("%d/%m/%Y") local position = Vector2( 20, Render.Height * 0.31 ) local text = tostring( self.CLtime ) local pos_1 = Vector2( (20)/1, (Render.Height/3) + 5) local text1 = tostring( self.CLdate ) local text_width = Render:GetTextWidth( text ) Render:SetFont( AssetLocation.Disk, "Archivo.ttf" ) Render:DrawText( position + Vector2.One, text, Color( 25, 25, 25, Game:GetSetting(4) * 2.25 ), 24 ) Render:DrawText( position, text, Color( 255, 255, 255, Game:GetSetting(4) * 2.25 ), 24 ) local height = Render:GetTextHeight("A") * 1.5 position.y = position.y + height Render:DrawText( position + Vector2.One, text1, Color( 25, 25, 25, Game:GetSetting(4) * 2.25 ), 16 ) Render:DrawText( position, text1, Color( 255, 165, 0, Game:GetSetting(4) * 2.25 ), 16 ) end datetime = DateTime()
-- Copyright 2017 Yousong Zhou <yszhou4tech@gmail.com> -- Licensed to the public under the Apache License 2.0. local ss = require("luci.model.shadowsocks-libev") local m, s, o m = Map("shadowsocks-libev", translate("Redir Rules"), translate("On this page you can configure how traffics are to be \ forwarded to ss-redir instances. \ If enabled, packets will first have their source ip addresses checked \ against <em>Src ip bypass</em>, <em>Src ip forward</em>, \ <em>Src ip checkdst</em> and if none matches <em>Src default</em> \ will give the default action to be taken. \ If the prior check results in action <em>checkdst</em>, packets will continue \ to have their destination addresses checked.")) local sdata = m:get('ss_rules') if not sdata then m:set('ss_rules', nil, 'ss_rules') m:set('ss_rules', 'ss_rules', 'disabled', true) end s = m:section(NamedSection, "ss_rules", "ss_rules") s:tab("general", translate("General Settings")) s:tab("srcip", translate("Source Settings")) s:tab("dstip", translate("Destination Settings")) s:taboption('general', Flag, "disabled", translate("Disable")) ss.option_install_package(s, 'general') o = s:taboption('general', ListValue, "redir_tcp", translate("ss-redir for TCP")) ss.values_redir(o, 'tcp') o = s:taboption('general', ListValue, "redir_udp", translate("ss-redir for UDP")) ss.values_redir(o, 'udp') o = s:taboption('general', ListValue, "local_default", translate("Local-out default"), translate("Default action for locally generated packets")) ss.values_actions(o) s:taboption('general', Value, "ipt_args", translate("Extra arguments"), translate("Passes additional arguments to iptables. Use with care!")) s:taboption('srcip', DynamicList, "src_ips_bypass", translate("Src ip bypass"), translate("Bypass redir action for packets with source addresses in this list")) s:taboption('srcip', DynamicList, "src_ips_forward", translate("Src ip forward"), translate("Go through redir action for packets with source addresses in this list")) s:taboption('srcip', DynamicList, "src_ips_checkdst", translate("Src ip checkdst"), translate("Continue to have dst address checked for packets with source addresses in this list")) o = s:taboption('srcip', ListValue, "src_default", translate("Src default"), translate("Default action for packets whose source addresses do not match any of the source ip list")) ss.values_actions(o) s:taboption('dstip', DynamicList, "dst_ips_bypass", translate("Dst ip bypass"), translate("Bypass redir action for packets with destination addresses in this list")) s:taboption('dstip', DynamicList, "dst_ips_forward", translate("Dst ip forward"), translate("Go through redir action for packets with destination addresses in this list")) o = s:taboption('dstip', FileBrowser, "dst_ips_bypass_file", translate("Dst ip bypass file"), translate("File containing ip addresses for the purposes as with <em>Dst ip bypass</em>")) o.datatype = "file" s:taboption('dstip', FileBrowser, "dst_ips_forward_file", translate("Dst ip forward file"), translate("File containing ip addresses for the purposes as with <em>Dst ip forward</em>")) o.datatype = "file" return m
local replicatedStorage = game:GetService("ReplicatedStorage") local gui = script.Parent.Parent local message = replicatedStorage.Message local remaining = replicatedStorage.Remaining local display = {} local messageLabel = gui:WaitForChild("Message") local remainingLabel = gui:WaitForChild("Remaining") messageLabel.Text = message.Value remainingLabel.Text = remaining.Value message:GetPropertyChangedSignal("Value"):Connect(function() messageLabel.Text = message.Value end) remaining:GetPropertyChangedSignal("Value"):Connect(function() remainingLabel.Text = remaining.Value end) return display
require('constants') local base_hp = get_creature_base_hp(PLAYER_ID) local base_ap = get_creature_base_ap(PLAYER_ID) set_creature_current_hp(PLAYER_ID, base_hp) set_creature_current_ap(PLAYER_ID, base_ap) remove_negative_statuses_from_creature(PLAYER_ID) add_message_with_pause("FAIRY_SPIRIT_HEAL_SID") clear_and_add_message("FAIRY_SPIRIT_HEAL2_SID") local spirit_id = args[SPEAKING_CREATURE_ID] remove_creature_from_map(spirit_id)
local plane local spritesLOD = { bottom = dxCreateTexture("assets/plane_bottom.png"), side = dxCreateTexture("assets/plane_side.png"), tail = dxCreateTexture("assets/plane_tail.png") } local planeLODColor = tocolor(255, 255, 255, 255) local startTime = 0 local velocityX = 0 local velocityY = 0 local startX = 0 local startY = 0 local airdropMatchId local dropTime = 0 local dropX = 0 local dropY = 0 local crateEjected = false local planeSound local maxSoundDistance = 2000 local middleSoundDistance = 1100 local minSoundDistance = 300 local function getFlightDistance() return ((getTickCount() - startTime) / 1000) * Config.planeSpeed end local function drawPlaneLOD() -- Низ local pos1 = plane.matrix:transformPosition(0, -32, 2) local pos2 = plane.matrix:transformPosition(0, 15, 2) dxDrawMaterialLine3D(pos1, pos2, spritesLOD.bottom, 45, planeLODColor, plane.matrix:transformPosition(0, 0, -1)) -- Боковая сторона pos1 = plane.matrix:transformPosition(0, -20, 2) pos2 = plane.matrix:transformPosition(0, 15, 2) dxDrawMaterialLine3D(pos1, pos2, spritesLOD.side, 5, planeLODColor) -- Хвост pos1 = plane.matrix:transformPosition(0, -30, 5) pos2 = plane.matrix:transformPosition(0, -20, 5) dxDrawMaterialLine3D(pos1, pos2, spritesLOD.tail, -7, planeLODColor, plane.matrix:transformPosition(100, 0, 0)) end addEventHandler("onClientPreRender", root, function () if not isElement(plane) then return end local passedTime = (getTickCount() - startTime) / 1000 local x, y, z = getElementPosition(plane) if not crateEjected and passedTime > dropTime then crateEjected = true createCrate(airdropMatchId, dropX, dropY, z - 20) end setElementPosition(plane, startX + velocityX * passedTime, startY + velocityY * passedTime, plane.position.z) setElementPosition(planeSound, x, y, z) local cx, cy, cz = getCameraMatrix() local distance = getDistanceBetweenPoints3D(cx, cy, cz, x, y, z) local volume = 0 if distance < maxSoundDistance then if distance > 1100 then volume = math.max(0, math.min(1, 1 - (distance - middleSoundDistance) / (maxSoundDistance - middleSoundDistance))) else volume = 1 end end setSoundVolume(planeSound, volume) if math.abs(x) > 3300 or math.abs(y) > 3300 then destroyElement(plane) if isElement(planeSound) then destroyElement(planeSound) end return end end) addEventHandler("onClientRender", root, function () if not isElement(plane) then return end if plane.streamedIn then return end drawPlaneLOD() end) addEvent("createAirDrop", true) addEventHandler("createAirDrop", resourceRoot, function (matchId, x, y, z, angle, vx, vy, dtime, dx, dy) if isElement(plane) then destroyElement(plane) end airdropMatchId = matchId plane = createVehicle(592, x, y, z, 0, 0, angle) plane.frozen = true plane:setCollisionsEnabled(false) plane.dimension = localPlayer.dimension planeSound = playSound3D("assets/plane_sound.mp3", localPlayer.position, true) planeSound.dimension = localPlayer.dimension setSoundMaxDistance(planeSound, maxSoundDistance) setSoundMinDistance(planeSound, minSoundDistance) startTime = getTickCount() startX = x startY = y velocityX = vx velocityY = vy dropTime = dtime dropX = dx dropY = dy crateEjected = false end) function destroyAirDrop() if isElement(plane) then destroyElement(plane) end if isElement(planeSound) then destroyElement(planeSound) end plane = nil crateEjected = false airdropMatchId = nil end function getAirDropPosition() if crateEjected then return dropX, dropY, getCrateHeight() end end
local M = {} local system_name = sys.get_sys_info().system_name local is_debug = sys.get_engine_info().is_debug M.platform = {} M.platform.name = system_name M.platform.is_desktop = system_name == 'Darwin' or system_name == 'Linux' or system_name == 'Windows' or system_name == 'HTML5' M.platform.is_html5 = system_name == 'HTML5' M.platform.is_ios = system_name == 'iPhone OS' M.platform.is_android = system_name == 'Android' M.IS_NEED_RENDER_TAGET = system_name ~= 'iPhone OS' local is_first_init = true local is_inited = false local video_ext = M.platform.is_desktop and 'webm' or 'mp4' local audio_ext = M.platform.is_desktop and 'webm' or 'aac' M.VIDEO_FILENAME = "video" M.RESULT_FILENAME = "gameplay" M.logging = "" -- Temporary video track file. local video_filename = nil -- Video file with muxed-in audio track. local output_filename = nil -- Temporary audio track file, saved from resources. local audio_filename = nil local external_listener = nil local _self =nil local record_frame_every_sec = 0 local sec_from_last_frame = 0 M.params = {} local function log(...) if is_debug then print("SCREEN_RECORDER: ",...) local lg = {...} M.logging = M.logging..table.concat(lg, ', ').."\n" end end local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end local function listener(event) if event.phase == 'init' then if not event.is_error then is_inited = true log('Initialized.') else log('Failed to initialize: ', event.error_message) end elseif event.phase == 'recorded' then if not event.is_error then log('Saved the recording. ', video_filename) else log('Failed to save the recording: ', event.error_message) end elseif event.phase == 'muxed' then if not event.is_error then log('Muxed audio and video tracks.') else log('Failed to mux audio and video tracks: ', event.error_message) end elseif event.phase == 'preview' then if event.actions then log('Preview ended with actions: ', table.concat(event.actions, ', '), '.') else log('Preview is closed.') end end if external_listener then external_listener(_self, event) end end local function files_init() -- paths creation -- Temporary video track file. video_filename = directories.path_for_file(M.VIDEO_FILENAME..'.'.. video_ext, directories.documents) -- Video file with muxed-in audio track. output_filename = directories.path_for_file(M.RESULT_FILENAME..'.'.. video_ext, directories.documents) -- Temporary audio track file, saved from resources. local audio_content = sys.load_resource('/resources/audio.' .. audio_ext) audio_filename = directories.path_for_file('audio.' .. audio_ext, directories.documents) local audio_file = io.open(audio_filename, 'wb') audio_file:write(audio_content) audio_file:close() end function M.register_listener(self, listener) external_listener = listener _self = self end function M.fill_defaulf_params(params) params = params or M.params if is_first_init then files_init() end M.params.listener = listener video_filename = params.filename or video_filename M.params.filename = video_filename os.remove(video_filename) M.params.iframe = params.iframe or 1 M.params.duration = params.duration or nil M.params.bitrate = params.bitrate or 2 * 1024 * 1024 if M.platform.is_html5 then M.params.width = params.width or 640 M.params.height = params.height or 360 else M.params.width = params.width or 1280 M.params.height = params.height or 720 end if M.platform.is_ios then M.params.enable_preview = params.enable_preview or false M.params.scaling = params.scaling and screenrecorder[params.scaling] or screenrecorder.SCALING_RESIZE_ASPECT --[[ screenrecorder.SCALING_RESIZE_ASPECT, screenrecorder.SCALING_RESIZE, screenrecorder.SCALING_RESIZE_ASPECT_FILL]]-- else M.params.render_target = params.render_target or nil M.params.x_scale = params.x_scale or 1 M.params.y_scale = params.y_scale or 1 M.params.fps = params.fps or 30 record_frame_every_ms = round(1/M.params.fps - 0.001, 3) end if M.platform.is_desktop then M.params.async_encoding = params.async_encoding or false end return params end function M.init(params) if not screenrecorder then log("screenrecorder module do not exist.") return end params = M.fill_defaulf_params(params) log("Initializing the screenrecorder.") screenrecorder.init(M.params) end function M.start_record() if not screenrecorder then log("screenrecorder module do not exist.") return end sec_from_last_frame = 1 if screenrecorder.is_recording() then log("Video recording already in progress.") elseif is_inited then screenrecorder.start() else log("Recorder hasn't inited.") end end function M.stop_record() if not screenrecorder then log("screenrecorder module do not exist.") return end if screenrecorder.is_recording() then is_inited = false screenrecorder.stop() else log("You can't stop video recording while recording wasn't started.") end end function M.toggle() if not screenrecorder then log("screenrecorder module do not exist.") return end if screenrecorder.is_recording() then M.stop_record() else M.start_record() end end function M.is_recording() return screenrecorder and screenrecorder.is_recording() or false end function M.is_preview_avaliable() if not screenrecorder then log("screenrecorder module do not exist.") return end return screenrecorder.is_preview_available() end function M.show_preview() if not screenrecorder then log("screenrecorder module do not exist.") return end if screenrecorder.is_preview_available() then log('Showing preview.') screenrecorder.show_preview() else log('Preview does not available') end end function M.mux_audio_video() if not screenrecorder then log("screenrecorder module do not exist.") return end os.remove(output_filename) screenrecorder.mux_audio_video({ audio_filename = audio_filename, video_filename = video_filename, filename = output_filename }) end function M.capture_frame(dt) if M.IS_NEED_RENDER_TAGET then sec_from_last_frame = sec_from_last_frame + dt if sec_from_last_frame >= record_frame_every_ms then screenrecorder.capture_frame() sec_from_last_frame = 0 end end end function M.get_video_file_path() return video_filename end function M.get_muxed_file_path() return output_filename end return M
nnoremap("<Leader>w", ":w<CR>") nnoremap("<Leader>W", ":wa<CR>") vnoremap("<Leader>w", "<C-c>:w<CR>") inoremap("<Leader>w", "<C-o>:w<CR>") nnoremap("<Leader>q", ":q<CR>") vnoremap("<Leader>q", "<C-c>:q<CR>") inoremap("<Leader>q", "<C-o>:q<CR>") nnoremap("<Leader>Q", ":bdelete!<CR>") nnoremap("<Leader>R", ":edit!<CR>") vnoremap("//", "y/\\V<C-r>=escape(@\",'/\\')<CR><CR>") nnoremap("//", "yiw/\\V<C-r>=escape(@\",'/\\')<CR><CR>") vnoremap("<M-/>", '"hy:%s/<C-r>h//gc<left><left><left>') vnoremap("<C-c>", '"+y') vnoremap("p", '"0p') vnoremap("P", '"0P') vnoremap("<", "<gv") vnoremap(">", ">gv") vnoremap("J", ":m '>+1<CR>gv=gv") vnoremap("K", ":m '<-2<CR>gv=gv") tnoremap("<Esc>", "<C-\\><C-n>") tnoremap("<M-h>", "<C-\\><C-n><C-w>h") tnoremap("<M-j>", "<C-\\><C-n><C-w>j") tnoremap("<M-k>", "<C-\\><C-n><C-w>k") tnoremap("<M-l>", "<C-\\><C-n><C-w>l") nnoremap("<M-h>", "<C-w>h") nnoremap("<M-j>", "<C-w>j") nnoremap("<M-k>", "<C-w>k") nnoremap("<M-l>", "<C-w>l") nnoremap("<M-S-h>", "<C-w>H") nnoremap("<M-S-j>", "<C-w>J") nnoremap("<M-S-k>", "<C-w>K") nnoremap("<M-S-l>", "<C-w>L")
-- find the packages: package.path = '../utf8.lua/?.lua;../?.lua;' .. package.path zmd = require 'zmdocument' -- run test on authors print('% --- Test authors') print('% one author:') print(zmd.formatAuthorsBase('Eskimon', '', false)) print('% three authors:') print(zmd.formatAuthorsBase('Karnaj, Heziode, pierre_24', '', false)) print('% one author with link:') print(zmd.formatAuthorsBase('Eskimon', 'http://test.com/author', false)) print('% one author with long name:') print(zmd.formatAuthorsBase('that_author_with_a_very_long_name', '', false)) print('% one author with long name (but in author list, so full name):') print(zmd.formatAuthorsBase('that_author_with_a_very_long_name', '', true)) -- run test on abbrv print('% --- Test abbrv') print(zmd.cleanSpecialCharacters('AT\\&T')) print(zmd.cleanSpecialCharacters('pierre\\_24')) print(zmd.cleanSpecialCharacters('\\#hashtag'))
ENT.Type = "anim" ENT.Base = "base_rd3_entity" ENT.PrintName = "Heavy Water Electrolyzer" list.Set("LSEntOverlayText", "generator_liquid_hvywater", { HasOOO = true, resnames = {"energy", "water"}, genresnames = {"heavy water"} })
function User:Create(data) return setmetatable(data, User) end
material_science = {} local modname = minetest.get_current_modname() local modpath = minetest.get_modpath(modname) -- Settings dofile(modpath .. "/settings.lua") -- Materials dofile(modpath .. "/materials.lua") -- Recipes dofile(modpath .. "/recipes.lua") -- Machines dofile(modpath .. "/blocks/alkali_metal_extractor.lua") dofile(modpath .. "/blocks/decomposer.lua") dofile(modpath .. "/blocks/coater.lua") dofile(modpath .. "/blocks/flame_fusion_injector.lua") dofile(modpath .. "/blocks/water_splitter.lua") -- Blocks dofile(modpath .. "/blocks/quartz_glass.lua") dofile(modpath .. "/blocks/phosphorus.lua") dofile(modpath .. "/blocks/aluminium_block.lua")
--[[ Copyright (c) 2016-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. ]]-- local tnt = require 'torchnet.env' local argcheck = require 'argcheck' local ClassErrorMeter = torch.class('tnt.ClassErrorMeter', 'tnt.Meter', tnt) ClassErrorMeter.__init = argcheck{ doc = [[ <a name="ClassErrorMeter"> #### tnt.ClassErrorMeter(@ARGP) @ARGT The `tnt.ClassErrorMeter` measures the classification error (in %) of classification models (zero-one loss). The meter can also measure the error of predicting the correct label among the top-k scoring labels (for instance, in the Imagenet competition, one generally measures classification@5 errors). At initialization time, it takes to optional parameters: (1) a table `topk` that contains the values at which the classification@k errors should be measures (default = {1}); and (2) a boolean `accuracy` that makes the meter output accuracies instead of errors (accuracy = 1 - error). The `add(output, target)` method takes as input an NxK-tensor `output` that contains the output scores for each of the N examples and each of the K classes, and an N-tensor `target` that contains the targets corresponding to each of the N examples (targets are integers between 1 and K). If only one example is `add`ed, `output` may also be a K-tensor and target a 1-tensor. Please note that `topk` (if specified) may not contain values larger than K. The `value()` returns a table with the classification@k errors for all values at k that were specified in `topk` at initialization time. Alternatively, `value(k)` returns the classification@k error as a number; only values of `k` that were element of `topk` are allowed. If `accuracy` was set to `true` at initialization time, the `value()` method returns accuracies instead of errors. ]], noordered = true, {name="self", type="tnt.ClassErrorMeter"}, {name="topk", type="table", default={1}}, {name="accuracy", type="boolean", default=false}, call = function(self, topk, accuracy) self.topk = torch.LongTensor(topk):sort():totable() self.accuracy = accuracy self:reset() end } ClassErrorMeter.reset = argcheck{ {name="self", type="tnt.ClassErrorMeter"}, call = function(self) self.sum = {} for _,k in ipairs(self.topk) do self.sum[k] = 0 end self.n = 0 end } ClassErrorMeter.add = argcheck{ {name="self", type="tnt.ClassErrorMeter"}, {name="output", type="torch.*Tensor"}, {name="target", type="torch.*Tensor"}, call = function(self, output, target) target = target:squeeze() output = output:squeeze() if output:nDimension() == 1 then output = output:view(1, output:size(1)) assert( type(target) == 'number', 'target and output do not match') target = torch.Tensor(1):fill(target) else assert( output:nDimension() == 2, 'wrong output size (1D or 2D expected)') assert( target:nDimension() == 1, 'target and output do not match') end assert( target:size(1) == output:size(1), 'target and output do not match') local topk = self.topk local maxk = topk[#topk] local no = output:size(1) local _, pred = output:double():topk(maxk, 2, true, true) local correct = pred:typeAs(target):eq( target:view(no, 1):expandAs(pred)) for _,k in ipairs(topk) do self.sum[k] = self.sum[k] + no - correct:narrow(2, 1, k):sum() end self.n = self.n + no end } ClassErrorMeter.value = argcheck{ {name="self", type="tnt.ClassErrorMeter"}, {name="k", type="number", opt=true}, call = function(self, k) if k then assert(self.sum[k], 'invalid k (this k was not provided at construction time)') return self.accuracy and (1-self.sum[k] / self.n)*100 or self.sum[k]*100 / self.n else local value = {} for _,k in ipairs(self.topk) do value[k] = self:value(k) end return value end end }
-- language support local S = ethereal.intllib -- stair mods active local stairs_redo = stairs and stairs.mod and stairs.mod == "redo" local stairs_plus = minetest.global_exists("stairsplus") -- stair selection function local do_stair = function(description, name, node, groups, texture, sound) if stairs_redo then stairs.register_all(name, node, groups, texture, S(description), sound) elseif stairs_plus then stairsplus:register_all("ethereal", name, node, { description = S(description), tiles = texture, groups = groups, sounds = sound, }) else stairs.register_stair_and_slab(name, node, groups, texture, S(description .. " Stair"), S(description .. " Slab"), sound) end end -- Register Stairs (stair mod will be auto-selected) do_stair( "Blue Marble", "blue_marble", "ethereal:blue_marble", {cracky = 1}, {"ethereal_blue_marble.png"}, default.node_sound_stone_defaults()) do_stair( "Blue Marble Tile", "blue_marble_tile", "ethereal:blue_marble_tile", {cracky = 1}, {"ethereal_blue_marble_tile.png"}, default.node_sound_stone_defaults()) do_stair( "Crystal Block", "crystal_block", "ethereal:crystal_block", {cracky = 1, level = 2, puts_out_fire = 1, cools_lava = 1}, {"ethereal_crystal_block.png"}, default.node_sound_glass_defaults()) do_stair( "Ice Brick", "icebrick", "ethereal:icebrick", {cracky = 3, puts_out_fire = 1, cools_lava = 1}, {"ethereal_brick_ice.png"}, default.node_sound_glass_defaults()) do_stair( "Snow Brick", "snowbrick", "ethereal:snowbrick", {crumbly = 3, puts_out_fire = 1, cools_lava = 1}, {"ethereal_brick_snow.png"}, default.node_sound_dirt_defaults({ footstep = {name = "default_snow_footstep", gain = 0.25}, dug = {name = "default_snow_footstep", gain = 0.75}, })) do_stair( "Dried Dirt", "dry_dirt", "ethereal:dry_dirt", {crumbly = 3}, {"ethereal_dry_dirt.png"}, default.node_sound_dirt_defaults()) do_stair( "Mushroom Trunk", "mushroom_trunk", "ethereal:mushroom_trunk", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, {"ethereal_mushroom_trunk.png"}, default.node_sound_wood_defaults()) do_stair( "Mushroom Top", "mushroom", "ethereal:mushroom", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, {"ethereal_mushroom_block.png"}, default.node_sound_wood_defaults()) do_stair( "Frost Wood", "frost_wood", "ethereal:frost_wood", {choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1}, {"ethereal_frost_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Healing Wood", "yellow_wood", "ethereal:yellow_wood", {choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1}, {"ethereal_yellow_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Palm Wood", "palm_wood", "ethereal:palm_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"moretrees_palm_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Birch Wood", "birch_wood", "ethereal:birch_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"moretrees_birch_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Banana Wood", "banana_wood", "ethereal:banana_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"ethereal_banana_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Willow Wood", "willow_wood", "ethereal:willow_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"ethereal_willow_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Redwood", "redwood_wood", "ethereal:redwood_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"ethereal_redwood_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Bamboo", "bamboo_wood", "ethereal:bamboo_block", {snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"ethereal_bamboo_floor.png"}, default.node_sound_wood_defaults()) do_stair( "Sakura Wood", "sakura_wood", "ethereal:sakura_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"ethereal_sakura_wood.png"}, default.node_sound_wood_defaults()) do_stair( "Olive Wood", "olive_wood", "ethereal:olive_wood", {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {"ethereal_olive_wood.png"}, default.node_sound_wood_defaults())
addEvent ( "VDBGPhone:App->Vehicles:onPanelOpened", true ) addEventHandler ( "VDBGPhone:App->Vehicles:onPanelOpened", root, function ( ) local cars = exports.VDBGVehicles:getAccountVehicles ( getAccountName ( getPlayerAccount ( source ) ) ) triggerClientEvent ( source, "VDBGPhone:App->Vehicles:onClientGetVehicles", source, cars ) end ) addEvent ( "VDBGPhone:Apps->Vehicles:SetVehicleVisible", true ) addEventHandler ( "VDBGPhone:Apps->Vehicles:SetVehicleVisible", root, function ( id, stat ) local v = exports.VDBGVehicles:SetVehicleVisible ( id, stat, source ) end ) addEvent ( "VDBGPhone:Apps->Vehicles:AttemptRecoveryOnID", true ) addEventHandler ( "VDBGPhone:Apps->Vehicles:AttemptRecoveryOnID", root, function ( id ) exports.VDBGVehicles:recoverVehicle ( source, id ) end ) addEvent ( "VDBGPhone:App->Vehicles:sellPlayerVehicle", true ) addEventHandler ( "VDBGPhone:App->Vehicles:sellPlayerVehicle", root, function ( plr, data ) exports.VDBGVehicles:sellVehicle ( plr, data ) end ) addEvent ( "VDBGPhone:Apps->Vehicles:WarpThisVehicleToMe", true ) addEventHandler ( "VDBGPhone:Apps->Vehicles:WarpThisVehicleToMe", root, function ( id ) if ( not exports.VDBGVehicles:warpVehicleToPlayer ( id, source ) ) then exports.VDBGMessages:sendClientMessage ( "Erro: Incapaz de trazer veículo", source, 255, 0, 0 ) end end )
function love.conf(t) t.window.width = 15 * 20 t.window.height = 15 * 15 t.window.title = "Snake" end
panshee_elder = Creature:new { objectName = "@mob/creature_names:panshee_elder", randomNameType = NAME_GENERIC, randomNameTag = true, socialGroup = "panshee_tribe", faction = "panshee_tribe", level = 46, chanceHit = 0.48, damageMin = 375, damageMax = 460, baseXp = 4461, baseHAM = 9800, baseHAMmax = 12000, armor = 1, resists = {30,30,0,-1,0,0,-1,0,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0.0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK, optionsBitmask = AIENABLED, diet = HERBIVORE, templates = { "object/mobile/dressed_ewok_f_01.iff", "object/mobile/dressed_ewok_f_03.iff", "object/mobile/dressed_ewok_f_04.iff", "object/mobile/dressed_ewok_f_06.iff", "object/mobile/dressed_ewok_f_07.iff", "object/mobile/dressed_ewok_f_08.iff", "object/mobile/dressed_ewok_f_09.iff", "object/mobile/dressed_ewok_m_12.iff", "object/mobile/dressed_ewok_m_01.iff", "object/mobile/dressed_ewok_m_02.iff"}, lootGroups = { { groups = { {group = "ewok", chance = 10000000} }, lootChance = 1920000 } }, weapons = {"ewok_weapons"}, conversationTemplate = "", attacks = merge(riflemanmaster,brawlermaster) } CreatureTemplates:addCreatureTemplate(panshee_elder, "panshee_elder")
function createDots(grid) -- create paladin dot group 1 (dot, tooltip, texture, name, class) local x = ((1-1)*5)+1 newDot(_G["Dot_"..x], _G["Tooltip_"..x], _G["Texture_"..x], grid[1][1][1], grid[1][1][2]) -- create dots group 2 to 8 for i=2,8 do for j=1,5 do local player = grid[i][j] local class = (player[2]) local name = player[1] local x = ((i-1)*5)+j newDot(_G["Dot_"..x], _G["Tooltip_"..x], _G["Texture_"..x], name, class) end end end function newDot(dot, tooltip, texture, name, class) if (CURRENT_PLAYERNAME == name) then dot:SetWidth(36) dot:SetHeight(36) else dot:SetWidth(26) dot:SetHeight(26) end if name == "Empty" or name == "" or name == nil then texture:Hide() else texture:SetVertexColor(CLASSCOLORS[class][1], CLASSCOLORS[class][2], CLASSCOLORS[class][3], 1.0) texture:Show() end dot:SetScript("OnEnter", function() tooltip:SetOwner(dot, "ANCHOR_RIGHT") tooltip:SetText(name) tooltip:Show() end) dot:SetScript("OnLeave", function() tooltip:Hide() end) end -- up to 8 hunters function addHunters(players) local cpt_hunter = 0 for i, player in ipairs(players) do local name = player[1] local class = player[2] if (class == "Hunter" and cpt_hunter < 9) then cpt_hunter = cpt_hunter + 1 newDot(_G["Dot_4"..cpt_hunter], _G["Tooltip_4"..cpt_hunter], _G["Texture_4"..cpt_hunter], name, class) end end end function clearDots() for i=1, 48 do newDot(_G["Dot_"..i], _G["Tooltip_"..i], _G["Texture_"..i], "Empty", "Empty") end end
-- osc: sine, square, triangle and saw oscillators local defs = {name = 'Osc', knobs = {}} -- Define all the functions that map a phase to a [-1, 1] amplitude. -- Lua is pretty verbose here :( This should really all be 5 lines. -- Note that these all have a periodicity of 2, just 'cuz local function sine(phase) return math.sin(phase * math.pi) end local function tri(phase) local f = phase % 2 if f < 0.5 then return 2*f elseif f < 1.5 then return -2*f + 2 else return 2*f - 4 end end local function square(phase) if phase % 2 < 1 then return 1 else return -1 end end local function sawUp(phase) local f = (phase + 1) % 2 return f - 1 end local function sawDown(phase) return -sawUp(phase) end local funcForOsc = { ['Sine'] = sine, ['Triangle'] = tri, ['Square'] = square, ['Saw Up'] = sawUp, ['Saw Down'] = sawDown } local function dbToRatio(db) return 10 ^ (db/20) end defs.knobs.oscType = { label = 'Oscillator type', options = {'Sine', 'Triangle', 'Square', 'Saw Up', 'Saw Down'}, default = 'Sine', onChange = function(state, newVal) state.func = funcForOsc[newVal] end } defs.knobs.gain = { min = -120.0, max = 0.0, default = -8.0, label = 'Gain (dB)', onChange = function(state, newVal) state.linearGain = dbToRatio(newVal) end } defs.knobs.freq = { label = 'Frequency', min = 0.0, max = 22000.0, default = 500.0, onChange = function(state, newVal) state.phaseInc = 2 * newVal / state.sampleRate end } function defs.generateOneSample(state) if not state.n then state.n = 0 end state.n = state.n + state.phaseInc return state.linearGain * state.func(state.n) end return require("util.wrap").wrapMachineDefs(defs)
--[[ file:cx_struct.lua desc:扯旋 auth:Caorl Luo ]] ---@alias cx_score number ---积分 ---@alias cx_double number ---倍数 ---@alias cx_type senum ---牌型 ---@alias cx_index number ---下标 ---@alias cx_enum senum ---枚举 ---@alias cx_seat number ---位置 ---@alias cx_card number ---牌值 ---@alias cx_value number ---牌值 ---@alias cx_color number ---花色 ---@class cx_seat_cards @玩家手牌 ---@field seatID cx_seat @玩家 ---@field hand cx_card[] @手牌 ---@class cx_deal_ntc @发牌通知 ---@field seatID cx_seat @玩家 ---@field count cx_count @张数 ---@class cx_see_ntc @看牌通知 ---@field seatID cx_seat @玩家 ---@field hand cx_card[] @手牌 ---@class cx_giveup_ntc @放弃通知 ---@field seatID cx_seat @玩家 ---@field hand cx_card[] @手牌 ---@class cx_bet_refuel_ntc @加注通知 ---@field seatID cx_seat @玩家 ---@field score cx_score @下注 ---@field blance cx_score @余额 ---@class cx_bet_with_ntc @跟注通知 ---@field seatID cx_seat @玩家 ---@field score cx_score @下注 ---@field blance cx_score @余额 ---@class cx_bet_all_ntc @梭哈通知 ---@field seatID cx_seat @玩家 ---@field score cx_score @下注 ---@field blance cx_score @余额 ---@class cx_cmp_card_ntc @比牌通知 ---@field originID cx_seat @发起玩家 ---@field targetID cx_seat @目标玩家 ---@field winnerID cx_seat @胜利玩家 ---@field originSP cx_card[] @发起手牌 ---@field targetSP cx_card[] @目标手牌 ---@field originPX cx_type @发起牌型 ---@field targetPX cx_type @目标牌型 ---@field comparCB cx_score @比牌成本 ---@field blanceLY cx_score @剩余分数 ---@class cx_game_result_ntc @结果通知 ---@field winnerID cx_seat @胜利玩家 ---@field reaScore cx_score @实际得分 ---@field ducScore cx_score @应得分数 ---@field blanceLJ cx_score @剩余分数 ---@field openseat cx_seat[] @开牌状态 ---@field giveseat cx_seat[] @放弃状态 ---@field loseseat cx_seat[] @淘汰状态 ---@field cardseat cx_seat_cards[][] @玩家手牌 ---@class cx_game_start_ntc:game_start_ntc @开始通知
local spritesheet = spritesheet --[[-------------------------------------------- Icons spritesheet ----------------------------------------------]] local mpSpritesheetMat = Material( "mediaplayer/ui/spritesheet2015-10-7.png" ) local blockSize = 24 local function mpIcon( name, i, j, w, h ) return { name = name, mat = mpSpritesheetMat, w = w, h = h, xoffset = i * blockSize, yoffset = j * blockSize } end spritesheet.Register { mpIcon( "mp-thumbs-up", 0, 0, 18, 21 ), mpIcon( "mp-thumbs-down", 1, 0, 18, 21 ), mpIcon( "mp-delete", 2, 0, 15, 20 ), mpIcon( "mp-favorite", 3, 0, 21, 21 ), mpIcon( "mp-favorite-outline", 4, 0, 21, 21 ), mpIcon( "mp-volume-mute", 0, 1, 18, 17 ), mpIcon( "mp-volume", 1, 1, 18, 17 ), mpIcon( "mp-back", 2, 1, 16, 17 ), mpIcon( "mp-forward", 3, 1, 16, 17 ), mpIcon( "mp-home", 4, 1, 19, 17 ), mpIcon( "mp-close", 0, 2, 16, 16 ), mpIcon( "mp-skip", 1, 2, 16, 16 ), mpIcon( "mp-refresh", 2, 2, 16, 15 ), mpIcon( "mp-plus", 3, 2, 14, 14 ), mpIcon( "mp-repeat", 4, 2, 18, 18 ), mpIcon( "mp-shuffle", 0, 3, 16, 16 ), mpIcon( "mp-replay", 1, 3, 13, 16 ), mpIcon( "mp-lock", 2, 3, 12, 16 ), mpIcon( "mp-lock-open", 3, 3, 12, 16 ), mpIcon( "mp-play", 3, 4, 19, 25 ), mpIcon( "mp-pause", 4, 4, 22, 24 ), } --[[-------------------------------------------- DIcon ----------------------------------------------]] local DICON = {} AccessorFunc( DICON, "m_strIcon", "Icon" ) AccessorFunc( DICON, "m_Color", "IconColor" ) AccessorFunc( DICON, "m_bKeepAspect", "KeepAspect" ) function DICON:Init() self:SetIconColor( color_white ) self:SetMouseInputEnabled( false ) self:SetKeyboardInputEnabled( false ) self:SetKeepAspect( false ) self.IconWidth = 10 self.IconHeight = 10 end function DICON:SetIcon( icon ) self.m_strIcon = icon self.IconWidth, self.IconHeight = spritesheet.GetIconSize( icon ) end function DICON:SizeToContents( strImage ) self:SetSize( self.IconWidth, self.IconHeight ) end function DICON:Paint( w, h ) self:PaintAt( 0, 0, w, h ) end function DICON:PaintAt( x, y, dw, dh ) if not self.m_strIcon then return end if ( self.m_bKeepAspect ) then local w = self.IconWidth local h = self.IconHeight -- Image is bigger than panel, shrink to suitable size if ( w > dw and h > dh ) then if ( w > dw ) then local diff = dw / w w = w * diff h = h * diff end if ( h > dh ) then local diff = dh / h w = w * diff h = h * diff end end if ( w < dw ) then local diff = dw / w w = w * diff h = h * diff end if ( h < dh ) then local diff = dh / h w = w * diff h = h * diff end local OffX = ceil((dw - w) * 0.5) local OffY = ceil((dh - h) * 0.5) spritesheet.DrawIcon( self.m_strIcon, OffX+y, OffY+y, w, h, self.m_Color ) return true end spritesheet.DrawIcon( self.m_strIcon, x, y, dw, dh, self.m_Color ) return true end derma.DefineControl( "DIcon", "", DICON, "DPanel" ) --[[-------------------------------------------- DIconButton ----------------------------------------------]] local DICONBTN = {} AccessorFunc( DICONBTN, "m_strIcon", "Icon" ) AccessorFunc( DICONBTN, "m_bStretchToFit", "StretchToFit" ) function DICONBTN:Init() self:SetDrawBackground( false ) self:SetDrawBorder( false ) self:SetStretchToFit( false ) self:SetCursor( "hand" ) self.m_Icon = vgui.Create( "DIcon", self ) self:SetText( "" ) self:SetColor( Color( 255, 255, 255, 255 ) ) end function DICONBTN:SetIconVisible( bBool ) self.m_Icon:SetVisible( bBool ) end function DICONBTN:SetIcon( strIcon ) self.m_Icon:SetIcon( strIcon ) end function DICONBTN:SetColor( col ) self.m_Icon:SetIconColor( col ) end function DICONBTN:GetIcon() return self.m_Icon:GetIcon() end function DICONBTN:SetKeepAspect( bKeep ) self.m_Icon:SetKeepAspect( bKeep ) end function DICONBTN:SizeToContents( ) self.m_Icon:SizeToContents() self:SetSize( self.m_Icon:GetWide(), self.m_Icon:GetTall() ) end function DICONBTN:PerformLayout() if ( self.m_bStretchToFit ) then self.m_Icon:SetPos( 0, 0 ) self.m_Icon:SetSize( self:GetSize() ) else self.m_Icon:SizeToContents() self.m_Icon:Center() end end derma.DefineControl( "DIconButton", "", DICONBTN, "DButton" ) --[[-------------------------------------------- DIconButton ----------------------------------------------]] local DICONLBLBTN = {} AccessorFunc( DICONLBLBTN, "m_LabelSpacing", "LabelSpacing" ) AccessorFunc( DICONLBLBTN, "m_Padding", "Padding" ) function DICONLBLBTN:Init() self.BaseClass.Init( self ) self.BtnLbl = vgui.Create( "DLabel", self ) self.BtnLbl:SetText( "" ) self:SetLabelSpacing( 4 ) self:SetPadding( 4 ) end function DICONLBLBTN:PerformLayout() self.m_Icon:SizeToContents() self.m_Icon:AlignLeft( self.m_Padding ) self.BtnLbl:SizeToContents() self.BtnLbl:MoveRightOf( self.m_Icon, self.m_LabelSpacing ) local w = self.BtnLbl:GetPos() + self.BtnLbl:GetWide() + self.m_Padding local h = math.max( self.m_Icon:GetTall(), self.BtnLbl:GetTall() ) self:SetWide( w, h ) self.m_Icon:CenterVertical() self.BtnLbl:CenterVertical() end derma.DefineControl( "DIconLabeledButton", "", DICONLBLBTN, "DIconButton" )
-- TODO: long term - implement new UI resembling original game design -- more code cleanup? local SCREEN_WIDTH, SCREEN_HEIGHT = guiGetScreenSize() -- -- client HUD definitions -- _hud = {} -- loading screen _hud.loadingScreen = {} _hud.loadingScreen.deathmatchText = dxText:create("Deathmatch", 0, 0, false, "bankgothic", 2) _hud.loadingScreen.deathmatchText:color(230, 200, 110) _hud.loadingScreen.deathmatchText:boundingBox(0, 0, 1, 0.2, true) _hud.loadingScreen.deathmatchText:align("bottom", "center") _hud.loadingScreen.deathmatchText:type("stroke", 1) _hud.loadingScreen.mapInfoText = dxText:create("", 0, 0, false, "pricedown", 2) _hud.loadingScreen.mapInfoText:color(125, 85, 13) _hud.loadingScreen.mapInfoText:boundingBox(0, 0.65, 0.95, 1, true) _hud.loadingScreen.mapInfoText:align("right", "top") _hud.loadingScreen.mapInfoText:type("stroke", 1) _hud.loadingScreen.setVisible = function(_, visible) _hud.loadingScreen.deathmatchText:visible(visible) _hud.loadingScreen.mapInfoText:visible(visible) end _hud.loadingScreen.update = function() _hud.loadingScreen.mapInfoText:text(_mapTitle..(_mapAuthor and ("\n by ".._mapAuthor) or "")) end -- score display _hud.scoreDisplay = {} _hud.scoreDisplay.roundInfoText = dxText:create("", 0, 0, false, "bankgothic", 1) _hud.scoreDisplay.roundInfoText:color(175, 200, 240) _hud.scoreDisplay.roundInfoText:boundingBox(0, 0, 0.95, 0.95, true) _hud.scoreDisplay.roundInfoText:align("right", "bottom") _hud.scoreDisplay.roundInfoText:type("stroke", 1) _hud.scoreDisplay.setVisible = function(_, visible) _hud.scoreDisplay.roundInfoText:visible(visible) end _hud.scoreDisplay.update = function() -- don't do anything if a round isn't in progress if getElementData(resourceRoot, "gameState") ~= GAME_IN_PROGRESS then return end -- update score and rank text local score = getElementData(localPlayer, "Score") local rank = getElementData(localPlayer, "Rank") _hud.scoreDisplay.roundInfoText:text( "Score: "..score..(_fragLimit > 0 and "/".._fragLimit or "") .."\nRank: "..getElementData(localPlayer, "Rank").."/"..#getElementsByType("player") ) end -- respawn screen _hud.respawnScreen = {} -- respawn counter (You will respawn in x seconds) _hud.respawnScreen.respawnCounter = dxText:create("", 0.5, 0.5, true, "beckett", 4) _hud.respawnScreen.respawnCounter:type("stroke", 6) _hud.respawnScreen.respawnCounter:color(255, 225, 225) _hud.respawnScreen.respawnCounter:visible(false) _hud.respawnScreen.setVisible = function(_, visible) _hud.respawnScreen.respawnCounter:visible(visible) end _hud.respawnScreen.startCountdown = function() if _respawnTime > 0 then startCountdown(_respawnTime) else _hud.respawnScreen.respawnCounter:text("Wasted") end end -- end screen _hud.endScreen = {} -- announcement text (x has won the round!) _hud.endScreen.announcementText = dxText:create("", 0, 0, false, "pricedown", 2) _hud.endScreen.announcementText:color(225, 225, 225, 225) _hud.endScreen.announcementText:boundingBox(0, 0, 1, 0.2, true) _hud.endScreen.announcementText:align("bottom", "center") _hud.endScreen.announcementText:type("border", 1) _hud.endScreen.setVisible = function(_, visible) _hud.endScreen.announcementText:visible(visible) end _hud.endScreen.update = function(_, winner, draw, aborted) if winner then _hud.endScreen.announcementText:text(getPlayerName(winner).." has won the round!") _hud.endScreen.announcementText:color(getPlayerNametagColor(winner)) else if draw then _hud.endScreen.announcementText:text("The round was a draw!") else _hud.endScreen.announcementText:text("Round ended.") end _hud.endScreen.announcementText:color(225, 225, 225, 225) end if not aborted then playSound("client/audio/mission_accomplished.mp3") end end -- hide all HUD elements by default _hud.loadingScreen:setVisible(false) _hud.scoreDisplay:setVisible(false) _hud.respawnScreen:setVisible(false) _hud.endScreen:setVisible(false) -- TODO: clean this junk up local function dxSetAlpha ( dx, a ) local r,g,b = dx:color() dx:color(r,g,b,a) end local countdownCR local function countdown(time) for i=time,0,-1 do _hud.respawnScreen.respawnCounter:text("Wasted\n"..i) setTimer ( countdownCR, 1000, 1 ) coroutine.yield() end end local function hideCountdown() setTimer ( function() _hud.respawnScreen:setVisible(false) end, 600, 1 ) Animation.createAndPlay( _hud.respawnScreen.respawnCounter, {{ from = 225, to = 0, time = 400, fn = dxSetAlpha }} ) removeEventHandler ( "onClientPlayerSpawn", localPlayer, hideCountdown ) end function startCountdown(time) Animation.createAndPlay( _hud.respawnScreen.respawnCounter, {{ from = 0, to = 225, time = 600, fn = dxSetAlpha }} ) addEventHandler ( "onClientPlayerSpawn", localPlayer, hideCountdown ) _hud.respawnScreen:setVisible(true) time = math.floor(time/1000) countdownCR = coroutine.wrap(countdown) countdownCR(time) end
-- rats minetest.register_abm({ nodenames = { "default:dirt", "default:dirt_with_grass", "default:dirt_with_dry_grass", "seasons:spring_default_dirt_with_grass", "seasons:fall_default_dirt_with_grass", "seasons:winter_default_dirt_with_grass", "default:dirt_with_rainforest_litter", "default:dirt_with_coniferous_litter", "default:desert_sand", "default:silver_sand", "default:gravel", }, neighbors = {"air"}, interval = 3000, chance = 1000, catch_up = false, action = function(pos, node, active_object_count, active_object_count_wider) -- print("spawn rat") if active_object_count > 3 then --print("too many local objs " .. active_object_count) return end local nearobjs = minetest.get_objects_inside_radius(pos, 30) if #nearobjs > 4 then --print("too many near objs") return end --print("----------spawning rat") local p = minetest.find_node_near(pos, 3, "air") if p then local mob = minetest.add_entity(p, "mobehavior:rat") end end }) -- wolves minetest.register_abm({ nodenames = { "default:dirt_with_coniferous_litter", }, neighbors = {"air"}, interval = 6000, chance = 400, catch_up = false, action = function(pos, node, active_object_count, active_object_count_wider) if active_object_count_wider > 0 then --print("too many local objs") return end local nearobjs = minetest.get_objects_inside_radius(pos, 40) if #nearobjs > 0 then -- print("------") for _,o in ipairs(nearobjs) do local p = o:get_luaentity() if p and p.name == "wolf" then count = count + 1 if count > 1 then return end end end --print("too many near objs") return end --print("----------spawning rat") local p = minetest.find_node_near(pos, 3, "air") if p then local mob = minetest.add_entity(p, "mobehavior:wolf") end end }) -- bunnies minetest.register_abm({ nodenames = { "default:dirt_with_grass", "seasons:spring_default_dirt_with_grass", "default:dirt_with_coniferous_litter", "default:desert_sand", "default:silver_sand", }, neighbors = {"air"}, interval = 4000, chance = 800, catch_up = false, action = function(pos, node, active_object_count, active_object_count_wider) if active_object_count > 2 then --print("too many local objs " .. active_object_count) return end local nearobjs = minetest.get_objects_inside_radius(pos, 40) if #nearobjs > 4 then --print("too many near objs") return end --print("----------spawning rat") local p = minetest.find_node_near(pos, 3, "air") if p then local mob = minetest.add_entity(p, "mobehavior:bunny") end end }) -- brown bears minetest.register_abm({ nodenames = { "default:dirt_with_grass", "seasons:spring_default_dirt_with_grass", "default:dirt_with_coniferous_litter", }, neighbors = {"air"}, interval = 6000, chance = 1500, catch_up = false, action = function(pos, node, active_object_count, active_object_count_wider) if active_object_count > 5 then --print("too many local objs " .. active_object_count) return end local nearobjs = minetest.get_objects_inside_radius(pos, 40) if #nearobjs > 0 then -- print("------") for _,o in ipairs(nearobjs) do local p = o:get_luaentity() if p and p.name == "bear" then count = count + 1 if count > 1 then return end end end --print("too many near objs") return end --print("----------spawning rat") local p = minetest.find_node_near(pos, 3, "air") if p then local mob = minetest.add_entity(p, "mobehavior:bear") end end })
local util = require('pipes_util') local push = util.push local pop = util.pop local isEmpty = util.isEmpty -- local inner = require('pipes_inner') local typeLua = inner.typecode('lua') -- local pps = {} if not PIPES_C_LIB then PIPES_C_LIB = OPEN_PIPES_C_LIB() end local _c = PIPES_C_LIB local _co = coroutine local _tasks = {} local _freeThs = {} local _coThs = {} local _exit = false local function newThread() local th = {} local co = _co.create(function() local q while(true) do if _exit then break end local t if q then t = pop(q) end if not t then -- no task in seq t = pop(_tasks) if t then q = t.q if q then t = pop(q) end end end -- if t then -- exec task --print('will pcall', pps.curthread().co, t.f, q) local ok, ret = pcall(t.f, select(1, table.unpack(t.arg))) if not ok then pps.error(ret) end else -- no more task, yield & add to free-thread-queue if q then q.done = true q = nil end push(_freeThs, th) pps.wait() end end end) th.co = co _coThs[co] = th return th end local function notifyThread() local th = pop(_freeThs) if not th then -- no free thread, create th = newThread() end pps.wakeup(th) return th end local function wrapTask(f, ...) local t = {f=f, arg=table.pack(...)} return t end local function addTask(t) push(_tasks, t) end local function execTask(f, ...) local t = wrapTask(f, ...) addTask(t) return notifyThread() end local function send(cmd, ...) return _c.send(cmd, ...) end local function typeCode(typeOri) local tp = type(typeOri) if tp == 'string' then local ret = inner.typecode(typeOri) if not ret then error('unknown protocol: '..tostring(typeOri)) end return ret end return typeOri end -- local _msgPacks = {} local function regProtocol(mType, fPack, fUnpack) mType = typeCode(mType) _msgPacks[mType] = {pk = fPack, unpk = fUnpack} end local function doUnpack(mType, msg, sz) local pack = _msgPacks[mType] if not pack then error('unreg protocol for unpack: '..tostring(mType)) end if not pack.unpk then error('unpack not reg for protocol: '..tostring(mType)) end return pack.unpk(msg, sz) end local function doPack(mType, ...) local pack = _msgPacks[mType] if not pack then error('unreg protocol for pack: '..tostring(mType)) end if not pack.pk then error('pack not reg for protocol: '..tostring(mType)) end return pack.pk(...) end -- function pps.reg_protocol(mType, fPack, fUnpack) return regProtocol(mType, fPack, fUnpack) end function pps.unpack(data, sz) return _c.luaunpack(data, sz) end function pps.pack(...) return _c.luapack(...) end function pps.error(err) _c.error(err) end function pps.exec(f, ...) return execTask(f, ...) end function pps.wait() return _co.yield() end function pps.wakeup(th, ...) return _co.resume(th.co, ...) end function pps.curthread() local co = _co.running() return _coThs[co] end function pps.yield() pps.sleep(0) end function pps.fork(f, ...) local t = wrapTask(f, ...) pps.timeout(0, function() addTask(t) notifyThread() end) end local _cmd = inner.cmd local _rspCbs = {} local function _newservice(src, th, ...) --srcPath, toThread, session, paramType(opt), param(opt), paramSize(opt) local ss = util.genid() local id = send(_cmd.newservice, src, th, ss, typeLua, doPack(typeLua, ...)) if not id then error('newservice failed 1') end _rspCbs[ss] = {th=pps.curthread()} local ret = pps.wait() if not ret then error('newservice failed 2') end return id end function pps.newservice(src, ...) return _newservice(src, -1, ...) end function pps.newidxservice(src, th, ...) return _newservice(src, th, ...) end function pps.timeout(delay, cb) local ss = util.genid() send(_cmd.timeout, delay, ss) -- delay, session _rspCbs[ss] = {cb=cb} end function pps.sleep(delay) local ss = util.genid() send(_cmd.timeout, delay, ss) -- delay, session _rspCbs[ss] = {th=pps.curthread()} return pps.wait() end -- local _tickSs local function doTick(delay, ss, cnt, cb) if delay < 1 then error('invalid tick delay: '..tostring(delay)) end _tickSs = ss send(_cmd.timeout, delay, ss, cnt) -- delay, session _rspCbs[ss] = {cb=cb} end local _tickCb = nil local _tickDelay local fnTickCb fnTickCb = function(src, ss, cnt) --print('tickCb: ', cnt, ss, _tickSs, _tickCb) if ss ~= _tickSs or not _tickCb then return end if cnt == 1 then -- re-reg local ss = util.genid() doTick(_tickDelay, ss, 500, fnTickCb) end _tickCb() end function pps.tick(delay, cb) if _tickCb then error('reg tick duplicately') end _tickDelay = delay _tickCb = cb local ss = util.genid() doTick(delay, ss, 500, fnTickCb) end function pps.untick() if _tickCb then _tickCb = nil _rspCbs[_tickSs] = nil end end function pps.now() return _c.time() end function pps.free(ptr) return _c.free(ptr) end function pps.send(to, mType, ...) mType = typeCode(mType) local msg, sz = doPack(mType, ...) send(_cmd.send, to, 0, mType, msg, sz) -- to, session, mType, msg, sz end function pps.call(to, mType, ...) mType = typeCode(mType) local msg, sz = doPack(mType, ...) local ss = util.genid() send(_cmd.send, to, ss, mType, msg, sz) _rspCbs[ss] = {th=pps.curthread()} return pps.wait() end local _retsWait = {} function pps.ret(mType, ...) local th = pps.curthread() local tb = _retsWait[th] if not tb then error('ret not expect') end _retsWait[th] = nil mType = typeCode(mType) local msg, sz = doPack(mType, ...) send(_cmd.send, tb.src, -tb.ss, mType, msg, sz) end function pps.name(name, addr) return send(_cmd.name, name, addr) end function pps.exit() if _exit then return end _exit = true _c.exit() pps.wait() end function pps.shutdown() _c.shutdown() pps.exit() end local logger = inner.logger() function pps.log(...) local msg, sz = doPack(typeLua, ...) send(_cmd.send, logger, 0, typeLua, msg, sz) -- to, session, mType, msg, sz end -- stat begin local _stat = {id=1, mem=2, mqlen=3, message=4, memth=5, svcnum=6} local function statCode(sType) if type(sType) == 'string' then local s = _stat[sType] if not s then error('unknown stat type: '..sType) end return s end error('invalid state type: '..tostring(sType)) end local function isThValid(th) th = tonumber(th) local ths = tonumber(pps.env('thread')) if th >= 0 and th < ths then return true end end function pps.stat(sType, a1) local code = statCode(sType) if sType == 'memth' and a1 then -- specify thread a1 = tonumber(a1) local _, thSelf = pps.self() if a1 ~= thSelf then -- query other thread mem if not isThValid(a1) then return false, 'thread invalid: '..a1 end local ok, mem = pps.call(inner.sysname(a1), 'lua', 'memth') if not ok then return false, mem end return mem end end if sType == 'mem' then if a1 then -- specify service id a1 = tonumber(a1) local ok, mem = pps.call(a1, 'stat', 'mem') if not ok then return false, mem end return mem end local mem = _c.stat(code) local sock = require('pipes.socket') return mem + sock.mem() end return _c.stat(code, a1) end function pps.self() return _c.stat(_stat.id) end local function onStatQuery(src, ss, ...) local tb = {...} local cmd = tb[1] if cmd == 'mem' then -- query self mem local mem, err = pps.stat('mem') pps.ret('stat', mem) end end -- stat end -- function pps.env(key) return _c.env(key) end -- dispatch local types = inner.typename local _msgCbs = {} local function _dispatch(code, cb) _msgCbs[code] = cb end function pps.dispatch(mType, cb) local code = typeCode(mType) if code == types.net or code == types.stat then error('dispatch type reserved: '..tostring(mType)) end _dispatch(code, cb) end _dispatch(types.stat, onStatQuery) -- reg stat-query cb local function freeMsg(mType, msg) --[[ if msg and (mType == types.lua or mType == types.string) then pps.free(msg) end --]] if msg then pps.free(msg) end end local function procMsg(src, ss, mType, msg, sz) if _exit then freeMsg(mType, msg) return 1 end --print('procMsg ss='..ss..', type='..mType..', thread='..tostring(_co.running()), sz) if mType == types.net then -- handler has reg by pipes.socket local cbMsg = inner.msgCb(mType) if cbMsg then cbMsg(src, ss, msg, sz) else -- no msg handle freeMsg(mType, msg) end return 1 end -- source, session, type, msg, size if ss < 0 then -- is response ss = -ss local cb = _rspCbs[ss] if cb then if cb.th then -- is call response --print('recv call rsp, ', ss, cb.th.co, msg) _rspCbs[ss] = nil if mType == types.reterr then pps.wakeup(cb.th, false, doUnpack(mType, msg, sz)) else pps.wakeup(cb.th, true, doUnpack(mType, msg, sz)) end elseif cb.cb then -- is ret --print('recv ret cb: ', ss, mType, msg, sz) if mType ~= types.timer or sz <= 1 then _rspCbs[ss] = nil end cb.cb(src, ss, doUnpack(mType, msg, sz)) end end freeMsg(mType, msg) return 1 end local cbMsg = _msgCbs[mType] if cbMsg then local th if ss > 0 then -- need ret th = pps.curthread() _retsWait[th] = {ss=ss, src=src} end cbMsg(src, ss, doUnpack(mType, msg, sz)) if ss > 0 then -- check ret if _retsWait[th] then -- has not ret _retsWait[th] = nil send(_cmd.send, src, -ss, types.reterr, 'no ret', 0) end end end -- freeMsg(mType, msg) return 1 end -- reg msg cb _c.dispatch(function(src, ss, mType, msg, sz) --print('msg cb, ', ss, mType, msg, sz) pps.exec(procMsg, src, ss, mType, msg, sz) return 1 end) function pps.queue() local seq = {} local function fn(f, ...) local t = {f=f, arg=table.pack(...)} if not seq.q then seq.q = {done = true} end push(seq.q, t) if seq.q.done then -- all task done, re-add to task-queue seq.q.done = nil push(_tasks, seq) end --print('seq add f', pps.curthread().co, f, seq.q.n) end return fn end function pps.console(cfg) return pps.newservice('lpps_console', 'init', cfg) end -- reg default protocol regProtocol(types.raw, nil, function(msg, sz) return msg, sz end) regProtocol(types.string, function(...) local tb = table.pack(...) if tb.n == 1 then return tostring(tb[1]) end if tb.n > 1 then local str = table.concat(tb) return str end end, inner.rawtostr) regProtocol(types.newsvrret, nil, function(msg, sz) return sz end) regProtocol(types.timer, nil, function(msg, sz) return sz end) regProtocol(types.reterr, function(err) return tostring(err), 0 end, function(msg, sz) return inner.rawtostr(msg, sz) end) regProtocol(types.lua, pps.pack, pps.unpack) regProtocol(types.stat, pps.pack, pps.unpack) return pps
return function(player,attackRate) return { type = script.Name, player = player, attackRate = attackRate, replicateTo = player, } end
require('plugin.mappings') require('plugin.settings') vim.g.coq_settings = { xdg = false, auto_start = 'shut-up', display = { pum = { fast_close = false, source_context = {"[", "]"}, }, preview = { border = "single", positions = { east = 1, south = 2, north = 3, west = 4, }, }, ghost_text = { enabled = true, context = {"", ""}, }, icons = { mode = "none", } }, keymap = { jump_to_mark = "<C-p>", } } if vim.api.nvim_get_option('loadplugins') then if vim.fn.has('packages') == 1 then vim.cmd([[packad coq]]) vim.cmd([[packadd lspconfig]]) vim.cmd([[packadd treesitter]]) end end
------------------------------------------------------------------------------- -- Imports ------------------------------------------------------------------------------- dofile("src/ParticleHelper.lua" ) dofile("src/Settings.lua") dofile("src/Assets.lua") dofile("src/GameState.lua") dofile("src/Util.lua") dofile("src/EventSource.lua") dofile("src/Entity.lua") dofile("src/ActiveSet.lua") dofile("src/PhysicalEntity.lua") dofile("src/DynamicEntity.lua") dofile("src/Effect.lua") dofile("src/ObstaclePath.lua") dofile("src/LightMap.lua") dofile("src/Level.lua") dofile("src/Game.lua") dofile("src/LightBall.lua") dofile("src/Goal.lua") dofile("src/Swimmer.lua") dofile("src/SwimmerController.lua") dofile("src/Killer.lua") dofile("src/Glower.lua") ------------------------------------------------------------------------------- -- Entry point ------------------------------------------------------------------------------- game = Game.new() game:run()
local setTimeout = require('async.time').setTimeout local flow = {} flow.ratelimiter = function(persecond) local func_list = {} local arg_list = {} local currently_running = 0 local waiting = false local rate = 1000 / (persecond or 100) local exec_next exec_next = function() if #func_list > 0 then waiting = true if currently_running < persecond then local func = func_list[1] local args = arg_list[1] table.remove(func_list, 1) table.remove(arg_list, 1) currently_running = currently_running + 1 -- if the function has a callback, wrap that callback with our currently_running counter decrement if type(args[#args]) == "function" then local cb = args[#args] args[#args] = function(...) currently_running = currently_running - 1 cb(...) end else table.insert(args, function() currently_running = currently_running - 1 end) end func(unpack(args)) end setTimeout(rate, exec_next) else waiting = false end end return function(func, args) table.insert(func_list, func) table.insert(arg_list, args) if waiting == false then exec_next() end end end return flow
-- lib/server/networking.lua -- add some network strings util.AddNetworkString("bsu_client_ready") -- used to tell the server when the clientside part of the addon has loaded util.AddNetworkString("bsu_rpc") -- used for client RPC system util.AddNetworkString("bsu_client_info") -- used to send client info to the server util.AddNetworkString("bsu_ppdata_init") -- used for getting all prop protection client data on the server util.AddNetworkString("bsu_ppdata_update") -- used for updating prop protection client data on the server function BSU.ClientRPC(plys, func, ...) net.Start("bsu_rpc") net.WriteString(func) local tableToWrite = {...} net.WriteInt(#tableToWrite, 16) -- Only 32766 args :) for k, v in pairs(tableToWrite) do net.WriteType(v) -- Still not the best but the args can be any value so there's no other option end if plys then net.Send(plys) else net.Broadcast() end end
concommand.Add( "SetSCarPlayerSCarKey", function( ply, com, args ) ply.ScarSpecialKeyInput[SCarKeys.KeyVarTransTable[math.floor(tonumber(args[1]))]] = math.floor(tonumber(args[2])) end) function SCarKeys:KeyDown(ply, key) if ply and key and ply.ScarSpecialKeyInput[key] and ply.ScarSpecialKeyInput[key] == 2 then return true end return false end function SCarKeys:KeyWasReleased(ply, key) if ply and key and ply.ScarSpecialKeyInput[key] and ply.ScarSpecialKeyInput[key] == 3 then return true end return false end function SCarKeys:KeyWasPressed(ply, key) if ply and key and ply.ScarSpecialKeyInput[key] and ply.ScarSpecialKeyInput[key] >= 2 then return true end return false end function SCarKeys:KillKey(ply, key) if ply and key and ply.ScarSpecialKeyInput[key] then ply.ScarSpecialKeyInput[key] = 0 end end -----------------Mouse input local function AddDefaultMousePos( ply ) ply.SCarMouseMoveX = 0 ply.SCarMouseMoveY = 0 end hook.Add("PlayerInitialSpawn", "SCarMouseSetDefaultValues", AddDefaultMousePos) concommand.Add( "SetSCarMouseMovementX", function( ply, com, args ) if(args[1]) then ply.SCarMouseMoveX = tonumber(args[1]) end end) concommand.Add( "SetSCarMouseMovementY", function( ply, com, args ) if(args[1]) then ply.SCarMouseMoveY = tonumber(args[1]) end end)
local class = require("heart.class") local M = class.newClass() function M:init(engine, config) self.engine = assert(engine) self.parentConstraintEntities = assert(self.engine.componentEntitySets.parentConstraint) self.parentConstraintComponents = assert(self.engine.componentManagers.parentConstraint) self.transformComponents = assert(self.engine.componentManagers.transform) end function M:handleEvent(dt) local parents = self.engine.entityParents local transforms = self.transformComponents.transforms local localTransforms = self.parentConstraintComponents.localTransforms local enabledFlags = self.parentConstraintComponents.enabledFlags for id in pairs(self.parentConstraintEntities) do if enabledFlags[id] then local parentId = parents[id] transforms[id]: reset(): apply(transforms[parentId]): apply(localTransforms[id]) end end end return M
local BuildingProperties = {} local defines = {} local building = { maxHp = 1800, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP001"] = building ---------------------- local building = { maxHp = 1800, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP002"] = building ---------------------- local building = { maxHp = 2000, -- 最大 HP maxArmor = 20, -- 最大装甲 } defines["BuildingP003"] = building ---------------------- local building = { maxHp = 1800, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP004"] = building ---------------------- local building = { maxHp = 2500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP005"] = building ---------------------- local building = { maxHp = 2500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP006"] = building ---------------------- local building = { maxHp = 2500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP007"] = building ---------------------- local building = { maxHp = 2500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP008"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP009"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP010"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP011"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP012"] = building ---------------------- local building = { maxHp = 10000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP013"] = building ---------------------- local building = { maxHp = 10000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP014"] = building ---------------------- local building = { maxHp = 13600, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP015"] = building ---------------------- local building = { maxHp = 13600, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP016"] = building ---------------------- local building = { maxHp = 20000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP017"] = building ---------------------- local building = { maxHp = 20000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP018"] = building ---------------------- local building = { maxHp = 26000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP019"] = building ---------------------- local building = { maxHp = 26000, -- 最大 HP maxArmor = 50, -- 最大装甲 } defines["BuildingP020"] = building ---------------------- local building = { maxHp = 30000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP021"] = building ---------------------- local building = { maxHp = 28000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP022"] = building ---------------------- local building = { maxHp = 37500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP023"] = building ---------------------- local building = { maxHp = 37500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP024"] = building ---------------------- local building = { maxHp = 48000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP025"] = building ---------------------- local building = { maxHp = 48000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP026"] = building ---------------------- local building = { maxHp = 48000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingP027"] = building ---------------------- local building = { maxHp = 48000, -- 最大 HP maxArmor = 500, -- 最大装甲 } defines["BuildingP028"] = building ------------------------------------------------------------------ ------------------------------------------------------------------ local building = { maxHp = 3000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN001"] = building ---------------------- local building = { maxHp = 3000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN002"] = building ---------------------- local building = { maxHp = 3000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN003"] = building ---------------------- local building = { maxHp = 3000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN004"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN005"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN006"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN007"] = building ---------------------- local building = { maxHp = 5500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN008"] = building ---------------------- local building = { maxHp = 8500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN009"] = building ---------------------- local building = { maxHp = 8500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN010"] = building ---------------------- local building = { maxHp = 8500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN011"] = building ---------------------- local building = { maxHp = 8500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN012"] = building ---------------------- local building = { maxHp = 13500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN013"] = building ---------------------- local building = { maxHp = 15500, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN014"] = building ---------------------- local building = { maxHp = 24000, -- 最大 HP maxArmor = 0, -- 最大装甲 } defines["BuildingN015"] = building ---------------------- local building = { maxHp = 24000, -- 最大 HP maxArmor = 50, -- 最大装甲 } defines["BuildingN016"] = building ---------------------- local building = { maxHp = 30000, -- 最大 HP maxArmor = 100, -- 最大装甲 } defines["BuildingN017"] = building ---------------------- local building = { maxHp = 34000, -- 最大 HP maxArmor = 150, -- 最大装甲 } defines["BuildingN018"] = building ---------------------- local building = { maxHp = 40000, -- 最大 HP maxArmor = 200, -- 最大装甲 } defines["BuildingN019"] = building ---------------------- local building = { maxHp = 40000, -- 最大 HP maxArmor = 250, -- 最大装甲 } defines["BuildingN020"] = building ---------------------- local building = { maxHp = 38000, -- 最大 HP maxArmor = 300, -- 最大装甲 } defines["BuildingN021"] = building ---------------------- local building = { maxHp = 52000, -- 最大 HP maxArmor = 450, -- 最大装甲 } defines["BuildingN022"] = building ---------------------- local building = { maxHp = 47500, -- 最大 HP maxArmor = 400, -- 最大装甲 } defines["BuildingN023"] = building ---------------------- local building = { maxHp = 58000, -- 最大 HP maxArmor = 450, -- 最大装甲 } defines["BuildingN024"] = building ---------------------- local building = { maxHp = 48000, -- 最大 HP maxArmor = 800, -- 最大装甲 } defines["BuildingN025"] = building ---------------------- local building = { maxHp = 64000, -- 最大 HP maxArmor = 800, -- 最大装甲 } defines["BuildingN026"] = building ---------------------- local building = { maxHp = 50000, -- 最大 HP maxArmor = 800, -- 最大装甲 } defines["BuildingN027"] = building ---------------------- local building = { maxHp = 64000, -- 最大 HP maxArmor = 800, -- 最大装甲 } defines["BuildingN028"] = building ------------------------------------------------------------------ ------------------------------------------------------------------ function BuildingProperties.get(id) return clone(defines[id]) end return BuildingProperties
-- get machine info: this needs to be loaded *before* the node9 cdefs -- first the misc machine info ffi.cdef[[ extern char *hostcpu(); extern char *hostos(); /* the machine architecture word size in bytes, usually 4 or 8 */ extern int wordsize(); /* number of 32-bit words (ints) in the os machine state */ extern int jumpsize(); ]]
----------------------------------------------------------- --To be removed ----------------------------------------------------------- function cmd_set_xp(player, cmd, args, argStr) local amount = tonumber(argStr) if(amount != nil) then player_manager.RunClass( player, "SetXP", amount) player_manager.RunClass( player, "SendRaceInfo") print( "set xp: " .. amount) else print("Bad argument: " + argStr) end end ----------------------------------------------------------- function cmd_get_xp(player, cmd, args, argStr) print(db_get_xp(player)) end ----------------------------------------------------------- function cmd_gain_xp(player, cmd, args, argStr) local amount = tonumber(argStr) if(amount != nil) then player_manager.RunClass( player, "GainXP", amount) else print("Bad argument: " + argStr) end end ----------------------------------------------------------- function cmd_spawn_prison_guard(player, cmd, args, argStr) local npc = ents.Create( "npc_combine_s" ) if ( !IsValid( npc ) ) then return end // Check whether we successfully made an entity, if not - bail npc:SetPos( player:GetEyeTrace().HitPos ) npc:Spawn() end ----------------------------------------------------------- function cmd_changerace(player, cmd, args, argStr) if ( IsValid( player ) and player:IsPlayer() ) then player_manager.SetPlayerClass(player, args[1]) print("New Race " .. argStr) db_set_race(player) end end ----------------------------------------------------------- function cmd_levelskill(player, cmd, args, argStr) local ability = tonumber(args[1]) if(ability != nil) then player_manager.RunClass(player, "LevelAbility", ability) else print("Bad argument: " + argStr) end end ----------------------------------------------------------- function cmd_resetskills(player, cmd, args, argStr) player_manager.RunClass(player, "ResetSkills") end
local g, o, wo, bo = vim.g, vim.o, vim.wo, vim.bo local utils = require "utils" local map = utils.map -- BASE VIM KEYBINDINGS local expr = { expr = true } local remap = { noremap = false } local silent = { silent = true } local silent_expr = { silent = true, expr = true } local silent_remap = { silent = true, noremap = false } local silent_nowait = { silent = true, nowait = true } -- Remap space as leader key map("n", "<space>", "<nop>", silent) g.mapleader = [[ ]] g.maplocalleader = [[,]] -- Common commands map("n", "<leader>w", "<cmd>w<cr>", silent) -- Write buffer map("n", "<leader>x", "<cmd>x!<cr>", silent) -- Write buffer map("n", "<leader>q", "<cmd>q<cr>", silent) -- Quit buffer map("n", "<leader>d", "<cmd>Sayonara!<cr>", silent_nowait) -- Delete buffer -- Yank into clipboard map("n", "<leader>y", '"+y', silent) map("v", "<leader>y", '"+y', silent) -- Paste from clipboard map("n", "<leader>p", '"+p', silent) map("n", "<leader>P", '"+P', silent) map("v", "<leader>p", '"+p', silent) -- Remap for dealing with word wrap map("n", "k", [[v:count == 0 ? 'gk' : 'k']], silent_expr) map("n", "j", [[v:count == 0 ? 'gj' : 'j']], silent_expr) -- Let Y yank until the end of line map("n", "Y", "y$") -- Simpler window management map("n", "<c-h>", "<c-w>h") map("n", "<c-j>", "<c-w>j") map("n", "<c-k>", "<c-w>k") map("n", "<c-l>", "<c-w>l") -- Map escape key to exit terminal window map("t", "<Esc>", "<C-\\><C-n>") -- Make working directory the directory of the current file map("n", "<leader>cd", ":cd %:p:h<cr>") map("n", "<leader>e", ":Explore<cr>") -- Insert newlines in normal mode map("n", "<leader>j", "m`o<esc>") map("n", "<leader>k", "m`O<esc>") -- Use <c-h> and <c-l> instead of <up> and <down> in wildmenu map("c", "<c-l>", [[wildmenumode() ? "\<down>" : "\<c-l>"]], silent_expr) map("c", "<c-h>", [[wildmenumode() ? "\<up>" : "\<c-h>"]], silent_expr) -- PLUGIN KEYMAPPINGS -- Easy-Align map({ "x", "n" }, "ga", "<Plug>(EasyAlign)", silent_remap) -- Telescope map( "n", "<leader>sb", [[<cmd>lua require('telescope.builtin').buffers()<CR>]], silent ) map( "n", "<leader>sf", [[<cmd>lua require('telescope.builtin').find_files()<CR>]], silent ) map( "n", "<leader>sc", [[<cmd>lua require('telescope.builtin').current_buffer_fuzzy_find()<CR>]], silent ) map( "n", "<leader>sh", [[<cmd>lua require('telescope.builtin').help_tags()<CR>]], silent ) -- map( -- 'n', -- '<leader>st', -- [[<cmd>lua require('telescope.builtin').tags()<CR>]], -- silent -- ) map( "n", "<leader>ss", [[<cmd>lua require('telescope.builtin').grep_string()<cr>]], silent ) map( "n", "<leader>sg", [[<cmd>lua require('telescope.builtin').live_grep()<cr>]], silent ) map( "n", "<leader>se", [[<cmd>lua require('telescope.builtin').file_browser()<cr>]], silent ) -- map('n', 'z=', [[<cmd>lua require('telescope.builtin').spell_suggest()<cr>]], -- silent) map( "n", "z=", [[<cmd>lua require('telescope.builtin').spell_suggest(require('telescope.themes').get_cursor({}))<CR>]], silent ) -- map( -- 'n', -- '<leader>st', -- [[<cmd>lua require('telescope.builtin').tags{ -- only_current_buffer = true -- }<CR> -- ]], -- silent -- ) map( "n", "<leader>so", [[<cmd>lua require('telescope.builtin').oldfiles()<CR>]], silent ) -- ArgWrap map("n", "gw", ":ArgWrap<cr>", silent) -- Git map("n", "<leader>g", "<cmd>Git<cr>", silent) -- REPL -- map("v", "gs", "<Plug>(neoterm-repl-send)", remap) -- map("n", "gs", "<Plug>(neoterm-repl-send)", remap) -- map("n", "gss", "<Plug>(neoterm-repl-send-line)", remap) -- map("n", "gsf", "<cmd>treplsendfile<cr>", remap) map("x", "gs", "<Plug>SlimeRegionSend", remap) map("n", "gs", "<Plug>SlimeParagraphSend", remap) -- map("n", "gss", "<Plug>(neoterm-repl-send-line)", remap) -- map("n", "gsf", "<cmd>treplsendfile<cr>", remap) -- Format map("n", "<leader>f", "<cmd>Format<cr>", silent) map("v", "<leader>f", "<cmd>Format<cr>", silent) -- Bufferline map("n", "gb", "<cmd>BufferLinePick<cr>", silent) -- Ranger map("n", "<leader>rf", "<cmd>Ranger<cr>") map("n", "<leader>rw", "<cmd>RangerWorkingDirectory<cr>")
CombatControls = {} -- private variables local combatControlsButton local combatControlsWindow local fightOffensiveBox local fightBalancedBox local fightDefensiveBox local chaseModeButton local safeFightButton local fightModeRadioGroup -- private functions local function onFightModeChange(self, selectedFightButton) if selectedFightButton == nil then return end local buttonId = selectedFightButton:getId() local fightMode if buttonId == 'fightOffensiveBox' then fightMode = FightOffensive elseif buttonId == 'fightBalancedBox' then fightMode = FightBalanced else fightMode = FightDefensive end if g_game.getFightMode ~= fightMode then g_game.setFightMode(fightMode) end end local function onChaseModeChange(self, checked) local chaseMode if checked then chaseMode = ChaseOpponent else chaseMode = DontChase end if g_game.getChaseMode() ~= chaseMode then g_game.setChaseMode(chaseMode) end end local function onSafeFightChange(self, checked) local safeFight = not checked if g_game.isSafeFight() ~= safeFight then g_game.setSafeFight(not checked) end end -- public functions function CombatControls.init() combatControlsButton = TopMenu.addGameToggleButton('combatControlsButton', tr('Combat Controls'), 'combatcontrols.png', CombatControls.toggle) combatControlsButton:setOn(true) combatControlsWindow = loadUI('combatcontrols.otui', GameInterface.getRightPanel()) fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox') fightBalancedBox = combatControlsWindow:recursiveGetChildById('fightBalancedBox') fightDefensiveBox = combatControlsWindow:recursiveGetChildById('fightDefensiveBox') chaseModeButton = combatControlsWindow:recursiveGetChildById('chaseModeBox') safeFightButton = combatControlsWindow:recursiveGetChildById('safeFightBox') fightModeRadioGroup = RadioGroup.create() fightModeRadioGroup:addWidget(fightOffensiveBox) fightModeRadioGroup:addWidget(fightBalancedBox) fightModeRadioGroup:addWidget(fightDefensiveBox) connect(fightModeRadioGroup, { onSelectionChange = onFightModeChange }) connect(chaseModeButton, { onCheckChange = onChaseModeChange }) connect(safeFightButton, { onCheckChange = onSafeFightChange }) connect(g_game, { onGameStart = CombatControls.online }) connect(g_game, { onGameEnd = CombatControls.offline }) if g_game.isOnline() then CombatControls.online() end end function CombatControls.terminate() if g_game.isOnline() then CombatControls.offline() end fightModeRadioGroup:destroy() fightModeRadioGroup = nil fightOffensiveBox = nil fightBalancedBox = nil fightDefensiveBox = nil chaseModeButton = nil safeFightButton = nil combatControlsButton:destroy() combatControlsButton = nil combatControlsWindow:destroy() combatControlsWindow = nil disconnect(g_game, { onGameStart = CombatControls.online }) disconnect(g_game, { onGameEnd = CombatControls.offline }) CombatControls = nil end function CombatControls.online() combatControlsWindow:setVisible(combatControlsButton:isOn()) local fightMode = g_game.getFightMode() if fightMode == FightOffensive then fightModeRadioGroup:selectWidget(fightOffensiveBox) elseif fightMode == FightBalanced then fightModeRadioGroup:selectWidget(fightBalancedBox) else fightModeRadioGroup:selectWidget(fightDefensiveBox) end local chaseMode = g_game.getChaseMode() chaseModeButton:setChecked(chaseMode == ChaseOpponent) local safeFight = g_game.isSafeFight() safeFightButton:setChecked(not safeFight) end function CombatControls.offline() end function CombatControls.toggle() local visible = not combatControlsWindow:isExplicitlyVisible() combatControlsWindow:setVisible(visible) combatControlsButton:setOn(visible) end
workspace "tp1" architecture "x64" configurations { "debug", "release" } folder = "%{cfg.buildcfg}/%{cfg.system}/%{cfg.architecture}" project "wav" location "config/%{prj.name}" kind "StaticLib" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/%{prj.name}") objdir ("int/%{prj.name}") links { "sndfile" } files { "src/%{prj.name}/**.cpp", "include/%{prj.name}/**.hpp" } includedirs { "include" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on" project "wavcb" location "config/%{prj.name}" kind "ConsoleApp" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/") objdir ("int/") files { "src/%{prj.name}.cpp", "include/**.hpp" } includedirs { "include" } links { "wav", "sndfile", "pthread", "stdc++fs" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on" project "wavcmp" location "config/%{prj.name}" kind "ConsoleApp" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/") objdir ("int/") files { "src/%{prj.name}.cpp", "include/**.hpp" } includedirs { "include" } links { "wav", "sndfile" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on" project "wavcp" location "config/%{prj.name}" kind "ConsoleApp" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/") objdir ("int/") files { "src/%{prj.name}.cpp", "include/**.hpp" } includedirs { "include" } links { "wav", "sndfile" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on" project "wavfind" location "config/%{prj.name}" kind "ConsoleApp" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/") objdir ("int/") files { "src/%{prj.name}.cpp", "include/**.hpp" } includedirs { "include" } links { "wav", "sndfile", "stdc++fs" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on" project "wavhist" location "config/%{prj.name}" kind "ConsoleApp" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/") objdir ("int/") files { "src/%{prj.name}.cpp", "include/**.hpp" } includedirs { "include" } links { "wav", "sndfile" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on" project "wavquant" location "config/%{prj.name}" kind "ConsoleApp" language "C++" cppdialect "C++17" staticruntime "on" targetdir ("bin/") objdir ("int/") files { "src/%{prj.name}.cpp", "include/**.hpp" } includedirs { "include" } links { "wav", "sndfile" } filter "system:windows" systemversion "latest" filter "system:linux" systemversion "latest" filter "system:macosx" systemversion "latest" filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "on"
local middle = require 'hawk/middleclass' local machine = require 'hawk/statemachine' local app = require 'app' local anim8 = require 'vendor/anim8' local gamestate = require 'vendor/gamestate' local timer = require 'vendor/timer' local tween = require 'vendor/tween' local game = require 'game' local camera = require 'camera' local NAMESPACE = 'cuttriggers.' local timeline = { opacity=0 } local SceneTrigger = middle.class('SceneTrigger') SceneTrigger:include(machine.mixin({ initial = 'ready', events = { {name = 'start', from = 'ready', to = 'playing'}, {name = 'stop', from = 'playing', to = 'finished'}, } })) function SceneTrigger:initialize(node, collider, layer) assert(node.properties.cutscene, "A cutscene to trigger is required") self.isTrigger = true --eventually replace me self.x = node.x self.y = node.y self.db = app.gamesaves:active() self.key = NAMESPACE .. node.properties.cutscene if self.db:get(self.key, false) then --already seen return end local scene = require('nodes/cutscenes/' .. node.properties.cutscene) self.scene = scene.new(node, collider, layer) -- Figure out how to "mix this in" -- so much work self.collider = collider self.bb = collider:addRectangle(node.x, node.y, node.width, node.height) self.bb.node = self collider:setPassive(self.bb) end function SceneTrigger:update(dt, player) if not self:is('playing') then return end self.scene:update(dt, player) end function SceneTrigger:keypressed(button) if not self:is('playing') then return false end return self.scene:keypressed(button) end function SceneTrigger:collide(node, dt, mtv_x, mtv_y) if node and node.character and self:can('start') then local current = gamestate.currentState() current.scene = self self:start() current.trackPlayer = false node.controlState:inventory() node.velocity.x = math.min(node.velocity.x,game.max_x) self.scene:start() end end function SceneTrigger:draw(player) if not self:is('playing') then return end self.scene:draw(player) if self.scene.finished then local current = gamestate.currentState() self:stop() current.player.controlState:standard() current.trackPlayer = true current.scene = nil self.db:set(self.key, true) end end return SceneTrigger
inviteView2= { name="inviteView2",type=0,typeName="View",time=0,x=-1,y=0,width=1280,height=720,visible=1,nodeAlign=kAlignCenter,fillParentWidth=1,fillParentHeight=1, { name="bg",type=1,typeName="Image",time=0,x=0,y=0,width=1280,height=720,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignTopLeft,file="isolater/bg_shiled.png" } } return inviteView2;
--import local WIM = WIM; local _G = _G; local CreateFrame = CreateFrame; local table = table; local string = string; --set namespace setfenv(1, WIM); local Menu = CreateModule("Menu", true); local groupCount = 0; local buttonCount = 0; local lists = { whisper = {}, chat = {} } local maxButtons = { whisper = 20, chat = 10 }; db_defaults.menuSortActivity = true; local function sortWindows(a, b) if(db and db.menuSortActivity) then return a.lastActivity > b.lastActivity; else return string.lower(a.theUser) < string.lower(b.theUser); end end function isMouseOver() -- can optionaly exclude an object local x,y = _G.GetCursorPosition(); local menu = WIM.Menu; if(not menu) then return false; else local x1, y1 = menu:GetLeft()*menu:GetEffectiveScale(), menu:GetTop()*menu:GetEffectiveScale(); local x2, y2 = x1 + menu:GetWidth()*menu:GetEffectiveScale(), y1 - menu:GetHeight()*menu:GetEffectiveScale(); if(x >= x1 and x <= x2 and y <= y1 and y >= y2) then return true; end return false; end end local function createCloseButton(parent) local button = CreateFrame("Button", nil, parent); button:SetNormalTexture("Interface\\AddOns\\"..addonTocName.."\\Modules\\Textures\\xNormal"); button:SetPushedTexture("Interface\\AddOns\\"..addonTocName.."\\Modules\\Textures\\xPressed"); button:SetWidth(16); button:SetHeight(16); button:SetScript("OnClick", function(self) self:GetParent().win.widgets.close.forceShift = true; self:GetParent().win.widgets.close:Click(); end); return button; end local function createStatusIcon(parent) local icon = parent:CreateTexture(nil, "OVERLAY"); icon:SetWidth(14); icon:SetHeight(14); icon:SetAlpha(.85); icon:SetTexture("Interface\\AddOns\\"..addonTocName.."\\Sources\\Options\\Textures\\blipClear"); return icon; end local function createButton(parent) buttonCount = buttonCount + 1; local button = CreateFrame("Button", "WIM3MenuButton"..buttonCount, parent, "UIPanelButtonTemplate"); local bgtex = "Interface\\AddOns\\"..addonTocName.."\\Modules\\Textures\\Menu_bg" button:SetNormalTexture(bgtex); button:SetPushedTexture(bgtex); button:SetDisabledTexture(bgtex); button:SetHighlightTexture(bgtex); button:SetHighlightTexture("Interface\\QuestFrame\\UI-QuestLogTitleHighlight", "ADD"); button:GetHighlightTexture():SetVertexColor(.196, .388, .8); button:SetHeight(20); button:GetHighlightTexture():SetAllPoints(); button.text = _G[button:GetName().."Text"]; button.text:ClearAllPoints(); button.text:SetPoint("LEFT"); button.text:SetPoint("RIGHT"); button:GetHighlightTexture():ClearAllPoints(); button:GetHighlightTexture():SetAllPoints(); button.status = createStatusIcon(button); button.status:SetPoint("LEFT", button, "RIGHT", 0, -1); button.close = createCloseButton(button); button.close:SetPoint("LEFT", button.status, "RIGHT", 2, 0); button:SetScript("OnClick", function(self, b) local forceShow = true if db.pop_rules[self.win.type].obeyAutoFocusRules then forceShow = self.win:GetRuleSet().autofocus end self.win:Pop(true, forceShow); WIM.Menu:Hide(); end); button:SetScript("OnUpdate", function(self, elapsed) if(self.win) then if(self.win.online ~= nil and not self.win.online and self.win.type == "whisper") then self.text:SetTextColor(.5, .5, .5); self.status:SetTexture("Interface\\AddOns\\"..addonTocName.."\\Sources\\Options\\Textures\\blipRed"); self.canFade = true; elseif(self.win.unreadCount and self.win.unreadCount > 0) then self.text:SetTextColor(1, 1, 1); self.status:SetTexture("Interface\\AddOns\\"..addonTocName.."\\Sources\\Options\\Textures\\blipBlue"); self.canFade = false; else self.text:SetTextColor(1, 1, 1); self.status:SetTexture("Interface\\AddOns\\"..addonTocName.."\\Sources\\Options\\Textures\\blipClear"); self.canFade = true; end -- set opacity of button text. if(self.win and not self.win:IsShown() and self.canFade) then self.text:SetAlpha(.65); self.status:SetAlpha(.65); else self.text:SetAlpha(1); self.status:SetAlpha(1); end end end); button.GetMinimumWidth = function(self) return self.text:GetStringWidth()+40; end return button; end local function createGroup(title, list, maxButtons, showNone) groupCount = groupCount + 1; local group = CreateFrame("Frame", "WIM3MenuGroup"..groupCount, _G.WIM3Menu); -- set backdrop group:SetBackdrop({bgFile = "Interface\\AddOns\\"..addonTocName.."\\Modules\\Textures\\Menu_bg", edgeFile = "Interface\\AddOns\\"..addonTocName.."\\Modules\\Textures\\Menu", tile = true, tileSize = 32, edgeSize = 32, insets = { left = 32, right = 32, top = 32, bottom = 32 }}); group.list = list; group.title = CreateFrame("Frame", group:GetName().."Title", group); group.title:SetHeight(17); group.title:SetPoint("TOPLEFT", 20, -18); group.title:SetPoint("TOPRIGHT", -20, -18); group.title.bg = group.title:CreateTexture(nil, "BACKGROUND"); group.title.bg:SetAllPoints(); group.title.text = group.title:CreateFontString(nil, "OVERLAY", "ChatFontNormal"); local font = group.title.text:GetFont(); group.title.text:SetFont(font, 11, ""); group.title.text:SetAllPoints(); group.title.text:SetText(title.." "); group.title.text:SetJustifyV("TOP"); group.title.text:SetJustifyH("RIGHT"); group.buttons = {}; local lastButton = group.title; local offSet = -32; for i=1, maxButtons do local button = createButton(group); button:SetPoint("TOPLEFT", lastButton, "BOTTOMLEFT"); button:SetPoint("TOPRIGHT", lastButton, "BOTTOMRIGHT", offSet, 0); offSet= 0; button.shown = false; lastButton = button; table.insert(group.buttons, button); end group.showNone = showNone; group.GetButtonCount = function(self) local count = 0; for i=1, #self.buttons do count = self.buttons[i].shown and count+1 or count; end return count; end group.UpdateHeight = function(self) if(#self.list == 0 and not self.showNone) then group:SetHeight(0); else group:SetHeight(_G.math.max(group.title:GetHeight() + group.buttons[1]:GetHeight()*self:GetButtonCount() + 18*2, 64)); end end group.width = 0; group.Refresh = function(self) local maxWidth = 150-18*2; table.sort(self.list, sortWindows); for i=1, #self.buttons do local button = self.buttons[i]; if(i > #self.list) then button.win = nil; button:Hide(); button.shown = false; else button.win = self.list[i]; button.close:Show(); button.status:Show(); button.text:SetText(button.win.theUser); button:Show(); button:Enable(); button.text:SetJustifyH("LEFT"); button.shown = true; maxWidth = _G.math.max(maxWidth, button:GetMinimumWidth()); self:Show(); end end self.title:Show(); if(#self.list == 0) then if(self.showNone) then self.buttons[1].win = nil; self.buttons[1].close:Hide(); self.buttons[1].status:Hide(); self.buttons[1]:Show(); self.buttons[1].shown = true; self.buttons[1]:Disable(); self.buttons[1].text:SetJustifyH("LEFT"); self.buttons[1].text:SetText(L["None"]); self.buttons[1].text:SetTextColor(.5, .5, .5); else self.title:Hide(); self:Hide(); end end self.width = maxWidth+18*2; self:UpdateHeight(); end return group; end local function createMenu() local menu = CreateFrame("Frame", "WIM3Menu", _G.UIParent); menu:Hide(); -- testing only. menu:SetClampedToScreen(true); menu:SetFrameStrata("DIALOG"); menu:SetToplevel(true); menu:SetWidth(180); menu:SetHeight(200); menu.groups = {}; --create whisper group menu.groups[1] = createGroup(L["Whispers"], lists.whisper, maxButtons.whisper, true); menu.groups[1]:SetPoint("TOPLEFT"); menu.groups[1]:SetPoint("TOPRIGHT"); --create chat group menu.groups[2] = createGroup(L["Chat"], lists.chat, maxButtons.chat, false); menu.groups[2]:SetPoint("TOPLEFT", menu.groups[1], "BOTTOMLEFT", 0, 25); menu.groups[2]:SetPoint("TOPRIGHT", menu.groups[1], "BOTTOMRIGHT", 0, 25); menu.Refresh = function(self) local groupHeight = 0; local groupWidth = 0; for i=1, #self.groups do self.groups[i]:Refresh(); groupHeight = groupHeight + self.groups[i]:GetHeight(); groupWidth = _G.math.max(groupWidth, self.groups[i].width); end self:SetHeight(groupHeight); self:SetWidth(groupWidth); end menu:SetScript("OnUpdate", function(self) if(isMouseOver()) then self.mouseStamp = _G.time(); else if((_G.time() - self.mouseStamp) > 1) then self:Hide(); end end end); menu:SetScript("OnShow", function(self) self.mouseStamp = _G.time(); _G.CloseDropDownMenus(); end); return menu; end function Menu:OnWindowCreated(obj) -- add obj to specified list & Update if(obj.type == "whisper" or obj.type == "chat") then addToTableUnique(lists[obj.type], obj); WIM.Menu:Refresh(); end end function Menu:OnWindowDestroyed(obj) -- remove obj to specified list & Update obj.widgets.close.forceShift = nil; if(obj.type == "whisper" or obj.type == "chat") then removeFromTable(lists[obj.type], obj); WIM.Menu:Refresh(); end end function Menu:OnWindowPopped(obj) -- check status of obj to specified list & Update if(obj.type == "whisper" or obj.type == "chat") then WIM.Menu:Refresh(); end end -- for convention, we will load the module as normal. function Menu:OnEnable() if(not WIM.Menu) then WIM.Menu = createMenu(); WIM.Menu:Refresh(); end end -- This is a core module and must always be loaded... Menu.canDisable = false; Menu:Enable();
local outerFolder = (...):match('(.-)[^%.]+$') return { Scene = require(outerFolder .. 'scene'), Object = require(outerFolder .. 'scene-data.object'), Material = require(outerFolder .. 'scene-data.material'), Light = require(outerFolder .. 'scene-data.light') }
OCRP_VehicleGas = 0 OCRP_CurCar = "none" function GetCurCar(umsg) local car = umsg:ReadString() if car == "none" then return end if not GAMEMODE.OCRP_Cars[car] then return end OCRP_CurCar = GAMEMODE.OCRP_Cars[car].Name end usermessage.Hook("OCRP_UpdateCurCar", GetCurCar) net.Receive("OCRP_SendAllCars", function() OCRP_MyCars = {} local t = net.ReadTable() for k,v in pairs(t) do table.insert(OCRP_MyCars, {car = v}) end end) function FixMaterial(mat) local params = {} params["$basetexture"] = mat:GetString("$basetexture") if string.find(mat:GetName(), "skin15") then params["$forcedcolor"] = "{100 0 100}" params["$rimlight"] = 1 params["$rimlightboost"] = 3 params["$phongsfix"] = "{254 113 0}" end return CreateMaterial(mat:GetName() .. "_Fixed", "UnlitGeneric", params) end color_table = { White = Color(255,255,255), Red = Color(255,0,0), Black = Color(0,0,0), Blue = Color(0,0,255), Green = Color(0,255,0), Orange = Color(255,152,44), Yellow = Color(220,220,0), Pink = Color(255,130,255), Grey = Color(110,110,110), Ice = Color(180,255,255), Shiny_Purple = FixMaterial(Material("models/tdmcars/shared/skin15.vmt")), Black_Carbon_Fiber = FixMaterial(Material("models/tdmcars/shared/skin3.vmt")), Metal = FixMaterial(Material("models/tdmcars/shared/skin9.vmt")), Camo = FixMaterial(Material("models/tdmcars/shared/skin10.vmt")), Blue_Camo = FixMaterial(Material("models/tdmcars/shared/skin12.vmt")), Wood = FixMaterial(Material("models/tdmcars/shared/skin14.vmt")) } function CarDealerMenu() local frame = vgui.Create("OCRP_BaseMenu") frame:SetSize(363, 500) frame:SetOCRPTitle("Car Dealership") frame:Center() frame:MakePopup() -- We define these here so they are accessible from the carItems -- But we don't set them up until later local previewFrame = vgui.Create("OCRP_BaseMenu") local previewDisplay = vgui.Create("DModelPanel", previewFrame) local previewColorArea = vgui.Create("DFrame", previewFrame) local carInfoArea = vgui.Create("OCRP_BaseMenu") local numcars = #OCRP_MyCars or 0 local totalcars = table.Count(GAMEMODE.OCRP_Cars) or 0 local left = totalcars - numcars surface.SetFont("TargetIDSmall") local wide,tall = surface.GetTextSize("There are " .. totalcars .. " cars total. \nYou have " .. left .. " more to purchase.") local topBox = vgui.Create("DFrame", frame) topBox:SetSize(wide+10, tall+10) topBox:SetPos(frame:GetWide()/2-(wide+10)/2, 10) topBox:ShowCloseButton(false) topBox:SetTitle("") function topBox:Paint(w,h) draw.RoundedBox(8, 0, 0, w, h, Color(25,25,25,255)) draw.DrawText("You have ".. numcars .." cars. \nYou have " .. left .. " more to purchase.", "TargetIDSmall", w/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local carList = vgui.Create("DPanelList", frame) carList:SetPos(5, tall+30) carList:SetSize(348, 430) carList:EnableVerticalScrollbar(true) carList:SetSpacing(10) carList:SetNoSizing(true) for k,v in pairs(GAMEMODE.OCRP_Cars) do local canAfford = LocalPlayer().Bank >= v.Price local owned = false for _,mycar in pairs(OCRP_MyCars) do if mycar.car == v.OtherName then owned = true end end local carItem = vgui.Create("DPanel") carItem:SetSize(320, 80) local textWide, textTall = surface.GetTextSize(v.Name) local canBuyTri = LocalPlayer():GetNWBool("CanBuyTricycle") function carItem:Paint(w,h) draw.RoundedBox(8,0,0,w,h,Color(39,168,216,255)) draw.RoundedBox(8,1,1,w-2,h-2,Color( 25, 25, 25, 255 )) draw.RoundedBox(0,80,10,1,60,Color(39,168,216,255)) draw.DrawText(v.Name, "TargetIDSmall", 80 + (w-80)/2, 10, Color(39,168,216,255), TEXT_ALIGN_CENTER) draw.RoundedBox(0, 80 + (w-80)/2 - textWide/2, 10 + textTall + 3, textWide, 1, Color(39,168,216,255)) if owned then draw.DrawText("$" .. v.Price .. " -- Owned", "TargetIDSmall", 80 + (w-80)/2, 45, Color(100,100,100,255), TEXT_ALIGN_CENTER) elseif not canBuyTri and k == "PORSCHE_TRICYCLE" then draw.DrawText("Not Unlocked", "TargetIDSmall", 80 + (w-80)/2, 45, Color(255,0,0,255), TEXT_ALIGN_CENTER) else draw.DrawText("$" .. v.Price, "TargetIDSmall", 80 + (w-80)/2, 45, canAfford and Color(255,255,255,255) or Color(255,0,0,255), TEXT_ALIGN_CENTER) end end local carIcon = vgui.Create( "SpawnIcon", carItem ) carIcon:SetSize( 70, 70 ) carIcon:SetPos( 5, 5 ) carIcon:SetModel( v.Model ) carIcon.OnMousePressed = function() previewDisplay:SetModel(v.Model) previewDisplay.Entity:SetSkin(0) previewDisplay.Entity:SetColor(Color(255,255,255,255)) previewDisplay.carTable = v previewColorArea:SetupSkins() carInfoArea:layout() end carItem.mdl = v.Model carItem.table = v carList:AddItem(carItem) end table.sort(carList.Items, function(a,b) return a.table.Price < b.table.Price end) previewDisplay.carTable = carList:GetItems()[1].table -- Preview area previewFrame:SetSize(500, 500) previewFrame:SetOCRPTitle("Car Preview") previewFrame:SetPos(frame:GetPos()-previewFrame:GetWide()-50, select(2, frame:GetPos())) previewFrame:AllowCloseButton(false) previewFrame:MakePopup() surface.SetFont("TargetIDSmall") local wide1,tall1 = surface.GetTextSize("Select a car by clicking its icon on the list.\nSelect a skin to see how it looks on a car.") local previewInfoBox = vgui.Create("DFrame", previewFrame) previewInfoBox:SetSize(wide1+10, tall1+10) previewInfoBox:SetPos(previewFrame:GetWide()/2-(wide1+10)/2, 10) previewInfoBox:ShowCloseButton(false) previewInfoBox:SetTitle("") function previewInfoBox:Paint(w,h) draw.RoundedBox(8, 0, 0, w, h, Color(25,25,25,255)) draw.DrawText("Select a car by clicking its icon on the list.\nSelect a skin to see how it looks on a car.", "TargetIDSmall", w/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER) end previewDisplay:SetPos(5, 10+tall1+10+10) previewDisplay:SetSize(490, 495 - previewDisplay:GetPos()) previewDisplay:SetCamPos(Vector(300,0,100)) previewDisplay:SetModel(carList:GetItems()[1].mdl) previewDisplay:SetLookAt(previewDisplay.Entity:GetPos()+Vector(0,0,50)) function previewDisplay:OnCursorEntered() previewDisplay:SetCursor("arrow") end local note = vgui.Create("DLabel", previewFrame) note:SetText("Above display only for reference. Respray sold separately.") note:SetFont("UiBold") note:SizeToContents() note:SetPos(previewFrame:GetWide()/2-note:GetWide()/2, previewFrame:GetTall()-note:GetTall()-5) -- Skin choosing stuff function previewColorArea:SetupSkins() self.skins = self.skins or {} for k1,v1 in pairs(self.skins) do v1:Remove() end self.skins = {} for _,color in pairs(carList:GetItems()[1].table.Skins) do local ColorPanel = vgui.Create("DButton", self) ColorPanel:SetSize(45,45) ColorPanel:SetText("") local cstring = string.gsub(color.name, " " , "_") ColorPanel.Paint = function() if type(color_table[cstring]) == "table" then surface.SetDrawColor(color_table[cstring]) surface.DrawRect(0, 0, 45, 45) else if string.find(tostring(color_table[cstring]), "skin15") then -- This texture is broken, but it's basically just (100,0,100) surface.SetDrawColor(Color(100,0,100)) surface.DrawRect(0,0,45,45) else surface.SetMaterial(color_table[cstring]) surface.DrawTexturedRect(0, 0, 45, 45) end end end ColorPanel.DoClick = function() if type(color_table[cstring]) == "table" then previewDisplay.Entity:SetSkin(0) previewDisplay:SetColor(color_table[cstring]) else previewDisplay:SetColor(Color(255,255,255)) previewDisplay.Entity:SetSkin(color.skin) end end table.insert(self.skins, ColorPanel) end local x = math.Clamp(#self.skins*50, 0, 400) local y = #self.skins <= 8 and 45 or 95 if x > 0 then self:SetSize(x+5, y+10) else surface.SetFont("UiBold") local wide2,tall2 = surface.GetTextSize("No skins available for this car") self:SetSize(wide2+10, tall2+10) end self:SetPos(previewDisplay:GetWide()/2-self:GetWide()/2, select(2, previewInfoBox:GetPos())+previewInfoBox:GetTall()+20) local i,h = 5, 5 for k,v in pairs(self.skins) do if i >= 400 then h = h + 50 i = 5 end v:SetPos(i,h) i = i + 50 end end previewColorArea:SetTitle("") previewColorArea:ShowCloseButton(false) previewColorArea:SetupSkins() function previewColorArea:Paint(w,h) if #self.skins == 0 then draw.DrawText("No skins available for this car", "UiBold", 5, 5, Color(255,255,255,255), TEXT_ALIGN_LEFT) else draw.RoundedBox(8, 0, 0, w, h, Color(39,168,216,255)) draw.RoundedBox(8, 1, 1, w-2, h-2, Color(25,25,25,255)) end end carInfoArea:SetPos(frame:GetPos()+frame:GetWide()+50, select(2, frame:GetPos())) carInfoArea:SetSize(363, 500) carInfoArea:SetOCRPTitle("Car Info") carInfoArea:AllowCloseButton(false) carInfoArea:MakePopup() local carTitle = vgui.Create("DFrame", carInfoArea) carTitle:SetTitle("") carTitle:ShowCloseButton(false) function carTitle:Paint(w,h) --draw.RoundedBox(8, 0, 0, w, h, Color(25,25,25,255)) draw.DrawText(previewDisplay.carTable.Name, "TargetIDSmall", w/2, 5, Color(39,168,216,255), TEXT_ALIGN_CENTER) draw.RoundedBox(0, 5, h-2, w-10, 1, Color(39,168,216,255)) end -- Price, Health, Speed, Gas tank, Repair cost, Seats, Respray price local desc = vgui.Create("DLabel", carInfoArea) desc:SetFont("UiBold") local priceLabel = vgui.Create("DLabel", carInfoArea) priceLabel:SetFont("Trebuchet19") priceLabel:SetTextColor(Color(255,255,255,255)) local price = vgui.Create("DLabel", carInfoArea) price:SetFont("Trebuchet19") price:SetTextColor(Color(39,168,216,255)) local seatsLabel = vgui.Create("DLabel", carInfoArea) seatsLabel:SetFont("Trebuchet19") seatsLabel:SetTextColor(Color(255,255,255,255)) local seats = vgui.Create("DLabel", carInfoArea) seats:SetFont("Trebuchet19") seats:SetTextColor(Color(39,168,216,255)) local repairLabel = vgui.Create("DLabel", carInfoArea) repairLabel:SetFont("Trebuchet19") repairLabel:SetTextColor(Color(255,255,255,255)) local repair = vgui.Create("DLabel", carInfoArea) repair:SetFont("Trebuchet19") repair:SetTextColor(Color(39,168,216,255)) local resprayLabel = vgui.Create("DLabel", carInfoArea) resprayLabel:SetFont("Trebuchet19") resprayLabel:SetTextColor(Color(255,255,255,255)) local respray = vgui.Create("DLabel", carInfoArea) respray:SetFont("Trebuchet19") respray:SetTextColor(Color(39,168,216,255)) local speedLabel = vgui.Create("DLabel", carInfoArea) speedLabel:SetFont("Trebuchet19") speedLabel:SetTextColor(Color(255,255,255,255)) local speedBar = vgui.Create("DProgress", carInfoArea) speedBar:SetSize(150, 30) local speed = vgui.Create("DLabel", carInfoArea) speed:SetFont("UiBold") speed:SetTextColor(Color(39,168,216,255)) local strengthLabel = vgui.Create("DLabel", carInfoArea) strengthLabel:SetFont("Trebuchet19") strengthLabel:SetTextColor(Color(255,255,255,255)) local strengthBar = vgui.Create("DProgress", carInfoArea) strengthBar:SetSize(150, 30) local strength = vgui.Create("DLabel", carInfoArea) strength:SetFont("UiBold") strength:SetTextColor(Color(39,168,216,255)) local gasLabel = vgui.Create("DLabel", carInfoArea) gasLabel:SetFont("Trebuchet19") gasLabel:SetTextColor(Color(255,255,255,255)) local gasBar = vgui.Create("DProgress", carInfoArea) gasBar:SetSize(150, 30) local gas = vgui.Create("DLabel", carInfoArea) gas:SetFont("UiBold") gas:SetTextColor(Color(39,168,216,255)) function carInfoArea:layout() local ct = previewDisplay.carTable surface.SetFont("TargetIDSmall") local titleWide,titleTall = surface.GetTextSize(previewDisplay.carTable.Name) carTitle:SetSize(titleWide+10, titleTall+10) carTitle:SetPos(self:GetWide()/2-carTitle:GetWide()/2, 10) desc:SetText("\"" .. ct.Desc .. "\"") desc:SizeToContents() desc:SetPos(self:GetWide()/2-desc:GetWide()/2, 50) priceLabel:SetText("Price: $" .. ct.Price) -- Size with price but then remove priceLabel:SizeToContents() priceLabel:SetText("Price:") priceLabel:SetPos(self:GetWide()/2-priceLabel:GetWide()/2, 80) surface.SetFont("Trebuchet19") local sxwide = surface.GetTextSize("Price:") local sx = priceLabel:GetPos() + sxwide price:SetText("$" .. ct.Price) price:SizeToContents() price:SetPos(priceLabel:GetPos()+50, 80) seatsLabel:SetText("Number of Seats:") seatsLabel:SizeToContents() seatsLabel:SetPos(sx - seatsLabel:GetWide(), 120) seats:SetText(ct.SeatsNum) seats:SizeToContents() seats:SetPos(186, 120) repairLabel:SetText("Cost to Fully Repair:") repairLabel:SizeToContents() repairLabel:SetPos(sx - repairLabel:GetWide(), 160) repair:SetText("$" .. ct.RepairCost) repair:SizeToContents() repair:SetPos(186, 160) resprayLabel:SetText("Cost to Respray:") resprayLabel:SizeToContents() resprayLabel:SetPos(sx-resprayLabel:GetWide(), 200) respray:SetText("$" .. ct.Skin_Price) respray:SizeToContents() respray:SetPos(186, 200) speedLabel:SetText("Max Speed: ") speedLabel:SizeToContents() speedLabel:SetPos(20, 250) speedBar:SetFraction(ct.Speed/130) speedBar:SetPos(20+speedLabel:GetWide()+20, 244) speed:SetText(ct.Speed .. " MPH") speed:SizeToContents() speed:SetPos(speedBar:GetPos()+speedBar:GetWide()+20, 252) strengthLabel:SetText("Strength: ") strengthLabel:SizeToContents() strengthLabel:SetPos(20, 300) strengthBar:SetFraction(ct.Health/225) strengthBar:SetPos(20+speedLabel:GetWide()+20, 294) strength:SetText(ct.Health .. " HP") strength:SizeToContents() strength:SetPos(strengthBar:GetPos()+strengthBar:GetWide()+20, 302) gasLabel:SetText("Gas Tank: ") gasLabel:SizeToContents() gasLabel:SetPos(20, 350) gasBar:SetFraction(ct.GasTank/1000) gasBar:SetPos(20+speedLabel:GetWide()+20, 344) gas:SetText(ct.GasTank .. " Liters") gas:SizeToContents() gas:SetPos(gasBar:GetPos()+gasBar:GetWide()+20, 352) end carInfoArea:layout() local buy = vgui.Create("OCRP_BaseButton", carInfoArea) buy:SetText("Purchase Car") buy:SetSize(200, 30) buy:SetPos(carInfoArea:GetWide()/2-buy:GetWide()/2, 425) function buy:DoClick() for k,v in pairs(OCRP_MyCars) do if v.car == previewDisplay.carTable.OtherName then OCRP_AddHint("You already own this car!") return end end if LocalPlayer().Bank < previewDisplay.carTable.Price then OCRP_AddHint("You don't have enough in your bank for this car.") return end AreYouSure(previewDisplay.carTable.OtherName, previewDisplay.carTable.Price, previewDisplay.carTable.Name, frame) end function RemoveWholeMenu() if frame and frame:IsValid() then frame:Remove() end if previewFrame and previewFrame:IsValid() then previewFrame:Remove() end if carInfoArea and carInfoArea:IsValid() then carInfoArea:Remove() end end -- Only frame has a button for the time being frame.Close.DoClick = RemoveWholeMenu previewFrame.Close.DoClick = RemoveWholeMenu carInfoArea.Close.DoClick = RemoveWholeMenu end function AreYouSure(car, price, name, base) local frame = vgui.Create("OCRP_BaseMenu") frame:SetSize(250, 110) frame:Center() frame:MakePopup() local start = SysTime() function frame:Paint(w,h) Derma_DrawBackgroundBlur(self, start) draw.RoundedBox(4, 0, 0, w, h, Color(0,0,0,255)) draw.RoundedBox(4, 1, 1, w-2, h-2, Color(25,25,25,255)) draw.DrawText("Are you sure?", "TargetIDSmall", w/2, 10, Color(39,168,216,255), TEXT_ALIGN_CENTER) draw.DrawText("Buying: " .. name, "UiBold", w/2, 30, Color(255,255,255,255), TEXT_ALIGN_CENTER) draw.DrawText("For: $" .. price, "UiBold", w/2, 45, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local yes = vgui.Create("OCRP_BaseButton", frame) yes:SetText("Yes") yes:SetSize(75, 20) yes:SetPos(33, 75) function yes:DoClick() net.Start("OCRP_BuyCar") net.WriteString(car) net.SendToServer() frame:Remove() base.Close:DoClick() end local no = vgui.Create("OCRP_BaseButton", frame) no:SetText("No") no:SetSize(75, 20) no:SetPos(141, 75) function no:DoClick() frame:Remove() end end net.Receive("OCRP_ShowCarDealer", function() CarDealerMenu() end) function OpenGarageMenu() local frame = vgui.Create("OCRP_BaseMenu") frame:SetSize(363, 500) frame:SetOCRPTitle("Your Garage") frame:Center() frame:MakePopup() local numcars = #OCRP_MyCars or 0 local totalcars = table.Count(GAMEMODE.OCRP_Cars) or 0 local left = totalcars - numcars surface.SetFont("TargetIDSmall") local wide,tall = surface.GetTextSize("You have ".. numcars .." cars. \nYou have " .. left .. " more to purchase. \nYour current car is: " .. OCRP_CurCar) local topBox = vgui.Create("DFrame", frame) topBox:SetSize(wide+10, tall+10) topBox:SetPos(frame:GetWide()/2-(wide+10)/2, 10) topBox:ShowCloseButton(false) topBox:SetTitle("") function topBox:Paint(w,h) draw.RoundedBox(8, 0, 0, w, h, Color(25,25,25,255)) draw.DrawText("You have ".. numcars .." cars. \nYou have " .. left .. " more to purchase. \nYour current car is: " .. OCRP_CurCar, "TargetIDSmall", w/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local carList = vgui.Create("DPanelList", frame) carList:SetPos(5, tall+30) carList:SetSize(348, 415) carList:EnableVerticalScrollbar(true) carList:SetSpacing(10) carList:SetNoSizing(true) for k,v in pairs(OCRP_MyCars) do if v.car then local carItem = vgui.Create("DPanel") carItem:SetSize(320, 80) local hp = LocalPlayer():GetNWInt("Health_" .. v.car, GAMEMODE.OCRP_Cars[v.car].Health) local maxhp = GAMEMODE.OCRP_Cars[v.car].Health local perHp = math.Clamp(math.ceil(hp/maxhp*100), 0, 100) local gas = LocalPlayer():GetNWInt("Gas_" .. v.car, GAMEMODE.OCRP_Cars[v.car].GasTank) local maxGas = GAMEMODE.OCRP_Cars[v.car].GasTank local perGas = math.Clamp(math.ceil(gas/maxGas*100), 0, 100) local textWide, textTall = surface.GetTextSize(GAMEMODE.OCRP_Cars[v.car].Name) local textWide2, textTall2 = surface.GetTextSize("Health: " .. perHp .. "%") function carItem:Paint(w,h) draw.RoundedBox(8,0,0,w,h,Color(39,168,216,255)) draw.RoundedBox(8,1,1,w-2,h-2,Color( 25, 25, 25, 255 )) draw.RoundedBox(0,80,10,1,60,Color(39,168,216,255)) draw.DrawText(GAMEMODE.OCRP_Cars[v.car].Name, "TargetIDSmall", 80 + (w-80)/2, 10, Color(39,168,216,255), TEXT_ALIGN_CENTER) draw.RoundedBox(0, 80 + (w-80)/2 - textWide/2, 10 + textTall + 3, textWide, 1, Color(39,168,216,255)) draw.DrawText("Health: " .. perHp .. "%", "TargetIDSmall", 80 + (w-80)/2, 10+textTall+8, perHp > 0 and Color(255,255,255,255) or Color(255,0,0,255), TEXT_ALIGN_CENTER) draw.DrawText("Gas: " .. perGas .. "%", "TargetIDSmall", 80 + (w-80)/2, 10+textTall+8+textTall2+2, perGas > 0 and Color(255,255,255,255) or Color(255,0,0,255), TEXT_ALIGN_CENTER) end local mdl = GAMEMODE.OCRP_Cars[v.car].Model if type(mdl) == "table" then mdl = GAMEMODE.OCRP_Cars[v.car].Model[1] end local carIcon = vgui.Create( "SpawnIcon", carItem ) carIcon:SetSize( 70, 70 ) carIcon:SetPos( 5, 5 ) carIcon:SetModel( mdl ) carIcon.OnMousePressed = function() net.Start("OCRP_SC") net.WriteString(v.car) net.SendToServer() frame:Remove() end carList:AddItem(carItem) end end while #carList:GetItems() < 5 do local filler = vgui.Create("DPanel") filler:SetSize(320, 80) filler.Paint = function() end carList:AddItem(filler) end end net.Receive("OCRP_OpenGarage", function() OpenGarageMenu() end) function OpenSkinMenu(car) if not GAMEMODE.OCRP_Cars[car] then OCRP_AddHint("This car does not have any skins available!") return end local frame = vgui.Create("OCRP_BaseMenu") frame:SetSize(400, 375) frame:SetOCRPTitle("Respray Choices") frame:Center() frame:AllowCloseButton(true) frame:MakePopup() surface.SetFont("Trebuchet19") local infotext = "A respray for this vehicle costs $" .. GAMEMODE.OCRP_Cars[car].Skin_Price or 5000 local textw,texth = surface.GetTextSize(infotext) local info = vgui.Create("DFrame", frame) info:ShowCloseButton(false) info:SetTitle("") info:SetSize(textw+10, texth+10) info:SetPos(frame:GetWide()/2-info:GetWide()/2, 10) function info:Paint(w,h) draw.RoundedBox(8,0,0,w,h,Color(25,25,25,255)) draw.DrawText(infotext, "Trebuchet19", w/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local skinlist = vgui.Create("DPanelList", frame) skinlist:SetSize(380, 310) skinlist:SetPos(frame:GetWide()/2-skinlist:GetWide()/2, 55) skinlist:EnableVerticalScrollbar(true) skinlist:SetSpacing(10) skinlist:SetNoSizing(true) for k,v in pairs(GAMEMODE.OCRP_Cars[car].Skins) do local skinitem = vgui.Create("DPanel") skinitem:SetSize(350, 60) for i=1,2 do local color = vgui.Create("DPanel", skinitem) color:SetSize(50,50) local cstring = string.gsub(v.name, " " , "_") function color:Paint(w,h) if type(color_table[cstring]) == "table" then surface.SetDrawColor(color_table[cstring]) surface.DrawRect(0, 0, w, h) else if string.find(tostring(color_table[cstring]), "skin15") then -- This texture is broken, but it's basically just (100,0,100) surface.SetDrawColor(Color(100,0,100)) surface.DrawRect(0,0,w,h) else surface.SetMaterial(color_table[cstring]) surface.DrawTexturedRect(0, 0, w, h) end end end if i == 1 then color:SetPos(5,5) elseif i == 2 then color:SetPos(skinitem:GetWide()-color:GetWide()-5, 5) end end function skinitem:Paint(w,h) draw.RoundedBox(8, 0, 0, w, h, Color(39,168,216,255)) draw.RoundedBox(8, 1, 1, w-2,h-2, Color(25,25,25,255)) --draw.DrawText(v.name, "UiBold", w/2, 25, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local buy = vgui.Create("OCRP_BaseButton", skinitem) buy:SetSize(180, 30) buy:SetPos(skinitem:GetWide()/2-buy:GetWide()/2, skinitem:GetTall()/2-buy:GetTall()/2) buy:SetText("Purchase " .. v.name) function buy:DoClick() net.Start("ocrp_bskin") net.WriteInt(k, 32) net.SendToServer() frame:Remove() end skinlist:AddItem(skinitem) end end net.Receive("OCRP_Open_Skins", function() local car = net.ReadString() OpenSkinMenu(car) end) function ShowColors(kind) local frame = vgui.Create("OCRP_BaseMenu") frame:SetSize(400, 375) frame:SetOCRPTitle(kind .. " Colors") frame:Center() frame:MakePopup() local cost = "$50000" if kind == "Underglow" then cost = "$15000" end surface.SetFont("Trebuchet19") local infotext = "Colors for this vehicle cost " .. cost .. " each." local textw,texth = surface.GetTextSize(infotext) local info = vgui.Create("DPanel", frame) info:SetSize(textw+10, texth+10) info:SetPos(frame:GetWide()/2-info:GetWide()/2, 10) function info:Paint(w,h) draw.RoundedBox(8,0,0,w,h,Color(25,25,25,255)) draw.DrawText(infotext, "Trebuchet19", w/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local colorlist = vgui.Create("DPanelList", frame) colorlist:SetSize(380, 310) colorlist:SetPos(frame:GetWide()/2-colorlist:GetWide()/2, 55) colorlist:EnableVerticalScrollbar(true) colorlist:SetSpacing(10) colorlist:SetNoSizing(true) local colors = {"Blue", "Green", "Red", "Ice", "Purple", "White", "Orange", "Yellow", "Pink"} for _,color in pairs(colors) do local coloritem = vgui.Create("DPanel") coloritem:SetSize(350, 60) for i=1,2 do local colordisplay = vgui.Create("DPanel", coloritem) colordisplay:SetSize(50,50) function colordisplay:Paint(w,h) surface.SetDrawColor(StringToColor(color)) surface.DrawRect(0, 0, w, h) end if i == 1 then colordisplay:SetPos(5,5) elseif i == 2 then colordisplay:SetPos(coloritem:GetWide()-colordisplay:GetWide()-5, 5) end end function coloritem:Paint(w,h) draw.RoundedBox(8, 0, 0, w, h, Color(39,168,216,255)) draw.RoundedBox(8, 1, 1, w-2,h-2, Color(25,25,25,255)) --draw.DrawText(v.name, "UiBold", w/2, 25, Color(255,255,255,255), TEXT_ALIGN_CENTER) end local buy = vgui.Create("OCRP_BaseButton", coloritem) buy:SetSize(180, 30) buy:SetPos(coloritem:GetWide()/2-buy:GetWide()/2, coloritem:GetTall()/2-buy:GetTall()/2) buy:SetText("Purchase " .. color) function buy:DoClick() if kind == "Underglow" then net.Start("OCRP_Buy_UG") else net.Start("OCRP_Buy_Headlights") end net.WriteString(color) net.SendToServer() frame:Remove() end colorlist:AddItem(coloritem) end end function StringToColor(colorstring) local color1 = Color(0,0,0,255) if colorstring == "Blue" then color1.r = 0 color1.g = 0 color1.b = 255 elseif colorstring == "Green" then color1.r = 0 color1.g = 204 color1.b = 0 elseif colorstring == "Red" then color1.r = 204 color1.g = 0 color1.b = 0 elseif colorstring == "Ice" then color1.r = 0 color1.g = 50 color1.b = 150 elseif colorstring == "Purple" then color1.r = 145 color1.g = 0 color1.b = 255 elseif colorstring == "Orange" then color1.r = 255 color1.g = 152 color1.b = 44 elseif colorstring == "Yellow" then color1.r = 220 color1.g = 220 color1.b = 0 elseif colorstring == "White" then color1.r = 255 color1.g = 255 color1.b = 255 elseif colorstring == "Pink" then color1.r = 255 color1.g = 130 color1.b = 255 end return color1 end function CL_UpdateGas( umsg ) local gas = umsg:ReadLong() OCRP_VehicleGas = gas end usermessage.Hook("OCRP_UpdateGas", CL_UpdateGas) function GM.CarAlarm ( UMsg ) local Entity = UMsg:ReadEntity(); if !Entity or !Entity:IsValid() then return false; end if !Entity:GetTable().CarAlarmLoop then Entity:GetTable().CarAlarmLoop = CreateSound(Entity, Sound('ocrp/car_alarm.mp3')); Entity:GetTable().CarAlarmLoop_LastPlay = 0; end if Entity:GetTable().CarAlarmLoop_LastPlay + 25 < CurTime() then Entity:GetTable().CarAlarmLoop:Play(); Entity:GetTable().CarAlarmLoop_LastPlay = CurTime(); end end usermessage.Hook('car_alarm', GM.CarAlarm); function GM.CarAlarmStop ( UMsg ) local Entity = UMsg:ReadEntity(); if !Entity or !Entity:IsValid() then return false; end if Entity:GetTable().CarAlarmLoop_LastPlay and Entity:GetTable().CarAlarmLoop_LastPlay + 23 > CurTime() then Entity:GetTable().CarAlarmLoop:Stop(); Entity:GetTable().CarAlarmLoop_LastPlay = 0; end end usermessage.Hook('car_alarm_stop', GM.CarAlarmStop);
local function isModuleAvailable(name) if package.loaded[name] then return true else for _, searcher in ipairs(package.searchers or package.loaders) do local loader = searcher(name) if type(loader) == 'function' then package.preload[name] = loader return true end end return false end end local loadIfExists = function (module) if isModuleAvailable(module) then require(module) end end loadIfExists('custom')
local theme_assets = require("beautiful.theme_assets") local xresources = require("beautiful.xresources") local dpi = xresources.apply_dpi local gears = require("gears") local gfs = require("gears.filesystem") local themes_path = gfs.get_themes_dir() local theme = {} theme.font_family = "JetBrains Mono Regular" theme.font = theme.font_family.." 8" theme.icon_font = "Symbols Nerd Font" -- wibar stuff theme.icon_v_padding = dpi(5) theme.icon_h_padding = dpi(5) theme.wibar_spacing = dpi(25) theme.wibar_height = dpi(25) theme.wibar_border_width = 0 theme.transparent = "#00000000" -- systray theme.systray_icon_spacing = theme.wibar_spacing -- time widget theme.hour_widget_fg = "#c83349" theme.minute_widget_fg = "#5b9aa0" theme.second_widget_fg = "#622569" theme.meridiem_widget_fg = "#f2ae72" -- calendar widget theme.day_name_widget_fg = "#8b6f47" theme.day_number_widget_fg = "#c94c4c" theme.month_name_widget_fg = "#485f6a" -- weather widget theme.weather_temperature_fg = "#c1502e" theme.weather_text_fg = "#bd5734" -- buttons and default theme.button_hover_fg = "#c94c4c" theme.bg_normal = "#00000000" theme.bg_focus = "#00000018" theme.bg_urgent = "#00000000" theme.bg_minimize = "#00000000" theme.fg_normal = "#000000" theme.fg_focus = "#000000" theme.fg_urgent = "#e53935" theme.fg_minimize = "#000000" theme.hotkeys_fg = "#223238" theme.hotkeys_bg = "#e4e4e4" theme.tooltip_fg = "#223238" theme.tooltip_bg = "#e4e4e4" theme.tooltip_border_color = "#b3b3b3" theme.tooltip_border_width = 1 theme.progressbar_bg = "#e4e4e4" theme.progressbar_fg = theme.fg_normal theme.progressbar_border_color = "#808080" theme.progressbar_border_width = 1 theme.gap_single_client = true theme.useless_gap = 10 theme.border_width = dpi(1) theme.border_normal = "#b3b3b3" theme.border_focus = "#b3b3b3" theme.border_marked = "#e53935" theme.titlebar_size = dpi(20) theme.titlebar_fg = theme.fg_normal theme.titlebar_bg = "#00000000" theme.titlebar_fg_focus = theme.fg_normal theme.titlebar_bg_focus = "#e4e4e4" theme.titlebar_fg_normal = theme.fg_normal theme.titlebar_bg_normal = "#e4e4e4" theme.tasklist_bg_focus = "#e4e4e4" theme.tasklist_plain_task_name = true theme.taglist_fg_focus = "#808080" theme.taglist_bg_focus = "#223238" theme.taglist_bg_urgent = "#e53935" theme.icon_path = "/home/lenny/.config/awesome/assets/" theme.theme = { day = { bg = "#e0e2e4", fg = "#3e515b", hour = "#c83349", minute = "#5b9aa0", second = "#622569", meridiem = "#f2ae72", day_number = "#c94c4c", weather_cond = "#bd5734", weather_temp = "#c1502e", meridian = "#f2ae72", day_name = "#8b6f47", month_name = "#485f6a", hover = "#c94c4c", progressbar_bg = "#e0e2e4", progressbar_fg = "#3e515b", bar_bg = "#e0e2e4", bar_fg = "#263238", }, night = { bg = "#282b30", fg = "#e3e6e8", hour = "#eca1a6", minute = "#b5e7a0", second = "#fefbd8", meridiem = "#b2c2bf", day_number = "#c94c4c", weather_cond = "#dac292", weather_temp = "#f18973", meridian = "#b2c2bf", day_name = "#fefbd8", month_name = "#eceff1", hover = "#c94c4c", progressbar_bg = "#282b30", progressbar_fg = "#e3e6e8", bar_bg = "#282b30", bar_fg = "#e3e6e8", } } theme.snap_shape = gears.shape.rectangle theme.snap_border_width = 1 -- Variables set for theming notifications: theme.notification_margin = dpi(10) theme.notification_font = theme.font theme.notification_border_width = 0 theme.notification_border_color = theme.border_normal theme.notification_icon_size = dpi(100) theme.notification_icon_resize_strategy = "center" -- Variables set for theming the menu theme.menu_submenu_icon = themes_path.."default/submenu.png" theme.menu_fg = "#223238" theme.menu_bg = "#e4e4e4" theme.menu_fg_normal = "#223238" theme.menu_bg_normal = "#e4e4e4" theme.menu_height = dpi(15) theme.menu_width = dpi(100) -- titlebar stuff theme.titlebar_button_size = 20 theme.color_idle_normal = "#98989d" theme.color_idle_focus = "#848489" theme.titlebar_close_focus = "#ff443a" theme.titlebar_close_normal = theme.color_idle_normal theme.titlebar_maximized_focus_inactive = "#6ac4dc" theme.titlebar_maximized_normal_inactive = theme.color_idle_normal theme.titlebar_maximized_focus_active = "#6ac4dc" theme.titlebar_maximized_normal_active = theme.color_idle_normal theme.titlebar_sticky_focus_inactive = theme.color_idle_focus theme.titlebar_sticky_normal_inactive = theme.color_idle_normal theme.titlebar_sticky_focus_active = "#ff9d0a" theme.titlebar_sticky_normal_active = "#ff9d0a" theme.titlebar_floating_focus_inactive = "#0a84ff" theme.titlebar_floating_normal_inactive = theme.color_idle_normal theme.titlebar_floating_focus_active = "#0a84ff" theme.titlebar_floating_normal_active = theme.color_idle_normal theme.overline_color = "#808080" theme.wallpaper = "/home/lenny/Pictures/wallpaper.png" local layout_path = "/home/lenny/.config/awesome/assets/layouts/" -- {{{ Calendar stuff theme.calendar_year_bg_color = "#e4e4e4" theme.calendar_month_bg_color = "#e4e4e4" theme.calendar_yearheader_bg_color = "#e4e4e4" theme.calendar_header_bg_color = "#e4e4e4" theme.calendar_weekday_bg_color = "#e4e4e4" theme.calendar_normal_bg_color = "#e4e4e4" theme.calendar_focus_bg_color = "#808080" theme.calendar_year_border_width = 1 theme.calendar_month_border_width = 1 theme.calendar_yearheader_border_width = 1 theme.calendar_header_border_width = 1 theme.calendar_weekday_border_width = 1 theme.calendar_normal_border_width = 1 theme.calendar_focus_border_width = 1 theme.calendar_year_border_color = "#b3b3b3" theme.calendar_month_border_color = "#b3b3b3" theme.calendar_yearheader_border_color = "#e4e4e4" theme.calendar_header_border_color = "#e4e4e4" theme.calendar_weekday_border_color = "#e4e4e4" theme.calendar_normal_border_color = "#e4e4e4" theme.calendar_focus_border_color = "#b3b3b3" theme.calendar_focus_markup = "<b>%s</b>" theme.calendar_focus_fg_color = "#e4e4e4" theme.calendar_yearheader_shape = gears.shape.rounded_bar theme.calendar_header_shape = gears.shape.rounded_bar theme.calendar_weekday_shape = gears.shape.rounded_bar theme.calendar_normal_shape = gears.shape.rounded_bar theme.calendar_focus_shape = gears.shape.rect theme.calendar_year_padding = dpi(10) theme.calendar_month_padding = dpi(10) -- }}} -- default awful related -- https://epsi-rns.github.io/desktop/2019/10/22/awesome-theme-layout.html theme.layout_dwindle = layout_path .. "dwindle.png" theme.layout_fairh = layout_path .. "fairh.png" theme.layout_fairv = layout_path .. "fairv.png" theme.layout_floating = layout_path .. "floating.png" theme.layout_magnifier = layout_path .. "magnifier.png" theme.layout_max = layout_path .. "max.png" theme.layout_spiral = layout_path .. "spiral.png" theme.layout_tilebottom = layout_path .. "tilebottom.png" theme.layout_tileleft = layout_path .. "tileleft.png" theme.layout_tile = layout_path .. "tile.png" theme.layout_tiletop = layout_path .. "tiletop.png" theme.layout_fullscreen = layout_path .. "fullscreen.png" theme.layout_cornernw = layout_path .. "cornernw.png" theme.layout_cornerne = layout_path .. "cornerne.png" theme.layout_cornersw = layout_path .. "cornersw.png" theme.layout_cornerse = layout_path .. "cornerse.png" -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon( theme.menu_height, theme.bg_normal, theme.fg_normal) -- Define the icon theme for application icons. If not set then the icons -- from /usr/share/icons and /usr/share/icons/hicolor will be used. theme.icon_theme = nil return theme -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
TOOL.Category = "Resource Distribution" TOOL.Name = "#Resource Valves" TOOL.DeviceName = "Resource Valve" TOOL.DeviceNamePlural = "Resource Valves" TOOL.ClassName = "valves" TOOL.DevSelect = true TOOL.CCVar_type = "rd_ent_valve" TOOL.CCVar_sub_type = "normal" TOOL.CCVar_model = "models/ResourcePump/resourcepump.mdl" TOOL.Limited = true TOOL.LimitName = "valves" TOOL.Limit = 10 CAFToolSetup.SetLang("RD Resource Valves", "Create Resource Valves attached to any surface.", "Left-Click: Spawn a Device. Reload: Repair Device.") TOOL.ExtraCCVars = {} local function resource_valve_func(ent, type, sub_type, devinfo, Extra_Data, ent_extras) local volume_mul = 1 --Change to be 0 by default later on local base_volume = 2272 local base_mass = 10 local base_health = 50 local phys = ent:GetPhysicsObject() if phys:IsValid() then volume_mul = math.Round(phys:GetVolume()) / base_volume end local mass = math.Round(base_mass * volume_mul) local maxhealth = math.Round(base_health * volume_mul) return mass, maxhealth end TOOL.Devices = { rd_ent_valve = { Name = "Entity <-> Resource Node valve", type = "rd_ent_valve", class = "rd_ent_valve", func = resource_valve_func, devices = { normal = { Name = "Default", model = "models/ResourcePump/resourcepump.mdl", }, normal_2 = { Name = "CE Valve", model = "models/ce_ls3additional/resource_pump/resource_pump.mdl", }, }, }, rd_node_valve = { Name = "Resource Node <-> Resource Node (2-way) valve", type = "rd_node_valve", class = "rd_node_valve", func = resource_valve_func, devices = { normal = { Name = "Default", model = "models/ResourcePump/resourcepump.mdl", }, normal_2 = { Name = "CE Valve", model = "models/ce_ls3additional/resource_pump/resource_pump.mdl", }, }, }, rd_one_way_valve = { Name = "Resource Node -> Resource Node (1-way) valve", type = "rd_one_way_valve", class = "rd_one_way_valve", func = resource_valve_func, devices = { normal = { Name = "Default", model = "models/ResourcePump/resourcepump.mdl", }, normal_2 = { Name = "CE Valve", model = "models/ce_ls3additional/resource_pump/resource_pump.mdl", }, }, }, }
function AgiSteal( keys ) local hero = keys.target local caster = keys.caster local ability = keys.ability local AGIMultiplier = ability:GetLevelSpecialValueFor("agi_steal_multiplier", (ability:GetLevel() - 1)) local heroAGI = hero:GetLevel() local AGIGain = heroAGI * AGIMultiplier local currentAGI = caster:GetModifierStackCount("modifier_agility_bonus", ability) local nextAGI = AGIGain + currentAGI if not caster:HasModifier("modifier_agility_bonus") then ability:ApplyDataDrivenModifier(caster, caster, "modifier_agility_bonus", {}) end caster:SetModifierStackCount("modifier_agility_bonus", caster, nextAGI) end
-- Configurations --- plc_prompt_type is whether the displayed prompt is the full path or only the folder name -- Use: -- "full" for full path like C:\Windows\System32 local promptTypeFull = "full" -- "folder" for folder name only like System32 local promptTypeFolder = "folder" -- "smart" to switch in git repo to folder name instead of full path local promptTypeSmart = "smart" -- default is promptTypeFull -- Set default value if no value is already set if not plc_prompt_type then plc_prompt_type = promptTypeFull end if not plc_prompt_useHomeSymbol then plc_prompt_useHomeSymbol = true end -- Extracts only the folder name from the input Path -- Ex: Input C:\Windows\System32 returns System32 --- local function get_folder_name(path) local reversePath = string.reverse(path) local slashIndex = string.find(reversePath, "\\") return string.sub(path, string.len(path) - slashIndex + 2) end -- * Segment object with these properties: ---- * isNeeded: sepcifies whether a segment should be added or not. For example: no Git segment is needed in a non-git folder ---- * text ---- * textColor: Use one of the color constants. Ex: colorWhite ---- * fillColor: Use one of the color constants. Ex: colorBlue local segment = { isNeeded = true, text = "", textColor = colorWhite, fillColor = colorBlue } --- -- Sets the properties of the Segment object, and prepares for a segment to be added --- local function init() -- fullpath cwd = clink.get_cwd() -- show just current folder if plc_prompt_type == promptTypeFolder then cwd = get_folder_name(cwd) else -- show 'smart' folder name -- This will show the full folder path unless a Git repo is active in the folder -- If a Git repo is active, it will only show the folder name -- This helps users avoid having a super long prompt local git_dir = get_git_dir() -- a = cwd -- b = clink.get_env("HOME") homedir = string.gsub(clink.get_env("HOME"), "%-", "%%-") if plc_prompt_useHomeSymbol and string.find(cwd, homedir) then -- in both smart and full if we are in home, behave like a proper command line cwd = string.gsub(cwd, homedir, plc_prompt_homeSymbol) end if git_dir == nil then -- either not in home or home not supported then check the smart path if plc_prompt_type == promptTypeSmart then if git_dir then cwd = get_folder_name(cwd) if plc_npm_gitSymbol then cwd = gitSymbol.." "..cwd end end -- if not git dir leave the full path end end end segment.text = " "..cwd.." " end --- -- Uses the segment properties to add a new segment to the prompt --- local function addAddonSegment() init() addSegment(segment.text, segment.textColor, segment.fillColor) end -- Register this addon with Clink clink.prompt.register_filter(addAddonSegment, 55)
-- Addon: PersonalAssistant -- Developer: Klingo PA = {} PA.AddonVersion = "1.8.2" -- 1.3.3 fix -- http://www.esoui.com/forums/showthread.php?t=2054 -- http://www.esoui.com/forums/showthread.php?t=1944 -- TODO: -- Update Currency System: https://forums.elderscrollsonline.com/en/discussion/200789/imperial-city-api-patch-notes-change-log-live/p1 -- Support Virtual Bags: https://forums.elderscrollsonline.com/en/discussion/261946/dark-brotherhood-api-patch-notes-change-log-pts -- Support Specialized Item Types: https://forums.elderscrollsonline.com/en/discussion/261946/dark-brotherhood-api-patch-notes-change-log-pts -- default values PA.General_Defaults = {} PA.Profiles_Defaults = {} PA.Repair_Defaults = {} PA.Banking_Defaults = {} PA.Loot_Defaults = {} PA.Junk_Defaults = {} -- init saved variables and register Addon function PA.initAddon(eventCode, addOnName) if addOnName ~= "PersonalAssistant" then return end -- initialize the default values PA.initDefaults() -- gets values from SavedVars, or initialises with default values PA_SavedVars.General = ZO_SavedVars:New("PersonalAssistant_SavedVariables", 1, "General", PA.General_Defaults) PA_SavedVars.Profiles = ZO_SavedVars:New("PersonalAssistant_SavedVariables", 1, "Profiles", PA.Profiles_Defaults) PA_SavedVars.Repair = ZO_SavedVars:New("PersonalAssistant_SavedVariables", 2, "Repair", PA.Repair_Defaults) PA_SavedVars.Banking = ZO_SavedVars:New("PersonalAssistant_SavedVariables", 2, "Banking", PA.Banking_Defaults) PA_SavedVars.Loot = ZO_SavedVars:New("PersonalAssistant_SavedVariables", 1, "Loot", PA.Loot_Defaults) PA_SavedVars.Junk = ZO_SavedVars:New("PersonalAssistant_SavedVariables", 1, "Junk", PA.Junk_Defaults) -- set the language PA_SavedVars.General.language = GetCVar("language.2") or "en" --returns "en", "de" or "fr" -- register Event Dispatcher for: PARepair and PAJunk EVENT_MANAGER:RegisterForEvent("PersonalAssistant", EVENT_OPEN_STORE, PAED.EventOpenStore) -- register PABanking EVENT_MANAGER:RegisterForEvent("PersonalAssistant", EVENT_OPEN_BANK, PAB.OnBankOpen) EVENT_MANAGER:RegisterForEvent("PersonalAssistant", EVENT_CLOSE_BANK, PAB.OnBankClose) -- register PALoot ZO_PreHookHandler(RETICLE.interact, "OnEffectivelyShown", PALo.OnReticleTargetChanged) EVENT_MANAGER:RegisterForEvent("PersonalAssistant", EVENT_LOOT_UPDATED, PALo.OnLootUpdated) -- register PAJunk EVENT_MANAGER:RegisterForEvent("PersonalAssistant", EVENT_INVENTORY_SINGLE_SLOT_UPDATE, PAJ.OnInventorySingleSlotUpdate) -- add hook for contextMenu modification -- ZO_PreHook("ZO_InventorySlot_ShowContextMenu", PAJ.AddContextMenuOption) -- addon load complete - unregister event EVENT_MANAGER:UnregisterForEvent("PersonalAssistant_AddonLoaded", EVENT_ADD_ON_LOADED) end -- init default values function PA.initDefaults() for profileNo = 1, PAG_MAX_PROFILES do -- initialize the multi-profile structure -- default values for Addon PA.General_Defaults.language = 1 PA.General_Defaults.activeProfile = 1 PA.General_Defaults.savedVarsVersion = "" -- ----------------------------------------------------- -- default values for PAGeneral PA.General_Defaults[profileNo] = {} PA.General_Defaults[profileNo].welcome = true -- ----------------------------------------------------- -- default values for Profiles PA.Profiles_Defaults[profileNo] = {} PA.Profiles_Defaults[profileNo].name = MenuHelper.getDefaultProfileName(profileNo) -- ----------------------------------------------------- -- default values for PARepair PA.Repair_Defaults[profileNo] = {} PA.Repair_Defaults[profileNo].enabled = true PA.Repair_Defaults[profileNo].equipped = true PA.Repair_Defaults[profileNo].equippedThreshold = 75 PA.Repair_Defaults[profileNo].backpack = false PA.Repair_Defaults[profileNo].backpackThreshold = 75 PA.Repair_Defaults[profileNo].hideNoRepairMsg = false PA.Repair_Defaults[profileNo].hideAllMsg = false -- ----------------------------------------------------- -- default values for PABanking PA.Banking_Defaults[profileNo] = { ItemTypes = {}, ItemTypesAdvanced = {} } PA.Banking_Defaults[profileNo].enabled = true PA.Banking_Defaults[profileNo].gold = true PA.Banking_Defaults[profileNo].goldDepositInterval = 300 PA.Banking_Defaults[profileNo].goldDepositPercentage = 50 PA.Banking_Defaults[profileNo].goldTransactionStep = "1" PA.Banking_Defaults[profileNo].goldMinToKeep = 250 PA.Banking_Defaults[profileNo].goldWithdraw = false PA.Banking_Defaults[profileNo].goldLastDeposit = 0 PA.Banking_Defaults[profileNo].items = false PA.Banking_Defaults[profileNo].itemsDepStackType = PAB_STACKING_FULL PA.Banking_Defaults[profileNo].itemsWitStackType = PAB_STACKING_FULL PA.Banking_Defaults[profileNo].itemsTimerInterval = 300 PA.Banking_Defaults[profileNo].itemsJunkSetting = PAC_ITEMTYPE_IGNORE PA.Banking_Defaults[profileNo].hideNoDepositMsg = false PA.Banking_Defaults[profileNo].hideAllMsg = false -- default values for ItemTypes (only prepare defaults for enabled itemTypes) -- deposit=true, withdrawal=false for i = 1, #PAItemTypes do if PAItemTypes[i] ~= "" then PA.Banking_Defaults[profileNo].ItemTypes[PAItemTypes[i]] = 0 end end -- default values for advanced ItemTypes for itemTypeAdvancedNo = 0, #PAItemTypesAdvanced do -- amount of advanced item types PA.Banking_Defaults[profileNo].ItemTypesAdvanced[itemTypeAdvancedNo] = { Key = {}, Value = {} } end PA.Banking_Defaults[profileNo].ItemTypesAdvanced[0].Key = PAC_OPERATOR_NONE -- 0 = Lockpick PA.Banking_Defaults[profileNo].ItemTypesAdvanced[0].Value = 100 -- 0 = Lockpick -- ----------------------------------------------------- -- default values for PALoot PA.Loot_Defaults[profileNo] = { ItemTypes = {} } PA.Loot_Defaults[profileNo].enabled = false PA.Loot_Defaults[profileNo].lootGold = true PA.Loot_Defaults[profileNo].lootItems = true PA.Loot_Defaults[profileNo].hideItemLootMsg = false PA.Loot_Defaults[profileNo].hideGoldLootMsg = false PA.Loot_Defaults[profileNo].hideAllMsg = false -- default values for ItemTypes (only prepare defaults for enabled itemTypes) -- auto-loot=true, ignore=false for i = 1, #PALoItemTypes do if PALoItemTypes[i] ~= "" then PA.Loot_Defaults[profileNo].ItemTypes[PALoItemTypes[i]] = 0 end end -- ----------------------------------------------------- -- default values for PAJunk PA.Junk_Defaults[profileNo] = {} PA.Junk_Defaults[profileNo].enabled = false PA.Junk_Defaults[profileNo].autoSellJunk = true PA.Junk_Defaults[profileNo].autoMarkTrash = true PA.Junk_Defaults[profileNo].hideAllMsg = false -- default values for ItemTypes (only prepare defaults for enabled itemTypes) -- auto-flag-as-junk=true, ignore=false -- for i = 2, #PAJItemTypes do -- if PAJItemTypes[i] ~= "" then -- PA.Junk_Defaults[profileNo].ItemTypes[PAJItemTypes[i]] = 0 -- end -- end end end -- introduces the addon to the player function PA.introduction() EVENT_MANAGER:UnregisterForEvent("PersonalAssistant_PlayerActivated", EVENT_PLAYER_ACTIVATED) -- SLASH_COMMANDS["/pa"] = PAUI.toggleWindow -- fix/update saved vars changes since last version SVC.updateSavedVars() -- create the options with LAM-2 PA_SettingsMenu.CreateOptions() if PA_SavedVars.General[PA_SavedVars.General.activeProfile].welcome then if PA_SavedVars.General.language ~= "en" and PA_SavedVars.General.language ~= "de" and PA_SavedVars.General.language ~= "fr" then PA.println("Welcome_NoSupport", PA_SavedVars.General.language) else PA.println("Welcome_Support", PA_SavedVars.General.language) end end end -- returns a noun for the bagId function PA.getBagName(bagId) if (bagId == BAG_WORN) then return PAL.getResourceMessage("NS_Bag_Equipment") elseif (bagId == BAG_BACKPACK) then return PAL.getResourceMessage("NS_Bag_Backpack") elseif (bagId == BAG_BANK or bagId == BAG_SUBSCRIBER_BANK) then return PAL.getResourceMessage("NS_Bag_Bank") else return PAL.getResourceMessage("NS_Bag_Unknown") end end -- returns an adjective for the bagId function PA.getBagNameAdjective(bagId) if (bagId == BAG_WORN) then return PAL.getResourceMessage("NS_Bag_Equipped") elseif (bagId == BAG_BACKPACK) then return PAL.getResourceMessage("NS_Bag_Backpacked") elseif (bagId == BAG_BANK or bagId == BAG_SUBSCRIBER_BANK) then return PAL.getResourceMessage("NS_Bag_Banked") else return PAL.getResourceMessage("NS_Bag_Unknown") end end -- returns a fixed/formatted ItemLink function PA.getFormattedItemLink(bagId, slotIndex) local itemLink = GetItemLink(bagId, slotIndex, LINK_STYLE_BRACKETS) if itemLink == "" then return end local itemName = zo_strformat(SI_TOOLTIP_ITEM_NAME, GetItemName(bagId, slotIndex)) local itemData = itemLink:match("|H.-:(.-)|h") return zo_strformat(SI_TOOLTIP_ITEM_NAME, (("|H%s:%s|h[%s]|h"):format(LINK_STYLE_BRACKETS, itemData, itemName))) end -- currently supports one text-key and n arguments function PA.println(key, ...) local text = PAL.getResourceMessage(key) if text == nil then text = key end local args = {...} local unpackedString = string.format(text, unpack(args)) if (unpackedString == "") then unpackedString = key end CHAT_SYSTEM:AddMessage(unpackedString) -- check this out: Singular & plural form using the zo_strformat() function -- http://www.esoui.com/forums/showthread.php?p=7988 end EVENT_MANAGER:RegisterForEvent("PersonalAssistant_AddonLoaded", EVENT_ADD_ON_LOADED, PA.initAddon) EVENT_MANAGER:RegisterForEvent("PersonalAssistant_PlayerActivated", EVENT_PLAYER_ACTIVATED, PA.introduction) -- ======================================================================================================================== -- Dev-Debug -- function PA.cursorPickup(type, param1, bagId, slotIndex, param4, param5, param6, itemSoundCategory) local itemType, specializedItemType = GetItemType(bagId, slotIndex) local strItemType = PAL.getResourceMessage(itemType) local stack, maxStack = GetSlotStackSize(bagId, slotIndex) local isSaved = ItemSaver.isItemSaved(bagId, slotIndex) PA.println("itemType (%s): %s. (special = %s) ---> (%d/%d) --> %s (saved = %s)", itemType, strItemType, specializedItemType, stack, maxStack, PA.getFormattedItemLink(bagId, slotIndex), tostring(isSaved)) end -- EVENT_MANAGER:RegisterForEvent("PersonalAssistant_CursorPickup", EVENT_CURSOR_PICKUP, PA.cursorPickup)
--All of these functions are related to updating the ui from the data or vice versa. local lib = LibStub:GetLibrary("LibUIDropDownMenu-4.0") --Will take in the string ID and return the appropriate Locky Frame function NL.GetLockyFriendFrameById(LockyFrameID) for key, value in pairs(LockyFrame.scrollframe.content.LockyFriendFrames) do --print(key, " -- ", value["LockyFrameID"]) if value["LockyFrameID"] == LockyFrameID then return value end end end --Will take in a string name and return the appropriate Locky Frame. function NL.GetLockyFriendFrameByName(LockyName) for key, value in pairs(LockyFrame.scrollframe.content.LockyFriendFrames) do --print(key, " -- ", value["LockyFrameID"]) if value["LockyName"] == LockyName then return value end end end --Will update a locky friend frame with the warlock data passed in. --If the warlock object is null it will clear and hide the data from the screen. function NL.UpdateLockyFrame(Warlock, LockyFriendFrame) --print("Updating Locky Frame") if(Warlock == nil) then LockyFriendFrame:Hide() Warlock = NL.CreateWarlock("", "None", "None") else LockyFriendFrame:Show() end --Set the nametag --print("Updating Nameplate Text to: ".. Warlock.Name) LockyFriendFrame.LockyName = Warlock.Name LockyFriendFrame.NamePlate.TextFrame:SetText(Warlock.Name) --Set the CurseAssignment --print("Updating Curse to: ".. Warlock.CurseAssignment) -- this may need to be done by index..... --GetIndexFromTable(CurseOptions, Warlock.CurseAssignment) lib:UIDropDownMenu_SetSelectedID(LockyFriendFrame.CurseAssignmentMenu, NL.GetIndexFromTable(NL.CurseOptions, Warlock.CurseAssignment)) NL.UpdateCurseGraphic(LockyFriendFrame.CurseAssignmentMenu, NL.GetCurseValueFromDropDownList(LockyFriendFrame.CurseAssignmentMenu)) LockyFriendFrame.CurseAssignmentMenu.Text:SetText(NL.GetCurseValueFromDropDownList(LockyFriendFrame.CurseAssignmentMenu)) --Set the BanishAssignmentMenu --print("Updating Banish to: ".. Warlock.BanishAssignment) lib:UIDropDownMenu_SetSelectedID(LockyFriendFrame.BanishAssignmentMenu, NL.GetIndexFromTable(NL.BanishMarkers, Warlock.BanishAssignment)) NL.UpdateBanishGraphic(LockyFriendFrame.BanishAssignmentMenu, NL.GetValueFromDropDownList(LockyFriendFrame.BanishAssignmentMenu, NL.BanishMarkers, "")) LockyFriendFrame.BanishAssignmentMenu.Text:SetText(NL.GetValueFromDropDownList(LockyFriendFrame.BanishAssignmentMenu, NL.BanishMarkers, "")) --Set the SS Assignment --print("Updating SS to: ".. Warlock.SSAssignment) NL.UpdateDropDownMenuWithNewOptions(LockyFriendFrame.SSAssignmentMenu, NL.GetSSTargets(), "SSAssignments"); lib:UIDropDownMenu_SetSelectedID(LockyFriendFrame.SSAssignmentMenu, NL.GetSSIndexFromTable(NL.GetSSTargets(),Warlock.SSAssignment)) LockyFriendFrame.SSAssignmentMenu.Text:SetText(NL.GetValueFromDropDownList(LockyFriendFrame.SSAssignmentMenu, NL.GetSSTargets(), "SSAssignments")) --Update the Portrait picture if Warlock.Name=="" then LockyFriendFrame.Portrait:Hide() else --print("Trying to set diff portrait") if(LockyFriendFrame.Portrait.Texture == nil) then --print("The obj never existed") local PortraitGraphic = LockyFriendFrame.Portrait:CreateTexture(nil, "OVERLAY") PortraitGraphic:SetAllPoints() SetPortraitTexture(PortraitGraphic, Warlock.Name) LockyFriendFrame.Portrait.Texture = PortraitGraphic else --print("the obj exists") SetPortraitTexture(LockyFriendFrame.Portrait.Texture, Warlock.Name) end LockyFriendFrame.Portrait:Show() end --Update acknowledged Update that text: if(Warlock.AcceptedAssignments == "true")then LockyFriendFrame.AssignmentAcknowledgement.value:SetText("Yes") elseif Warlock.AcceptedAssignments == "false" then LockyFriendFrame.AssignmentAcknowledgement.value:SetText("No") else LockyFriendFrame.AssignmentAcknowledgement.value:SetText("Not Received") end if(Warlock.AddonVersion == 0) then LockyFriendFrame.Warning.value:SetText("Warning: Addon not installed") LockyFriendFrame.Warning:Show(); elseif (Warlock.AddonVersion< NL.Version) then LockyFriendFrame.Warning.value:SetText("Warning: Addon out of date") LockyFriendFrame.Warning:Show(); else LockyFriendFrame.Warning:Hide(); end return LockyFriendFrame.LockyFrameID end --This will use the global locky friends data. function NL.UpdateAllLockyFriendFrames() if NL.DebugMode then print("Updating all frames.") end NL.ClearAllLockyFrames() -- print("All frames Cleared") NL.ConsolidateFrameLocations() --print("Frame Locations Consolidated") for key, value in pairs(NL.LockyFriendsData) do NL.UpdateLockyFrame(value, NL.GetLockyFriendFrameById(value.LockyFrameLocation)) end if NL.DebugMode then print("Frames updated successfully.") end LockyFrame.scrollbar:SetMinMaxValues(1, NL.GetMaxValueForScrollBar(NL.LockyFriendsData)) -- print("ScrollRegion size updated successfully") end --Loops through and clears all of the data currently loaded. function NL.ClearAllLockyFrames() --print("Clearing the frames") for key, value in pairs(LockyFrame.scrollframe.content.LockyFriendFrames) do NL.UpdateLockyFrame(nil, value) --print(value.LockyFrameID, "successfully cleared.") end end --This function will take in the warlock table object and update the frame assignment to make sense. function NL.ConsolidateFrameLocations() --Need to loop through and assign a locky frame id to a locky friend. --print("Setting up FrameLocations for the locky friend data.") for key, value in pairs(NL.LockyFriendsData) do --print(value.Name, "will be assigned a frame.") value.LockyFrameLocation = LockyFrame.scrollframe.content.LockyFriendFrames[key].LockyFrameID; --print("Assigned Frame:",value.LockyFrameLocation) end end --[[ Go through each lock. if SS is on CD then Update the CD Tracker Text else do nothing. ]]-- function NL.UpdateLockyClockys() for k,v in pairs(NL.LockyFriendsData) do if (NL.DebugMode) then --print(v.Name, "on cooldown =", v.SSonCD) end if(v.SSonCD=="true") then -- We have the table item for the SSCooldown local CDLength = 30*60 local timeShift = 0 timeShift = v.MyTime - v.LocalTime; local absCD = v.SSCooldown+timeShift; local secondsRemaining = math.floor(absCD + CDLength - GetTime()) local result = SecondsToTime(secondsRemaining) if(NL.DebugMode and v.SSCooldown~=0) then --print(v.Name,"my time:", v.MyTime, "localtime:", v.LocalTime, "timeShift:", timeShift, "LocalCD", v.SSCooldown, "Abs CD:",absCD, "Time Remaining:",secondsRemaining) end local frame = NL.GetLockyFriendFrameById(v.LockyFrameLocation) frame.SSCooldownTracker:SetText("CD "..result) if secondsRemaining <=0 or v.SSCooldown == 0 then v.SSonCD = "false" frame.SSCooldownTracker:SetText("Available") end end end end --Will set default assignments for curses / banishes and SS. function NL.SetDefaultAssignments(warlockTable) for k, y in pairs(warlockTable) do if(k<=3)then y.CurseAssignment = NL.CurseOptions[k+1] else y.CurseAssignment = NL.CurseOptions[1] end if(k<=7) then y.BanishAssignment = NL.BanishMarkers[k+1] else y.BanishAssignment = NL.BanishMarkers[1] end if(k<=2) then local strSS = NL.GetSSTargets()[k] --print(strSS) y.SSAssignment = strSS else local targets = NL.GetSSTargets() y.SSAssignment = targets[NL.GetTableLength(targets)] end end return warlockTable end -- Gets the index of the frame that currently houses a particular warlock. -- This is used for force removal and not much else that I can recall. function NL.GetLockyFriendIndexByName(table, name) for key, value in pairs(table) do --print(key, " -- ", value["LockyFrameID"]) --print(value.Name) if value.Name == name then if NL.DebugMode then print(value.Name, "is in position", key) end return key end end if NL.DebugMode then print(name, "is not in the list.") end return nil end --Checks to see if the SS is on CD, and broadcasts if it is to all everyone. function NL.CheckSSCD(self) local startTime, duration, enable = GetItemCooldown(16896) --if my CD in never locky is different from the what I am aware of then I need to update. local myself = NL.GetMyLockyData() if myself ~= nil then if(myself.SSCooldown~=startTime) then if NL.DebugMode then print("Personal SSCD detected.") end myself.SSCooldown = startTime myself.LocalTime = GetTime() myself.SSonCD = "true" end --print(startTime, duration, enable, myself.Name) --If the SS is on CD then we broadcast that. --If the CD is on cooldown AND we have not broadcast in the last minute we will broadcast. if(startTime > 0 and self.TimeSinceLastSSCDBroadcast > NL.NeverLockySSCD_BroadcastInterval) then self.TimeSinceLastSSCDBroadcast=0 NL.BroadcastSSCooldown(myself) end else if NL.DebugMode then print("Something went horribly wrong.") end end end function NL.ForceUpdateSSCD() if NL.DebugMode then print("Forcing SSCD cache update.") end local startTime, duration, enable = GetItemCooldown(16896) --if my CD in never locky is different from the what I am aware of then I need to update. local myself = NL.GetMyLockyData() if myself ~= nil then if(myself.SSCooldown~=startTime) then if NL.DebugMode then print("Personal SSCD detected.") end myself.SSCooldown = startTime myself.LocalTime = GetTime() myself.SSonCD = "true" end else if NL.DebugMode then print("Something went horribly wrong.") end end end --Updates the cooldown of a warlock in the ui. function NL.UpdateLockySSCDByName(name, cd) local warlock = NL.GetLockyDataByName(name) if NL.DebugMode then print("Attempting to update SS CD for", name); end --if warlock.SSCooldown~=cd then warlock.SSCooldown = cd if NL.DebugMode then print("Updated SS CD for", name,"successfully."); end --end end --Returns a warlock table object from the LockyFrame --This function is used to determine if unsaved UI changes have been made. --This will be used by the is dirty function to determine if the frame is dirty. function NL.GetWarlockFromLockyFrame(LockyName) local LockyFriendFrame = NL.GetLockyFriendFrameByName(LockyName) local Warlock = NL.CreateWarlock(LockyFriendFrame.LockyName, NL.GetCurseValueFromDropDownList(LockyFriendFrame.CurseAssignmentMenu), NL.GetValueFromDropDownList(LockyFriendFrame.BanishAssignmentMenu, NL.BanishMarkers, "")) Warlock.SSAssignment = NL.GetValueFromDropDownList(LockyFriendFrame.SSAssignmentMenu, NL.GetSSTargets(), "SSAssignments") Warlock.LockyFrameLocation = LockyFriendFrame.LockyFrameID return Warlock end --Returns true if changes have been made but have not been saved. function NL.IsUIDirty(LockyData) if(not LockyData_HasInitialized) then NL.LockyFriendsData = NL.InitLockyFriendData(); LockyData_HasInitialized = true; return true; end for k, v in pairs(LockyData) do local uiLock = NL.GetWarlockFromLockyFrame(v.Name) if(v.CurseAssignment~=uiLock.CurseAssignment or v.BanishAssignment ~= uiLock.BanishAssignment or v.SSAssignment ~= uiLock.SSAssignment) then return true end end return false end --Commits any UI changes to the global LockyFriendsDataModel function NL.CommitChanges(LockyFriendsData) for k, v in pairs(LockyFriendsData) do local uiLock = NL.GetWarlockFromLockyFrame(v.Name) if NL.DebugMode then print("Old: ", v.CurseAssignment, "New: ", uiLock.CurseAssignment) print("Old: ", v.BanishAssignment, "New: ", uiLock.BanishAssignment) print("Old",v.SSAssignment , "New:", uiLock.SSAssignment) end v.CurseAssignment = uiLock.CurseAssignment v.BanishAssignment = uiLock.BanishAssignment v.SSAssignment = uiLock.SSAssignment v.AcceptedAssignments = "nil" end LockyData_Timestamp = GetTime() return LockyFriendsData end function NL.AnnounceAssignments() local AnnounceOption = NL.GetValueFromDropDownList(LockyAnnouncerOptionMenu, NL.AnnouncerOptions, ""); for k, v in pairs(NL.LockyFriendsData) do local message = "" if v.CurseAssignme1nt ~= "None" or v.BanishAssignment ~= "None" or v.SSAssignment~="None" then message = v.Name .. ": "; end if v.CurseAssignment~="None" then message = message.."Curse -> ".. v.CurseAssignment .." "; NL.SendAnnounceMent(AnnounceOption, message, v); end if v.BanishAssignment~="None" then message = v.Name .. ": ".."Banish -> {".. v.BanishAssignment .."} "; NL.SendAnnounceMent(AnnounceOption, message, v); end if v.SSAssignment~="None" then message = v.Name .. ": ".."SS -> "..v.SSAssignment .." "; NL.SendAnnounceMent(AnnounceOption, message, v); end end end function NL.SendAnnounceMent(AnnounceOption, message, v) if AnnounceOption == "Addon Only" then if NL.DebugMode then print(message) end elseif AnnounceOption == "Raid" then SendChatMessage(message, "RAID", nil, nil) elseif AnnounceOption == "Party" then SendChatMessage(message, "PARTY", nil, nil) elseif AnnounceOption == "Whisper" then SendChatMessage(message, "WHISPER", nil, v.Name) else if(NL.DebugMode) then print("Should send the announce here: " .. AnnounceOption) end local index = GetChannelName(AnnounceOption) -- It finds General is a channel at index 1 if (index~=nil) then SendChatMessage(message , "CHANNEL", nil, index); end end end
if (GetLocale() ~= "deDE") then return; end -- @EXACT = true: Translation has to be the exact(!) match in the clients language, -- beacause it carries technical semantics -- @EXACT = false: Translation can be done freely, because text is only descriptive -- Class Names -- @EXACT = false VUHDO_I18N_WARRIORS="Krieger" VUHDO_I18N_ROGUES = "Schurken"; VUHDO_I18N_HUNTERS = "Jäger"; VUHDO_I18N_PALADINS = "Paladine"; VUHDO_I18N_MAGES = "Magier"; VUHDO_I18N_WARLOCKS = "Hexenmeister"; VUHDO_I18N_SHAMANS = "Schamanen"; VUHDO_I18N_DRUIDS = "Druiden"; VUHDO_I18N_PRIESTS = "Priester"; VUHDO_I18N_DEATH_KNIGHT = "Todesritter"; VUHDO_I18N_MONKS = "Mönche"; -- Group Model Names -- @EXACT = false VUHDO_I18N_GROUP = "Gruppe"; VUHDO_I18N_OWN_GROUP = "Eigene Grp."; -- Special Model Names -- @EXACT = false VUHDO_I18N_PETS = "Begleiter"; VUHDO_I18N_MAINTANKS = "Main Tanks"; VUHDO_I18N_PRIVATE_TANKS = "Privat-Tanks"; -- General Labels -- @EXACT = false VUHDO_I18N_OKAY = "Okay"; VUHDO_I18N_CLASS = "Klasse"; VUHDO_I18N_PLAYER = "Spieler"; -- VuhDoTooltip.lua -- @EXACT = false VUHDO_I18N_TT_POSITION = "|cffffb233Position:|r"; VUHDO_I18N_TT_GHOST = "<GEIST>"; VUHDO_I18N_TT_DEAD = "<TOT>"; VUHDO_I18N_TT_AFK = "<AFK>"; VUHDO_I18N_TT_DND = "<DND>"; VUHDO_I18N_TT_LIFE = "|cffffb233Leben:|r "; VUHDO_I18N_TT_MANA = "|cffffb233Mana:|r "; VUHDO_I18N_TT_LEVEL = "Level "; -- VuhDoPanel.lua -- @EXACT = false VUHDO_I18N_CHOOSE = "Auswahl"; VUHDO_I18N_DRAG = "Zieh"; VUHDO_I18N_REMOVE = "Entfernen"; VUHDO_I18N_ME = "mich!"; VUHDO_I18N_TYPE = "Typ"; VUHDO_I18N_VALUE = "Wert"; VUHDO_I18N_SPECIAL = "Spezial"; VUHDO_I18N_BUFF_ALL = "alle"; VUHDO_I18N_SHOW_BUFF_WATCH = "Buff Watch anzeigen"; -- Chat messages -- @EXACT = false VUHDO_I18N_COMMAND_LIST = "\n|cffffe566 - [ VuhDo Kommandos ] -|r"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566opt|r[ions] - VuhDo Optionen"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566res|r[et] - Panel Positionen zurücksetzen"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566lock|r - Panelpositionen sperren/freigeben"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566mm, map, minimap|r - Minimap Icon an/aus"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566show, hide, toggle|r - Panels anzeigen/verbergen"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566load|r - [Profile],[Key Layout]"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§[broad]|cffffe566cast, mt|r[s] - Main Tanks übertragen"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566role|r - Spielerrollen zuruecksetzen"; VUHDO_I18N_COMMAND_LIST = VUHDO_I18N_COMMAND_LIST .. "§|cffffe566help,?|r - Diese Befehlsliste\n"; VUHDO_I18N_BAD_COMMAND = "Ungültiges Argument! '/vuhdo help' oder '/vd ?' für eine Liste der Kommandos."; VUHDO_I18N_CHAT_SHOWN = "|cffffe566sichtbar|r."; VUHDO_I18N_CHAT_HIDDEN = "|cffffe566versteckt|r."; VUHDO_I18N_MM_ICON = "Das Minimap-Symbol ist jetzt "; VUHDO_I18N_MTS_BROADCASTED = "Die Main-Tanks wurden dem Raid übertragen"; VUHDO_I18N_PANELS_SHOWN = "Die Heil-Panels werden jetzt |cffffe566angezeigt|r."; VUHDO_I18N_PANELS_HIDDEN = "Die Heil-Panels werden jetzt |cffffe566versteckt|r."; VUHDO_I18N_LOCK_PANELS_PRE = "Die Panel-Positionen sind jetzt "; VUHDO_I18N_LOCK_PANELS_LOCKED = "|cffffe566gesperrt|r."; VUHDO_I18N_LOCK_PANELS_UNLOCKED = "|cffffe566freigegeben|r."; VUHDO_I18N_PANELS_RESET = "Die Panel-Positionen wurden zurückgesetzt."; -- Config Pop-Up -- @EXACT = false VUHDO_I18N_ROLE = "Rolle"; VUHDO_I18N_PRIVATE_TANK = "Privat-Tank"; VUHDO_I18N_SET_BUFF = "Setze Buff"; -- Minimap -- @EXACT = false VUHDO_I18N_VUHDO_OPTIONS = "VuhDo Optionen"; VUHDO_I18N_PANEL_SETUP = "Optionen"; VUHDO_I18N_MM_TOOLTIP = "Linksklick: Panel-Einstellungen\nRechtsklick: Menü"; VUHDO_I18N_TOGGLES = "Schalter"; VUHDO_I18N_LOCK_PANELS = "Panels sperren"; VUHDO_I18N_SHOW_PANELS = "Panels anzeigen"; VUHDO_I18N_MM_BUTTON = "Minimap-Symbol"; VUHDO_I18N_CLOSE = "Schließen"; VUHDO_I18N_BROADCAST_MTS = "MTs übertragen"; -- Buff categories -- @EXACT = false -- Priest -- Shaman VUHDO_I18N_BUFFC_FIRE_TOTEM = "Feuertotem"; VUHDO_I18N_BUFFC_AIR_TOTEM = "Lufttotem"; VUHDO_I18N_BUFFC_EARTH_TOTEM = "Erdtotem"; VUHDO_I18N_BUFFC_WATER_TOTEM = "Wassertotem"; VUHDO_I18N_BUFFC_WEAPON_ENCHANT = "Waffenverzauberung"; VUHDO_I18N_BUFFC_WEAPON_ENCHANT_2 = "Waffenverzauberung 2"; VUHDO_I18N_BUFFC_SHIELDS = "Schilde"; -- Paladin VUHDO_I18N_BUFFC_BLESSING = "Segen"; VUHDO_I18N_BUFFC_SEAL = "Siegel"; -- Druids -- Warlock VUHDO_I18N_BUFFC_SKIN = "Rüstung"; -- Mage VUHDO_I18N_BUFFC_ARMOR_MAGE = "Rüstung"; -- Death Knight VUHDO_BUFFC_PRESENCE = "Präsenz"; -- Warrior VUHDO_I18N_BUFFC_SHOUT = "Ruf"; -- Hunter VUHDO_I18N_BUFFC_ASPECT = "Aspekt"; -- Monk VUHDO_I18N_BUFFC_STANCE = "Haltung"; -- Key Binding Headers/Names -- @EXACT = false BINDING_HEADER_VUHDO_TITLE = "{ VuhDo - |cffffe566Raid Frames|r }"; BINDING_NAME_VUHDO_KEY_ASSIGN_1 = "Mouse-Over Spruch 1"; BINDING_NAME_VUHDO_KEY_ASSIGN_2 = "Mouse-Over Spruch 2"; BINDING_NAME_VUHDO_KEY_ASSIGN_3 = "Mouse-Over Spruch 3"; BINDING_NAME_VUHDO_KEY_ASSIGN_4 = "Mouse-Over Spruch 4"; BINDING_NAME_VUHDO_KEY_ASSIGN_5 = "Mouse-Over Spruch 5"; BINDING_NAME_VUHDO_KEY_ASSIGN_6 = "Mouse-Over Spruch 6"; BINDING_NAME_VUHDO_KEY_ASSIGN_7 = "Mouse-Over Spruch 7"; BINDING_NAME_VUHDO_KEY_ASSIGN_8 = "Mouse-Over Spruch 8"; BINDING_NAME_VUHDO_KEY_ASSIGN_9 = "Mouse-Over Spruch 9"; BINDING_NAME_VUHDO_KEY_ASSIGN_10 = "Mouse-Over Spruch 10"; BINDING_NAME_VUHDO_KEY_ASSIGN_11 = "Mouse-Over Spruch 11"; BINDING_NAME_VUHDO_KEY_ASSIGN_12 = "Mouse-Over Spruch 12"; BINDING_NAME_VUHDO_KEY_ASSIGN_13 = "Mouse-Over Spruch 13"; BINDING_NAME_VUHDO_KEY_ASSIGN_14 = "Mouse-Over Spruch 14"; BINDING_NAME_VUHDO_KEY_ASSIGN_15 = "Mouse-Over Spruch 15"; BINDING_NAME_VUHDO_KEY_ASSIGN_16 = "Mouse-Over Spruch 16"; BINDING_NAME_VUHDO_KEY_ASSIGN_SMART_BUFF = "Smart Buff"; VUHDO_I18N_MOUSE_OVER_BINDING = "Tastenspruch"; VUHDO_I18N_UNASSIGNED = "(nicht zugewiesen)"; -- #+V1.89 VUHDO_I18N_NO = "Nein"; VUHDO_I18N_UP = "auf"; VUHDO_I18N_VEHICLES = "Vehikel"; -- #+v1.94 VUHDO_I18N_DEFAULT_RES_ANNOUNCE = "vuhdo, steh auf, Du Pappe!"; -- #v+1.151 VUHDO_I18N_MAIN_ASSISTS = "Assistenten"; -- #+v1.184 VUHDO_I18N_BW_CD = "CD"; VUHDO_I18N_BW_GO = "GO!"; VUHDO_I18N_BW_LOW = "LOW"; VUHDO_I18N_BW_N_A = "|cffff0000N/A|r"; VUHDO_I18N_BW_RNG_RED = "|cffff0000RNG|r"; VUHDO_I18N_BW_OK = "OK"; VUHDO_I18N_BW_RNG_YELLOW = "|cffffff00RNG|r"; VUHDO_I18N_PROMOTE_RAID_LEADER = "Zum Raid-Leiter befördern"; VUHDO_I18N_PROMOTE_ASSISTANT = "Zum Assistenten befördern"; VUHDO_I18N_DEMOTE_ASSISTANT = "Assistent degradieren"; VUHDO_I18N_PROMOTE_MASTER_LOOTER = "Zum Loot-Master ernennen"; VUHDO_I18N_MT_NUMBER = "MT #"; VUHDO_I18N_ROLE_OVERRIDE = "Rolle überschreiben"; VUHDO_I18N_MELEE_TANK = "Melee - Tank"; VUHDO_I18N_MELEE_DPS = "Melee - DPS"; VUHDO_I18N_RANGED_DPS = "Ranged - DPS"; VUHDO_I18N_RANGED_HEALERS = "Ranged - Heiler"; VUHDO_I18N_AUTO_DETECT = "<automatisch>"; VUHDO_I18N_PROMOTE_ASSIST_MSG_1 = "|cffffe566"; VUHDO_I18N_PROMOTE_ASSIST_MSG_2 = "|r wurde zum Assistenten ernannt."; VUHDO_I18N_DEMOTE_ASSIST_MSG_1 = "|cffffe566"; VUHDO_I18N_DEMOTE_ASSIST_MSG_2 = "|r wurde aus den Assistenten entfernt."; VUHDO_I18N_RESET_ROLES = "Rollen zurücksetzen"; VUHDO_I18N_LOAD_KEY_SETUP = "Spruchbelegung"; VUHDO_I18N_BUFF_ASSIGN_1 = "Buff |cffffe566"; VUHDO_I18N_BUFF_ASSIGN_2 = "|r wurde |cffffe566"; VUHDO_I18N_BUFF_ASSIGN_3 = "|r zugewiesen."; VUHDO_I18N_MACRO_KEY_ERR_1 = "FEHLER: Die max.Größe für Tastatur-Makros wurde überschritten für: "; VUHDO_I18N_MACRO_KEY_ERR_2 = "/256 Characters). Bitte die \"Automatisch-Zünden\"-Optionen reduzieren!"; VUHDO_I18N_MACRO_NUM_ERR = "Maximale Anzahl Makros überschritten! Kann Makro NICHT anlegen für: "; VUHDO_I18N_SMARTBUFF_ERR_1 = "VuhDo: Smart-Cast nur außerhalb des Kampfes!"; VUHDO_I18N_SMARTBUFF_ERR_2 = "VuhDo: Keine Spieler verfügbar für: "; VUHDO_I18N_SMARTBUFF_ERR_3 = " Spieler nicht in Reichweite für "; VUHDO_I18N_SMARTBUFF_ERR_4 = "VuhDo: Es gibt nichts zu tun."; VUHDO_I18N_SMARTBUFF_OKAY_1 = "VuhDo: Buffe |cffffffff"; VUHDO_I18N_SMARTBUFF_OKAY_2 = "|r auf "; -- #+v1.189 VUHDO_I18N_UNKNOWN = "unbekannt"; VUHDO_I18N_SELF = "Selbst"; VUHDO_I18N_MELEES = "Nahkampf"; VUHDO_I18N_RANGED = "Fernkampf"; -- #+1.196 VUHDO_I18N_OPTIONS_NOT_LOADED = ">>> VuhDo-Optionen PlugIn nicht geladen! <<<"; VUHDO_I18N_SPELL_LAYOUT_NOT_EXIST_1 = "Fehler: Spell-Layout \""; VUHDO_I18N_SPELL_LAYOUT_NOT_EXIST_2 = "\" existiert nicht."; VUHDO_I18N_AUTO_ARRANG_1 = "Gruppengröße ist auf "; VUHDO_I18N_AUTO_ARRANG_2 = " gewechselt. Lade Profil: \""; -- #+1.209 VUHDO_I18N_OWN_GROUP_LONG = "Eigene Gruppe"; VUHDO_I18N_TRACK_BUFFS_FOR = "Buff prüfen für ..."; VUHDO_I18N_NO_FOCUS = "[kein focus]"; VUHDO_I18N_NOT_AVAILABLE = "[ N/V ]"; -- #+1.237 VUHDO_I18N_TT_DISTANCE = "|cffffb233Distanz:|r"; VUHDO_I18N_TT_OF = " von "; VUHDO_I18N_YARDS = "Meter"; -- #+1.252 VUHDO_I18N_PANEL = "Fenster"; VUHDO_I18N_BOUQUET_AGGRO = "Flag: Aggro"; VUHDO_I18N_BOUQUET_OUT_OF_RANGE = "Flag: Reichweite, ausser"; VUHDO_I18N_BOUQUET_IN_RANGE = "Flag: Reichweite, in"; VUHDO_I18N_BOUQUET_IN_YARDS = "Flag: Entfernung < Meter"; VUHDO_I18N_BOUQUET_OTHER_HOTS = "Flag: HoTs anderer Spieler"; VUHDO_I18N_BOUQUET_DEBUFF_MAGIC = "Flag: Debuff Magie"; VUHDO_I18N_BOUQUET_DEBUFF_DISEASE = "Flag: Debuff Krankheit"; VUHDO_I18N_BOUQUET_DEBUFF_POISON = "Flag: Debuff Gift"; VUHDO_I18N_BOUQUET_DEBUFF_CURSE = "Flag: Debuff Fluch"; VUHDO_I18N_BOUQUET_CHARMED = "Flag: Übernommen"; VUHDO_I18N_BOUQUET_DEAD = "Flag: Tot"; VUHDO_I18N_BOUQUET_DISCONNECTED = "Flag: Disconnect"; VUHDO_I18N_BOUQUET_AFK = "Flag: AFK"; VUHDO_I18N_BOUQUET_PLAYER_TARGET = "Flag: Spielerziel"; VUHDO_I18N_BOUQUET_MOUSEOVER_TARGET = "Flag: Mouseover Einzeln"; VUHDO_I18N_BOUQUET_MOUSEOVER_GROUP = "Flag: Mouseover Gruppe"; VUHDO_I18N_BOUQUET_HEALTH_BELOW = "Flag: Leben < %"; VUHDO_I18N_BOUQUET_MANA_BELOW = "Flag: Mana < %"; VUHDO_I18N_BOUQUET_THREAT_ABOVE = "Flag: Bedrohung > %"; VUHDO_I18N_BOUQUET_NUM_IN_CLUSTER = "Flag: Cluster >= Spieler"; VUHDO_I18N_BOUQUET_CLASS_COLOR = "Flag: Immer Klassenfarbe"; VUHDO_I18N_BOUQUET_ALWAYS = "Flag: Immer einfarbig"; VUHDO_I18N_SWIFTMEND_POSSIBLE = "Flag: Rasche Heilung möglich"; VUHDO_I18N_BOUQUET_MOUSEOVER_CLUSTER = "Flag: Cluster, Mouseover"; VUHDO_I18N_THREAT_LEVEL_MEDIUM = "Flag: Bedrohung, Hoch"; VUHDO_I18N_THREAT_LEVEL_HIGH = "Flag: Bedrohung, Overnuke"; VUHDO_I18N_BOUQUET_STATUS_HEALTH = "Statusbar: Leben %"; VUHDO_I18N_BOUQUET_STATUS_MANA = "Statusbar: Mana %"; VUHDO_I18N_BOUQUET_STATUS_OTHER_POWERS = "Statusbar: Nicht-Mana %"; VUHDO_I18N_BOUQUET_STATUS_INCOMING = "Statusbar: Eingehende Heilung %"; VUHDO_I18N_BOUQUET_STATUS_THREAT = "Statusbar: Bedrohung %"; VUHDO_I18N_BOUQUET_NEW_ITEM_NAME = "-- (de)buff hier eingeben --"; VUHDO_I18N_DEF_BOUQUET_TANK_COOLDOWNS = "Tank-Cooldowns"; VUHDO_I18N_DEF_BOUQUET_PW_S_WEAKENED_SOUL = "Schild & Geschwächte Seele"; VUHDO_I18N_DEF_BOUQUET_BORDER_MULTI_AGGRO = "Rahmen: Multi + Aggro"; VUHDO_I18N_DEF_BOUQUET_BORDER_MULTI = "Rahmen: Multi"; VUHDO_I18N_DEF_BOUQUET_BORDER_SIMPLE = "Rahmen: Einfach"; VUHDO_I18N_DEF_BOUQUET_SWIFTMENDABLE = "Rasche Heilung möglich"; VUHDO_I18N_DEF_BOUQUET_MOUSEOVER_SINGLE = "Mouseover: Einzeln"; VUHDO_I18N_DEF_BOUQUET_MOUSEOVER_MULTI = "Mouseover: Multi"; VUHDO_I18N_DEF_BOUQUET_AGGRO_INDICATOR = "Aggro-Indikator"; VUHDO_I18N_DEF_BOUQUET_CLUSTER_MOUSE_HOVER = "Cluster: Mouse Hover"; VUHDO_I18N_DEF_BOUQUET_THREAT_MARKS = "Bedrohung: Marken"; VUHDO_I18N_DEF_BOUQUET_BAR_MANA_ALL = "Manabars: Alle Energien"; VUHDO_I18N_DEF_BOUQUET_BAR_MANA_ONLY = "Manabars: Nur Mana"; VUHDO_I18N_DEF_BOUQUET_BAR_THREAT = "Bedrohung: Statusbalken"; VUHDO_I18N_CUSTOM_ICON_NONE = "- Kein / Default -"; VUHDO_I18N_CUSTOM_ICON_GLOSSY = "Glänzend"; VUHDO_I18N_CUSTOM_ICON_MOSAIC = "Mosaik"; VUHDO_I18N_CUSTOM_ICON_CLUSTER = "Cluster"; VUHDO_I18N_CUSTOM_ICON_FLAT = "Flach"; VUHDO_I18N_CUSTOM_ICON_SPOT = "Spot"; VUHDO_I18N_CUSTOM_ICON_CIRCLE = "Kreis"; VUHDO_I18N_CUSTOM_ICON_SKETCHED = "Rechteck"; VUHDO_I18N_CUSTOM_ICON_RHOMB = "Karo"; VUHDO_I18N_ERROR_NO_PROFILE = "Fehler: Kein Profil mit Namen: "; VUHDO_I18N_PROFILE_LOADED = "Profil geladen: "; VUHDO_I18N_PROFILE_SAVED = "Profil gespeichert: "; VUHDO_I18N_PROFILE_OVERWRITE_1 = "Profil"; VUHDO_I18N_PROFILE_OVERWRITE_2 = "gehört derzeit zu \neinem anderen Char"; VUHDO_I18N_PROFILE_OVERWRITE_3 = "\n- Überschreiben: Überschreibt bestehendes Profil.\n- Copy: Erzeugt eine Kopie. Bestehendes Profil bleibt erhalten."; VUHDO_I18N_COPY = "Kopieren"; VUHDO_I18N_OVERWRITE = "Überschreiben"; VUHDO_I18N_DISCARD = "Verwerfen"; -- 2.0, alpha #2 VUHDO_I18N_DEF_BAR_BACKGROUND_SOLID = "Hintergrund: Einfarbig"; VUHDO_I18N_DEF_BAR_BACKGROUND_CLASS_COLOR = "Hintergrund: Klassenfarbe"; -- 2.0 alpha #9 VUHDO_I18N_BOUQUET_DEBUFF_BAR_COLOR = "Flag: Debuff, konfiguriert"; -- 2.0 alpha #11 VUHDO_I18N_DEF_BOUQUET_BAR_HEALTH = "Lebensbalken: (auto)"; VUHDO_I18N_UPDATE_RAID_TARGET = "Farbe: Schlachtzugsymbol"; VUHDO_I18N_BOUQUET_OVERHEAL_HIGHLIGHT = "Farbe: Overheal Aufheller"; VUHDO_I18N_BOUQUET_EMERGENCY_COLOR = "Farbe: Notfall"; VUHDO_I18N_BOUQUET_HEALTH_ABOVE = "Flag: Leben > %"; VUHDO_I18N_BOUQUET_RESURRECTION = "Flag: Wiederbelebung"; VUHDO_I18N_BOUQUET_STACKS_COLOR = "Farbe: #Stacks"; -- 2.1 VUHDO_I18N_DEF_BOUQUET_BAR_HEALTH_SOLID = "Leben: (auto, einfarbig)"; VUHDO_I18N_DEF_BOUQUET_BAR_HEALTH_CLASS_COLOR = "Leben: (auto, Klassenfarben)"; -- 2.9 VUHDO_I18N_NO_TARGET = "[kein Ziel]"; VUHDO_I18N_TT_LEFT = " Links: "; VUHDO_I18N_TT_RIGHT = " Rechts: "; VUHDO_I18N_TT_MIDDLE = " Mitte: "; VUHDO_I18N_TT_BTN_4 = " Taste 4: "; VUHDO_I18N_TT_BTN_5 = " Taste 5: "; VUHDO_I18N_TT_WHEEL_UP = " Rad hoch: "; VUHDO_I18N_TT_WHEEL_DOWN = " Rad runter: "; -- 2.13 VUHDO_I18N_BOUQUET_CLASS_ICON = "Icon: Klasse"; VUHDO_I18N_BOUQUET_RAID_ICON = "Icon: Schlachtzugsymbol"; VUHDO_I18N_BOUQUET_ROLE_ICON = "Icon: Rolle"; -- 2.18 VUHDO_I18N_LOAD_PROFILE = "Profil laden"; -- 2.20 VUHDO_I18N_DC_SHIELD_NO_MACROS = "Keine Makro-Plätze frei... d/c-Schild abgeschaltet."; VUHDO_I18N_BROKER_TOOLTIP_1 = "|cffffff00Linksklick|r für Optionen"; VUHDO_I18N_BROKER_TOOLTIP_2 = "|cffffff00Rechtsklick|r für Popup-Menü"; -- 2.54 VUHDO_I18N_HOURS = "Std."; VUHDO_I18N_MINS = "Min."; VUHDO_I18N_SECS = "Sek."; -- 2.65 VUHDO_I18N_BOUQUET_CUSTOM_DEBUFF = "Icon: Eigener Debuff"; -- 2.66 VUHDO_I18N_OFF = "aus"; VUHDO_I18N_GHOST = "Geist"; VUHDO_I18N_RIP = "tot"; VUHDO_I18N_DC = "d/c"; VUHDO_I18N_FOC = "Fok"; VUHDO_I18N_TAR = "Ziel"; VUHDO_I18N_VEHICLE = "O-O"; VUHDO_I18N_BOUQUET_PLAYER_FOCUS = "Flag: Spielerfokus"; -- 2.67 VUHDO_I18N_BUFF_WATCH = "BuffWatch"; VUHDO_I18N_HOTS = "HoTs"; VUHDO_I18N_DEBUFFS = "Debuffs"; VUHDO_I18N_BOUQUET_PLAYER_FOCUS = "Flag: Player Focus"; -- 2.69 VUHDO_I18N_SIDE_BAR_LEFT = "Seite Links"; VUHDO_I18N_SIDE_BAR_RIGHT = "Seite Rechts"; VUHDO_I18N_OWN_PET = "Eigenes Pet"; -- 2.72 VUHDO_I18N_SPELL = "Zauber"; VUHDO_I18N_COMMAND = "Kommando"; VUHDO_I18N_MACRO = "Makro"; VUHDO_I18N_ITEM = "Item"; -- 2.75 VUHDO_I18N_ERR_NO_BOUQUET = "\"%s\" ist dem nicht existierenden Bouquet \"%s\" zugeordnet!"; VUHDO_I18N_BOUQUET_HEALTH_BELOW_ABS = "Flag: Leben < k"; VUHDO_I18N_BOUQUET_HEALTH_ABOVE_ABS = "Flag: Leben > k"; VUHDO_I18N_SPELL_LAYOUT_NOT_EXIST = "Spruch-Layout \"%s\" existiert nicht."; --VUHDO_I18N_ADDON_WARNING = "WARNUNG: Das möglicherweise problematische Addon |cffffffff\"%s\"|r ist mit VuhDo aktiv. Grund: %s"; --VUHDO_I18N_MAY_CAUSE_LAGS = "Kann zu erheblichen Lags führen."; VUHDO_I18N_DISABLE_BY_VERSION = "!!! VUHDO IS DISABLED !!! This version is for client versions %d and above only !!!" VUHDO_I18N_BOUQUET_STATUS_ALTERNATE_POWERS = "Statusbar: Alt. Energie %" VUHDO_I18N_BOUQUET_ALTERNATE_POWERS_ABOVE = "Flag: Alt. Ernergie > %"; VUHDO_I18N_DEF_ALTERNATE_POWERS = "Alternative Energie"; VUHDO_I18N_DEF_TANK_CDS_EXTENDED = "Tank-Cooldowns erw"; VUHDO_I18N_BOUQUET_HOLY_POWER_EQUALS = "Flag: Eigene Heilige Macht =="; VUHDO_I18N_DEF_PLAYER_HOLY_POWER = "Heilige Macht Spieler"; VUHDO_I18N_CUSTOM_ICON_ONE_THIRD = "Drittel: Eins"; VUHDO_I18N_CUSTOM_ICON_TWO_THIRDS = "Drittel: Zwei"; VUHDO_I18N_CUSTOM_ICON_THREE_THIRDS = "Drittel: Drei"; VUHDO_I18N_DEF_ROLE_ICON = "Rollen-Icon"; VUHDO_I18N_DEF_BOUQUET_TARGET_HEALTH = "Leben: (auto, Ziele)"; VUHDO_I18N_TAPPED_COLOR = "Flag: Getappt"; VUHDO_I18N_ENEMY_STATE_COLOR = "Farbe: Freund/Feind"; VUHDO_I18N_BOUQUET_STATUS_ALWAYS_FULL = "Statusbar: Immer voll"; VUHDO_I18N_BOUQUET_STATUS_FULL_IF_ACTIVE = "Statusbar: voll wenn aktiv"; VUHDO_I18N_AOE_ADVICE = "Icon: Gruppenheilung"; VUHDO_I18N_DEF_AOE_ADVICE = "Hinweis Gruppenheilung"; VUHDO_I18N_BOUQUET_DURATION_ABOVE = "Flag: Dauer > sec"; VUHDO_I18N_BOUQUET_DURATION_BELOW = "Flag: Dauer < sec"; VUHDO_I18N_DEF_WRACK = "Sinestra: Zermürben"; VUHDO_I18N_DEF_DIRECTION_ARROW = "Richtungspfeil"; VUHDO_I18N_BOUQUET_DIRECTION_ARROW = "Richtungspfeil"; VUHDO_I18N_DEF_RAID_LEADER = "Icon: Raid-Leiter"; VUHDO_I18N_DEF_RAID_ASSIST = "Icon: Raid-Assistent"; VUHDO_I18N_DEF_MASTER_LOOTER = "Icon: Loot-Meister"; VUHDO_I18N_DEF_PVP_STATUS = "Icon: PvP-Status"; VUHDO_I18N_GRID_MOUSEOVER_SINGLE = "Grid: Mouseover Einzeln"; VUHDO_I18N_GRID_BACKGROUND_BAR = "Grid: Hintergrund"; VUHDO_I18N_DEF_BIT_O_GRID = "Bit'o'Grid"; VUHDO_I18N_DEF_VUHDO_ESQUE = "Vuhdo'esque"; VUHDO_I18N_DEF_ROLE_COLOR = "Rollen-Farbe"; VUHDO_I18N_BOUQUET_ROLE_TANK = "Flag: Rolle Tank"; VUHDO_I18N_BOUQUET_ROLE_DAMAGE = "Flag: Rolle Damage-Dealer"; VUHDO_I18N_BOUQUET_ROLE_HEALER = "Flag: Rolle Heiler"; VUHDO_I18N_BOUQUET_STACKS = "Flag: Stacks >"; VUHDO_I18N_BOUQUET_TARGET_RAID_ICON = "Icon: Ziel-Schlachtzugsymbol"; VUHDO_I18N_BOUQUET_OWN_CHI_EQUALS = "Flag: Eigenes Chi =="; VUHDO_I18N_CUSTOM_ICON_FOUR_THIRDS = "Drittel: Vier"; VUHDO_I18N_CUSTOM_ICON_FIVE_THIRDS = "Drittel: Fünf"; VUHDO_I18N_DEF_RAID_CDS = "Raid Cooldowns"; VUHDO_I18N_BOUQUET_STATUS_CLASS_COLOR_IF_ACTIVE = "Flag: Klassenfarbe wenn aktiv"; VUHDO_I18N_DEF_PVP_FLAGS="PvP-Flaggenträger"; VUHDO_I18N_DEF_STATUS_SHIELD = "Statusbar: Schilde"; VUHDO_I18N_TARGET = "Ziel"; VUHDO_I18N_FOCUS = "Fokus"; VUHDO_I18N_DEF_STATUS_OVERSHIELDED = "Statusbar: Überschildung"; -- 3.65 VUHDO_I18N_BOUQUET_OUTSIDE_ZONE = "Flag: Player Zone, outside"; VUHDO_I18N_BOUQUET_INSIDE_ZONE = "Flag: Player Zone, inside"; VUHDO_I18N_BOUQUET_WARRIOR_TANK = "Flag: Role Tank, Warrior"; VUHDO_I18N_BOUQUET_PALADIN_TANK = "Flag: Role Tank, Paladin"; VUHDO_I18N_BOUQUET_DK_TANK = "Flag: Role Tank, Death Knight"; VUHDO_I18N_BOUQUET_MONK_TANK = "Flag: Role Tank, Monk"; VUHDO_I18N_BOUQUET_DRUID_TANK = "Flag: Role Tank, Druid"; -- 3.66 VUHDO_I18N_BOUQUET_PALADIN_BEACON = "Paladin Beacon"; VUHDO_I18N_BOUQUET_STATUS_EXCESS_ABSORB = "Statusbar: Excess Absorption %"; VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %"; -- 3.67 VUHDO_I18N_NO_BOSS = "[no NPC]"; VUHDO_I18N_BOSSES = "NPCs"; -- 3.71 VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag"; VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:"; VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:"; VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources."; VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:"; -- 3.72 VUHDO_I18N_BOUQUET_DEMON_HUNTER_TANK = "Flag: Role Tank, Demon Hunter"; VUHDO_I18N_DEMON_HUNTERS = "Demon Hunters"; -- 3.77 VUHDO_I18N_DEF_COUNTER_OVERFLOW_ABSORB = "Counter: Mythic+ Overflow Absorb #k"; -- 3.79 VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!"; -- 3.81 VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix"; -- 3.82 VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace"; VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace"; VUHDO_I18N_TRAIL_OF_LIGHT = "Icon: Trail of Light"; VUHDO_I18N_DEF_TRAIL_OF_LIGHT = "Trail of Light"; -- 3.83 VUHDO_I18N_BOUQUET_STATUS_MANA_HEALER_ONLY = "Statusbar: Mana % (Healer Only)"; VUHDO_I18N_DEF_BOUQUET_BAR_MANA_HEALER_ONLY = "Manabars: Mana (Healer Only)"; -- 3.98 VUHDO_I18N_BOUQUET_HAS_SUMMON_ICON = "Icon: Has Summon"; VUHDO_I18N_DEF_BOUQUET_HAS_SUMMON = "Summon Status Icon"; VUHDO_I18N_DEF_BOUQUET_ROLE_AND_SUMMON = "Role & Summon Status Icon";
--------------------------------------------------------------------------- -- Recording Input while Rewinding Playback frame-by-frame -- by AnS, 2012 --------------------------------------------------------------------------- -- Showcases following functions: -- * joypad.getimmediate() -- * taseditor.getrecordermode() -- * taseditor.getsuperimpose() -- * taseditor.getinput() -- * taseditor.setinput() -- * taseditor.clearinputchanges() -- * taseditor.applyinputchanges() --------------------------------------------------------------------------- -- Usage: -- Run the script, unpause emulation (or simply Frame Advance once). -- Now you can hold some joypad buttons and press "Rewind Frame" hotkey -- to Record those buttons into PREVIOUS frame. -- Try using this crazy method alongside with Frame Advance Recording. -- This script supports multitracking and superimpose. Doesn't support Patterns. --------------------------------------------------------------------------- -- This function reads joypad input table and converts it to single byte function GetCurrentInputByte(player) input_byte = 0; input_table = joypad.getimmediate(player); if (input_table ~= nil) then -- A B select start up down left right if (input_table.A) then input_byte = OR(input_byte, 1) end; if (input_table.B) then input_byte = OR(input_byte, 2) end; if (input_table.select) then input_byte = OR(input_byte, 4) end; if (input_table.start) then input_byte = OR(input_byte, 8) end; if (input_table.up) then input_byte = OR(input_byte, 16) end; if (input_table.down) then input_byte = OR(input_byte, 32) end; if (input_table.left) then input_byte = OR(input_byte, 64) end; if (input_table.right) then input_byte = OR(input_byte, 128) end; end return input_byte; end function reversed_recorder() if taseditor.engaged() then playback_position = movie.framecount(); if (playback_position == (playback_last_position - 1)) then -- Playback cursor moved up 1 frame, probably Rewind was used this frame if (not movie.readonly()) then -- Recording on recording_mode = taseditor.getrecordermode(); superimpose = taseditor.getsuperimpose(); taseditor.clearinputchanges(); name = "Record"; if (recording_mode == "All") then -- Recording all 4 joypads for target_player = 1, 4 do new_joypad_input = GetCurrentInputByte(target_player); old_joypad_input = taseditor.getinput(playback_position, target_player); -- Superimpose with old input if needed if (superimpose == 1 or (superimpose == 2 and new_joypad_input == 0)) then new_joypad_input = OR(new_joypad_input, old_joypad_input); end -- Add joypad info to name if (new_joypad_input ~= old_joypad_input) then name = name .. "(" .. target_player .. "P)"; end taseditor.submitinputchange(playback_position, target_player, new_joypad_input); end -- Write to movie data taseditor.applyinputchanges(name); else -- Recording target_player using 1P keys new_joypad_input = GetCurrentInputByte(1); target_player = 1; if (recording_mode == "2P") then target_player = 2 end; if (recording_mode == "3P") then target_player = 3 end; if (recording_mode == "4P") then target_player = 4 end; old_joypad_input = taseditor.getinput(playback_position, target_player); -- Superimpose with old input if needed if (superimpose == 1 or (superimpose == 2 and new_joypad_input == 0)) then new_joypad_input = OR(new_joypad_input, old_joypad_input); end -- Add joypad info to name if (new_joypad_input ~= old_joypad_input) then name = name .. "(" .. recording_mode .. ")"; end -- Write to movie data taseditor.submitinputchange(playback_position, target_player, new_joypad_input); taseditor.applyinputchanges(name); end end end playback_last_position = playback_position; else gui.text(1, 9, "TAS Editor is not engaged."); end end playback_last_position = movie.framecount(); taseditor.registerauto(reversed_recorder);
local Dta = select(2, ...) Dta.move = {} ------------------------------- -- POSITION CHECKBOXES / BUTTON HANDLERS ------------------------------- function Dta.move.ModeSwapped(move_ui) move_ui.x:SwapText() move_ui.y:SwapText() move_ui.z:SwapText() end function Dta.move.modifyPositionModeAbsChanged() local move_ui = Dta.Tools.Move.window.modifyPosition -- both checked means we are now switching mode if move_ui.modeAbs:GetChecked() and move_ui.modeRel:GetChecked() then move_ui.modeRel:SetChecked(false) move_ui.moveAsGrp:CBSetEnabled(true) move_ui.modeLocal:CBSetEnabled(false) Dta.move.ModeSwapped(move_ui) elseif not move_ui.modeRel:GetChecked() then move_ui.modeAbs:SetChecked(true) end end function Dta.move.modifyPositionModeRelChanged() local move_ui = Dta.Tools.Move.window.modifyPosition -- both checked means we are now switching mode if move_ui.modeRel:GetChecked() and move_ui.modeAbs:GetChecked() then move_ui.modeAbs:SetChecked(false) move_ui.moveAsGrp:CBSetEnabled(false) move_ui.modeLocal:CBSetEnabled(true) Dta.move.ModeSwapped(move_ui) elseif not move_ui.modeAbs:GetChecked() then move_ui.modeRel:SetChecked(true) end end function Dta.move.modifyPositionButtonClicked() if Dta.selectionCount <= 0 then Dta.CPrint(Dta.Locale.Prints.ModifyPosition) return end local move_ui = Dta.Tools.Move.window.modifyPosition local settings, ok = {}, {} settings.x, ok.x = Dta.ui.checkNumber(move_ui.x:GetText(), nil) settings.y, ok.y = Dta.ui.checkNumber(move_ui.y:GetText(), nil) settings.z, ok.z = Dta.ui.checkNumber(move_ui.z:GetText(), nil) if not (ok.x and ok.y and ok.z) then Dta.CPrint(Dta.Locale.Prints.NumbersOnly) return end settings.relative = move_ui.modeRel:GetChecked() settings.grouped = move_ui.moveAsGrp:GetChecked() settings.local_axis = move_ui.modeLocal:GetChecked() Dta.move.setItemPositions(settings) end function Dta.move.modifyPositionResetButtonClicked() Dta.move.resetItemPositions() end function Dta.move.fetchXButtonClicked() if Dta.Tools.Move.window.modifyPosition.modeRel:GetChecked() then Dta.Tools.Move.window.modifyPosition.x:SetText("0") elseif Dta.selectionCenter then Dta.Tools.Move.window.modifyPosition.x:SetText(tostring(Dta.items.round(Dta.selectionCenter.x, 4))) end end function Dta.move.fetchYButtonClicked() if Dta.Tools.Move.window.modifyPosition.modeRel:GetChecked() then Dta.Tools.Move.window.modifyPosition.y:SetText("0") elseif Dta.selectionCenter then Dta.Tools.Move.window.modifyPosition.y:SetText(tostring(Dta.items.round(Dta.selectionCenter.y, 4))) end end function Dta.move.fetchZButtonClicked() if Dta.Tools.Move.window.modifyPosition.modeRel:GetChecked() then Dta.Tools.Move.window.modifyPosition.z:SetText("0") elseif Dta.selectionCenter then Dta.Tools.Move.window.modifyPosition.z:SetText(tostring(Dta.items.round(Dta.selectionCenter.z, 4))) end end function Dta.move.fetchAllButtonClicked() Dta.move.fetchXButtonClicked() Dta.move.fetchYButtonClicked() Dta.move.fetchZButtonClicked() end -------------------------------------- --MOVE ONE ITEM -------------------------------------- function Dta.move.setItemPosition(details, x, y, z, relative, local_axis) if details then local newX, newY, newZ if relative then -- relative positioning if local_axis then local vec = { x or 0, y or 0, z or 0 } local m_rot = Dta.Matrix.createZYX(details.pitch, details.yaw, details.roll, true) vec = Dta.Matrix.Transform(m_rot, vec) newX = details.coordX + vec[1] newY = details.coordY + vec[2] newZ = details.coordZ + vec[3] else if x then newX = details.coordX + x end if y then newY = details.coordY + y end if z then newZ = details.coordZ + z end end Dta.items.QueueMove(details.id, newX, newY, newZ) else -- absolute positioning Dta.items.QueueMove(details.id, x, y, z) end end end -------------------------------------- --MOVE MULTIPLE ITEMS -------------------------------------- function Dta.move.setItemPositions(settings) if not settings.relative and settings.grouped and Dta.selectionCount > 1 then -- group move local cp = Dta.items.getCentralPoint(Dta.selectedItems) local deltaX, deltaY, deltaZ if settings.x then deltaX = settings.x - cp.x end if settings.y then deltaY = settings.y - cp.y end if settings.z then deltaZ = settings.z - cp.z end for k, details in pairs(Dta.selectedItems) do Dta.move.setItemPosition(details, deltaX, deltaY, deltaZ, true, settings.local_axis) end else for k, details in pairs(Dta.selectedItems) do Dta.move.setItemPosition(details, settings.x, settings.y, settings.z, settings.relative, settings.local_axis) end end Dta.items.QueueNotification(Dta.Locale.Prints.ProcessFinished, Dta.selectionCount) end -------------------------------------- --RESET ITEMS TO PLAYER POSITION -------------------------------------- function Dta.move.resetItemPositions() if Dta.selectionCount > 0 then local player = Inspect.Unit.Detail("player") Dta.move.Co_MoveItemReset = coroutine.create(function () for k, details in pairs(Dta.selectedItems) do Dta.move.setItemPosition(details, player.coordX, player.coordY + 0.1, player.coordZ, false) end end) coroutine.resume(Dta.move.Co_MoveItemReset) Dta.items.QueueNotification(Dta.Locale.Prints.ProcessFinished, Dta.selectionCount) end end
-- Super Mario Sunshine (PAL v1.0) local core = require("games.core") return core.newGame(0x803FBBF4)
function binInventoryChange() if entity.id() then local container = entity.id() local frames = entity.configParameter("binFrames", 9) local fill = math.ceil(frames * fillPercent(container)) if self.fill ~= fill then self.fill = fill entity.setAnimationState("fill", tostring(fill)) end end end function fillPercent(container) if type(container) ~= "number" then return nil end local size = world.containerSize(container) local count = 0 for i = 0,size,1 do local item = world.containerItemAt(container, i) if item ~= nil then count = count + 1 end end return (count/size) end
local TokenBuffer = assert(yatm_oku.TokenBuffer) local match_tokens = assert(yatm_oku.match_tokens) local string_pad_leading = assert(foundation.com.string_pad_leading) local string_rsub = assert(foundation.com.string_rsub) local string_hex_pair_to_byte = assert(foundation.com.string_hex_pair_to_byte) local Parser = {} local m = Parser local function atom_value(token) return token[2] end local function parse_comment(token_buf, result) if token_buf:scan("ws", "comment", "nl") then return true elseif token_buf:scan("comment", "nl") then return true elseif token_buf:scan("ws", "comment") then return true elseif token_buf:skip("comment") then return true end return false end local function parse_label(token_buf, result) local tokens = token_buf:scan("atom", ":") if tokens then result:push_token("label", atom_value(tokens[1])) return true end return false end local function parse_line_term(token_buf, result) if token_buf:scan("ws", "nl") then return true elseif token_buf:scan("nl") then return true elseif token_buf:scan("ws", "comment", "nl") then return true elseif token_buf:scan("comment", "nl") then return true end return false end local function parse_register_name_or_atom(token_buf) local token = token_buf:scan_one("atom") if token then local name = atom_value(token) if name == "X" or name == "x" then return {"register_x", true} elseif name == "Y" or name == "y" then return {"register_y", true} else -- return a new atom return {"atom", name} end end return nil end local function hex_token_to_byte(token) local hex_value = token[2] if #hex_value < 2 then -- TODO: issue warning, the value was padded hex_value = string_pad_leading(hex_value, 2, "0") elseif #hex_value > 2 then -- TODO: issue warning, the value was truncated hex_value = string_rsub(hex_value, 2) end return string_hex_pair_to_byte(hex_value) end local function hex_token_to_num(token) local hex_value = token[2] if #hex_value > 2 then hex_value = string_pad_leading(hex_value, 4, "0") hex_value = string_rsub(hex_value, 4) local hipair = string.sub(hex_value, 1, 2) local lopair = string.sub(hex_value, 3, 4) return hipair * 256 + lopair else return hex_token_to_byte(token) end end local function parse_absolute_or_zeropage_address(token_buf) local token = token_buf:scan_one("integer") or token_buf:scan_one("hex") if token then if token[1] == "hex" then local hex_value = token[2] if #hex_value <= 2 then hex_value = string_pad_leading(hex_value, 2, "0") local value = string_hex_pair_to_byte(hex_value) return {"zeropage", value} else hex_value = string_pad_leading(hex_value, 4, "0") hex_value = string_rsub(hex_value, 4) local hipair = string.sub(hex_value, 1, 2) local lopair = string.sub(hex_value, 3, 4) return {"absolute", hipair * 256 + lopair} end else local value = token[2] if value > 255 then return {"absolute", value} else return {"zeropage", value} end end end return nil end local function parse_immediate(token_buf) local tokens = token_buf:scan("#", "hex") or token_buf:scan("#", "integer") if tokens then local token = tokens[2] local value if token[1] == "hex" then value = hex_token_to_byte(token) elseif token[1] == "integer" then value = math.min(math.max(-128, token[2]), 255) else error("expected an integer or hex") end return {"immediate", value} end return nil end local function parse_indirect_offset(token_buf) if token_buf:skip("(") then local result = {} while not token_buf:isEOB() do token_buf:skip("ws") -- skip leading spaces local token = token_buf:scan_one("hex") or token_buf:scan_one("integer") or parse_register_name_or_atom(token_buf) if token then table.insert(result, token) token_buf:skip("ws") if token_buf:skip(",") then -- can continue else break end else break end end token_buf:skip("ws") -- skip trailing spaces if token_buf:skip(")") then if #result == 2 then if match_tokens(result, 1, #result, {"hex", "register_x"}) then return {"indirect_x", hex_token_to_byte(result[1])} elseif match_tokens(result, 1, #result, {"integer", "register_x"}) then return {"indirect_x", result[1][2]} else error("unexpected indirect args") end elseif #result == 1 then if match_tokens(result, 1, #result, {"hex"}) then return {"indirect", hex_token_to_num(result[1])} elseif match_tokens(result, 1, #result, {"integer"}) then return {"indirect", result[1][2]} else error("unexpected token") end else error("invalid number of arguments expected 1 or 2 got " .. #result) end else error("invalid indirect syntax, expected (hex | integer[,atom])") end end return nil end local function parse_ins_arg(token_buf) return parse_register_name_or_atom(token_buf) or parse_absolute_or_zeropage_address(token_buf) or parse_immediate(token_buf) or parse_indirect_offset(token_buf) end local function tokens_to_addressing_mode(result) -- -- TODO: Support variable substitution -- Example: -- ADC #word -- ADC word -- if #result == 0 then return {} elseif #result == 1 then if match_tokens(result, 1, 1, {"indirect_x"}) then return result elseif match_tokens(result, 1, 1, {"absolute"}) then return result elseif match_tokens(result, 1, 1, {"immediate"}) then return result elseif match_tokens(result, 1, 1, {"zeropage"}) then return result elseif match_tokens(result, 1, 1, {"register_a"}) then return result else error("invalid 1 argument pattern") end elseif #result == 2 then if match_tokens(result, 1, 2, {"absolute", "register_x"}) then return {{"absolute_x", result[1][2]}} elseif match_tokens(result, 1, 2, {"absolute", "register_y"}) then return {{"absolute_y", result[1][2]}} elseif match_tokens(result, 1, 2, {"indirect", "register_y"}) then return {{"indirect_y", result[1][2]}} elseif match_tokens(result, 1, 2, {"zeropage", "register_y"}) then return {{"zeropage_y", result[1][2]}} elseif match_tokens(result, 1, 2, {"zeropage", "register_x"}) then return {{"zeropage_x", result[1][2]}} else error("invalid 2 argument pattern") end else error("invalid number of arguments expected 0, 1 or 2 got " .. #result) end end local function parse_ins_args(token_buf) local result = {} while not token_buf:isEOB() do token_buf:skip("ws") local token = parse_ins_arg(token_buf) if token then table.insert(result, token) token_buf:skip("ws") if token_buf:skip(",") then -- else break end else break end end return tokens_to_addressing_mode(result) end local function parse_ins(token_buf, result) token_buf:skip("ws") local ins = token_buf:scan_one("atom") if ins then local args = parse_ins_args(token_buf) parse_line_term(token_buf, result) result:push_token("ins", { name = string.lower(atom_value(ins)), args = args }) return true end return false end function m.parse(token_buf) local result = TokenBuffer:new({}, 'w') while not token_buf:isEOB() do if parse_line_term(token_buf, result) then -- elseif parse_label(token_buf, result) then -- elseif parse_ins(token_buf, result) then -- else break end end return result end yatm_oku.OKU.isa.MOS6502.Parser = Parser
--------------------------------- --! @file TimeMeasure.lua --! @brief 時間計測ヘルパ関数定義 --------------------------------- --[[ Copyright (c) 2017 Nobuhiko Miyamoto ]] local TimeMeasure= {} --_G["openrtm.TimeMeasure"] = TimeMeasure TimeMeasure.new = function() local obj = {} return obj end return TimeMeasure
local Log = require "log" local io = require "io" local os = require "os" local string = require "string" local date = require "date" local lfs = require "lfs" local DIR_SEP = package.config:sub(1,1) local IS_WINDOWS = DIR_SEP == '\\' local function remove_dir_end(str) return (string.gsub(str, '[\\/]+$', '')) end local function ensure_dir_end(str) return remove_dir_end(str) .. DIR_SEP end local function path_normolize_sep(P) return (string.gsub(P, '\\', DIR_SEP):gsub('/', DIR_SEP)) end local function path_fullpath(P) P = path_normolize_sep(P) local ch1, ch2 = P:sub(1,1), P:sub(2,2) if IS_WINDOWS then if ch1 == DIR_SEP then -- \temp => c:\temp local cwd = lfs.currentdir() local disk = cwd:sub(1,2) P = disk .. P elseif ch1 == '~' then -- ~\temp local base = os.getenv('USERPROFILE') or (os.getenv('HOMEDRIVE') .. os.getenv('HOMEPATH')) P = ((ch2 == DIR_SEP) and remove_dir_end(base) or ensure_dir_end(base)) .. string.sub(P,2) elseif ch2 ~= ':' then P = ensure_dir_end(lfs.currentdir()) .. P end else if ch1 == '~' then -- ~/temp local base = os.getenv('HOME') P = ((ch2 == DIR_SEP) and remove_dir_end(base) or ensure_dir_end(base)) .. string.sub(P,2) else if P:sub(1,1) ~= '/' then P = ensure_dir_end(lfs.currentdir()) .. P end end end P = string.gsub(P, DIR_SEP .. '%.' .. DIR_SEP, DIR_SEP):gsub(DIR_SEP .. DIR_SEP, DIR_SEP) while true do local first, last = string.find(P, DIR_SEP .. "[^".. DIR_SEP .. "]+" .. DIR_SEP .. '%.%.' .. DIR_SEP) if not first then break end P = string.sub(P, 1, first) .. string.sub(P, last+1) end return P end local function attrib(P, ...) if IS_WINDOWS then if #P < 4 and P:sub(2,2) == ':' then P = ensure_dir_end(P) -- c: => c:\ else P = remove_dir_end(P) -- c:\temp\ => c:\temp end end return lfs.attributes(P, ...) end local function path_exists(P) return attrib(P,'mode') ~= nil and P end local function path_isdir(P) return attrib(P,'mode') == 'directory' and P end local function path_mkdir(P) local P = path_fullpath(P) local p = '' for str in string.gmatch(ensure_dir_end(P), '.-' .. DIR_SEP) do p = p .. str if path_exists(p) then if not path_isdir(p) then return nil, 'can not create ' .. p end else local ok, err = lfs.mkdir(remove_dir_end(p)) if not ok then return nil, err .. ' ' .. p end end end return true end local function path_getctime(P) return attrib(P,'change') end local function path_getmtime(P) return attrib(P,'modification') end local function path_getatime(P) return attrib(P,'access') end local function path_getsize(P) return attrib(P, 'size') end local function path_getrows(P) local f, err = io.open(P, "r") if not f then return 0 end local count = 0 for _ in f:lines() do count = count + 1 end f:close() return count end local function path_remove(P) return os.remove(P) end local function path_rename(from,to) path_remove(to) return os.rename(from, to) end local function reset_out(FileName, rewrite) local END_OF_LINE = '\n' local FILE_APPEND = 'a' if rewrite then local FILE_REWRITE = 'w+' local f, err = io.open(FileName , FILE_REWRITE); if not f then return nil, err end f:close(); end return function (msg) local f, err = io.open(FileName, FILE_APPEND) if not f then return nil, err end f:write(msg, END_OF_LINE) f:close() end end local function make_no_close_reset(flush_interval) return function (FileName, rewrite) local END_OF_LINE = '\n' local FILE_APPEND = 'a' if rewrite then local FILE_REWRITE = 'w+' local f, err = io.open(FileName, FILE_REWRITE); if not f then return nil, err end f:close() end local f, err = io.open(FileName, FILE_APPEND); if not f then return nil, err end local writer if flush_interval then local flush_interval, counter = flush_interval, 0 writer = function (msg) f:write(msg, END_OF_LINE) counter = counter + 1 if counter >= flush_interval then f:flush() counter = 0 end end else writer = function (msg) f:write(msg, END_OF_LINE) end end return writer, function() f:close() end end end local function split_ext(fname) local s1, s2 = string.match(fname, '([^\\/]*)([.][^.\\/]*)$') if s1 then return s1, s2 end s1 = string.match(fname, '([^\\/]+)$') if s1 then return s1, '' end end local function assert_2(f1, f2, v1, v2) assert(f1 == v1, string.format( "Expected '%s' got '%s'", tostring(f1), tostring(v1))) assert(f2 == v2, string.format( "Expected '%s' got '%s'", tostring(f2), tostring(v2))) end assert_2("events", ".log", split_ext("events.log")) assert_2("events", '', split_ext("events")) assert_2(nil, nil, split_ext("events\\")) assert_2('', '.log', split_ext("events\\.log")) assert_2('log', '', split_ext("events\\log")) local file_logger = {} local FILE_LOG_DATE_FMT = "%Y%m%d" local EOL_SIZE = IS_WINDOWS and 2 or 1 local function get_file_date(fname) local mdate = path_getmtime(fname) if mdate then mdate = date(mdate):tolocal() else mdate = date() end return mdate:fmt(FILE_LOG_DATE_FMT) end function file_logger:close() if self.private_.logger and self.private_.logger_close then self.private_.logger_close() end self.private_.logger = nil self.private_.logger_close = nil end function file_logger:open() local full_name = self:current_name() local logger, err = self.private_.reset_out(full_name) if not logger then return nil, string.format("can not create logger for file '%s':", full_name, err) end self.private_.logger = logger self.private_.logger_close = err self.private_.log_date = os.date(FILE_LOG_DATE_FMT) self.private_.log_rows = 0 self.private_.log_size = 0 return true end function file_logger:current_name() return self.private_.log_dir .. self.private_.log_name end function file_logger:archive_roll_name(i) return self.private_.log_dir .. string.format("%s.%.5d.log", self.private_.arc_pfx, i) end function file_logger:archive_date_name(d, i) return self.private_.log_dir .. string.format("%s.%s.%.5d.log", self.private_.arc_pfx, d, i) end function file_logger:reset_log_by_roll() self:close() local full_name = self:current_name() local first_name = self:archive_roll_name(1) -- we must "free" space for current file if path_exists(first_name) then for i = self.private_.roll_count - 1, 1, -1 do local fname1 = self:archive_roll_name(i) local fname2 = self:archive_roll_name(i + 1) path_rename(fname1, fname2) end end if path_exists(full_name) then local ok, err = path_rename(full_name, first_name) if not ok then return nil, string.format("can not rename '%s' to '%s' : %s", full_name, first_name, err or '') end end return self:open() end function file_logger:next_date_name(log_date) local id = self.private_.id local fname = self:archive_date_name(log_date, id) while path_exists(fname) do id = id + 1 fname = self:archive_date_name(log_date, id) end self.private_.id = id return fname end function file_logger:reset_log_by_date(log_date) self:close() local full_name = self:current_name() if path_exists(full_name) then -- previews file log_date = log_date or get_file_date(full_name) local next_fname = self:next_date_name(log_date) local ok, err = path_rename(full_name, next_fname) if not ok then return nil, string.format("can not rename '%s' to '%s' : ", full_name, next_fname, err or '') end end return self:open() end function file_logger:reset_log(...) if self.private_.roll_count then return self:reset_log_by_roll(...) end return self:reset_log_by_date(...) end function file_logger:check() if self.private_.by_day then local now = os.date(FILE_LOG_DATE_FMT) if self.private_.log_date ~= now then local ok, err = self:reset_log_by_date(self.private_.log_date) self.private_.id = 1 return ok, err end end if self.private_.max_rows and (self.private_.log_rows >= self.private_.max_rows) then return self:reset_log() end if self.private_.max_size and (self.private_.log_size >= self.private_.max_size) then return self:reset_log() end return true end function file_logger:write(msg) local ok, err = self:check() if not ok then io.stderr:write("logger error: ", err, '\n') return end self.private_.logger(msg) self.private_.log_rows = self.private_.log_rows + 1 self.private_.log_size = self.private_.log_size + #msg + EOL_SIZE end function file_logger:init(opt) if(opt.by_day or opt.roll_count)then assert(not(opt.by_day and opt.roll_count), "Can not set 'by_day' and 'roll_count' fields at the same time!" ) end assert(opt.log_name, 'field log_name is required') local log_dir = path_fullpath(opt.log_dir or '.') if path_exists(log_dir) then assert(path_isdir(log_dir)) else assert(path_mkdir(log_dir)) end local log_name, log_ext = string.match(opt.log_name, '([^\\/]+)([.][^.\\/]+)$') assert(log_name and log_ext) log_dir = ensure_dir_end( log_dir ) local full_name = log_dir .. log_name .. log_ext local current_size = path_getsize(full_name) if 0 == current_size then -- prevent rename zero size logfile path_remove(full_name) end local flush_interval = opt.flush_interval and assert(tonumber(opt.flush_interval), 'flush_interval must be a number') or 1 self.private_ = { -- options log_dir = log_dir; log_name = log_name .. log_ext; max_rows = opt.max_rows or math.huge; max_size = opt.max_size or math.huge; reset_out = opt.close_file and reset_out or make_no_close_reset(flush_interval); arc_pfx = opt.archive_prefix or log_name; roll_count = opt.roll_count and assert(tonumber(opt.roll_count), 'roll_count must be a number'); by_day = not not opt.by_day; -- state -- log_date = ; -- date when current log file was create -- log_rows = 0; -- how many lines in current log file -- log_size = 0; id = 1; -- numbers of file in current log_date } if self.private_.roll_count then assert(self.private_.roll_count > 0) end local reuse_log = opt.reuse if reuse_log and current_size and (current_size > 0) then self.private_.log_date = get_file_date(full_name) if opt.max_rows then self.private_.log_rows = path_getrows(full_name) or 0 else self.private_.log_rows = 0 end if opt.max_size then self.private_.log_size = path_getsize(full_name) or 0 else self.private_.log_size = 0 end local logger, err = self.private_.reset_out(full_name) if not logger then error(string.format("can not create logger for file '%s':", full_name, err)) end self.private_.logger = logger self.private_.logger_close = err else assert(self:reset_log()) end return self end function file_logger:new(...) local o = setmetatable({}, {__index = self}):init(...) Log.add_cleanup(function() o:close() end) return o end local function do_profile() require "profiler".start() local logger = file_logger:new{ log_dir = './logs'; log_name = "events.log"; max_rows = 1000; max_size = 70; roll_count = 11; -- by_day = true; close_file = false; flush_interval = 1; reuse = true } for i = 1, 10000 do local msg = string.format("%5d", i) logger:write(msg) end logger:close() end return file_logger
print( "yowhat?" ) print( 3 + 2 ) a = 1
-- -------------------------------------------------------- -- static background image local file = ... -- We want the Shared BG to be used on the following screens. local SharedBackground = { ["ScreenInit"] = true, ["ScreenLogo"] = true, ["ScreenTitleMenu"] = true, ["ScreenTitleJoin"] = true, ["ScreenSelectProfile"] = true, ["ScreenAfterSelectProfile"] = true, -- hidden screen ["ScreenSelectColor"] = true, ["ScreenSelectStyle"] = true, ["ScreenSelectPlayMode"] = true, ["ScreenSelectPlayMode2"] = true, ["ScreenProfileLoad"] = true, -- hidden screen -- Operator Menu screens and sub screens. ["ScreenOptionsService"] = true, ["ScreenSystemOptions"] = true, ["ScreenMapControllers"] = true, ["ScreenTestInput"] = true, ["ScreenInputOptions"] = true, ["ScreenGraphicsSoundOptions"] = true, ["ScreenVisualOptions"] = true, ["ScreenAppearanceOptions"] = true, ["ScreenSetBGFit"] = true, ["ScreenOverscanConfig"] = true, ["ScreenArcadeOptions"] = true, ["ScreenAdvancedOptions"] = true, ["ScreenMenuTimerOptions"] = true, ["ScreenUSBProfileOptions"] = true, ["ScreenOptionsManageProfiles"] = true, ["ScreenThemeOptions"] = true, } local StaticBackgroundVideos = { ["Unaffiliated"] = THEME:GetPathG("", "_VisualStyles/SRPG6/Fog.mp4"), ["Democratic People's Republic of Timing"] = THEME:GetPathG("", "_VisualStyles/SRPG6/Ranni.mp4"), ["Footspeed Empire"] = THEME:GetPathG("", "_VisualStyles/SRPG6/Malenia.mp4"), ["Stamina Nation"] = THEME:GetPathG("", "_VisualStyles/SRPG6/Melina.mp4"), } local shared_alpha = 0.6 local static_alpha = 1 local af = Def.ActorFrame { InitCommand=function(self) self:diffusealpha(0) local style = ThemePrefs.Get("VisualStyle") self:visible(style == "SRPG6") self.IsShared = true end, OnCommand=function(self) self:accelerate(0.8):diffusealpha(1) end, ScreenChangedMessageCommand=function(self) local screen = SCREENMAN:GetTopScreen() local style = ThemePrefs.Get("VisualStyle") if screen and style == "SRPG6" then local static = self:GetChild("Static") local video = self:GetChild("Video") if SharedBackground[screen:GetName()] and not self.IsShared then static:visible(true) video:Load(THEME:GetPathG("", "_VisualStyles/SRPG6/Fog.mp4")) video:rotationx(180):blend("BlendMode_Add"):diffusealpha(shared_alpha):diffuse(color("#ffffff")) self.IsShared = true end if not SharedBackground[screen:GetName()] and self.IsShared then local faction = SL.SRPG6.GetFactionName(SL.Global.ActiveColorIndex) -- No need to change anything for Unaffiliated. -- We want to keep using the SharedBackground. if faction ~= "Unaffiliated" then static:visible(false) video:Load(StaticBackgroundVideos[faction]) video:rotationx(0):blend("BlendMode_Normal"):diffusealpha(static_alpha):diffuse(GetCurrentColor(true)) self.IsShared = false end end end end, VisualStyleSelectedMessageCommand=function(self) local style = ThemePrefs.Get("VisualStyle") if style == "SRPG6" then self:visible(true) else self:visible(false) end end, Def.Sprite { Name="Static", Texture=THEME:GetPathG("", "_VisualStyles/SRPG6/SharedBackground.png"), InitCommand=function(self) self:xy(_screen.cx, _screen.cy):zoomto(_screen.w, _screen.h):diffusealpha(shared_alpha) end, }, Def.Sprite { Name="Video", Texture=THEME:GetPathG("", "_VisualStyles/SRPG6/Fog.mp4"), InitCommand= function(self) self:xy(_screen.cx, _screen.cy):zoomto(_screen.w, _screen.h):rotationx(180):blend("BlendMode_Add"):diffusealpha(shared_alpha) end, }, } return af
local root = script.Parent.Parent local G = require(root.G) local Slider = {} Slider.__index = Slider Slider.New = function(label, parent, min, max, default, round, snapping) local self = setmetatable({}, Slider) self._maid = G.classes["Maid"].New() self.event = G.classes["Event"].New() self.label = label or "" self.parent = parent self.min = min or 1 self.max = max or 5 self.round = round or 0 self.default = default or 1 self.snapping = snapping or false self.mouseBtnPressed = false self.gui = Instance.new("Frame") self.nameLabel = Instance.new("TextLabel") self.sliderFrame = Instance.new("Frame") self.sliderLine = Instance.new("Frame") self.sliderDragger = Instance.new("TextButton") self.textBox = Instance.new("TextBox") self.textBox.MouseEnter:Connect(function() self.textBox.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item, Enum.StudioStyleGuideModifier.Hover) self.textBox.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border, Enum.StudioStyleGuideModifier.Hover) self.textBox.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText, Enum.StudioStyleGuideModifier.Hover) end) self.textBox.MouseLeave:Connect(function() self.textBox.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item, Enum.StudioStyleGuideModifier.Default) self.textBox.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border, Enum.StudioStyleGuideModifier.Default) self.textBox.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText, Enum.StudioStyleGuideModifier.Default) end) self:Init() return self end Slider.Init = function(self) self.gui.Size = UDim2.new(1, 0, 0, 24) self.gui.BackgroundTransparency = 1 self.gui.BorderSizePixel = 0 if self.parent then self.gui.Parent = self.parent end self.nameLabel.Text = self.label self.nameLabel.Font = Enum.Font.Arial self.nameLabel.TextSize = 12 self.nameLabel.Position = UDim2.new(0, 0, 0, 0) self.nameLabel.Size = UDim2.new(0, 120, 1, 0) self.nameLabel.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item) self.nameLabel.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border) self.nameLabel.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText) self.nameLabel.LayoutOrder = 1 self.nameLabel.Parent = self.gui self.sliderFrame.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item) self.sliderFrame.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border) self.sliderFrame.Position = UDim2.new(0, 121, 0, 0) self.sliderFrame.Size = UDim2.new(1, -121, 1, 0) self.sliderFrame.LayoutOrder = 2 self.sliderFrame.Parent = self.gui self.sliderLine.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.ScrollBarBackground) self.sliderLine.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border) self.sliderLine.Size = UDim2.new(1, -60, 0, 4) self.sliderLine.Position = UDim2.new(0, 10, 0.5, 0) self.sliderLine.AnchorPoint = Vector2.new(0, 0.5) self.sliderLine.Parent = self.sliderFrame self.sliderDragger.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.ScrollBar) self.sliderDragger.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border) self.sliderDragger.Size = UDim2.new(0, 6, 0, 18) self.sliderDragger.Position = UDim2.new(0, 0, 0.5, 0) self.sliderDragger.AnchorPoint = Vector2.new(0.5, 0.5) self.sliderDragger.Text = "" self.sliderDragger.AutoButtonColor = false self.sliderDragger.Parent = self.sliderLine self.textBox.Text = self.default self.textBox.Font = Enum.Font.Arial self.textBox.TextSize = 12 self.textBox.Position = UDim2.new(1, 0, 0, 0) self.textBox.Size = UDim2.new(0, 40, 1, 0) self.textBox.AnchorPoint = Vector2.new(1, 0) self.textBox.ClearTextOnFocus = false self.textBox.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item) self.textBox.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border) self.textBox.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText) self.textBox.LayoutOrder = 3 self.textBox.Parent = self.sliderFrame self.textBox.MouseEnter:Connect(function() self.textBox.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item, Enum.StudioStyleGuideModifier.Hover) self.textBox.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border, Enum.StudioStyleGuideModifier.Hover) self.textBox.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText, Enum.StudioStyleGuideModifier.Hover) end) self.textBox.MouseLeave:Connect(function() self.textBox.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Item, Enum.StudioStyleGuideModifier.Default) self.textBox.BorderColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.Border, Enum.StudioStyleGuideModifier.Default) self.textBox.TextColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText, Enum.StudioStyleGuideModifier.Default) end) self.textBox.FocusLost:Connect(function(enterPressed, inputThatCausedFocusLoss) local newValue = tonumber(self.textBox.Text) or self.default if self.round ~= 0 then newValue = G.modules["Functions"].Round(newValue, self.round) end if self.min > newValue then newValue = math.clamp(newValue, self.min, math.huge) end self.textBox.Text = newValue local xScalePos = self.textBox.Text/self.max self:Set(xScalePos) self.event:Call(self.textBox.Text) end) local detectMouseMoving local function startDetectingMouseMovement(input) detectMouseMoving = game:GetService("RunService").Heartbeat:Connect(function() if self.mouseBtnPressed then local mousePos = input.Position.X local sliderLine = self.sliderLine local frameSize = sliderLine.AbsoluteSize.X-- + (sliderLine.AbsoluteSize.X/2) local framePosition = sliderLine.AbsolutePosition.X-- + (sliderLine.AbsoluteSize.X) local xOffset = mousePos - framePosition local clampedXOffset = math.clamp(xOffset, 0, frameSize) -- Makes sure the dragger doesnt fall off the sliderFrame local xScalePos = (clampedXOffset) / frameSize self:Set(xScalePos) end end) end self.sliderDragger.InputBegan:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 then self.sliderDragger.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.ScrollBar, Enum.StudioStyleGuideModifier.Pressed) self.mouseBtnPressed = true end if input.UserInputType == Enum.UserInputType.MouseMovement then if detectMouseMoving == nil then startDetectingMouseMovement(input) end end end) self.sliderDragger.InputEnded:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 then self.sliderDragger.BackgroundColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.ScrollBar, Enum.StudioStyleGuideModifier.Default) self.mouseBtnPressed = false if detectMouseMoving then detectMouseMoving:Disconnect() detectMouseMoving = nil end self.event:Call(self.textBox.Text) end end) self._maid:Add(function() if detectMouseMoving then detectMouseMoving:Disconnect() detectMouseMoving = nil end end) self.sliderLine.InputBegan:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 then self.mouseBtnPressed = true local mousePos = input.Position.X local sliderLine = self.sliderLine local offset = sliderLine.AbsolutePosition.X-mousePos local scale = offset/self.sliderLine.AbsoluteSize.X local xScalePos = math.abs(scale) self:Set(xScalePos) startDetectingMouseMovement(input) end end) self.sliderLine.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then self.mouseBtnPressed = false if detectMouseMoving then detectMouseMoving:Disconnect() detectMouseMoving = nil end self.event:Call(self.textBox.Text) end end) self:Set(math.clamp(self.default/self.max, self.min, self.max)) end Slider.Set = function(self, value) local minValue = self.min local maxValue = self.max local decimalValue = G.modules["Functions"].Round(value, 2) local clampedDecimalValue = math.clamp(decimalValue, 0, 1) local newValue = minValue+(maxValue-minValue)*decimalValue self.value = maxValue*decimalValue if self.round ~= nil then newValue = G.modules["Functions"].Round(newValue, self.round) end local sliderScale = clampedDecimalValue if self.snapping then local decimalValue = value local newValue = maxValue*decimalValue local roundedValue = G.modules["Functions"].Round(newValue, self.round) sliderScale = roundedValue/maxValue end self.sliderDragger.Position = UDim2.new(sliderScale, 0, 0.5, 0) self.textBox.Text = newValue end Slider.Increment = function(self, increment) local maxValue = self.max local newValue = self.value+increment print(newValue) if self.round ~= nil then newValue = G.modules["Functions"].Round(newValue, self.round) end local xScalePos = newValue/maxValue local clampedxScalePosScalePos = math.clamp(xScalePos, 0, 1) self:Set(clampedxScalePosScalePos) end Slider.Destroy = function(self) self._maid:Destroy() end return Slider
-- A water mill produces LV EUs by exploiting flowing water across it -- It is a LV EU supplier and fairly low yield (max 180EUs) -- It is a little over half as good as the thermal generator. local S = technic.getter local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_alias("water_mill", "technic:water_mill") minetest.register_craft({ output = 'technic:water_mill', recipe = { {'technic:marble', 'default:diamond', 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } }) local function check_node_around_mill(pos) local node = minetest.get_node(pos) if node.name == "default:water_flowing" or node.name == "default:river_water_flowing" then return node.param2 -- returns approx. water flow, if any end return false end local run = function(pos, node) local meta = minetest.get_meta(pos) local water_flow = 0 local production_level = 0 local eu_supply = 0 local max_output = 4 * 45 -- keeping it around 180, little more than previous 150 :) local positions = { {x=pos.x+1, y=pos.y, z=pos.z}, {x=pos.x-1, y=pos.y, z=pos.z}, {x=pos.x, y=pos.y, z=pos.z+1}, {x=pos.x, y=pos.y, z=pos.z-1}, } for _, p in pairs(positions) do local check = check_node_around_mill(p) if check then water_flow = water_flow + check end end eu_supply = math.min(4 * water_flow, max_output) production_level = math.floor(100 * eu_supply / max_output) meta:set_int("LV_EU_supply", eu_supply) meta:set_string("infotext", S("Hydro %s Generator"):format("LV").." ("..production_level.."%)") if production_level > 0 and minetest.get_node(pos).name == "technic:water_mill" then technic.swap_node (pos, "technic:water_mill_active") meta:set_int("LV_EU_supply", 0) return end if production_level == 0 then technic.swap_node(pos, "technic:water_mill") end end minetest.register_node("technic:water_mill", { description = S("Hydro %s Generator"):format("LV"), tiles = { "technic_water_mill_top.png", "technic_machine_bottom.png"..cable_entry, "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png" }, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("LV")) meta:set_int("LV_EU_supply", 0) end, technic_run = run, }) minetest.register_node("technic:water_mill_active", { description = S("Hydro %s Generator"):format("LV"), tiles = {"technic_water_mill_top_active.png", "technic_machine_bottom.png", "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png"}, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), drop = "technic:water_mill", technic_run = run, technic_disabled_machine_name = "technic:water_mill", }) technic.register_machine("LV", "technic:water_mill", technic.producer) technic.register_machine("LV", "technic:water_mill_active", technic.producer)
--[[ Autoinstall plugin Licensed by Creative Commons Attribution-ShareAlike 4.0 http://creativecommons.org/licenses/by-sa/4.0/ Dev: TheHeroeGAC Designed By Gdljjrod & DevDavisNunez. Collaborators: BaltazaR4 & Wzjk. ]] local psvita_callback = function () menu_ps() end local psp_callback = function () menu_psp() end local downloads_callback = function () downloads() end local extras_callback = function () menu_extras() end local settings_callback = function () menu_settings() end local exit_callback = function () exit_bye_bye() end function menu_gral() local menu = { { text = LANGUAGE["MENU_PSVITA"], funct = psvita_callback }, { text = LANGUAGE["MENU_PSP"], funct = psp_callback }, { text = LANGUAGE["MENU_DOWNLOADS"],funct = downloads_callback }, { text = LANGUAGE["MENU_EXTRAS"], funct = extras_callback }, { text = LANGUAGE["MENU_SETTINGS"], funct = settings_callback }, { text = LANGUAGE["MENU_EXIT"], funct = exit_callback } } local scroll = newScroll(menu,#menu) buttons.interval(10,6) while true do menu = { { text = LANGUAGE["MENU_PSVITA"], funct = psvita_callback }, { text = LANGUAGE["MENU_PSP"], funct = psp_callback }, { text = LANGUAGE["MENU_DOWNLOADS"],funct = downloads_callback }, { text = LANGUAGE["MENU_EXTRAS"], funct = extras_callback }, { text = LANGUAGE["MENU_SETTINGS"], funct = settings_callback }, { text = LANGUAGE["MENU_EXIT"], funct = exit_callback } } buttons.read() if change then buttons.homepopup(0) else buttons.homepopup(1) end if back then back:blit(0,0) end draw.offsetgradrect(0,0,960,55,color.blue:a(85),color.blue:a(85),0x0,0x0,20) screen.print(480,20,LANGUAGE["MENU_TITLE"],1.2,color.white,0x0,__ACENTER) local y = 145 for i=scroll.ini, scroll.lim do if i == scroll.sel then draw.offsetgradrect(5,y-12,950,40,color.shine:a(75),color.shine:a(135),0x0,0x0,21) end screen.print(480,y,menu[i].text,1.2,color.white,0x0,__ACENTER) y += 45 end screen.flip() --Controls if buttons.up or buttons.analogly < -60 then scroll:up() end if buttons.down or buttons.analogly > 60 then scroll:down() end if buttons.accept then menu[scroll.sel].funct() end vol_mp3() end end menu_gral()
me = Game.Players.yfc rdist = 15 mod = Instance.new("Model") mod.Parent = me.Character mod.Name = "mod" local dist = rdist * 2 orb = Instance.new("Part") orb.Parent = mod orb.Name = "Head" orb.Shape = "Ball" orb.BrickColor = BrickColor.new("Mid grey") orb.Anchored = true orb.TopSurface = "Smooth" orb.BottomSurface = "Smooth" orb.Size = Vector3.new(2, 2, 2) orb.CanCollide = false local guimain1 = Instance.new("BillboardGui") guimain1.Parent = mod guimain1.Adornee = orb guimain1.Size = UDim2.new(0, 80, 0, 4) guimain1.StudsOffset = (Vector3.new(0, 2, 0)) T1 = Instance.new("TextLabel") T1.Parent = guimain1 T1.Size = UDim2.new(0, 0, 0, 0) T1.Position = UDim2.new(0, 0, 0, 0) T1.Text = "Dist : " ..dist T1.BackgroundTransparency = 1 T1.BackgroundColor = BrickColor.new(1003) T1.TextColor = BrickColor.new(1003) T1.FontSize = "Size18" local guimain2 = Instance.new("BillboardGui") guimain2.Parent = mod guimain2.Adornee = orb guimain2.Size = UDim2.new(0, 80, 0, 4) guimain2.StudsOffset = (Vector3.new(0, 8, 0)) T2 = Instance.new("TextLabel") T2.Parent = guimain2 T2.Size = UDim2.new(0, 0, 0, 0) T2.Position = UDim2.new(0, 0, 0, 0) T2.Text = "yfc's Guard ball, and admin :P" T2.BackgroundTransparency = 1 T2.BackgroundColor = BrickColor.new(1003) T2.TextColor = BrickColor.new(1003) T2.FontSize = "Size18" function onChatted(msg) if string.sub(msg, 1, 6) == "dist/ " then said = string.lower(string.sub(msg, 7)) dist = said wait() T1.Text = "Dist : " ..dist " " end end me.Chatted:connect(onChatted) while true do wait(0.001) orb.CFrame = me.Character.Head.CFrame + Vector3.new(0, 3, 0) end
return{ name= 'robot', type= 'vehicle', hasAttack = true, move = {'loop', {'2,1','1,1','3,1','1,1'}, .25}, attack = {'loop', {'1-3,1'}, .25}, height = 223, width = 216, xOffset= 40, yOffset= -17, }
local I18N = require("api.I18N") local Draw = require("api.Draw") local Gui = require("api.Gui") local Ui = require("api.Ui") local UiTheme = require("api.gui.UiTheme") local IUiLayer = require("api.gui.IUiLayer") local TopicWindow = require("api.gui.TopicWindow") local InputHandler = require("api.gui.InputHandler") local IInput = require("api.gui.IInput") local TextHandler = require("api.gui.TextHandler") local config = require("internal.config") local TextPrompt = class.class("TextPrompt", IUiLayer) TextPrompt:delegate("input", IInput) --- val(0): x --- val(1): y --- val(2): limit_length --- val(3): can_cancel --- val(4)>1: this is actually a NumberPrompt, initial input --- val(5): maximum number function TextPrompt:init(length, can_cancel, limit_length, autocenter, y_offset, initial_text, shadow) self.length = length or 16 self.width = math.max(16 * 16 + 60, utf8.wide_len(self.length) * 8) + 10 self.height = 36 self.can_cancel = can_cancel if can_cancel == nil then self.can_cancel = true end self.limit_length = limit_length if limit_length == nil then self.limit_length = true end self.autocenter = autocenter if autocenter == nil then self.autocenter = true end self.shadow = shadow if shadow == nil then self.shadow = true end self.y_offset = y_offset or 0 self.text = initial_text or "" self.display_text = "" self.cut_off = false self.frames = 0 self.caret_alpha = 2 self.win = TopicWindow:new(0, 2) self.input = InputHandler:new(TextHandler:new()) self.input:bind_keys(self:make_keymap()) self.input:halt_input() self:update_display_text() end function TextPrompt:make_keymap() return { text_entered = function(t) self.text = self.text .. t self:update_display_text() end, raw_backspace = function() self.text = utf8.pop(self.text) self:update_display_text() end, text_submitted = function() self.finished = true end, ["\t"] = function() self:cancel() end, text_canceled = function() self:cancel() end, west = function() -- prompt text forward end, east = function() -- prompt text backward end, repl_first_char = function() end, repl_last_char = function() end, } end function TextPrompt:get_text() return self.text end function TextPrompt:focus() self.input:focus() end function TextPrompt:on_query() Gui.play_sound("base.pop2") end function TextPrompt:cancel() if self.can_cancel then self.canceled = true end end function TextPrompt:relayout(x, y) if self.autocenter then x, y = Ui.params_centered(self.width, self.height + 54) -- or + 84 (= 120) end self.x = x self.y = y self.t = UiTheme.load(self) self.win:relayout(self.x, self.y, self.width, self.height) end function TextPrompt:update_display_text() self.cut_off = false local len = utf8.wide_len(self.text) if not self.limit_length then if len > self.length - 2 then local dots = "..." if I18N.is_fullwidth() then dots = "…" end self.display_text = utf8.wide_sub(self.text, 0, self.length - 2) .. dots else self.display_text = self.text end return end if len > self.length then self.text = utf8.wide_sub(self.text, 0, self.length) self.cut_off = true end self.display_text = self.text end function TextPrompt:ime_status_quad() local stat = "ime_status_english" if self.cut_off then stat = "ime_status_none" end return stat end function TextPrompt:draw() if self.shadow then Draw.filled_rect(self.x + 4, self.y + 4, self.width - 1, self.height - 1, {0, 0, 0, 127}) end self.win:draw() self.t.base.label_input:draw(self.x + self.width / 2 - 60, self.y - 32) local ime_status = self:ime_status_quad() self.t.base[ime_status]:draw(self.x + 8, self.y + 4) Draw.text(self.display_text, self.x + 36, self.y + 9, -- self.y + vfix + 9 {255, 255, 255}, 16) -- 16 - en * 2 self.t.base.input_caret:draw( self.x + Draw.text_width(self.display_text) + 34, self.y + 5, nil, nil, {255, 255, 255, self.caret_alpha / 2 + 50}) end function TextPrompt:update(dt) self.frames = self.frames + (dt / (config.base.screen_refresh * (16.66 / 1000))) * 4 self.caret_alpha = math.sin(self.frames) * 255 * 2 -- TODO if self.finished then self.finished = false return self.text end if self.canceled then return nil, "canceled" end end return TextPrompt
--[[ Nether mod for minetest Copyright (C) 2013 PilzAdam Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ]]-- local S if minetest.get_translator ~= nil then S = minetest.get_translator("nether") else -- mock the translator function for MT 0.4 S = function(str, ...) local args={...} return str:gsub( "@%d+", function(match) return args[tonumber(match:sub(2))] end ) end end -- Global Nether namespace nether = {} nether.modname = minetest.get_current_modname() nether.path = minetest.get_modpath(nether.modname) nether.get_translator = S -- Settings nether.DEPTH = -5000 -- The y location of the Nether nether.FASTTRAVEL_FACTOR = 8 -- 10 could be better value for Minetest, since there's no sprint, but ex-Minecraft players will be mathing for 8 nether.PORTAL_BOOK_LOOT_WEIGHTING = 0.9 -- Likelyhood of finding the Book of Portals (guide) in dungeon chests. Set to 0 to disable. nether.NETHER_REALM_ENABLED = true -- Setting to false disables the Nether and Nether portal -- Override default settings with values from the .conf file, if any are present. nether.FASTTRAVEL_FACTOR = tonumber(minetest.settings:get("nether_fasttravel_factor") or nether.FASTTRAVEL_FACTOR) nether.PORTAL_BOOK_LOOT_WEIGHTING = tonumber(minetest.settings:get("nether_portalBook_loot_weighting") or nether.PORTAL_BOOK_LOOT_WEIGHTING) nether.NETHER_REALM_ENABLED = minetest.settings:get_bool("nether_realm_enabled", nether.NETHER_REALM_ENABLED) or nether.NETHER_REALM_ENABLED -- Load files dofile(nether.path .. "/portal_api.lua") dofile(nether.path .. "/nodes.lua") if nether.NETHER_REALM_ENABLED then dofile(nether.path .. "/mapgen.lua") end dofile(nether.path .. "/portal_examples.lua") -- Portals are ignited by right-clicking with a mese crystal fragment nether.register_portal_ignition_item( "default:mese_crystal_fragment", {name = "nether_portal_ignition_failure", gain = 0.3} ) if nether.NETHER_REALM_ENABLED then -- Use the Portal API to add a portal type which goes to the Nether -- See portal_api.txt for documentation nether.register_portal("nether_portal", { shape = nether.PortalShape_Traditional, frame_node_name = "default:obsidian", wormhole_node_color = 0, -- 0 is magenta title = S("Nether Portal"), book_of_portals_pagetext = S([[Construction requires 14 blocks of obsidian, which we found deep underground where water had solidified molten rock. The finished frame is four blocks wide, five blocks high, and stands vertically, like a doorway. This opens to a truly hellish place, though for small mercies the air there is still breathable. There is an intriguing dimensional mismatch happening between this realm and ours, as after opening the second portal into it we observed that 10 strides taken in the Nether appear to be an equivalent of @1 in the natural world. The expedition parties have found no diamonds or gold, and after an experienced search party failed to return from the trail of a missing expedition party, I must conclude this is a dangerous place.]], 10 * nether.FASTTRAVEL_FACTOR), is_within_realm = function(pos) -- return true if pos is inside the Nether return pos.y < nether.DEPTH end, find_realm_anchorPos = function(surface_anchorPos) -- divide x and z by a factor of 8 to implement Nether fast-travel local destination_pos = vector.divide(surface_anchorPos, nether.FASTTRAVEL_FACTOR) destination_pos.x = math.floor(0.5 + destination_pos.x) -- round to int destination_pos.z = math.floor(0.5 + destination_pos.z) -- round to int destination_pos.y = nether.DEPTH - 1000 -- temp value so find_nearest_working_portal() returns nether portals -- a y_factor of 0 makes the search ignore the altitude of the portals (as long as they are in the Nether) local existing_portal_location, existing_portal_orientation = nether.find_nearest_working_portal("nether_portal", destination_pos, 8, 0) if existing_portal_location ~= nil then return existing_portal_location, existing_portal_orientation else local start_y = nether.DEPTH - math.random(500, 1500) -- Search starting altitude destination_pos.y = nether.find_nether_ground_y(destination_pos.x, destination_pos.z, start_y) return destination_pos end end, find_surface_anchorPos = function(realm_anchorPos) -- A portal definition doesn't normally need to provide a find_surface_anchorPos() function, -- since find_surface_target_y() will be used by default, but Nether portals also scale position -- to create fast-travel. -- Defining a custom function also means we can look for existing nearby portals. -- Multiply x and z by a factor of 8 to implement Nether fast-travel local destination_pos = vector.multiply(realm_anchorPos, nether.FASTTRAVEL_FACTOR) destination_pos.x = math.min(30900, math.max(-30900, destination_pos.x)) -- clip to world boundary destination_pos.z = math.min(30900, math.max(-30900, destination_pos.z)) -- clip to world boundary destination_pos.y = 0 -- temp value so find_nearest_working_portal() doesn't return nether portals -- a y_factor of 0 makes the search ignore the altitude of the portals (as long as they are outside the Nether) local existing_portal_location, existing_portal_orientation = nether.find_nearest_working_portal("nether_portal", destination_pos, 8 * nether.FASTTRAVEL_FACTOR, 0) if existing_portal_location ~= nil then return existing_portal_location, existing_portal_orientation else destination_pos.y = nether.find_surface_target_y(destination_pos.x, destination_pos.z, "nether_portal") return destination_pos end end, on_ignite = function(portalDef, anchorPos, orientation) -- make some sparks fly local p1, p2 = portalDef.shape:get_p1_and_p2_from_anchorPos(anchorPos, orientation) local pos = vector.divide(vector.add(p1, p2), 2) local textureName = portalDef.particle_texture if type(textureName) == "table" then textureName = textureName.name end minetest.add_particlespawner({ amount = 110, time = 0.1, minpos = {x = pos.x - 0.5, y = pos.y - 1.2, z = pos.z - 0.5}, maxpos = {x = pos.x + 0.5, y = pos.y + 1.2, z = pos.z + 0.5}, minvel = {x = -5, y = -1, z = -5}, maxvel = {x = 5, y = 1, z = 5}, minacc = {x = 0, y = 0, z = 0}, maxacc = {x = 0, y = 0, z = 0}, minexptime = 0.1, maxexptime = 0.5, minsize = 0.2 * portalDef.particle_texture_scale, maxsize = 0.8 * portalDef.particle_texture_scale, collisiondetection = false, texture = textureName .. "^[colorize:#F4F:alpha", animation = portalDef.particle_texture_animation, glow = 8 }) end }) end
#!/usr/bin/env lua -- (C) Copyright 2009 Hewlett-Packard Development Company, L.P. -- -- 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. -- -- $Id$ dofile(arg[0]:gsub("(.+)/.+","%1/defaults.lua")) use_bsd=use_bsd_helper use_hdd=use_hdd_helper set_journal=set_journal_helper set_diskjournal=set_diskjournal_helper set_quantum=set_quantum_helper send_keyboard=send_keyboard_helper set_serial=set_serial_helper dumpregistry=dumpregistry_helper analyzer=analyzer_helper run_script='' function execute(n) run_script=n send_keyboard("xget ../data/run.sh b ; sh ./b") end if type(simnow)~='table' or type(simnow.commands)~='function' then error("missing simnow.commands function") end simnow.commands() if type(simnow)=='table' and type(simnow.xcommands)=='function' then simnow.xcommands() end
local map = vim.api.nvim_set_keymap -- moved to whichkey -- map('n', '<Leader>w', ':write<cr>', {noremap = true}) map("i", "jk", "<Esc>", { noremap = true }) -- skip if module(s) isn't loaded local status_ok, bufferline = pcall(require, "bufferline") if status_ok then map("n", "<Tab>", ":BufferLineCycleNext<CR>", { silent = true }) end -- NvimTreeToggle -- moved to whichkey --[[ local status_ok, nvimtree = pcall(require, "nvim-tree") if status_ok then map('n', '<leader>t', ':NvimTreeToggle<CR>', {silent = true}) end ]] -- deprecated since I'm using toggeterm pluging -- map('n', '<Leader>sh', ':split term://zsh<cr>', {noremap = true}) map("t", "<Esc>", "<C-\\><C-n>", { noremap = true }) -- moved to whichkey -- map('n', '<leader>x', ':bd!<cr>', {noremap = true}) -- map('n', 'nh', ':nohl<cr>', {noremap = true}) map("n", "<leader>p", '"0p', { noremap = true }) -- paste yanked, not deleted, not system copied -- better navigating splits map("n", "<C-h>", "<C-w><C-h>", { noremap = true }) map("n", "<C-j>", "<C-w><C-j>", { noremap = true }) map("n", "<C-k>", "<C-w><C-k>", { noremap = true }) map("n", "<C-l>", "<C-w><C-l>", { noremap = true }) -- While on visual mode, this allows selections to remain selected for aditional actions without -- loosing the visual block selection map("v", "<", "<gv", { noremap = true }) map("v", ">", ">gv", { noremap = true }) -- "Y" will select remainder of the line, start at cursor, -- similar to "D" and "C" for deleting and replacing respectively -- map('n', 'Y', 'y$', {noremap = true}) -- moved to whichkey -- Moving visual blocks up/down map("v", "J", ":m '>+1<cr>gv=gv", { noremap = true }) map("v", "K", ":m '<-2<cr>gv=gv", { noremap = true }) -- utils.map('i', '<c-j>', '<esc>:m .+1<cr>') -- utils.map('i', '<c-k>', '<esc>:m .-2<cr>') -- Keeping it centered when hitting `n` or `N` after a search map("n", "n", "nzzzv", { noremap = true }) map("n", "N", "Nzzzv", { noremap = true }) map("n", "J", "mzJ`z", { noremap = true }) -- Undo breakpoints map("i", ",", ",<c-g>u", { noremap = true }) map("i", ".", ".<c-g>u", { noremap = true }) map("i", "!", "!<c-g>u", { noremap = true }) map("i", "?", "?<c-g>u", { noremap = true }) -- moved these to whichkey -- -- Press * to search word under cursor, then hit map below for search/replace. -- map('n', '<leader>r', ':%s///g<left><left>', {noremap = true}) -- -- same but with confirmation for each change -- map('n', '<leader>rc', ':%s///gc<left><left><left>', {noremap = true}) -- Search/replace on a visual block. You can do that by pressing *, then visual select map("x", "<leader>r", ":%s///g<left><left>", { noremap = true }) -- same but with confirmation for each change map("x", "<leader>rc", ":%s///gc<left><left><left>", { noremap = true })
---@class love local m = {} --region Data ---@class Data : Object ---The superclass of all data. local Data = {} ---Gets a pointer to the Data. ---@return light userdata function Data:getPointer() end ---Gets the size of the Data. ---@return number function Data:getSize() end ---Gets the full Data as a string. ---@return string function Data:getString() end --endregion Data --region Drawable ---@class Drawable : Object ---Superclass for all things that can be drawn on screen. This is an abstract type that can't be created directly. local Drawable = {} --endregion Drawable --region Object ---@class Object ---The superclass of all LÖVE types. local Object = {} ---Gets the type of the object as a string. ---@return string function Object:type() end ---Checks whether an object is of a certain type. If the object has the type with the specified name in its hierarchy, this function will return true. ---@param name string @The name of the type to check for. ---@return boolean function Object:typeOf(name) end --endregion Object ---@type love.audio m.audio = nil ---@type love.event m.event = nil ---@type love.filesystem m.filesystem = nil ---@type love.graphics m.graphics = nil ---@type love.image m.image = nil ---@type love.joystick m.joystick = nil ---@type love.keyboard m.keyboard = nil ---@type love.math m.math = nil ---@type love.mouse m.mouse = nil ---@type love.physics m.physics = nil ---@type love.sound m.sound = nil ---@type love.system m.system = nil ---@type love.thread m.thread = nil ---@type love.timer m.timer = nil ---@type love.touch m.touch = nil ---@type love.video m.video = nil ---@type love.window m.window = nil ---Gets the current running version of LÖVE. ---@return number, number, number, string function m.getVersion() end return m
------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ -- -- -- Battle of Mount Hyjal script -- -- -- -- created by Shady, Ascent Team -- ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ -- Rage Winterchill Event -- ------------------------------------------------------------------------------------------------------------------ -- Cast timers RWC_RWC_ICEBOLT_TIMER = 9000 RWC_RWC_FROSTNOVA_TIMER = 15000 RWC_RWC_ICEARMOR_TIMER = 23000 RWC_RWC_DEATHANDDECAY_TIMER = 11000 RWC_ABOMINATION_POISONCLOUD_TIMER = 20000 RWC_NECROMANCER_UNHOLYFRENZY_TIMER = 8000 RWC_NECROMANCER_CRIPPLE_TIMER = 7000 RWC_NECROMANCER_SUMMONSKELETONS_TIMER =20000 RWC_NECROMANCER_SHADOWBOLT_TIMER = 5000 RWC_CRYPTFIEND_WEB_TIMER = 13500 -- Internal globals Jaina = null RWC_IsInProgress = 0 RWC_DeathAndDecayAllowed = 1 RWC_Spawns = { {4897.40,-1665.15,1319.50}, {4898.54,-1663.35,1319.60}, {4899.70,-1661.54,1319.70}, {4900.99,-1659.52,1319.72}, {4902.58,-1657.00,1320.04}, {4899.82,-1655.24,1319.89}, {4898.81,-1658.16,1319.37}, {4898.08,-1660.37,1319.35}, {4896.65,-1662.63,1319.24}, {4895.67,-1664.15,1319.13}, {4904.07,-1660.22,1320.24}, {4902.70,-1662.38,1320.13}, {4901.91,-1663.90,1320.17}, {4900.20,-1666.28,1320.00} } RWC_WaypointsDelta = { {59.5,-33.9,20.78 }, {124.3,-82.9,2.88 } } function RWC_RWC(unit) unit:RegisterEvent("RWC_Waves_Move",10000,1) end function RWC_RWC_Combat(unit) unit:RegisterEvent("RWC_RWC_Icebolt",RWC_RWC_ICEBOLT_TIMER,0) unit:RegisterEvent("RWC_RWC_FrostNova",RWC_RWC_FROSTNOVA_TIMER,0) unit:RegisterEvent("RWC_RWC_IceArmor",RWC_RWC_ICEARMOR_TIMER,0) unit:RegisterEvent("RWC_RWC_DeathAndDecay",RWC_RWC_DEATHANDDECAY_TIMER ,0) end function RWC_RWC_Icebolt(unit) local plr = unit:GetRandomPlayer(0) if (plr ~= nil) then unit:FullCastSpellOnTarget(31249,plr) end end function RWC_RWC_FrostNova(unit) unit:FullCastSpell(32365) RWC_DeathAndDecayAllowed = 0 unit:RegisterEvent("RWC_Allow_DeathAndDecay",6000,1) end function RWC_Allow_DeathAndDecay(unit) RWC_DeathAndDecayAllowed = 1 end function RWC_RWC_IceArmor(unit) unit:FullCastSpell(31256) end function RWC_RWC_DeathAndDecay(unit) if (RWC_DeathAndDecayAllowed>0) then local plr = unit:GetRandomPlayer(0) if (plr ~= nil) then unit:FullCastSpellOnTarget(34642,plr) end end end function RWC_Ghoul(unit) unit:RegisterEvent("RWC_Waves_Move",10000,1) end function RWC_Abomination(unit) unit:RegisterEvent("RWC_Waves_Move",10000,1) end function RWC_Waves_Move(unit) unit:CreateWaypoint(unit:GetX()+RWC_WaypointsDelta[1][1],unit:GetY()+RWC_WaypointsDelta[1][2],unit:GetZ()+RWC_WaypointsDelta[1][3],0,0,0,0) unit:CreateWaypoint(unit:GetX()+RWC_WaypointsDelta[2][1],unit:GetY()+RWC_WaypointsDelta[2][2],unit:GetZ()+RWC_WaypointsDelta[2][3],0,0,0,0) end function RWC_Abomination_Combat(unit) unit:RegisterEvent("RWC_Abomination_PoisonCloud",RWC_ABOMINATION_POISONCLOUD_TIMER,0) end function RWC_Abomination_PoisonCloud(unit) unit:FullCastSpell(30914) end function RWC_Necromancer(unit) unit:RegisterEvent("RWC_Waves_Move",10000,1) end function RWC_Necromancer_Combat(unit) unit:RegisterEvent("RWC_Necromancer_UnholyFrenzy",RWC_NECROMANCER_UNHOLYFRENZY_TIMER,0) unit:RegisterEvent("RWC_Necromancer_SummonSkeletons",RWC_NECROMANCER_SUMMONSKELETONS_TIMER,0) unit:RegisterEvent("RWC_Necromancer_Cripple",RWC_NECROMANCER_CRIPPLE_TIMER,0) unit:RegisterEvent("RWC_Necromancer_ShadowBolt",RWC_NECROMANCER_SHADOWBOLT_TIMER,0) end function RWC_Necromancer_UnholyFrenzy(unit) local plr = unit:GetRandomFriend() if (plr ~= nil) then unit:FullCastSpellOnTarget(31626,plr) end end function RWC_Necromancer_SummonSkeletons(unit) unit:FullCastSpell(31617) end function RWC_Necromancer_Cripple(unit) local plr = unit:GetClosestPlayer(); if (plr ~= nil) then unit:FullCastSpellOnTarget(33787,plr) end end function RWC_Necromancer_ShadowBolt(unit) local plr = unit:GetClosestPlayer(); if (plr ~= nil) then unit:FullCastSpellOnTarget(29487,plr) end end function RWC_CryptFiend(unit) unit:RegisterEvent("RWC_Waves_Move",10000,1) end function RWC_CryptFiend_Combat(unit) unit:RegisterEvent("RWC_CryptFiend_Web",RWC_CRYPTFIEND_WEB_TIMER,0) end function RWC_CryptFiend_Web(unit) local plr = unit:GetRandomPlayer(0) if (plr ~= nil) then unit:FullCastSpellOnTarget(745,plr) end end function RWC_Wave1() print "RWC_Wave1" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave2",125000,1) end function RWC_Wave2() print "RWC_Wave2" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave3",125000,1) end function RWC_Wave3() print "RWC_Wave3" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave4",125000,1) end function RWC_Wave4() print "RWC_Wave4" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave5",125000,1) end function RWC_Wave5() print "RWC_Wave5" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave6",125000,1) end function RWC_Wave6() print "RWC_Wave6" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave7",125000,1) end function RWC_Wave7() print "RWC_Wave7" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:RegisterEvent("RWC_Wave8",125000,1) end function RWC_Wave8() print "RWC_Wave8" Jaina:SpawnCreature(17895,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[2][1],RWC_Spawns[2][2],RWC_Spawns[2][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[3][1],RWC_Spawns[3][2],RWC_Spawns[3][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[4][1],RWC_Spawns[4][2],RWC_Spawns[4][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[5][1],RWC_Spawns[5][2],RWC_Spawns[5][3],0,1720,0) Jaina:SpawnCreature(17895,RWC_Spawns[6][1],RWC_Spawns[6][2],RWC_Spawns[6][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[7][1],RWC_Spawns[7][2],RWC_Spawns[7][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[8][1],RWC_Spawns[8][2],RWC_Spawns[8][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[9][1],RWC_Spawns[9][2],RWC_Spawns[9][3],0,1720,0) Jaina:SpawnCreature(17897,RWC_Spawns[10][1],RWC_Spawns[10][2],RWC_Spawns[10][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[11][1],RWC_Spawns[11][2],RWC_Spawns[11][3],0,1720,0) Jaina:SpawnCreature(17899,RWC_Spawns[12][1],RWC_Spawns[12][2],RWC_Spawns[12][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[13][1],RWC_Spawns[13][2],RWC_Spawns[13][3],0,1720,0) Jaina:SpawnCreature(17898,RWC_Spawns[14][1],RWC_Spawns[14][2],RWC_Spawns[14][3],0,1720,0) Jaina:RegisterEvent("RWC_Boss",200000,1) end function RWC_Boss() print "RWC_Boss" Jaina:SpawnCreature(17767,RWC_Spawns[1][1],RWC_Spawns[1][2],RWC_Spawns[1][3],0,1720,0) end function RWC_Start(unit) Jaina = unit if (RWC_IsInProgress == 0) then print "MH:RWC Start" RWC_IsInProgress = 1 Jaina:RegisterEvent("RWC_Wave1",100,1) end end function RWC_Failed(unit) print "MH:RWC Failed" Jaina:RemoveEvents() Jaina:SendChatMessage(12,0,"Event Failed. Try once again and dont let me die") Jaina:Despawn(0,5000) RWC_IsInProgress = 0 end RegisterUnitEvent(17895,6,"RWC_Ghoul") RegisterUnitEvent(17898,6,"RWC_Abomination") RegisterUnitEvent(17898,1,"RWC_Abomination_Combat") RegisterUnitEvent(17897,6,"RWC_CryptFiend") RegisterUnitEvent(17897,1,"RWC_CryptFiend_Combat") RegisterUnitEvent(17899,6,"RWC_Necromancer") RegisterUnitEvent(17899,1,"RWC_Necromancer_Combat") RegisterUnitEvent(17767,6,"RWC_RWC") RegisterUnitEvent(17767,1,"RWC_RWC_Combat") RegisterUnitEvent(17772,10,"RWC_Start") RegisterUnitEvent(17772,4,"RWC_Failed")
--[[ This file is part of script complex Properties Ribbon Copyright (c) 2020-2021 outsidepro-arts License: MIT License ---------- Let me say a few word before starts LUA - is not object oriented programming language, but very flexible. Its flexibility allows to realize OOP easy via metatables. In this scripts the pseudo OOP has been used, therefore we have to understand some terms. .1 When i'm speaking "Class" i mean the metatable variable with some fields. 2. When i'm speaking "Method" i mean a function attached to a field or submetatable field. When i was starting write this scripts complex i imagined this as real OOP. But in consequence the scripts structure has been reunderstanded as current structure. It has been turned out more comfort as for writing new properties table, as for call this from main script engine. After this preambula, let me begin. ]]-- -- It's just another vision of Properties Ribbon can be applied on local parentLayout = initLayout("%spreferences actions") function parentLayout.canProvide() return true end parentLayout:registerSublayout("reaperPrefs", "REAPER ") parentLayout:registerSublayout("osaraLayout", "OSARA extension") if reaper.APIExists("ReaPack_AboutInstalledPackage") == true then parentLayout:registerSublayout("reaPackLayout", "ReaPack extension ") end if reaper.APIExists("CF_GetSWSVersion") == true then parentLayout:registerSublayout("swsLayout", "SWS extension ") end -- The properties functions template local function getUsualProperty( -- the Main_OnCommand ID cmd, -- The property label msg ) local usual = { get = function(self) local message = initOutputMessage() message:initType(string.format("Perform this property to open the %s dialog.", msg), "Performable") if config.getboolean("allowLayoutsrestorePrev", true) == true then message:addType(" Please note that this action is onetime, i.e., after action here, the current layout will be closed.", 1) message:addType(", onetime", 2) end message(msg) return message end, set = function(self, action) if action == nil then reaper.Main_OnCommand(cmd, 1) restorePreviousLayout() setUndoLabel(self:get()) return "" else return "This property is performable only." end end } return usual end -- REAPER preferences parentLayout.reaperPrefs:registerProperty(getUsualProperty(40016, "Global preferences")) -- Metronome/Pre-roll setings parentLayout.reaperPrefs:registerProperty(getUsualProperty(40363, "Show metronome and pre-roll settings")) -- Snap/Grid settings parentLayout.reaperPrefs:registerProperty(getUsualProperty(40071, "Show snap and grid settings")) -- External time synchronization settings parentLayout.reaperPrefs:registerProperty(getUsualProperty(40619, "Show external timecode synchronization settings")) -- OSARA configuration -- We will not check OSARA install status,cuz it's supposet should be installed there parentLayout.osaraLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_OSARA_CONFIG"), "OSARA configuration")) parentLayout.osaraLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_OSARA_PEAKWATCHER"), "Peak Watcher")) parentLayout.osaraLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_OSARA_ABOUT"), "About currently installed OSARA")) -- ReaPack actions if parentLayout.reaPackLayout then parentLayout.reaPackLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_REAPACK_BROWSE"), "Browse packages")) parentLayout.reaPackLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_REAPACK_IMPORT"), "Import repositories")) parentLayout.reaPackLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_REAPACK_MANAGE"), "Manage repositories")) parentLayout.reaPackLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_REAPACK_SYNC"), "Synchronize packages")) parentLayout.reaPackLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_REAPACK_UPLOAD"), "Upload packages")) parentLayout.reaPackLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_REAPACK_ABOUT"), "About currently installed ReaPack")) end -- SWS actions if parentLayout.swsLayout then parentLayout.swsLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_BR_LOUDNESS_PREF"), "Global loudness preferences")) parentLayout.swsLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_XENAKIOS_DISKSPACECALC"), "Disk space calculator")) parentLayout.swsLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_AUTORENDER_PREFERENCES"), "Autorender: Global Preferences")) parentLayout.swsLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_SWS_ABOUT"), "About currently installed SWS extension")) parentLayout.swsLayout:registerProperty(getUsualProperty(reaper.NamedCommandLookup("_BR_VERSION_CHECK"), "Check for new SWS version")) end return parentLayout
object_mobile_azure_cabal_greel_smuggler_f_02 = object_mobile_shared_azure_cabal_greel_smuggler_f_02:new { } ObjectTemplates:addTemplate(object_mobile_azure_cabal_greel_smuggler_f_02, "object/mobile/azure_cabal_greel_smuggler_f_02.iff")
--[[ ]]-- --Plutonium local RunService = game:service'RunService' local Camera = Workspace.CurrentCamera or nil local Lighting = game.Lighting local Version = "XV415" local Player = game.Players.LocalPlayer or game.Players.runtoheven local UserInterface = game:service'UserInputService' local RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil local bannedlist = {"phriol","sism0xd","timostink","vonnys","NilLua","minecraftrath101","xJaffie","lolishutdown"}; local changecamonpossess = false local Debris = game:service'Debris' local Mouse = Player:GetMouse() or nil local Players = game.Players local chatAdornee = Player.Character.Head local RbxUtility = LoadLibrary("RbxUtility") local CMDS = {}; local InsertService = game:service'InsertService' local math = { abs = math.abs, acos = math.acos, asin = math.asin, atan = math.atan, atan2 = math.atan2, ceil = math.ceil, cos = math.cos, cosh = math.cosh, deg = math.deg, exp = math.exp, floor = math.floor, fmod = math.fmod, frexp = math.frexp, huge = math.huge, ldexp = math.ldexp, log = math.log, log10 = math.log10, max = math.max, min = math.min, modf = math.modf, phi = 1.618033988749895, pi = math.pi, pow = math.pow, rad = math.rad, random = math.random, randomseed = math.randomseed, sin = math.sin, sinh = math.sinh, sqrt = math.sqrt, tan = math.tan, tanh = math.tanh, tau = 2 * math.pi } rainbow = false if script.ClassName == "LocalScript" then if game.PlaceId == 178350907 then script.Parent = nil else local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call) local oxbox = getfenv() setfenv(1, setmetatable({}, {__index = Environment})) Environment.coroutine.yield() oxbox.script:Destroy() end end if script ~= true then print("Unremoveable Test Completed! Works! This script is immune to g/nol/all or g/nos/all!") else print("Unremoveable Test Failed! This script is removable by g/nol/all or g/nos/all!") end TaskScheduler = {}; local currentTime = 0 local pairs = pairs local rbx_coroutine_create = coroutine.create local rbx_coroutine_resume = coroutine.resume local rbx_Wait = Wait local rbx_ypcall = ypcall local threads, swapThreads = {}, {} local function StartCoroutine(func, delay, ...) if delay > 0 then rbx_Wait(delay) end local success, message = rbx_ypcall(func, ...) if not success then print("Error in a TaskScheduler coroutine: "..message) end end function TaskScheduler.GetCurrentTime() return currentTime end function TaskScheduler.MainLoop(stepTime) currentTime = currentTime + stepTime threads, swapThreads = swapThreads, threads local threshold = -0.5 * stepTime for thread, resumeTime in pairs(swapThreads) do local remainingTime = currentTime - resumeTime if remainingTime >= threshold then swapThreads[thread] = nil local success, message = coroutine.resume(thread, remainingTime, currentTime) if not success then print("Error in a TaskScheduler custom thread: "..message) end end end threads, swapThreads = swapThreads, threads for thread, resumeTime in pairs(swapThreads) do threads[thread], swapThreads[thread] = resumeTime, nil end end -- TODO: add stack trace info to scheduling functions? function TaskScheduler.Schedule(t, f, ...) coroutine.resume(coroutine.create(StartCoroutine), f, t, ...) end function TaskScheduler.Start(f, ...) coroutine.resume(coroutine.create(StartCoroutine), f, 0, ...) end function TaskScheduler.ScheduleCustomThread(t, f) threads[coroutine.create(f)] = currentTime + t end function TaskScheduler.Wait(duration) duration = tonumber(duration) or 0 threads[coroutine.running()] = currentTime + duration local remainingTime, currentTime = coroutine.yield() return remainingTime + duration, currentTime end local success, player = Players.LocalPlayer if success and player then RunService.RenderStepped:connect(function() TaskScheduler.MainLoop(1 / 60) end) else RunService.Stepped:connect(function() TaskScheduler.MainLoop(1 / 30) end) end ChatBubble = {}; local FONT_CUSTOM_A_SRC, FONT_CUSTOM_A, TextAlignment, LoadFixedFont, LoadFont, DrawTextNetwork, DrawMultilineTextNetwork, ConfigureChatBubble, CreateChatBubble, WrapText, chat_bubbles FONT_CUSTOM_A_SRC = "03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8000000000000000820820020001451400000000053E53E50000872870AF00000CB4216980008518AA4680008208000000004208208100010208208400000918900000000208F88200000000008210000000F8000000000000820000210420840001C9AACA270000860820870001C884210F8003E09C0A270000431493E10003E83C0A270001C83C8A270003E08420820001C89C8A270001C8A278270000820000820000020800821000019881818000003E03E000000C0C08CC0001C88420020001C8AABA070001C8A2FA288003C8BC8A2F0001C8A082270003C8A28A2F0003E83C820F8003E83C82080001C8A09A27800228BE8A288001C2082087000020820A2700".."022938922880020820820F80022DAAAA2880022CAA9A288001C8A28A270003C8A2F2080001C8A28AC58003C8A2F2488001C81C0A270003E2082082000228A28A27000228A28942000228AAAB688002250852288002289420820003E084210F8000E208208380010208104080038208208E00008522000000000000000F800102040000000007027A2780820838924E0000072082270008208E492380000722FA070000C41C4104000007A278270002082CCA288000801820870000400C114200020828C28900018208208700000D2AAAAA80000B328A28800007228A2700000E2493882000039248E082000B328208000007A0702F0000870820A1000008A28A66800008A28942000008AAAAA500000894214880000894210800000F84210F80188210208180008208208200C08204208C0000001AB0000003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80" FONT_CUSTOM_A = {} ChatBubble.THEME = {} ChatBubble.THEME.COOL = { Name = "Cool", Background = Color3.new(0, 3 / 2, 0.2), Foreground = Color3.new(2 / 3, 1, 1) } ChatBubble.THEME.AQUA = { Name = "Aqua", Background = Color3.new(0, 1 / 3, 0.5), Foreground = Color3.new(2 / 3, 1, 1) } ChatBubble.THEME.CLASSIC = { Name = "Classic", Background = Color3.new(0, 0, 0), Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.KAYAVEN = { Name = "Kayaven", Background = Color3.new(0, 0, 0), Foreground = Color3.new(0, 1, 0) } ChatBubble.THEME.CRIMSON = { Name = "Crimson", Background = Color3.new(0, 0, 0), Foreground = Color3.new(0.9, 0, 0) } ChatBubble.THEME.WHITE = { Name = "White", Background = Color3.new(1, 1, 1), Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.GRAPE = { Name = "Grape", Background = Color3.new(0.25, 0, 0.25), Foreground = Color3.new(1, 2 / 3, 1) } ChatBubble.THEME.LIBERATION = { Name = "Liberation", Background = Color3.new(1 / 6, 3 / 7, 3 / 7), Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.PASSION = { Name = "Passion", Background = Color3.new(0.5, 0, 0), Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.PURPLE = { Name = "Purple", Background = Color3.new(0.25, 0, 0.25), Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.Black = { Name = "Black", Background = Color3.new(0, 0, 0), Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.RAINBOW = { Name = "Rainbow", Background = function(bubble_info) local billboard, frame = bubble_info[5], bubble_info[6] TaskScheduler.Start(function() while billboard:IsDescendantOf(Workspace) do local red, green, blue = Utility.GetRainbowRGB(tick()) frame.BackgroundColor3 = Color3.new(0.6 * red, 0.6 * green, 0.65 * blue) RunService.Stepped:wait() end end) end, Foreground = Color3.new(1, 1, 1) } ChatBubble.THEME.TEAL = { Name = "Teal", Background = Color3.new(0, 1 / 3, 0.5), Foreground = Color3.new(1, 1, 1) } function ChatBubble.GetTheme() return ChatBubble.theme_info end function ChatBubble.SetTheme(theme_info) if type(theme_info) == "string" then theme_info = string.lower(theme_info) for key, info in pairs(ChatBubble.THEME) do if info.Name:lower() == theme_info:lower() then ChatBubble.SetTheme(info) break end end return end ChatBubble.theme_info = theme_info ChatBubble.background_color = theme_info.Background ChatBubble.font = LoadFont(ChatBubble.FONT_DEFAULT, theme_info.Foreground) print("Theme has been set to "..theme_info.Name.." in ChatBubble") end do local floor = math.floor local max = math.max local asc = string.byte local chr = string.char local find = string.find local gmatch = string.gmatch local sub = string.sub local insert = table.insert local type = type local unpack = unpack local PopIntegerBit TextAlignment = setmetatable({ [0] = 0, [1] = 1, [2] = 2, Left = 0, Center = 1, Right = 2 }, { __call = function(self, ...) local argc = #{...} if argc == 0 then return 0 else local arg = (...) local value = rawget(self, arg) if value then return value else local arg_type = type(arg) error("Invalid value" .. ((arg_type == "number") and (" " .. arg) or ((arg_type == "string") and (" \"" .. arg .. "\"") or "")) .. " for enum TextAlignment") end end end }) function PopIntegerBit(value, bit) if value >= bit then return 1, value - bit else return 0, value end end function LoadFixedFont(dest, src, height, width) local n = #src / 64 - 1 local bit_index = 0 local symbol_bits = width * height for i = 0, 255 do local char_data = {} for j = 1, height do char_data[j] = {} end dest[i] = char_data end for i = 1, #src do local buffer = tonumber(sub(src, i, i), 16) for j = 1, 4 do local code = floor(bit_index / symbol_bits) local row = floor(bit_index / width) % height + 1 local column = bit_index % width + 1 dest[code][row][column], buffer = PopIntegerBit(buffer, 8) buffer = buffer * 2 bit_index = bit_index + 1 end end end function LoadFont(font_data, color) local font_obj = {} for character, char_data in pairs(font_data) do local code = character if type(code) ~= "number" then code = asc(character) end local height = #char_data local width = #char_data[1] local pixel_h = 1 / height local pixel_w = 1 / width local pixel_size = UDim2.new(pixel_w, 0, pixel_h, 0) local frame = Instance.new("Frame") frame.BackgroundTransparency = 1 frame.Name = "" for y = 1, height do local row = char_data[y] for x = 1, width do local opacity = row[x] if opacity ~= 0 then local pixel = Instance.new("Frame", frame) pixel.BackgroundColor3 = color pixel.BorderSizePixel = 0 pixel.Name = "" pixel.Position = UDim2.new(x * pixel_w, 0, y * pixel_h, 0) - pixel_size pixel.Size = pixel_size -- + UDim2.new(0, 0, 0, 1) -- correction -- ^ never mind that correction, fixed by changing font size to 12x16 instead of 13x17 if opacity then pixel.BackgroundTransparency = 1 - opacity end end end end font_obj[code] = {frame, height, width} end return font_obj end function DrawTextNetwork(text, font, size, delay_offset) if #text == 0 then text = " " end local frame = Instance.new("Frame") frame.BackgroundTransparency = 1 frame.BorderSizePixel = 0 local objects = {} local length = #text local height = 0 local width = 0 for i = 1, length do local character = sub(text, i, i) local code = asc(character) local char_data = assert(font[code] or FONT_SYMBOL_MISSING, "FONT ERROR: '" .. character .. "' (" .. code .. ") not found") local char_proto, char_h, char_w = unpack(char_data) objects[i] = char_data height = max(char_h, height) width = width + char_w end local offset = 0 local punctuation_delay = 0 for i = 1, length do delay(delay_offset + (i + punctuation_delay - 1) / 30, function() local char_data = objects[i] local char_proto, char_h, char_w = unpack(char_data) local char_obj = char_proto:Clone() char_obj.Position = UDim2.new(offset / width, 0, 0, 0) char_obj.Size = UDim2.new(char_w / width, 0, 1, 0) char_obj.Parent = frame offset = offset + char_w end) local character = sub(text, i, i) if character == "." then punctionation_delay = punctuation_delay + 3 elseif character == "?" or character == "!" then punctionation_delay = punctuation_delay + 2 elseif character == ";" or character == "~" then punctionation_delay = punctuation_delay + 1 end end local ratio = (height == 0) and (0) or (width / height) frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale, size.Y.Offset) return frame, height, width, (length + punctuation_delay) / 30 end function DrawMultilineTextNetwork(text, font, size, delay_offset, ...) local align = TextAlignment(...) local frame = Instance.new("Frame") frame.BackgroundTransparency = 1 frame.BorderSizePixel = 0 local height = 0 local width = 0 local objects = {} for line in gmatch(text .. "\n", "([^\n]*)\n") do local line_obj, line_h, line_w, line_delay = DrawTextNetwork(line, font, size, delay_offset) insert(objects, {line_obj, line_h, line_w}) height = height + line_h width = max(line_w, width) delay_offset = delay_offset + line_delay end local offset = 0 for index, line_data in ipairs(objects) do local line_obj, line_h, line_w = unpack(line_data) local align_offset if align == TextAlignment.Left then align_offset = 0 elseif align == TextAlignment.Center then align_offset = 0.5 - line_w / width / 2 elseif align == TextAlignment.Right then align_offset = 1 - line_w / width end line_obj.Position = UDim2.new(align_offset, 0, offset / height, 0) line_obj.Parent = frame offset = offset + line_h end local line_count = #objects local ratio = (height == 0) and (0) or (line_count * width / height) frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale * line_count, size.Y.Offset * line_count) return frame, height, width end end LoadFixedFont(FONT_CUSTOM_A, FONT_CUSTOM_A_SRC, 8, 6) ChatBubble.FONT_DEFAULT = FONT_CUSTOM_A ChatBubble.SetTheme("Classic") chat_bubbles = {} function CreateChatBubble(bubble_info) local creation_time, text, backup = bubble_info[1], bubble_info[2], bubble_info[8] local billboard, frame, label if backup and false then billboard = backup:Clone() frame = billboard.Frame label = frame.Label bubble_info[5] = billboard bubble_info[6] = frame bubble_info[7] = label billboard.Parent = Workspace else label = DrawMultilineTextNetwork('[c22Chat] \n'..text, bubble_info[9], UDim2.new(0, 12, 0, 16), creation_time - time(), "Center") label.Name = "Label" label.Position = UDim2.new(0, 16, 0, 16) billboard = Instance.new("BillboardGui", Workspace) billboard.Adornee = chatAdornee billboard.AlwaysOnTop = true billboard.Size = UDim2.new(label.Size.X.Scale, label.Size.X.Offset + 32, label.Size.Y.Scale, label.Size.Y.Offset + 32) billboard.SizeOffset = Vector2.new(0, 0) billboard.StudsOffset = Vector3.new(0, 1, 0) frame = Instance.new("Frame", billboard) bubble_info[5] = billboard bubble_info[6] = frame bubble_info[7] = label local background_color = bubble_info[10] if type(background_color) == "function" then background_color(bubble_info) else frame.BackgroundColor3 = background_color end frame.BackgroundTransparency = 0.3 frame.BorderSizePixel = 0 frame.ClipsDescendants = true frame.Name = "Frame" frame.Size = UDim2.new(1, 0, 0, 0) label.Parent = frame -- bubble_info[8] = billboard:Clone() end end local tween_time = 0.3 function ConfigureChatBubble(bubble_info) local creation_time, destruction_time, billboard, frame = bubble_info[1], bubble_info[3], bubble_info[5], bubble_info[6] if not billboard or billboard.Parent ~= workspace then CreateChatBubble(bubble_info) billboard, frame = bubble_info[5], bubble_info[6] end if billboard.Adornee ~= chatAdornee then billboard.Adornee = chatAdornee end local current_time = time() local elapsed_time = current_time - creation_time local remaining_time = destruction_time - current_time if remaining_time < 0 then bubble_info[4] = false billboard:Destroy() return false elseif remaining_time < tween_time then local tween_progress = math.sin(remaining_time * math.pi / (tween_time * 2)) frame.Size = UDim2.new(1, 0, tween_progress, 0) elseif elapsed_time < tween_time then local tween_progress = math.sin(elapsed_time * math.pi / (tween_time * 2)) frame.Size = UDim2.new(1, 0, tween_progress, 0) elseif frame.Size ~= UDim2.new(1, 0, 1, 0) then frame.Size = UDim2.new(1, 0, 1, 0) end return true end function ChatBubble.MainLoop() local offset = 0 local removing = {} for index, bubble_info in ipairs(chat_bubbles) do if not ConfigureChatBubble(bubble_info) then removing[#removing + 1] = index - #removing else local billboard, frame = bubble_info[5], bubble_info[6] local billboard_h = billboard.Size.Y.Offset local bubble_h = frame.Size.Y.Scale * billboard_h offset = 8 + offset + bubble_h billboard.SizeOffset = Vector2.new(0, offset / billboard_h - 0.5) end end for index, bubble_index in ipairs(removing) do table.remove(chat_bubbles, bubble_index) end RunService.Stepped:wait() end function WrapText(text, character_limit, line_length_limit) if #text > character_limit then text = string.sub(text, 1, character_limit - 3) .. "..." end local text_length = #text local line_length = 0 local i = 0 while i <= text_length do i = i + 1 local character = string.sub(text, i, i) if character == "\t" then local tabulation_size = 4 - line_length % 4 line_length = line_length + tabulation_size if line_length >= line_length_limit then tabulation_size = line_length - line_length_limit line_length = 0 text_length = text_length + tabulation_size text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. "\n" .. string.sub(text, i + 1) i = i + tabulation_size + 1 else text_length = text_length + tabulation_size - 1 text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. string.sub(text, i + 1) i = i + tabulation_size - 1 end elseif character == "\n" then line_length = 0 else line_length = line_length + 1 if line_length >= line_length_limit then local k = i - line_length + 1 local success = false for j = i, k, -1 do if string.match(string.sub(text, j, j), "[ \t]") then text = string.sub(text, 1, j - 1) .. "\n" .. string.sub(text, j + 1) text_length = text_length + 1 success = true break end end if not success then text = string.sub(text, 1, i) .. "\n" .. string.sub(text, i + 1) text_length = text_length + 1 end i = i + 1 line_length = 0 end end end if #text > character_limit then text = string.sub(text, 1, character_limit - 3) .. "..." end return text end function ChatBubble.Create(text, theme) local text = WrapText(text, 200, 30) local creation_time = time() local bubble_info = {creation_time, text, creation_time + 6 + #text / 15, true} local previousTheme if theme then previousTheme = ChatBubble.GetTheme() ChatBubble.SetTheme(theme) end bubble_info[9] = ChatBubble.font bubble_info[10] = ChatBubble.background_color if previousTheme then ChatBubble.SetTheme(previousTheme) end table.insert(chat_bubbles, 1, bubble_info) end TaskScheduler.Start(function() while true do ChatBubble.MainLoop() end end) PyramidCharacter = {}; local stock_triangle = Instance.new("WedgePart") stock_triangle.Anchored = true stock_triangle.BottomSurface = "Smooth" stock_triangle.FormFactor = "Custom" stock_triangle.Locked = true stock_triangle.TopSurface = "Smooth" local stock_triangle_mesh = Instance.new("SpecialMesh", stock_triangle) stock_triangle_mesh.MeshType = "Wedge" local triangles = {} function PyramidCharacter.CreateTriangle(v1, v2, v3, properties, parent, index) local triangleInfo = triangles[index] local side1 = (v1 - v2).magnitude local side2 = (v2 - v3).magnitude local side3 = (v3 - v1).magnitude local sqrside1 = side1 * side1 local sqrside2 = side2 * side2 local sqrside3 = side3 * side3 if sqrside3 + sqrside1 == sqrside2 then v1, v2, v3 = v1, v2, v3 elseif sqrside1 + sqrside2 == sqrside3 then v1, v2, v3 = v2, v3, v1 elseif sqrside2 + sqrside3 == sqrside1 then v1, v2, v3 = v3, v1, v2 elseif sqrside1 >= sqrside2 and sqrside1 >= sqrside3 then v1, v2, v3 = v1, v2, v3 elseif sqrside2 >= sqrside3 and sqrside2 >= sqrside1 then v1, v2, v3 = v2, v3, v1 else v1, v2, v3 = v3, v1, v2 end local model, part1, part2, mesh1, mesh2 if triangleInfo then model, part1, part2, mesh1, mesh2 = unpack(triangleInfo) if not (model.Parent == parent and part1.Parent == model and part2.Parent == model and mesh1.Parent == part1 and mesh2.Parent == part2) then if model.Parent then model:Destroy() end model = nil end else triangleInfo = {} triangles[index] = triangleInfo end if not model then model = Instance.new("Model") part1 = stock_triangle:Clone() part2 = stock_triangle:Clone() mesh1 = part1.Mesh mesh2 = part2.Mesh part1.Parent = model part2.Parent = model triangleInfo[1] = model triangleInfo[2] = part1 triangleInfo[3] = part2 triangleInfo[4] = mesh1 triangleInfo[5] = mesh2 end for key, value in pairs(properties) do part1[key] = value part2[key] = value end local cframe = CFrame.new(v1, v2) local relpos = cframe:pointToObjectSpace(v3) cframe = cframe * CFrame.fromEulerAnglesXYZ(0, 0, -math.atan2(relpos.x, relpos.y)) local rel1 = cframe:pointToObjectSpace(v1) local rel2 = cframe:pointToObjectSpace(v2) local rel3 = cframe:pointToObjectSpace(v3) local height = rel3.y local width1 = rel3.z local width2 = rel2.z - rel3.z local relcenter1 = Vector3.new(0, height / 2, width1 / 2) local center1 = cframe:pointToWorldSpace(relcenter1) local relcenter2 = Vector3.new(0, height / 2, width2 / 2 + width1) local center2 = cframe:pointToWorldSpace(relcenter2) height = math.abs(height) width1 = math.abs(width1) width2 = math.abs(width2) if not part1.Anchored then part1.Anchored = true end part1.Size = Vector3.new(0.2, height, width1) part1.CFrame = cframe * CFrame.fromEulerAnglesXYZ(0, math.pi, 0) - cframe.p + center1 mesh1.Scale = Vector3.new(0, height / part1.Size.y, width1 / part1.Size.z) if not part2.Anchored then part2.Anchored = true end part2.Size = Vector3.new(0.2, height, width1) part2.CFrame = cframe - cframe.p + center2 mesh2.Scale = Vector3.new(0, height / part1.Size.y, width2 / part2.Size.z) model.Parent = parent return model end PyramidCharacter.head_properties = {BrickColor = BrickColor.new(Color3.new(1, 1, 1)), Transparency = 0.5} PyramidCharacter.head_radius = math.pi PyramidCharacter.center = CFrame.new(0, 10, 0) PyramidCharacter.point1 = Vector3.new() PyramidCharacter.point2 = Vector3.new() PyramidCharacter.point3 = Vector3.new() PyramidCharacter.point4 = Vector3.new() PyramidCharacter.core_mesh_scale = Vector3.new(0.833, 0.833, 0.833) PyramidCharacter.visible = false function PyramidCharacter.Teleport(location) PyramidCharacter.point1 = location PyramidCharacter.point2 = location PyramidCharacter.point3 = location PyramidCharacter.point4 = location end local stock_core = Instance.new("Part") stock_core.Anchored = true stock_core.BottomSurface = "Smooth" stock_core.Color = Color3.new(1, 1, 1) stock_core.FormFactor = "Custom" stock_core.Locked = true stock_core.Name = "CubePyramid" stock_core.Size = Vector3.new(0.5, 0.5, 0.5) stock_core.TopSurface = "Smooth" PyramidCharacter.stock_core = stock_core PyramidCharacter.core = stock_core:Clone() PyramidCharacter.Archivable = false PyramidCharacter.core_mesh = Instance.new("BlockMesh", core) PyramidCharacter.core_lights = {} PyramidCharacter.coreLightCount = 1 for index = 1, PyramidCharacter.coreLightCount do PyramidCharacter.core_lights[index] = Instance.new("PointLight", core) end PyramidCharacter.camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude PyramidCharacter.camera_position = Vector3.new() Camera.Changed:connect(function(property) if PyramidCharacter.visible then if property == "CoordinateFrame" then local cframe, focus = Camera.CoordinateFrame, Camera.Focus local eventTime = time() local connection connection = Camera.Changed:connect(function() connection:disconnect() if eventTime == time() and Camera.Focus ~= focus then local camera_distance = PyramidCharacter.camera_distance Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance) PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p end end) coroutine.yield() if Camera.Focus == focus then PyramidCharacter.camera_distance = (focus.p - cframe.p).magnitude else local camera_distance = PyramidCharacter.camera_distance Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance) PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p end if connection.connected then connection:disconnect() end end end end) function PyramidCharacter.Animate() local total_time = time() local core = PyramidCharacter.core local frame = PyramidCharacter.frame if PyramidCharacter.visible then local core_mesh = PyramidCharacter.core_mesh local core_lights = PyramidCharacter.core_lights if not frame or frame.Parent ~= core then frame = Instance.new("Model") frame.Archivable = false frame.Parent = core PyramidCharacter.frame = frame end if core.Parent ~= Workspace then core = PyramidCharacter.stock_core:Clone() PyramidCharacter.core = core core.Archivable = false core.Parent = Workspace chatAdornee = core end if core_mesh.Parent ~= core then core_mesh = Instance.new("BlockMesh", core) PyramidCharacter.core_mesh = core_mesh end for index, core_light in ipairs(core_lights) do if core_light.Parent ~= core then core_light = Instance.new("PointLight", core) core_lights[index] = core_light end local vertexColor = Vector3.new(Utility.GetRainbowRGB(total_time)) * 0.25 + Vector3.new(1, 1, 1) * 0.75 core_light.Color = Color3.new(vertexColor.X, vertexColor.Y, vertexColor.Z) core_light.Brightness = 0.85 + 0.15 * math.random() if core_light.Range ~= 30 then core_light.Range = 30 end if not core_light.Shadows then core_light.Shadows = true end end if core_mesh.Offset ~= Vector3.new(0, 0, 0) then core_mesh.Offset = Vector3.new(0, 0, 0) end if not core.Anchored then core.Anchored = true end if core.Transparency ~= 0 then core.Transparency = 0 end local core_mesh_scale = PyramidCharacter.core_mesh_scale local transition_speed = (math.sin(total_time * math.tau) + 1) / 16 core_mesh_scale = core_mesh_scale * (1 - transition_speed) + Vector3.new(math.random() * 0.5 + 0.5, math.random() * 0.5 + 0.5, math.random() * 0.5 + 0.5) * transition_speed core_mesh.Scale = core_mesh_scale * 2 local center = CFrame.new(PyramidCharacter.camera_position) * CFrame.Angles(0, total_time * math.tau, 0) local cframe1 = CFrame.new(PyramidCharacter.head_radius, 0, 0) local cframe2 = CFrame.Angles(math.tau / -3, 0, 0) local cframe3 = CFrame.Angles(0, math.tau / 3, 0) local cframe4 = center * cframe3 local desired1 = center * CFrame.new(0, PyramidCharacter.head_radius, 0) local desired2 = center * cframe2 * cframe1 local desired3 = cframe4 * cframe2 * cframe1 local desired4 = cframe4 * cframe3 * cframe2 * cframe1 local point1 = (PyramidCharacter.point1 * 3 + desired1.p) / 4 local point2 = (PyramidCharacter.point2 * 3 + desired2.p) / 4 local point3 = (PyramidCharacter.point3 * 3 + desired3.p) / 4 local point4 = (PyramidCharacter.point4 * 3 + desired4.p) / 4 PyramidCharacter.point1 = point1 PyramidCharacter.point2 = point2 PyramidCharacter.point3 = point3 PyramidCharacter.point4 = point4 local head_properties = PyramidCharacter.head_properties PyramidCharacter.CreateTriangle(point1, point2, point3, head_properties, frame, 1).Archivable = false PyramidCharacter.CreateTriangle(point2, point3, point4, head_properties, frame, 2).Archivable = false PyramidCharacter.CreateTriangle(point3, point4, point1, head_properties, frame, 3).Archivable = false PyramidCharacter.CreateTriangle(point4, point1, point2, head_properties, frame, 4).Archivable = false core.CFrame = CFrame.new((point1 + point2 + point3 + point4) / 4) * CFrame.Angles(total_time * math.tau, total_time * math.tau / 2, total_time * math.tau / 3) PyramidCharacter.center = center else if core.Parent then core:Destroy() end if frame and frame.Parent then frame:Destroy() end PyramidCharacter.frame = nil end end function PyramidCharacter.MainLoop() PyramidCharacter.Animate() RunService.Stepped:wait() end TaskScheduler.Start(function() while true do PyramidCharacter.MainLoop() end end) RBXInstance = {}; RBXInstance.init_metatable = {} function RBXInstance.init_metatable:__call(data) local instance = Instance.new(self[1]) for key, value in pairs(data) do if type(key) == "number" then value.Parent = instance else instance[key] = value end end return instance end function RBXInstance.new(className) return setmetatable({className}, RBXInstance.init_metatable) end Utility = {}; function Utility.CleanLighting() Lighting.Ambient = Color3.new(0, 0, 0) Lighting.Brightness = 1 Lighting.ColorShift_Bottom = Color3.new(0, 0, 0) Lighting.ColorShift_Top = Color3.new(0, 0, 0) Lighting.FogColor = Color3.new(0.75294125080109, 0.75294125080109, 0.75294125080109) Lighting.FogEnd = 100000 Lighting.FogStart = 0 Lighting.GeographicLatitude = 41.733299255371095 Lighting.GlobalShadows = true Lighting.OutdoorAmbient = Color3.new(0.5, 0.5, 0.5) Lighting.Outlines = false Lighting.ShadowColor = Color3.new(0.70196080207825, 0.70196080207825, 0.72156864404678) Lighting.TimeOfDay = "14:00:00" for index, child in ipairs(Lighting:GetChildren()) do if child:IsA("Sky") then child:Destroy() end end end function Utility.GetProperty(object, field) return object[field] end function Utility.CaseInsensitivePattern(pattern) return string.gsub(pattern, "(%%?)(.)", Utility.CaseInsensitivePatternReplaceFunc) end function Utility.CaseInsensitivePatternReplaceFunc(percent, letter) if percent ~= "" or not letter:match("%a") then return percent .. letter else return "[" .. string.lower(letter) .. string.upper(letter) .. "]" end end function Utility.FindHumanoidClosestToRay(ray, exlusionList) local view = CFrame.new(ray.Origin, ray.Origin + ray.Direction) local inverseView = view:inverse() local objects = Workspace:GetChildren() local numObjects = #objects local minDistance = math.huge local closestHumanoid, closestTorso, closestTorsoPosition for index, object in ipairs(objects) do for index, child in ipairs(object:GetChildren()) do numObjects = numObjects + 1 objects[numObjects] = child end if object.ClassName == "Humanoid" and object.Health > 0 then local torso = object.Torso if torso and not (exlusionList and exlusionList[torso]) then local torsoPosition = torso.Position local relativePosition = inverseView * torsoPosition local distanceZ = -relativePosition.Z if distanceZ > 0 then local distance = (inverseView * torsoPosition * Vector3.new(1, 1, 0)).magnitude / distanceZ if distance < 0.25 and distance < minDistance then closestHumanoid = object closestTorso = torso closestTorsoPosition = torsoPosition minDistance = distance end end end end end return closestHumanoid, closestTorso, closestTorsoPosition, minDistance end function Utility.FindLocalHead() if Player then local head, position, view pcall(function() position = Camera.Focus.p view = Camera.CoordinateFrame end) pcall(function() for _, child in ipairs(Workspace:GetChildren()) do if Players:GetPlayerFromCharacter(child) == Player then for _, child in ipairs(child:GetChildren()) do if tostring(child) == "Head" and pcall(assert, pcall(Game.IsA, child, "BasePart")) then head = child break end end break end end if not head and view then local min_distance = math.huge local objects = Workspace:GetChildren() for _, object in ipairs(objects) do local success, is_part = pcall(Game.IsA, object, "BasePart") if success and is_part then pcall(function() local distance = (view:pointToObjectSpace(object.Position) * Vector3.new(1, 1, 0)).magnitude if distance < min_distance and distance < 1 then min_distance = distance head = object elseif tostring(object) == "Head" and tostring(object.Parent):lower():match("^" .. tostring(Player):lower()) then min_distance = 0 head = object end end) if min_distance < 5e-4 then break end end pcall(function() if not object:IsA("Camera") then for _, child in ipairs(object:GetChildren()) do objects[#objects + 1] = child end end end) end end end) return head, position, view end end function Utility.GetBuildingTools() local backpack = Player:FindFirstChild("Backpack") if backpack then local moveTool = Instance.new("HopperBin") local cloneTool = Instance.new("HopperBin") local deleteTool = Instance.new("HopperBin") moveTool.BinType = Enum.BinType.GameTool cloneTool.BinType = Enum.BinType.Clone deleteTool.BinType = Enum.BinType.Hammer moveTool.Parent = backpack cloneTool.Parent = backpack deleteTool.Parent = backpack end end function Utility.Rejoin() Workspace.Parent:service'TeleportService':Teleport(Game.PlaceId) end function Utility.BlockRobloxFilter(text) return string.gsub(text, ".", "%1\143") end function Utility.GetTimestamp() local unix_time = tick() local time_secs = math.floor(unix_time % 60) local time_mins = math.floor(unix_time / 60 % 60) local time_hours = math.floor(unix_time / 3600 % 24) return string.format("%02i:%02i:%02i", time_hours, time_mins, time_secs) end function Utility.GetRainbowRGB(hue) local section = hue % 1 * 3 local secondary = 0.5 * math.pi * (section % 1) if section < 1 then return 1, 1 - math.cos(secondary), 1 - math.sin(secondary) elseif section < 2 then return 1 - math.sin(secondary), 1, 1 - math.cos(secondary) else return 1 - math.cos(secondary), 1 - math.sin(secondary), 1 end end function Utility.SetProperty(object, field, value) object[field] = value end function Utility.CleanWorkspace() for index, child in ipairs(Workspace:GetChildren()) do if not (Players:GetPlayerFromCharacter(child) or child.ClassName == "Camera" or child:IsA("Script") or child.ClassName == "Terrain") then pcall(child.Destroy, child) end end Workspace.Terrain:Clear() local base = Instance.new("Part") base.Anchored = true base.BrickColor = BrickColor.new("Earth green") base.Locked = true base.Name = "Base" base.Size = Vector3.new(512, 1.2, 512) base.Parent = Workspace end function Utility.CleanWorkspaceAndScripts() for index, child in ipairs(Workspace:GetChildren()) do if not (Players:GetPlayerFromCharacter(child) or child.ClassName == "Camera" or child.ClassName == "Terrain") then pcall(child.Destroy, child) end end Workspace.Terrain:Clear() local base = Instance.new("Part") base.Anchored = true base.BrickColor = BrickColor.new("Earth green") base.Locked = true base.Name = "Base" base.Size = Vector3.new(512, 1.2, 512) base.Parent = Workspace end function Utility.CreateDummy(cframe, name, parent) local model = Instance.new("Model") model.Archivable = false model.Name = name local humanoid = Instance.new("Humanoid", model) local head = Instance.new("Part", model) local face = Instance.new("Decal", head) local head_mesh = Instance.new("SpecialMesh", head) local torso = Instance.new("Part", model) local right_arm = Instance.new("Part", model) local left_arm = Instance.new("Part", model) local right_leg = Instance.new("Part", model) local left_leg = Instance.new("Part", model) local neck = Instance.new("Motor", torso) local right_shoulder = Instance.new("Motor", torso) local left_shoulder = Instance.new("Motor", torso) local right_hip = Instance.new("Motor", torso) local left_hip = Instance.new("Motor", torso) head.BrickColor = BrickColor.Yellow() head.CFrame = cframe * CFrame.new(0, 1.5, 0) head.FormFactor = "Symmetric" head.Locked = true head.Name = "Head" head.Size = Vector3.new(2, 1, 1) head.TopSurface = "Smooth" face.Texture = "rbxasset://textures/face.png" head_mesh.Scale = Vector3.new(1.25, 1.25, 1.25) torso.BrickColor = BrickColor.Blue() torso.CFrame = cframe torso.FormFactor = "Symmetric" torso.LeftSurface = "Weld" torso.Locked = true torso.RightSurface = "Weld" torso.Name = "Torso" torso.Size = Vector3.new(2, 2, 1) right_arm.BrickColor = BrickColor.Yellow() right_arm.CanCollide = false right_arm.CFrame = cframe * CFrame.new(1.5, 0, 0) right_arm.FormFactor = "Symmetric" right_arm.Locked = true right_arm.Name = "Right Arm" right_arm.Size = Vector3.new(1, 2, 1) left_arm.BrickColor = BrickColor.Yellow() left_arm.CanCollide = false left_arm.CFrame = cframe * CFrame.new(-1.5, 0, 0) left_arm.FormFactor = "Symmetric" left_arm.Locked = true left_arm.Name = "Left Arm" left_arm.Size = Vector3.new(1, 2, 1) right_leg.BrickColor = BrickColor.new("Br. yellowish green") right_leg.BottomSurface = "Smooth" right_leg.CanCollide = false right_leg.CFrame = cframe * CFrame.new(0.5, -2, 0) right_leg.FormFactor = "Symmetric" right_leg.Locked = true right_leg.Name = "Right Leg" right_leg.Size = Vector3.new(1, 2, 1) right_leg.TopSurface = "Smooth" left_leg.BrickColor = BrickColor.new("Br. yellowish green") left_leg.BottomSurface = "Smooth" left_leg.CanCollide = false left_leg.CFrame = cframe * CFrame.new(-0.5, -2, 0) left_leg.FormFactor = "Symmetric" left_leg.Locked = true left_leg.Name = "Left Leg" left_leg.Size = Vector3.new(1, 2, 1) left_leg.TopSurface = "Smooth" neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) neck.Name = "Neck" neck.Part0 = torso neck.Part1 = head right_shoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) right_shoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) right_shoulder.MaxVelocity = 0.15 right_shoulder.Name = "Right Shoulder" right_shoulder.Part0 = torso right_shoulder.Part1 = right_arm left_shoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) left_shoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) left_shoulder.MaxVelocity = 0.15 left_shoulder.Name = "Left Shoulder" left_shoulder.Part0 = torso left_shoulder.Part1 = left_arm right_hip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) right_hip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) right_hip.MaxVelocity = 0.1 right_hip.Name = "Right Hip" right_hip.Part0 = torso right_hip.Part1 = right_leg left_hip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) left_hip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) left_hip.MaxVelocity = 0.1 left_hip.Name = "Left Hip" left_hip.Part0 = torso left_hip.Part1 = left_leg humanoid.Died:connect(function() wait(5) model:Destroy() end) model.Parent = parent return model end Serializer = {}; Serializer.NAN = math.abs(0 / 0) function Serializer.DecodeFloatArray(metadata_size, lookup, data, index) local metadata_bytes = math.ceil(metadata_size * 0.25) local metadata = {string.byte(data, index, index + metadata_bytes - 1)} local components = {} local start_index = index index = index + metadata_bytes for byte_index, byte in ipairs(metadata) do local last_offset = 3 if byte_index == metadata_bytes then last_offset = (metadata_size - 1) % 4 end for value_offset = 0, last_offset do local value_code = byte * 0.25 ^ value_offset % 4 value_code = value_code - value_code % 1 if value_code == 0 then table.insert(components, Serializer.DecodeFloat32(string.byte(data, index, index + 3))) index = index + 4 else table.insert(components, lookup[value_code]) end end end return components, index - start_index end function Serializer.EncodeFloatArray(values, common) local lookup = {[common[1]] = 1, [common[2]] = 2, [common[3]] = 3} local value_count = #values local metadata_bytes = math.ceil(value_count * 0.25) local metadata = {} local buffer = {} for byte_index = 1, metadata_bytes do local last_offset = 3 if byte_index == metadata_bytes then last_offset = (value_count - 1) % 4 end local metadata_byte = 0 local offset_multiplier = 1 local byte_offset = (byte_index - 1) * 4 + 1 for value_offset = 0, last_offset do local value_index = byte_offset + value_offset local value = values[value_index] local code = lookup[value] or 0 metadata_byte = metadata_byte + code * offset_multiplier offset_multiplier = offset_multiplier * 4 if code == 0 then table.insert(buffer, Serializer.EncodeFloat32(value)) end end metadata[byte_index] = string.char(metadata_byte) end return table.concat(metadata) .. table.concat(buffer) end function Serializer.DecodeColor3(data, index) local components, size = Serializer.DecodeFloatArray(3, {0, 0.5, 1}, data, index) return Color3.new(unpack(components)), size end function Serializer.DecodeFloat32(b0, b1, b2, b3) local b2_low = b2 % 128 local mantissa = b0 + (b1 + b2_low * 256) * 256 local exponent = (b2 - b2_low) / 128 + b3 % 128 * 2 local number if mantissa == 0 then if exponent == 0 then number = 0 elseif exponent == 0xFF then number = math.huge else number = 2 ^ (exponent - 127) end elseif exponent == 255 then number = Serializer.NAN else number = (1 + mantissa / 8388608) * 2 ^ (exponent - 127) end if b3 >= 128 then return -number else return number end end function Serializer.EncodeColor3(color3) return Serializer.EncodeFloatArray({color3.r, color3.g, color3.b}, {0, 0.5, 1}) end function Serializer.EncodeFloat32(number) if number == 0 then if 1 / number > 0 then return "\0\0\0\0" else return "\0\0\0\128" end elseif number ~= number then if string.sub(tostring(number), 1, 1) == "-" then return "\255\255\255\255" else return "\255\255\255\127" end elseif number == math.huge then return "\0\0\128\127" elseif number == -math.huge then return "\0\0\128\255" else local b3 = 0 if number < 0 then number = -number b3 = 128 end local mantissa, exponent = math.frexp(number) exponent = exponent + 126 if exponent < 0 then return "\0\0\0" .. string.char(b3) elseif exponent >= 255 then return "\0\0\128" .. string.char(b3 + 0x7F) else local fraction = mantissa * 16777216 - 8388608 + 0.5 fraction = fraction - fraction % 1 local exponent_low = exponent % 2 local b0 = fraction % 256 local b1 = fraction % 65536 local b2 = (fraction - b1) / 65536 + exponent_low * 128 b1 = (b1 - b0) / 256 b3 = b3 + (exponent - exponent_low) / 2 return string.char(b0, b1, b2, b3) end end end LuaEnum = {}; LuaEnum.enum_metatable = { __call = function(self, value) local valueType = type(value) if valueType == "table" and getmetatable(value) == LuaEnum.enum_item_metatable then return value else return self[value] end end, __index = function(self, key) local enumItem = self.ItemsByName[key] or self.ItemsByValue[key] if enumItem == nil then local default = self.Default if default then Logger.printf("Warning", "%s is not a valid EnumItem, returning default (%s)", Utility.ToString(key), tostring(default)) enumItem = default else Logger.errorf(2, "%s is not a valid EnumItem", Utility.ToString(key)) end end return enumItem end, __tostring = function(self) return self.Name end } LuaEnum.enum_item_metatable = { __tostring = function(self) return self.Enum.Name .. "." .. self.Name end } LuaEnum.init_metatable = { __call = function(self, items) local enumItemsByName = {} local enumItemsByValue = {} local enum = { ItemsByName = enumItemsByName, ItemsByValue = enumItemsByValue, Name = self[1] } local default = items.Default if default ~= nil then items.Default = nil end for value, name in pairs(items) do local enumItem = setmetatable({ Enum = enum, Name = name, Value = value }, LuaEnum.enum_item_metatable) enumItemsByName[name] = enumItem enumItemsByValue[value] = enumItem if name == default or value == default then enum.Default = enumItem end end return setmetatable(enum, LuaEnum.enum_metatable) end } function LuaEnum.new(name) return setmetatable({name}, LuaEnum.init_metatable) end Logger = {}; Logger.entries = {0} Logger.MessageType = LuaEnum.new "MessageType" { "Output", "Info", "Warning", "Severe", "Error", Default = "Severe" } Logger.MESSAGE_TYPE_SETTINGS = { { -- Output Font = "Arial", TextColor3 = Color3.new(0, 0, 0) }, { -- Info Font = "Arial", TextColor3 = Color3.new(0, 0, 1) }, { -- Warning Font = "ArialBold", TextColor3 = Color3.new(1, 0.5, 0) }, { -- Severe/Error Font = "ArialBold", TextColor3 = Color3.new(1, 0, 0) } } Logger.MAX_ENTRIES = 160 Logger.WARNING_TRACE_ITEM_COUNT = 5 Logger.rbxPrint = getfenv(RbxUtility.CreateSignal).print function Logger.error(level, message) message = message .. "\n" .. Logger.StackTraceToString(Logger.GenerateStackTrace(level + 1)) Logger.AddEntry {Logger.MessageType.Error, message} error(level + 1, message) end function Logger.errorf(level, messageFormat, ...) Logger.error(level + 1, string.format(messageFormat, ...)) end function Logger.print(messageType, message, level) messageType = Logger.MessageType(messageType) local entry = {messageType, message} Logger.rbxPrint(Logger.EntryToString(entry)) Logger.AddEntry(entry) if level ~= false and messageType.Value >= Logger.MessageType.Warning.Value then local maxItems if messageType.Value >= Logger.MessageType.Severe.Value then maxItems = math.huge else maxItems = Logger.WARNING_TRACE_ITEM_COUNT end local trace = Logger.GenerateStackTrace((level or 1) + 1, math.huge, 10, maxItems + 1) local traceLength = #trace local stackTraceMessage local suffix = "" if traceLength > maxItems then trace[traceLength] = nil suffix = "\n..." end Logger.print("Info", "Stack trace:\n" .. Logger.StackTraceToString(trace) .. suffix .. "\nStack end", false) end end function Logger.printf(messageType, messageFormat, ...) Logger.print(messageType, string.format(messageFormat, ...), 2) end function Logger.AddEntry(entry) local entries = Logger.entries if entries[1] >= Logger.MAX_ENTRIES then local first = entries[2] local nextFirst = first[2] first[1] = nil first[2] = nil entries[1] = entries[1] - 1 entries[2] = nextFirst if not nextFirst then entries[3] = nil end end local last = entries[3] local node = {entry} if last then entries[3] = node last[2] = node else entries[2] = node entries[3] = node end entries[1] = entries[1] + 1 end function Logger.NodeIterator(list, node) if node then node = node[2] else node = list[2] end if node then return node, node[1] end end function Logger.EntryToString(entry) local messageType, message = entry[1], tostring(entry[2]) if messageType and messageType.Value >= Logger.MessageType.Info.Value then return messageType.Name .. ": " .. message else return message end end function Logger.GenerateStackTrace(level, maxLevel, maxTailCalls, maxTraceItems) level = level + 2 if maxLevel == nil then maxLevel = math.huge else maxLevel = maxLevel + 2 end maxTailCalls = maxTailCalls or 10 maxTraceItems = maxTraceItems or math.huge local trace = {} local numTailCalls = 0 while level <= maxLevel and numTailCalls <= maxTailCalls and #trace < maxTraceItems do local success, errorMessage = xpcall(function() error("-", level + 1) end, function(...) return ... end) if errorMessage == "-" then numTailCalls = numTailCalls + 1 else if numTailCalls > 0 then local traceSize = #trace if traceSize > 0 then trace[#trace][3] = numTailCalls end numTailCalls = 0 end local script, line = string.match(errorMessage, "(.*):(%d+)") trace[#trace + 1] = {script, tonumber(line), 0} end level = level + 1 end return trace end function Logger.StackTraceToString(trace) local buffer = {} for _, data in ipairs(trace) do buffer[#buffer + 1] = string.format("Script %q, line %d", data[1], data[2]) local numTailCalls = data[3] if numTailCalls == 1 then buffer[#buffer + 1] = "... 1 tail call" elseif numTailCalls > 1 then buffer[#buffer + 1] = string.format("... %d tail calls", numTailCalls) end end return table.concat(buffer, "\n") end function Logger.MessageOutFunc(message, messageType) if AdvancedGUI and AdvancedGUI.Print then local messageTypeValue if messageType == Enum.MessageType.MessageOutput then local tagName, untaggedMessage = string.match(message, "(%a+): (.*)") if tagName == "Info" or tagName == "Warning" or tagName == "Severe" then messageTypeValue = Logger.MessageType[tagName].Value message = untaggedMessage else messageTypeValue = Logger.MessageType.Output.Value end else messageTypeValue = messageType.Value + 1 end AdvancedGUI.PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], message) end end function print(...) local args = {...} local buffer = {} for index = 1, select("#", ...) do buffer[index] = tostring(args[index]) end local message = table.concat(buffer, "\t") Logger.print("Output", message) end CharacterAppearance = {}; CharacterAppearance.defaultAppearanceId = 2 CharacterAppearance.stock = {} function CharacterAppearance.Create(properties) local id = properties.Id local bodyColors = Instance.new("BodyColors") bodyColors.HeadColor = properties.HeadColor bodyColors.TorsoColor = properties.TorsoColor bodyColors.RightArmColor = properties.RightArmColor bodyColors.LeftArmColor = properties.LeftArmColor bodyColors.RightLegColor = properties.RightLegColor bodyColors.LeftLegColor = properties.LeftLegColor local characterObjects = {bodyColors} local headObjects = {} local data = { characterObjects = characterObjects, headObjects = headObjects, tshirt = properties.TShirt } for _, assetId in ipairs(properties.CharacterAssets) do TaskScheduler.Start(CharacterAppearance.LoadAsset, characterObjects, assetId) end for _, assetId in ipairs(properties.HeadAssets) do TaskScheduler.Start(CharacterAppearance.LoadAsset, headObjects, assetId) end CharacterAppearance.stock[id] = data end function CharacterAppearance.GetDefaultAppearance() return CharacterAppearance.stock[CharacterAppearance.defaultAppearanceId] end function CharacterAppearance.LoadAsset(objects, assetId) local asset = InsertService:LoadAsset(assetId) for _, child in ipairs(asset:GetChildren()) do child.Archivable = true table.insert(objects, child:Clone()) end end CharacterAppearance.Create { Id = 1, HeadColor = BrickColor.new("Institutional white"), TorsoColor = BrickColor.new("Institutional white"), RightArmColor = BrickColor.new("Institutional white"), LeftArmColor = BrickColor.new("Institutional white"), RightLegColor = BrickColor.new("Institutional white"), LeftLegColor = BrickColor.new("Institutional white"), CharacterAssets = { 90825058, 90825211, 27112056, 27112052, 27112039, 27112025, 27112068, 38322996 }, HeadAssets = { 20722130, 8330576 } } CharacterAppearance.Create { Id = 2, HeadColor = BrickColor.new("Institutional white"), TorsoColor = BrickColor.new("Institutional white"), RightArmColor = BrickColor.new("Institutional white"), LeftArmColor = BrickColor.new("Institutional white"), RightLegColor = BrickColor.new("Institutional white"), LeftLegColor = BrickColor.new("Institutional white"), CharacterAssets = { 90825058, 90825211, 11748356, 1029025, 1235488, 27112056, 27112052, 27112039, 27112025, 27112068 }, HeadAssets = { 20722130 } } CharacterAppearance.Create { Id = 3, HeadColor = BrickColor.new("Pastel brown"), TorsoColor = BrickColor.new("Pastel brown"), RightArmColor = BrickColor.new("Pastel brown"), LeftArmColor = BrickColor.new("Pastel brown"), RightLegColor = BrickColor.new("White"), LeftLegColor = BrickColor.new("White"), CharacterAssets = { 134289125, 48474356, 100339040, 46302558, 153955895 }, HeadAssets = {}, TShirt = "rbxassetid://148856353" } CharacterAppearance.Create { Id = 4, HeadColor = BrickColor.new("Pastel brown"), TorsoColor = BrickColor.new("Pastel brown"), RightArmColor = BrickColor.new("Pastel brown"), LeftArmColor = BrickColor.new("Pastel brown"), RightLegColor = BrickColor.new("White"), LeftLegColor = BrickColor.new("White"), CharacterAssets = { 129458426, 96678344, 184489190 }, HeadAssets = {}, TShirt = "rbxassetid://160146697" } GraphicalEffects = {}; local MESH_IDS = {"rbxassetid://15310891"} local SOUND_IDS = {"rbxassetid://2248511", "rbxassetid://1369158"} local TEXTURE_IDS = {"rbxassetid://36527089", "rbxassetid://122610943", "rbxassetid://126561317", "rbxassetid://127033719"} local preloadConnections = {} local reloadingPreloads = false function GraphicalEffects.InitPreloads() local preload_part = Instance.new("Part") GraphicalEffects.preload_part = preload_part preload_part.Anchored = true preload_part.Archivable = false preload_part.BottomSurface = "Smooth" preload_part.CanCollide = false preload_part.CFrame = CFrame.new(math.huge, math.huge, math.huge) preload_part.FormFactor = "Custom" preload_part.Locked = true preload_part.Name = "Asset Preloader" preload_part.Size = Vector3.new(0.2, 0.2, 0.2) preload_part.TopSurface = "Smooth" preload_part.Transparency = 1 preloadConnections[preload_part] = preload_part.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) for _, mesh_id in ipairs(MESH_IDS) do local mesh = Instance.new("SpecialMesh") mesh.MeshType = "FileMesh" mesh.MeshId = mesh_id preloadConnections[mesh] = mesh.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) mesh.Parent = preload_part end for _, sound_id in ipairs(SOUND_IDS) do local sound = Instance.new("Sound") sound.SoundId = sound_id sound.Volume = 0 preloadConnections[sound] = sound.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) sound.Parent = preload_part end for _, texture_id in ipairs(TEXTURE_IDS) do local decal = Instance.new("Decal") decal.Texture = texture_id preloadConnections[decal] = decal.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) decal.Parent = preload_part end preload_part.Parent = Workspace end function GraphicalEffects.PreloadsAncestryChanged(child, parent) if not reloadingPreloads and parent ~= GraphicalEffects.preload_part and parent ~= Workspace then reloadingPreloads = true for _, connection in pairs(preloadConnections) do connection:disconnect() preloadConnections[_] = nil end wait(1) reloadingPreloads = false GraphicalEffects.InitPreloads() end end GraphicalEffects.InitPreloads() -- Hyper beam function GraphicalEffects.FireSpaceHyperBeam(target, power, duration, radius, height, deviation) local stepTime, gameTime = 1 / 30, TaskScheduler.GetCurrentTime() local frames = duration * 30 local beamColorOffset = 0.75 * tick() -- math.random() local blastPressure = power * 62500 + 250000 local beamPart = Instance.new("Part") local beamMesh = Instance.new("SpecialMesh", beamPart) local explosion = Instance.new("Explosion") local sound = Instance.new("Sound", beamPart) beamPart.Anchored = true beamPart.CanCollide = false beamPart.CFrame = CFrame.new(target, target + Vector3.new(deviation * (math.random() - 0.5), deviation * (math.random() - 0.5), height)) beamPart.FormFactor = "Custom" beamPart.Locked = true beamPart.Size = Vector3.new(0.2, 0.2, 0.2) beamMesh.MeshId = "rbxassetid://15310891" beamMesh.MeshType = "FileMesh" beamMesh.TextureId = "rbxassetid://36527089" local beamGlowPart1 = beamPart:Clone() local beamGlowMesh1 = beamMesh:Clone() local beamGlowPart2 = beamPart:Clone() local beamGlowMesh2 = beamMesh:Clone() local beamLight = Instance.new("PointLight", beamPart) beamLight.Range = power * 2 beamLight.Shadows = true explosion.BlastPressure = blastPressure explosion.BlastRadius = power explosion.Position = target sound.SoundId = "rbxassetid://2248511" sound.Volume = 1 local explosionHitConnection = explosion.Hit:connect(function(part, distance) if not part.Anchored and part:GetMass() < power * power then pcall(part.BreakJoints, part) part.Color = Color3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset)) end end) beamPart.Transparency = 0.5 beamPart.Archivable = false beamGlowPart1.Transparency = 0.75 beamGlowPart2.Transparency = 0.75 beamGlowMesh1.Parent = beamGlowPart1 beamGlowPart1.Parent = beamPart beamGlowMesh2.Parent = beamGlowPart2 beamGlowPart2.Parent = beamPart beamPart.Parent = workspace explosion.Parent = workspace for frame = 1, frames do local progress = frame / frames local alpha = 1 - math.sin(0.5 * math.pi * progress) local scale = 0.4 * alpha local glowScale1 = alpha * (0.5 + 0.5 * math.sin(math.tau * (8 * gameTime + beamColorOffset))) local glowScale2 = alpha * (0.5 + 0.5 * math.cos(math.tau * (8 * gameTime + beamColorOffset))) local vertexColor = Vector3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset)) beamLight.Brightness = 1 - progress beamLight.Color = Color3.new(vertexColor.x, vertexColor.y, vertexColor.z) beamMesh.Scale = Vector3.new(radius * scale, 9000, radius * scale) beamMesh.VertexColor = vertexColor beamGlowMesh1.Scale = Vector3.new(1.2 * radius * glowScale1, 9000, 1.2 * radius * glowScale1) beamGlowMesh1.VertexColor = vertexColor beamGlowMesh2.Scale = Vector3.new(1.2 * radius * glowScale2, 9000, 1.2 * radius * glowScale2) beamGlowMesh2.VertexColor = vertexColor RunService.Stepped:wait() gameTime = TaskScheduler.GetCurrentTime() if frame <= 2 then local explosion = Instance.new("Explosion") explosion.BlastPressure = (1 - progress) * blastPressure explosion.BlastRadius = (1 - progress) * power explosion.Position = target explosion.Parent = Workspace if frame == 2 then sound:Play() end end end pcall(beamPart.Destroy, beamPart) explosionHitConnection:disconnect() end function GraphicalEffects.SpaceHyperBeam(target, power, duration, radius, height, deviation) TaskScheduler.Start(GraphicalEffects.FireSpaceHyperBeam, target, power or 12, duration or 1.5, radius or 6, height or 600, deviation or 20) end function GraphicalEffects.CrystalRing(data) data = data or {} local crystal_count = data.crystal_count or 10 local crystal_color = data.crystal_color or BrickColor.new("Bright red") local crystal_scale = data.crystal_scale or Vector3.new(2 / 3, 2, 2 / 3) local fade_out_color = data.fade_out_color or BrickColor.new("Really black") local radius = radius or 1.25 * crystal_count / math.pi local spawn_duration = data.spawn_duration or 0.065 local full_spawn_duration = spawn_duration * crystal_count local float_duration = data.float_duration or 5 local wave_amplitude = data.wave_amplitude or 0.5 local wave_period = data.wave_period or 1 local appear_duration = data.appear_duration or 0.1 local disappear_duration = data.disappear_duration or 0.5 local base_part = data.base_part local offset_cframe if data.position then offset_cframe = CFrame.new(data.position) if base_part then offset_cframe = base_part.CFrame:toObjectSpace(offset_cframe) end else offset_cframe = CFrame.new() end local crystal_template = Instance.new("Part") crystal_template.Anchored = true crystal_template.Locked = true crystal_template.CanCollide = false crystal_template.BottomSurface = "Smooth" crystal_template.TopSurface = "Smooth" crystal_template.BrickColor = crystal_color crystal_template.FormFactor = "Symmetric" crystal_template.Size = Vector3.new(1, 1, 1) local crystal_light = Instance.new("PointLight", crystal_template) crystal_light.Brightness = 0.1 / crystal_count crystal_light.Color = crystal_color.Color crystal_light.Name = "Light" crystal_light.Range = radius crystal_light.Shadows = true local crystal_mesh = Instance.new("SpecialMesh", crystal_template) crystal_mesh.MeshId = "rbxassetid://9756362" crystal_mesh.MeshType = "FileMesh" crystal_mesh.Name = "Mesh" crystal_mesh.Scale = crystal_scale local crystal_model = Instance.new("Model") crystal_model.Archivable = false crystal_model.Name = "Crystal Model" crystal_model.Parent = Workspace local crystals = {} local lights = {} local meshes = {} for index = 1, crystal_count do local crystal = crystal_template:Clone() crystal.Parent = crystal_model crystals[index] = crystal lights[index] = crystal.Light meshes[index] = crystal.Mesh end local start_time = tick() repeat local base_cframe = offset_cframe if base_part then base_cframe = base_part.CFrame * base_cframe end local elapsed_time = tick() - start_time for index, crystal in ipairs(crystals) do local crystal_time = elapsed_time - index * spawn_duration local disappear_time = crystal_time - float_duration local offset if crystal_time < 0 then offset = 0 elseif crystal_time < appear_duration then offset = radius * crystal_time / appear_duration else offset = radius end local wave_offset if disappear_time >= 0 then local disappear_progress = disappear_time / disappear_duration if disappear_progress > 1 then if crystal.Parent then crystal:Destroy() end else local inverse_progress = 1 - disappear_progress local light = lights[index] local mesh = meshes[index] crystal.BrickColor = fade_out_color light.Brightness = 2 * inverse_progress light.Range = 2 * radius mesh.Scale = crystal_scale * inverse_progress end wave_offset = 0 else wave_offset = wave_amplitude * math.sin(math.tau * (elapsed_time - index / crystal_count * 3) / wave_period) end local rotation_angle = (tick() * 0.5 + (index - 1) / crystal_count) % 1 * math.tau crystal.CFrame = base_cframe * CFrame.Angles(0, rotation_angle, 0) * CFrame.new(0, wave_offset, -offset) end RunService.Stepped:wait() until elapsed_time >= float_duration + full_spawn_duration + disappear_duration if crystal_model.Parent then crystal_model:Destroy() end end GraphicalEffects.magicCircleData = {} GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET = 6.25 function GraphicalEffects.AnimateMagicCircle(data) local frame, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, duration, stay, magic_circle_adornee_func, magic_circle_offset = unpack(data) frame = frame + 1 data[1] = frame local transparency = (frame / duration) ^ stay local opacity = 1 - transparency if frame == duration then pcall(Game.Destroy, magic_circle_model) GraphicalEffects.magicCircleData[data] = nil else if magic_circle_model.Parent ~= Workspace then pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace) end local magic_circle_adornee = magic_circle_adornee_func() magic_circle_position = magic_circle_adornee.Position + direction * magic_circle_offset local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame / 25) magic_circle_part.CFrame = magic_circle_cframe magic_circle_light.Brightness = opacity magic_circle_decal_back.Transparency = transparency magic_circle_decal_front.Transparency = transparency end end function GraphicalEffects.CreateMagicCircle(target, magic_circle_scale, magic_circle_image, light_color, duration, stay, magic_circle_adornee_func, magic_circle_offset) local magic_circle_adornee = magic_circle_adornee_func() if magic_circle_adornee then local origin = magic_circle_adornee.Position local direction = (target - origin).unit local magic_circle_position = origin + direction * magic_circle_offset local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) local magic_circle_model = Instance.new("Model") local magic_circle_part = Instance.new("Part", magic_circle_model) local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part) local magic_circle_light = Instance.new("PointLight", magic_circle_part) local magic_circle_decal_back = Instance.new("Decal", magic_circle_part) local magic_circle_decal_front = Instance.new("Decal", magic_circle_part) magic_circle_model.Archivable = false magic_circle_part.Anchored = true magic_circle_part.BottomSurface = "Smooth" magic_circle_part.CanCollide = false magic_circle_part.CFrame = magic_circle_cframe magic_circle_part.FormFactor = "Custom" magic_circle_part.Locked = true magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2) magic_circle_part.TopSurface = "Smooth" magic_circle_part.Transparency = 1 magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale magic_circle_light.Color = light_color magic_circle_light.Range = 16 * magic_circle_scale magic_circle_light.Shadows = true magic_circle_decal_back.Face = "Back" magic_circle_decal_back.Texture = magic_circle_image magic_circle_decal_front.Face = "Front" magic_circle_decal_front.Texture = magic_circle_image magic_circle_model.Parent = Workspace local data = {0, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, duration, stay, magic_circle_adornee_func, magic_circle_offset} GraphicalEffects.magicCircleData[data] = true return data end end GraphicalEffects.missileData = {} GraphicalEffects.missileParts = {} function GraphicalEffects.AnimateMissile(data) local frame, missilePart, targetPart, timeCreated, direction, touchedConnection, explodeRequested, bodyGyro, swooshSound, magicCircleData, lifeTime, pointOnPart, flipped = unpack(data) frame = frame + 1 data[1] = frame if flipped then direction = -direction end if frame <= 10 then if frame == 2 then swooshSound:Play() end missilePart.Anchored = true local progress = frame / 10 missilePart.Size = Vector3.new(1, 1, progress * 4) local magicCirclePart = magicCircleData[4] local magicCirclePosition = magicCirclePart.Position local missileOffset = 2 * progress * direction local missilePosition = magicCirclePosition + missileOffset missilePart.CFrame = CFrame.new(missilePosition, missilePosition + direction) --missilePart.Transparency = 0.5 * (1 - progress) if frame == 10 then touchedConnection = missilePart.Touched:connect(function(hit) if hit.CanCollide and hit.Parent and not GraphicalEffects.missileParts[hit] then touchedConnection:disconnect() data[7] = true end end) data[6] = touchedConnection end else missilePart.Anchored = false local missilePosition = missilePart.Position local targetPosition = targetPart.CFrame * pointOnPart local distanceVector = targetPosition - missilePosition local elapsedTime = time() - timeCreated local targetParent = targetPart.Parent if explodeRequested or (targetParent and distanceVector.magnitude < 10) or elapsedTime > lifeTime then GraphicalEffects.missileData[data] = nil GraphicalEffects.missileParts[missilePart] = nil touchedConnection:disconnect() if missilePart.Parent then missilePart:Destroy() local explosion = Instance.new("Explosion") explosion.BlastRadius = 12.5 explosion.Position = missilePosition local explosionHitConnection = explosion.Hit:connect(function(hit, distance) local missileData = GraphicalEffects.missileParts[hit] if missileData and distance < 3 then missileData[7] = true else pcall(hit.BreakJoints, hit) end end) explosion.Parent = Workspace TaskScheduler.Schedule(1, explosionHitConnection.disconnect, explosionHitConnection) end else local targetInWorkspace = targetPart:IsDescendantOf(Workspace) if targetInWorkspace then direction = distanceVector.unit data[5] = direction end local speed = 14 + elapsedTime * 10 local gyroD if elapsedTime < 42.5 and targetInWorkspace then gyroD = 1000 - elapsedTime * 15 else gyroD = 100 bodyGyro.maxTorque = Vector3.new(0, 0, 0) if elapsedTime + 7.5 < lifeTime then data[11] = elapsedTime + 7.5 end end bodyGyro.D = gyroD bodyGyro.cframe = CFrame.new(Vector3.new(), direction) missilePart.Velocity = missilePart.CFrame.lookVector * speed end end end function GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction, magic_circle_adornee_func, magic_circle_offset, flipped) if not magic_circle_offset then magic_circle_offset = GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET end local targetPosition = targetPart.Position local headPosition = chatAdornee.Position local origin = CFrame.new(headPosition, headPosition + direction) + direction * magic_circle_offset local missilePart = Instance.new("Part") local antiGravityForce = Instance.new("BodyForce", missilePart) local bodyGyro = Instance.new("BodyGyro", missilePart) local explosionSound = Instance.new("Sound", missilePart) local swooshSound = Instance.new("Sound", missilePart) antiGravityForce.force = Vector3.new(0, 196.2 * 4, 0) bodyGyro.D = 1000 bodyGyro.maxTorque = Vector3.new(1, 1, 1) explosionSound.PlayOnRemove = true explosionSound.SoundId = "rbxasset://sounds/collide.wav" explosionSound.Volume = 1 missilePart.Anchored = true missilePart.BackSurface = "Studs" missilePart.BottomSurface = "Studs" missilePart.BrickColor = BrickColor.Red() missilePart.CFrame = origin missilePart.FormFactor = "Custom" missilePart.FrontSurface = "Studs" missilePart.LeftSurface = "Studs" missilePart.Locked = true missilePart.RightSurface = "Studs" missilePart.Size = Vector3.new(1, 1, 0.2) missilePart.TopSurface = "Studs" --missilePart.Transparency = 0.5 swooshSound.Looped = true swooshSound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav" swooshSound.Volume = 0.7 local magicCircleData = GraphicalEffects.CreateMagicCircle(headPosition + direction * 1000, 0.875, "rbxassetid://127033719", Color3.new(1, 1, 1), 40, 4, magic_circle_adornee_func or function() return chatAdornee end, magic_circle_offset) local data = {0, missilePart, targetPart, time(), direction, false, false, bodyGyro, swooshSound, magicCircleData, 50, pointOnPart, flipped} missilePart.Parent = Workspace GraphicalEffects.missileData[data] = true GraphicalEffects.missileParts[missilePart] = data end function GraphicalEffects.CubicInterpolate(y0, y1, y2, y3, mu) local a0, a1, a2, a3, mu2 mu2 = mu * mu a0 = y3 - y2 - y0 + y1 a1 = y0 - y1 - a0 a2 = y2 - y0 a3 = y1 return a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3 end function GraphicalEffects.JointCrap(model, cycletime) if model then local cycletime = cycletime or (0.75 * (1 + math.random() * 4)) local offsetradius = 0.75 local rotationoffset = math.pi local joints = {} local stack = model:GetChildren() while #stack ~= 0 do local object = stack[#stack] table.remove(stack) for index, child in ipairs(object:GetChildren()) do table.insert(stack, child) end if object:IsA("JointInstance") then table.insert(joints, object) end end local rot0 = {} local rot1 = {} local rot2 = {} local rot3 = {} local rot4 = {} for index, joint in ipairs(joints) do local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius local rot = Vector3.new(math.random(), math.random(), math.random()) * rotationoffset rot0[index] = {joint.C0, joint.C1} rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) rot2[index] = {pos, rot} pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) rot3[index] = {pos, rot} pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) rot4[index] = {pos, rot} end while model.Parent do for i, j in ipairs(joints) do local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius local rot = rot4[i][2] + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) rot1[i], rot2[i], rot3[i], rot4[i] = rot2[i], rot3[i], rot4[i], {pos, rot} end local start = tick() while true do local ctime = tick() local elapsed = ctime - start if elapsed > cycletime then break end local progress = elapsed / cycletime for index, joint in ipairs(joints) do local v0, v1, v2, v3, v4 = rot0[index], rot1[index], rot2[index], rot3[index], rot4[index] local p1, p2, p3, p4, r1, r2, r3, r4 = v1[1], v2[1], v3[1], v4[1], v1[2], v2[2], v3[2], v4[2] local px = GraphicalEffects.CubicInterpolate(p1.x, p2.x, p3.x, p4.x, progress) local py = GraphicalEffects.CubicInterpolate(p1.y, p2.y, p3.y, p4.y, progress) local pz = GraphicalEffects.CubicInterpolate(p1.z, p2.z, p3.z, p4.z, progress) local rx = GraphicalEffects.CubicInterpolate(r1.x, r2.x, r3.x, r4.x, progress) local ry = GraphicalEffects.CubicInterpolate(r1.y, r2.y, r3.y, r4.y, progress) local rz = GraphicalEffects.CubicInterpolate(r1.z, r2.z, r3.z, r4.z, progress) local cframe = CFrame.new(px, py, pz) * CFrame.Angles(rx, ry, rz) joint.C0 = v0[1] * cframe joint.C1 = v0[2] * cframe:inverse() end RunService.Stepped:wait() end end end end GraphicalEffects.LASER_WIDTH = 0.15 GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE = 6.25 GraphicalEffects.laser_data = {} --GraphicalEffects.fragmentation = {} function GraphicalEffects.AnimateLaserOfDeath(data) local frame, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay, light_effects = unpack(data) local laser_color = laser_part.Color frame = frame + 1 data[1] = frame local transparency = (frame / duration) ^ stay local opacity = 1 - transparency if frame == 2 then sound:Play() end if frame == duration then pcall(Game.Destroy, magic_circle_model) GraphicalEffects.laser_data[data] = nil else if magic_circle_model.Parent ~= Workspace then pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace) end local laser_distance = 0 local origin = chatAdornee.CFrame if not light_effects then direction = (origin * directionOrientation - origin.p).unit end local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame / 25) local loop_scale = (laser_scale - 1) / 10 for x_offset = -loop_scale, loop_scale, 2 do for y_offset = -loop_scale, loop_scale, 2 do local origin_position = magic_circle_cframe * Vector3.new(x_offset, y_offset, 0) for index = 1, 8 do local part, position for ray_index = 1, 10 do local ray = Ray.new(origin_position + direction * (999 * (ray_index - 1)), direction * 999) part, position = Workspace:FindPartOnRay(ray, magic_circle_model) if part then break end end if part then laser_distance = (position - origin_position).magnitude if frame % 8 == 1 and index == 1 then Instance.new("Explosion", Workspace).Position = position end if not part:IsA("Terrain") then pcall(part.BreakJoints, part) local is_block = part:IsA("Part") and part.Shape == Enum.PartType.Block local mass = part:GetMass() local size = part.Size if (is_block and ((size.X < fragmentation_size and size.Y < fragmentation_size and size.Z < fragmentation_size) or (not part.Anchored and mass < 750))) or (not is_block and mass < 250000) then local part_transparency = math.max(part.Transparency + 0.007 * fragmentation_size, 0.5) if part_transparency >= 0.5 then -- temporarily to minimize debris pcall(Game.Destroy, part) else local cframe = part.CFrame part.Anchored = false part.BrickColor = BrickColor.new("Medium stone grey") part.CanCollide = true if part:IsA("FormFactorPart") then part.FormFactor = "Custom" end part.Size = size - Vector3.new(0.135, 0.135, 0.135) * fragmentation_size part.Transparency = part_transparency part.CFrame = cframe + direction * 5 part.Velocity = part.Velocity + direction * 40 end elseif is_block then local parts = {part} local model = Instance.new("Model", part.Parent) model.Name = "Fragments" if size.X >= fragmentation_size then size = Vector3.new(0.5, 1, 1) * size local archivable = part.Archivable local cframe = part.CFrame part.FormFactor = "Custom" part.Size = size part.Archivable = true local part_clone = part:Clone() part.Archivable = archivable part_clone.Archivable = archivable part.CFrame = cframe * CFrame.new(-0.5 * size.X, 0, 0) part_clone.CFrame = cframe * CFrame.new(0.5 * size.X, 0, 0) part_clone.Parent = model parts[2] = part_clone end if size.Y >= fragmentation_size then size = Vector3.new(1, 0.5, 1) * size for part_index = 1, #parts do local part = parts[part_index] local archivable = part.Archivable local cframe = part.CFrame part.FormFactor = "Custom" part.Size = size part.Archivable = true local part_clone = part:Clone() part.Archivable = archivable part_clone.Archivable = archivable part.CFrame = cframe * CFrame.new(0, -0.5 * size.Y, 0) part_clone.CFrame = cframe * CFrame.new(0, 0.5 * size.Y, 0) part_clone.Parent = model table.insert(parts, part_clone) end end if size.Z >= fragmentation_size then size = Vector3.new(1, 1, 0.5) * size for part_index = 1, #parts do local part = parts[part_index] local archivable = part.Archivable local cframe = part.CFrame part.FormFactor = "Custom" part.Size = size part.Archivable = true local part_clone = part:Clone() part.Archivable = archivable part_clone.Archivable = archivable part.CFrame = cframe * CFrame.new(0, 0, -0.5 * size.Z) part_clone.CFrame = cframe * CFrame.new(0, 0, 0.5 * size.Z) part_clone.Parent = model table.insert(parts, part_clone) end end for _, part in ipairs(parts) do part:MakeJoints() end else break end end else laser_distance = 9990 break end end end end local laser_cframe = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0) local laser_width = GraphicalEffects.LASER_WIDTH * opacity * laser_scale local laser_mesh_offset = Vector3.new(0, 0.5 * laser_distance, 0) laser_part.CFrame = laser_cframe if laser_effects then local laser_effect_data_1, laser_effect_data_2 = laser_effects[1], laser_effects[2] local laser_effect_1, laser_effect_mesh_1 = laser_effect_data_1[1], laser_effect_data_1[2] local laser_effect_2, laser_effect_mesh_2 = laser_effect_data_2[1], laser_effect_data_2[2] laser_effect_1.CFrame = laser_cframe laser_effect_2.CFrame = laser_cframe laser_effect_mesh_1.Offset = laser_mesh_offset laser_effect_mesh_2.Offset = laser_mesh_offset local game_time = time() local effect_scale_1 = 0.5 + 0.5 * math.sin(16 * math.pi * game_time) local effect_scale_2 = 0.5 + 0.5 * math.cos(16 * math.pi * game_time) laser_effect_mesh_1.Scale = 5 * Vector3.new(laser_width * effect_scale_1, laser_distance, laser_width * effect_scale_1) laser_effect_mesh_2.Scale = 5 * Vector3.new(laser_width * effect_scale_2, laser_distance, laser_width * effect_scale_2) laser_width = laser_width * 0.25 end laser_mesh.Offset = laser_mesh_offset laser_mesh.Scale = 5 * Vector3.new(laser_width, laser_distance, laser_width) magic_circle_part.CFrame = magic_circle_cframe magic_circle_light.Brightness = opacity magic_circle_decal_back.Transparency = transparency magic_circle_decal_front.Transparency = transparency if light_effects then for index, data in ipairs(laser_lights) do local laser_spotlight_part, laser_spotlight = data[1], data[2] local laser_spotlight_offset = 30 * (index - 1) if laser_spotlight_offset <= laser_distance then laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -laser_spotlight_offset) laser_spotlight.Brightness = opacity laser_spotlight.Enabled = true else laser_spotlight.Enabled = false end end end end end function GraphicalEffects.ShootLaserOfDeath(target, data) if chatAdornee then data = data or {} local brickcolor = data.brickcolor or BrickColor.new("Really black") local duration = data.duration or 40 local fragmentation_size = data.fragmentation_size or 3 local laser_scale = data.laser_scale or 1 local light_color = data.light_color or Color3.new(1, 0.5, 1) local magic_circle_image = data.magic_circle_image or "rbxassetid://122610943" local magic_circle_scale = data.magic_circle_scale or 1 local sound_volume = data.sound_volume or 1 / 3 local special_effects = data.special_effects local stay = data.stay or 4 local origin = chatAdornee.CFrame local directionOrientation = origin:pointToObjectSpace(target) local direction = (target - origin.p).unit local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) local magic_circle_model = Instance.new("Model") local laser_part = Instance.new("Part", magic_circle_model) local laser_mesh = Instance.new("CylinderMesh", laser_part) local magic_circle_part = Instance.new("Part", magic_circle_model) local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part) local magic_circle_light = Instance.new("PointLight", magic_circle_part) local magic_circle_decal_back = Instance.new("Decal", magic_circle_part) local magic_circle_decal_front = Instance.new("Decal", magic_circle_part) local sound = Instance.new("Sound", magic_circle_part) sound.Pitch = 1.25 sound.SoundId = "rbxassetid://2248511" sound.Volume = sound_volume magic_circle_model.Archivable = false laser_part.Anchored = true laser_part.BottomSurface = "Smooth" laser_part.BrickColor = brickcolor laser_part.CanCollide = false laser_part.CFrame = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0) laser_part.FormFactor = "Custom" laser_part.Locked = true laser_part.Size = Vector3.new(0.2, 0.2, 0.2) laser_part.TopSurface = "Smooth" laser_mesh.Offset = Vector3.new(0, 0, 0) laser_mesh.Name = "Mesh" laser_mesh.Scale = 5 * laser_scale * Vector3.new(GraphicalEffects.LASER_WIDTH, 0, GraphicalEffects.LASER_WIDTH) magic_circle_part.Anchored = true magic_circle_part.BottomSurface = "Smooth" magic_circle_part.CanCollide = false magic_circle_part.CFrame = magic_circle_cframe magic_circle_part.FormFactor = "Custom" magic_circle_part.Locked = true magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2) magic_circle_part.TopSurface = "Smooth" magic_circle_part.Transparency = 1 magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale magic_circle_light.Color = light_color magic_circle_light.Range = 16 * magic_circle_scale magic_circle_light.Shadows = true magic_circle_decal_back.Face = "Back" magic_circle_decal_back.Texture = magic_circle_image magic_circle_decal_front.Face = "Front" magic_circle_decal_front.Texture = magic_circle_image magic_circle_model.Parent = Workspace local laser_color = brickcolor.Color local laser_lights = {} local light_effects = laser_color.r + laser_color.g + laser_color.b > 0.25 if light_effects then local laser_spotlight_part_template = Instance.new("Part") local laser_spotlight_light_template = Instance.new("SpotLight", laser_spotlight_part_template) laser_spotlight_part_template.Anchored = true laser_spotlight_part_template.Anchored = true laser_spotlight_part_template.BottomSurface = "Smooth" laser_spotlight_part_template.CanCollide = false laser_spotlight_part_template.FormFactor = "Custom" laser_spotlight_part_template.Locked = true laser_spotlight_part_template.Size = Vector3.new(0.2, 0.2, 0.2) laser_spotlight_part_template.TopSurface = "Smooth" laser_spotlight_part_template.Transparency = 1 laser_spotlight_light_template.Angle = 45 laser_spotlight_light_template.Color = laser_color laser_spotlight_light_template.Enabled = true laser_spotlight_light_template.Name = "Light" laser_spotlight_light_template.Range = 60 for index = 1, 40 do local laser_spotlight_part = laser_spotlight_part_template:Clone() laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -30 * (index - 1)) laser_spotlight_part.Parent = magic_circle_model laser_lights[index] = {laser_spotlight_part, laser_spotlight_part.Light} end end local laser_effects if special_effects then laser_effects = {} local laser_effect_1 = laser_part:Clone() laser_effect_1.BrickColor = special_effects laser_effect_1.Transparency = 0.5 local laser_effect_2 = laser_effect_1:Clone() laser_effects[1], laser_effects[2] = {laser_effect_1, laser_effect_1.Mesh}, {laser_effect_2, laser_effect_2.Mesh} laser_effect_1.Parent = magic_circle_model laser_effect_2.Parent = magic_circle_model end GraphicalEffects.laser_data[{0, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay, light_effects}] = true end end function GraphicalEffects.SpawnSapientRock(position) local part = Instance.new("Part", Workspace) local size = 8 + math.random(0, 5) part.BottomSurface = "Smooth" part.TopSurface = "Smooth" part.Material = "Slate" part.Locked = true part.Shape = "Ball" part.FormFactor = "Custom" part.Size = Vector3.new(size, size, size) part.Position = position local bodypos = Instance.new("BodyPosition", part) bodypos.maxForce = Vector3.new(0, 0, 0) local angry = false local damage_ready = true local torso_following local torso_changed = -1000 local touched_conn = part.Touched:connect(function(hit) local character = hit.Parent if character then local humanoid for _, child in ipairs(character:GetChildren()) do if child:IsA("Humanoid") then humanoid = child break end end if humanoid then if angry then if damage_ready then damage_ready = false humanoid:TakeDamage(100) wait(1) damage_ready = true angry = false part.BrickColor = BrickColor.new("Medium stone grey") end else local torso = humanoid.Torso if torso then torso_following = torso torso_changed = tick() end end end end end) TaskScheduler.Start(function() while part.Parent == Workspace do if torso_following then bodypos.position = torso_following.Position if tick() - torso_changed > 60 or not torso_following.Parent then torso_following = nil bodypos.maxForce = Vector3.new(0, 0, 0) angry = false part.BrickColor = BrickColor.new("Medium stone grey") else local speed = angry and Vector3.new(16, 16, 16) or Vector3.new(6, 0, 6) bodypos.maxForce = part:GetMass() * speed if part.Position.Y < -250 then part.Velocity = Vector3.new() part.Position = torso_following.Position + Vector3.new(0, 80, 0) part.BrickColor = BrickColor.new("Bright red") angry = true torso_changed = tick() end end end RunService.Stepped:wait() end touched_conn:disconnect() end) TaskScheduler.Start(function() while part.Parent == Workspace do wait(25 + math.random() * 10) local next_size = 8 + math.random() * 5 if math.random(100) == 1 then next_size = next_size * (2 + 6 * math.random()) end next_size = math.floor(next_size + 0.5) local start_time = tick() local mesh = Instance.new("SpecialMesh", part) mesh.MeshType = "Sphere" repeat local elapsed_time = tick() - start_time local alpha = math.cos(elapsed_time * math.pi * 0.5) local interpolated_size = size * alpha + next_size * (1 - alpha) local size_vector = Vector3.new(interpolated_size, interpolated_size, interpolated_size) local cframe = part.CFrame part.Size = size_vector part.CFrame = cframe mesh.Scale = size_vector / part.Size RunService.Stepped:wait() until tick() - start_time >= 1 mesh:Destroy() local cframe = part.CFrame part.Size = Vector3.new(next_size, next_size, next_size) part.CFrame = cframe size = next_size end end) end function GraphicalEffects.MainLoop() RunService.Stepped:wait() for data in pairs(GraphicalEffects.magicCircleData) do GraphicalEffects.AnimateMagicCircle(data) end for data in pairs(GraphicalEffects.laser_data) do GraphicalEffects.AnimateLaserOfDeath(data) end for data in pairs(GraphicalEffects.missileData) do GraphicalEffects.AnimateMissile(data) end end TaskScheduler.Start(function() while true do GraphicalEffects.MainLoop() end end) PlayerControl = {}; PlayerControl.fly_acceleration = 10 PlayerControl.fly_basespeed = 250 PlayerControl.fly_speed = PlayerControl.fly_basespeed PlayerControl.featherfallEnabled = true PlayerControl.pushable = false PlayerControl.rolling = false PlayerControl.rollingAngle = 0 PlayerControl.rollingOffset = 0 PlayerControl.rollingMaxOffset = 3 PlayerControl.rollingSpeed = 1 / 50 PlayerControl.characterEnabled = false PlayerControl.characterMode = "normal" local character = nil local flying, flyingMomentum, flyingTilt = false, Vector3.new(), 0 local pose, regeneratingHealth, jumpDebounce = "Standing", false, false -- TODO: make local variables public local model, bodyColors, leftArmMesh, leftLegMesh, rightArmMesh, rightLegMesh, torsoMesh, wildcardHat, wildcardHandle, wildcardMesh, pants, shirt, humanoid, head, leftArm, leftLeg, rightArm, rightLeg, torso, rootPart, rootJoint, face, soundFreeFalling, soundGettingUp, soundRunning, leftHip, leftShoulder, rightHip, rightShoulder, neck, wildcardWeld, feetPart, feetWeld, feetTouchInterest, bodyGyro, bodyVelocity, headMesh, torsoLight local AnimateCharacter local UserInterface = game:service'UserInputService' local chatBubbles = {} local chatCharacterLimit = 240 function PlayerControl.CreateCharacter() local characterMode = PlayerControl.characterMode if characterMode == "normal" then if not PlayerControl.characterEnabled then return end local appearance = CharacterAppearance.GetDefaultAppearance() local active = true local torsoCFrame = (torso and torso.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0) if torsoCFrame.p.Y < -450 then torsoCFrame = CFrame.new(0, 10, 0) end local rootPartCFrame = (rootPart and rootPart.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0) if rootPartCFrame.p.Y < -450 then rootPartCFrame = CFrame.new(0, 10, 0) end local cameraCFrame = Camera.CoordinateFrame local connections = {} local feetTouching = {} local previousWalkSpeed = 0 local prevLeftHip, prevLeftShoulder, prevRightHip, prevRightShoulder = leftHip, leftShoulder, rightHip, rightShoulder model = Instance.new("Model") humanoid = Instance.new("Humanoid", model) head = Instance.new("Part", model) leftArm = Instance.new("Part", model) leftLeg = Instance.new("Part", model) rightArm = Instance.new("Part", model) rightLeg = Instance.new("Part", model) torso = Instance.new("Part", model) rootPart = Instance.new("Part", model) soundFallingDown = Instance.new("Sound", head) soundFreeFalling = Instance.new("Sound", head) soundGettingUp = Instance.new("Sound", head) soundJumping = Instance.new("Sound", head) soundRunning = Instance.new("Sound", head) leftHip = Instance.new("Motor", torso) leftShoulder = Instance.new("Motor", torso) rightHip = Instance.new("Motor", torso) rightShoulder = Instance.new("Motor", torso) neck = Instance.new("Motor", torso) rootJoint = Instance.new("Motor", rootPart) feetPart = Instance.new("Part", model) feetWeld = Instance.new("Weld", torso) bodyGyro = Instance.new("BodyGyro", rootPart) bodyVelocity = Instance.new("BodyVelocity", rootPart) model.Archivable = false model.Name = user_name or Player.Name model.PrimaryPart = head humanoid.LeftLeg = leftLeg humanoid.RightLeg = rightLeg humanoid.Torso = rootPart head.CFrame = torsoCFrame * CFrame.new(0, 1.5, 0) head.FormFactor = "Symmetric" head.Locked = true head.Name = "Head" head.Size = Vector3.new(2, 1, 1) head.TopSurface = "Smooth" leftArm.CanCollide = false leftArm.CFrame = torsoCFrame * CFrame.new(-1.5, 0, 0) leftArm.FormFactor = "Symmetric" leftArm.Locked = true leftArm.Name = "Left Arm" leftArm.Size = Vector3.new(1, 2, 1) leftLeg.BottomSurface = "Smooth" leftLeg.CanCollide = false leftLeg.CFrame = torsoCFrame * CFrame.new(-0.5, -2, 0) leftLeg.FormFactor = "Symmetric" leftLeg.Locked = true leftLeg.Name = "Left Leg" leftLeg.Size = Vector3.new(1, 2, 1) leftLeg.TopSurface = "Smooth" rightArm.CanCollide = false rightArm.CFrame = torsoCFrame * CFrame.new(1.5, 0, 0) rightArm.FormFactor = "Symmetric" rightArm.Locked = true rightArm.Name = "Right Arm" rightArm.Size = Vector3.new(1, 2, 1) rightLeg.BottomSurface = "Smooth" rightLeg.CanCollide = false rightLeg.CFrame = torsoCFrame * CFrame.new(0.5, -2, 0) rightLeg.FormFactor = "Symmetric" rightLeg.Locked = true rightLeg.Name = "Right Leg" rightLeg.Size = Vector3.new(1, 2, 1) rightLeg.TopSurface = "Smooth" torso.CFrame = torsoCFrame torso.FormFactor = "Symmetric" torso.LeftSurface = "Weld" torso.Locked = true torso.RightSurface = "Weld" torso.Name = "Torso" torso.Size = Vector3.new(2, 2, 1) rootPart.BottomSurface = "Smooth" rootPart.BrickColor = BrickColor.Blue() rootPart.CFrame = rootPartCFrame rootPart.FormFactor = "Symmetric" rootPart.LeftSurface = "Weld" rootPart.Locked = true rootPart.RightSurface = "Weld" rootPart.Name = "HumanoidRootPart" rootPart.Size = Vector3.new(2, 2, 1) rootPart.TopSurface = "Smooth" rootPart.Transparency = 1 soundFreeFalling.Archivable = false soundFreeFalling.SoundId = "rbxasset://sounds/swoosh.wav" soundGettingUp.Archivable = false soundGettingUp.SoundId = "rbxasset://sounds/hit.wav" soundRunning.Archivable = false soundRunning.SoundId = "rbxasset://sounds/bfsl-minifigfoots1.mp3" soundRunning.Looped = true leftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) leftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) leftHip.MaxVelocity = 0.1 leftHip.Name = "Left Hip" leftHip.Part0 = torso leftHip.Part1 = leftLeg leftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) leftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) leftShoulder.MaxVelocity = 0.15 leftShoulder.Name = "Left Shoulder" leftShoulder.Part0 = torso leftShoulder.Part1 = leftArm rightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) rightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) rightHip.MaxVelocity = 0.1 rightHip.Name = "Right Hip" rightHip.Part0 = torso rightHip.Part1 = rightLeg rightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) rightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) rightShoulder.MaxVelocity = 0.15 rightShoulder.Name = "Right Shoulder" rightShoulder.Part0 = torso rightShoulder.Part1 = rightArm if prevLeftHip then leftHip.CurrentAngle = prevLeftHip.CurrentAngle leftHip.DesiredAngle = prevLeftHip.DesiredAngle end if prevLeftShoulder then leftShoulder.CurrentAngle = prevLeftShoulder.CurrentAngle leftShoulder.DesiredAngle = prevLeftShoulder.DesiredAngle end if prevRightHip then rightHip.CurrentAngle = prevRightHip.CurrentAngle rightHip.DesiredAngle = prevRightHip.DesiredAngle end if prevRightShoulder then rightShoulder.CurrentAngle = prevRightShoulder.CurrentAngle rightShoulder.DesiredAngle = prevRightShoulder.DesiredAngle end neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) neck.Name = "Neck" neck.Part0 = torso neck.Part1 = head rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) rootJoint.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) rootJoint.Name = "RootJoint" rootJoint.Part0 = rootPart rootJoint.Part1 = torso feetPart.BottomSurface = "Smooth" feetPart.CanCollide = false feetPart.CFrame = torsoCFrame * CFrame.new(0, -3.1, 0) feetPart.FormFactor = "Custom" feetPart.Locked = true feetPart.Name = "Platform" feetPart.Size = Vector3.new(1.8, 0.2, 0.8) feetPart.TopSurface = "Smooth" feetPart.Transparency = 1 feetWeld.C0 = CFrame.new(0, -3, 0) feetWeld.C1 = CFrame.new(0, 0.1, 0) feetWeld.Name = "PlatformWeld" feetWeld.Part0 = torso feetWeld.Part1 = feetPart table.insert(connections, feetPart.Touched:connect(function(hit) feetTouching[hit] = true end)) table.insert(connections, feetPart.TouchEnded:connect(function(hit) feetTouching[hit] = nil end)) feetTouchInterest = feetPart:FindFirstChild("TouchInterest") bodyGyro.D = 3250 bodyGyro.P = 400000 bodyGyro.maxTorque = Vector3.new(1000000000, 0, 1000000000) bodyVelocity.P = 5000 bodyVelocity.maxForce = Vector3.new(0, 0, 0) bodyVelocity.velocity = Vector3.new(0, 0, 0) torsoLight = Instance.new("PointLight", torso) torsoLight.Brightness = 0.4 torsoLight.Color = Color3.new(1, 1, 1) torsoLight.Range = 16 torsoLight.Shadows = true local ff1, ff2, ff3, ff4, ff5, ff6, ff7, ff8, ff9 = Instance.new("ForceField", head), Instance.new("ForceField", leftArm), Instance.new("ForceField", leftLeg), Instance.new("ForceField", rightArm), Instance.new("ForceField", rightLeg), Instance.new("ForceField", torso), Instance.new("ForceField", wildcardHandle), Instance.new("ForceField", feetPart), Instance.new("ForceField", rootPart) local forcefields = {[ff1] = head, [ff2] = leftArm, [ff3] = leftLeg, [ff4] = rightArm, [ff5] = rightLeg, [ff6] = torso, [ff7] = wildcardHandle, [ff8] = feetPart, [ff9] = rootPart} local objects = {[humanoid] = true, [head] = true, [leftArm] = true, [leftLeg] = true, [rightArm] = true, [rightLeg] = true, [torso] = true, [rootPart] = true, [rootJoint] = true, [soundFreeFalling] = true, [soundGettingUp] = true, [soundRunning] = true, [leftHip] = true, [leftShoulder] = true, [rightHip] = true, [rightShoulder] = true, [neck] = true, [feetPart] = true, [feetWeld] = true, [feetTouchInterest] = true, [bodyGyro] = true, [bodyVelocity] = true, [ff1] = true, [ff2] = true, [ff3] = true, [ff4] = true, [ff5] = true, [ff6] = true, [ff7] = true, [ff8] = true, [ff9] = true} local tshirtUrl = appearance.tshirt if tshirtUrl then local tshirt = Instance.new("Decal", torso) tshirt.Name = "roblox" tshirt.Texture = tshirtUrl objects[tshirt] = true end for _, template in ipairs(appearance.characterObjects) do local object = template:Clone() local newObjects = {object} for _, object in ipairs(newObjects) do objects[object] = true for _, child in ipairs(object:GetChildren()) do table.insert(newObjects, child) end end if object:IsA("BodyColors") then head.BrickColor = object.HeadColor leftArm.BrickColor = object.LeftArmColor leftLeg.BrickColor = object.LeftLegColor rightArm.BrickColor = object.RightArmColor rightLeg.BrickColor = object.RightLegColor torso.BrickColor = object.TorsoColor elseif object:IsA("Hat") then local handle = object:FindFirstChild("Handle") if handle and handle:IsA("BasePart") then local weld = Instance.new("Weld", head) weld.C0 = CFrame.new(0, 0.5, 0) local attachmentPos = object.AttachmentPos local attachmentRight = object.AttachmentRight local attachmentUp = object.AttachmentUp local attachmentForward = object.AttachmentForward weld.C1 = CFrame.new(attachmentPos.X, attachmentPos.Y, attachmentPos.Z, attachmentRight.X, attachmentUp.X, -attachmentForward.X, attachmentRight.Y, attachmentUp.Y, -attachmentForward.Y, attachmentRight.Z, attachmentUp.Z, -attachmentForward.Z) weld.Name = "HeadWeld" weld.Part0 = head weld.Part1 = handle handle.Parent = model local antiGravity = Instance.new("BodyForce", handle) antiGravity.force = Vector3.new(0, handle:GetMass() * 196.2, 0) objects[object] = false object.Parent = nil objects[weld] = true end end object.Parent = model end local facePresent = false local headMeshPresent = false for _, template in ipairs(appearance.headObjects) do local object = template:Clone() local newObjects = {object} for _, object in ipairs(newObjects) do objects[object] = true for _, child in ipairs(object:GetChildren()) do table.insert(newObjects, child) end end if object:IsA("DataModelMesh") then headMeshPresent = true elseif object:IsA("Decal") then facePresent = true end object.Parent = head end if not facePresent then local face = Instance.new("Decal", head) face.Texture = "rbxasset://textures/face.png" objects[face] = true end if not headMeshPresent then local headMesh = Instance.new("SpecialMesh", head) headMesh.Scale = Vector3.new(1.25, 1.25, 1.25) objects[headMesh] = true end table.insert(connections, model.DescendantAdded:connect(function(object) local success, is_localscript = pcall(Game.IsA, object, "LocalScript") if success and is_localscript then pcall(Utility.SetProperty, object, "Disabled", true) local changed_connection = pcall(object.Changed.connect, object.Changed, function(property) if property == "Disabled" and not object.Disabled then pcall(Utility.SetProperty, object, "Disabled", true) object:Destroy() end end) end if not objects[object] then object:Destroy() end end)) model.Parent = Workspace Player.Character = model Camera.CameraSubject = humanoid Camera.CameraType = "Track" Camera.CoordinateFrame = cameraCFrame local IsStanding local RegenerateHealth local ResetCharacter function IsStanding() return not not next(feetTouching) end function RegenerateHealth() if humanoid.Health < 1 then humanoid.Health = 100 elseif not regeneratingHealth then regeneratingHealth = true local elapsedTime = wait(1) regeneratingHealth = false if humanoid.Health < 100 then humanoid.Health = math.min(humanoid.Health + elapsedTime, 100) end end end function ResetCharacter() for index, connection in ipairs(connections) do connection:disconnect() end active = false end table.insert(connections, model.AncestryChanged:connect(ResetCharacter)) table.insert(connections, model.DescendantRemoving:connect(function(object) local parent = forcefields[object] if parent then forcefields[object] = nil local new_forcefield = Instance.new("ForceField") forcefields[new_forcefield] = parent objects[new_forcefield] = true new_forcefield.Parent = parent elseif objects[object] then ResetCharacter() end end)) table.insert(connections, humanoid.HealthChanged:connect(RegenerateHealth)) table.insert(connections, humanoid.Climbing:connect(function() pose = "Climbing" end)) table.insert(connections, humanoid.FallingDown:connect(function(state) pose = "FallingDown" end)) table.insert(connections, humanoid.FreeFalling:connect(function(state) pose = "FreeFall" if state then soundFreeFalling:Play() else soundFreeFalling:Pause() end end)) table.insert(connections, humanoid.GettingUp:connect(function(state) pose = "GettingUp" if state then soundGettingUp:Play() else soundGettingUp:Pause() end end)) table.insert(connections, humanoid.PlatformStanding:connect(function() pose = "PlatformStanding" end)) table.insert(connections, humanoid.Seated:connect(function() pose = "Seated" end)) table.insert(connections, humanoid.Swimming:connect(function(speed) if speed > 0 then pose = "Swimming" else pose = "Standing" end end)) local previousRootPartCFrame = rootPart.CFrame TaskScheduler.Start(function() while active do local totalTime = TaskScheduler.GetCurrentTime() local stepTime = 1 / 60 if not PlayerControl.characterEnabled then ResetCharacter() break end torsoLight.Brightness = 0.5 + 0.15 * math.sin(totalTime * 0.75 * math.pi) local featherfallEnabled = PlayerControl.IsFeatherfallEnabled() local rootPartCFrame = rootPart.CFrame if not jumpDebounce and UserInterface:IsKeyDown(Enum.KeyCode.Space) then if humanoid.Sit then humanoid.Sit = false end if IsStanding() then jumpDebounce = true pose = "Jumping" rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 50, rootPart.Velocity.Z) torso.Velocity = Vector3.new(torso.Velocity.X, 50, torso.Velocity.Z) TaskScheduler.Schedule(1, function() if pose == "Jumping" then pose = "FreeFall" end jumpDebounce = false humanoid.Jump = false end) end end local cameraCFrame = Camera.CoordinateFrame local cameraDirection = cameraCFrame.lookVector if flying then if PlayerControl.rolling then local rootPartCFrame = rootPart.CFrame local speed = (rootPartCFrame - rootPartCFrame.p):pointToObjectSpace(rootPart.Velocity).Y local decay = 0.5 ^ stepTime if math.abs(speed) <= 50 then PlayerControl.rollingAngle = (((PlayerControl.rollingAngle + 0.5) % 1 - 0.5) * decay) % 1 PlayerControl.rollingOffset = PlayerControl.rollingOffset * decay else PlayerControl.rollingAngle = (PlayerControl.rollingAngle + stepTime * speed * PlayerControl.rollingSpeed) % 1 PlayerControl.rollingOffset = (PlayerControl.rollingOffset + PlayerControl.rollingMaxOffset * (1 / decay - 1)) * decay end rootJoint.C0 = (CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) * CFrame.Angles(PlayerControl.rollingAngle * 2 * math.pi, 0, 0)) * CFrame.new(0, -PlayerControl.rollingOffset, 0) else rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) PlayerControl.rollingAngle = 0 PlayerControl.rollingOffset = 0 end rightShoulder.MaxVelocity = 0.5 leftShoulder.MaxVelocity = 0.5 rightShoulder.DesiredAngle = 0 leftShoulder.DesiredAngle = 0 rightHip.DesiredAngle = 0 leftHip.DesiredAngle = 0 bodyGyro.D = 500 bodyGyro.P = 1e6 bodyGyro.maxTorque = Vector3.new(1e6, 1e6, 1e6) bodyVelocity.P = 1250 bodyVelocity.maxForce = Vector3.new(1e6, 1e6, 1e6) local movementRight = 0 local movementForward = 0 local movementUp = 0 if UserInterface:IsKeyDown(Enum.KeyCode.A) and not UserInterface:IsKeyDown(Enum.KeyCode.D) then movementRight = -1 elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then movementRight = 1 end if UserInterface:IsKeyDown(Enum.KeyCode.W) then movementUp = 0.2 if not UserInterface:IsKeyDown(Enum.KeyCode.S) then movementForward = -1 end elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then movementForward = 1 end local movement = PlayerControl.fly_acceleration * cameraCFrame:vectorToWorldSpace(Vector3.new(movementRight, movementUp, movementForward)) local previousMomentum = flyingMomentum local previousTilt = flyingTilt flyingMomentum = movement + flyingMomentum * (1 - PlayerControl.fly_acceleration / PlayerControl.fly_speed) flyingTilt = ((flyingMomentum * Vector3.new(1, 0, 1)).unit:Cross((previousMomentum * Vector3.new(1, 0, 1)).unit)).Y if flyingTilt ~= flyingTilt or flyingTilt == math.huge then flyingTilt = 0 end local absoluteTilt = math.abs(flyingTilt) if absoluteTilt > 0.06 or absoluteTilt < 0.0001 then if math.abs(previousTilt) > 0.0001 then flyingTilt = previousTilt * 0.9 else flyingTilt = 0 end else flyingTilt = previousTilt * 0.77 + flyingTilt * 0.25 end previousTilt = flyingTilt if flyingMomentum.magnitude < 0.1 then flyingMomentum = Vector3.new(0, 0, 0) -- bodyGyro.cframe = cameraCFrame else local momentumOrientation = CFrame.new(Vector3.new(0, 0, 0), flyingMomentum) local tiltOrientation = CFrame.Angles(0, 0, -20 * flyingTilt) bodyGyro.cframe = momentumOrientation * tiltOrientation * CFrame.Angles(-0.5 * math.pi * math.min(flyingMomentum.magnitude / PlayerControl.fly_speed, 1), 0, 0) end bodyVelocity.velocity = flyingMomentum + Vector3.new(0, 0.15695775618683547, 0) rootPart.Velocity = flyingMomentum previousMomentum = flyingMomentum else rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) PlayerControl.rollingAngle = 0 PlayerControl.rollingOffset = 0 bodyGyro.D = 3250 bodyGyro.P = 400000 bodyVelocity.P = 5000 local cameraDirection = cameraCFrame.lookVector local walkDirection = Vector3.new(0, 0, 0) local walkSpeed = 16 if UserInterface:IsKeyDown(Enum.KeyCode.W) then if UserInterface:IsKeyDown(Enum.KeyCode.A) then walkDirection = Vector3.new(cameraDirection.X + cameraDirection.Z, 0, cameraDirection.Z - cameraDirection.X).unit elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then walkDirection = Vector3.new(cameraDirection.X - cameraDirection.Z, 0, cameraDirection.Z + cameraDirection.X).unit else walkDirection = Vector3.new(cameraDirection.X, 0, cameraDirection.Z).unit end elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then if UserInterface:IsKeyDown(Enum.KeyCode.A) then walkDirection = Vector3.new(-cameraDirection.X + cameraDirection.Z, 0, -cameraDirection.Z - cameraDirection.X).unit elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then walkDirection = Vector3.new(-cameraDirection.X - cameraDirection.Z, 0, -cameraDirection.Z + cameraDirection.X).unit else walkDirection = Vector3.new(-cameraDirection.X, 0, -cameraDirection.Z).unit end elseif UserInterface:IsKeyDown(Enum.KeyCode.A) then walkDirection = Vector3.new(cameraDirection.Z, 0, -cameraDirection.X).unit elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then walkDirection = Vector3.new(-cameraDirection.Z, 0, cameraDirection.X).unit else walkSpeed = 0 end if walkSpeed ~= previousWalkSpeed then if walkSpeed > 0 then soundRunning:Play() else soundRunning:Pause() end end if walkSpeed > 0 then if pose ~= "Jumping" then if IsStanding() then pose = "Running" else pose = "FreeFall" end end bodyGyro.cframe = CFrame.new(Vector3.new(), walkDirection) bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000) bodyVelocity.maxForce = Vector3.new(1000000, maxForceY, 1000000) else if pose ~= "Jumping" then if IsStanding() then pose = "Standing" else pose = "FreeFall" end end -- TODO: find and fix bug that causes torso to rotate back to some angle bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000) -- Vector3.new(1000000000, 0, 1000000000) if PlayerControl.pushable then bodyVelocity.maxForce = Vector3.new(0, 0, 0) else bodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000) end end if featherfallEnabled then local velocity = rootPart.Velocity if velocity.Y > 50 then rootPart.Velocity = Vector3.new(velocity.X, 50, velocity.Z) elseif velocity.Y < -50 then rootPart.Velocity = Vector3.new(velocity.X, -50, velocity.Z) end local distanceVector = rootPartCFrame.p - previousRootPartCFrame.p local offsetX, offsetY, offsetZ = distanceVector.X, distanceVector.Y, distanceVector.Z local MAX_MOVEMENT = 50 * 0.03333333507180214 if offsetX > MAX_MOVEMENT then offsetX = MAX_MOVEMENT elseif offsetX < -MAX_MOVEMENT then offsetX = -MAX_MOVEMENT end if offsetY > MAX_MOVEMENT then offsetY = MAX_MOVEMENT elseif offsetY < -MAX_MOVEMENT then offsetY = -MAX_MOVEMENT end if offsetZ > MAX_MOVEMENT then offsetZ = MAX_MOVEMENT elseif offsetZ < -MAX_MOVEMENT then offsetZ = -MAX_MOVEMENT end local offset = Vector3.new(offsetX, offsetY, offsetZ) if offset ~= distanceVector then rootPartCFrame = previousRootPartCFrame + offset --rootPart.CFrame = rootPartCFrame end end local walkingVelocity = walkDirection * walkSpeed bodyVelocity.velocity = walkingVelocity if not jumpDebounce and math.abs(rootPart.Velocity.Y) <= 0.1 then rootPart.Velocity = Vector3.new(walkingVelocity.X, rootPart.Velocity.Y, walkingVelocity.Z) end previousWalkSpeed = walkSpeed if pose == "Jumping" or jumpDebounce then rightShoulder.MaxVelocity = 0.5 leftShoulder.MaxVelocity = 0.5 rightShoulder.DesiredAngle = 3.14 leftShoulder.DesiredAngle = -3.14 rightHip.DesiredAngle = 0 leftHip.DesiredAngle = 0 elseif pose == "FreeFall" then rightShoulder.MaxVelocity = 0.5 leftShoulder.MaxVelocity = 0.5 rightShoulder.DesiredAngle = 3.14 leftShoulder.DesiredAngle = -3.14 rightHip.DesiredAngle = 0 leftHip.DesiredAngle = 0 elseif pose == "Seated" then rightShoulder.MaxVelocity = 0.15 leftShoulder.MaxVelocity = 0.15 rightShoulder.DesiredAngle = 3.14 / 2 leftShoulder.DesiredAngle = -3.14 / 2 rightHip.DesiredAngle = 3.14 / 2 leftHip.DesiredAngle = -3.14 / 2 else local climbFudge = 0 local amplitude local frequency if pose == "Running" then rightShoulder.MaxVelocity = 0.15 leftShoulder.MaxVelocity = 0.15 amplitude = 1 frequency = 9 elseif (pose == "Climbing") then rightShoulder.MaxVelocity = 0.5 leftShoulder.MaxVelocity = 0.5 amplitude = 1 frequency = 9 climbFudge = 3.14 else amplitude = 0.1 frequency = 1 end local desiredAngle = amplitude * math.sin(totalTime * frequency) rightShoulder.DesiredAngle = desiredAngle + climbFudge leftShoulder.DesiredAngle = desiredAngle - climbFudge rightHip.DesiredAngle = -desiredAngle leftHip.DesiredAngle = -desiredAngle end end previousRootPartCFrame = rootPartCFrame RunService.RenderStepped:wait() end if model.Parent ~= nil then model.Parent = nil end PlayerControl.CreateCharacter() end) humanoid.Health = 100 character = model chatAdornee = head elseif characterMode == "pyramid" then if PlayerControl.characterEnabled then Camera.CameraType = "Fixed" PyramidCharacter.camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude PyramidCharacter.camera_position = Camera.Focus.p PyramidCharacter.Teleport(Camera.Focus.p) PyramidCharacter.visible = true Player.Character = nil else PyramidCharacter.visible = false end end end function PlayerControl.GetCharacter() return character end function PlayerControl.GetHead() local characterMode = PlayerControl.characterMode if characterMode == "normal" then return head elseif characterMode == "pyramid" then return PyramidCharacter.core end end function PlayerControl.GetHumanoid() return humanoid end function PlayerControl.GetRootPart() return rootPart end function PlayerControl.GetTorso() return torso end function PlayerControl.IsEnabled() return PlayerControl.characterEnabled end function PlayerControl.IsFeatherfallEnabled() return PlayerControl.featherfallEnabled end function PlayerControl.IsPushable() return PlayerControl.pushable end function PlayerControl.IsRolling() return PlayerControl.rolling end function PlayerControl.ResetCharacter() if character and character.Parent then character.Parent = nil end PyramidCharacter.visible = false end function PlayerControl.SetEnabled(state, no_animation) state = not not state if state ~= PlayerControl.characterEnabled then PlayerControl.characterEnabled = state local characterMode = PlayerControl.characterMode if characterMode == "normal" then local torso = PlayerControl.GetRootPart() local rootPart = PlayerControl.GetRootPart() if rootPart then if PlayerControl.characterEnabled then local torso_cframe = Camera.Focus:toWorldSpace(PlayerControl.hide_torso_object_cframe) PlayerControl.torso_cframe = torso_cframe torso.CFrame = torso_cframe rootPart.CFrame = torso_cframe else PlayerControl.hide_torso_object_cframe = Camera.Focus:toObjectSpace(rootPart.CFrame) end else PlayerControl.torso_cframe = Camera.Focus end if PlayerControl.characterEnabled then PlayerControl.CreateCharacter() RunService.Stepped:wait() coroutine.yield() if not no_animation then GraphicalEffects.CrystalRing({base_part = PlayerControl.GetTorso(), crystal_color = BrickColor.new("Institutional white"), float_duration = 2}) end else Player.Character = nil Camera.CameraType = "Fixed" if not no_animation then GraphicalEffects.CrystalRing({position = PlayerControl.GetTorso().Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2}) end end else if state then PlayerControl.CreateCharacter() RunService.Stepped:wait() coroutine.yield() if not no_animation then GraphicalEffects.CrystalRing({base_part = PyramidCharacter.core, crystal_color = BrickColor.new("Institutional white"), float_duration = 2}) end else PyramidCharacter.visible = false if not no_animation then GraphicalEffects.CrystalRing({position = PyramidCharacter.core.Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2}) end end end end end function PlayerControl.SetFeatherfallEnabled(state) state = not not state if state ~= PlayerControl.featherfallEnabled then PlayerControl.featherfallEnabled = state if state then Logger.print("Info", "Featherfall enabled in PlayerControl") else Logger.print("Info", "Featherfall disabled in PlayerControl") end end end function PlayerControl.SetPushable(state) state = not not state if state ~= PlayerControl.pushable then PlayerControl.pushable = state if state then Logger.print("Info", "Pushing enabled in PlayerControl") else Logger.print("Info", "Pushing disabled in PlayerControl") end end end function PlayerControl.SetRolling(state) state = not not state if state ~= PlayerControl.rolling then PlayerControl.rolling = state if state then Logger.print("Info", "Rolling fly mode enabled in PlayerControl") else Logger.print("Info", "Rolling fly mode disabled in PlayerControl") end end end function PlayerControl.StartFlying() PlayerControl.fly_speed = PlayerControl.fly_basespeed if torso then flyingMomentum = torso.Velocity + torso.CFrame.lookVector * 3 + Vector3.new(0, 10, 0) else flyingMomentum = Vector3.new() end flyingTilt = 0 flying = true end function PlayerControl.StopFlying() if bodyGyro.cframe then local lookVector = bodyGyro.cframe.lookVector if lookVector.X ~= 0 or lookVector.Z ~= 0 then bodyGyro.cframe = CFrame.new(Vector3.new(), Vector3.new(lookVector.X, 0, lookVector.Z)) end end flying = false end local previousTime = 0 ControllerCommands = {}; ControllerCommands = {}; ControllerCommands.BALEFIRE_SPEED = 40 function ControllerCommands.BalefireAtMouse() local head = chatAdornee if head then local target = Mouse.Hit.p local origin = head.Position local direction = (target - origin).unit local explosionCount = 0 local animation_frame = 0 local magic_circle_position = origin + direction * 4 local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) local magic_circle_part = Instance.new("Part") local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part) local magic_circle_light = Instance.new("PointLight", magic_circle_part) local magic_circle_decal_back = Instance.new("Decal", magic_circle_part) local magic_circle_decal_front = Instance.new("Decal", magic_circle_part) magic_circle_part.Anchored = true magic_circle_part.Archivable = false magic_circle_part.BottomSurface = "Smooth" magic_circle_part.CanCollide = false magic_circle_part.CFrame = magic_circle_cframe magic_circle_part.FormFactor = "Custom" magic_circle_part.Locked = true magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2) magic_circle_part.TopSurface = "Smooth" magic_circle_part.Transparency = 1 magic_circle_mesh.Scale = Vector3.new(60, 60, 0) magic_circle_light.Color = Color3.new(1, 0.5, 1) magic_circle_light.Range = 16 magic_circle_light.Shadows = true magic_circle_decal_back.Face = "Back" magic_circle_decal_back.Texture = "rbxassetid://122610943" magic_circle_decal_front.Face = "Front" magic_circle_decal_front.Texture = "rbxassetid://122610943" local function NextExplosion() explosionCount = explosionCount + 1 Instance.new("Explosion", Workspace).Position = origin + direction * (explosionCount * 8 + 4) end local function AnimateMagicCircle() animation_frame = animation_frame + 1 local transparency = (animation_frame / 40) ^ 3 if animation_frame == 40 then pcall(Game.Destroy, magic_circle_part) else if magic_circle_part.Parent ~= Workspace then pcall(Utility.SetProperty, magic_circle_part, "Parent", Workspace) end head = PlayerControl.GetHead() if head then magic_circle_position = head.Position + direction * 4 end magic_circle_part.CFrame = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * animation_frame / 40 * 1.5) magic_circle_light.Brightness = 1 - transparency magic_circle_decal_back.Transparency = transparency magic_circle_decal_front.Transparency = transparency end end magic_circle_part.Parent = Workspace for i = 1, 40 do Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion) Delay((i - 1) / 30, AnimateMagicCircle) end for i = 1, 20 do Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion) end end end function ControllerCommands.ControlRandomDummy() local dummies = {} local numDummies = 0 for _, character in ipairs(Workspace:GetChildren()) do local name = tostring(character) if name == "???" or name == "Dummy" then local head, humanoid for _, child in ipairs(character:GetChildren()) do local className = child.ClassName if className == "Part" and tostring(child) == "Head" then head = child if humanoid then break end elseif className == "Humanoid" then if child.Health > 0 then humanoid = child if head then break end else break end end end if head and humanoid then numDummies = numDummies + 1 dummies[numDummies] = {character, head, humanoid} end end end if numDummies > 0 then local dummy = dummies[math.random(numDummies)] Player.Character = dummy[1] chatAdornee = dummy[2] Camera.CameraSubject = dummy[3] Camera.CameraType = "Track" end end function ControllerCommands.Decalify(textures, exclusion) local objects = Workspace:GetChildren() for _, object in ipairs(objects) do if not exclusion[object] then for _, child in ipairs(object:GetChildren()) do objects[#objects + 1] = child end if object:IsA("BasePart") then local texture = textures[math.random(#textures)] local face_left = Instance.new("Decal", object) face_left.Face = Enum.NormalId.Left face_left.Texture = texture local face_right = Instance.new("Decal", object) face_right.Face = Enum.NormalId.Right face_right.Texture = texture local face_bottom = Instance.new("Decal", object) face_bottom.Face = Enum.NormalId.Bottom face_bottom.Texture = texture local face_top = Instance.new("Decal", object) face_top.Face = Enum.NormalId.Top face_top.Texture = texture local face_front = Instance.new("Decal", object) face_front.Face = Enum.NormalId.Front face_front.Texture = texture local face_back = Instance.new("Decal", object) face_back.Face = Enum.NormalId.Back face_back.Texture = texture end end end end function ControllerCommands.ExplodeAtMouse() local explosion = Instance.new("Explosion") explosion.Position = Mouse.Hit.p explosion.Parent = Workspace end function ControllerCommands.LaserAtMouse() GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p) end function ControllerCommands.BigLaser(target) GraphicalEffects.ShootLaserOfDeath(target, {brickcolor = BrickColor.new("New Yeller"), duration = 80, fragmentation_size = 6,laser_scale = 30, light_color = Color3.new(1, 0.5, 0), magic_circle_image = "rbxassetid://126561317", magic_circle_scale = 1.5, sound_volume = 1,special_effects = BrickColor.new("Deep orange"), stay = 2}) end function ControllerCommands.BigLaserAtMouse() ControllerCommands.BigLaser(Mouse.Hit.p) end function ControllerCommands.ShootMissile(targetPart, pointOnPart, direction) GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction) end function ControllerCommands.ShootMissileAtMouse(amount, spread, delayTime) local exclusionList = {} local playerHead = PlayerControl.GetHead() local playerTorso = PlayerControl.GetTorso() if playerHead and playerTorso then exclusionList[playerTorso] = true local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList) local targetPart, pointOnPart if humanoid and torso then targetPart, pointOnPart = torso, Vector3.new() else local target = Mouse.Target if target then targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p) else return end end if targetPart then local direction = (Mouse.Hit.p - playerHead.Position).unit delayTime = delayTime or 0 for index = 1, amount do local angles = math.tau * (index - 0.5) * spread / amount * Vector3.new(math.random() - 0.5, math.random() - 0.5,math.random() - 0.5).unit TaskScheduler.Schedule(delayTime * (index - 1), ControllerCommands.ShootMissile, targetPart, pointOnPart, CFrame.Angles(angles.X, angles.Y, angles.Z) * direction) end end end end function ControllerCommands.ShootMissileAroundMouse(amount, offset, delayTime) local exclusionList = {} local playerHead = PlayerControl.GetHead() local playerTorso = PlayerControl.GetTorso() if playerHead and playerTorso then exclusionList[playerTorso] = true local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList) local targetPart, pointOnPart if humanoid and torso then targetPart, pointOnPart = torso, Vector3.new() else local target = Mouse.Target if target then targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p) else return end end if targetPart then delayTime = delayTime or 0 local index = 1 local targetPoint = targetPart.CFrame * pointOnPart local rotation_offset_angles = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, 0).unit local rotation_offset = CFrame.Angles(rotation_offset_angles.x, rotation_offset_angles.y, 0) local angle_x = 0 local angle_x_step = math.tau / math.phi for i = 1, 8 * amount do angle_x = angle_x + angle_x_step local direction = rotation_offset * (CFrame.Angles(0, math.tau * index / amount, 0) * CFrame.Angles(angle_x, 0,0).lookVector) local blocked = Workspace:FindPartOnRay(Ray.new(targetPoint, direction * offset), targetPart.Parent) if not blocked then local p0, p1, p2, p3 = targetPart, pointOnPart, direction, offset; GraphicalEffects.ShootMissile(p0, p1, p2, function() return p0 end, p3, true) index = index + 1 if index > amount then break end end end end end end function ControllerCommands.HugeExplosionOfDoom(position) local connections = {} local parts = {} local cframe = CFrame.new(position) local function ExplosionHit(part) if part:GetMass() < 10000 and part.Parent ~= Camera then parts[part] = true part.Anchored = true part:BreakJoints() part.BrickColor = BrickColor.new("Instituational white") end end for i = 1, 4 do local quantity = 0.5 * i * (1 + i) local fraction = math.tau / quantity for x = 1, quantity do for y = 1, quantity do local explosion = Instance.new("Explosion") connections[#connections + 1] = explosion.Hit:connect(ExplosionHit) explosion.BlastRadius = 5 explosion.Position = cframe * (CFrame.Angles(fraction * x, fraction * y, 0) * Vector3.new((i - 1) * 6, 0, 0)) explosion.Parent = Workspace end end wait(0.075) end for part in pairs(parts) do for _, child in ipairs(part:GetChildren()) do if child:IsA("BodyMover") then child:Destroy() end end local mass = part:GetMass() local velocity = CFrame.Angles(math.tau * math.random(), math.tau * math.random(), 0) * Vector3.new(25, 0, 0) local bodythrust = Instance.new("BodyThrust") bodythrust.force = mass * -velocity bodythrust.Parent = part local bodyforce = Instance.new("BodyForce") bodyforce.force = mass * Vector3.new(0, 196.2, 0) bodyforce.Parent = part part.Anchored = false part.Reflectance = 1 part.RotVelocity = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) part.Transparency = 0.5 part.Velocity = (part.CFrame - part.Position) * velocity end for _, connection in ipairs(connections) do connection:disconnect() end for i = 0, 99 do Delay(i / 10, function() for part in pairs(parts) do local new_transparency = 0.5 * (1 + i / 50) part.Reflectance = 0.98 * part.Reflectance if new_transparency > part.Transparency then part.Transparency = new_transparency end end end) end Delay(10, function() for part in pairs(parts) do pcall(part.Destroy, part) end end) end function ControllerCommands.HugeExplosionOfDoomAtMouse() ControllerCommands.HugeExplosionOfDoom(Mouse.Hit.p) end function ControllerCommands.SpaceHyperBeam(asd) GraphicalEffects.SpaceHyperBeam(asd) end function ControllerCommands.SpaceHyperBeamAtMouse() ControllerCommands.SpaceHyperBeam(Mouse.Hit.p) end function ControllerCommands.ConcentratedSpaceHyperBeamAtMouse() local p = Mouse.Hit.p; for i = 1, 50 do GraphicalEffects.SpaceHyperBeam(p) end end function ControllerCommands.TeleportCharacterToMouse() if PlayerControl.IsEnabled() then local torso = PlayerControl.GetTorso() if torso then local pos = Mouse.Hit.p + Vector3.new(0, 5, 0) torso.CFrame = CFrame.new(pos, pos + torso.CFrame.lookVector) end else local new_focus_position = Mouse.Hit.p local direction_vector = Camera.CoordinateFrame.lookVector local new_focus = CFrame.new(new_focus_position, new_focus_position + direction_vector) Camera.CoordinateFrame = new_focus * CFrame.new(0, 0, 25) Camera.Focus = new_focus end end AdvancedGUI = {}; if not AdvancedGUI.GUI_BASE_COLOR then AdvancedGUI.GUI_BASE_COLOR = Color3.new(0, 0, 0) end function AdvancedGUI.GenerateChatColor(speakerName) local chatColor = ChatColor.Get(speakerName).Color local brightness = chatColor.r + chatColor.g + chatColor.b if brightness < 1.5 then chatColor = Color3.new(math.min(1, 0.4 + chatColor.r), math.min(1, 0.4 + chatColor.g), math.min(1, 0.4 + chatColor.b)) else chatColor = Color3.new(math.min(1, 0.05 + chatColor.r), math.min(1, 0.05 + chatColor.g), math.min(1, 0.05 + chatColor.b)) end return chatColor end GuiBase = {} GuiBase.__index = GuiBase function GuiBase:new(data) local instance = setmetatable({}, self) instance:Init(data) return instance end function GuiBase:Destroy() if self.parent then self.parent.children[self] = nil end for child in pairs(self.children) do child:Destroy() end self.m_base_instance:Destroy() end function GuiBase:GetContentInstance(child) return self.m_base_instance end function GuiBase:Init() self.children = {} end function GuiBase:IsA(className) return className == "GuiBase" end function GuiBase:SetParent(parent) if parent ~= self.parent then if self.parent then self.parent.children[self] = nil end self.parent = parent if parent then parent.children[self] = true self.m_base_instance.Parent = parent:GetContentInstance() else self.m_base_instance.Parent = nil end end end GuiObject = setmetatable({}, GuiBase) GuiObject.__index = GuiObject function GuiObject:Destroy() self.DragBegin:disconnect() self.DragMove:disconnect() self.DragStopped:disconnect() self.MouseButton1Click:disconnect() self.MouseButton1Down:disconnect() self.MouseButton1Up:disconnect() self.MouseButton2Down:disconnect() self.MouseButton2Up:disconnect() self.MouseEnter:disconnect() self.MouseLeave:disconnect() GuiBase.Destroy(self) end function GuiObject:GetAbsolutePosition() return self.m_base_instance.AbsolutePosition end function GuiObject:GetAbsoluteSize() return self.m_base_instance.AbsoluteSize end function GuiObject:GetPosition() return self.position end function GuiObject:GetSize() return self.size end function GuiObject:Init() GuiBase.Init(self) self.mouseDown = false self.mouseOver = false self.DragBegin = RbxUtility.CreateSignal() self.DragMove = RbxUtility.CreateSignal() self.DragStopped = RbxUtility.CreateSignal() self.MouseButton1Click = RbxUtility.CreateSignal() self.MouseButton1Down = RbxUtility.CreateSignal() self.MouseButton1Up = RbxUtility.CreateSignal() self.MouseButton2Down = RbxUtility.CreateSignal() self.MouseButton2Up = RbxUtility.CreateSignal() self.MouseEnter = RbxUtility.CreateSignal() self.MouseLeave = RbxUtility.CreateSignal() end function GuiObject:IsA(className) return className == "GuiObject" or GuiBase.IsA(self, className) end function GuiObject:SetActive(active) if active ~= self.active then self.active = active end end function GuiObject:SetBackgroundTransparency(backgroundTransparency) if backgroundTransparency ~= self.backgroundTransparency then self.backgroundTransparency = backgroundTransparency self.m_base_instance.BackgroundTransparency = backgroundTransparency end end function GuiObject:SetColor(color) if color ~= self.color then self.color = color self.m_base_instance.BackgroundColor3 = color end end function GuiObject:SetPosition(position) if position ~= self.position then self.position = position self.m_base_instance.Position = position end end function GuiObject:SetSize(size) if size ~= self.size then self.size = size self.m_base_instance.Size = size end end function GuiObject:SetVisible(visible) if visible ~= self.visible then self.visible = visible self.m_base_instance.Visible = visible end end function GuiObject:SetZIndex(zIndex) local stack = {self.m_base_instance} repeat local object = stack[#stack] stack[#stack] = nil for _, child in ipairs(object:GetChildren()) do stack[#stack + 1] = child end object.ZIndex = zIndex until #stack == 0 end GuiServiceClass = setmetatable({}, GuiBase) GuiServiceClass.__index = GuiServiceClass function GuiServiceClass:CreateTextArea(text, font, fontSize, textColor3, textXAlignment, textYAlignment, maxWidth, minWidth) local totalHeight = 0 local frame = Instance.new("Frame") frame.BackgroundTransparency = 1 local label = Instance.new("TextLabel") label.BackgroundTransparency = 1 label.Font = font label.FontSize = fontSize label.TextColor3 = textColor3 label.TextTransparency = 1 label.TextWrapped = true label.TextXAlignment = textXAlignment label.TextYAlignment = textYAlignment label.Parent = self.guiFrame local index = 1 while true do local length = #text - index + 1 if length > 1024 then length = 1024 local textBlock = string.sub(text, index, index + length - 1) label.Text = textBlock local height = 0 local width = maxWidth repeat height = height + 20 label.Size = UDim2.new(0, width, 0, height) until label.TextFits repeat height = height - 1 label.Size = UDim2.new(0, width, 0, height) until not label.TextFits repeat length = length - 10 label.Text = string.sub(text, index, index + length - 1) until label.TextFits repeat length = length + 1 label.Text = string.sub(text, index, index + length - 1) until not label.TextFits local overflowCharacter = string.sub(text, index + length - 1, index + length - 1) length = length - 1 label.Text = string.sub(text, index, index + length - 1) if overflowCharacter == "\n" then index = index + 1 end repeat height = height - 1 label.Size = UDim2.new(0, width, 0, height) until not label.TextFits height = height + 1 local blockLabel = label:Clone() blockLabel.Position = UDim2.new(0, 0, 0, totalHeight) blockLabel.Size = UDim2.new(1, 0, 0, height) blockLabel.Parent = frame totalHeight = totalHeight + height index = index + length else local textBlock = string.sub(text, index) label.Text = textBlock local height = 0 local width = maxWidth repeat height = height + 20 label.Size = UDim2.new(0, width, 0, height) until label.TextFits repeat height = height - 1 label.Size = UDim2.new(0, width, 0, height) until not label.TextFits height = height + 1 if index == 1 then repeat width = width - 10 label.Size = UDim2.new(0, width, 0, height) until width < minWidth or not label.TextFits width = math.max(width, minWidth - 1) repeat width = width + 1 label.Size = UDim2.new(0, width, 0, height) until label.TextFits end local blockLabel = label:Clone() blockLabel.Position = UDim2.new(0, 0, 0, totalHeight) blockLabel.Size = UDim2.new(1, 0, 0, height) blockLabel.Parent = frame label:Destroy() frame.Size = UDim2.new(0, width, 0, totalHeight + height) return frame end end end function GuiServiceClass:Destroy() self.running = false self.cameraPart:Destroy() self.cameraConnection:disconnect() self.keyDownConnection:disconnect() self.mouseButton1DownConnection:disconnect() self.mouseButton1UpConnection:disconnect() self.mouseButton2DownConnection:disconnect() self.mouseButton2UpConnection:disconnect() self.mouseMoveConnection:disconnect() self.steppedConnection:disconnect() end function GuiServiceClass:GetMousePosition() local mouse = self.mouse return mouse.X, mouse.Y -- mouse.X, mouse.Y + 2 -- return mouse.X - 2, mouse.Y - 3 end function GuiServiceClass:GetTextBounds(text, font, fontSize, alignX, alignY, width) local tempLabel = self.tempLabel tempLabel.Font = font tempLabel.FontSize = fontSize tempLabel.Size = UDim2.new(0, width, 0, 4096) tempLabel.Text = text tempLabel.TextXAlignment = alignX tempLabel.TextYAlignment = alignY local textBounds = tempLabel.TextBounds tempLabel.Text = "" return textBounds end function GuiServiceClass:Init(data) GuiBase.Init(self) local _ = string.char local camera = data.Camera local mouse = data.Mouse local cameraPart = Instance.new("Part") local billboardGui = Instance.new("BillboardGui", cameraPart) guiFrame = Instance.new("Frame", billboardGui) cameraPart.Anchored = true cameraPart.BottomSurface = "Smooth" cameraPart.CanCollide = false -- cameraPart.CFrame = CFrame.new(16384, 16384, 16384) cameraPart.FormFactor = "Custom" cameraPart.Locked = true cameraPart.Size = Vector3.new(0.2, 0.2, 0.2) cameraPart.TopSurface = "Smooth" cameraPart.Transparency = 1 billboardGui.Adornee = cameraPart billboardGui.AlwaysOnTop = true -- billboardGui.ExtentsOffset = Vector3.new(-16384, -16384, -16384) guiFrame.BackgroundTransparency = 1 cameraPart.Parent = camera self.running = true self.m_base_instance = guiFrame self.billboardGui = billboardGui self.cameraPart = cameraPart self.tempLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, TextTransparency = 1, TextWrapped = true, Parent = guiFrame } self.mnemonics = {} self.visible = true self.camera = camera self.mouse = mouse self.cameraConnection = camera.Changed:connect(function(property) self:UpdateView() if property == "CameraType" then if camera.CameraType ~= Enum.CameraType.Track and camera.CameraType ~= Enum.CameraType.Fixed then camera.CameraType = Enum.CameraType.Track end elseif property == "CoordinateFrame" and camera.CameraType ~= Enum.CameraType.Fixed then local cframe, focus = camera.CoordinateFrame, camera.Focus local watchOffset = focus.p - cframe.p local error = watchOffset.unit - cframe.lookVector if error.magnitude >= 1e-3 then local head = PlayerControl.GetHead() local time1, velocity1 if head then time1 = time() velocity1 = head.Velocity end if camera.Changed:wait() == "CoordinateFrame" then local position = cframe.p if head then local time2 = time() local velocity2 = head.Velocity position = position + 0.5 * (velocity1 + velocity2) * (time2 - time1) end camera.CoordinateFrame = CFrame.new(position, camera.Focus.p) end end end end) self.keyDownConnection = mouse.KeyDown:connect(function(key) self:KeyDown(key) end) self.mouseButton1DownConnection = mouse.Button1Down:connect(function() self:MouseButton1Down() end) self.mouseButton1UpConnection = mouse.Button1Up:connect(function() self:MouseButton1Up() end) self.mouseButton2DownConnection = mouse.Button2Down:connect(function() self:MouseButton2Down() end) self.mouseButton2UpConnection = mouse.Button2Up:connect(function() self:MouseButton2Up() end) self.mouseMoveConnection = mouse.Move:connect(function() self:MouseMove() end) self.steppedConnection = RunService.RenderStepped:connect(function() self:UpdateObjects() self:UpdateView() end) self.mousePreviousPosition = Vector2.new(self:GetMousePosition()) end function GuiServiceClass:IsA(className) return className == "GuiService" or GuiBase.IsA(self, className) end function GuiServiceClass:KeyDown(key) local mnemonicButton = self.mnemonics[string.upper(key)] if mnemonicButton then mnemonicButton.Activated:fire() end end function GuiServiceClass:MouseButton1Down() local mouse = self.mouse local mouseX, mouseY = self:GetMousePosition() local stack = {self} local dragObjects = {} self.dragObjects = dragObjects while #stack > 0 do local object = stack[#stack] stack[#stack] = nil if object.visible then for child in pairs(object.children) do stack[#stack + 1] = child end if object.active then local position = object:GetAbsolutePosition() local size = object:GetAbsoluteSize() if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then object.mouseDown = true dragObjects[object] = true local mouseButton1Down = object.MouseButton1Down if mouseButton1Down then mouseButton1Down:fire() if object.autoButtonColor then local color = object.color local transparency = object.backgroundTransparency object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1)) object.m_base_instance.BackgroundTransparency = transparency end end object.DragBegin:fire() end end end end self.mousePreviousPosition = Vector2.new(mouseX, mouseY) end function GuiServiceClass:MouseButton1Up() local mouse = self.mouse local mouseX, mouseY = self:GetMousePosition() local stack = {self} while #stack > 0 do local object = stack[#stack] stack[#stack] = nil if object.visible then for child in pairs(object.children) do stack[#stack + 1] = child end if object.active then local position = object:GetAbsolutePosition() local size = object:GetAbsoluteSize() if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then object.MouseButton1Up:fire() end end end end local dragObjects = self.dragObjects self.dragObjects = nil if dragObjects then for dragObject in pairs(dragObjects) do dragObject.mouseDown = false local position = dragObject:GetAbsolutePosition() local size = dragObject:GetAbsoluteSize() if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then dragObject.MouseButton1Click:fire() local activated = dragObject.Activated if activated then activated:fire() end end dragObject.DragStopped:fire() if dragObject.autoButtonColor then if dragObject.mouseOver then local color = dragObject.color local transparency = dragObject.backgroundTransparency dragObject.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0)) dragObject.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2) else dragObject.m_base_instance.BackgroundColor3 = dragObject.color dragObject.m_base_instance.BackgroundTransparency = dragObject.backgroundTransparency end end self.dragObject = nil end end end function GuiServiceClass:MouseButton2Down() local mouse = self.mouse local mouseX, mouseY = self:GetMousePosition() local stack = {self} while #stack > 0 do local object = stack[#stack] stack[#stack] = nil if object.visible then for child in pairs(object.children) do stack[#stack + 1] = child end if object.active then local position = object:GetAbsolutePosition() local size = object:GetAbsoluteSize() if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then local mouseButton2Down = object.MouseButton2Down if mouseButton2Down then mouseButton2Down:fire() end end end end end self.mousePreviousPosition = Vector2.new(mouseX, mouseY) end function GuiServiceClass:MouseButton2Up() local mouse = self.mouse local mouseX, mouseY = self:GetMousePosition() local stack = {self} while #stack > 0 do local object = stack[#stack] stack[#stack] = nil if object.visible then for child in pairs(object.children) do stack[#stack + 1] = child end if object.active then local position = object:GetAbsolutePosition() local size = object:GetAbsoluteSize() if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then local mouseButton2Up = object.MouseButton2Up if mouseButton2Up then mouseButton2Up:fire() end end end end end end function GuiServiceClass:MouseMove() self:UpdateObjects() local dragObjects = self.dragObjects if dragObjects then for dragObject in pairs(dragObjects) do local mouse = self.mouse local mousePosition = Vector2.new(self:GetMousePosition()) dragObject.DragMove:fire(mousePosition - self.mousePreviousPosition) self.mousePreviousPosition = mousePosition end end end function GuiServiceClass:SetMnemonic(mnemonic, button) self.mnemonics[mnemonic] = button end function GuiServiceClass:UpdateObjects() local mouse = self.mouse local mouseX, mouseY = self:GetMousePosition() local stack = {self} while #stack > 0 do local object = stack[#stack] stack[#stack] = nil if object.visible then for child in pairs(object.children) do stack[#stack + 1] = child end if object.active then local position = object:GetAbsolutePosition() local size = object:GetAbsoluteSize() if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then if not object.mouseOver then object.mouseOver = true object.MouseEnter:fire() if object.autoButtonColor then local color = object.color local transparency = object.backgroundTransparency if object.mouseDown then object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1)) object.m_base_instance.BackgroundTransparency = transparency else object.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0)) object.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2) end end end else if object.mouseOver then object.mouseOver = false object.MouseLeave:fire() if object.autoButtonColor then object.m_base_instance.BackgroundColor3 = object.color object.m_base_instance.BackgroundTransparency = object.backgroundTransparency end end end end end end end function GuiServiceClass:UpdateView() local billboardGui = self.billboardGui local guiFrame = self.m_base_instance local camera = self.camera local mouse = self.mouse local cameraCFrame = CFrame.new(camera.CoordinateFrame.p, camera.Focus.p) -- camera.CoordinateFrame local viewSizeX, viewSizeY = mouse.ViewSizeX, mouse.ViewSizeY local previousViewSize = self.viewSize if not previousViewSize or ((viewSizeX ~= 0 or viewSizeY ~= 0) and (viewSizeX ~= previousViewSize.X or viewSizeY ~= previousViewSize.Y)) then self.viewSize = {X = viewSizeX, Y = viewSizeY} local viewSizeUDim2 = UDim2.new(0, viewSizeX, 0, viewSizeY) billboardGui.Size = viewSizeUDim2 guiFrame.Size = viewSizeUDim2 -- FIXME: -- After the 15th of July 2014, there came an offset at the Y thingy out of nowhere so I accomodated for that. billboardGui.SizeOffset = Vector2.new(0.5 / viewSizeX, (0.5 + 10) / viewSizeY) end --billboardGui.SizeOffset = Vector2.new() billboardGui.StudsOffset = (cameraCFrame - cameraCFrame.p):inverse() * cameraCFrame.p - Vector3.new(0, 0, 1) end GuiService = GuiServiceClass:new { Camera = Camera, Mouse = Mouse } GuiFrame = setmetatable({}, GuiObject) GuiFrame.__index = GuiFrame GuiFrame.__default = {__index = { Active = false, BackgroundTransparency = 0.75, BorderSize = 4, BorderTransparency = 0.75, Color = AdvancedGUI.GUI_BASE_COLOR, Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(0, 52, 0, 52), Visible = true }} function GuiFrame:Destroy() GuiObject.Destroy(self) end function GuiFrame:GetContentInstance() return self.m_content_frame end function GuiFrame:Init(data) GuiObject.Init(self) setmetatable(data, GuiFrame.__default) local leftBorderFrameLeft = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0, Size = UDim2.new(0, 1, 1, -1) } local leftBorderFrameCenter = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Position = UDim2.new(0, 1, 0, 1) } local leftBorderFrameRight = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0 } local rightBorderFrameRight = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0, Position = UDim2.new(1, -1, 0, 1), Size = UDim2.new(0, 1, 1, -1) } local rightBorderFrameCenter = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0 } local rightBorderFrameLeft = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0 } local bottomBorderFrameBottom = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0, Position = UDim2.new(0, 0, 1, -1), Size = UDim2.new(1, -1, 0, 1) } local bottomBorderFrameCenter = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0 } local bottomBorderFrameTop = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0 } local topBorderFrameTop = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0, Position = UDim2.new(0, 1, 0, 0), Size = UDim2.new(1, -1, 0, 1) } local topBorderFrameCenter = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0 } local topBorderFrameBottom = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0 } local border_frame = RBXInstance.new "Frame" { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0), leftBorderFrameLeft, leftBorderFrameCenter, leftBorderFrameRight, rightBorderFrameLeft, rightBorderFrameCenter, rightBorderFrameRight, bottomBorderFrameBottom, bottomBorderFrameCenter, bottomBorderFrameTop, topBorderFrameBottom, topBorderFrameCenter, topBorderFrameTop } local contentFrame = RBXInstance.new "Frame" { BackgroundTransparency = 1, BorderSizePixel = 0, ClipsDescendants = true, Size = UDim2.new(1, 0, 1, 0) } local base_frame = RBXInstance.new "Frame" { BorderSizePixel = 0, border_frame, contentFrame } self.m_base_instance = base_frame self.m_content_frame = contentFrame self.m_border_frame = border_frame self.leftBorderFrameLeft = leftBorderFrameLeft self.leftBorderFrameCenter = leftBorderFrameCenter self.leftBorderFrameRight = leftBorderFrameRight self.rightBorderFrameLeft = rightBorderFrameLeft self.rightBorderFrameCenter = rightBorderFrameCenter self.rightBorderFrameRight = rightBorderFrameRight self.bottomBorderFrameBottom = bottomBorderFrameBottom self.bottomBorderFrameCenter = bottomBorderFrameCenter self.bottomBorderFrameTop = bottomBorderFrameTop self.topBorderFrameBottom = topBorderFrameBottom self.topBorderFrameCenter = topBorderFrameCenter self.topBorderFrameTop = topBorderFrameTop self:SetActive(data.Active) self:SetBackgroundTransparency(data.BackgroundTransparency) self:SetBorderSize(data.BorderSize) self:SetBorderTransparency(data.BorderTransparency) self:SetColor(data.Color) self:SetPosition(data.Position) self:SetSize(data.Size) self:SetVisible(data.Visible) self:SetParent(data.Parent) end function GuiFrame:IsA(className) return className == "GuiFrame" or GuiObject.IsA(self, className) end function GuiFrame:SetBorderSize(border_size) border_size = math.max(math.floor(border_size + 0.5), 0) if border_size ~= self.m_border_size then self.m_border_size = border_size local border_frame = self.m_border_frame local contentFrame = self.m_content_frame local leftBorderFrameCenter = self.leftBorderFrameCenter local leftBorderFrameRight = self.leftBorderFrameRight local rightBorderFrameCenter = self.rightBorderFrameCenter local rightBorderFrameLeft = self.rightBorderFrameLeft local bottomBorderFrameCenter = self.bottomBorderFrameCenter local bottomBorderFrameTop = self.bottomBorderFrameTop local topBorderFrameCenter = self.topBorderFrameCenter local topBorderFrameBottom = self.topBorderFrameBottom contentFrame.Position = UDim2.new(0, border_size, 0, border_size) contentFrame.Size = UDim2.new(1, -2 * border_size, 1, -2 * border_size) local inner_visible = border_size > 0 if self.leftBorderFrameLeft.Visible ~= inner_visible then self.rightBorderFrameRight.Visible = inner_visible self.bottomBorderFrameBottom.Visible = inner_visible self.topBorderFrameTop.Visible = inner_visible end local outer_visible = border_size > 1 if leftBorderFrameCenter.Visible ~= outer_visible then leftBorderFrameCenter.Visible = outer_visible leftBorderFrameRight.Visible = outer_visible rightBorderFrameCenter.Visible = outer_visible rightBorderFrameLeft.Visible = outer_visible bottomBorderFrameCenter.Visible = outer_visible bottomBorderFrameTop.Visible = outer_visible topBorderFrameCenter.Visible = outer_visible topBorderFrameBottom.Visible = outer_visible end if outer_visible then leftBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size) leftBorderFrameRight.Position = UDim2.new(0, border_size - 1, 0, border_size - 1) leftBorderFrameRight.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size) rightBorderFrameCenter.Position = UDim2.new(1, 1 - border_size, 0, border_size - 1) rightBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size) rightBorderFrameLeft.Position = UDim2.new(1, -border_size, 0, border_size) rightBorderFrameLeft.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size) bottomBorderFrameCenter.Position = UDim2.new(0, 1, 1, 1 - border_size) bottomBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2) bottomBorderFrameTop.Position = UDim2.new(0, border_size - 1, 1, -border_size) bottomBorderFrameTop.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1) topBorderFrameCenter.Position = UDim2.new(0, border_size - 1, 0, 1) topBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2) topBorderFrameBottom.Position = UDim2.new(0, border_size, 0, border_size - 1) topBorderFrameBottom.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1) end end end function GuiFrame:SetBorderTransparency(borderTransparency) self.borderTransparency = borderTransparency self.leftBorderFrameLeft.BackgroundTransparency = borderTransparency self.leftBorderFrameCenter.BackgroundTransparency = borderTransparency self.leftBorderFrameRight.BackgroundTransparency = borderTransparency self.rightBorderFrameLeft.BackgroundTransparency = borderTransparency self.rightBorderFrameCenter.BackgroundTransparency = borderTransparency self.rightBorderFrameRight.BackgroundTransparency = borderTransparency self.bottomBorderFrameBottom.BackgroundTransparency = borderTransparency self.bottomBorderFrameCenter.BackgroundTransparency = borderTransparency self.bottomBorderFrameTop.BackgroundTransparency = borderTransparency self.topBorderFrameBottom.BackgroundTransparency = borderTransparency self.topBorderFrameCenter.BackgroundTransparency = borderTransparency self.topBorderFrameTop.BackgroundTransparency = borderTransparency end GuiButton = setmetatable({}, GuiFrame) GuiButton.__index = GuiButton GuiButton.__default = {__index = { AutoButtonColor = true }} function GuiButton:Destroy() self.Activated:disconnect() GuiFrame.Destroy(self) end function GuiButton:Init(data) if data.Active == nil then data.Active = true end GuiFrame.Init(self, data) setmetatable(data, GuiButton.__default) self.Activated = RbxUtility.CreateSignal() self:SetAutoButtonColor(data.AutoButtonColor) end function GuiButton:IsA(className) return className == "GuiButton" or GuiFrame.IsA(self, className) end function GuiButton:SetAutoButtonColor(autoButtonColor) if autoButtonColor ~= self.autoButtonColor then self.autoButtonColor = autoButtonColor if autoButtonColor then if self.mouseOver then local color = self.color local transparency = self.backgroundTransparency if self.mouseDown then self.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1)) self.m_base_instance.BackgroundTransparency = transparency else self.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0)) self.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.5) end end else self.m_base_instance.BackgroundColor3 = self.color end end end GuiTextLabel = setmetatable({}, GuiFrame) GuiTextLabel.__index = GuiTextLabel GuiTextLabel.__default = {__index = { Font = "ArialBold", FontSize = "Size12", Text = "", TextColor = Color3.new(1, 1, 1), TextStrokeColor = Color3.new(0, 0, 0), TextStrokeTransparency = 0.6, TextWrapped = true }} function GuiTextLabel:Destroy() GuiFrame.Destroy(self) end function GuiTextLabel:Init(data) GuiFrame.Init(self, data) setmetatable(data, GuiTextLabel.__default) local base_instance = self.m_base_instance local textLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = data.Font, FontSize = data.FontSize, TextColor3 = data.TextColor3, TextStrokeColor3 = data.TextStrokeColor3, TextStrokeTransparency = data.TextStrokeTransparency, TextWrapped = data.TextWrapped } textLabel.Parent = self:GetContentInstance() self.textLabel = textLabel self:SetText(data.Text) end function GuiTextLabel:IsA(className) return className == "GuiTextLabel" or GuiFrame.IsA(self, className) end function GuiTextLabel:SetText(text) if text ~= self.text then self.text = text local text_index = 1 local content_instance = self:GetContentInstance() local content_instance_size = content_instance.AbsoluteSize local frame = Instance.new("Frame") frame.BackgroundTransparency = 1 local label = Instance.new("TextLabel") label.BackgroundTransparency = 1 label.Font = font label.FontSize = fontSize label.Size = UDim2.new(0, content_instance_size.X, 0, 1000) label.Text = "" label.TextColor3 = textColor3 label.TextTransparency = 1 label.TextWrapped = true label.TextXAlignment = textXAlignment label.TextYAlignment = textYAlignment label.Parent = self.guiFrame local row_length = 0 local step_size = 256 for step = 1, 8 do step_size = 0.5 * step_size label.Text = string.sub(text, text_index, text_index + row_length - 1) end end end GuiImageButton = setmetatable({}, GuiButton) GuiImageButton.__index = GuiImageButton GuiImageButton.__default = {__index = { Image = "" }} function GuiImageButton:Destroy() GuiButton.Destroy(self) end function GuiImageButton:Init(data) GuiButton.Init(self, data) setmetatable(data, GuiImageButton.__default) local content_frame = self.m_content_frame local image_label = RBXInstance.new "ImageLabel" { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0) } image_label.Parent = content_frame self.m_image_label = image_label self:SetImage(data.Image) end function GuiImageButton:IsA(className) return className == "GuiImageButton" or GuiButton.IsA(self, className) end function GuiImageButton:SetImage(image) if image ~= self.m_image then self.m_image = image self.m_image_label.Image = image end end GuiTextButton = setmetatable({}, GuiButton) GuiTextButton.__index = GuiTextButton GuiTextButton.__default = {__index = { Font = Enum.Font.ArialBold, FontSize = Enum.FontSize.Size11, Text = "Button", TextXAlignment = Enum.TextXAlignment.Center }} function GuiTextButton:Destroy() GuiButton.Destroy(self) end function GuiTextButton:GetTextBounds() return self.textLabel.TextBounds end function GuiTextButton:Init(data) GuiButton.Init(self, data) setmetatable(data, GuiTextButton.__default) local contentFrame = self.m_content_frame local mnemonicLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size36", Size = UDim2.new(1, 0, 0.7, 0), TextColor3 = Color3.new(1, 1, 1), TextStrokeColor3 = Color3.new(0, 0, 0), TextStrokeTransparency = 0.6, TextWrapped = true } local textLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, TextColor3 = Color3.new(1, 1, 1), TextStrokeColor3 = Color3.new(0, 0, 0), TextStrokeTransparency = 0.6, TextWrapped = true } mnemonicLabel.Parent = contentFrame textLabel.Parent = contentFrame self.mnemonicLabel = mnemonicLabel self.textLabel = textLabel self:SetFont(data.Font) self:SetFontSize(data.FontSize) self:SetMnemonic(data.Mnemonic, true) self:SetText(data.Text) self:SetTextXAlignment(data.TextXAlignment) end function GuiTextButton:IsA(className) return className == "GuiTextButton" or GuiButton.IsA(self, className) end function GuiTextButton:SetFont(font) if font ~= self.font then self.font = font self.textLabel.Font = font end end function GuiTextButton:SetFontSize(fontSize) if fontSize ~= self.fontSize then self.fontSize = fontSize self.textLabel.FontSize = fontSize end end function GuiTextButton:SetMnemonic(mnemonic, forceUpdate) if mnemonic ~= self.mnemonic or forceUpdate then if self.mnemonic then GuiService:SetMnemonic(self.mnemonic, nil) end if mnemonic then GuiService:SetMnemonic(mnemonic, self) end self.mnemonic = mnemonic local mnemonicLabel = self.mnemonicLabel local textLabel = self.textLabel if mnemonic then mnemonicLabel.Text = mnemonic textLabel.Size = UDim2.new(1, 0, 0.9, 0) textLabel.TextYAlignment = "Bottom" else mnemonicLabel.Text = "" textLabel.Size = UDim2.new(1, 0, 1, 0) textLabel.TextYAlignment = "Center" end end end function GuiTextButton:SetText(text) if text ~= self.text then self.text = text self.textLabel.Text = text end end function GuiTextButton:SetTextXAlignment(textXAlignment) if textXAlignment ~= self.textXAlignment then self.textXAlignment = textXAlignment self.textLabel.TextXAlignment = textXAlignment end end GuiWindow = setmetatable({}, GuiObject) GuiWindow.__index = GuiWindow GuiWindow.__default = {__index = { Active = true, BackgroundTransparency = 0.5, BorderSize = 4, BorderTransparency = 0.5, Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(0, 360, 0, 240), Title = "Window", TitleBarBackgroundTransparency = 0.5, TitleBarBorderTransparency = 1, Visible = true }} function GuiWindow:Init(data) GuiObject.Init(self) setmetatable(data, GuiFrame.__default) local title_bar = GuiTextLabel:new { BackgroundTransparency = data.TitleBarBackgroundTransparency, BorderTransparency = data.TitleBarBackgroundTransparency, Text = data.Title } local content_frame = GuiFrame:new { Active = data.Active, BackgroundTransparency = data.BackgroundTransparency, BorderSize = data.BorderSize, BorderTransparency = data.BorderTransparency } local base_frame = RBXInstance.new "Frame" { BackgroundTransparency = 1, BorderSizePixel = 0, Position = data.Position, Size = data.Size, Visible = data.Visible } self.m_base_frame = base_frame self.m_content_frame = content_frame self.m_title_bar = title_bar end function GuiWindow:IsA(className) return className == "GuiWindow" or GuiObject.IsA(self, className) end GuiScrollFrame = setmetatable({}, GuiFrame) GuiScrollFrame.__index = GuiScrollFrame GuiScrollFrame.__default = {__index = { ContentHeight = 0, ScrollBarColor = Color3.new(1, 1, 1) }} function GuiScrollFrame:Destroy() self.m_scroll_bar:Destroy() GuiFrame.Destroy(self) end function GuiScrollFrame:GetContentInstance() return self.m_scroll_frame or GuiFrame.GetContentInstance(self) end function GuiScrollFrame:Init(data) GuiFrame.Init(self, data) setmetatable(data, GuiScrollFrame.__default) local scroll_pane = RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.8, BorderSizePixel = 0, Position = UDim2.new(1, -20, 0, 0), Size = UDim2.new(0, 20, 1, 0), Parent = self.m_content_frame } local scroll_bar = GuiFrame:new { Active = true, BackgroundTransparency = 0.6, BorderTransparency = 0.6, Color = data.ScrollBarColor, Parent = self } local scroll_frame = RBXInstance.new "Frame" { BackgroundTransparency = 1, Parent = self.m_content_frame } self.m_scroll_bar = scroll_bar self.m_scroll_frame = scroll_frame self.m_scroll_pane = scroll_pane self.m_scroll_position = 0 self.m_updating_content_height = false self:SetContentHeight(data.ContentHeight) self:UpdateScrollPosition() self.m_scroll_bar.DragBegin:connect(function() self.m_scroll_drag_total = Vector2.new() self.m_scroll_initial_position = self.m_scroll_position end) self.m_scroll_bar.DragMove:connect(function(offset) self.m_scroll_drag_total = self.m_scroll_drag_total + offset local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size if absolute_height ~= 0 then local content_height = math.max(self.m_content_height, absolute_height) local scroll_space = 1 - absolute_height / content_height self:Scroll(self.m_scroll_initial_position + self.m_scroll_drag_total.Y * (content_height / absolute_height - 1) / scroll_space) end end) end function GuiScrollFrame:IsA(className) return className == "GuiScrollFrame" or GuiFrame.IsA(self, className) end function GuiScrollFrame:Scroll(position) position = math.min(math.max(position, 0), self.m_content_height - (self:GetAbsoluteSize().Y - 2 * self.m_border_size)) if position ~= self.m_scroll_position then self.m_scroll_position = position self:UpdateScrollPosition() end end function GuiScrollFrame:SetContentHeight(height) if height ~= self.m_content_height then local prev_height = self.m_content_height self.m_content_height = height if not self.m_updating_content_height then self.m_updating_content_height = true coroutine.resume(coroutine.create(function() local success, message = ypcall(self.SetContentHeightImpl1, self, prev_height) if not success then Logger.printf("Severe", "Error in GuiScrollFrame:SetContentHeight(%s): %s", Utility.ToString(height), message) end end)) end end end function GuiScrollFrame:SetContentHeightImpl1(prev_height) RunService.RenderStepped:wait() self.m_updating_content_height = false local height = self.m_content_height self.m_scroll_frame.Size = UDim2.new(1, -20, 0, height) if prev_height and prev_height ~= 0 then local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size if self.m_scroll_position == prev_height - absolute_height then self.m_scroll_position = height - absolute_height else self.m_scroll_position = height * self.m_scroll_position / prev_height end end self:UpdateScrollPosition() end function GuiScrollFrame:UpdateScrollPosition() local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size if absolute_height == 0 then absolute_height = self.m_content_height end local scroll_bar = self.m_scroll_bar local scroll_frame = self.m_scroll_frame local scroll_pane = self.m_scroll_pane local content_height = math.max(self.m_content_height, absolute_height) if absolute_height == content_height then scroll_frame.Position = UDim2.new(0, 0, 0, 0) scroll_frame.Size = UDim2.new(1, 0, 1, 0) scroll_bar:SetVisible(false) scroll_pane.Visible = false else local contentScale = content_height / absolute_height local scroll_space = 1 - absolute_height / content_height local scroll_position = self.m_scroll_position scroll_frame.Position = UDim2.new(0, 0, 0, -scroll_position) scroll_bar:SetPosition(UDim2.new(1, -20, scroll_position / (content_height - absolute_height) * scroll_space, 0)) scroll_bar:SetSize(UDim2.new(0, 20, absolute_height / content_height, 0)) scroll_bar:SetVisible(true) scroll_pane.Visible = true end end GuiMenu = setmetatable({}, GuiFrame) GuiMenu.__index = GuiMenu GuiMenu.__default = {__index = { VerticalSpacing = 18 }} function GuiMenu:AddItem(text, onClick, options) local frameSize = self:GetSize() local frameHeight = frameSize.Y.Offset - self.m_border_size * 2 local verticalSpacing = self.verticalSpacing local properties = { BackgroundTransparency = 0.75, BorderSize = 0, BorderTransparency = 1, Color = (#self.menuItems % 2 == 1) and Color3.new(0.25, 0.25, 0.25) or Color3.new(0, 0, 0), FontSize = Enum.FontSize.Size12, Position = UDim2.new(0, 0, 0, frameHeight), Size = UDim2.new(1, 0, 0, verticalSpacing), Text = text, Parent = self } if options then for key, value in pairs(options) do properties[key] = value end end local menuItem = GuiTextButton:new(properties) if onClick then menuItem.Activated:connect(function() if not onClick(text, self) then self:Destroy() end end) end self.menuItems[#self.menuItems + 1] = menuItem self:SetSize(frameSize + UDim2.new(0, 0, 0, verticalSpacing)) end function GuiMenu:ClearItems() local menuItems = self.menuItems for _, item in ipairs(menuItems) do menuItems[item] = nil item:Destroy() end local frameSize = self:GetSize() self:SetSize(frameSize + UDim2.new(0, 0, 0, self.m_border_size * 2 - frameSize.Y.Offset)) end function GuiMenu:Destroy() self:ClearItems() GuiFrame.Destroy(self) end function GuiMenu:Init(data) GuiFrame.Init(self, data) setmetatable(data, GuiMenu.__default) self.menuItems = {} self.verticalSpacing = data.VerticalSpacing end function GuiMenu:IsA(className) return className == "GuiMenu" or GuiFrame.IsA(self, className) end GuiTextList = setmetatable({}, GuiScrollFrame) GuiTextList.__index = GuiTextList GuiTextList.__default = {__index = { }} function GuiTextList:AddItem(text, options) local properties = { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 4, 0, self.m_content_height), Size = UDim2.new(1, -8, 0, 12), Text = tostring(text), TextColor3 = Color3.new(1, 1, 1), TextStrokeTransparency = 0.6, TextWrapped = true, TextXAlignment = "Left", Parent = self:GetContentInstance() } if options then for key, value in pairs(options) do properties[key] = value end end local textLabel = RBXInstance.new "TextLabel" (properties) textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextBounds.Y) self.listItems[#self.listItems + 1] = textLabel self:SetContentHeight(self.m_content_height + textLabel.TextBounds.Y) end function GuiTextList:ClearItems() local listItems = self.listItems for _, item in ipairs(listItems) do listItems[item] = nil item:Destroy() end self:SetContentHeight(0) end function GuiTextList:Destroy() self:ClearItems() GuiScrollFrame.Destroy(self) end function GuiTextList:Init(data) GuiScrollFrame.Init(self, data) self.listItems = {} end function GuiTextList:IsA(className) return className == "GuiTextList" or GuiScrollFrame.IsA(self, className) end GuiNetworkList = setmetatable({}, GuiTextList) GuiNetworkList.__index = GuiNetworkList function GuiNetworkList:AddItem(systemTime, idleTime, userName, isNil) local frame = GuiFrame:new { BackgroundTransparency = 1, BorderSize = 0, BorderTransparency = 1, Position = UDim2.new(0, 4, 0, self.m_content_height), Size = UDim2.new(1, -8, 0, 14), } local systemTimeColor if string.sub(systemTime, 1, 1) == "?" then systemTimeColor = Color3.new(1, 0.75, 0.75) else systemTimeColor = Color3.new(0.75, 0.75, 1) end local systemTimeLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(0, 50, 1, 0), Text = systemTime, TextColor3 = systemTimeColor, TextStrokeTransparency = 0.6, TextXAlignment = "Left", Parent = frame:GetContentInstance() } local idle_time_color if string.sub(idleTime, 1, 1) == "0" then idle_time_color = Color3.new(1, 1, 1) else idle_time_color = Color3.new(1, 0.75, 0.75) end local idleTimeLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 40, 0, 0), Size = UDim2.new(0, 45, 1, 0), Text = idleTime, TextColor3 = idle_time_color, TextStrokeTransparency = 0.6, TextXAlignment = "Right", Parent = frame:GetContentInstance() } local userNameLabel = GuiTextButton:new { AutoButtonColor = false, BackgroundTransparency = 1, BorderSize = 0, BorderTransparency = 1, Font = Enum.Font.SourceSansBold, FontSize = Enum.FontSize.Size14, Position = UDim2.new(0, 98, 0, 0), Size = UDim2.new(1, -98, 1, 0), TextXAlignment = Enum.TextXAlignment.Left, Text = userName, Parent = frame } frame:SetParent(self) local userNameWidth = userNameLabel:GetTextBounds().X userNameLabel:SetSize(UDim2.new(0, userNameWidth + 4, 1, 0)) if isNil then local isNilLabel = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "SourceSans", FontSize = "Size14", Position = UDim2.new(0, 100 + userNameWidth + 8, 0, 0), Size = UDim2.new(0, 50, 1, 0), Text = "(nil)", TextColor3 = Color3.new(1, 0.4, 0.4), TextStrokeTransparency = 0.6, TextXAlignment = "Left", Parent = frame:GetContentInstance() } end self.listItems[#self.listItems + 1] = frame self:SetContentHeight(self.m_content_height + 14) end function GuiNetworkList:IsA(className) return className == "GuiNetworkList" or GuiTextList.IsA(self, className) end GuiTextOutput = setmetatable({}, GuiScrollFrame) GuiTextOutput.__index = GuiTextOutput GuiTextOutput.__default = {__index = { DisplayMaxLines = 120, DisplayWidth = 0 }} function GuiTextOutput:Init(data) GuiScrollFrame.Init(self, data) setmetatable(data, GuiTextOutput.__default) self.displayMaxLines = data.DisplayMaxLines self.displayWidth = data.DisplayWidth self.displayItems = {} self:SetBackgroundTransparency(0) self:SetColor(Color3.new(1, 1, 1)) self.m_scroll_pane.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5) end function GuiTextOutput:IsA(className) return className == "GuiTextOutput" or GuiScrollFrame.IsA(self, className) end function GuiTextOutput:Print(...) self:PrintFormat(nil, ...) end function GuiTextOutput:PrintFormat(options, ...) local buffer = {} local args = {...} local first = true for i = 1, select("#", ...) do buffer[i] = tostring(args[i]) end message = Utility.BlockRobloxFilter(table.concat(buffer, "\t")) local properties = { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 4, 0, self.m_content_height), Text = message, TextColor3 = Color3.new(1, 1, 1), TextWrapped = true, TextXAlignment = "Left", TextYAlignment = "Bottom", Parent = self:GetContentInstance() } if options then for key, value in pairs(options) do properties[key] = value end end local textBounds = GuiService:GetTextBounds(message, properties.Font, properties.FontSize, properties.TextXAlignment, properties.TextYAlignment, self.displayWidth - 20) local textHeight = textBounds.Y properties.Size = UDim2.new(0, self.displayWidth - 8, 0, textBounds.Y) local textLabel = RBXInstance.new "TextLabel" (properties) self.displayItems[#self.displayItems + 1] = textLabel local maxLines = self.displayMaxLines local maxHeight = maxLines * 12 local newHeight = self.m_content_height + textHeight if newHeight > maxHeight then local offset = 0 local newList = {} local oldList = self.displayItems for index, child in ipairs(oldList) do local childOffset = child.Size.Y.Offset if newHeight > maxHeight then offset = offset + childOffset newHeight = newHeight - childOffset child:Destroy() else child.Position = child.Position - UDim2.new(0, 0, 0, offset) newList[#newList + 1] = child end end self.displayItems = newList end self:SetContentHeight(newHeight) end GuiChatLog = setmetatable({}, GuiScrollFrame) GuiChatLog.__index = GuiChatLog GuiChatLog.__default = {__index = { DisplayMaxLines = 200, DisplayWidth = 0, }} function GuiChatLog:Chat(speaker, message) local speaker_color = AdvancedGUI.GenerateChatColor(speaker) speaker = Utility.BlockRobloxFilter(speaker) message = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" .. Utility.BlockRobloxFilter(message) local timestamp = Utility.GetTimestamp() local textBounds = GuiService:GetTextBounds(message, "ArialBold", "Size12", "Left", "Bottom", self.displayWidth - 8) local textHeight = math.max(math.min(textBounds.Y, 36), 12) local message_frame = RBXInstance.new "Frame" { BackgroundTransparency = 1, Position = UDim2.new(0, 0, 0, self.m_content_height), Size = UDim2.new(0, self.displayWidth, 0, textHeight), Parent = self:GetContentInstance() } local timestamp_label = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 4, 0, 0), Size = UDim2.new(1, -8, 0, 12), Text = timestamp, TextColor3 = Color3.new(0.75, 0.75, 0.75), TextStrokeTransparency = 0.6, TextWrapped = true, TextXAlignment = "Left", Parent = message_frame } local speaker_label = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 64, 0, 0), Size = UDim2.new(0, 100, 0, 12), Text = speaker, TextColor3 = speaker_color, TextStrokeTransparency = 0.6, Parent = message_frame } local message_label = RBXInstance.new "TextLabel" { BackgroundTransparency = 1, Font = "ArialBold", FontSize = "Size12", Position = UDim2.new(0, 4, 0, 0), Size = UDim2.new(1, -8, 1, 0), Text = message, TextColor3 = Color3.new(1, 1, 1), TextStrokeTransparency = 0.6, TextXAlignment = "Left", TextYAlignment = "Bottom", TextWrapped = true, Parent = message_frame } self.displayItems[#self.displayItems + 1] = message_frame local maxLines = self.displayMaxLines local maxHeight = maxLines * 12 local newHeight = self.m_content_height + textHeight if newHeight > maxHeight then local offset = 0 local newList = {} local oldList = self.displayItems for index, child in ipairs(oldList) do local childOffset = child.Size.Y.Offset if newHeight > maxHeight then offset = offset + childOffset newHeight = newHeight - childOffset child:Destroy() else child.Position = child.Position - UDim2.new(0, 0, 0, offset) newList[#newList + 1] = child end end self.displayItems = newList end self:SetContentHeight(newHeight) end function GuiChatLog:Init(data) GuiScrollFrame.Init(self, data) setmetatable(data, GuiChatLog.__default) self.displayMaxLines = data.DisplayMaxLines self.displayWidth = data.DisplayWidth self.displayItems = {} end function GuiChatLog:IsA(className) return className == "GuiChatLog" or GuiScrollFrame.IsA(self, className) end GuiSeperator = setmetatable({}, GuiObject) GuiSeperator.__index = GuiSeperator GuiSeperator.__default = {__index = { Active = false, Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(1, 0, 0, 16), Visible = true }} function GuiSeperator:Init(data) GuiObject.Init(self) setmetatable(data, GuiSeperator.__default) local base_frame = RBXInstance.new "Frame" { BackgroundTransparency = 1, RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.25, BorderSizePixel = 0, Position = UDim2.new(0.5, -13, 0.5, -1), Size = UDim2.new(0, 3, 0, 3), RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.75, BorderSizePixel = 0, Position = UDim2.new(0, -1, 0, -1), Size = UDim2.new(0, 5, 0, 5) } }, RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.25, BorderSizePixel = 0, Position = UDim2.new(0.5, -1, 0.5, -1), Size = UDim2.new(0, 3, 0, 3), RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.75, BorderSizePixel = 0, Position = UDim2.new(0, -1, 0, -1), Size = UDim2.new(0, 5, 0, 5) } }, RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.25, BorderSizePixel = 0, Position = UDim2.new(0.5, 11, 0.5, -1), Size = UDim2.new(0, 3, 0, 3), RBXInstance.new "Frame" { BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.75, BorderSizePixel = 0, Position = UDim2.new(0, -1, 0, -1), Size = UDim2.new(0, 5, 0, 5) } } } self.m_base_instance = base_frame self:SetActive(data.Active) self:SetPosition(data.Position) self:SetSize(data.Size) self:SetVisible(data.Visible) self:SetParent(data.Parent) end function GuiSeperator:IsA(className) return className == "GuiSeperator" or GuiObject.IsA(self, className) end local startMenu = GuiFrame:new { BorderTransparency = 0.5, Position = UDim2.new(0, -4, 0, -4), Size = UDim2.new(0, 68, 1, 8), Parent = GuiService } GuiSeperator:new { Position = UDim2.new(0, 0, 0, 5), Parent = startMenu } GuiSeperator:new { Position = UDim2.new(0, 0, 1, -85), Parent = startMenu } local networkButton = GuiTextButton:new { BackgroundTransparency = 0.9, Mnemonic = "L", Position = UDim2.new(0, 4, 1, -647), Text = "Network", Parent = startMenu } local chatLogButton = GuiTextButton:new { BackgroundTransparency = 0.9, Mnemonic = "K", Position = UDim2.new(0, 4, 1, -475), Text = "Chat log", Parent = startMenu } local outputButton = GuiTextButton:new { BackgroundTransparency = 0.9, Mnemonic = "P", Position = UDim2.new(0, 4, 1, -283), Text = "Output", Parent = startMenu } local toolsButton = GuiTextButton:new { BackgroundTransparency = 0.9, Mnemonic = "O", Position = UDim2.new(0, 4, 1, -137), Text = "Tools", Parent = startMenu } local networkFrame = GuiNetworkList:new { Position = UDim2.new(0, 66, 1, -647), Size = UDim2.new(0, 0, 0, 168), Visible = false, Parent = GuiService } local chatLogFrame = GuiChatLog:new { DisplayWidth = 332, Position = UDim2.new(0, 66, 1, -475), Size = UDim2.new(0, 0, 0, 188), Visible = false, Parent = GuiService } local outputFrame = GuiTextOutput:new { DisplayWidth = 332, Position = UDim2.new(0, 66, 1, -283), Size = UDim2.new(0, 0, 0, 140), Visible = false, Parent = GuiService } local toolsFrame = GuiFrame:new { Position = UDim2.new(0, 66, 1, -137), Size = UDim2.new(0, 0, 0, 52), Visible = false, Parent = GuiService } local toggleCharacterButton = GuiTextButton:new { BackgroundTransparency = 0.9, Position = UDim2.new(0, 1, 0, 1), Size = UDim2.new(0, 108, 0, 20), Text = "Enable character", Parent = toolsFrame } local resetCharacterButton = GuiTextButton:new { BackgroundTransparency = 0.9, Position = UDim2.new(0, 1, 0, 23), Size = UDim2.new(0, 108, 0, 20), Text = "Reset character", Parent = toosFrame } local clearWorkspaceButton = GuiTextButton:new { BackgroundTransparency = 0.9, Position = UDim2.new(0, 110, 0, 1), Size = UDim2.new(0, 108, 0, 20), Text = "Clear workspace", Parent = toolsFrame } local clearScriptButton = GuiTextButton:new { BackgroundTransparency = 0.9, Position = UDim2.new(0, 110, 0, 23), Size = UDim2.new(0, 108, 0, 20), Text = "Clear all", Parent = toolsFrame } local fixLightingButton = GuiTextButton:new { BackgroundTransparency = 0.9, Position = UDim2.new(0, 219, 0, 1), Size = UDim2.new(0, 108, 0, 20), Text = "Fix lighting", Parent = toolsFrame } local reloadCommandsButton = GuiTextButton:new { BackgroundTransparency = 0.9, Position = UDim2.new(0, 219, 0, 23), Size = UDim2.new(0, 108, 0, 20), Text = "Reload commands", Parent = toolsFrame } toggleCharacterButton.Activated:connect(function() local enabled = not PlayerControl.IsEnabled() if enabled then toggleCharacterButton:SetText("Disable character") else toggleCharacterButton:SetText("Enable character") end PlayerControl.SetEnabled(enabled) end) resetCharacterButton.Activated:connect(function() PlayerControl.ResetCharacter() end) clearWorkspaceButton.Activated:connect(function() Utility.CleanWorkspace() end) clearScriptButton.Activated:connect(function() Utility.CleanWorkspaceAndScripts() end) fixLightingButton.Activated:connect(function() Utility.CleanLighting() end) reloadCommandsButton.Activated:connect(function() UserInterface.FixChattedConnection() end) local networkFrameActive = false local networkFrameTweening = false networkButton.Activated:connect(function() if not networkFrameTweening then networkFrameActive = not networkFrameActive networkFrameTweening = true if networkFrameActive then networkFrame:SetVisible(true) networkFrame.m_base_instance:TweenSize(UDim2.new(0, 276, 0, 168), nil, nil, 0.5) wait(0.5) else networkFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 168), nil, nil, 0.5) wait(0.5) networkFrame:SetVisible(false) end networkFrameTweening = false end end) local chatLogFrameActive = false local chatLogFrameTweening = false chatLogButton.Activated:connect(function() if not chatLogFrameTweening then chatLogFrameActive = not chatLogFrameActive chatLogFrameTweening = true if chatLogFrameActive then chatLogFrame:SetVisible(true) chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 188), nil, nil, 0.5) wait(0.5) else chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 188), nil, nil, 0.5) wait(0.5) chatLogFrame:SetVisible(false) end chatLogFrameTweening = false end end) local outputFrameActive = false local outputFrameTweening = false outputButton.Activated:connect(function() if not outputFrameTweening then outputFrameActive = not outputFrameActive outputFrameTweening = true if outputFrameActive then outputFrame:SetVisible(true) outputFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 140), nil, nil, 0.5) wait(0.5) else outputFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 140), nil, nil, 0.5) wait(0.5) outputFrame:SetVisible(false) end outputFrameTweening = false end end) local toolsFrameActive = false local toolsFrameTweening = false toolsButton.Activated:connect(function() if not toolsFrameTweening then toolsFrameActive = not toolsFrameActive toolsFrameTweening = true if toolsFrameActive then toolsFrame:SetVisible(true) toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 336, 0, 52), nil, nil, 0.5) wait(0.5) else toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 52), nil, nil, 0.5) wait(0.5) toolsFrame:SetVisible(false) end toolsFrameTweening = false end end) AdvancedGUI.startMenu = startMenu AdvancedGUI.networkFrame = networkFrame AdvancedGUI.outputFrame = outputFrame AdvancedGUI.toolsFrame = toolsFrame AdvancedGUI.chatLogFrame = chatLogFrame AdvancedGUI.toggleCharacterButton = toggleCharacterButton AdvancedGUI.reloadCommandsButton = reloadCommandsButton function AdvancedGUI.Print(...) AdvancedGUI.outputFrame:Print(...) end function AdvancedGUI.PrintFormat(...) AdvancedGUI.outputFrame:PrintFormat(...) end function AdvancedGUI.PrintChatLog(speaker, message) AdvancedGUI.chatLogFrame:Chat(speaker, message) end for _, entry in Logger.NodeIterator, Logger.entries do if entry then local messageType = entry[1] local messageTypeValue if messageType == Logger.MessageType.Error then messageTypeValue = Logger.MessageType.Severe.Value else messageTypeValue = messageType.Value end AdvancedGUI.outputFrame:PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], entry[2]) else break end end function GetPlayers(str) local found = {}; if str == "all" then for i,v in pairs(game.Players:children()) do if v:IsA("Player") then table.insert(found,v) end end else for i,v in pairs(game.Players:children()) do if string.match(v.Name:lower(), str:lower()) and v:IsA("Player") then table.insert(found,v) end end end return found end function NewCMD(nme, usg, desc, func) table.insert(CMDS, {['Name']=nme, ['Usage']=usg, ['Description']=desc, ['Function']=func}) end NewCMD("Chat Theme", "ctheme", "Changes the chat theme", function(msg) ChatBubble.SetTheme(msg) end) NewCMD("Clean", "clr", "Clears the game", function() Utility.CleanWorkspaceAndScripts() end) NewCMD("Fix Lighting", "fixl", "Fixes the ligghting",function() Utility.CleanLighting() end) NewCMD("Kill", "kill", "Kills the player", function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2}) plr.Character:BreakJoints() end end) NewCMD("Doge", "doge", "Dogeify's the player", function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2}) local function QuaternionFromCFrame(cf) local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() local trace = m00 + m11 + m22 if trace > 0 then local s = math.sqrt(1 + trace) local recip = 0.5/s return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 else local i = 0 if m11 > m00 then i = 1 end if m22 > (i == 0 and m00 or m11) then i = 2 end if i == 0 then local s = math.sqrt(m00-m11-m22+1) local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip elseif i == 1 then local s = math.sqrt(m11-m22-m00+1) local recip = 0.5/s return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip elseif i == 2 then local s = math.sqrt(m22-m00-m11+1) local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip end end end local function QuaternionToCFrame(px, py, pz, x, y, z, w) local xs, ys, zs = x + x, y + y, z + z local wx, wy, wz = w*xs, w*ys, w*zs local xx = x*xs local xy = x*ys local xz = x*zs local yy = y*ys local yz = y*zs local zz = z*zs return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) end local function QuaternionSlerp(a, b, t) local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] local startInterp, finishInterp; if cosTheta >= 0.0001 then if (1 - cosTheta) > 0.0001 then local theta = math.acos(cosTheta) local invSinTheta = 1/math.sin(theta) startInterp = math.sin((1-t)*theta)*invSinTheta finishInterp = math.sin(t*theta)*invSinTheta else startInterp = 1-t finishInterp = t end else if (1+cosTheta) > 0.0001 then local theta = math.acos(-cosTheta) local invSinTheta = 1/math.sin(theta) startInterp = math.sin((t-1)*theta)*invSinTheta finishInterp = math.sin(t*theta)*invSinTheta else startInterp = t-1 finishInterp = t end end return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp end function clerp(a,b,t) local qa = {QuaternionFromCFrame(a)} local qb = {QuaternionFromCFrame(b)} local ax, ay, az = a.x, a.y, a.z local bx, by, bz = b.x, b.y, b.z local _t = 1-t return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) end do --the animating char = plr.Character mouse = plr:GetMouse() humanoid = char:findFirstChild("Humanoid") torso = char:findFirstChild("Torso") head = char.Head ra = char:findFirstChild("Right Arm") la = char:findFirstChild("Left Arm") rl = char:findFirstChild("Right Leg") ll = char:findFirstChild("Left Leg") rs = torso:findFirstChild("Right Shoulder") ls = torso:findFirstChild("Left Shoulder") rh = torso:findFirstChild("Right Hip") lh = torso:findFirstChild("Left Hip") neck = torso:findFirstChild("Neck") rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint") anim = char:findFirstChild("Animate") rootpart = char:findFirstChild("HumanoidRootPart") camera = workspace.CurrentCamera if anim then anim:Destroy() end local rm = Instance.new("Motor", torso) rm.C0 = CFrame.new(1.5, 0.5, 0) rm.C1 = CFrame.new(0, 0.5, 0) rm.Part0 = torso rm.Part1 = ra local lm = Instance.new("Motor", torso) lm.C0 = CFrame.new(-1.5, 0.5, 0) lm.C1 = CFrame.new(0, 0.5, 0) lm.Part0 = torso lm.Part1 = la local rlegm = Instance.new("Motor", torso) rlegm.C0 = CFrame.new(0.5, -1, 0) rlegm.C1 = CFrame.new(0, 1, 0) rlegm.Part0 = torso rlegm.Part1 = rl local llegm = Instance.new("Motor", torso) llegm.C0 = CFrame.new(-0.5, -1, 0) llegm.C1 = CFrame.new(0, 1, 0) llegm.Part0 = torso llegm.Part1 = ll neck.C0 = CFrame.new(0, 1, 0) neck.C1 = CFrame.new(0, -0.5, 0) rj.C0 = CFrame.new() rj.C1 = CFrame.new() local sound = Instance.new("Sound", head) sound.SoundId = "http://www.roblox.com/asset/?id=130797915" sound.Volume = 0.8 sound.Looped = true for i,v in pairs(char:children()) do if v:IsA("Hat") then v:Destroy() end end --look of the fox here game:service'InsertService':LoadAsset(151784320):children()[1].Parent = char Instance.new("PointLight", head).Range = 10 local speed = 0.3 local angle = 0 local sitting = false local humanwalk = false local anglespeed = 1 rsc0 = rm.C0 lsc0 = lm.C0 llc0 = llegm.C0 rlc0 = rlegm.C0 neckc0 = neck.C0 local controllerService = game:GetService("ControllerService") local controller = controllerService:GetChildren()[1] controller.Parent = nil Instance.new("HumanoidController", game:service'ControllerService') Instance.new("SkateboardController", game:service'ControllerService') Instance.new("VehicleController", game:service'ControllerService') local controller = controllerService:GetChildren()[1] mouse.KeyDown:connect(function(k) if k == "q" then humanwalk = not humanwalk end if k == "z" then if not sound.IsPlaying then sound:stop() sound.SoundId = "http://www.roblox.com/asset/?id=130802245" wait() sound:play() end end if k == "x" then if not sound.IsPlaying then sound:stop() sound.SoundId = "http://www.roblox.com/asset/?id=130797915" wait() sound:play() end end if k == "c" then if not sound.IsPlaying then sound:stop() sound.SoundId = "http://www.roblox.com/asset/?id=149713968" wait() sound:play() end end if string.byte(k) == 48 then humanoid.WalkSpeed = 34 end end) mouse.KeyUp:connect(function(k) if string.byte(k) == 48 then humanoid.WalkSpeed = 16 end end) while wait() do angle = (angle % 100) + anglespeed/10 mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10)) local rscf = rsc0 local lscf = lsc0 local rlcf = rlc0 local llcf = llc0 local rjcf = CFrame.new() local ncf = neckc0 local rayz = Ray.new(rootpart.Position, Vector3.new(0, -6, 0)) local hitz, enz = workspace:findPartOnRay(rayz, char) if not hitz then if sound.IsPlaying then sound:stop() end if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then ncf = neckc0 * CFrame.Angles(math.pi/5, 0, 0) rjcf = CFrame.new() * CFrame.Angles(-math.pi/5, math.sin(angle)*0.05, 0) rscf = rsc0 * CFrame.Angles(math.pi/1.7+math.sin(angle)*0.1, 0, 0) lscf = lsc0 * CFrame.Angles(math.pi/1.7+math.sin(-angle)*0.1, 0, 0) rlcf = rlc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.3, 0, 0) llcf = llc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.3, 0, 0) else ncf = neckc0 * CFrame.Angles(math.pi/14, 0, 0) rjcf = CFrame.new() * CFrame.Angles(-math.pi/18, math.sin(angle)*0.05, 0) rscf = rsc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.2, 0, 0) lscf = lsc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.2, 0, 0) rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) CFrame.Angles(-math.pi/14, 0, 0) llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0) end elseif humanoid.Sit then if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then anglespeed = 6 ncf = neckc0 * CFrame.Angles(math.pi/5-math.sin(angle)*0.1, 0, 0) rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0) rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=135570347" then anglespeed = 4 ncf = neckc0 * CFrame.Angles(math.pi/5-math.abs(math.sin(angle))*0.3, 0, 0) rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0) rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then anglespeed = 2 ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08) rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0) rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) else anglespeed = 1/2 ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08) rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0) rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) end elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then anglespeed = 6 ncf = neckc0 * CFrame.Angles(math.pi/10-math.sin(angle)*0.07, 0, 0) rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/10, math.sin(angle)*0.001, 0) rscf = rsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0) lscf = lsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0) rlcf = rlc0 * CFrame.Angles(math.pi/10, math.sin(angle)*0.08, math.rad(6.5)) llcf = llc0 * CFrame.Angles(math.pi/10, -math.sin(angle)*0.08, -math.rad(6.5)) elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then anglespeed = 2 ncf = neckc0 * CFrame.Angles(math.pi/10-math.abs(math.sin(angle))*0.3, 0, 0) rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/20, math.sin(angle)*0.001, 0) rscf = rsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0) lscf = lsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0) rlcf = rlc0 * CFrame.Angles(math.pi/20, math.sin(angle)*0.08, math.rad(2.5)) llcf = llc0 * CFrame.Angles(math.pi/20, -math.sin(angle)*0.08, -math.rad(2.5)) elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130802245" then anglespeed = 3 ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.07, math.rad(30), 0) rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0) rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.05, 0, 0) lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.05, 0, 0) rlcf = rlc0 * CFrame.new(0, -0.1 + math.abs(mvmnt)*0.1, -0.1) * CFrame.Angles(0, math.rad(5), math.rad(5)) llcf = llc0 * CFrame.Angles(0, math.rad(2.5), math.rad(1)) else if humanwalk then anglespeed = 1/4 ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0) rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0) rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.1, 0, 0) lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.1, 0, 0) rlcf = rlc0 * CFrame.Angles(0, math.sin(angle)*0.08, math.rad(2.5)) llcf = llc0 * CFrame.Angles(0, -math.sin(angle)*0.08, -math.rad(2.5)) else anglespeed = 1/2 ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08) rjcf = CFrame.new(0, -2, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0) rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) end end elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 20 then if sound.IsPlaying then sound:stop() end if humanwalk then anglespeed = 4 ncf = neckc0 * CFrame.Angles(math.pi/24, mvmnt*.02, 0) rjcf = CFrame.new(0, math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/24, -mvmnt*.02, 0) rscf = rsc0 * CFrame.Angles(math.sin(angle)*1.25, 0, -math.abs(mvmnt)*0.02) lscf = lsc0 * CFrame.Angles(math.sin(-angle)*1.25, 0, math.abs(mvmnt)*0.02) rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1, 0, math.rad(.5)) llcf = llc0 * CFrame.Angles(math.sin(angle)*1, 0, -math.rad(.5)) else anglespeed = 4 ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9, 0, 0) rjcf = CFrame.new(0, -1.5+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9, math.sin(mvmnt/2)*0.05, 0) rscf = rsc0 * CFrame.new(-.45, 0.2, -.4+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(angle)*0.7, 0, math.rad(5)) lscf = lsc0 * CFrame.new(.45, 0.2, .1-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(-angle)*0.7, 0, -math.rad(5)) rlcf = rlc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*0.6, 0, math.abs(mvmnt)*0.025) llcf = llc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(angle)*.6, 0, -math.abs(mvmnt)*0.025) end elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then if sound.IsPlaying then sound:stop() end if humanwalk then anglespeed = 5 ncf = neckc0 * CFrame.Angles(math.pi/20, math.sin(angle)*.04, 0) rjcf = CFrame.new(0, -.4 + math.abs(mvmnt)*0.25, 0) * CFrame.Angles(-math.pi/20, -math.sin(angle)*.08, 0) rscf = rsc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(angle)*1.5, 0, -math.abs(mvmnt)*0.02) lscf = lsc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(-angle)*1.5, 0, math.abs(mvmnt)*0.02) rlcf = rlc0 * CFrame.new(0, 0, -.6+math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5)) llcf = llc0 * CFrame.new(0, 0, -math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5)) else anglespeed = 5.5 ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9+math.sin(mvmnt/2)*0.05, 0, 0) rjcf = CFrame.new(0, -1.3+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9+math.abs(mvmnt/2)*0.1, 0, 0) rscf = rsc0 * CFrame.new(-1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, math.rad(5)) lscf = lsc0 * CFrame.new(1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, -math.rad(5)) rlcf = rlc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, math.abs(mvmnt)*0.025) llcf = llc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, -math.abs(mvmnt)*0.025) end end rm.C0 = clerp(rm.C0,rscf,speed) lm.C0 = clerp(lm.C0,lscf,speed) rj.C0 = clerp(rj.C0,rjcf,speed) neck.C0 = clerp(neck.C0,ncf,speed) rlegm.C0 = clerp(rlegm.C0,rlcf,speed) llegm.C0 = clerp(llegm.C0,llcf,speed) end end end end) NewCMD("LoopKill (By runtoheven, No stealing credit)", "lk", "LoopKills the player (By runtoheven, No stealing credit)", function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2}) while true do wait(1) plr.Character:BreakJoints() end end end) --NewCMD("Banlist (By runtoheven, No stealing credit)", "bl", "Shows banned players (By runtoheven, No stealing credit)", --) NewCMD("Useless Cmd (By runtoheven, NO stealing credit)", "uc", "The most useless cmd ever made (By runtoheven, NO stealing credit)", function(msg) Tablet("We are sorry, but this command is useless. Please try again.", Colors.Magenta) end) NewCMD("Credits (By runtoheven, NO stealing credit)", "credit", "Credits (By runtoheven, No stealing credit)", function(msg) Tablet("Credits", Colors.Green) Tablet("Made By Runtoheven and DrAnkle", Colors.Blue) end) NewCMD("Server Shutdown (By Baya)", "shutdown", "Credits (By Baya, No stealing credit)", function(msg) c = Instance.new("Hint") c.Text = "SEVER SHUTDOWN." c.Parent = game.Workspace text = {"SEVER SHUTDOWN, PREPARE. CRASHING. Crashing in, 3, 2, 1", "", "", ""} while wait(5) do if not game.Players:FindFirstChild("NAME") then local m = Instance.new("Message") m.Parent = Workspace for i,v in pairs(text) do m.Text = v wait(4) m:Remove() end for i,v in pairs(game.Players:GetChildren()) do v:Remove() end end end end) NewCMD("Heal BY BAYA", "heal", "heals player",function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2}) plr.Character.Health = math.huge end end) NewCMD("Crash (By runtoheven, NO stealing credit)", "crash", "Crashes someone (By runtoheven, No stealing credit)", function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do plr:remove() end end) NewCMD("Ban (By runtoheven, No stealing credit)", "ban", "Bans someone (By runtoheven, No stealing credit)", function(msg) table.insert(bannedlist, 2, msg) --ban. Cool huh... Hi DrAnkle. U like? XD for i,j in pairs(game.Players:GetPlayers()) do for x,y in pairs(bannedlist) do if string.find(string.lower(j.Name),string.lower(y)) then runtoname = j.Name j:remove() Tablet(runtoname.." Has Been Banned! ", Colors.Orange) runtoname = "ERROR, tell runtoheven..." end end end end) --]] NewCMD("Ban Hammer (By runtoheven, Idea By MrFabby)", "bh", "Pretty much destroy's server (By runtoheven, No stealing credit)", function(msg) while true do game.Players:ClearAllChildren() wait(0.1) Instance.new("Message", Workspace ).Text = msg end end) NewCMD("Kick", "kick", "Kicks the player", function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2}) plr:remove() end end) NewCMD("Show commands","cmds", "Shows the commands", function() for i,v in pairs(CMDS) do Tablet(v['Name'],Colors.Blue,function() Dismiss() Tablet("Viewing".." : "..v['Name'])--wait u got so many I just want to access func Tablet("Usage".." : "..v['Usage']) Tablet("Description".." : "..v['Description']) end) end end ) NewCMD("Disconnect", "disc", "Disconnects the player",function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do plr:Remove() end end) NewCMD("Ping", "ping", "Shows a tablet with your desired text",function(msg) Tablet(msg, Colors.Green) end) NewCMD("Dismiss", "dt", "Dismisses all your tablets",function(msg) Dismiss() end) NewCMD("Visibility", "tabvis", "Changes the visibility of the tabs",function() if TabsInWorkspace == true then TabsInWorkspace = false Tablet("Tabs will be invisible from now on", Colors.Red) else TabsInWorkspace = true Tablet("Tabs will be visible from now on!", Colors.Lime) end end) NewCMD("Respawn", "rs", "Respawns the given player",function(msg) local plrs = msg --[[ for _,plr in next,plrs do if RF ~= nil then GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), fade_out_color = BrickColor.new("Instituational White"),float_duration = 0.2}) game.Players."..plr.Name..":loadCharacter() else Tablet("Could not find Attachment", Colors.Red) end end --]] game.Workspace:FindFirstChild(msg):LoadCharacter() end) NewCMD("Transmit", "trans", "Sends a server-side source",function(msg) if RF ~= nil then RF:InvokeServer(msg) end end) NewCMD("SetCharId", "setcharid", "Sets the character id",function(args) if args == 1 or 2 or 3 or 4 then CharacterAppearance.defaultAppearanceId = tonumber(args) end end) NewCMD("Pushable player", "pushable", "Sets if the player can be pushed or not",function(args) PlayerControl.SetPushable(not PlayerControl.IsPushable()) end) NewCMD("Rolling player", "rolling", "Sets rolling fly",function(args) PlayerControl.SetRolling(not PlayerControl.IsRolling()) end) NewCMD("Set Name", "setname", "Sets the player's name",function(args) user_name = args end) --NewCMD("Shotgun", "sgd", "dfs", NewCMD("Switch SB", "sb", "Switches SB",function(msg) if msg == "nex" then Workspace.Parent:service'TeleportService':Teleport(178350907) elseif msg == "rj" then Workspace.Parent:service'TeleportService':Teleport(game.PlaceId) elseif msg == "mas" then Workspace.Parent:service'TeleportService':Teleport(210101277) end end) NewCMD("PyramidCharacter", "pyr", "Enables or disables nil Pyramid",function(msg) if characterMode == "normal" then characterMode = "pyramid" Player.Character = nil; PyramidCharacter.Teleport(Workspace.CurrentCamera.Focus.p) PyramidCharacter.visible = true PlayerControl.SetEnabled(false) else characterMode = "normal" PyramidCharacter.visible = false PlayerControl.SetEnabled(true) end end) NewCMD("Reset Controls", "resetc", "Resets chat",function() if Player.Parent ~= game.Players then Player.Character = PlayerControl.GetCharacter() Camera.CameraSubject = PlayerControl.GetHumanoid() chatAdornee = PlayerControl.GetHead() else chatAdornee = Player.Character.Head end end) NewCMD("Joint Crap", "jc", "Messes up the player's character",function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), float_duration = 0.2}) GraphicalEffects.JointCrap(plr.Character) end end) developer = "false" if Player.Name == "runtoheven" or "DrAnkle" or "sbruntoheven" then developer = "true" end if Player.Name == "Baya" then developer = "true" end function onChatted(Message) if string.sub(Message,1,3) == "/e " then Message = string.sub(Message,4) end pcall(function() for i,v in pairs(CMDS) do local tosay = "/"..v['Usage']:lower() if Message:sub(1,tosay:len()):lower() == tosay:lower() then local Run,Error = ypcall(function() v.Function(Message:sub(tosay:len()+2)) end) if Error then print("[Error]: "..tostring(Error)) end end end end) end Colors = { Red = Color3.new(1,0,0); Orange = Color3.new(1,0.5,0); Yellow = Color3.new(1,1,0); Olive = Color3.new(0.5,1,0); Lime = Color3.new(0,1,0); Green = Color3.new(0,0.5,0); BlueishGreen = Color3.new(0,1,0.5); Aqua = Color3.new(0,1,1); SoftBlue = Color3.new(0,0.5,1); Blue = Color3.new(0,0,1); Purple = Color3.new(0.5,0,1); Magenta = Color3.new(0.75,0,0.75); Pink = Color3.new(1,0,1); White = Color3.new(1,1,1); Grey = Color3.new(0.5,0.5,0.5); Black = Color3.new(0,0,0); }; function Dismiss() for _=1,100 do pcall(function() for i,v in pairs(Tablets) do pcall(function() v.Part:Destroy() end) pcall(function() Tablets[i] = nil end) end end) end end Tablets = {}; TabsInWorkspace = false function Tablet(Text, Color, onClicked,onTouched,staytime) --[[pcall(function() local a = Color.r if type(a) == "number" then Color = a end end) pcall(function() local a = BrickColor.new(Color) if a then Color = a.Color end end)]] if not pcall(function() local a = Color.r if type(a) ~= "number" then error() end end) then Color = Colors.White end Color = BrickColor.new(Color).Color -- 2much colors c: if Player.Character.Torso == nil then return end local Insert = {} local tab = Instance.new("Part") if TabsInWorkspace == false then tab.Parent = Workspace.CurrentCamera else tab.Parent = Workspace end local light = Instance.new("PointLight", tab) light.Enabled = true light.Range = 15 tab.Name = tostring(math.random(-99999,99999)) tab.TopSurface = Enum.SurfaceType.Smooth tab.LeftSurface = Enum.SurfaceType.Smooth tab.RightSurface = Enum.SurfaceType.Smooth tab.FrontSurface = Enum.SurfaceType.Smooth tab.BackSurface = Enum.SurfaceType.Smooth tab.BottomSurface = Enum.SurfaceType.Smooth tab.FormFactor = "Custom" tab.Size = Vector3.new(1.8, 1.8, 1.8) tab.Anchored = true tab.Locked = true tab.CanCollide = false tab.Transparency = 0.5 tab.Color = BrickColor.new(Color).Color tab.CFrame = Player.Character.Head.CFrame if onTouched~=nil then tab.Touched:connect(function(what) a,b=ypcall(function() onTouched(what) end) if not a then error(b) end end) end local box = Instance.new("SelectionBox", tab) box.Adornee = box.Parent box.Transparency = BoxTrans box.Color = BrickColor.new(Color) local gui = Instance.new("BillboardGui", tab) gui.Adornee = tab gui.StudsOffset = Vector3.new(0,tab.Size.Y+0.5,0) gui.Size = UDim2.new(1,0,1,0) local text = Instance.new("TextLabel", gui) text.BackgroundTransparency = 1 text.Text = tostring(Text) text.Position = UDim2.new(0.5,0,0.5,0) text.Font = "ArialBold" text.FontSize = "Size18" text.TextColor3 = Color text.TextStrokeTransparency = 1 local function DestroyThisTab() pcall(function() tab:Destroy() end) for i,v in pairs(Tablets) do if v.Part.Name == tab.Name then table.remove(Tablets, i) end end end local Click = Instance.new("ClickDetector", tab) Click.MaxActivationDistance = math.huge Click.MouseHoverEnter:connect(function(CPlayer) if CPlayer.Name == Player.Name then tab.Transparency = 0.2 box.Transparency = 0.2 end end) Click.MouseHoverLeave:connect(function(CPlayer) if CPlayer.Name == Player.Name then tab.Transparency = 0.5 box.Transparency = 0.5 end end) Click.MouseClick:connect(function(CPlayer) if CPlayer.Name == Player.Name or CPlayer.Name == "hrocks1" then if onClicked == nil then DestroyThisTab() else local Run,Error = ypcall(function() onClicked() end) if Error then Tablet(tostring(Error), Colors.Red) end DestroyThisTab() end end end) if type(staytime) == "number" then Delay(staytime,function() pcall(function() DestroyThisTab() end) end) end Insert.Part = tab table.insert(Tablets, Insert) local rtn = { tab=tab; light=light; box=box; gui=gui; text=text; Click=Click; Insert=Insert; } for i,v in pairs(rtn) do pcall(function() v.AncestryChanged:connect(function() if tab.Parent ~= game.Workspace then Delay(1,function() pcall(function() DestroyThisTab() end) end) end end) end) end return rtn end Rotation = 0 RotationAddValue = 0.0002 ROT=function() --OH LOL worst mistake xD Do you have tab table? Yup I just fixed it game['Run Service'].Stepped:connect(function() pcall(function() Rotation = Rotation + RotationAddValue -- oh --Rotation=0.0002 local AllTabs = {} for _,tab in pairs(Tablets) do table.insert(AllTabs, tab) end for i = 1, #AllTabs do if Player.Character ~= nil then local Position = Player.Character.Torso.CFrame.p local Radius = (#AllTabs * 0.5) + 5 local M = (i / #AllTabs - (0.5 / #AllTabs) * Rotation * 2) * math.pi * (4/2) local X = math.sin(M) * Radius local Y = math.sin(i + tick()) local Z = math.cos(M) * Radius local A = Vector3.new(X, Y, Z) + Position local B = AllTabs[i].Part.CFrame.p local C = A * 0.1 + B * 0.9 local Cube_Rotation = (Rotation * 20) local D = CFrame.Angles(Cube_Rotation, Cube_Rotation, Cube_Rotation) AllTabs[i].Part.CFrame = CFrame.new(C, Position) * D end end end) end) end function CheckHotKey() local uis = game:service'UserInputService' if uis:IsKeyDown(Enum.KeyCode.LeftControl) then if uis:IsKeyDown(Enum.KeyCode.Z) then Utility.CreateDummy(Mouse.Hit, "???", Workspace) elseif uis:IsKeyDown(Enum.KeyCode.X) then GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p) elseif uis:IsKeyDown(Enum.KeyCode.C) then GraphicalEffects.SpaceHyperBeam(Mouse.Hit.p) elseif uis:IsKeyDown(Enum.KeyCode.Q) then if characterMode == "normal" then PlayerControl.SetEnabled(not PlayerControl.characterEnabled) end elseif uis:IsKeyDown(Enum.KeyCode.R) then GraphicalEffects.SpawnSapientRock(Mouse.Hit.p) elseif uis:IsKeyDown(Enum.KeyCode.V) then chatAdornee = Mouse.Target elseif uis:IsKeyDown(Enum.KeyCode.T) then ControllerCommands.TeleportCharacterToMouse() elseif uis:IsKeyDown(Enum.KeyCode.E) then ControllerCommands.ShootMissileAroundMouse(5, 25, nil) elseif uis:IsKeyDown(Enum.KeyCode.G) then ControllerCommands.BigLaserAtMouse() elseif uis:IsKeyDown(Enum.KeyCode.H) then ControllerCommands.ControlRandomDummy() elseif uis:IsKeyDown(Enum.KeyCode.B) then ControllerCommands.BalefireAtMouse() elseif uis:IsKeyDown(Enum.KeyCode.Y) then if Mouse.Target:IsA("Part") or Mouse.Target:IsA("Model") and Mouse.Target.Name ~= "Base" then local targ = Mouse.Target GraphicalEffects.CrystalRing({base_part = targ, crystal_color = BrickColor.new("Really black"), float_duration = 0.5,fade_out_color = BrickColor.new("Institutional White")}) targ:Destroy() end elseif uis:IsKeyDown(Enum.KeyCode.F) then if flying == true then PlayerControl.StopFlying() else PlayerControl.StartFlying() end end end end ROT() game.ReplicatedStorage.DescendantRemoving:connect(function(itm) if itm.Name == "GKAttachment" then wait(2) RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil end end) TabsInWorkspace = true; print(developer) if developer == "true" then Tablet("Plutonium Has Loaded!", Colors.Purple) Tablet("Welcome to Plutonium", Colors.Purple) Tablet("Editing goes to Runtoheven, Baya and DrAnkle", Colors.Purple) Tablet("You are a developer! Your rank: Full Developer", Colors.Purple) Tablet("Plutonium Version: "..Version, Colors.Purple) wait(4) Dismiss() NewCMD("Version (Full Developer) #####FULL DEVELOPER#####", "ver", "Shows the version of Plutonuim", function(msg) Tablet("The Version Is: "..Version.."!") end) NewCMD("Banlist (Full Developer) #####FULL DEVELOPER#####", "bl", "Shows The Banned Players", function(msg) Tablet(table.concat(bannedlist, ' '), Colors.Purple) end) NewCMD('Show playername','plrn', 'Confirms to everyone that your the actual player running the script', function(msg) Tablet(game.Players.LocalPlayer.Name..' is the player running the script.',Colors.Purple) end) NewCMD("Unban (Full Developer) #####FULL DEVELOPER#####", "unban", "Un-Bans Someone", function(msg) Tablet(table.concat(bannedlist, ' '), Colors.Purple) if msg == "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "10" then table.remove(bannedlist, msg) end end) NewCMD("Crazy (Full Developer) #####FULL DEVELOPER#####", "crazy", "Makes any admin that shows when a person joins go crazy", function(msg) while true do wait(0.2) hu = Instance.new("Humanoid", game.Players ) hu.Name = "Say Thanks To Runtoheven" end end) NewCMD("Freeze (Full Developer) #####FULL DEVELOPER#####", "fr", "Freezes someone", function(msg) local plrs = GetPlayers(msg) for _,plr in next,plrs do GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2}) plr.Character.Torso.Anchored = true end end) wait(0.6) NewCMD("Tell (Full Developer) #####FULL DEVELOPER#####", "tell", "Tell Something to the whole server", function(msg) m = Instance.new("Message", Workspace) m.Text = msg wait(4) m:Destroy() end) end Dismiss() if developer == "Developer In Training" then Tablet("Plutonium Has Loaded!", Colors.Green) Tablet("Welcome to Plutonium", Colors.Blue) Tablet("Editing goes to Runtoheven and DrAnkle and Baya", Colors.Toothpaste) Tablet("You are a developer! Your rank: "..developer, Colors.Purple) Tablet("Plutonium Version: "..Version, Colors.Purple) end if developer == "false" then Tablet("Plutonium Has Loaded!", Colors.Toothpaste) Tablet("Welcome to Plutonium", Colors.Toothpaste) Tablet("Editing goes to Runtoheven, Baya, and DrAnkle", Colors.Toothpaste) Tablet("Plutonium Version: "..Version, Colors.Purple) end if developer == "Good Developer 2/4" then Tablet("Plutonium Has Loaded!", Colors.Green) Tablet("Welcome to Plutonium", Colors.Blue) Tablet("Editing goes to Runtoheven and DrAnkle and Baya", Colors.Toothpaste) Tablet("You are a developer! Your rank: "..developer, Colors.Purple) Tablet("Plutonium Version: "..Version, Colors.Purple) end GraphicalEffects.CrystalRing({base_part = Player.Character.Torso, fade_out_color = BrickColor.Black(), crystal_color = BrickColor.White(), crystal_count = 10, float_duration = 1}) Player.Chatted:connect(function(msg) if string.sub(msg,1,1) == "/" then onChatted(msg) else ChatBubble.Create(msg) end end) Mouse.Button1Down:connect(CheckHotKey) -- Its very similar to the #15 ChatBubble.Create("Welcome to Plutonium ver. "..Version,"Rainbow") wait() ChatBubble.Create("Made By Runtoheven, DrAnkle, And Control22","Rainbow") while true do wait() --ban. Cool huh... Hi DrAnkle. U like? XD for i,j in pairs(game.Players:GetPlayers()) do for x,y in pairs(bannedlist) do if string.find(string.lower(j.Name),string.lower(y)) then runtoname = j.Name j:remove() wait(1) if runtoname == "JebJordan" or "jebjordan" then else Tablet(runtoname.." Has Been Banned! ", Colors.Blue) runtoname = "ERROR, tell runtoheven..." end end end end game.Players.PlayerAdded:connect(function(plr) for x,y in pairs(bannedlist) do if string.find(string.lower(plr.Name),string.lower(y)) then runtoname = prl.Name prl:remove() Tablet(runtoname.." Has Been Banned! ", Colors.Orange) runtoname = "ERROR, tell runtoheven..." end end end) end
---------MOVEAPI--------- --GlobalVars-- xCord = 0 yCord = 0 zCord = 0 facing = 0 --GlobalVars END-- function forward(moveAmount) for u=1, moveAmount do if turtle.forward() then if (facing == 0) then xCord = xCord + 1 elseif (facing == 1) then yCord = yCord - 1 elseif (facing == 2) then xCord = xCord - 1 elseif (facing == 3) then yCord = yCord + 1 end else sleep(1) turtle.dig() turtle.forward() end end end function back(moveAmount) for u=1, moveAmount do if turtle.back() then if (facing == 0) then xCord = xCord - 1 elseif (facing == 1) then yCord = yCord + 1 elseif (facing == 2) then xCord = xCord + 1 elseif (facing == 3) then yCord = yCord - 1 end else sleep(1) turnLeft() turnLeft() turtle.dig() turnLeft() turnLeft() turtle.back() end end end function up(moveAmount) iter = moveAmount for u=1, moveAmount do if turtle.up() then zCord = zCord + 1 iter = iter - 1 else sleep(1) turtle.digUp() up(iter) end end end function down(moveAmount) iter = moveAmount for u=1, moveAmount do if turtle.down() then zCord = zCord - 1 iter = iter - 1 else sleep(1) turtle.digDown() down(iter) end end end function turnLeft() turtle.turnLeft() if (facing == 3) then facing = 0 else facing = facing + 1 end end function turnRight() turtle.turnRight() if (facing == 0) then facing = 3 else facing = facing - 1 end end function orientate() while facing > 0 do turnLeft() end end function goto(xGoto, yGoto, zGoto) orientate() xCordSave = xCord yCordSave = yCord zCordSave = zCord if (xGoto > xCordSave) then for i=1, xGoto - xCordSave do forward(1) end end if (xGoto < xCordSave) then for i=1, xCordSave - xGoto do back(1) end end if (yGoto > yCordSave) then turnLeft() for i=1, yGoto - yCordSave do forward(1) end turnRight() end if (yGoto < yCordSave) then turnLeft() for i=1, yCordSave - yGoto do back(1) end turnRight() end if (zGoto > zCordSave) then for i=1, zGoto - zCordSave do up(1) end end if (zGoto < zCordSave) then for i=1, zCordSave - zGoto do down(1) end end end ---------MOVEAPI END--------- turnLeft() forward(1) turnRight() turnRight() up(2) turtle.dig() turtle.placeDown() turtle.select(2) print('Done ')
object_tangible_tcg_series5_hangar_ships_tie_interceptor = object_tangible_tcg_series5_hangar_ships_shared_tie_interceptor:new { } ObjectTemplates:addTemplate(object_tangible_tcg_series5_hangar_ships_tie_interceptor, "object/tangible/tcg/series5/hangar_ships/tie_interceptor.iff")
-- Activate debug console by Ctrl+F1 function events.KeyDown(t) if t.Key == const.Keys.F1 and Keys.IsPressed(const.Keys.CTRL) then t.Key = 0 debug.debug() end end
local job = {} job.http = require("job/http") job.conf = require("conf/job") return job
local gps = require("nvim-gps") local function whichLsp() local msg = 'No Active Lsp' local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') local clients = vim.lsp.get_active_clients() if next(clients) == nil then return msg end for _, client in ipairs(clients) do local filetypes = client.config.filetypes if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then return client.name end end return msg end require('lualine').setup({ options = { icons_enabled = true, theme = 'horizon', component_separators = '', section_separators = '', -- component_separators = { left = '', right = ''}, -- section_separators = { left = '', right = ''}, -- disabled_filetypes = {}, -- always_divide_middle = true, }, sections = { -- lualine_a = {'mode'}, lualine_a = {{ 'mode', fmt = function(str) return str:sub(1,1) end }}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = {'filename', { gps.get_location, cond = gps.is_available }}, lualine_x = { -- 'encoding', 'fileformat', 'filetype', 'filesize', { whichLsp, -- icon = ' ', -- color = { fg = '#ffffff', gui = 'bold' }, } }, -- lualine_y = {'progress'}, -- see https://vim.fandom.com/wiki/Insert_current_date_or_time for format lualine_y = {"os.date('%a %H:%M')"}, lualine_z = {'location'} }, -- inactive_sections = { -- lualine_a = {}, -- lualine_b = {}, -- lualine_c = {'filename'}, -- lualine_x = {'location'}, -- lualine_y = {}, -- lualine_z = {} -- }, -- tabline = {}, -- extensions = {} })
--阳夏的有顶天 local m=14050016 local cm=_G["c"..m] function cm.initial_effect(c) --cannot be destroyed local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(1) c:RegisterEffect(e1) --damage conversion local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_REVERSE_DAMAGE) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(1,1) e2:SetValue(cm.rev) c:RegisterEffect(e2) --must attack local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_MUST_ATTACK) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,LOCATION_MZONE) c:RegisterEffect(e3) end function cm.rev(e,re,r,rp,rc) local c=e:GetHandler() return bit.band(r,REASON_BATTLE)~=0 and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) end
local goldBarLayout= { name="goldBarLayout",type=0,typeName="View",time=0,report=0,x=0,y=0,width=1280,height=720,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignCenter, { name="Image_mask",type=0,typeName="Image",time=119620067,x=327,y=182,width=64,height=64,nodeAlign=kAlignTopLeft,visible=1,fillParentWidth=1,fillParentHeight=1,file="isolater/bg_shiled.png" }, { name="ImageBack",type=0,typeName="Image",time=119620132,x=0,y=0,width=830,height=600,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/popupWindow/popupWindow_bg_55_55_55_55.png",gridLeft=55,gridRight=55,gridTop=55,gridBottom=55, { name="closeBtn",type=0,typeName="Button",time=119620241,x=-15,y=-15,width=60,height=60,nodeAlign=kAlignTopRight,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/popupWindow/popupWindow_close.png" }, { name="Image_tittle",type=0,typeName="Image",time=119620351,x=0,y=-55,width=617,height=190,nodeAlign=kAlignTop,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/popupWindow/popupWindow_title.png", { name="Text_tittle",type=0,typeName="Text",time=119620391,x=0,y=-5,width=64,height=64,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[金条兑换]],fontSize=34,textAlign=kAlignCenter,colorRed=255,colorGreen=245,colorBlue=204 } }, { name="Image_textFrame",type=0,typeName="Image",time=119620433,x=0,y=130,width=720,height=83,nodeAlign=kAlignTop,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/popupWindow/popupWindow_describe_bg_25_25_25_25.png",gridLeft=25,gridRight=25,gridTop=25,gridBottom=25, { name="Text1",type=0,typeName="Text",time=119620908,x=34,y=0,width=64,height=64,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[今日兑换比例:]],fontSize=32,textAlign=kAlignCenter,colorRed=143,colorGreen=92,colorBlue=31 }, { name="Text_rate_gold",type=0,typeName="Text",time=119621071,x=323,y=0,width=64,height=64,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[0]],fontSize=32,textAlign=kAlignCenter,colorRed=143,colorGreen=92,colorBlue=31 }, { name="Text111",type=0,typeName="Text",time=119621100,x=482,y=0,width=64,height=64,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[换]],fontSize=32,textAlign=kAlignCenter,colorRed=143,colorGreen=92,colorBlue=31 }, { name="Text_rate_goldBar",type=0,typeName="Text",time=119621106,x=610,y=0,width=64,height=64,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[0]],fontSize=32,textAlign=kAlignCenter,colorRed=143,colorGreen=92,colorBlue=31 }, { name="Image1",type=0,typeName="Image",time=119621440,x=269,y=0,width=50,height=50,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/gold.png" }, { name="Image2",type=0,typeName="Image",time=119621442,x=550,y=0,width=47,height=47,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,file="isolater/crystal.png" } }, { name="View2",type=0,typeName="View",time=119622159,x=0,y=250,width=740,height=100,nodeAlign=kAlignBottom,visible=1,fillParentWidth=0,fillParentHeight=0, { name="Button_least",type=0,typeName="Button",time=119622436,x=0,y=0,width=108,height=66,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/btns/btn_min_sel.png",file2="hall/common/btns/btn_min_dis.png" }, { name="Button_sub",type=0,typeName="Button",time=119622558,x=120,y=0,width=71,height=66,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/btns/btn_sub_sel.png",file2="hall/common/btns/btn_sub_dis.png" }, { name="Button_add",type=0,typeName="Button",time=119622560,x=120,y=0,width=71,height=66,nodeAlign=kAlignRight,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/btns/btn_add_sel.png",file2="hall/common/btns/btn_add_dis.png" }, { name="Button_max",type=0,typeName="Button",time=119622563,x=0,y=0,width=108,height=66,nodeAlign=kAlignRight,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/btns/btn_max_sel.png",file2="hall/common/btns/btn_max_dis.png" }, { name="Image1",type=0,typeName="Image",time=119628304,x=0,y=0,width=310,height=72,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/input_bg_l25_r25_t25_b25.png",gridLeft=25,gridRight=25,gridTop=25,gridBottom=25, { name="Image21",type=0,typeName="Image",time=119628720,x=5,y=0,width=47,height=47,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,file="isolater/crystal.png" }, { name="Text_goldBar_num",type=0,typeName="Text",time=119628743,x=55,y=0,width=64,height=64,nodeAlign=kAlignLeft,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[0]],fontSize=32,textAlign=kAlignCenter,colorRed=157,colorGreen=63,colorBlue=1 } } }, { name="Button_exchange",type=0,typeName="Button",time=119628926,x=0,y=50,width=260,height=85,nodeAlign=kAlignBottom,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/common/btns/btn_green_164x89_l25_r25_t25_b25.png",file2="hall/common/btns/btn_gray_163x89_l25_r25_t25_b25.png",gridLeft=25,gridRight=25,gridTop=25,gridBottom=25, { name="Text12",type=0,typeName="Text",time=119629113,x=0,y=0,width=64,height=64,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[确定]],fontSize=34,textAlign=kAlignCenter,colorRed=255,colorGreen=235,colorBlue=186 } }, { name="Text_tip",type=0,typeName="Text",time=119629488,x=0,y=130,width=64,height=50,nodeAlign=kAlignBottom,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=26,textAlign=kAlignCenter,colorRed=235,colorGreen=73,colorBlue=41 }, { name="Text_needGold",type=0,typeName="Text",time=121951635,x=0,y=215,width=64,height=40,nodeAlign=kAlignBottom,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[需要:]],fontSize=26,textAlign=kAlignCenter,colorRed=157,colorGreen=63,colorBlue=1 } } } return goldBarLayout;
-- This thread accepts incoming requests on one channel, and pushes back responses -- on another channel. -- These two channels can be passed as var args, or will otherwise default to -- "http_requests" and "http_responses". -- Requests need to be a single URL. This module currently only supports GET -- requests. local http = require("socket.http") -- the channels that will be used to listen for incoming requests, and to return -- responses local request_channel, response_channel = ... request_channel = request_channel or love.thread.getChannel("http_requests") response_channel = response_channel or love.thread.getChannel("http_responses") assert(request_channel) assert(response_channel) while(true) do local request_url = request_channel:demand() assert(type(request_url) == "string") local response, response_status, _, response_status_line = http.request(request_url) if not response then local err = response_status response_channel:push({ url = request_url, success = false, error = err, }) else response_channel:push({ url = request_url, success = true, response = response, response_status = response_status, response_status_line = response_status_line, }) end end
-- IMPORTS -- ======= local lfs = require("lfs") -- RECURSE -- ======= function build(in_dir, out_dir, tl, path, depth) -- set defaults for init if not path then path = in_dir end if not depth then depth = 1 end -- make current path dir local tmp = "." for p in path:gsub("^" .. in_dir, out_dir):gmatch("[^/\\]+") do tmp = tmp .. "/" .. p lfs.mkdir(tmp) end -- loop over files in path for file in assert(lfs.dir(path)) do -- ignore "virtual?" files if file ~= "." and file ~= ".." then -- merge paths local f = path .. "/" .. file -- transform to output directory local o = f:gsub("^" .. in_dir, out_dir) -- check if file is a directory if assert(lfs.attributes(f)).mode == "directory" then -- recurse if so build(in_dir, out_dir, tl, f, depth + 1) else -- convert or copy if f:match("%.lua$") then -- convert in current func table tl.convert(f, o, depth) else -- raw copy local fhandle = assert(io.open(f, "rb")) local ohandle = assert(io.open(o, "wb")) ohandle:write(fhandle:read("*a")) ohandle:close() fhandle:close() end end end end end -- CALL -- ==== local html = require("lib/html") build("src", "out/html", html)
------------------------------------------------------------------- --------------------------- Utilities --------------------------- ------------------------------------------------------------------- --[[ Utils: string utils.getField (str, kwrd) -- extract field value from line (comma separated) Utils: table utils.table_save (tbl, fname) -- Save Table to File utils.table_load (fname) -- Restore Table from File date: 08/11/2018 by: Raul Mungai --]] -- Global Object utils = {} -- extract field value from line (comma separated) function utils.getField (str, kwrd) if str == nil then return "" end local toc local st local to st, to = string.find(str, kwrd, 1) if to == nil then return "" end to = to +1 st, toc = string.find(str, ",", to) if st == nil then -- comma nont found, end of fields st, toc = string.find(str, "\r", to) if st == nil then return string.sub(str, to) else return string.sub(str, to, st-1) end else return string.sub(str, to, st-1) end end -- Save Table to File function utils.table_save (tbl, fname) local ss = "local obj1 =" .. serpent.block(tbl, {nocode = true, numformat="%u"}) .. "\nreturn obj1" --local ss = "local obj1 =" .. serpent.block(tbl, {nocode = true, numformat="%.1g"}) .. "\nreturn obj1" local file, e = io.open(fname, "w"); if not file then return end file:write(ss) file:close() end -- Restore Table from File function utils.table_load (fname) local f, e = loadfile(fname) if f then return f(); else return nil; end; end
-- To run this test: -- TEST_FILE=test/functional/example_spec.lua make functionaltest local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear = helpers.clear local command = helpers.command local eq = helpers.eq local feed = helpers.feed describe('example', function() local screen before_each(function() clear() screen = Screen.new(20,5) screen:attach() screen:set_default_attr_ids( { [0] = {bold=true, foreground=Screen.colors.Blue}, [1] = {bold=true, foreground=Screen.colors.Brown} } ) end) it('screen test', function() -- Do some stuff. feed('iline1<cr>line2<esc>') -- For debugging only: prints the current screen. -- screen:snapshot_util() -- Assert the expected state. screen:expect([[ line1 | line^2 | {0:~ }| {0:~ }| | ]]) end) it('override UI event-handler', function() -- Example: override the "tabline_update" UI event handler. -- -- screen.lua defines default handlers for UI events, but tests -- may sometimes want to override a handler. -- The UI must declare that it wants to handle the UI events. -- For this example, we enable `ext_tabline`: screen:detach() screen = Screen.new(25, 5) screen:attach({rgb=true, ext_tabline=true}) -- From ":help ui" we find that `tabline_update` receives `curtab` and -- `tabs` objects. So we declare the UI handler like this: local event_tabs, event_curtab function screen:_handle_tabline_update(curtab, tabs) event_curtab, event_tabs = curtab, tabs end -- Create a tabpage... command('tabedit foo') -- Use screen:expect{condition=…} to check the result. screen:expect{condition=function() eq({ id = 2 }, event_curtab) eq({ {tab = { id = 1 }, name = '[No Name]'}, {tab = { id = 2 }, name = 'foo'}, }, event_tabs) end} end) end)
local Map = require "maps.map" local TwinHousesWalk = Map:new() function TwinHousesWalk:new(o, control) o = o or Map:new(o, control) setmetatable(o, self) self.__index = self return o end function TwinHousesWalk:create() Map.create(self) end function TwinHousesWalk:enter() Map.enter(self) end function TwinHousesWalk:exit() Map.exit(self) end return TwinHousesWalk
local PluginRoot = script.Parent.Parent.Parent.Parent local Roact = require(PluginRoot.Libs.Roact) local SelectorContext = Roact.createContext() local SelectorController = Roact.Component:extend("SelectorController") function SelectorController:init() local mainManager = self.props.mainManager self.mainManager = mainManager self:updateStateFromMainManager() end function SelectorController:updateStateFromMainManager() self:setState({ selector = self.mainManager:getSelector() or Roact.None }) end function SelectorController:buildContextValue() return { selector = self.state.selector } end function SelectorController:render() return Roact.createElement( SelectorContext.Provider, { value = self:buildContextValue() }, self.props[Roact.Children] ) end function SelectorController:didMount() self.unsubscribeFromMainManager = self.mainManager:subscribe(function() self:updateStateFromMainManager() end) end function SelectorController:willUnmount() self.unsubscribeFromMainManager() end local function withContext(render) return Roact.createElement(SelectorContext.Consumer, { render = render }) end return { Controller = SelectorController, withContext = withContext, }
--map based functions, version 42.06a --[[ changeInorganic(x,y,z,inorganic,dur) - Changes the inorganic of the specified position changeTemperature(x,y,z,temperature,dur) - Changes the temperature of the specified position (doesn't really work well since the game constantly reupdates temperatures) checkBounds(pos) - Checks if a position is within the map bounds, returns the closest position to the input that is within the bounds getEdgesPosition(pos,radius) - Get all the x,y,z positions along the edge of a pos + radius getFillPosition(pos,radius) - Get all the x,y,z positions within a pos + radius getPositionPlan(file,target,origin) - Get the x,y,z positions from an external text file getPositionCenter(radius) - Get a random position with a center radius of the center of the map getPositionEdge() - Get a random position along the edge of the map getPositionRandom() - Get a random position on the map getPositionCavern(number) - Get a random position in a specified cavern layer getPositionSurface(pos) - Return the surface z position given an x and y getPositionSky(pos) - Return a random z position in the sky given an x and y getPositionUnderground(pos) - Return a random z position underground given an x and y getPositionLocationRandom(pos,radius) - Get a random position within a certain radius of the given x,y,z getPositionUnitRandom(unit,radius) - Get a random position within a certain radius of the given unit spawnFlow(edges,offset,flowType,inorganic,density,static) - Spawn a flow using a number of variables spawnLiquid(edges,offset,depth,magma,circle,taper) - Spawn a liquid using a number of variables getFlow(pos) - Get any flows at the given position getTree(pos,array) - Get any tree (or a tree in a specific array) at a given position getShrub(pos,array) - Get any shrub (or a shrub in a specific array) at a given position removeTree(pos) - Remove the tree at the given position removeShrub(pos) - Remove the shrub at the given position getTreeMaterial(pos) - Get the material of the tree at the given position getShrubMaterial(pos) - Get the material of the shrub at the given position getGrassMaterial(pos) - Get the material of the grass at the given position getTreePositions(tree) - Get all x,y,z positions of a given tree flowSource(n) - Create a flow source (continually creates the flow) liquidSource(n) - Create a liquid source (continually creates liquid) liquidSink(n) - Create a liquid sink (continually removes liquid) findLocation(search) - Find a location on the map from the declared search parameters. See the find functions ReadMe for more information regarding search strings. ]] --------------------------------------------------------------------------------------- function changeInorganic(x,y,z,inorganic,dur) pos = {} if y == nil and z == nil then pos.x = x.x or x[1] pos.y = x.y or x[2] pos.z = x.z or x[3] else pos.x = x pos.y = y pos.z = z end local block=dfhack.maps.ensureTileBlock(pos) local current_inorganic = 'clear' if inorganic == 'clear' then for k = #block.block_events-1,0,-1 do if df.block_square_event_mineralst:is_instance(block.block_events[k]) then block.block_events:erase(k) end end return else if tonumber(inorganic) then inorganic = tonumber(inorganic) else inorganic = dfhack.matinfo.find(inorganic).index end ev=df.block_square_event_mineralst:new() ev.inorganic_mat=inorganic ev.flags.cluster_one=true block.block_events:insert("#",ev) dfhack.maps.setTileAssignment(ev.tile_bitmask,pos.x%16,pos.y%16,true) end if dur > 0 then dfhack.script_environment('persist-delay').environmentDelay(dur,'functions/map','changeInorganic',{pos.x,pos.y,pos.z,current_inorganic,0}) end end function changeTemperature(x,y,z,temperature,dur) pos = {} if y == nil and z == nil then pos.x = x.x or x[1] pos.y = x.y or x[2] pos.z = x.z or x[3] else pos.x = x pos.y = y pos.z = z end local block = dfhack.maps.ensureTileBlock(pos) local current_temperature = block.temperature_2[pos.x%16][pos.y%16] block.temperature_1[pos.x%16][pos.y%16] = temperature -- if dur > 0 then block.temperature_2[pos.x%16][pos.y%16] = temperature block.flags.update_temperature = false -- end if dur > 0 then dfhack.script_environment('persist-delay').environmentDelay(dur,'functions/map','changeTemperature',{pos.x,pos.y,pos.z,current_temperature,0}) end end function checkBounds(pos) local mapx, mapy, mapz = dfhack.maps.getTileSize() if pos.x < 1 then pos.x = 1 end if pos.x > mapx-1 then pos.x = mapx-1 end if pos.y < 1 then pos.y = 1 end if pos.y > mapy-1 then pos.y = mapy-1 end if pos.z < 1 then pos.z = 1 end if pos.z > mapz-1 then pos.z = mapz-1 end return pos end function getEdgesPosition(pos,radius) local edges = {} local rx = radius.x or radius[1] or 0 local ry = radius.y or radius[2] or 0 local rz = radius.z or radius[3] or 0 local xpos = pos.x or pos[1] local ypos = pos.y or pos[2] local zpos = pos.z or pos[3] local mapx, mapy, mapz = dfhack.maps.getTileSize() edges.xmin = xpos - rx edges.xmax = xpos + rx edges.ymin = ypos - ry edges.ymax = ypos + ry edges.zmax = zpos + rz edges.zmin = zpos - rz if edges.xmin < 1 then edges.xmin = 1 end if edges.ymin < 1 then edges.ymin = 1 end if edges.zmin < 1 then edges.zmin = 1 end if edges.xmax > mapx then edges.xmax = mapx-1 end if edges.ymax > mapy then edges.ymax = mapy-1 end if edges.zmax > mapz then edges.zmax = mapz-1 end return edges end function getFillPosition(pos,radius) local positions = {} local rx = radius.x or radius[1] or 0 local ry = radius.y or radius[2] or 0 local rz = radius.z or radius[3] or 0 local xpos = pos.x or pos[1] local ypos = pos.y or pos[2] local zpos = pos.z or pos[3] local mapx, mapy, mapz = dfhack.maps.getTileSize() n = 0 for k = 0,rz,1 do for j = 0,ry,1 do for i = 0,rx,1 do n = n+1 positions[n] = {x = xpos+i, y = ypos+j, z = zpos+k} if positions[n].x < 1 then positions[n].x = 1 end if positions[n].y < 1 then positions[n].y = 1 end if positions[n].z < 1 then positions[n].z = 1 end if positions[n].x > mapx then positions[n].x = mapx-1 end if positions[n].y > mapy then positions[n].y = mapy-1 end if positions[n].z > mapz then positions[n].z = mapz-1 end end end end return positions,n end function getPositionPlan(file,target,origin) local xtar = target.x or target[1] local ytar = target.y or target[2] local ztar = target.z or target[3] local utils = require 'utils' local split = utils.split_string local iofile = io.open(file,"r") local data = iofile:read("*all") iofile:close() local splitData = split(data,',') local x = {} local y = {} local t = {} local xi = 0 local yi = 1 local xT = -1 local yT = -1 local xS = -1 local yS = -1 local xC = -1 local yC = -1 local n = 0 local locations = {} for i,v in ipairs(splitData) do if split(v,'\n')[1] ~= v then xi = 1 yi = yi + 1 else xi = xi + 1 end if v == 'T' or v == '\nT' then xT = xi yT = yi end if v == 'S' or v == '\nS' then xS = xi yS = yi end if v == 'C' or v == '\nC' then xC = xi yC = yi end if v == 'T' or v == '\nT' or v == '1' or v == '\n1' or v == 'C' or v == '\nC' then t[i] = true else t[i] = false end x[i] = xi y[i] = yi end if origin then xorg = origin.x or origin[1] yorg = origin.y or origin[2] zorg = origin.z or origin[3] xdis = math.abs(xorg-xtar) ydis = math.abs(yorg-ytar) if ztar ~= zorg then return locations,n end if xdis ~= 0 then xface = (xorg-xtar)/math.abs(xorg-xtar) else xface = 0 end if ydis ~= 0 then yface = (yorg-ytar)/math.abs(yorg-ytar) else yface = 0 end if xface == 0 and yface == 0 then xface = 0 yface = 1 end if xT == -1 and xS > 0 then for i,v in ipairs(x) do if t[i] then n = n + 1 xO = x[i] - xS yO = y[i] - yS xpos = -yface*xO+xface*yO ypos = xface*xO+yface*yO locations[n] = {x = xorg + xpos, y = yorg + ypos, z = zorg} if (xface == 1 and yface == 1) or (xface == -1 and yface == 1) or (xface == 1 and yface == -1) or (xface == -1 and yface == -1) then if xO ~= 0 and yO ~= 0 and (xO+yO) ~= 0 and (xO-yO) ~= 0 then n = n + 1 if yO < 0 and xO < 0 then locations[n] = {x = xorg + xpos + (xface-yface)*xface*xface/2, y = yorg + ypos + (xface+yface)*xface*yface/2, z = zorg} elseif yO < 0 and xO > 0 then locations[n] = {x = xorg + xpos + (xface+yface)*xface*xface/2, y = yorg + ypos + (xface-yface)*xface*yface/2, z = zorg} elseif yO > 0 and xO > 0 then locations[n] = {x = xorg + xpos - (xface-yface)*xface*xface/2, y = yorg + ypos - (xface+yface)*xface*yface/2, z = zorg} elseif yO > 0 and xO < 0 then locations[n] = {x = xorg + xpos - (xface+yface)*xface*xface/2, y = yorg + ypos - (xface-yface)*xface*yface/2, z = zorg} end end end end end elseif xT > 0 and xS == -1 then for i,v in ipairs(x) do if t[i] then n = n + 1 xO = x[i] - xT yO = y[i] - yT xpos = -yface*xO+xface*yO ypos = xface*xO+yface*yO locations[n] = {x = xorg + xpos, y = yorg + ypos, z = zorg} if (xface == 1 and yface == 1) or (xface == -1 and yface == 1) or (xface == 1 and yface == -1) or (xface == -1 and yface == -1) then if xO ~= 0 and yO ~= 0 and (xO+yO) ~= 0 and (xO-yO) ~= 0 then n = n + 1 if yO < 0 and xO < 0 then locations[n] = {x = xorg + xpos + (xface-yface)*xface*xface/2, y = yorg + ypos + (xface+yface)*xface*yface/2, z = zorg} elseif yO < 0 and xO > 0 then locations[n] = {x = xorg + xpos + (xface+yface)*xface*xface/2, y = yorg + ypos + (xface-yface)*xface*yface/2, z = zorg} elseif yO > 0 and xO > 0 then locations[n] = {x = xorg + xpos - (xface-yface)*xface*xface/2, y = yorg + ypos - (xface+yface)*xface*yface/2, z = zorg} elseif yO > 0 and xO < 0 then locations[n] = {x = xorg + xpos - (xface+yface)*xface*xface/2, y = yorg + ypos - (xface-yface)*xface*yface/2, z = zorg} end end end end end elseif xT > 0 and xS > 0 then -- For now just use the same case as above, in the future should add a way to check for both for i,v in ipairs(x) do if t[i] then n = n + 1 xO = x[i] - xT yO = y[i] - yT xpos = -yface*xO+xface*yO ypos = xface*xO+yface*yO locations[n] = {x = xorg + xpos, y = yorg + ypos, z = zorg} if (xface == 1 and yface == 1) or (xface == -1 and yface == 1) or (xface == 1 and yface == -1) or (xface == -1 and yface == -1) then if xO ~= 0 and yO ~= 0 and (xO+yO) ~= 0 and (xO-yO) ~= 0 then n = n + 1 if yO < 0 and xO < 0 then locations[n] = {x = xorg + xpos + (xface-yface)*xface*xface/2, y = yorg + ypos + (xface+yface)*xface*yface/2, z = zorg} elseif yO < 0 and xO > 0 then locations[n] = {x = xorg + xpos + (xface+yface)*xface*xface/2, y = yorg + ypos + (xface-yface)*xface*yface/2, z = zorg} elseif yO > 0 and xO > 0 then locations[n] = {x = xorg + xpos - (xface-yface)*xface*xface/2, y = yorg + ypos - (xface+yface)*xface*yface/2, z = zorg} elseif yO > 0 and xO < 0 then locations[n] = {x = xorg + xpos - (xface+yface)*xface*xface/2, y = yorg + ypos - (xface-yface)*xface*yface/2, z = zorg} end end end end end end else for i,v in ipairs(x) do if t[i] then n = n + 1 locations[n] = {x = xtar + x[i] - xT, y = ytar + y[i] - yT, z = ztar} end end end return locations,n end function getPositionCenter(radius) local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() if tonumber(radius) then radius = tonumber(radius) else radius = 0 end x = math.floor(mapx/2) y = math.floor(mapy/2) pos.x = rand:random(radius) + (rand:random(2)-1)*x pos.y = rand:random(radius) + (rand:random(2)-1)*y pos.z = rand:random(mapz) return pos end function getPositionEdge() local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() roll = rand:random(2) if roll == 1 then pos.x = 2 else pos.x = mapx-1 end roll = rand:random(2) if roll == 1 then pos.y = 2 else pos.y = mapy-1 end pos.z = rand:random(mapy) return pos end function getPositionRandom() local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() pos.x = rand:random(mapx) pos.y = rand:random(mapy) pos.z = rand:random(mapz) return pos end function getPositionCavern(number) local mapx, mapy, mapz = dfhack.maps.getTileSize() for i = 1,mapx,1 do for j = 1,mapy,1 do for k = 1,mapz,1 do if dfhack.maps.getTileFlags(i,j,k).subterranean then if dfhack.maps.getTileBlock(i,j,k).global_feature >= 0 then for l,v in pairs(df.global.world.features.feature_global_idx) do if v == dfhack.maps.getTileBlock(i,j,k).global_feature then feature = df.global.world.features.map_features[l] if feature.start_depth == tonumber(quaternary) or quaternary == 'NONE' then if df.tiletype.attrs[dfhack.maps.getTileType(i,j,k)].caption == 'stone floor' then n = n+1 targetList[n] = {x = i, y = j, z = k} end end end end end else break end end end end pos = dfhack.script_environment('functions/misc').permute(targetList) return pos[1] end function getPositionSurface(location) local pos = {} local mapx, mapy, mapz = dfhack.maps.getTileSize() pos.x = location.x or location[1] pos.y = location.y or location[2] pos.z = mapz - 1 local j = 0 while dfhack.maps.ensureTileBlock(pos.x,pos.y,pos.z-j).designation[pos.x%16][pos.y%16].outside do j = j + 1 end pos.z = pos.z - j pos = checkBounds(pos) return pos end function getPositionSky(location) local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() pos.x = location.x or location[1] pos.y = location.y or location[2] pos.z = mapz - 1 local j = 0 while dfhack.maps.ensureTileBlock(pos.x,pos.y,pos.z-j).designation[pos.x%16][pos.y%16].outside do j = j + 1 end pos.z = rand:random(mapz-j)+j pos = checkBounds(pos) return pos end function getPositionUnderground(location) local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() pos.x = location.x or location[1] pos.y = location.y or location[2] pos.z = mapz - 1 local j = 0 while dfhack.maps.ensureTileBlock(pos.x,pos.y,pos.z-j).designation[pos.x%16][pos.y%16].outside do j = j + 1 end pos.z = rand:random(j-1) pos = checkBounds(pos) return pos end function getPositionLocationRandom(location,radius) lx = location.x or location[1] ly = location.y or location[2] lz = location.z or location[3] local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() local rx = radius.x or radius[1] or 0 local ry = radius.y or radius[2] or 0 local rz = radius.z or radius[3] or 0 local xmin = lx - rx local ymin = ly - ry local zmin = lz - rz local xmax = lx + rx local ymax = ly + ry local zmax = lz + rz pos.x = rand:random(xmax-xmin) + xmin pos.y = rand:random(ymax-ymin) + ymin pos.z = rand:random(zmax-zmin) + zmin pos = checkBounds(pos) return pos end function getPositionUnitRandom(unit,radius) if tonumber(unit) then unit = df.unit.find(tonumber(unit)) end local pos = {} local rand = dfhack.random.new() local mapx, mapy, mapz = dfhack.maps.getTileSize() local rx = radius.x or radius[1] or 0 local ry = radius.y or radius[2] or 0 local rz = radius.z or radius[3] or 0 local xmin = unit.pos.x - rx local ymin = unit.pos.y - ry local zmin = unit.pos.z - rz local xmax = unit.pos.x + rx local ymax = unit.pos.y + ry local zmax = unit.pos.z + rz pos.x = rand:random(xmax-xmin) + xmin pos.y = rand:random(ymax-ymin) + ymin pos.z = rand:random(zmax-zmin) + zmin pos = checkBounds(pos) return pos end function spawnFlow(edges,offset,flowType,inorganic,density,static) local ox = offset.x or offset[1] or 0 local oy = offset.y or offset[2] or 0 local oz = offset.z or offset[3] or 0 if edges.xmin then xmin = edges.xmin + ox xmax = edges.xmax + ox ymin = edges.ymin + oy ymax = edges.ymax + oy zmin = edges.zmin + oz zmax = edges.zmax + oz else xmin = edges.x + ox or edges[1] + ox ymin = edges.y + oy or edges[2] + oy zmin = edges.z + oz or edges[3] + oz xmax = edges.x + ox or edges[1] + ox ymax = edges.y + oy or edges[2] + oy zmax = edges.z + oz or edges[3] + oz end for x = xmin, xmax, 1 do for y = ymin, ymax, 1 do for z = zmin, zmax, 1 do block = dfhack.maps.ensureTileBlock(x,y,z) dsgn = block.designation[x%16][y%16] if not dsgn.hidden then flow = dfhack.maps.spawnFlow({x=x,y=y,z=z},flowType,0,inorganic,density) if static then flow.expanding = false end end end end end end function spawnLiquid(edges,offset,depth,magma,circle,taper) local ox = offset.x or offset[1] or 0 local oy = offset.y or offset[2] or 0 local oz = offset.z or offset[3] or 0 if edges.xmin then xmin = edges.xmin + ox xmax = edges.xmax + ox ymin = edges.ymin + oy ymax = edges.ymax + oy zmin = edges.zmin + oz zmax = edges.zmax + oz else xmin = edges.x + ox or edges[1] + ox ymin = edges.y + oy or edges[2] + oy zmin = edges.z + oz or edges[3] + oz xmax = edges.x + ox or edges[1] + ox ymax = edges.y + oy or edges[2] + oy zmax = edges.z + oz or edges[3] + oz end for x = xmin, xmax, 1 do for y = ymin, ymax, 1 do for z = zmin, zmax, 1 do if circle then if (math.abs(x-(xmax+xmin)/2)+math.abs(y-(ymax+ymin)/2)+math.abs(z-(zmax+zmin)/2)) <= math.sqrt((xmax-xmin)^2/4+(ymax-ymin)^2/4+(zmax-zmin)^2/4) then block = dfhack.maps.ensureTileBlock(x,y,z) dsgn = block.designation[x%16][y%16] if not dsgn.hidden then if taper then size = math.floor(depth-((xmax-xmin)*math.abs((xmax+xmin)/2-x)+(ymax-ymin)*math.abs((ymax+ymin)/2-y)+(zmax-zmin)*math.abs((zmax+zmin)/2-z))/depth) if size < 0 then size = 0 end else size = depth end dsgn.flow_size = size if magma then dsgn.liquid_type = true end flow = block.liquid_flow[x%16][y%16] flow.temp_flow_timer = 10 flow.unk_1 = 10 block.flags.update_liquid = true block.flags.update_liquid_twice = true end end else block = dfhack.maps.ensureTileBlock(x,y,z) dsgn = block.designation[x%16][y%16] if not dsgn.hidden then if taper then size = math.floor(depth-((xmax-xmin)*math.abs((xmax+xmin)/2-x)+(ymax-ymin)*math.abs((ymax+ymin)/2-y)+(zmax-zmin)*math.abs((zmax+zmin)/2-z))/depth) if size < 0 then size = 0 end else size = depth end flow = block.liquid_flow[x%16][y%16] flow.temp_flow_timer = 10 flow.unk_1 = 10 dsgn.flow_size = size if magma then dsgn.liquid_type = true end block.flags.update_liquid = true block.flags.update_liquid_twice = true end end end end end end function getFlow(pos) flowtypes = { MIASMA, MIST, MIST2, DUST, LAVAMIST, SMOKE, DRAGONFIRE, FIREBREATH, WEB, UNDIRECTEDGAS, UNDIRECTEDVAPOR, OCEANWAVE, SEAFOAM } block = dfhack.maps.ensureTileBlock(pos) flows = block.flows flowID = -1 for i,flow in pairs(flows) do if flow.pos.x == pos.x and flow.pos.y == pos.y and flow.pos.z == pos.z then flowID = i break end end if flowID == -1 then return false, false else return flows[flowID], flowtypes[flows[flowID]['type']] end end function getTree(pos,array) if not array then array = df.global.world.plants.all end for i,tree in pairs(array) do if tree.tree_info ~= nil then local x1 = tree.pos.x - math.floor(tree.tree_info.dim_x / 2) local x2 = tree.pos.x + math.floor(tree.tree_info.dim_x / 2) local y1 = tree.pos.y - math.floor(tree.tree_info.dim_y / 2) local y2 = tree.pos.y + math.floor(tree.tree_info.dim_y / 2) local z1 = tree.pos.z local z2 = tree.pos.z + tree.tree_info.body_height if ((pos.x >= x1 and pos.x <= x2) and (pos.y >= y1 and pos.y <= y2) and (pos.z >= z1 and pos.z <= z2)) then body = tree.tree_info.body[pos.z - tree.pos.z]:_displace((pos.y - y1) * tree.tree_info.dim_x + (pos.x - x1)) if not body.blocked then if body.trunk or body.thick_branches_1 or body.thick_branches_2 or body.thick_branches_3 or body.thick_branches_4 or body.branches or body.twigs then return i,tree end end end end end return nil end function getShrub(pos,array) if not array then array = df.global.world.plants.all end for i,shrub in pairs(array) do if not shrub.tree_info then if pos.x == shrub.pos.x and pos.y == shrub.pos.y and pos.z == shrub.pos.z then return i,shrub end end end end function removeTree(pos) --erase from plants.all (but first get the tree positions) nAll,tree = getTree(pos,df.global.world.plants.all) positions = getTreePositions(tree) base = tree.pos.z --erase from plants.tree_dry nDry = getTree(pos,df.global.world.plants.tree_dry) --erase from plants.tree_wet nWet = getTree(pos,df.global.world.plants.tree_wet) --erase from map_block_columns x_column = math.floor(pos.x/16) y_column = math.floor(pos.y/16) --need to get 1st of 9 map block columns for plant information map_block_column = df.global.world.map.column_index[x_column-x_column%3][y_column-y_column%3] nBlock = getTree(pos,map_block_column.plants) print(nAll,nDry,nWet,nBlock) if nAll then df.global.world.plants.all:erase(nAll) end if nDry then df.global.world.plants.tree_dry:erase(nDry) end if nWet then df.global.world.plants.tree_wet:erase(nWet) end if nBlock then map_block_column.plants:erase(nBlock) end --Now change tiletypes for tree positions for _,position in ipairs(positions) do block = dfhack.maps.ensureTileBlock(position) if position.z == base then block.tiletype[position.x%16][position.y%16] = 350 else block.tiletype[position.x%16][position.y%16] = df.tiletype['OpenSpace'] end block.designation[position.x%16][position.y%16].outside = true end end function removeShrub(pos) --erase from plants.all n = getShrub(pos,df.global.world.plants.all) if n then df.global.world.plants.all:erase(n) end --erase from plants.shrub_dry n = getShrub(pos,df.global.world.plants.shrub_dry) if n then df.global.world.plants.shrub_dry:erase(n) end --erase from plants.tree_wet n = getShrub(pos,df.global.world.plants.shrub_wet) if n then df.global.world.plants.shrub_wet:erase(n) end --erase from map_block_columns x_column = math.floor(pos.x/16) y_column = math.floor(pos.y/16) --need to get 1st of 9 map block columns for plant information map_block_column = df.global.world.map.column_index[x_column-x_column%3][y_column-y_column%3] n = getTree(pos,map_block_column.plants) if n then map_block_column:erase(n) end end function getTreeMaterial(pos) _,tree = getTree(pos) material = dfhack.matinfo.decode(419, tree.material) return material end function getShrubMaterial(pos) _,shrub = getShrub(pos) material = dfhack.matinfo.decode(419, shrub.material) return material end function getGrassMaterial(pos) events = dfhack.maps.ensureTileBlock(pos).block_events for _,event in ipairs(events) do if df.block_square_event_grassst:is_instance(event) then if event.amount[pos.x%16][pos.y%16] > 0 then return dfhack.matinfo.decode(419,event.plant_index) end end end end function getTreePositions(tree) n = 0 nTrunk = 0 nTwigs = 0 nBranches = 0 nTBranches = 0 positions = {} positionsTrunk = {} positionsTwigs = {} positionsBranches = {} positionsTBranches = {} local x1 = tree.pos.x - math.floor(tree.tree_info.dim_x / 2) local x2 = tree.pos.x + math.floor(tree.tree_info.dim_x / 2) local y1 = tree.pos.y - math.floor(tree.tree_info.dim_y / 2) local y2 = tree.pos.y + math.floor(tree.tree_info.dim_y / 2) local z1 = tree.pos.z local z2 = tree.pos.z + math.floor(tree.tree_info.body_height / 2) for x = x1,x2 do for y = y1,y2 do for z = z1,z2 do pos = {x=x,y=y,z=z} body = tree.tree_info.body[pos.z-z1]:_displace((pos.y - y1) * tree.tree_info.dim_x + (pos.x - x1)) if body.trunk then n = n + 1 positions[n] = pos nTrunk = nTrunk + 1 positionsTrunk[nTrunk] = pos elseif body.twigs then n = n + 1 positions[n] = pos nTwigs = nTwigs + 1 positionsTwigs[nTwigs] = pos elseif body.branches then n = n + 1 positions[n] = pos nBranches = nBranches + 1 positionsBranches[nBranches] = pos elseif body.thick_branches_1 or body.thick_branches_2 or body.thick_branches_3 or body.thick_branches_4 then n = n + 1 positions[n] = pos nTBranches = nTBranches + 1 positionsTBranches[nTBranches] = pos end end end end return positions,positionsTrunk,positionsTBranches,positionsBranches,positionsTwigs end function flowSource(n) local persistTable = require 'persist-table' flowTable = persistTable.GlobalTable.roses.FlowTable flow = flowTable[n] if flow then x = tonumber(flow.x) y = tonumber(flow.y) z = tonumber(flow.z) density = tonumber(flow.Density) inorganic = tonumber(flow.Inorganic) flowType = tonumber(flow.FlowType) check = tonumber(flow.Check) dfhack.maps.spawnFlow({x,y,z},flowType,0,inorganic,density) dfhack.timeout(check,'ticks', function () dfhack.script_environment('functions/map').flowSource(n) end ) end end function liquidSource(n) local persistTable = require 'persist-table' liquidTable = persistTable.GlobalTable.roses.LiquidTable liquid = liquidTable[n] if liquid then x = tonumber(liquid.x) y = tonumber(liquid.y) z = tonumber(liquid.z) depth = tonumber(liquid.Depth) magma = liquid.Magma check = tonumber(liquid.Check) block = dfhack.maps.ensureTileBlock(x,y,z) dsgn = block.designation[x%16][y%16] flow = block.liquid_flow[x%16][y%16] flow.temp_flow_timer = 10 flow.unk_1 = 10 if dsgn.flow_size < depth then dsgn.flow_size = depth end if magma then dsgn.liquid_type = true end block.flags.update_liquid = true block.flags.update_liquid_twice = true dfhack.timeout(check,'ticks', function () dfhack.script_environment('functions/map').liquidSource(n) end ) end end function liquidSink(n) local persistTable = require 'persist-table' liquidTable = persistTable.GlobalTable.roses.LiquidTable liquid = liquidTable[n] if liquid then x = tonumber(liquid.x) y = tonumber(liquid.y) z = tonumber(liquid.z) depth = tonumber(liquid.Depth) magma = liquid.Magma check = tonumber(liquid.Check) block = dfhack.maps.ensureTileBlock(x,y,z) dsgn = block.designation[x%16][y%16] flow = block.liquid_flow[x%16][y%16] flow.temp_flow_timer = 10 flow.unk_1 = 10 if dsgn.flow_size > depth then dsgn.flow_size = depth end if magma then dsgn.liquid_type = true end block.flags.update_liquid = true block.flags.update_liquid_twice = true dfhack.timeout(check,'ticks', function () dfhack.script_environment('functions/map').liquidSink(n) end ) end end function findLocation(search) local primary = search[1] local secondary = search[2] or 'NONE' local tertiary = search[3] or 'NONE' local quaternary = search[4] or 'NONE' local x_map, y_map, z_map = dfhack.maps.getTileSize() x_map = x_map - 1 y_map = y_map - 1 z_map = z_map - 1 local targetList = {} local target = nil local found = false local n = 1 local rando = dfhack.random.new() if primary == 'RANDOM' then if secondary == 'NONE' or secondary == 'ALL' then n = 1 targetList = {{x = rando:random(x_map-1)+1,y = rando:random(y_map-1)+1,z = rando:random(z_map-1)+1}} elseif secondary == 'SURFACE' then if tertiary == 'ALL' or tertiary == 'NONE' then targetList[n] = getPositionRandom() targetList[n] = getPositionSurface(targetList[n]) elseif tertiary == 'EDGE' then targetList[n] = getPositionEdge() targetList[n] = getPositionSurface(targetList[n]) elseif tertiary == 'CENTER' then targetList[n] = getPositionCenter(quaternary) targetList[n] = getPositionSurface(targetList[n]) end elseif secondary == 'UNDERGROUND' then if tertiary == 'ALL' or tertiary == 'NONE' then targetList[n] = getPositionRandom() targetList[n] = getPositionUnderground(targetList[n]) elseif tertiary == 'CAVERN' then targetList[n] = getPositionCavern(quaternary) end elseif secondary == 'SKY' then if tertiary == 'ALL' or tertiary == 'NONE' then targetList[n] = getPositionRandom() targetList[n] = getPositionSky(targetList[n]) elseif tertiary == 'EDGE' then targetList[n] = getPositionEdge() targetList[n] = getPositionSky(targetList[n]) elseif tertiary == 'CENTER' then targetList[n] = getPositionCenter(quaternary) targetList[n] = getPositionSky(targetList[n]) end end end target = targetList[1] return {target} end
-- Acrobat Master v2.1 by Cegaiel -- -- Immediately upon Starting: -- Searches your acro menu for all of your acro buttons. It will not include acro move names on the list, that is not inside of a button. -- Displays your available moves in a list with a checkbox beside each one. If checked, it will click the move while acroing. Unchecked, it will be skipped. -- Set how many times you want to do each checked acro move. -- -- While acroing: -- Click Next button while acroing to skip the current move and go to next one. Idea if your partner is following this move or enough facets have been taught. -- Click Menu button to stop acroing and go back to your list. -- Go back to Menu, click Refresh when you have a new partner, to refresh the buttons -- -- While in Menu: -- Point mouse over your partner and Tap Shift to quickly Ask to Acro (Tests, The Human Body, Test of the Acrobat, Ask to Acro menus) dofile("common.inc"); askText = "Acrobat Master v2.1 by Cegaiel\n \nWait until you have Acrobat window open, from a partner, (won\'t work with Self Click, Acrobat, Show Moves) before you start macro! It will memorize your moves for future partners (even if you close acro window). You can move acro window while its running. You do not need to quit/restart macro between each partner. Click \"Menu\" button, when you are done acroing the current player. Optionally, click \"Refresh\" button when your next partner\'s acro window is open. Make sure you resize the acro window so all the buttons you know are showing (above divider bar). Press Shift over ATITD window to continue."; moveImages = { "Asianinfluence.png", "Broadjump.png", "Cartwheels.png", "Catstretch.png", "Clappingpushups.png", "Crunches.png", "Fronttuck.png", "Handplant.png", "Handstand.png", "Invertedpushups.png", "Jumpsplit.png", "Jumpingjacks.png", "Kickup.png", "Legstretch.png", "Lunge.png", "Pinwheel.png", "Pushups.png", "Rearsquat.png", "Roundoff.png", "Runinplace.png", "Sidebends.png", "Somersault.png", "Spinflip.png", "Squats.png", "Squatthrust.png", "Toetouches.png", "Widesquat.png", "Windmill.png", }; moveNames = { "Asian Influence", "Broad Jump", "Cartwheels", "Cat Stretch", "Clapping Push-Ups", "Crunches", "Front Tuck", "Handplant", "Handstand", "Inverted Pushups", "Jump Split", "Jumping Jacks", "Kick-Up", "Leg Stretch", "Lunge", "Pinwheel", "Push-Ups", "Rear Squat", "Roundoff", "Run in Place", "Side Bends", "Somersault", "Spin Flip", "Squats", "Squat Thrust", "Toe Touches", "Wide Squat", "Windmill", }; moveShortNames = { "AI", "BJ", "CW", "CS", "CPU", "CR", "FT", "HP", "HS", "IPU", "JS", "JJ", "KU", "LS", "LU", "PW", "PU", "RS", "RO", "RIP", "SB", "SS", "SF", "SQ", "ST", "TT", "WS", "WM", }; startTime = 0; perMoves = 6; perMovesAuto = 5; --Default Minutes to alot to each partner moveDelay = 7500; -- How many ms to wait to perform between each move to your partner. debugClickMoves = nil; -- Change to true to make mouse point to where it's clicking. Change to nil to disable. function doit() askForWindow(askText); totalSession = lsGetTimer(); findMoves(); checkAllBoxes(); displayMoves(); end function findMoves() lsDoFrame(); statusScreen("Scanning Acro Buttons ...", nil, 0.7); foundMovesName = {}; foundMovesImage = {}; foundMovesShortName = {}; local message = ""; --See if the acro bar (middle border on Acro window) is found. If not, then just set Y to screenHeight --Moves above the acro bar are moves that your partner does not know yet. Moves below are moves your partner already knows. Attempt to exclude those. srReadScreen(); barFound = srFindImage("acro/acro_bar.png"); if barFound then acroY = barFound[1]; -- set Y position of the middle border message = message .. "\n\nDIVIDER BAR FOUND!\n\nIgnoring moves below the border..."; else atitdY = srGetWindowSize(); acroY = atitdY[1]; -- No middle border found, so just use ATITD screen height end for i=1,#moveNames do checkBreak(); srReadScreen(); local found = srFindImage("acro/" .. moveImages[i]); if found then moveY = found[1]; end if found and (moveY > acroY) then --Button found, but below middle border, skip it (this means your partner already knows the move, too. statusScreen("Scanning acro buttons...\n\nSkipping: " .. moveNames[i] .. message, nil, 0.7); end if found and (moveY < acroY) then foundMovesName[#foundMovesName + 1] = moveNames[i]; foundMovesImage[#foundMovesImage + 1] = moveImages[i]; foundMovesShortName[#foundMovesShortName + 1] = moveShortNames[i]; statusScreen("Scanning acro buttons...\n\nFound: " .. moveNames[i] .. message, nil, 0.7); lsSleep(10); end end --if #foundMovesName == 0 then --error 'No acro moves found, aborted.'; --end end function doMoves() local skip = false; local now = 0; local lastClick = 0; local GUI = ""; local skipNotification = nil; startTime = lsGetTimer(); for i=1,checkedBoxes do checkBreak(); for j=1,perMoves do checkBreak(); skipNotification = nil; if skip then if j ~= 1 then break; else skip = false; end end local acroTimer = true; while acroTimer do checkBreak(); now = lsGetTimer(); if lsButtonText(10, lsScreenY - 30, z, 75, 0xffff80ff, "Menu") then sleepWithStatus(1500, "Returning to Menu !", nil, 0.7) displayMoves(); end if lsButtonText(100, lsScreenY - 30, z, 75, 0xff8080ff, "Skip") then if j == 1 then skipNotification = true; else skip = true; end if j == 1 then nextMove = checkedMovesName[i]; elseif i < tonumber(checkedBoxes) then nextMove = checkedMovesName[i+1]; else nextMove = "Last Move (N/A)"; end end -- if Skip button if ( (now - lastClick) < tonumber(moveDelay) ) then if skip or skipNotification then statusScreen("Move Delay: " .. math.floor(moveDelay - (now - lastClick)) .. "\n\nSkip Queued: " .. string.upper(nextMove) .. GUI, nil, 0.7); else statusScreen("Move Delay: " .. math.floor(moveDelay - (now - lastClick)) .. "\n\nWaiting on Timer" .. GUI, nil, 0.7); end else if skip then break; end acroTimer = false; srReadScreen(); clickMove = srFindImage("acro/" .. checkedMovesImage[i]); if clickMove and barFound and (clickMove[1] > acroY) then -- Check if the button is below a found divider Bar. -- This suggests your partner has learned a new move while acroing and the button has moved below the bar. Skip and uncheck the box. status = "SKIPPING: " .. checkedMovesName[i] .. "\n\nBUTTON HAS MOVED BELOW BAR!\n\nUnchecking from Move List.\n\nPartner likely learned this move."; foundMovesShortName[i] = false sleepWithStatus(2000, status, nil, 0.7); skip = true; elseif clickMove then status = string.upper(checkedMovesName[i]); lastClick = lsGetTimer(); if debugClickMoves then srSetMousePos(clickMove[0]+3, clickMove[1]+2); end srClickMouseNoMove(clickMove[0]+3, clickMove[1]+2); else -- This suggests your partner has learned a new move while acroing and the button has moved below the bar (but out of sight, furthur down in menu). status = "SKIPPING: " .. checkedMovesName[i] .. "\n\nBUTTON NOT FOUND!\n\nUnchecking from Move List.\n\nPartner likely learned this move"; foundMovesShortName[i] = false sleepWithStatus(2000, status, nil, 0.7); skip = true; end -- if clickMove GUI = "\n\n" .. status .. "\n \n[" .. i .. "/" .. checkedBoxes .. "] Moves\n[" .. j .. "/" .. perMoves .. "] Clicked\n \nNote: Avatar animation might not keep up with macro. This is OK, each move clicked will still be recognized by your partner.\n\nClick Skip to advance to next move on list (ie partner follows the move)."; end --if ( (now - lastClick) < tonumber(moveDelay) ) end --while acroTimer end --for j end --for i if skip or skipNotification then -- We skipped on final move; Simply announce we're returning to menu, with short delay sleepWithStatus(1500, "\nALL DONE, RETURNING TO MENU ...\n" .. GUI , nil, 0.7) else -- Allow the full animation timer to finish before returning to menu. sleepWithStatus(tonumber(moveDelay), "ALL DONE, RETURNING TO MENU ...\n\nWaiting on Timer/Move Delay to finish" .. GUI , nil, 0.7) end displayMoves(); end function processCheckedBoxes() checkedMovesName = {}; checkedMovesImage = {}; checkedMovesShortName = {}; checkedBoxes = 0; lsDoFrame(); --Make screen blank to prevent a text fade from doMoves function for i=1,#foundMovesName do if foundMovesShortName[i] then checkedMovesName[#checkedMovesName + 1] = foundMovesName[i]; checkedMovesImage[#checkedMovesImage + 1] = foundMovesImage[i]; checkedMovesShortName[#checkedMovesShortName + 1] = foundMovesShortName[i]; checkedBoxes = checkedBoxes + 1; end end if checkedBoxes == 0 then sleepWithStatus(2500, "No moves selected!\n\nAborting ...", nil, 0.7); else doMoves(); end end function checkAllBoxes() for i=1,#foundMovesName do foundMovesShortName[i] = true; end end function uncheckAllBoxes() for i=1,#foundMovesName do foundMovesShortName[i] = false; end end function displayMoves() lsDoFrame(); local foo; local is_done = nil; local finishTime = lsGetTimer(); local seconds = 0; local minutes = 0; local totalCheckedMoves = 0 if startTime ~= 0 then sessionTime = math.floor((finishTime - startTime)/1000); sessionTime = sessionTime - 1; -- subtract 1 second for the 1000ms sleepWithStatus delay that occurs before returning to menu. if sessionTime >= 60 then minutes = math.floor(sessionTime/60); seconds = math.floor(sessionTime - (minutes*60)); else minutes = 0; seconds = sessionTime; end end if minutes == 0 and seconds == 0 then lastSession = "N/A" elseif minutes == 0 and seconds ~= 0 then lastSession = seconds .. " sec"; else lastSession = minutes .. " min " .. seconds .. " sec"; end while 1 do checkBreak() local y = 10; local tpmColor = 0xffffffff; local tpmColor2 = 0x99c2ffff; local perMovesColor = 0x99c2ffff; if timesPerMove then tpmColor = 0xff9933ff; tpmColor2 = 0xffbf80ff; perMovesColor = 0xffffffff; perMoves = math.floor(pms2) else perMoves = math.floor(perMoves) end lsSetCamera(0,0,lsScreenX*1.5,lsScreenY*1.5); foo, moveDelay = lsEditBox("ms Delay per Move", 15, y, z, 70, 30, 0.7, 0.7, 0x000000ff, moveDelay); if not tonumber(moveDelay) then moveDelay = 0; is_done = nil; lsPrint(100, y, 0, 0.9, 0.9, 0xFF2020ff, "MUST BE A NUMBER!"); else is_done = true; lsPrint(100, y+2, z, 0.9, 0.9, 0xf0f0f0ff, "ms (" .. round(moveDelay/1000,2) .. "s) between each Move Click"); end y=y+30; foo, perMoves = lsEditBox("Time per Move", 15, y, z, 70, 30, 0.7, 0.7, 0x000000ff, perMoves); if not tonumber(perMoves) then perMoves = 0; is_done = nil; lsPrint(100, y, 0, 0.9, 0.9, 0xFF2020ff, "MUST BE A NUMBER!"); else is_done = true; lsPrint(100, y+2, z, 0.9, 0.9, perMovesColor, "# Times to Repeat each Move"); end y=y+30; foo, perMovesAuto = lsEditBox("perMovesAuto", 15, y, z, 70, 30, 0.7, 0.7, 0x000000ff, perMovesAuto); if not tonumber(perMovesAuto) then perMovesAuto = 0; is_done = nil; lsPrint(100, y, 0, 0.9, 0.9, 0xFF2020ff, "MUST BE A NUMBER!"); else is_done = true; lsPrint(100, y+2, z, 0.9, 0.9, tpmColor, "OR Minutes alloted to Partner"); end y = y + 30; pms2 = perMoves; if tonumber(perMovesAuto) and tonumber(moveDelay) and tonumber(perMoves) then pms = 60000 * perMovesAuto pms2 = pms/(totalCheckedMoves * moveDelay) autoMoveMessage = totalCheckedMoves .. " Moves (" .. round(moveDelay/1000,2) .. "s each) = " .. round(pms2,2) .. " (" .. math.floor(pms2) .. ") x each, in " .. perMovesAuto .. "m"; lsPrintWrapped(15, y, z, lsScreenX*1.5 - 20, 0.9, 0.9, 0xf2f2f2ff, autoMoveMessage); end y = y + 40; local timesPerMoveColor = 0xB0B0B0ff; if timesPerMove then timesPerMoveColor = 0xf0f0f0ff; end timesPerMove = lsCheckBox(15, y, z, timesPerMoveColor, " Set '# Times to Repeat' based on Minutes", timesPerMove); if timesPerMove then perMoves = math.floor(pms2) else perMoves = math.floor(perMoves) end y = y + 25; lsPrint(37, y, z, 0.9, 0.9, tpmColor2, " # Times to Repeat each Move = " .. perMoves ); lsPrint(120, y+35, z, 0.8, 0.8, 0xf0f0f0ff, "Total Acro Session: " .. getElapsedTime(totalSession)); y = y + 20; lsPrint(120, y+35, z, 0.8, 0.8, 0xf0f0f0ff, " Last Acro Session: " .. lastSession); y = y + 80; lsPrint(15, y, 0, 0.9, 0.9, 0xffff00ff, "Hover Mouse over Partner and Tap Ctrl to Ask Acro!"); y = y + 35; if #foundMovesName > 0 then lsPrint(15, y, 0, 0.9, 0.9, 0x40ff40ff, "Check moves you want to perform:"); else lsPrint(15, y, 0, 0.9, 0.9, 0xff8080ff, "No moves found! Refresh when Acro window is open"); end y = y + 30; totalCheckedMoves = 0; for i=1,#foundMovesName do local color = 0xB0B0B0ff; if foundMovesShortName[i] then color = 0xffffffff; totalCheckedMoves = totalCheckedMoves + 1; end foundMovesShortName[i] = lsCheckBox(20, y, z, color, " " .. foundMovesName[i], foundMovesShortName[i]); y = y + 20; end if lsControlHeld() then askAcro(); end lsSetCamera(0,0,lsScreenX*1.2,lsScreenY*1.2); if lsButtonText(lsScreenX - 50, lsScreenY - 50, z, 100, 0xFFFFFFff, "Refresh") and is_done then findMoves(); checkAllBoxes(); end if #foundMovesName > 0 then if lsButtonText(lsScreenX - 50, lsScreenY - 80, z, 100, 0xFFFFFFff, "Start") and is_done then processCheckedBoxes(); end if lsButtonText(lsScreenX - 50, lsScreenY - 20, z, 100, 0xFFFFFFff, "Check") and is_done then checkAllBoxes(); end if lsButtonText(lsScreenX - 50, lsScreenY + 10, z, 100, 0xFFFFFFff, "Uncheck") and is_done then uncheckAllBoxes(); end end if lsButtonText(lsScreenX - 50, lsScreenY + 40, z, 100, 0xFFFFFFff, "End Script") then error "Clicked End script button"; end lsSetCamera(0,0,lsScreenX*1.0,lsScreenY*1.0); lsDoFrame(); lsSleep(10); end end function round(num, numDecimalPlaces) local mult = 10^(numDecimalPlaces or 0) return math.floor(num * mult + 0.5) / mult end function askAcro() lsDoFrame(); statusScreen("Asking to Acro...", nil, 0.7); local pos = getMousePos(); srClickMouseNoMove(pos[0], pos[1], 1); -- Right click where mouse is hovering (partner). Use right click in case we misclick and don't start running. clickText(waitForText("Tests", 500)); lsSleep(100); -- Needed so that next menu doesn't fall behind Tests menu. clickText(waitForText("The Human Body", 500)); clickText(waitForText("Test of the Acrobat", 500)); clickText(waitForText("Ask to Acro", 500)); lsSleep(100); srClickMouseNoMove(pos[0]+20, pos[1], 1); -- Right click to close out possible pinned menu. end
--require "defines" DEBUG = false --[[ General notes for those planning to utilize this API: - do not combine entities from multiple mods, unless it's the vehicle 'turrets' included in this APIs - add this mod as a dependancy unless you want unexpected weird behavior - the teleport command works on many entities besides vehicles, but the behavior is probably not what you might expect. Known issues: - the bullets shot from turrets appear far from the actual barrel. this is because the bullets may impact other entities on the vehicle --]] --register_design: registers a multi-entity design with base and subordinate entities -- subordinate entities will use a direction based translation to remain in sync with the -- base entity. (untested) It should be possible to have designs where the base entity is subordinate -- a different entity. offset is stored as a polar coordinate. -- format: -- remote.call("msu_turrets_V1","register_design", {base= <base_entity>, subordinates= -- {{entity=<subordinate_entity>,rotation = {theta=<num>,r=<num>},shift = {x=<num>, y=<num>}}) --IE: remote.call("msu_turrets_V1","register_design", {base = "msucargowagon", subordinates = {{ entity="msugunturret", rotation = {theta=0,r=0}, shift={x=0,y=0} }} }) --unregister_design: removes an entity registration -- Note: unregister_design is UNTESTED: designs are removed as needed when mod config changes -- accepts 1 argument, the name of the entry to be removed: -- format: -- remote.call("msu_turrets_V1","unregister_design", "base_entity_name") remote.add_interface("msu_turrets_V1", { register_design = function(designTable) if not designTable.base or not designTable.subordinates then debugPrint("invalid data passed when attempting to register a subordinate design"); return end if global.designs[designTable.base] then debugPrint("Existing design exists for entity ".. designTable.base) return end global.designs[designTable.base] = designTable debugPrint("design added") end, unregister_design = function(entityName) global.designs[entityTable] = nil end, })--add_interface script.on_init( function() on_init_handler() end) script.on_load( function() on_init_handler() end) -- generate the custom event id function on_init_handler() global.designs = global.designs or {} global.subs = global.subs or {} script.on_event(defines.events.on_built_entity, function(event) onBuiltEventHandler(event) end) script.on_event(defines.events.on_tick, function(event) onTickEventHandler(event) end) end script.on_configuration_changed( function() on_mod_changes(data) end) function on_mod_changes(data) local delete = {} debugPrint(serpent.dump(global.designs)) for _,design in pairs(global.designs) do debugPrint(design.base) if not game.entity_prototypes[design.base] then table.insert(delete,design.base) debugPrint("design removed due to mod removal: "..design.base) end end for _,entry in ipairs(delete) do global.designs[entry] = nil end debugPrint(serpent.dump(global.designs).." ") end function onBuiltEventHandler(event) --see if we have a matching entity to run this if not global.designs then return end if not global.designs[event.created_entity.name] then return end local err, err_text = pcall(addSubordinates, event) end -- creates the subordinate entities and then adds them of the list of entity's that need to be updated each tick function addSubordinates(event) debugPrint("adding subs for "..event.created_entity.name) design = global.designs[event.created_entity.name] surface = event.created_entity.surface base = event.created_entity for _, subordinate in ipairs(design.subordinates) do newSub = surface.create_entity{ name = subordinate.entity, position = base.position, force = base.force} global.subs[#global.subs+1] = {base_entity = base, sub_entity = newSub, rotation = subordinate.rotation, offset = subordinate.offset, frames = subordinate.frames, car = subordinate.car} --debugPrint(serpent.dump(global.subs)) if not newSub.valid then error("subordinate failed to place") end end end --not needed, we will check for an error when the base entity no longer exists --we will handle the removal of subordinates in the onTickEventHandler --function removeSubordinates(event) function onTickEventHandler(event) if global.subs == nil then return end remove= {} for key, entity_pair in pairs(global.subs) do if (entity_pair.base_entity.valid and entity_pair.sub_entity.valid) then --valid base entity entity_pair.sub_entity.teleport(transform(entity_pair.base_entity.position,entity_pair.rotation, entity_pair.offset, math.floor(entity_pair.base_entity.orientation * entity_pair.frames)/entity_pair.frames)) entity_pair.sub_entity.orientation = entity_pair.base_entity.orientation if entity_pair.car then entity_pair.sub_entity.speed = entity_pair.base_entity.speed end else if (entity_pair.sub_entity.valid) then entity_pair.sub_entity.destroy() end if (entity_pair.base_entity.valid) then entity_pair.base_entity.destroy() end debugPrint("entity_pair invalidated") table.insert(remove,key) end end removeInvalidSubordinates(remove) end function removeInvalidSubordinates(remove) for i,value in pairs(remove) do table.remove(global.subs,value) end end --performs pivot on origin and polar/rectangular conversion function transform(base,rotation,offset,direction) --graph: y+ is north, pi/2 is x+ local theta = direction * math.pi * 2 + rotation.theta - math.pi/2 if theta > (math.pi*2) then theta = theta - (math.pi *2) end -- return {x = rotation.r * math.cos(theta) + base.x + offset.x, y = rotation.r/1.41421356 * math.sin(theta) + base.y + offset.y } end function debugPrint(message) if DEBUG then for i=1,#game.players,1 do game.players[i].print("turretAPIV1: " .. message) end end end function debugTeleport(position) if DEBUG then for i=1,#game.players,1 do game.players[i].teleport(position) end end end
-- ======================================================================== -- MANDATORY (MUST BE CAREFULLY CHECKED AND PROPERLY SET!) -- ======================================================================== -- Name of this instance, defaults to name of config file -- ------------------------------------------------------------------------ config.instance_name = "Instance name" -- Information about service provider (HTML) -- ------------------------------------------------------------------------ config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany" -- A HTML formatted text the user has to accept while registering -- ------------------------------------------------------------------------ config.use_terms = "<h1>Terms of Use</h1><p>Insert terms here</p>" -- Checkbox(es) the user has to accept while registering -- ------------------------------------------------------------------------ config.use_terms_checkboxes = { { name = "terms_of_use_v1", html = "I accept the terms of use.", not_accepted_error = "You have to accept the terms of use to be able to register." }, -- { -- name = "extra_terms_of_use_v1", -- html = "I accept the extra terms of use.", -- not_accepted_error = "You have to accept the extra terms of use to be able to register." -- } } -- Absolute base url of application -- ------------------------------------------------------------------------ config.absolute_base_url = "http://example.com/" -- Connection information for the LiquidFeedback database -- ------------------------------------------------------------------------ config.database = { engine='postgresql', dbname='liquid_feedback' host='postgres' } -- Location of the rocketwiki binaries -- ------------------------------------------------------------------------ config.enforce_formatting_engine = "markdown2" config.formatting_engines = { { id = "markdown2", name = "python-markdown2", executable = "markdown2", args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'}, remove_images = true }, -- { id = "markdown_py", -- name = "Python Markdown", -- executable = "markdown_py", -- args = {'-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'}, -- remove_images = true -- }, -- { id = "rocketwiki", -- name = "RocketWiki", -- executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb" -- }, -- { id = "compat", -- name = "Traditional WIKI syntax", -- executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat" -- }, } -- Public access level -- ------------------------------------------------------------------------ -- Available options: -- "none" -- -> Closed user group, no public access at all -- (except login/registration/password reset) -- "anonymous" -- -> Shows only initiative/suggestions texts and aggregated -- supporter/voter counts -- "authors_pseudonymous" -- -> Like anonymous, but shows screen names of authors -- "all_pseudonymous" -- -> Show everything a member can see, except profile pages -- "everything" -- -> Show everything a member can see, including profile pages -- ------------------------------------------------------------------------ config.public_access = "none" -- ======================================================================== -- OPTIONAL -- Remove leading -- to use a option -- ======================================================================== -- Disable registration -- ------------------------------------------------------------------------ -- Available options: -- false: registration is enabled (default) -- true: registration is disabled -- ------------------------------------------------------------------------ -- config.disable_registration = true -- List of enabled languages, defaults to available languages -- ------------------------------------------------------------------------ -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'ka', 'nl', 'zh-Hans', 'zh-TW' } -- Default language, defaults to "en" -- ------------------------------------------------------------------------ -- config.default_lang = "en" -- after how long is a user considered inactive and the trustee will see warning, -- notation is according to postgresql intervals, default: no warning at all -- ------------------------------------------------------------------------ -- config.delegation_warning_time = '6 months' -- after which time a user is advised (_soft) or forced (_hard) to check -- unit and area delegations. default: no check at all -- ------------------------------------------------------------------------ -- config.check_delegations_interval_hard = "6 months" -- config.check_delegations_interval_soft = "3 months" -- default option when checking delegations -- available options: "confirm", "revoke" and "none", default: "confirm" -- ------------------------------------------------------------------------ -- config.check_delegations_default = "confirm" -- Prefix of all automatic mails, defaults to "[Liquid Feedback] " -- ------------------------------------------------------------------------ -- config.mail_subject_prefix = "[LiquidFeedback] " -- Sender of all automatic mails, defaults to system defaults -- ------------------------------------------------------------------------ -- config.mail_envelope_from = "liquidfeedback@example.com" -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" } -- config.mail_reply_to = { name = "Support", address = "support@example.com" } -- Configuration of password hashing algorithm (defaults to "crypt_sha512") -- ------------------------------------------------------------------------ -- config.password_hash_algorithm = "crypt_sha512" -- config.password_hash_algorithm = "crypt_sha256" -- config.password_hash_algorithm = "crypt_md5" -- Number of rounds for crypt_sha* algorithms, minimum and maximum -- (defaults to minimum 10000 and maximum 20000) -- ------------------------------------------------------------------------ -- config.password_hash_min_rounds = 10000 -- config.password_hash_max_rounds = 20000 -- Supply custom url for avatar/photo delivery -- ------------------------------------------------------------------------ -- config.fastpath_url_func = nil -- Local directory for database dumps offered for download -- ------------------------------------------------------------------------ -- config.download_dir = nil -- Special use terms for database dump download -- ------------------------------------------------------------------------ -- config.download_use_terms = "=== Download use terms ===\n" -- Use custom image conversion, defaults to ImageMagick's convert -- ------------------------------------------------------------------------ --config.member_image_content_type = "image/jpeg" --config.member_image_convert_func = { -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end, -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end --} -- Display a html formatted public message of the day -- ------------------------------------------------------------------------ -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>" -- Display a html formatted internal message of the day -- ------------------------------------------------------------------------ -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>" -- Automatic issue related discussion URL -- ------------------------------------------------------------------------ -- config.issue_discussion_url_func = function(issue) -- return "http://example.com/discussion/issue_" .. tostring(issue.id) -- end -- Integration of Etherpad, disabled by default -- ------------------------------------------------------------------------ --config.etherpad = { -- base_url = "http://example.com:9001/", -- api_base = "http://localhost:9001/", -- api_key = "mysecretapikey", -- group_id = "mygroupname", -- cookie_path = "/" --} -- Free timings -- ------------------------------------------------------------------------ -- This example expects a date string entered in the free timing field -- by the user creating a poll, interpreting it as target date for then -- poll and splits the remaining time at the ratio of 4:1:2 -- Please note, polling policies never have an admission phase -- The available_func is optional, if not set any target date is allowed config.free_timing = { calculate_func = function(policy, timing_string) local function interval_by_seconds(secs) local secs_per_day = 60 * 60 * 24 local days days = math.floor(secs / secs_per_day) secs = secs - days * secs_per_day return days .. " days " .. secs .. " seconds" end local target_date = parse.date(timing_string, atom.date) if not target_date then return false end local target_timestamp = target_date.midday local now = atom.timestamp:get_current() trace.debug(target_timestamp, now) local duration = target_timestamp - now if duration < 0 then return false end return { discussion = interval_by_seconds(duration / 7 * 4), verification = interval_by_seconds(duration / 7 * 1), voting = interval_by_seconds(duration / 7 * 2) } end, available_func = function(policy) return { { name = "End of 2013", id = '2013-12-31' }, { name = "End of 2014", id = '2014-12-31' }, { name = "End of 2015", id = '2015-12-31' } } end } -- Admin logger -- ------------------------------------------------------------------------ -- Logging administrative activities -- disabled by default --[[ config.admin_logger = function(params) local adminid = app.session.member_id local adminname = app.session.member.name local url = params._webmcp_path -- do something (e.g. calling 'logger' via extos.pfilter) end --]] -- Network interface to bind to -- ------------------------------------------------------------------------ -- Available options: -- true: bind to localhost (default) -- false: bind to all interface -- ------------------------------------------------------------------------ -- config.localhost = true -- Network port to bind to -- ------------------------------------------------------------------------ -- config.port = 8080 -- Serving content via IPV6 -- ------------------------------------------------------------------------ -- Available options: -- nil or false: do not serve via IPv6 (default) -- true: serve via IPv6 -- ------------------------------------------------------------------------ -- config.ipv6 = false -- Application server fork configuration -- ------------------------------------------------------------------------ -- config.fork = { -- pre = 2, -- desired number of spare (idle) processes -- min = 4, -- minimum number of processes -- max = 128, -- maximum number of processes (hard limit) -- delay = 0.125, -- delay (seconds) between creation of spare processes -- error_delay = 2, -- delay (seconds) before retry of failed process creation -- exit_delay = 2, -- delay (seconds) between destruction of excessive spare processes -- idle_timeout = 900, -- idle time (seconds) after a fork gets terminated (0 for no timeout) -- memory_limit = 0, -- maximum memory consumption (bytes) before process gets terminated -- min_requests = 50, -- minimum count of requests handled before fork is terminated -- max_requests = 100 -- maximum count of requests handled before fork is terminated -- } -- HTTP server options -- ------------------------------------------------------------------------ -- http_options = { -- static_headers = {} -- string or table of static headers to be returned with every request -- request_header_size_limit = 1024*1024, -- maximum size of request body sent by client -- request_body_size_limit = 64*1024*1024, -- maximum size of request body sent by client -- idle_timeout = 65, -- maximum time until receiving the first byte of the request headera -- stall_timeout = 60, -- maximum time a client connection may be stalled -- request_header_timeout = 120, -- maximum time until receiving the remaining bytes of the request header -- response_timeout = 3600, -- time in which request body and response must be sent -- maximum_input_chunk_size = 16384 -- tweaks behavior of request-body parser -- minimum_output_chunk_size = 1024 -- chunk size for chunked-transfer-encoding -- } -- WebMCP accelerator -- uncomment the following two lines to use C implementations of chosen -- functions and to disable garbage collection during the request, to -- increase speed: -- ------------------------------------------------------------------------ -- require 'webmcp_accelerator' -- if cgi then collectgarbage("stop") end -- Trace debug -- uncomment the following line to enable debug trace -- config.enable_debug_trace = true -- ======================================================================== -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION) -- ======================================================================== execute.config("init")
return { Colors = { Background = Color3.fromRGB(255, 211, 49), --// Background Color of UI Accent = Color3.fromRGB(56, 56, 56), --// Accent Color of UI PrimaryText = Color3.fromRGB(25, 25, 25), --// Primary Text Color SuggestionText = Color3.fromRGB(95, 95, 95), --// Suggestion Text Color Divider = Color3.fromRGB(93, 93, 93), }, Options = { Font = Enum.Font.SciFi, --// UI Font CornerRadius = UDim.new(0, 6), --// Corner Radius of UI BackgroundOpacity = 0.25, --// Background Opacity of UI } }
unit = "km/h" -- DEFAULT function updateUnit(setting, oldValue, newValue, retry) if (eventName == "onClientLoadSettings") then unit = exports.UCDsettings:getSetting("speedunit") elseif (eventName == "onClientSettingChange" and setting == "speedunit") then unit = newValue elseif (eventName == "onClientResourceStart" or retry) then if (not Resource.getFromName("UCDsettings")) then Timer(updateUnit, 5000, 1, _, _, _, true) -- retry in 5 seconds return end unit = exports.UCDsettings:getSetting("speedunit") end end addEventHandler("onClientResourceStart", resourceRoot, updateUnit) addEventHandler("onClientLoadSettings", localPlayer, updateUnit) addEventHandler("onClientSettingChange", localPlayer, updateUnit)
local PING = {} PING.OK = { short = 'PING_OK $(server) $(ip) $(seq) $(ttl) $(time) $(um)', expanded = '64 bytes from $(server) $(ip): icmp_seq=$(seq) ttl=$(ttl) time=$(time) $(um)', expected = {'$(time) <= 200'}, alarm = {'$(time) > 400'} } PING.NAME_RESOLUTION_FAIL = { short = 'PING_NR_FAIL $(server)', expanded = 'ping: $(server): Temporary failure in name resolution', causes = { 'Missing or Wrongly Configured resolv.conf File', 'Firewall Restrictions' }, strategy = { etc_resolv_conf = {}, local_firewall = {} } } PING.NETWORK_UNREACHABLE = { short = 'PING_NET_UNREACHABLE', expanded = 'ping: sendmsg: Network is unreachable', strategy = { etc_resolv_conf = {}, local_firewall = {} } } --[[ PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=121 time=28.7 ms PING www.axity.com (104.22.51.222) 56(84) bytes of data. 64 bytes from 104.22.51.222 (104.22.51.222): icmp_seq=1 ttl=61 time=31.8 ms PING dzlgdtxcws9pb.cloudfront.net (65.8.247.136) 56(84) bytes of data. 64 bytes from 65.8.247.136 (65.8.247.136): icmp_seq=1 ttl=245 time=184 ms PING www.google.com (172.217.192.103) 56(84) bytes of data. 64 bytes from 172.217.192.103: icmp_seq=1 ttl=111 time=28.5 ms PING github.com (140.82.113.3) 56(84) bytes of data. 64 bytes from lb-140-82-113-3-iad.github.com (140.82.113.3): icmp_seq=1 ttl=49 time=261 ms ]]
local ffi = require('ffi') local spi = require('pllj.spi').spi local bit = require("bit") local C = ffi.C; local trigger_event = { when ={ [tonumber(C.TRIGGER_EVENT_BEFORE)] = "before", [tonumber(C.TRIGGER_EVENT_AFTER)] = "after", [tonumber(C.TRIGGER_EVENT_INSTEAD)] = "instead", }, operation = { [tonumber(C.TRIGGER_EVENT_INSERT)] = "insert", [tonumber(C.TRIGGER_EVENT_DELETE)] = "delete", [tonumber(C.TRIGGER_EVENT_UPDATE)] = "update", [tonumber(C.TRIGGER_EVENT_TRUNCATE)] = "truncate", } } local tuple_to_lua_table = require('pllj.tuple_ops').tuple_to_lua_table local lua_table_to_tuple = require('pllj.tuple_ops').lua_table_to_tuple local G_mt if __untrusted__ then G_mt = {__index = _G } else local env = require('pllj.env').env G_mt = {__index = env } end local private_key = {} local private_key_changes = {} local proxy_mt = { __index = function(self, key) return self[private_key][key] end, __newindex = function(self, key, value) self[private_key][private_key_changes] = true self[private_key][key] = value end, } local function track(t) local proxy = {} proxy[private_key] = t setmetatable(proxy, proxy_mt) return proxy end local function trigger_handler(func_struct, fcinfo) if func_struct.prorettype ~= C.TRIGGEROID then return error('wrong trigger function') end local tdata = ffi.cast('TriggerData*', fcinfo.context) local trigger_level = bit.band(tdata.tg_event, C.TRIGGER_EVENT_ROW) and "row" or "statement" local trigger_operation = trigger_event.operation[bit.band(tdata.tg_event, C.TRIGGER_EVENT_OPMASK)] local trigger_when = trigger_event.when[bit.band(tdata.tg_event, C.TRIGGER_EVENT_TIMINGMASK)] local relname = ffi.string(tdata.tg_relation.rd_rel.relname.data) local namespace = ffi.string(C.get_namespace_name(tdata.tg_relation.rd_rel.relnamespace)) local relation_oid = tonumber(tdata.tg_relation.rd_id) local tupleDesc = tdata.tg_relation.rd_att local row = tuple_to_lua_table(tupleDesc, tdata.tg_trigtuple) local old_row if trigger_level == "row" and trigger_operation == "update" then old_row = row row = tuple_to_lua_table(tupleDesc, tdata.tg_newtuple) end local trigger_name = ffi.string(tdata.tg_trigger.tgname) local trigger = { level = trigger_level, operation = trigger_operation, when = trigger_when, name = trigger_name, old = old_row, row = track(row), relation = { namespace = namespace, name = relname, oid = relation_oid } } local newgt = {trigger = trigger} setmetatable(newgt, G_mt) setfenv(func_struct.func, newgt) func_struct.func() if trigger_level == "row" and trigger_when == "before" then if row[private_key_changes] then return true, C.SPI_copytuple(lua_table_to_tuple(tupleDesc, row)) end return true, tdata.tg_trigtuple end end return { trigger_handler = trigger_handler }