content
stringlengths
5
1.05M
object_tangible_storyteller_prop_pr_item_sitholantern3 = object_tangible_storyteller_prop_shared_pr_item_sitholantern3:new { } ObjectTemplates:addTemplate(object_tangible_storyteller_prop_pr_item_sitholantern3, "object/tangible/storyteller/prop/pr_item_sitholantern3.iff")
function SWEP:GetReloadTime() -- Only works with classic mag-fed weapons. local mult = self:GetBuff_Mult("Mult_ReloadTime") local anim = self:SelectReloadAnimation() if !self.Animations[anim] then return false end local full = self:GetAnimKeyTime(anim) * mult local magin = self:GetAnimKeyTime(anim, true) * mult return { full, magin } end function SWEP:SetClipInfo(load) load = self:GetBuff_Hook("Hook_SetClipInfo", load) or load self.LastLoadClip1 = load - self:Clip1() self.LastClip1 = load end function SWEP:Reload() if self:GetOwner():IsNPC() then return end if self:GetInUBGL() then if self:GetNextSecondaryFire() > CurTime() then return end self:ReloadUBGL() return end if self:GetNextPrimaryFire() >= CurTime() then return end --if self:GetNextSecondaryFire() > CurTime() then return end -- don't succumb to -- californication -- if !game.SinglePlayer() and !IsFirstTimePredicted() then return end -- DEBUG --[[] local vm = self.Owner:GetViewModel() vm:SendViewModelMatchingSequence(vm:LookupSequence("reload")) print("reload", CurTime()) if SERVER then PrintMessage(HUD_PRINTTALK, "SERVER: " .. tostring(self:GetOwner()) .. " " .. CurTime()) end if true then self:SetNextPrimaryFire(CurTime() + 2) return end ]] if self.Throwing then return end if self.PrimaryBash then return end if self:HasBottomlessClip() then return end -- with the lite 3D HUD, you may want to check your ammo without reloading local Lite3DHUD = self:GetOwner():GetInfo("arccw_hud_3dfun") == "1" if self:GetOwner():KeyDown(IN_WALK) and Lite3DHUD then return end -- Don't accidently reload when changing firemode if self:GetOwner():GetInfoNum("arccw_altfcgkey", 0) == 1 and self:GetOwner():KeyDown(IN_USE) then return end if self:GetMalfunctionJam() then local r = self:MalfunctionClear() if r then return end end if !self:GetMalfunctionJam() and self:Ammo1() <= 0 and !self:HasInfiniteAmmo() then return end if self:GetBuff_Hook("Hook_PreReload") then return end self.LastClip1 = self:Clip1() local reserve = self:Ammo1() reserve = reserve + self:Clip1() if self:HasInfiniteAmmo() then reserve = self:GetCapacity() + self:Clip1() end local clip = self:GetCapacity() local chamber = math.Clamp(self:Clip1(), 0, self:GetChamberSize()) if self:GetNeedCycle() then chamber = 0 end local load = math.Clamp(clip + chamber, 0, reserve) if !self:GetMalfunctionJam() and load <= self:Clip1() then return end self:SetBurstCount(0) local shouldshotgunreload = self:GetBuff_Override("Override_ShotgunReload") local shouldhybridreload = self:GetBuff_Override("Override_HybridReload") if shouldshotgunreload == nil then shouldshotgunreload = self.ShotgunReload end if shouldhybridreload == nil then shouldhybridreload = self.HybridReload end if shouldhybridreload then shouldshotgunreload = self:Clip1() != 0 end local mult = self:GetBuff_Mult("Mult_ReloadTime") if shouldshotgunreload then local anim = "sgreload_start" local insertcount = 0 local empty = self:Clip1() == 0 --or self:GetNeedCycle() if self.Animations.sgreload_start_empty and empty then anim = "sgreload_start_empty" empty = false insertcount = (self.Animations.sgreload_start_empty or {}).RestoreAmmo or 1 else insertcount = (self.Animations.sgreload_start or {}).RestoreAmmo or 0 end anim = self:GetBuff_Hook("Hook_SelectReloadAnimation", anim) or anim local time = self:GetAnimKeyTime(anim) local time2 = self:GetAnimKeyTime(anim, true) if time2 >= time then time2 = 0 end if insertcount > 0 then self:SetMagUpCount(insertcount) self:SetMagUpIn(CurTime() + time2 * mult) end self:PlayAnimation(anim, mult, true, 0, true, nil, true) self:SetReloading(CurTime() + time * mult) self:SetShotgunReloading(empty and 4 or 2) else local anim = self:SelectReloadAnimation() if !self.Animations[anim] then print("Invalid animation \"" .. anim .. "\"") return end self:PlayAnimation(anim, mult, true, 0, false, nil, true) local reloadtime = self:GetAnimKeyTime(anim, true) * mult local reloadtime2 = self:GetAnimKeyTime(anim, false) * mult self:SetNextPrimaryFire(CurTime() + reloadtime2) self:SetReloading(CurTime() + reloadtime2) self:SetMagUpCount(0) self:SetMagUpIn(CurTime() + reloadtime) end self:SetClipInfo(load) if game.SinglePlayer() then self:CallOnClient("SetClipInfo", tostring(load)) end for i, k in pairs(self.Attachments) do if !k.Installed then continue end local atttbl = ArcCW.AttachmentTable[k.Installed] if atttbl.DamageOnReload then self:DamageAttachment(i, atttbl.DamageOnReload) end end if !self.ReloadInSights then self:ExitSights() self.Sighted = false end self:GetBuff_Hook("Hook_PostReload") end function SWEP:ReloadTimed() -- yeah my function names are COOL and QUIRKY and you can't say a DAMN thing about it. self:RestoreAmmo((self:GetMagUpCount() != 0 and self:GetMagUpCount())) self:SetMagUpCount(0) self:SetLastLoad(self:Clip1()) self:SetNthReload(self:GetNthReload() + 1) end function SWEP:Unload() if !self:GetOwner():IsPlayer() then return end if SERVER then self:GetOwner():GiveAmmo(self:Clip1(), self.Primary.Ammo or "", true) end self:SetClip1(0) end function SWEP:HasBottomlessClip() if GetConVar("arccw_mult_bottomlessclip"):GetBool() then return true end if self.BottomlessClip or self:GetBuff_Override("Override_BottomlessClip") then return true end return false end function SWEP:HasInfiniteAmmo() if GetConVar("arccw_mult_infiniteammo"):GetBool() then return true end if self.InfiniteAmmo or self:GetBuff_Override("Override_InfiniteAmmo") then return true end return false end function SWEP:RestoreAmmo(count) if self:GetOwner():IsNPC() then return end local chamber = math.Clamp(self:Clip1(), 0, self:GetChamberSize()) if self:GetNeedCycle() then chamber = 0 end local clip = self:GetCapacity() count = count or (clip + chamber) local reserve = (self:HasInfiniteAmmo() and math.huge or self:Ammo1()) reserve = reserve + self:Clip1() local load = math.Clamp(self:Clip1() + count, 0, reserve) load = math.Clamp(load, 0, clip + chamber) reserve = reserve - load if !self:HasInfiniteAmmo() then self:GetOwner():SetAmmo(reserve, self.Primary.Ammo, true) end self:SetClip1(load) end -- local lastframeclip1 = 0 SWEP.LastClipOutTime = 0 function SWEP:GetVisualBullets() local reserve = self:Ammo1() local chamber = math.Clamp(self:Clip1(), 0, self:GetChamberSize()) local abouttoload = math.Clamp(self:GetCapacity() + chamber, 0, reserve + self:Clip1()) local h = self:GetBuff_Hook("Hook_GetVisualBullets") if h then return h end if self.LastClipOutTime > CurTime() then return self.LastClip1_B or self:Clip1() else self.LastClip1_B = self:Clip1() if self:GetReloading() and !(self.ShotgunReload or (self.HybridReload and self:Clip1() == 0)) then return abouttoload else return self:Clip1() end end end function SWEP:GetVisualClip() -- local reserve = self:Ammo1() -- local chamber = math.Clamp(self:Clip1(), 0, self:GetChamberSize()) -- local abouttoload = math.Clamp(self:GetCapacity() + chamber, 0, reserve + self:Clip1()) -- local h = self:GetBuff_Hook("Hook_GetVisualClip") -- if h then return h end -- if self.LastClipOutTime > CurTime() then -- return self.LastClip1 or self:Clip1() -- else -- if !self.RevolverReload then -- self.LastClip1 = self:Clip1() -- else -- if self:Clip1() > lastframeclip1 then -- self.LastClip1 = self:Clip1() -- end -- lastframeclip1 = self:Clip1() -- end -- if self:GetReloading() and !(self.ShotgunReload or (self.HybridReload and self:Clip1() == 0)) then -- return abouttoload -- else -- return self.LastClip1 or self:Clip1() -- end -- end local reserve = self:Ammo1() local chamber = math.Clamp(self:Clip1(), 0, self:GetChamberSize()) local abouttoload = math.Clamp(self:GetCapacity() + chamber, 0, reserve + self:Clip1()) local h = self:GetBuff_Hook("Hook_GetVisualClip") if h then return h end if self.LastClipOutTime > CurTime() then return self:GetLastLoad() or self:Clip1() end if self.RevolverReload then if self:GetReloading() and !(self.ShotgunReload or (self.HybridReload and self:Clip1() == 0)) then return abouttoload else return self:GetLastLoad() or self:Clip1() end else return self:Clip1() end end function SWEP:GetVisualLoadAmount() return self.LastLoadClip1 or self:Clip1() end function SWEP:SelectReloadAnimation() local ret if self.Animations.reload_empty and self:Clip1() == 0 then ret = "reload_empty" else ret = "reload" end ret = self:GetBuff_Hook("Hook_SelectReloadAnimation", ret) or ret return ret end function SWEP:ReloadInsert(empty) local total = self:GetCapacity() -- if !game.SinglePlayer() and !IsFirstTimePredicted() then return end if !empty and !self:GetNeedCycle() then total = total + (self:GetChamberSize()) end local mult = self:GetBuff_Mult("Mult_ReloadTime") if self:Clip1() >= total or (self:Ammo1() == 0 and !self:HasInfiniteAmmo()) or ((self:GetShotgunReloading() == 3 or self:GetShotgunReloading() == 5) and self:Clip1() > 0) then local ret = "sgreload_finish" if empty then if self.Animations.sgreload_finish_empty then ret = "sgreload_finish_empty" end if self:GetNeedCycle() then self:SetNeedCycle(false) end end ret = self:GetBuff_Hook("Hook_SelectReloadAnimation", ret) or ret self:PlayAnimation(ret, mult, true, 0, true, nil, true) self:SetReloading(CurTime() + (self:GetAnimKeyTime(ret, true) * mult)) self:SetTimer(self:GetAnimKeyTime(ret, true) * mult, function() self:SetNthReload(self:GetNthReload() + 1) if self:GetOwner():KeyDown(IN_ATTACK2) then self:EnterSights() end end) self:SetShotgunReloading(0) else local insertcount = self:GetBuff_Override("Override_InsertAmount") or 1 local insertanim = "sgreload_insert" local ret = self:GetBuff_Hook("Hook_SelectInsertAnimation", {count = insertcount, anim = insertanim, empty = empty}) if ret then insertcount = ret.count insertanim = ret.anim end local load = self:GetCapacity() + math.min(self:Clip1(), self:GetChamberSize()) if load - self:Clip1() > self:Ammo1() then load = self:Clip1() + self:Ammo1() end self:SetClipInfo(load) if game.SinglePlayer() then self:CallOnClient("SetClipInfo", tostring(load)) end local time = self:GetAnimKeyTime(insertanim, false) local time2 = self:GetAnimKeyTime(insertanim, true) if time2 >= time then time2 = 0 end self:SetMagUpCount(insertcount) self:SetMagUpIn(CurTime() + time2 * mult) self:SetReloading(CurTime() + time * mult) self:PlayAnimation(insertanim, mult, true, 0, true, nil, true) self:SetShotgunReloading(empty and 4 or 2) end end function SWEP:GetCapacity() local clip = self.RegularClipSize or self.Primary.ClipSize if !self.RegularClipSize then self.RegularClipSize = self.Primary.ClipSize end local level = 1 if self:GetBuff_Override("MagExtender") then level = level + 1 end if self:GetBuff_Override("MagReducer") then level = level - 1 end if level == 0 then clip = self.ReducedClipSize elseif level == 2 then clip = self.ExtendedClipSize end clip = self:GetBuff("ClipSize", true, clip) or clip local ret = self:GetBuff_Hook("Hook_GetCapacity", clip) clip = ret or clip clip = math.Clamp(clip, 0, math.huge) self.Primary.ClipSize = clip return clip end function SWEP:GetChamberSize() return self:GetBuff("ChamberSize") --(self:GetBuff_Override("Override_ChamberSize") or self.ChamberSize) + self:GetBuff_Add("Add_ChamberSize") end
return { init_effect = "", name = "提速", time = 240, picture = "", desc = "6s减速", stack = 1, id = 1000000, icon = 310, last_effect = "Darkness", effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onStack", "onRemove" }, arg_list = { attr = "velocity", number = 8000 } } } }
------------------------------------------------------------------------------- -- Mob Framework Settings Mod by Sapier -- -- You may copy, use, modify or do nearly anything except removing this -- copyright notice. -- And of course you are NOT allow to pretend you have written it. -- --! @file path.lua --! @brief path support for mobf --! @copyright Sapier --! @author Sapier --! @date 2013-02-09 -- -- Contact sapier a t gmx net -- Boilerplate to support localized strings if intllib mod is installed. local S if (minetest.get_modpath("intllib")) then dofile(minetest.get_modpath("intllib").."/intllib.lua") S = intllib.Getter(minetest.get_current_modname()) else S = function ( s ) return s end end ------------------------------------------------------------------------------- mobf_assert_backtrace(not core.global_exists("mobf_path")) mobf_path = {} ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] find_path() -- --! @brief workaround for broken mintest find_path function --! @ingroup mobf_path ------------------------------------------------------------------------------- function mobf_path.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm) local interim_path = minetest.find_path(pos1, pos2, searchdistance, max_jump, max_drop, algorithm) if interim_path == nil then return nil end local pos_n_minor_1 = nil local pos_n_minor_2 = nil local path_optimized = {} table.insert(path_optimized, interim_path[1]) for i,v in ipairs(interim_path) do if ( pos_n_minor_1 ~= nil ) and ( pos_n_minor_2 ~= nil) then local x_pitch = pos_n_minor_2.x - v.x local y_pitch = pos_n_minor_2.y - v.y local z_pitch = pos_n_minor_2.z - v.z local x_delta = (pos_n_minor_1.x - pos_n_minor_2.x) / x_pitch; local y_delta = (pos_n_minor_1.y - pos_n_minor_2.y) / y_pitch; local z_delta = (pos_n_minor_1.z - pos_n_minor_2.z) / z_pitch; if (x_pitch ~= 0) and (y_pitch ~= 0) and (x_delta ~= y_delta ) then table.insert(path_optimized, pos_n_minor_1) elseif (y_pitch ~= 0) and (z_pitch ~= 0) and (y_delta ~= z_delta) then table.insert(path_optimized, pos_n_minor_1) elseif (x_pitch ~= 0) and (z_pitch ~= 0) and (y_delta ~= z_delta) then table.insert(path_optimized, pos_n_minor_1) end end pos_n_minor_2 = pos_n_minor_1 pos_n_minor_1 = v end table.insert(path_optimized, interim_path[#interim_path]) return path_optimized end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] init() -- --! @brief initialize path subsystem --! @ingroup mobf_path ------------------------------------------------------------------------------- function mobf_path.init() mobf_path.load() if mobf_rtd.path_data == nil then mobf_rtd.path_data = {} end if mobf_rtd.path_data.users == nil then mobf_rtd.path_data.users = {} end --register path marker entity minetest.register_entity("mobf:path_marker_entity", { physical = false, collisionbox = {-0.5,-0.5,-0.5,0.5,1.5,0.5 }, visual = "mesh", textures = { "mobf_path_marker.png" }, mesh = "mobf_path_marker.b3d", initial_sprite_basepos = {x=0, y=0}, automatic_rotate = 2, on_step = function(self,dtime) if self.creationtime == nil then self.creationtime = 0 end self.creationtime = self.creationtime + dtime if self.creationtime > 30 then self.object:remove() end end }) minetest.register_craftitem(":mobf:path_marker", { description = S("Path marker tool"), image = "mobf_path_marker_item.png", on_place = function(item, placer, pointed_thing) if pointed_thing.type == "node" then local pos = pointed_thing.above local entity = spawning.spawn_and_check("mobf:path_marker_entity", pos,"path_marker_click") if entity ~= nil then mobf_path.handle_path_marker_place(placer,pos) end return item end end }) minetest.register_on_player_receive_fields(mobf_path.button_handler) end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] save() -- --! @brief save all path data --! @ingroup mobf_path ------------------------------------------------------------------------------- function mobf_path.save() mobf_set_world_setting("mobf_path_data",minetest.serialize(mobf_rtd.path_data)) end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] load() -- --! @brief save all path data --! @ingroup mobf_path ------------------------------------------------------------------------------- function mobf_path.load() local paths_raw = mobf_get_world_setting("mobf_path_data") if paths_raw ~= nil then mobf_rtd.path_data = minetest.deserialize(mobf_get_world_setting("mobf_path_data")) end end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] handle_path_marker_place(placer,pos) -- --! @brief initialize path subsystem --! @ingroup mobf_path -- --! @param placer player object placing the path marker --! @param pos position placed at ------------------------------------------------------------------------------- function mobf_path.handle_path_marker_place(placer,pos) mobf_assert_backtrace(placer ~= nil) mobf_assert_backtrace(pos ~= nil) if placer:is_player() then local playername = placer:get_player_name() local player_paths = mobf_path.get_editable_path_names(playername) mobf_path.show_add_point_menu(playername,player_paths,pos) end end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] get_editable_path_names(playername) -- --! @brief get list of pathnames for a player --! @ingroup mobf_path -- --! @param playername name of player to get paths for -- --! @return list of names ------------------------------------------------------------------------------- function mobf_path.get_editable_path_names(playername) if mobf_rtd.path_data.users[playername] == nil then return nil end if mobf_rtd.path_data.users[playername].paths == nil then return nil end local retval = {} for k,v in pairs(mobf_rtd.path_data.users[playername].paths) do if not v.locked then table.insert(retval,k) end end if #retval > 0 then return retval end return nil end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] add_point(playername,pathname,point) -- --! @brief add a point to a path --! @ingroup mobf_path -- --! @param playername name of player to store point --! @param pathname name of path to add point to --! @param point point to add ------------------------------------------------------------------------------- function mobf_path.add_point(playername,pathname,point) if mobf_rtd.path_data.users[playername] == nil then mobf_rtd.path_data.users[playername] = {} end if mobf_rtd.path_data.users[playername].paths == nil then mobf_rtd.path_data.users[playername].paths = {} end if mobf_rtd.path_data.users[playername].paths[pathname] == nil then mobf_rtd.path_data.users[playername].paths[pathname] = {} mobf_rtd.path_data.users[playername].paths[pathname].locked = false mobf_rtd.path_data.users[playername].paths[pathname].points = {} end table.insert(mobf_rtd.path_data.users[playername].paths[pathname].points,point) end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] show_add_point_menu(pathnames) -- --! @brief show a menu containing all paths a point may be added to --! @ingroup mobf_path -- --! @param playername player to show menu --! @param pathnames names of paths --! @param point point to add ------------------------------------------------------------------------------- function mobf_path.show_add_point_menu(playername,pathnames,point) local buttons = "" local y_pos = 0.25 local storage_id = mobf_global_data_store(point) if pathnames ~= nil then for i = 1, #pathnames, 1 do buttons = buttons .. "button_exit[0," .. y_pos .. ";4.5,0.5;" .. "mobfpath:existing:" .. storage_id .. ":" .. pathnames[i] .. ";" .. pathnames[i] .. "]" y_pos = y_pos + 0.75 end end local y_size = y_pos + 3 * 0.75 - 0.25 --add new path element local formspec = "size[4.5," .. y_size .. "]" .. buttons .. "label[0," .. y_pos .. ";-----------------------------]" .. "field[0.25," .. (y_pos + 1) .. ";4.5,0.5;new_path_name;;]" .. "button_exit[1.5," .. (y_pos + 1.5) .. ";1.5,0.5;mobfpath:addnew:" .. storage_id .. ";new path]" --show formspec minetest.show_formspec(playername,"mobf:path:path_name_menu",formspec) end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] button_handler(player, formname, fields) -- --! @brief handle button click in mobf_path menu --! @ingroup mobf_path -- --! @param player player issuing click --! @param formname name of form beeing clicked --! @param fields data submitted to form -- --! @return true/false event has been handled by this handler ------------------------------------------------------------------------------- function mobf_path.button_handler(player, formname, fields) local playername = player:get_player_name() mobf_assert_backtrace(playername ~= nil) if formname == "mobf:path:path_name_menu" then dbg_mobf.path_lvl2("MOBF: Path marker rightclick path selected") for k,v in pairs(fields) do local parts = string.split(k,":") if parts[1] == "mobfpath" then local point = mobf_global_data_get(parts[3]) local pathname = parts[4] if parts[2] == "addnew" then pathname = fields.new_path_name end if point ~= nil and pathname ~= nil and pathname ~= "" then mobf_path.add_point(playername,pathname,point) mobf_path.save() end end end return true end if formname == "mobf:path:add_path_to_entity" then dbg_mobf.path_lvl2("MOBF: Adding path to an entity") for k,v in pairs(fields) do local parts = string.split(k,":") if parts[1] == "mobfpath" then local entity = mobf_global_data_get(parts[2]) local pathname = parts[3] if entity ~= nil and pathname ~= nil and mobf_rtd.path_data.users[playername].paths[pathname] ~= nil and entity.data.patrol ~= nil then --switch to guard state mobf_path.switch_patrol(entity,playername,pathname) end end end return true end --not handled by this callback return false end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] delete_path(ownername,pathname) -- --! @brief show path markers --! @ingroup mobf_path -- --! @param ownername name of path owner --! @param pathname name of path -- ------------------------------------------------------------------------------- function mobf_path.delete_path(ownername, pathname) dbg_mobf.path_lvl1("MOBF: delete path issued: " .. pathname .. " owner: " .. ownername) mobf_rtd.path_data.users[ownername].paths[pathname] = nil mobf_path.save() end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] show_pathmarkers(ownername,pathname) -- --! @brief show path markers --! @ingroup mobf_path -- --! @param ownername name of path owner --! @param pathname name of path -- ------------------------------------------------------------------------------- function mobf_path.show_pathmarkers(ownername,pathname) for i,v in ipairs(mobf_rtd.path_data.users[ownername].paths[pathname].points) do local objects = minetest.get_objects_inside_radius(v,0.5) dbg_mobf.path_lvl3("MOBF: got " .. #objects .. " around pos checking for marker") local found = false; for i=1,#objects,1 do local luaentity = objects[i]:get_luaentity() dbg_mobf.path_lvl3("MOBF: checking: " .. dump(luaentity)) if luaentity.name == "mobf:path_marker_entity" then found = true break end end local node_at = minetest.get_node(v) if not found and node_at.name ~= nil and node_at.name ~= "ignore" then spawning.spawn_and_check("mobf:path_marker_entity",v,"mark_path") end end end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] get_pathlist(playername,isadmin) -- --! @brief get a list of paths for a specific player --! @ingroup mobf_path -- --! @param playername name of player to get paths --! @param isadmin does this player have admin rights? -- --! @return list of paths ------------------------------------------------------------------------------- function mobf_path.get_pathlist(playername,isadmin) local retval = {} if isadmin then for local_playername,userdata in pairs(mobf_rtd.path_data.users) do for pathname,path in pairs(userdata.paths) do dbg_mobf.path_lvl3("MOBF: Adding path: " .. pathname .. " data:" .. dump(path)) local toadd = { ownername = local_playername, pathname = pathname } dbg_mobf.path_lvl3("MOBF: Adding path entry: " .. dump(toadd)) table.insert(retval,toadd) end end else if playername ~= nil and mobf_rtd.path_data.users[playername] ~= nil then for pathname,path in pairs(mobf_rtd.path_data.users[playername].paths) do local toadd = { ownername = playername, pathname = pathname } table.insert(retval,toadd) end end end return retval end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] make_button_name(buttonid,data) -- --! @brief create a button name --! @ingroup mobf_path -- --! @param buttonid id to use for this button --! @param data information to add to this button -- --! @return string containing data ------------------------------------------------------------------------------- function mobf_path.make_button_name(buttonid,data) local retval = buttonid .. ":" if data.pathname ~= nil then retval = retval .. data.pathname .. ":" else retval = retval .. ":" end if data.ownername ~= nil then retval = retval .. data.ownername .. ":" else retval = retval .. ":" end return retval end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] parse_button_name(datastring) -- --! @brief get data from button name --! @ingroup mobf_path -- --! @param datastring name to parse -- --! @return parsed data ------------------------------------------------------------------------------- function mobf_path.parse_button_name(datastring) mobf_assert_backtrace(datastring ~= nil) local data = {} local parts = string.split(datastring,":") data.buttonid = parts[1] data.pathname = parts[2] data.ownername = parts[3] if data.pathname == "" then data.pathname = nil data.ownername = nil end return data end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] mob_rightclick_callback(entity,player) -- --! @brief do rightclick action --! @ingroup mobf_path -- --! @param entity mobf rightclicked --! @param player issuing rightclick ------------------------------------------------------------------------------- function mobf_path.mob_rightclick_callback(entity,player) local playername = player:get_player_name() if entity.dynamic_data.spawning.spawner ~= playername then core.show_formspec(playername,"mobf:path:add_path_to_entity", "size[4,1]label[0,0;This is not your mob keep away!]" .. "button_exit[1,0.75;2,0.5;btn_exit;Okay Okay!]") return end if entity.dynamic_data.patrol_state_before ~= nil then mobf_path.switch_patrol(entity,nil,nil) else local buttons = "" local y_pos = 0.25 local storage_id = mobf_global_data_store(entity) local playername = player:get_player_name() local pathlist = mobf_path.get_pathlist(playername,false) dbg_mobf.path_lvl2("MOBF: Pathlist contains: " .. dump(pathlist)) for i = 1, #pathlist, 1 do buttons = buttons .. "button_exit[0," .. y_pos .. ";4.5,0.5;" .. "mobfpath:" .. storage_id .. ":" .. pathlist[i].pathname .. ";" .. pathlist[i].pathname .. "]" y_pos = y_pos + 0.75 end local y_size = y_pos - 0.25 local formspec = "size[4.5," .. y_size .. "]" .. buttons --show formspec core.show_formspec(playername,"mobf:path:add_path_to_entity",formspec) end end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] config_check(entity) -- --! @brief check if mob is configured as trader --! @ingroup mobf_path -- --! @param entity mob being checked --! @return true/false if trader or not ------------------------------------------------------------------------------- function mobf_path.config_check(entity) if entity.data.patrol ~= nil then return true end return false end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] buttontext(entity) -- --! @brief return text for rightclick button --! @ingroup mobf_path -- --! @param entity to get text for --! @return buttonname ------------------------------------------------------------------------------- function mobf_path.buttontext(entity) if entity.dynamic_data.patrol_state_before == nil then return "Select path" end return "Disable path" end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] switch_patrol(entity,points) -- --! @brief check if mob is configured as trader --! @ingroup mobf_path -- --! @param entity mob being switched --! @param pathowner owner of path to switch to --! @param pathname path to switch to ------------------------------------------------------------------------------- function mobf_path.switch_patrol(entity,pathowner,pathname) if pathowner ~= nil and pathname ~= nil and entity.data.patrol.state ~= nil then if entity.dynamic_data.patrol_state_before == nil then if entity.dynamic_data.state.current ~= entity.data.patrol.state then entity.dynamic_data.patrol_state_before = entity.dynamic_data.state.current else entity.dynamic_data.patrol_state_before = "default" end mob_state.lock(entity,true) end local new_state = mob_state.get_state_by_name(entity,entity.data.patrol.state) mobf_assert_backtrace(new_state ~= nil) mob_state.change_state(entity,new_state) entity.dynamic_data.p_movement.pathowner = pathowner entity.dynamic_data.p_movement.pathname = pathname entity.dynamic_data.p_movement.path = mobf_rtd.path_data.users[pathowner].paths[pathname].points entity.dynamic_data.p_movement.next_path_index = 1 else if entity.dynamic_data.patrol_state_before ~= nil then local new_state = mob_state.get_state_by_name(entity,entity.dynamic_data.patrol_state_before) if new_state == nil then new_state = mob_state.get_state_by_name(entity,"default") end mobf_assert_backtrace(new_state ~= nil) mob_state.change_state(entity,new_state) entity.dynamic_data.patrol_state_before = nil mob_state.lock(entity,false) end end end ------------------------------------------------------------------------------- -- @function [parent=#mobf_path] getpoints(owner,name) -- --! @brief get a path by owner and name --! @ingroup mobf_path -- --! @param pathowner player owning the path --! @param pathname name of path --! @return list of points ------------------------------------------------------------------------------- function mobf_path.getpoints(pathowner,pathname) if mobf_rtd.path_data.users[pathowner] == nil then dbg_mobf.path_lvl2("MOBF: no paths for " .. dump(pathowner) .. " found") return nil end if mobf_rtd.path_data.users[pathowner].paths[pathname] == nil then dbg_mobf.path_lvl2( "MOBF: no path " .. dump(pathname) .. " found for owner " .. pathowner .. " have paths: " .. dump(mobf_rtd.path_data.users[pathowner].paths)) return nil end return mobf_rtd.path_data.users[pathowner].paths[pathname].points end
local props = { { Model = "prop_npc_phone_02", Bone = 0x6F06, Offset = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } } } Config = { EnabledControls = { 30, 31, 32, 33, 34, 35, 59, 60, 61, 62, 63, 64, 249 }, Kvp = "roleplay_device-%s-%s", LocalData = { ["options/background"] = true, ["options/notify"] = true, ["options/ringtone"] = true, }, Anims = { Call = { Dict = "cellphone@str", Name = "cellphone_call_listen_c", Flag = 49, Props = props, }, }, Devices = { ["phone"] = { name = "Phone", item = "Mobile Phone", anim = { Sequence = { { Dict = "cellphone@", Name = "cellphone_text_in", Flag = 50, Duration = 700, }, { Dict = "cellphone@", Name = "cellphone_text_read_base", Flag = 49, Props = props, }, { Dict = "cellphone@", Name = "cellphone_text_out", Flag = 48, Duration = 600, }, }, }, }, ["tablet"] = { name = "Tablet", item = "Tablet", anim = { Dict = "amb@code_human_in_bus_passenger_idles@female@tablet@base", Name = "base", Flag = 49, Props = { { Model = "prop_cs_tablet", Bone = 60309, Offset = { 0.03, 0.002, 0.0, 10.0, -20.0, 0.0 } } } }, }, }, }
local UnitTest = require("luatest.UnitTest") require("examples.Example_01") require("examples.Example_02") UnitTest.main()
-- Copyright (c) Jérémie N'gadi -- -- All rights reserved. -- -- Even if 'All rights reserved' is very clear : -- -- You shall not use any piece of this software in a commercial product / service -- You shall not resell this software -- You shall not provide any facility to install this particular software in a commercial product / service -- If you redistribute this software, you must link to ORIGINAL repository at https://github.com/ESX-Org/es_extended -- This copyright should appear in every part of the project code -- Immediate definitions local _print = print print = function(...) local args = {...} local str = '[^4esx^7]' for i=1, #args, 1 do str = str .. ' ' .. tostring(args[i]) end _print(str) end local tableIndexOf = function(t, val) for i=1, #t, 1 do if t[i] == val then return i end end return -1 end -- ESX base ESX = {} ESX.Loaded = false ESX.Ready = false ESX.Modules = {} ESX.TimeoutCount = 1 ESX.CancelledTimeouts = {} ESX.GetConfig = function() return Config end ESX.LogError = function(err, loc) loc = loc or '<unknown location>' print(debug.traceback('^1[error] in ^5' .. loc .. '^7\n\n^5message: ^1' .. err .. '^7\n')) end ESX.EvalFile = function(resource, file, env) env = env or {} env._G = env local code = LoadResourceFile(resource, file) local fn = load(code, '@' .. resource .. ':' .. file, 't', env) local success = true local status, result = xpcall(fn, function(err) success = false ESX.LogError(err, trace, '@' .. resource .. ':' .. file) end) return env, success end ESX.SetTimeout = function(msec, cb) local id = (ESX.TimeoutCount + 1 < 65635) and (ESX.TimeoutCount + 1) or 1 SetTimeout(msec, function() if ESX.CancelledTimeouts[id] then ESX.CancelledTimeouts[id] = nil else cb() end end) ESX.TimeoutCount = id; return id end ESX.ClearTimeout = function(id) ESX.CancelledTimeouts[id] = true end ESX.SetInterval = function(msec, cb) local id = (ESX.TimeoutCount + 1 < 65635) and (ESX.TimeoutCount + 1) or 1 local run run = function() ESX.SetTimeout(msec, function() if ESX.CancelledTimeouts[id] then ESX.CancelledTimeouts[id] = nil else cb() run() end end) end ESX.TimeoutCount = id; run() return id end ESX.ClearInterval = function(id) ESX.CancelledTimeouts[id] = true end -- ESX main module ESX.Modules['boot'] = {} local self = ESX.Modules['boot'] local resName = GetCurrentResourceName() local modType = IsDuplicityVersion() and 'server' or 'client' self.CoreEntries = json.decode(LoadResourceFile(resName, 'modules/__core__/modules.json')) self.Entries = json.decode(LoadResourceFile(resName, 'modules.json')) self.CoreOrder = {} self.Order = {} self.GetModuleEntryPoints = function(name) local isCore = self.IsCoreModule(name) local prefix = isCore and '__core__/' or '' local shared, current = false, false if LoadResourceFile(resName, 'modules/' .. prefix .. name .. '/shared/module.lua') ~= nil then shared = true end if LoadResourceFile(resName, 'modules/' .. prefix .. name .. '/' .. modType .. '/module.lua') ~= nil then current = true end return shared, current end self.IsCoreModule = function(name) return tableIndexOf(self.CoreEntries, name) ~= -1 end self.IsUserModule = function(name) return tableIndexOf(self.Entries, name) ~= -1 end self.DoesModuleExist = function(name) return self.IsCoreModule(name) or self.IsUserModule(name) end self.ModuleHasEntryPoint = function(name) local isCore = self.IsCoreModule(name) local shared, current = self.GetModuleEntryPoints(name, isCore) return shared or current end self.createModuleEnv = function(name, isCore) local env = {} for k,v in pairs(env) do env[k] = v end env.__RESOURCE__ = resName env.__ISCORE__ = isCore env.__MODULE__ = name env.module = {} env.self = env.module env.M = self.LoadModule env.print = function(...) local args = {...} local str = '[^3' .. name .. '^7]' for i=1, #args, 1 do str = str .. ' ' .. tostring(args[i]) end print(str) end local menv = setmetatable(env, {__index = _G, __newindex = _G}) env._ENV = menv env.module.__ENV__ = menv return env end self.LoadModule = function(name) local isCore = self.IsCoreModule(name) local prefix = isCore and '__core__/' or '' if ESX.Modules[name] == nil then if not self.DoesModuleExist(name) then ESX.LogError('module [' .. name .. '] is not declared in modules.json', '@' .. resName .. ':modules/__core__/__main__/module.lua') end TriggerEvent('esx:module:load:before', name, isCore) local menv = self.createModuleEnv(name, isCore) local shared, current = self.GetModuleEntryPoints(name, isCore) local env, success = nil, true local _env, _success if shared then env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/shared/module.lua', menv) if _success then env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/shared/events.lua', env) else success = false end if _success then env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/shared/main.lua', env) else success = false end end if current then if env then env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/' .. modType .. '/module.lua', env) else env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/' .. modType .. '/module.lua', menv) end if _success then env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/' .. modType .. '/events.lua', env) else success = false end if _success then env, _success = ESX.EvalFile(resName, 'modules/' .. prefix .. name .. '/' .. modType .. '/main.lua', env) else success = false end end if success then ESX.Modules[name] = env['module'] if isCore then self.CoreOrder[#self.CoreOrder + 1] = name else self.Order[#self.Order + 1] = name end TriggerEvent('esx:module:load:done', name, isCore) else ESX.LogError('module [' .. name .. '] does not exist', '@' .. resName .. ':modules/__core__/__main__/module.lua') TriggerEvent('esx:module:load:error', name, isCore) return nil, true end end return ESX.Modules[name], false end M = self.LoadModule
return { description = "Replaces the Lua REPL with an advanced version.", dependencies = { "bin/lua.lua", "lib/stack_trace.lua" }, -- When updating the defaults, one should also update bin/lua.lua settings = { { name = "mbs.lua.enabled", description = "Whether the extended Lua REPL is enabled.", default = true, }, { name = "mbs.lua.history_file", description = "The file to save history to. Set to false to disable.", default = ".lua_history", }, { name = "mbs.lua.history_max", description = "The maximum size of the history file", default = 1e4, }, { name = "mbs.lua.traceback", description = "Show an error traceback when an input errors", default = true, }, { name= "mbs.lua.pretty_height", description = "The height to fit the pretty-printer output to. Set to " .. "false to disable, true to use the terminal height or a number for a constant height.", default = true, }, }, enabled = function() return settings.get("mbs.lua.enabled") end, setup = function(path) if not _G["stack_trace"] then os.loadAPI(fs.combine(path, "lib/stack_trace.lua")) if not _G["stack_trace"] then _G["stack_trace"] = _G["stack_trace.lua"] end end shell.setAlias("lua", "/" .. fs.combine(path, "bin/lua.lua")) end }
-- Copyright (c) 2021 Kirazy -- Part of Artisanal Reskins: Bob's Mods -- -- See LICENSE in the project directory for license information. -- Check to see if reskinning needs to be done. if not (reskins.bobs and reskins.bobs.triggers.plates.technologies) then return end -- Setup inputs local inputs = { mod = "bobs", group = "plates", type = "technology", flat_icon = true, } -- Setup light layer extras local function return_technology_light_layer(mod, name, directory) local directory = directory and directory or name return { { icon = reskins.bobs.directory.."/graphics/technology/"..mod.."/"..directory.."/"..name.."-technology-lights.png", icon_size = 256, icon_mipmaps = 4, tint = {1, 1, 1, 0} } } end local technologies = { -- Nuclear -- ["uranium-processing"] = {}, -- uraniuym proc, centri t3 ["thorium-processing"] = {subgroup = "nuclear", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["thorium-fuel-reprocessing"] = {subgroup = "nuclear"}, ["deuterium-fuel-reprocessing"] = {subgroup = "nuclear", image = "deuterium-fuel-reprocessing-pink"}, ["bobingabout-enrichment-process"] = {subgroup = "nuclear", technology_icon_size = 256, technology_icon_mipmaps = 4}, -- ["plutonium-fuel-cell"] = {}, -- plut fuel cell icon, is broken/sized wrong -- ["thorium-plutonium-fuel-cell"] = {}, -- ^^^ -- ["deuterium-fuel-cell-2"] = {}, -- check color from revamp settings? -- Furnaces ["alloy-processing-1"] = {subgroup = "smelting"}, ["chemical-processing-1"] = {subgroup = "smelting"}, ["advanced-material-processing"] = {subgroup = "smelting"}, -- yellow steel ["fluid-furnace"] = {subgroup = "smelting"}, -- yellow fluid steel ["steel-mixing-furnace"] = {subgroup = "smelting"}, -- blue steel ["fluid-mixing-furnace"] = {subgroup = "smelting"}, -- blue fluid steel ["steel-chemical-furnace"] = {subgroup = "smelting"}, -- red steel ["fluid-chemical-furnace"] = {subgroup = "smelting"}, -- red fluid steel ["advanced-material-processing-2"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tint = util.color("ffb700"), icon_name = "advanced-material-processing", technology_icon_extras = return_technology_light_layer(inputs.group, "advanced-material-processing")}, -- yellow electric ["advanced-material-processing-3"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tier = 4, icon_name = "advanced-material-processing", technology_icon_extras = return_technology_light_layer(inputs.group, "advanced-material-processing")}, -- yellow electric ["advanced-material-processing-4"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tier = 5, icon_name = "advanced-material-processing", technology_icon_extras = return_technology_light_layer(inputs.group, "advanced-material-processing")}, -- yellow electric ["electric-chemical-furnace"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tint = util.color("e50000"), icon_name = "electric-chemical-furnace", technology_icon_extras = return_technology_light_layer(inputs.group, "electric-chemical-furnace")}, -- red electric ["electric-mixing-furnace"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tint = util.color("00bfff"), icon_name = "electric-mixing-furnace", technology_icon_extras = return_technology_light_layer(inputs.group, "electric-mixing-furnace")}, -- blue electric ["multi-purpose-furnace-1"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tier = 4, icon_name = "multi-purpose-furnace", technology_icon_extras = return_technology_light_layer(inputs.group, "multi-purpose-furnace")}, -- purple electric ["multi-purpose-furnace-2"] = {technology_icon_size = 256, technology_icon_mipmaps = 4, flat_icon = false, tier = 5, icon_name = "multi-purpose-furnace", technology_icon_extras = return_technology_light_layer(inputs.group, "multi-purpose-furnace")}, -- green electric -- Barreling pumps ["water-bore-1"] = {flat_icon = false, tier = 1, prog_tier = 2, icon_name = "water-bore"}, ["water-bore-2"] = {flat_icon = false, tier = 2, prog_tier = 3, icon_name = "water-bore"}, ["water-bore-3"] = {flat_icon = false, tier = 3, prog_tier = 4, icon_name = "water-bore"}, ["water-bore-4"] = {flat_icon = false, tier = 4, prog_tier = 5, icon_name = "water-bore"}, -- Air compressors ["air-compressor-1"] = {flat_icon = false, tier = 1, prog_tier = 2, icon_name = "air-compressor"}, ["air-compressor-2"] = {flat_icon = false, tier = 2, prog_tier = 3, icon_name = "air-compressor"}, ["air-compressor-3"] = {flat_icon = false, tier = 3, prog_tier = 4, icon_name = "air-compressor"}, ["air-compressor-4"] = {flat_icon = false, tier = 4, prog_tier = 5, icon_name = "air-compressor"}, -- Assorted processes -- ["plastics"] = {}, -- Plastic, plastic pipes -- ["ceramics"] = {}, -- silicon nitride, ceramic bearing, ball bearing, pipes -- ["advanced-oil-processing"] = {}, -- oil recipes ["grinding"] = {subgroup = "processing-steps", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["polishing"] = {subgroup = "processing-steps", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["electrolysis-1"] = {subgroup = "processing-steps", image = "electrolysis", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["electrolysis-2"] = {subgroup = "processing-steps", image = "electrolysis", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["void-fluid"] = {subgroup = "processing-steps", technology_icon_size = 256, technology_icon_mipmaps = 4}, -- Plate processing -- ["aluminium-processing"] = {subgroup = "plates"}, -- ["gold-processing"] = {subgroup = "plates"}, -- gold plate -- ["zinc-processing"] = {subgroup = "plates"}, -- zinc plate, brass, gunmetal, brass gear, brass pipes, brass chest -- ["nickel-processing"] = {}, -- nickel plate -- ["steel-processing"] = {}, -- vanilla fine as is -- ["silicon-processing"] = {}, -- silicon boule, wager, powder -- ["invar-processing"] = {}, -- invar plate -- ["lead-processing"] = {}, -- lead plate, lead oxide -- ["aluminium-processing"] = {}, -- alumina, aluminium plate -- ["cobalt-processing"] = {}, -- cobalt oxide, cobalt plate, copper plate from cobalt, cobalt steel plate, gear, bearing, ball bearing -- ["tungsten-alloy-processing"] = {}, -- copper-tungsten, tungsten carbide, c-tun-pipes -- ["nitinol-processing"] = {}, -- nitinol plate, gear, bearing, ball,. pipes -- ["titanium-processing"] = {}, -- titanium plate, gear, ball, bearing, pipes, chest -- ["tungsten-processing"] = {}, -- tungsten plate, gear, pipe, acid, oxide, powdered -- Gasses -- ["nitrogen-processing"] = {}, -- fluids: nitrogen, nitrogen-dioxide, nitric acid, ammonia, nitric oxide, hydrogen peroxide -- ["chemical-processing-2"] = {}, -- hydro chloride, calcium, ferric chloride, limestone, carbon dioxide, -- Chemicals and fluids processing -- ["lithium-processing"] = {}, -- lithium, lithium chloride, perchlorate, sodium chlorate, perchlorate, (Bob's revamp does something to this?) -- ["nitroglycerin-processing"] = {}, -- glycerol, nitroglycerin, sulfuric and nitric acid -- ["sulfur-processing"] = {}, -- sulfur, sulfuric acid, sulfur-dioxide, hydrogen-sulfide, hydrogen-peroxide, petroleum-gas -- ["heavy-water-processing"] = {}, -- heavy water -- ["deuterium-processing"] = {}, -- heavy water electrolysis -- Gems -- ["gem-processing-1"] = {}, -- cut gems -- ["gem-processing-2"] = {}, -- polished gems -- Alien plates ["alien-blue-research"] = {subgroup = "alien", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["alien-orange-research"] = {subgroup = "alien", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["alien-purple-research"] = {subgroup = "alien", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["alien-yellow-research"] = {subgroup = "alien", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["alien-green-research"] = {subgroup = "alien", technology_icon_size = 256, technology_icon_mipmaps = 4}, ["alien-red-research"] = {subgroup = "alien", technology_icon_size = 256, technology_icon_mipmaps = 4}, -- Fluid Handling ["fluid-handling"] = {flat_icon = false, tier = 1, prog_tier = 2, icon_name = "fluid-handling"}, ["bob-fluid-handling-2"] = {flat_icon = false, tier = 2, prog_tier = 3, icon_name = "fluid-handling"}, ["bob-fluid-handling-3"] = {flat_icon = false, tier = 3, prog_tier = 4, icon_name = "fluid-handling"}, ["bob-fluid-handling-4"] = {flat_icon = false, tier = 4, prog_tier = 5, icon_name = "fluid-handling"}, -- Miscellaneous -- ["gas-canisters"] = {}, -- gas cans } -- Handle nuclear update if reskins.lib.setting("bobmods-plates-nuclearupdate") == true then technologies["nuclear-fuel-reprocessing"] = {subgroup = "nuclear", defer_to_data_updates = true} -- Handle deuterium's default process color if reskins.lib.setting("bobmods-plates-bluedeuterium") == true then technologies["deuterium-fuel-reprocessing"].image = "deuterium-fuel-reprocessing-blue" end else technologies["thorium-fuel-reprocessing"].image = "thorium-fuel-reprocessing-alternate" -- Handle deuterium's alternate process color if reskins.lib.setting("bobmods-plates-bluedeuterium") == true then technologies["deuterium-fuel-reprocessing"].image = "deuterium-fuel-reprocessing-alternate-blue" else technologies["deuterium-fuel-reprocessing"].image = "deuterium-fuel-reprocessing-alternate-pink" end end -- Angel's Compatibility if mods["angelssmelting"] then -- Use metal-mixing sprites to be consistent with new "Filtering Furnace" progression technologies["multi-purpose-furnace-1"].icon_name = "electric-mixing-furnace" technologies["multi-purpose-furnace-1"].technology_icon_extras = return_technology_light_layer(inputs.group, "electric-mixing-furnace") technologies["multi-purpose-furnace-2"].icon_name = "electric-mixing-furnace" technologies["multi-purpose-furnace-2"].technology_icon_extras = return_technology_light_layer(inputs.group, "electric-mixing-furnace") end reskins.lib.create_icons_from_list(technologies, inputs)
return function(PackageId, Name) return Import(LoadedPackages[PackageId].Entrypoints[Name]) end
local mash = { split = {"ctrl", "alt", "cmd"}, corner = {"ctrl", "alt", "shift"}, focus = {"ctrl", "alt"} } -- Resize windows local function adjust(x, y, w, h) return function() local win = hs.window.focusedWindow() if not win then return end local f = win:frame() local max = win:screen():frame() f.w = math.floor(max.w * w) f.h = math.floor(max.h * h) f.x = math.floor((max.w * x) + max.x) f.y = math.floor((max.h * y) + max.y) win:setFrame(f) end end -- top half hs.hotkey.bind(mash.split, "K", adjust(0, 0, 1, 0.5)) -- -- right half hs.hotkey.bind(mash.split, "L", adjust(0.5, 0, 0.5, 1)) -- -- bottom half hs.hotkey.bind(mash.split, "J", adjust(0, 0.5, 1, 0.5)) -- -- left half hs.hotkey.bind(mash.split, "H", adjust(0, 0, 0.5, 1)) -- -- top left hs.hotkey.bind(mash.corner, "J", adjust(0, 0, 0.5, 0.5)) -- -- top right hs.hotkey.bind(mash.corner, "K", adjust(0.5, 0, 0.5, 0.5)) -- -- bottom right hs.hotkey.bind(mash.corner, "L", adjust(0.5, 0.5, 0.5, 0.5)) -- -- bottom left hs.hotkey.bind(mash.corner, "H", adjust(0, 0.5, 0.5, 0.5)) hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function() hs.reload() end) hs.alert.show("Config loaded") hs.hotkey.bind({"cmd", "alt", "ctrl"}, "M", function() local win = hs.window.focusedWindow() win:maximize() end) -- hs.hotkey.bind({"cmd"}, "J", function() -- local app = hs.application.frontmostApplication() -- if app:name() == "Mail" then -- hs.eventtap.keyStroke({}, "down") -- end -- end) --hs.hotkey.bind({"cmd"}, "K", function() -- local app = hs.application.frontmostApplication() -- if app:name() == "Mail" then -- hs.eventtap.keyStroke({}, "up") -- end --end) local function appl(appName) return function() hs.application.launchOrFocus(appName) end end -- hs.hotkey.bind(mash.focus, "H", appl("HipChat")) -- hs.hotkey.bind(mash.focus, "B", appl("Safari")) -- hs.hotkey.bind(mash.focus, "M", appl("Mail")) -- hs.hotkey.bind(mash.focus, "I", appl("iTerm")) -- hs.hotkey.bind({"cmd", "alt", "ctrl"}, "H", function() -- local win = hs.window.focusedWindow() -- local f = win:frame() -- local screen = win:screen() -- local max = screen:frame() -- -- f.x = max.x -- f.y = max.y -- f.w = max.w / 2 -- f.h = max.h -- win:setFrame(f) -- end) -- -- hs.hotkey.bind({"cmd", "alt", "ctrl"}, "J", function() -- local win = hs.window.focusedWindow() -- local f = win:frame() -- local screen = win:screen() -- local max = screen:frame() -- -- f.x = max.x -- f.y = max.y + (max.h / 2) -- f.w = max.w -- f.h = max.h / 2 -- win:setFrame(f) -- end) -- -- hs.hotkey.bind({"cmd", "alt", "ctrl"}, "K", function() -- local win = hs.window.focusedWindow() -- local f = win:frame() -- local screen = win:screen() -- local max = screen:frame() -- -- f.x = max.x -- f.y = max.y -- f.w = max.w -- f.h = max.h / 2 -- win:setFrame(f) -- end) -- -- hs.hotkey.bind({"cmd", "alt", "ctrl"}, "L", function() -- local win = hs.window.focusedWindow() -- local f = win:frame() -- local screen = win:screen() -- local max = screen:frame() -- -- f.x = max.x + (max.w / 2) -- f.y = max.y -- f.w = max.w / 2 -- f.h = max.h -- win:setFrame(f) -- end) -- hs.hotkey.bind({"shift", "cmd", "alt", "ctrl"}, "H", function() local win = hs.window.focusedWindow() local nextScreen = win:screen():previous() win:moveToScreen(nextScreen) end) hs.hotkey.bind({"shift", "cmd", "alt", "ctrl"}, "L", function() local win = hs.window.focusedWindow() local nextScreen = win:screen():next() win:moveToScreen(nextScreen) end)
local jsonConfig = {} local function GetFileName(name) return 'custom/config__' .. name .. '.json' end function jsonConfig.Load(name, default, keyOrderArray) local filename = GetFileName(name) local existingFile = fileDrive.LoadAsync(filename) local result = nil if not existingFile.content then fileDrive.SaveAsync(filename, jsonInterface.encode(default, keyOrderArray)) result = tableHelper.deepCopy(default) else result = jsonInterface.decode(existingFile.content) end return result end return jsonConfig
-- require("testing.ultest-plugin") require("testing.neotest-plugin") require("testing.whichkey-reg")
DownedShipScreenPlay = ScreenPlay:new { numberOfActs = 1, screenplayName = "DownedShipScreenPlay", lootContainers = { 6036667, 6036668, 6036669, 6036670 }, lootLevel = 38, lootGroups = { { groups = { {group = "color_crystals", chance = 3100000}, {group = "junk", chance = 3500000}, {group = "heavy_weapons_consumable", chance = 600000}, {group = "rifles", chance = 600000}, {group = "carbines", chance = 600000}, {group = "pistols", chance = 600000}, {group = "clothing_attachments", chance = 500000}, {group = "armor_attachments", chance = 500000} }, lootChance = 8000000 } }, lootContainerRespawn = 1800 -- 30 minutes } registerScreenPlay("DownedShipScreenPlay", true) function DownedShipScreenPlay:start() if (isZoneEnabled("taanab")) then self:spawnMobiles() self:spawnSceneObjects() self:initializeLootContainers() end end function DownedShipScreenPlay:spawnSceneObjects() --Lower Floor spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_down.iff",-3.5,9,-21.4,6036662,1,0,0,0) --Middle spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_up.iff",-3.5,0,-21.4,6036662,1,0,0,0) spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_down.iff",0.5,9,-21.4,6036661,1,0,0,0) --Left spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_up.iff",0.5,0,-21.4,6036661, 1,0,0,0) spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_down.iff",-7.5,9,-21.4,6036663,1,0,0,0) --Right spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_up.iff",-7.5,0,-21.4,6036663,1,0,0,0) --Upper Floor spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_up.iff",13.5,7,-17.95,6036664,1,0,0,0) spawnSceneObject("taanab", "object/tangible/terminal/terminal_elevator_down.iff",13.5,15,-17.95,6036664,1,0,0,0) end function DownedShipScreenPlay:spawnMobiles() -- Inside Ship, main floor spawnMobile("taanab", "black_sun_thug",600,-15,7,4.2,75,6036635) spawnMobile("taanab", "black_sun_guard",600,1.5,7,2.8,-90,6036635) spawnMobile("taanab", "black_sun_guard",600,1.5,7,-2.9,-90,6036635) spawnMobile("taanab", "black_sun_henchman",600,21.1,7,-10.6,-9,6036639) spawnMobile("taanab", "black_sun_henchman",600,21.8,7,9.4,-151,6036639) spawnMobile("taanab", "black_sun_henchman",600,25.8,7,-3.2,-61,6036639) spawnMobile("taanab", "black_sun_assassin",600,34.5,7,0.1,-90,6036642) spawnMobile("taanab", "black_sun_thug",600,33.6,7,-4.1,-28,6036642) spawnMobile("taanab", "black_sun_thug",600,33.8,7,4.1,-142,6036642) -- Lower level spawnMobile("taanab", "black_sun_henchman",600,-20.3,0,-3.3,-13,6036650) spawnMobile("taanab", "black_sun_henchman",600,-19.9,0,2.6,151,6036650) spawnMobile("taanab", "black_sun_henchman",600,-23.9,0,0.5,92,6036650) spawnMobile("taanab", "black_sun_guard",600,23.5,0,-3.3,-79,6036653) spawnMobile("taanab", "black_sun_guard",600,23.1,0,2.2,-139,6036653) spawnMobile("taanab", "black_sun_guard",600,9.6,0,-3.2,2,6036653) spawnMobile("taanab", "black_sun_guard",600,9.4,0,2.3,-177,6036653) spawnMobile("taanab", "black_sun_assassin",600,31.1,-0.3,-0.6,-90,6036660) spawnMobile("taanab", "black_sun_assassin",600,-4,0,12.9,-180,6036648) spawnMobile("taanab", "black_sun_guard",600,-3.6,0,7.7,-1,6036648) spawnMobile("taanab", "black_sun_thug",600,11.5,7,0.1,90,6036639) spawnMobile("taanab", "black_sun_assassin",600,-25.2,9,3.5,150,6036637) --Outside guards spawnMobile("taanab", "black_sun_henchman",600,3342.1,53.6,-1285.7,-3,0) spawnMobile("taanab", "black_sun_thug",600,3309.3,55.3,-1280.4,0,0) spawnMobile("taanab", "black_sun_thug",600,3305.6,54.5,-1274.3,133,0) --ramp spawnMobile("taanab", "black_sun_guard",600,3320.5,64.1,-1306.6,46,0) end
local function searchProjects() hideKeyboard() output.clear() matches = {} for _, p in ipairs( listProjects( "documents" ) ) do for _, t in ipairs( listProjectTabs( p ) ) do local code = readProjectTab( p .. ":" .. t ) local i = 1 for l in string.gmatch( code, "([^\r\n]*)\r?\n?" ) do if string.find( l, Search ) then table.insert( matches, { project = p, tab = t, line = i, code = l } ) print( p, t, i, l ) end i = i + 1 end end end searched = true end local function drawSearch( y ) fill( 65, 150, 190 ) fontSize( 27 ) local w, h = textSize( "Search(" ) text( "Search(", 36, y ) local w2, h2 = textSize( Search ) fill( 255 ) text( Search, 36 + w, y ) if isKeyboardShowing() then fill( 0, 155, 225, 155 + math.sin( ElapsedTime * 6 ) * 100 ) rect( 36 + w + w2, y, 3, h2 ) end fill( 65, 150, 190 ) text( ")", 36 + w + w2, y ) return y - h2 end local function drawLabel( col, str, y ) fill( col ) fontSize( 17 ) local _, h = textSize( str ) text( str, 36, y ) return y - h end local function drawLine( str, y ) fill( 110 ) fontSize( 11 ) local w = textSize( str ) text( str, 24 - w, y ) end function setup() supportedOrientations( CurrentOrientation ) displayMode( FULLSCREEN ) parameter.text( "Search", "" ) parameter.action( "Go", searchProjects ) font( "Inconsolata" ) textMode( CORNER ) showKeyboard() matches = {} searched = false scroll = HEIGHT - 33 end function draw() background( 30, 32, 40 ) fill( 20, 22, 30 ) rect( 0, 0, 27, HEIGHT ) local y = drawSearch( scroll ) if searched then y = drawLabel( color( 220, 130, 120 ), #matches .. "_MATCHES", y ) local prevTitle = "" for _, match in ipairs( matches ) do local title = "-- " .. match.project .. "/" .. match.tab .. ":" if title ~= prevTitle then y = drawLabel( color( 30, 160, 140 ), title, y ) end prevTitle = title drawLine( match.line, y ) y = drawLabel( color( 225, 230, 245 ), match.code, y ) end end end function touched( touch ) if touch.state == BEGAN and touch.y > scroll - 16 then showKeyboard() else scroll = scroll + touch.deltaY end end function keyboard( key ) if key == "\n" then searchProjects() elseif key == BACKSPACE then Search = string.sub( Search, 1, -2 ) else Search = Search .. key end end
mokk_worldboss_sp = ScreenPlay:new { numberOfActs = 1, planet = "dantooine", } registerScreenPlay("mokk_worldboss_sp", true) ----------------------------- --Start mokk_worldboss ScreenPlay ----------------------------- function mokk_worldboss_sp:start() if (isZoneEnabled(self.planet)) then self:spawnMobiles() print("Mokk Chieftain Loaded") end end ----------------------- --mokk_worldboss Has Spawned ----------------------- function mokk_worldboss_sp:spawnMobiles() local pBoss = spawnMobile("dantooine", "mokk_chieftain", -1, -7046.9, 2.2, -3329.2, -165,0)--Spawn Mokk Chieftain local creature = CreatureObject(pBoss) print("Mokk Chieftain Spawned") createObserver(DAMAGERECEIVED, "mokk_worldboss_sp", "npcDamageObserver", pBoss) createObserver(OBJECTDESTRUCTION, "mokk_worldboss_sp", "bossDead", pBoss)--Mokk Chieftain Has Died Trigger Respawn Function end ----------------------------- --mokk_worldboss Damage Observers ----------------------------- function mokk_worldboss_sp:npcDamageObserver(bossObject, playerObject, damage) local player = LuaCreatureObject(playerObject) local boss = LuaCreatureObject(bossObject) health = boss:getHAM(0) action = boss:getHAM(3) mind = boss:getHAM(6) maxHealth = boss:getMaxHAM(0) maxAction = boss:getMaxHAM(3) maxMind = boss:getMaxHAM(6) ----------------------- --mokk_worldboss Boss 90% health ----------------------- if (((health <= (maxHealth * 0.9)) or (action <= (maxAction * 0.9)) or (mind <= (maxMind * 0.9))) and readData("mokk_worldboss_sp:spawnState") == 0) then writeData("mokk_worldboss_sp:spawnState",1) createEvent(0 * 1000, "mokk_worldboss_sp", "bomb", playerObject, "") self:spawnSupport(playerObject) CreatureObject(playerObject):sendSystemMessage("Enemy Wave Starting!") CreatureObject(bossObject):playEffect("clienteffect/ui_quest_spawn_enemy.cef", "") CreatureObject(bossObject):playEffect("clienteffect/medic_reckless_stimulation.cef", "") spatialChat(bossObject, "Boss Current Health = 90%") end ----------------------- --mokk_worldboss Boss 70% health ----------------------- if (((health <= (maxHealth * 0.7)) or (action <= (maxAction * 0.7)) or (mind <= (maxMind * 0.7))) and readData("mokk_worldboss_sp:spawnState") == 1) then writeData("mokk_worldboss_sp:spawnState",2) createEvent(0 * 1000, "mokk_worldboss_sp", "bomb", playerObject, "") self:spawnSupport(playerObject) CreatureObject(playerObject):sendSystemMessage("Enemy Wave Starting!") CreatureObject(bossObject):playEffect("clienteffect/ui_quest_spawn_enemy.cef", "") CreatureObject(bossObject):playEffect("clienteffect/medic_reckless_stimulation.cef", "") spatialChat(bossObject, "Boss Current Health = 70%") end ----------------------- --mokk_worldboss Boss 50% health ----------------------- if (((health <= (maxHealth * 0.5)) or (action <= (maxAction * 0.5)) or (mind <= (maxMind * 0.5))) and readData("mokk_worldboss_sp:spawnState") == 2) then writeData("mokk_worldboss_sp:spawnState",3) createEvent(0 * 1000, "mokk_worldboss_sp", "bomb", playerObject, "") self:spawnSupport(playerObject) CreatureObject(playerObject):sendSystemMessage("Enemy Wave Starting!") CreatureObject(bossObject):playEffect("clienteffect/ui_quest_spawn_enemy.cef", "") CreatureObject(bossObject):playEffect("clienteffect/medic_reckless_stimulation.cef", "") spatialChat(bossObject, "Boss Current Health = 50%") end ----------------------- --mokk_worldboss Boss 30% health ----------------------- if (((health <= (maxHealth * 0.3)) or (action <= (maxAction * 0.3)) or (mind <= (maxMind * 0.3))) and readData("mokk_worldboss_sp:spawnState") == 3) then writeData("mokk_worldboss_sp:spawnState",4) createEvent(0 * 1000, "mokk_worldboss_sp", "bomb", playerObject, "") self:spawnSupport(playerObject) CreatureObject(playerObject):sendSystemMessage("Enemy Wave Starting!") CreatureObject(bossObject):playEffect("clienteffect/ui_quest_spawn_enemy.cef", "") CreatureObject(bossObject):playEffect("clienteffect/medic_reckless_stimulation.cef", "") spatialChat(bossObject, "Boss Current Health = 30%") end ----------------------- --mokk_worldboss Boss 10% health ----------------------- if (((health <= (maxHealth * 0.1)) or (action <= (maxAction * 0.1)) or (mind <= (maxMind * 0.1))) and readData("mokk_worldboss_sp:spawnState") == 4) then writeData("mokk_worldboss_sp:spawnState",5) createEvent(0 * 1000, "mokk_worldboss_sp", "bomb", playerObject, "") self:spawnSupport(playerObject) CreatureObject(playerObject):sendSystemMessage("Enemy Wave Starting!") CreatureObject(bossObject):playEffect("clienteffect/ui_quest_spawn_enemy.cef", "") CreatureObject(bossObject):playEffect("clienteffect/medic_reckless_stimulation.cef", "") spatialChat(bossObject, "Boss Current Health = 10%") end return 0 end -------------------------------- --Deploy Boss Trigger Trap Bomb -------------------------------- function mokk_worldboss_sp:bomb(playerObject) if (CreatureObject(playerObject):isGrouped()) then local groupSize = CreatureObject(playerObject):getGroupSize() for i = 0, groupSize - 1, 1 do local pMember = CreatureObject(playerObject):getGroupMember(i) if pMember ~= nil and SceneObject(pMember):isInRangeWithObject(playerObject, 200) then local trapDmg = getRandomNumber(2000, 2500) CreatureObject(pMember):inflictDamage(pMember, 0, trapDmg, 1) CreatureObject(pMember):playEffect("clienteffect/underground_explosion.cef", "") CreatureObject(pMember):playEffect("clienteffect/lava_player_burning.cef", "") end end else local trapDmg = getRandomNumber(2000, 2500) CreatureObject(playerObject):inflictDamage(playerObject, 0, trapDmg, 1) CreatureObject(playerObject):playEffect("clienteffect/underground_explosion.cef", "") CreatureObject(playerObject):playEffect("clienteffect/lava_player_burning.cef", "") end end ----------------------- --mokk_worldboss Boss Support ----------------------- function mokk_worldboss_sp:spawnSupport(playerObject) local pGuard1 = spawnMobile("dantooine", "mokk_huurton_reaper", -1, -7053, 2.7, -3350, 16, 0) spatialChat(pGuard1, "!!!!!!!!") CreatureObject(pGuard1):engageCombat(playerObject) CreatureObject(pGuard1):playEffect("clienteffect/attacker_berserk.cef", "") local pGuard2 = spawnMobile("dantooine", "mokk_guard", -1, -7049, 2.5, -3339, -165, 0) spatialChat(pGuard2, "Im coming Boss! Attack you useless mutt!") CreatureObject(pGuard2):engageCombat(playerObject) CreatureObject(pGuard2):playEffect("clienteffect/attacker_berserk.cef", "") end --------------------------------------------------------------- --mokk_worldboss Has Died Respawn NSTamer With A New Dynamic Spawn --------------------------------------------------------------- function mokk_worldboss_sp:bossDead(pBoss) print("Mokk Chieftain Has Died") local creature = CreatureObject(pBoss) createEvent(120 * 1000, "mokk_worldboss_sp", "KillBoss", pBoss, "")--Despawn Corpse createEvent(10800 * 1000, "mokk_worldboss_sp", "KillSpawn", pBoss, "")--Respawn Boss In 3 Hours createEvent(1 * 1000, "mokk_worldboss_sp", "BroadcastDead", pBoss, "")--Broadcast Dead createEvent(10800 * 1000, "mokk_worldboss_sp", "KillSpawnCast3", pBoss, "")--Broadcast Respawn 1 return 0 end ----------------------- -- mokk Boss ----------------------- function mokk_worldboss_sp:KillSpawn() local pBoss = spawnMobile("dantooine", "mokk_chieftain", -1, -7046.9, 2.2, -3329.2, -165,0)--Spawn mokk_worldboss After Death 3 Hour Timer print("Mokk Chieftain Respawned") createObserver(DAMAGERECEIVED, "mokk_worldboss_sp", "npcDamageObserver", pBoss) createObserver(OBJECTDESTRUCTION, "mokk_worldboss_sp", "bossDead", pBoss) end ----------------------------------------------------------------------------- --mokk_worldboss Has Died Without Being Looted, "Abandon" Destroy NPC, Destroy Loot ----------------------------------------------------------------------------- function mokk_worldboss_sp:KillBoss(pBoss) writeData("mokk_worldboss_sp:spawnState",0) dropObserver(pBoss, OBJECTDESTRUCTION) if SceneObject(pBoss) then print("Mokk Chieftain Destroyed") SceneObject(pBoss):destroyObjectFromWorld() end return 0 end ---------------------------- --Broadcast Dead ---------------------------- function mokk_worldboss_sp:BroadcastDead(bossObject) local boss = LuaCreatureObject(bossObject) CreatureObject(bossObject):broadcastToServer("\\#63C8F9 Mokk Chieftain Boss Has Died.") CreatureObject(bossObject):broadcastToDiscord("Mokk Chieftain Boss Has Died.") end ----------------------- --Broadcast Respawn 1 ----------------------- function mokk_worldboss_sp:KillSpawnCast3(bossObject) local boss = LuaCreatureObject(bossObject) CreatureObject(bossObject):broadcastToServer("\\#63C8F9 Mokk Chieftain Boss Respawning.") CreatureObject(bossObject):broadcastToDiscord("Mokk Chieftain Boss Respawning.") end
Config = Config or {} --[[ These values are going to be all the allowed values for settings. Some of these may be dependant on other resources ]]-- Config.Ringtones = { { name = 'Ringtone 1', value = 1 }, { name = 'Ringtone 2', value = 1 }, { name = 'Ringtone 3', value = 1 }, } Config.Settings = { volume = 100, wallpaper = 1, ringtone = 1, text = 1 }
vim.g.minimap_width = 10 vim.g.minimap_auto_start = 0 vim.g.minimap_auto_start_win_enter = 0 vim.g.minimap_highlight_range = 1
--- Ragdolls the humanoid on death -- @classmod RagdollHumanoidOnDeathClient -- @author Quenty local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore")) local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local BaseObject = require("BaseObject") local RagdollBindersClient = require("RagdollBindersClient") local CharacterUtils = require("CharacterUtils") local RagdollRigging = require("RagdollRigging") local RagdollHumanoidOnDeathClient = setmetatable({}, BaseObject) RagdollHumanoidOnDeathClient.ClassName = "RagdollHumanoidOnDeathClient" RagdollHumanoidOnDeathClient.__index = RagdollHumanoidOnDeathClient function RagdollHumanoidOnDeathClient.new(humanid) local self = setmetatable(BaseObject.new(humanid), RagdollHumanoidOnDeathClient) self._maid:GiveTask(self._obj.Died:Connect(function() self:_handleDeath(self._obj) end)) return self end function RagdollHumanoidOnDeathClient:_handleDeath() local player = CharacterUtils.getPlayerFromCharacter(self._obj) if player == Players.LocalPlayer then RagdollBindersClient.Ragdoll:BindClient(self._obj) end local character = self._obj.Parent delay(Players.RespawnTime - 0.5, function() if not character:IsDescendantOf(Workspace) then return end -- fade into the mist... RagdollRigging.disableParticleEmittersAndFadeOutYielding(character, 0.4) end) end return RagdollHumanoidOnDeathClient
slot0 = class("GetCommanderHomeCommand", pm.SimpleCommand) slot0.execute = function (slot0, slot1) slot2 = slot1:getBody() if getProxy(CommanderProxy):GetCommanderHome() then return end pg.ConnectionMgr.GetInstance():Send(25026, { type = 0 }, 25027, function (slot0) slot0:AddCommanderHome(slot1) for slot5, slot6 in ipairs(slot0.slots) do if slot6.commander_id ~= 0 and slot6.commander_level and slot6.commander_level ~= 0 and slot6.commander_exp then slot1:UpdateCommanderLevelAndExp(slot6.commander_id, slot6.commander_level, slot6.commander_exp) end end end) end slot0.UpdateCommanderLevelAndExp = function (slot0, slot1, slot2, slot3) if getProxy(CommanderProxy):getCommanderById(slot1) then slot5:UpdateLevelAndExp(slot2, slot3) slot4:updateCommander(slot5) end end return slot0
-- with this you can turn on/off specific anticheese components, note: you can also turn these off while the script is running by using events, see examples for such below Components = { Teleport = true, GodMode = true, Speedhack = true, WeaponBlacklist = true, CustomFlag = true, } --[[ event examples are: anticheese:SetComponentStatus( component, state ) enables or disables specific components component: an AntiCheese component, such as the ones listed above, must be a string state: the state to what the component should be set to, accepts booleans such as "true" for enabled and "false" for disabled anticheese:ToggleComponent( component ) sets a component to the opposite mode ( e.g. enabled becomes disabled ), there is no reason to use this. component: an AntiCheese component, such as the ones listed above, must be a string anticheese:SetAllComponents( state ) enables or disables **all** components state: the state to what the components should be set to, accepts booleans such as "true" for enabled and "false" for disabled These can be used by triggering them like following: TriggerEvent("anticheese:SetComponentStatus", "Teleport", false) Triggering these events from the clientside is not recommended as these get disabled globally and not just for one player. ]] Users = {} violations = {} RegisterServerEvent("anticheese:timer:b2k") AddEventHandler("anticheese:timer:b2k", function() if Users[source] then if (os.time() - Users[source]) < 15 and Components.Speedhack then -- prevent the player from doing a good old cheat engine speedhack --DropPlayer(source, "Speedhacking") else Users[source] = os.time() end else Users[source] = os.time() end end) AddEventHandler('playerDropped', function() if(Users[source])then Users[source] = nil end end) RegisterServerEvent("anticheese:kick") AddEventHandler("anticheese:kick", function(reason) DropPlayer(source, reason) end) RegisterServerEvent("anticheese:SetComponentStatus") AddEventHandler("anticheese:SetComponentStatus", function(component, state) if source ~= "" then SendWebhookMessage(ac_webhook_gameplay,"**"..GetPlayerName(source).." Tried Bypassing :cheese: and was swiftly banned**") TriggerEvent("banCheater", source,"Cheating") return end if type(component) == "string" and type(state) == "boolean" then Components[component] = state -- changes the component to the wished status end end) RegisterServerEvent("anticheese:ToggleComponent") AddEventHandler("anticheese:ToggleComponent", function(component) if source ~= "" then SendWebhookMessage(ac_webhook_gameplay,"**"..GetPlayerName(source).." Tried Bypassing :cheese: and was swiftly banned**") TriggerEvent("banCheater", source,"Cheating") return end if type(component) == "string" then Components[component] = not Components[component] end end) RegisterServerEvent("anticheese:SetAllComponents") AddEventHandler("anticheese:SetAllComponents", function(state) if source ~= "" then SendWebhookMessage(ac_webhook_gameplay,"**"..GetPlayerName(source).." Tried Bypassing :cheese: and was swiftly banned**") TriggerEvent("banCheater", source,"Cheating") return end if type(state) == "boolean" then for i,theComponent in pairs(Components) do Components[i] = state end end end) Citizen.CreateThread(function() ac_webhook_joins = GetConvar("ac_webhook_joins", "none") ac_webhook_gameplay = GetConvar("ac_webhook_gameplay", "none") ac_webhook_bans = GetConvar("ac_webhook_bans", "none") ac_webhook_wl = GetConvar("ac_webhook_wl", "none") ac_webhook_arsenal = GetConvar("ac_webhook_arsenal", "none") ac_webhook_keys = GetConvar("ac_webhook_keys", "none") function SendWebhookMessage(webhook,message) if webhook ~= "none" then PerformHttpRequest(webhook, function(err, text, headers) end, 'POST', json.encode({content = message}), { ['Content-Type'] = 'application/json' }) end end function WarnPlayer(playername, reason) local isKnown = false local isKnownCount = 1 local isKnownExtraText = "" for i,thePlayer in ipairs(violations) do if thePlayer.name == name then isKnown = true if violations[i].count == 3 then TriggerEvent("banCheater", source,"Cheating") isKnownCount = violations[i].count table.remove(violations,i) isKnownExtraText = ", was banned." else violations[i].count = violations[i].count+1 isKnownCount = violations[i].count end end end if not isKnown then table.insert(violations, { name = name, count = 1 }) end return isKnown, isKnownCount,isKnownExtraText end function GetPlayerNeededIdentifiers(player) local ids = GetPlayerIdentifiers(player) for i,theIdentifier in ipairs(ids) do if string.find(theIdentifier,"license:") or -1 > -1 then license = theIdentifier elseif string.find(theIdentifier,"steam:") or -1 > -1 then steam = theIdentifier end end if not steam then steam = "steam: missing" end return license, steam end RegisterServerEvent('AntiCheese:SpeedFlag') AddEventHandler('AntiCheese:SpeedFlag', function(rounds, roundm) if Components.Speedhack and not IsPlayerAceAllowed(source,"anticheese.bypass") then license, steam = GetPlayerNeededIdentifiers(source) name = GetPlayerName(source) isKnown, isKnownCount, isKnownExtraText = WarnPlayer(name,"Speed Hacking") SendWebhookMessage(ac_webhook_gameplay, "**Speed Hacker!** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\nWas travelling "..rounds.. " units. That's "..roundm.." more than normal! \nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") end end) RegisterServerEvent('AntiCheese:NoclipFlag') AddEventHandler('AntiCheese:NoclipFlag', function(distance) if Components.Speedhack and not IsPlayerAceAllowed(source,"anticheese.bypass") then license, steam = GetPlayerNeededIdentifiers(source) name = GetPlayerName(source) isKnown, isKnownCount, isKnownExtraText = WarnPlayer(name,"Noclip/Teleport Hacking") SendWebhookMessage(ac_webhook_gameplay,"**Noclip/Teleport!** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\nCaught with "..distance.." units between last checked location\nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") end end) RegisterServerEvent('AntiCheese:CustomFlag') AddEventHandler('AntiCheese:CustomFlag', function(reason,extrainfo) if Components.CustomFlag and not IsPlayerAceAllowed(source,"anticheese.bypass") then license, steam = GetPlayerNeededIdentifiers(source) name = GetPlayerName(source) if not extrainfo then extrainfo = "no extra informations provided" end isKnown, isKnownCount, isKnownExtraText = WarnPlayer(name,reason) SendWebhookMessage(ac_webhook_gameplay,"**"..reason.."** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\n"..extrainfo.."\nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") end end) RegisterServerEvent('AntiCheese:HealthFlag') AddEventHandler('AntiCheese:HealthFlag', function(invincible,oldHealth, newHealth, curWait) if Components.GodMode and not IsPlayerAceAllowed(source,"anticheese.bypass") then license, steam = GetPlayerNeededIdentifiers(source) name = GetPlayerName(source) isKnown, isKnownCount, isKnownExtraText = WarnPlayer(name,"Health Hacking") if invincible then SendWebhookMessage(ac_webhook_gameplay,"**Health Hack!** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\nRegenerated "..newHealth-oldHealth.."hp ( to reach "..newHealth.."hp ) in "..curWait.."ms! ( PlayerPed was invincible )\nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") else SendWebhookMessage(ac_webhook_gameplay,"**Health Hack!** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\nRegenerated "..newHealth-oldHealth.."hp ( to reach "..newHealth.."hp ) in "..curWait.."ms! ( Health was Forced )\nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") end end end) RegisterServerEvent('AntiCheese:JumpFlag') AddEventHandler('AntiCheese:JumpFlag', function(jumplength) if Components.SuperJump and not IsPlayerAceAllowed(source,"anticheese.bypass") then license, steam = GetPlayerNeededIdentifiers(source) name = GetPlayerName(source) isKnown, isKnownCount, isKnownExtraText = WarnPlayer(name,"SuperJump Hacking") SendWebhookMessage(ac_webhook_gameplay,"**SuperJump Hack!** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\nJumped "..jumplength.."ms long\nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") end end) RegisterServerEvent('AntiCheese:WeaponFlag') AddEventHandler('AntiCheese:WeaponFlag', function(weapon) if Components.WeaponBlacklist and not IsPlayerAceAllowed(source,"anticheese.bypass") then license, steam = GetPlayerNeededIdentifiers(source) name = GetPlayerName(source) isKnown, isKnownCount, isKnownExtraText = WarnPlayer(name,"Inventory Cheating") SendWebhookMessage(ac_webhook_gameplay,"**Inventory Hack!** \n```\nUser:"..name.."\n"..license.."\n"..steam.."\nGot Weapon: "..weapon.."( Blacklisted )\nAnticheat Flags:"..isKnownCount..""..isKnownExtraText.." ```") end end) end)
mars_extra = class({}) mars_extra_recast = class({}) LinkLuaModifier("modifier_mars_extra_recast", "abilities/heroes/mars/mars_extra/modifier_mars_extra_recast", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_mars_soldier", "abilities/heroes/mars/modifier_mars_soldier", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_mars_soldier_debuff", "abilities/heroes/mars/modifier_mars_soldier_debuff", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_mars_soldier_displacement", "abilities/heroes/mars/modifier_mars_soldier_displacement", LUA_MODIFIER_MOTION_BOTH) function mars_extra:GetCastAnimationCustom() return ACT_DOTA_GENERIC_CHANNEL_1 end function mars_extra:GetPlaybackRateOverride() return 2.0 end function mars_extra:GetCastPointSpeed() return 10 end function mars_extra:OnSpellStart() local caster = self:GetCaster() local origin = caster:GetAbsOrigin() local point = ClampPosition(origin, CustomAbilitiesLegacy:GetCursorPosition(self), self:GetCastRange(Vector(0,0,0), nil), nil) local direction = (origin - point):Normalized() local duration = 5.0 local radius = self:GetSpecialValueFor('radius') local spawnPoint = point + (direction * radius * -1) local callback = function(unit) CustomEntitiesLegacy:FullyFaceTowards(unit, direction) unit:SetNeverMoveToClearSpace(true) unit:AddNewModifier( caster, -- player source self, -- ability source "modifier_mars_soldier", -- modifier name { duration = duration, model = 1, fade = 0, marker = 1, x = direction.x, y = direction.y, radius = radius, } -- kv ) unit:SetModelScale(1.3) EFX("particles/mars/mars_extra.vpcf", PATTACH_ABSORIGIN_FOLLOW, unit, { cp1 = unit:GetAbsOrigin(), release = true }) EFX("particles/units/heroes/hero_invoker_kid/invoker_kid_forge_spirit_ambient.vpcf", PATTACH_ABSORIGIN_FOLLOW, unit, { release = true }) EFX("particles/items_fx/aegis_respawn_aegis_trail.vpcf", PATTACH_ABSORIGIN_FOLLOW, unit, { release = true }) unit:StartGesture(ACT_DOTA_SPAWN) EmitSoundOn('Hero_Mars.Spear.Root', unit) end local unit = CreateUnitByNameAsync( "npc_dota_mars_ultimate_soldier", spawnPoint, false, caster, nil, caster:GetTeamNumber(), callback ) if self:GetName() == 'mars_extra' then if self:GetLevel() == 2 then caster:AddNewModifier(caster, self, "modifier_mars_extra_recast", { duration = 1.5 }) end end end mars_extra_recast.GetCastAnimationCustom = mars_extra.GetCastAnimationCustom mars_extra_recast.GetPlaybackRateOverride = mars_extra.GetPlaybackRateOverride mars_extra_recast.GetCastPointSpeed = mars_extra.GetCastPointSpeed mars_extra_recast.OnSpellStart = mars_extra.OnSpellStart if IsClient() then require("wrappers/abilities") end Abilities.Castpoint(mars_extra) Abilities.Castpoint(mars_extra_recast)
CoreTrash = CreateFrame("Frame") CoreTrashConfig = {} CoreTrashConfig.enabled = false trashList = { "Troll Sweat", "Broken Obsidian Club", "Cracked Pottery", "Crusted Bandages", "Thick Scaly Tail", "Turtle Meat", "Tarnished Silver Necklace", "Moonberry Juice", "Cured Ham Steak", "Gelatinous Goo", "Slimy Ichor", "Raw Black Truffle", "Khadgar's Whisker", "Earthroot", "Silverleaf", "Mageroyal", "Broken Weapon", "Peacebloom", "Lifeless Skull"} function trash(item) for k, v in pairs(trashList) do if v and item:find(v) then return true end end return false end CoreTrash:SetScript("OnUpdate", function() if (CoreTrash.tick or 2) > GetTime() then return else CoreTrash.tick = GetTime() + 2 end if CoreTrashConfig.enabled then for bag = 0, 4 do for bagSlot = 1, GetContainerNumSlots(bag) do local item = GetContainerItemLink(bag, bagSlot) if item and trash(item) then PickupContainerItem(bag, bagSlot) DeleteCursorItem() end end end end end)
local dev = GetSelf() local update_time_step = 0.1 make_default_activity(update_time_step) --update will be called 10 times per second local sensor_data = get_base_data() -- Const local degrees_per_radian = 57.2957795 local feet_per_meter_per_minute = 196.8 -- Variables local DC_BUS_V = get_param_handle("DC_BUS_V") local ias = get_param_handle("D_IAS") local mach = get_param_handle("D_MACH") local AOA = get_param_handle("D_AOA") local hdg = get_param_handle("D_HDG") local vv = get_param_handle("D_VV") local altitude_source = get_param_handle("ALT_SOURCE") local altitude = get_param_handle("D_ALT") local RPMG = get_param_handle("D_RPMG") local RPMD = get_param_handle("D_RPMD") local test = get_param_handle("D_TEST") local pitch = get_param_handle("D_PITCH") local L_VD_G = get_param_handle("L_VD_G") local L_VD_D = get_param_handle("L_VD_D") local ELEC_P2 = get_param_handle("ELEC_P2") local FLAPSPOS = get_param_handle("FLAPSPOS") local COCKPIT = get_param_handle("COCKPIT") -- Initialisation DC_BUS_V:set(0) mach:set(0.0) AOA:set(0.0) ias:set(0.0) hdg:set(0.0) vv:set(0.0) altitude:set(0.0) RPMG:set(0.0) RPMD:set(0.0) test:set(0.0) pitch:set(0.0) L_VD_G:set(0.0) L_VD_D:set(0.0) FLAPSPOS:set(0.0) COCKPIT:set(0.0) function post_initialize() electric_system = GetDevice(3) --devices["ELECTRIC_SYSTEM"] -- print("post_initialize called") end function SetCommand(command,value) end function update() ias:set(sensor_data.getIndicatedAirSpeed()*1.9438444924574) mach:set(sensor_data.getMachNumber()) AOA:set(sensor_data.getAngleOfAttack()*degrees_per_radian) hdg:set(360-(sensor_data.getHeading()*degrees_per_radian)) vv:set(sensor_data.getVerticalVelocity()*feet_per_meter_per_minute) RPMG:set(sensor_data.getEngineLeftRPM()) -- sensor_data.getEngineLeftRPM() RPMD:set(sensor_data.getEngineRightRPM()) pitch:set(sensor_data.getStickRollPosition()) -- *degrees_per_radian test:set(sensor_data.getHorizontalAcceleration()) FLAPSPOS:set(sensor_data.getFlapsPos()) COCKPIT:set(sensor_data.getCanopyPos()) -- Altitude local barometric_altitude = sensor_data.getBarometricAltitude()*3.28084 local radar_altitude = sensor_data.getRadarAltitude()*3.28084 if radar_altitude > 495 then altitude:set(barometric_altitude) altitude_source:set("B") else altitude:set(radar_altitude) altitude_source:set("R") end -- Light Vanne Decharge if RPMG:get() > 5 and RPMG:get() < 80 and ELEC_P2:get() == 1 then L_VD_G:set(1) else L_VD_G:set(0) end if RPMD:get() > 5 and RPMD:get() < 80 and ELEC_P2:get() == 1 then L_VD_D:set(1) else L_VD_D:set(0) end -- Dinosaur electric system if electric_system ~= nil then local DC_V = electric_system:get_DC_Bus_1_voltage() local prev_val = DC_BUS_V:get() -- add some dynamic: DC_V = prev_val + (DC_V - prev_val) * update_time_step DC_BUS_V:set(DC_V) end end need_to_be_closed = false -- close lua state after initialization -- getAngleOfAttack -- getAngleOfSlide -- getBarometricAltitude -- getCanopyPos -- getCanopyState -- getEngineLeftFuelConsumption -- -- getEngineLeftRPM -- getEngineLeftTemperatureBeforeTurbine -- getEngineRightFuelConsumption -- getEngineRightRPM -- getEngineRightTemperatureBeforeTurbine -- getFlapsPos -- getFlapsRetracted -- getHeading -- getHelicopterCollective -- getHelicopterCorrection -- getHorizontalAcceleration -- getIndicatedAirSpeed -- getLandingGearHandlePos -- getLateralAcceleration -- getLeftMainLandingGearDown -- getLeftMainLandingGearUp -- getMachNumber -- getMagneticHeading -- getNoseLandingGearDown -- getNoseLandingGearUp -- getPitch -- getRadarAltitude -- getRateOfPitch -- getRateOfRoll -- getRateOfYaw -- getRightMainLandingGearDown -- getRightMainLandingGearUp -- getRoll -- getRudderPosition -- -- getSpeedBrakePos -- getStickPitchPosition -- getStickRollPosition -- getThrottleLeftPosition -- getThrottleRightPosition -- getTotalFuelWeight -- getTrueAirSpeed -- getVerticalAcceleration -- getVerticalVelocity -- getWOW_LeftMainLandingGear -- getWOW_NoseLandingGear -- getWOW_RightMainLandingGear
-- load init.lua local filepath = require("filepath") local root = filepath.dir(debug.getinfo(1).source) dofile(filepath.join(root, "init.lua")) function metric_exists(metric) local sql_query = string.format([[ select count(*) from metric m where plugin = md5('%s')::uuid and host = md5('%s')::uuid and ts > extract( epoch from (now()-'3 minute'::interval) ) and (value_jsonb::text <> '{}' or value_jsonb is null) ]], metric, tested_plugin:host()) local result = target:query(sql_query).rows[1] if result and result[1] then return result[1] > 0 end return false end function plugin_check_error() if tested_plugin:error_count() > 0 then error(tested_plugin:last_error()) end end function run_plugin_test(timeout, success_exit_function, check_error_function) check_error_function = check_error_function or plugin_check_error success_exit_function = success_exit_function or function() return false end tested_plugin:create() timeout = timeout or 120 while timeout > 0 do check_error_function() if success_exit_function() then tested_plugin:remove() return end time.sleep(1) timeout = timeout - 1 end tested_plugin:remove() error("execution timeout") end
local M = {} local vim = vim M.HERMES_HOME = vim.fn.stdpath('data') .. '/site/pack/hermes/start/' M.HERMES_OPT = vim.fn.stdpath('data') .. '/site/pack/hermes/opt/' M.HERMES_LOG = vim.fn.stdpath('cache') .. '/hermes.log' return M
----------------------------------- -- Area: Gusgen Mines -- NPC: Clay -- Involved in Quest: A Potter's Preference -- !pos 117 -21 432 196 ----------------------------------- require("scripts/globals/titles"); require("scripts/globals/quests"); require("scripts/globals/settings"); local ID = require("scripts/zones/Gusgen_Mines/IDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local GUSGENCLAY = 569; if (player:hasItem(GUSGENCLAY) == false) then if (player:getFreeSlotsCount() == 0) then player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,GUSGENCLAY); else player:addItem(GUSGENCLAY); player:messageSpecial(ID.text.ITEM_OBTAINED, GUSGENCLAY); end else player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY); end end; function onEventUpdate(player,csid,option) -- printf("CSID2: %u",csid); -- printf("RESULT2: %u",option); end; function onEventFinish(player,csid,option) end;
function setup() color(0,0,0) fillrect(0,0,128,128); color(255,255,255) text("Hello World", 32, 32) end function loop() end
local Concord = require("lib.concord") local Shapes = require("lib.hc.shapes") local Vector = require("lib.vector") local Quad = require("src.classes.quad") local Animation = require("src.classes.animation") local C = require("src.components") local function collisionCallback(eShape, otherShape, sepX, sepY) local e = eShape.entity local eTransform = e[C.transform] local shouldResolve = false local other = otherShape.entity if not other then shouldResolve = true else local otherCollider = other[C.collider] if otherCollider.isSolid then shouldResolve = true end end if shouldResolve then eShape:move(sepX, sepY) eTransform.position.x = eTransform.position.x + sepX eTransform.position.y = eTransform.position.y + sepY end end local voicelines = { love.audio.newSource("sounds/voicelines/gnome_more.wav", "static"), love.audio.newSource("sounds/voicelines/gnomes_candy.wav", "static"), love.audio.newSource("sounds/voicelines/meow_meow.wav", "static"), love.audio.newSource("sounds/voicelines/nyeay.wav", "static"), love.audio.newSource("sounds/voicelines/owo.wav", "static"), love.audio.newSource("sounds/voicelines/purrfect_execution.wav", "static"), love.audio.newSource("sounds/voicelines/theme_song.wav", "static"), love.audio.newSource("sounds/voicelines/trick_or_treat.wav", "static"), love.audio.newSource("sounds/voicelines/santa_doesnt_exist.wav", "static"), } local lastVoicelineTime = love.timer.getTime() local function onDeath() score = score + 1 if score == 150 then currentWorld = require("src.worlds.gameWin") return end if score < 150 then if love.timer.getTime() - lastVoicelineTime > 4 then local shouldPlay = love.math.random(0, 4) == 0 if shouldPlay then local line = love.math.random(1, #voicelines) voicelines[line]:setVolume(1) voicelines[line]:play() lastVoicelineTime = love.timer.getTime() end end end end return Concord.assemblage(function(e, position, target) e:give(C.transform, position, 0) :give(C.sprite, Quad(0, 128, 16, 16, 320, 384), "enemy") :give(C.collider, Shapes.CircleShape(position.x, position.y, 20), "game", true, false, collisionCallback) :give(C.health, 100, onDeath) :give(C.animation, { idle = Animation({ Quad( 0, 0, 64, 64, 768, 64), }, 1), walk_down = Animation({ Quad( 0, 0, 64, 64, 768, 64), Quad( 64, 0, 64, 64, 768, 64), Quad(128, 0, 64, 64, 768, 64), Quad(192, 0, 64, 64, 768, 64), }, 0.25), walk_right = Animation({ Quad(256, 0, 64, 64, 768, 64), Quad(320, 0, 64, 64, 768, 64), Quad(384, 0, 64, 64, 768, 64), Quad(448, 0, 64, 64, 768, 64), }, 0.25), walk_left = Animation({ Quad(512, 0, 64, 64, 768, 64), Quad(576, 0, 64, 64, 768, 64), Quad(640, 0, 64, 64, 768, 64), Quad(704, 0, 64, 64, 768, 64), }, 0.25) }, "idle") :give(C.enemyControls, target) :give(C.speed, Vector(0, 0)) :give(C.spells, 2) end)
require "Polycode/Resource" class "Font" (Resource) function Font:__getvar(name) if name == "loaded" then return Polycode.Font_get_loaded(self.__ptr) end if Resource["__getvar"] ~= nil then return Resource.__getvar(self, name) end end function Font:__setvar(name,value) if name == "loaded" then Polycode.Font_set_loaded(self.__ptr, value) return true end if Resource["__setvar"] ~= nil then return Resource.__setvar(self, name, value) else return false end end function Font:Font(...) local arg = {...} if type(arg[1]) == "table" and count(arg) == 1 then if ""..arg[1].__classname == "Resource" then self.__ptr = arg[1].__ptr return end end for k,v in pairs(arg) do if type(v) == "table" then if v.__ptr ~= nil then arg[k] = v.__ptr end end end if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then self.__ptr = Polycode.Font(unpack(arg)) end end function Font:getFace() local retVal = Polycode.Font_getFace(self.__ptr) if retVal == nil then return nil end local __c = _G["FT_Face"]("__skip_ptr__") __c.__ptr = retVal return __c end function Font:isValid() local retVal = Polycode.Font_isValid(self.__ptr) return retVal end function Font:setFontName(fontName) local retVal = Polycode.Font_setFontName(self.__ptr, fontName) end function Font:getFontName() local retVal = Polycode.Font_getFontName(self.__ptr) return retVal end function Font:getFontPath() local retVal = Polycode.Font_getFontPath(self.__ptr) return retVal end function Font:__delete() if self then Polycode.delete_Font(self.__ptr) end end
object_static_worldbuilding_structures_mun_nboo_cloning_facility_destroyed = object_static_worldbuilding_structures_shared_mun_nboo_cloning_facility_destroyed:new { } ObjectTemplates:addTemplate(object_static_worldbuilding_structures_mun_nboo_cloning_facility_destroyed, "object/static/worldbuilding/structures/mun_nboo_cloning_facility_destroyed.iff")
 cfg.table("Person", function(tb) tb.sqls.Add1 = function (sk) -- each函数用于遍历获取SqlParameters的key或者value,调用each进行遍历的SqlParameter参数会在执行sql之前自动移除,函数中的参数说明: -- (Func<string, string, string, string, string, string, bool?, List<string>, object>) -- (type, sqlkey, key, prefix, suffix, separate, is2sqlparams, ignores) -- type: 操作类型,目前有 -- list / dict.pair / model.pair / dict.keys / model.keys / dict.vals / model.vals / (遍历集合生成相应的字符串) -- list.notnull / dict.pair.notnull / dict.vals.notnull / dict.keys.notnull / -- model.pair.notnull / model.vals.notnull / model.keys.notnull -- (遍历集合生成相应的字符串,而且集合的值(dict和model的为检验Value的)不为null(包括string不为empty)) -- sqlkey: 传递lua sql函数的第一个参数(sk),用于获取SqlParameters -- key: 指定哪个SqlParameter参数 -- prefix: 每个key/value的前缀 -- suffix: 每个key/value的后缀 -- separate: key - key之间的分隔符,默认为"," -- is2sqlparams: 是否将值生成SqlParameter(list,或dict和model的vals时候生成,而使用pair使这个值忽略,因为pair必须会将值生成为SqlParameter) -- ignores: 需要忽略的key(用于dict和model) --return "insert into Person(name, birthday, addrid) values(@name, @birthday, @addrid)" --下面的会生成上面的一样sql, return "insert into Person(" .. cfg.each("list", sk, "names", nil, nil, nil, false) .. ") values(" .. cfg.each("list", sk, "vals") .. ")" end tb.sqls.Add11 = function (sk) return "insert into Person(" .. cfg.each("list", sk, "names", " ", " ", " , ", false) .. ") values(" .. cfg.each("list", sk, "vals", "'", "'", " , ", false) .. ")" end tb.sqls.Add12 = function (sk) return "insert into Person(" .. cfg.each("list.notnull", sk, "names", " ", " ", " , ", false) .. ") values(" .. cfg.each("list.notnull", sk, "vals") .. ")" end tb.sqls.Add13 = function (sk) local sql = "insert into Person("; local names = cfg.param("get", sk, "names") --获取参数 --使用lua进行遍历 local bsplit = false; for k,v in pairs(names) do if bsplit then sql = sql .. ','; else bsplit = true; end sql = sql .. v; end sql = sql .. ") values("; local vals = cfg.param("get", sk, "vals") --获取参数 --使用lua进行遍历(注意,lua中并不支持DateTime / Guid等类型,可能会抛异常,因此遍历应该使用cfg.each("list"),这里只是演示而已) bsplit = false; for k,v in pairs(vals) do if bsplit then sql = sql .. ','; else bsplit = true; end sql = sql .. "'" .. v .. "'"; end --遍历完成之后不需要的参数删除 cfg.param("del", sk, "names"); cfg.param("del", sk, "vals"); return sql .. ")"; end tb.sqls.Add2 = function (sk) return "insert into Person(" .. cfg.each("dict.keys", sk, "dparams") .. ") values(" .. cfg.each("dict.vals", sk, "dparams") .. ")" end tb.sqls.Add21 = function (sk) return "insert into Person(" .. cfg.each("dict.keys", sk, "dparams", " ", " ", " , ") .. ") values(" .. cfg.each("dict.vals", sk, "dparams", "'", "'", " , ", false) .. ")" end tb.sqls.Add22 = function (sk) return "insert into Person(" .. cfg.each("dict.keys.notnull", sk, "dparams") .. ") values(" .. cfg.each("dict.vals.notnull", sk, "dparams") .. ")" end tb.sqls.Add23 = function (sk) return "insert into Person(" .. cfg.each("dict.keys.notnull", sk, "dparams", " ", " ", " , ") .. ") values(" .. cfg.each("dict.vals.notnull", sk, "dparams", "'", "'", " , ", false) .. ")" end tb.sqls.Add24 = function (sk) return "insert into Person(" .. cfg.each("dict.keys.notnull", sk, "dparams", " ", " ", " , ", nil, { "id" }) .. ") values(" .. cfg.each("dict.vals.notnull", sk, "dparams", "'", "'", " , ", false, { "id" }) .. ")" end tb.sqls.Add3 = function (sk) return "insert into Person(" .. cfg.each("model.keys", sk, "mparams") .. ") values(" .. cfg.each("model.vals", sk, "mparams") .. ")" end tb.sqls.Add31 = function (sk) return "insert into Person(" .. cfg.each("model.keys", sk, "mparams", " ", " ", " , ") .. ") values(" .. cfg.each("model.vals", sk, "mparams", "'", "'", " , ", false) .. ")" end tb.sqls.Add32 = function (sk) return "insert into Person(" .. cfg.each("model.keys.notnull", sk, "mparams") .. ") values(" .. cfg.each("model.vals.notnull", sk, "mparams") .. ")" end tb.sqls.Add33 = function (sk) return "insert into Person(" .. cfg.each("model.keys.notnull", sk, "mparams", " ", " ", " , ") .. ") values(" .. cfg.each("model.vals.notnull", sk, "mparams", "'", "'", " , ", false) .. ")" end tb.sqls.Add34 = function (sk) return "insert into Person(" .. cfg.each("model.keys.notnull", sk, "mparams", " ", " ", " , ", nil, { "id" }) .. ") values(" .. cfg.each("model.vals.notnull", sk, "mparams", "'", "'", " , ", false, { "id" }) .. ")" end ----------------------------------------update start tb.sqls.Update = function (sk) local sql = "update Person set " --.. cfg.each("dict.pair", sk, "dparams", " ", " ", ',', nil, { "name" }) .. cfg.each("dict.pair", sk, "dparams") .. " where name=@name"; return sql; end tb.sqls.Update1 = function (sk) local sql = "update Person set " --.. cfg.each("dict.pair.notnull", sk, "dparams", " ", " ", ',', nil, { "name" }) .. cfg.each("dict.pair.notnull", sk, "dparams") .. " where name=@name"; return sql; end tb.sqls.Update2 = function (sk) local sql = "update Person set " --.. cfg.each("model.pair", sk, "mparams", " ", " ", ',', nil, { "name" }) .. cfg.each("model.pair", sk, "mparams") .. " where name=@name"; return sql; end tb.sqls.Update3 = function (sk) local sql = "update Person set " --.. cfg.each("model.pair.notnull", sk, "mparams", " ", " ", ',', nil, { "name" }) .. cfg.each("model.pair.notnull", sk, "mparams") .. " where name=@name"; return sql; end ----------------------------------------update end tb.sqls.Delete = function () return "delete from Person where name=@name" end end);
-- -- Test case for hang on [1]s and :join()s. -- require "lanes" local function ret(b) return b end local lgen = lanes.gen("*", {}, ret) for i=1,10000 do local ln = lgen(i) print( "getting result for "..i ) -- Hangs here forever every few hundred runs or so, -- can be illustrated by putting another print() statement -- after, which will never be called. -- local result = ln[1]; assert (result == i); end print "Finished!"
flail_butcher = Creature:new { objectName = "@mob/creature_names:flail_butcher", randomNameType = NAME_GENERIC, randomNameTag = true, socialGroup = "flail", faction = "flail", level = 22, chanceHit = 0.35, damageMin = 220, damageMax = 230, baseXp = 2219, baseHAM = 6300, baseHAMmax = 7700, armor = 0, resists = {0,0,0,0,0,0,0,-1,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0.0, ferocity = 0, pvpBitmask = ATTACKABLE + AGGRESSIVE + ENEMY, creatureBitmask = PACK + KILLER, diet = HERBIVORE, templates = {"object/mobile/dressed_mugger.iff", "object/mobile/dressed_goon_twk_female_01.iff", "object/mobile/dressed_goon_twk_male_01.iff", "object/mobile/dressed_gran_thug_male_01.iff", "object/mobile/dressed_gran_thug_male_02.iff", "object/mobile/dressed_ravager_human_female_01.iff", "object/mobile/dressed_ravager_human_male_01.iff", "object/mobile/dressed_raider_trandoshan_female_01.iff", "object/mobile/dressed_raider_trandoshan_male_01.iff", "object/mobile/dressed_ruffian_zabrak_female_01.iff", "object/mobile/dressed_criminal_thug_zabrak_male_01.iff", "object/mobile/dressed_villain_trandoshan_female_01.iff", "object/mobile/dressed_villain_trandoshan_male_01.iff"}, lootGroups = { { groups = { {group = "junk", chance = 3500000}, {group = "wearables_common", chance = 3000000}, {group = "rifles", chance = 2000000}, {group = "color_crystals", chance = 1000000}, {group = "flail_common", chance = 500000} } } }, weapons = {"pirate_weapons_medium"}, reactionStf = "@npc_reaction/slang", attacks = merge(brawlermaster,marksmanmaster) } CreatureTemplates:addCreatureTemplate(flail_butcher, "flail_butcher")
local gl = require 'gl' local table = require 'ext.table' local class = require 'ext.class' local GLTex = require 'gl.tex' local GLTex2D = require 'gl.tex2d' local GLTexCube = class(GLTex) GLTexCube.target = gl.GL_TEXTURE_CUBE_MAP function GLTexCube:create(args) -- now args.data should be a 6-indexed array of whatever data you were gonna pass the texture local data = args.data or {} if args.filenames then data = {} end -- I'm breaking with tradition: no more GLTexCube.load, now just through the ctor local baseWidth, baseHeight = args.width, args.height local width, height = baseWidth, baseHeight local baseFormat, baseInternalFormat, baseType = args.format, args.internalFormat or args.format, args.type for i=1,6 do local width, height, format, internalFormat, glType = baseWidth, baseHeight, baseFormat, baseInternalFormat, baseType if args.filenames then local filename = args.filenames[i] local Image = require 'image' local image = Image(filename) if baseWidth and baseHeight then image = image:resample(baseWidth, baseHeight) end data[i] = image:data() local channels width, height, channels = image:size() glType = gl.GL_UNSIGNED_BYTE if channels == 3 then format = gl.GL_RGB internalFormat = gl.GL_RGB else format = gl.GL_RGBA internalFormat = gl.GL_RGB end end -- hijacking from GLTex2D... GLTex2D.create(self, table(args, { target = (args.target or gl.GL_TEXTURE_CUBE_MAP_POSITIVE_X) + i-1, data = data[i], format = format, internalFormat = internalFormat, type = glType, width = width, height = height, })) end end return GLTexCube
PLUGIN.Name = "I like trains" PLUGIN.Description = "Adds commands to apply actions on players through trains." PLUGIN.Author = "MetaMan" PLUGIN:AddPermission("trainslay", "Allows users to awesomely slay players with trains") PLUGIN:AddPermission("trainkick", "Allows users to awesomely kick players with trains") PLUGIN:AddPermission("trainban", "Allows users to awesomely ban players with trains") function PLUGIN:TrainSlay(ply, targets) for i = 1, #targets do local target = targets[i] target:SetMoveType(MOVETYPE_WALK) local train = ents.Create("uac_train") train:SetPos(target:GetPos() + Vector(0, 0, 100) + target:GetForward() * 1000) local vec = target:GetPos() + Vector(0, 0, 100) - train:GetPos() vec:Normalize() train:SetAngles(vec:Angle() - Angle(0, 90, 0)) train:SetOwner(target) train:Spawn() train:Activate() train:SetHitCallback(function(self, targ) if not IsValid(targ) then return end local vel = targ:GetPos() - self:GetPos() + Vector(0, 0, 400) vel:Normalize() targ:SetLocalVelocity(vel * 2000) targ:Kill() end) end end PLUGIN:AddCommand("trainslay", PLUGIN.TrainSlay) :SetPermission("trainslay") :SetDescription("Slays a player in a awesome way") :AddParameter(uac.command.players) function PLUGIN:TrainKick(ply, target, reason) reason = string.gsub(reason, "[;,:.\\/]", "_") target:SetMoveType(MOVETYPE_WALK) local train = ents.Create("uac_train") train:SetPos(target:GetPos() + Vector(0, 0, 100) + target:GetForward() * 1000) local vec = target:GetPos() + Vector(0, 0, 100) - train:GetPos() vec:Normalize() train:SetAngles(vec:Angle() - Angle(0, 90, 0)) train:SetOwner(target) train:Spawn() train:Activate() train:SetHitCallback(function(self, targ) if IsValid(targ) then targ:Kick(reason) end end) end PLUGIN:AddCommand("trainkick", PLUGIN.TrainKick) :SetPermission("trainkick") :SetDescription("Kicks a player in a awesome way") :AddParameter(uac.command.player) :AddParameter(uac.command.string("Kicked from server")) function PLUGIN:TrainBan(ply, target, time, reason) reason = string.gsub(reason, "[;,:.\\/]", "_") target:SetMoveType(MOVETYPE_WALK) local train = ents.Create("uac_train") train:SetPos(target:GetPos() + Vector(0, 0, 100) + target:GetForward() * 1000) local vec = target:GetPos() + Vector(0, 0, 100) - train:GetPos() vec:Normalize() train:SetAngles(vec:Angle() - Angle(0, 90, 0)) train:SetOwner(target) train:Spawn() train:Activate() train:SetHitCallback(function(self, targ) if IsValid(targ) then targ:Ban(time, reason) targ:Kick(reason) end end) local name = target:Nick() local steamid = target:SteamID() train:SetEndCallback(function(self, targ, success) if success then return end uac.ban.Add(steamid, time, reason, ply, name) end) end PLUGIN:AddCommand("trainban", PLUGIN.TrainBan) :SetPermission("trainban") :SetDescription("Bans a player in a awesome way") :AddParameter(uac.command.player) :AddParameter(uac.command.number(0, math.huge, 5)) :AddParameter(uac.command.string("Banned from server")) ------------------------------------------------------------ local ENT = {} ENT.Type = "anim" ENT.Base = "base_anim" ENT.PrintName = "UAC Train" ENT.Author = "MetaMan" ENT.Spawnable = false ENT.AdminSpawnable = false if CLIENT then language.Add("uac_train", "Train") ENT.RenderGroup = RENDERGROUP_OPAQUE function ENT:Draw() self:DrawModel() end elseif SERVER then ENT.honk = Sound("Trainyard.train_horn_everywhere") ENT.shadowparams = {} function ENT:Initialize() self:SetColor(uac.color.yellow) self:SetModel("models/props_trainstation/train001.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) self:SetNotSolid(true) self:SetTrigger(true) self:StartMotionController() local phys = self:GetPhysicsObject() if IsValid(phys) then phys:EnableGravity(false) phys:Wake() end end function ENT:SetKick(bool) self.kick = bool end function ENT:SetHitCallback(func) self.hitcallback = func end function ENT:SetEndCallback(func) self.endcallback = func end function ENT:StartTouch(ent) if self:GetOwner() == ent and ent:Alive() and not self.done then self.done = CurTime() + 1 if self.hitcallback then self.hitcallback(self, ent) end end end function ENT:Think() local curtime = CurTime() if not IsValid(self:GetOwner()) or (self.done and self.done < curtime) then if self.endcallback then self.endcallback(self, self:GetOwner(), self.done and self.done >= curtime or false) end self:Remove() return end if not self.soundplayed and self:GetPos():Distance(self:GetOwner():GetPos()) < 2000 then self:EmitSound(self.honk, 100, 90) self.soundplayed = true end end function ENT:PhysicsUpdate(phys, delta) phys:Wake() if not IsValid(self:GetOwner()) then return SIM_NOTHING end if self:GetOwner():Alive() and not self.done then self.shadowparams.pos = self:GetOwner():GetPos() + Vector(0, 0, 100) local ang = (self.shadowparams.pos - self:GetPos()):Angle() ang.r = -ang.p ang.p = 0 self.shadowparams.angle = ang - Angle(0, 90, 0) else self.shadowparams.pos = self:GetPos() + -self:GetRight() * 10000 end self.shadowparams.secondstoarrive = 1 self.shadowparams.maxangular = 1000 self.shadowparams.maxangulardamp = 2000 self.shadowparams.maxspeed = 1000 self.shadowparams.maxspeeddamp = 2000 self.shadowparams.dampfactor = 0.1 self.shadowparams.teleportdistance = 90000 self.shadowparams.deltatime = delta phys:ComputeShadowControl(self.shadowparams) end end scripted_ents.Register(ENT, "uac_train")
local skynet = require "skynet" local socket = require "skynet.socket" local websocket = require "chestnut.websocket" local httpd = require "http.httpd" local urllib = require "http.url" local sockethelper = require "http.sockethelper" local log = require "chestnut.skynet.log" local servicecode = require "chestnut.servicecode" local server = {} local users = {} local username_map = {} local internal_id = 0 local forwarding = {} -- agent -> connection -- login server disallow multi login, so login_handler never be reentry -- call by login server function server.login_handler(uid, secret) if users[uid] then error(string.format("%s is already login", uid)) end internal_id = internal_id + 1 local id = internal_id local username = string.format("%d:%d", uid, id) log.info("gated username: %s, uid: %s", username, uid) -- you can use a pool to alloc new agent -- local agent = skynet.newservice "agent" local agent = skynet.call(".AGENT_MGR", "lua", "enter", uid) if agent == 0 or agent == -1 then local res = {} res.errorcode = servicecode.NOT_ENOUGH_AGENT res.subid = id return res end local u = { username = username, agent = agent, uid = uid, subid = id, } -- trash subid (no used) local err = skynet.call(agent, "lua", "login", skynet.self(), uid, id, secret) if err == servicecode.SUCCESS then log.info("gated call login err = %d", err) users[uid] = u username_map[username] = u -- you should return unique subid local res = {} res.errorcode = err res.subid = id return res else log.info("gated call login err = %d", err) local res = {} res.errorcode = err res.subid = 0 return res end end -- call by agent function server.logout_handler(uid, subid) local u = users[uid] if u then local username = string.format("%d:%d", uid, subid) assert(u.username == username) users[uid] = nil username_map[u.username] = nil forwarding[u.fd] = nil log.info("call login logout") local err = skynet.call(".wslogind", "lua", "logout", uid, subid) if err ~= servicecode.SUCCESS then log.error("wslogind service logout failture.") else log.info("wslogind service logout ok.") end return err else log.error("wsgate service not contains uid(%d)", uid) return servicecode.FAIL end end -- call by login server function server.kick_handler(uid, subid) local u = users[uid] if u then -- local username = msgserver.username(uid, subid, servername) local username = string.format("%d:%d", uid, subid) assert(u.username == username) -- NOTICE: logout may call skynet.exit, so you should use pcall. -- pcall(skynet.call, u.agent.handle, "lua", "logout") log.info("uid(%d) kick agent, call agent logout", uid) local ok = skynet.call(u.agent, "lua", "logout") if not ok then log.error("gated pcall agent kick error.") return false else return ok end else log.error("uid = %d not existence.") return false end end -- call by self (when socket disconnect) function server.disconnect_handler(fd) local u = forwarding[fd] if u then forwarding[fd] = nil skynet.call(u.agent, "lua", "afk") skynet.call(u.agent, "lua", "logout") log.info("agent logout ok.") end end -- call by self function server.start_handler(username, fd, ws) -- body local u = username_map[username] if u then local agent = u.agent if agent then local conf = { client = fd, } skynet.call(agent, "lua", "auth", conf) u.ws = ws u.fd = fd forwarding[fd] = u return true end end return false end local handler = {} function handler.on_open(ws) log.info(string.format("%d::open", ws.id)) -- skynet.error("New client from : " .. addr) -- log.info("New client from : %d", ws.id) end function handler.on_message(ws, message) if forwarding[ws.id] then if forwarding[ws.id] and forwarding[ws.id].agent then skynet.redirect(forwarding[ws.id].agent, skynet.self(), "client", 1, message) end else log.info("wsgate auth: %s", message) if not server.start_handler(message, ws.id, ws) then ws:send_text("500") ws:close() else ws:send_text("200") end end -- ws:send_text(message .. "from server") -- ws:close() end function handler.on_close(ws, code, reason) log.info(string.format("%d close:%s %s", ws.id, code, reason)) server.disconnect_handler(ws.id) end function handler.on_socket_close(id) -- body server.disconnect_handler(id) end local function handle_socket(id) -- limit request body size to 8192 (you can pass nil to unlimit) local code, url, method, header, body = httpd.read_request(sockethelper.readfunc(id), 8192) if code then if header.upgrade == "websocket" then local ws = websocket.new(id, header, handler) ws:start() end end end local CMD = {} function CMD.start() -- body return skynet.call(".wslogind", "lua", "register_gate", "sample1", skynet.self(), "gated") end function CMD.kick(uid, subid) -- body return server.kick_handler(uid, subid) end function CMD.login(uid, secret) -- body return server.login_handler(uid, secret) end function CMD.logout(uid, subid) -- body return server.logout_handler(uid, subid) end function CMD.push_client(id, args) -- body if forwarding[id] and forwarding[id].ws then forwarding[id].ws:send_binary(args) end return servicecode.NORET end skynet.register_protocol { name = "client", id = skynet.PTYPE_CLIENT, pack = function(m) return skynet.pack(m) end, -- unpack = skynet.tostring, } skynet.start(function() local address = skynet.getenv 'wsgated' skynet.error("Listening "..address) local id = assert(socket.listen(address)) socket.start(id , function(id, addr) socket.start(id) pcall(handle_socket, id) end) skynet.dispatch("lua", function ( _, _, cmd, ... ) -- body local f = assert(CMD[cmd]) local r = f( ... ) if r ~= servicecode.NORET then if r ~= nil then skynet.retpack(r) else log.error("wsgate cmd = %s not return", cmd) end end end) end)
-- init.lua -- -- initialize wireshark's lua -- -- This file is going to be executed before any other lua script. -- It can be used to load libraries, disable functions and more. -- -- Wireshark - Network traffic analyzer -- By Gerald Combs <gerald@wireshark.org> -- Copyright 1998 Gerald Combs -- -- SPDX-License-Identifier: GPL-2.0-or-later -- Set enable_lua to false to disable Lua support. enable_lua = true if not enable_lua then return end -- If set and we are running with special privileges this setting -- tells whether scripts other than this one are to be run. -- run_user_scripts_when_superuser = false -- set to true by WGM run_user_scripts_when_superuser = true -- disable potentialy harmful lua functions when running superuser if running_superuser then local hint = "has been disabled due to running Wireshark as superuser. See https://wiki.wireshark.org/CaptureSetup/CapturePrivileges for help in running Wireshark as an unprivileged user." local disabled_lib = {} setmetatable(disabled_lib,{ __index = function() error("this package ".. hint) end } ); dofile = function() error("dofile " .. hint) end loadfile = function() error("loadfile " .. hint) end loadlib = function() error("loadlib " .. hint) end require = function() error("require " .. hint) end os = disabled_lib io = disabled_lib file = disabled_lib end function typeof(obj) local mt = getmetatable(obj) return mt and mt.__typeof or obj.__typeof or type(obj) end -- the following function checks if a file exists -- since 1.11.3 function file_exists(name) local f = io.open(name,"r") if f ~= nil then io.close(f) return true else return false end end -- the following function prepends the given directory name to -- the package.path, so that a 'require "foo"' will work if 'foo' -- is in the directory name given to this function. For example, -- if your Lua file will do a 'require "foo"' and the foo.lua -- file is in a local directory (local to your script) named 'bar', -- then call this function before doing your 'require', by doing -- package.prepend_path("bar") -- and that will let Wireshark's Lua find the file "bar/foo.lua" -- when you later do 'require "foo"' -- -- Because this function resides here in init.lua, it does not -- have the same environment as your script, so it has to get it -- using the debug library, which is why the code appears so -- cumbersome. -- -- since 1.11.3 function package.prepend_path(name) -- get the function calling this package.prepend_path function local dt = debug.getinfo(2, "f") if not dt then error("could not retrieve debug info table") end -- get its upvalue local _, val = debug.getupvalue(dt.func, 1) if not val or type(val) ~= 'table' then error("No calling function upvalue or it is not a table") end -- get the __DIR__ field in its upvalue table local dir = val["__DIR__"] -- get the platform-specific directory separator character local sep = package.config:sub(1,1) -- prepend the dir and given name to path if dir and dir:len() > 0 then package.path = dir .. sep .. name .. sep .. "?.lua;" .. package.path end -- also prepend just the name as a directory package.path = name .. sep .. "?.lua;" .. package.path end -- Wiretap encapsulations XXX wtap_encaps = { ["PER_PACKET"] = -1, ["UNKNOWN"] = 0, ["ETHERNET"] = 1, ["TOKEN_RING"] = 2, ["SLIP"] = 3, ["PPP"] = 4, ["FDDI"] = 5, ["FDDI_BITSWAPPED"] = 6, ["RAW_IP"] = 7, ["ARCNET"] = 8, ["ARCNET_LINUX"] = 9, ["ATM_RFC1483"] = 10, ["LINUX_ATM_CLIP"] = 11, ["LAPB"] = 12, ["ATM_PDUS"] = 13, ["ATM_PDUS_UNTRUNCATED"] = 14, ["NULL"] = 15, ["ASCEND"] = 16, ["ISDN"] = 17, ["IP_OVER_FC"] = 18, ["PPP_WITH_PHDR"] = 19, ["IEEE_802_11"] = 20, ["IEEE_802_11_PRISM"] = 21, ["IEEE_802_11_WITH_RADIO"] = 22, ["IEEE_802_11_RADIOTAP"] = 23, ["IEEE_802_11_AVS"] = 24, ["SLL"] = 25, ["FRELAY"] = 26, ["FRELAY_WITH_PHDR"] = 27, ["CHDLC"] = 28, ["CISCO_IOS"] = 29, ["LOCALTALK"] = 30, ["OLD_PFLOG"] = 31, ["HHDLC"] = 32, ["DOCSIS"] = 33, ["COSINE"] = 34, ["WFLEET_HDLC"] = 35, ["SDLC"] = 36, ["TZSP"] = 37, ["ENC"] = 38, ["PFLOG"] = 39, ["CHDLC_WITH_PHDR"] = 40, ["BLUETOOTH_H4"] = 41, ["MTP2"] = 42, ["MTP3"] = 43, ["IRDA"] = 44, ["USER0"] = 45, ["USER1"] = 46, ["USER2"] = 47, ["USER3"] = 48, ["USER4"] = 49, ["USER5"] = 50, ["USER6"] = 51, ["USER7"] = 52, ["USER8"] = 53, ["USER9"] = 54, ["USER10"] = 55, ["USER11"] = 56, ["USER12"] = 57, ["USER13"] = 58, ["USER14"] = 59, ["USER15"] = 60, ["SYMANTEC"] = 61, ["APPLE_IP_OVER_IEEE1394"] = 62, ["BACNET_MS_TP"] = 63, ["NETTL_RAW_ICMP"] = 64, ["NETTL_RAW_ICMPV6"] = 65, ["GPRS_LLC"] = 66, ["JUNIPER_ATM1"] = 67, ["JUNIPER_ATM2"] = 68, ["REDBACK"] = 69, ["NETTL_RAW_IP"] = 70, ["NETTL_ETHERNET"] = 71, ["NETTL_TOKEN_RING"] = 72, ["NETTL_FDDI"] = 73, ["NETTL_UNKNOWN"] = 74, ["MTP2_WITH_PHDR"] = 75, ["JUNIPER_PPPOE"] = 76, ["GCOM_TIE1"] = 77, ["GCOM_SERIAL"] = 78, ["NETTL_X25"] = 79, ["K12"] = 80, ["JUNIPER_MLPPP"] = 81, ["JUNIPER_MLFR"] = 82, ["JUNIPER_ETHER"] = 83, ["JUNIPER_PPP"] = 84, ["JUNIPER_FRELAY"] = 85, ["JUNIPER_CHDLC"] = 86, ["JUNIPER_GGSN"] = 87, ["LINUX_LAPD"] = 88, ["CATAPULT_DCT2000"] = 89, ["BER"] = 90, ["JUNIPER_VP"] = 91, ["USB_FREEBSD"] = 92, ["IEEE802_16_MAC_CPS"] = 93, ["NETTL_RAW_TELNET"] = 94, ["USB_LINUX"] = 95, ["MPEG"] = 96, ["PPI"] = 97, ["ERF"] = 98, ["BLUETOOTH_H4_WITH_PHDR"] = 99, ["SITA"] = 100, ["SCCP"] = 101, ["BLUETOOTH_HCI"] = 102, ["IPMB"] = 103, ["IEEE802_15_4"] = 104, ["X2E_XORAYA"] = 105, ["FLEXRAY"] = 106, ["LIN"] = 107, ["MOST"] = 108, ["CAN20B"] = 109, ["LAYER1_EVENT"] = 110, ["X2E_SERIAL"] = 111, ["I2C"] = 112, ["IEEE802_15_4_NONASK_PHY"] = 113, ["TNEF"] = 114, ["USB_LINUX_MMAPPED"] = 115, ["GSM_UM"] = 116, ["DPNSS"] = 117, ["PACKETLOGGER"] = 118, ["NSTRACE_1_0"] = 119, ["NSTRACE_2_0"] = 120, ["FIBRE_CHANNEL_FC2"] = 121, ["FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS"] = 122, ["JPEG_JFIF"] = 123, ["IPNET"] = 124, ["SOCKETCAN"] = 125, ["IEEE_802_11_NETMON"] = 126, ["IEEE802_15_4_NOFCS"] = 127, ["RAW_IPFIX"] = 128, ["RAW_IP4"] = 129, ["RAW_IP6"] = 130, ["LAPD"] = 131, ["DVBCI"] = 132, ["MUX27010"] = 133, ["MIME"] = 134, ["NETANALYZER"] = 135, ["NETANALYZER_TRANSPARENT"] = 136, ["IP_OVER_IB_SNOOP"] = 137, ["MPEG_2_TS"] = 138, ["PPP_ETHER"] = 139, ["NFC_LLCP"] = 140, ["NFLOG"] = 141, ["V5_EF"] = 142, ["BACNET_MS_TP_WITH_PHDR"] = 143, ["IXVERIWAVE"] = 144, ["SDH"] = 145, ["DBUS"] = 146, ["AX25_KISS"] = 147, ["AX25"] = 148, ["SCTP"] = 149, ["INFINIBAND"] = 150, ["JUNIPER_SVCS"] = 151, ["USBPCAP"] = 152, ["RTAC_SERIAL"] = 153, ["BLUETOOTH_LE_LL"] = 154, ["WIRESHARK_UPPER_PDU"] = 155, ["STANAG_4607"] = 156, ["STANAG_5066_D_PDU"] = 157, ["NETLINK"] = 158, ["BLUETOOTH_LINUX_MONITOR"] = 159, ["BLUETOOTH_BREDR_BB"] = 160, ["BLUETOOTH_LE_LL_WITH_PHDR"] = 161, ["NSTRACE_3_0"] = 162, ["LOGCAT"] = 163, ["LOGCAT_BRIEF"] = 164, ["LOGCAT_PROCESS"] = 165, ["LOGCAT_TAG"] = 166, ["LOGCAT_THREAD"] = 167, ["LOGCAT_TIME"] = 168, ["LOGCAT_THREADTIME"] = 169, ["LOGCAT_LONG"] = 170, ["PKTAP"] = 171, ["EPON"] = 172, ["IPMI_TRACE"] = 173, ["LOOP"] = 174, ["JSON"] = 175, ["NSTRACE_3_5"] = 176, ["ISO14443"] = 177, ["GFP_T"] = 178, ["GFP_F"] = 179, ["IP_OVER_IB_PCAP"] = 180, ["JUNIPER_VN"] = 181, ["USB_DARWIN"] = 182, ["LORATAP"] = 183, ["3MB_ETHERNET"] = 184, ["VSOCK"] = 185, ["NORDIC_BLE"] = 186, ["NETMON_NET_NETEVENT"] = 187, ["NETMON_HEADER"] = 188, ["NETMON_NET_FILTER"] = 189, ["NETMON_NETWORK_INFO_EX"] = 190, ["MA_WFP_CAPTURE_V4"] = 191, ["MA_WFP_CAPTURE_V6"] = 192, ["MA_WFP_CAPTURE_2V4"] = 193, ["MA_WFP_CAPTURE_2V6"] = 194, ["MA_WFP_CAPTURE_AUTH_V4"] = 195, ["MA_WFP_CAPTURE_AUTH_V6"] = 196, ["JUNIPER_ST"] = 197, ["ETHERNET_MPACKET"] = 198, ["DOCSIS31_XRA31"] = 199, ["DPAUXMON"] = 200, ["RUBY_MARSHAL"] = 201, ["RFC7468"] = 202, ["SYSTEMD_JOURNAL"] = 203 } wtap = wtap_encaps -- for bw compatibility -- Wiretap file types wtap_filetypes = { ["UNKNOWN"] = 0, ["PCAP"] = 1, ["PCAPNG"] = 2, ["PCAP_NSEC"] = 3, ["PCAP_AIX"] = 4, ["PCAP_SS991029"] = 5, ["PCAP_NOKIA"] = 6, ["PCAP_SS990417"] = 7, ["PCAP_SS990915"] = 8, ["5VIEWS"] = 9, ["IPTRACE_1_0"] = 10, ["IPTRACE_2_0"] = 11, ["BER"] = 12, ["HCIDUMP"] = 13, ["CATAPULT_DCT2000"] = 14, ["NETXRAY_OLD"] = 15, ["NETXRAY_1_0"] = 16, ["COSINE"] = 17, ["CSIDS"] = 18, ["DBS_ETHERWATCH"] = 19, ["ERF"] = 20, ["EYESDN"] = 21, ["NETTL"] = 22, ["ISERIES"] = 23, ["ISERIES_UNICODE"] = 24, ["I4BTRACE"] = 25, ["ASCEND"] = 26, ["NGSNIFFER_UNCOMPRESSED"] = 29, ["NGSNIFFER_COMPRESSED"] = 30, ["NETXRAY_1_1"] = 31, ["NETWORK_INSTRUMENTS"] = 33, ["LANALYZER"] = 34, ["PPPDUMP"] = 35, ["RADCOM"] = 36, ["SNOOP"] = 37, ["SHOMITI"] = 38, ["VMS"] = 39, ["K12"] = 40, ["TOSHIBA"] = 41, ["VISUAL_NETWORKS"] = 42, ["PEEKCLASSIC_V56"] = 43, ["PEEKCLASSIC_V7"] = 44, ["PEEKTAGGED"] = 45, ["MPEG"] = 46, ["K12TEXT"] = 47, ["NETSCREEN"] = 48, ["COMMVIEW"] = 49, ["BTSNOOP"] = 50, ["TNEF"] = 51, ["DCT3TRACE"] = 52, ["PACKETLOGGER"] = 53, ["DAINTREE_SNA"] = 54, ["NETSCALER_1_0"] = 55, ["NETSCALER_2_0"] = 56, ["JPEG_JFIF"] = 57, ["IPFIX"] = 58, ["MIME"] = 59, ["AETHRA"] = 60, ["MPEG_2_TS"] = 61, ["VWR_80211"] = 62, ["VWR_ETH"] = 63, ["CAMINS"] = 64, ["STANAG_4607"] = 65, ["NETSCALER_3_0"] = 66, ["LOGCAT"] = 67, ["LOGCAT_BRIEF"] = 68, ["LOGCAT_PROCESS"] = 69, ["LOGCAT_TAG"] = 70, ["LOGCAT_THREAD"] = 71, ["LOGCAT_TIME"] = 72, ["LOGCAT_THREADTIME"] = 73, ["LOGCAT_LONG"] = 74, ["COLASOFT_CAPSA"] = 75, ["COLASOFT_PACKET_BUILDER"] = 76, ["JSON"] = 77, ["NETSCALER_3_5"] = 78, ["NETTRACE_3GPP_32_423"] = 79, ["MPLOG"] = 80, ["DPA400"] = 81, ["RFC7468"] = 82, ["RUBY_MARSHAL"] = 83, ["SYSTEMD_JOURNAL"] = 84, ["TSPREC_SEC"] = 0, ["TSPREC_DSEC"] = 1, ["TSPREC_CSEC"] = 2, ["TSPREC_MSEC"] = 3, ["TSPREC_USEC"] = 6, ["TSPREC_NSEC"] = 9 } -- Wiretap timestamp precision types wtap_tsprecs = { ["SEC"] = 0, ["DSEC"] = 1, ["CSEC"] = 2, ["MSEC"] = 3, ["USEC"] = 6, ["NSEC"] = 9 } -- Wiretap file comment types wtap_comments = { ["PER_SECTION"] = 0x00000001, ["PER_INTERFACE"] = 0x00000002, ["PER_PACKET"] = 0x00000004 } -- Field Types ftypes = { ["NONE"] = 0, ["PROTOCOL"] = 1, ["BOOLEAN"] = 2, ["CHAR"] = 3, ["UINT8"] = 4, ["UINT16"] = 5, ["UINT24"] = 6, ["UINT32"] = 7, ["UINT40"] = 8, ["UINT48"] = 9, ["UINT56"] = 10, ["UINT64"] = 11, ["INT8"] = 12, ["INT16"] = 13, ["INT24"] = 14, ["INT32"] = 15, ["INT40"] = 16, ["INT48"] = 17, ["INT56"] = 18, ["INT64"] = 19, ["IEEE_11073_SFLOAT"] = 20, ["IEEE_11073_FLOAT"] = 21, ["FLOAT"] = 22, ["DOUBLE"] = 23, ["ABSOLUTE_TIME"] = 24, ["RELATIVE_TIME"] = 25, ["STRING"] = 26, ["STRINGZ"] = 27, ["UINT_STRING"] = 28, ["ETHER"] = 29, ["BYTES"] = 30, ["UINT_BYTES"] = 31, ["IPv4"] = 32, ["IPv6"] = 33, ["IPXNET"] = 34, ["FRAMENUM"] = 35, ["PCRE"] = 36, ["GUID"] = 37, ["OID"] = 38, ["EUI64"] = 39, ["AX25"] = 40, ["VINES"] = 41, ["REL_OID"] = 42, ["SYSTEM_ID"] = 43, ["STRINGZPAD"] = 44, ["FCWWN"] = 45 } -- the following table is since 2.0 -- Field Type FRAMENUM Types frametype = { ["NONE"] = 0, ["REQUEST"] = 1, ["RESPONSE"] = 2, ["ACK"] = 3, ["DUP_ACK"] = 4, ["RETRANS_PREV"] = 5, ["RETRANS_NEXT"] = 6 } -- the following table is since 1.12 -- Wiretap record_types wtap_rec_types = { ["PACKET"] = 0, -- packet ["FT_SPECIFIC_EVENT"] = 1, -- file-type-specific event ["FT_SPECIFIC_REPORT"] = 2, -- file-type-specific report ["SYSCALL"] = 3, -- system call } -- the following table is since 1.11.3 -- Wiretap presence flags wtap_presence_flags = { ["TS"] = 1, -- time stamp ["CAP_LEN"] = 2, -- captured length separate from on-the-network length ["INTERFACE_ID"] = 4, -- interface ID ["COMMENTS"] = 8, -- comments ["DROP_COUNT"] = 16, -- drop count ["PACK_FLAGS"] = 32, -- packet flags } -- Display Bases base = { ["NONE"] = 0, -- none ["DEC"] = 1, -- decimal ["HEX"] = 2, -- hexadecimal ["OCT"] = 3, -- octal ["DEC_HEX"] = 4, -- decimal (hexadecimal) ["HEX_DEC"] = 5, -- hexadecimal (decimal) ["CUSTOM"] = 6, -- call custom routine (in ->strings) to format ["ASCII"] = 0, -- shows non-printable ASCII characters as C-style escapes ["UNICODE"] = 7, -- shows non-printable UNICODE characters as \\uXXXX (XXX for now non-printable characters display depends on UI) ["DOT"] = 8, -- hexadecimal bytes with a period (.) between each byte ["DASH"] = 9, -- hexadecimal bytes with a dash (-) between each byte ["COLON"] = 10, -- hexadecimal bytes with a colon (:) between each byte ["SPACE"] = 11, -- hexadecimal bytes with a space between each byte ["NETMASK"] = 12, -- Used for IPv4 address that shouldn't be resolved (like for netmasks) ["PT_UDP"] = 13, -- UDP port ["PT_TCP"] = 14, -- TCP port ["PT_DCCP"] = 15, -- DCCP port ["PT_SCTP"] = 16, -- SCTP port ["OUI"] = 17, -- OUI resolution ["RANGE_STRING"] = 256, -- Use the supplied range string to convert the field to text ["UNIT_STRING"] = 4096, -- Add unit text to the field value ["LOCAL"] = 1000, -- local time in our time zone, with month and day ["UTC"] = 1001, -- UTC, with month and day ["DOY_UTC"] = 1002, -- UTC, with 1-origin day-of-year } -- Encodings ENC_BIG_ENDIAN = 0 ENC_LITTLE_ENDIAN = 2147483648 ENC_TIME_SECS_NSECS = 0 ENC_TIME_TIMESPEC = 0 ENC_TIME_NTP = 2 ENC_TIME_TOD = 4 ENC_TIME_RTPS = 8 ENC_TIME_NTP_BASE_ZERO = 8 ENC_TIME_SECS_USECS = 16 ENC_TIME_TIMEVAL = 16 ENC_TIME_SECS = 18 ENC_TIME_MSECS = 20 ENC_TIME_SECS_NTP = 24 ENC_TIME_RFC_3971 = 32 ENC_TIME_MSEC_NTP = 34 ENC_CHARENCODING_MASK = 2147483646 ENC_ASCII = 0 ENC_UTF_8 = 2 ENC_UTF_16 = 4 ENC_UCS_2 = 6 ENC_UCS_4 = 8 ENC_ISO_8859_1 = 10 ENC_ISO_8859_2 = 12 ENC_ISO_8859_3 = 14 ENC_ISO_8859_4 = 16 ENC_ISO_8859_5 = 18 ENC_ISO_8859_6 = 20 ENC_ISO_8859_7 = 22 ENC_ISO_8859_8 = 24 ENC_ISO_8859_9 = 26 ENC_ISO_8859_10 = 28 ENC_ISO_8859_11 = 30 ENC_ISO_8859_13 = 34 ENC_ISO_8859_14 = 36 ENC_ISO_8859_15 = 38 ENC_ISO_8859_16 = 40 ENC_WINDOWS_1250 = 42 ENC_3GPP_TS_23_038_7BITS = 44 ENC_EBCDIC = 46 ENC_MAC_ROMAN = 48 ENC_CP437 = 50 ENC_ASCII_7BITS = 52 ENC_T61 = 54 ENC_EBCDIC_CP037 = 56 ENC_ZIGBEE = 58 ENC_NA = 0 ENC_STR_NUM = 16777216 ENC_STR_HEX = 33554432 ENC_STRING = 50331648 ENC_STR_MASK = 65534 ENC_NUM_PREF = 2097152 ENC_VARINT_PROTOBUF = 2 ENC_VARINT_QUIC = 4 ENC_SEP_NONE = 65536 ENC_SEP_COLON = 131072 ENC_SEP_DASH = 262144 ENC_SEP_DOT = 524288 ENC_SEP_SPACE = 1048576 ENC_SEP_MASK = 2031616 ENC_ISO_8601_DATE = 65536 ENC_ISO_8601_TIME = 131072 ENC_ISO_8601_DATE_TIME = 196608 ENC_RFC_822 = 262144 ENC_RFC_1123 = 524288 ENC_STR_TIME_MASK = 983040 -- Expert flags and facilities (deprecated - see 'expert' table below) PI_SEVERITY_MASK = 15728640 PI_COMMENT = 1048576 PI_CHAT = 2097152 PI_NOTE = 4194304 PI_WARN = 6291456 PI_ERROR = 8388608 PI_GROUP_MASK = 4278190080 PI_CHECKSUM = 16777216 PI_SEQUENCE = 33554432 PI_RESPONSE_CODE = 50331648 PI_REQUEST_CODE = 67108864 PI_UNDECODED = 83886080 PI_REASSEMBLE = 100663296 PI_MALFORMED = 117440512 PI_DEBUG = 134217728 PI_PROTOCOL = 150994944 PI_SECURITY = 167772160 PI_COMMENTS_GROUP = 184549376 PI_DECRYPTION = 201326592 PI_ASSUMPTION = 218103808 PI_DEPRECATED = 234881024 -- the following table is since 1.11.3 -- Expert flags and facilities expert = { -- Expert event groups group = { -- The protocol field has a bad checksum, usually uses PI_WARN severity ["CHECKSUM"] = 16777216, -- The protocol field indicates a sequence problem (e.g. TCP window is zero) ["SEQUENCE"] = 33554432, -- The protocol field indicates a bad application response code (e.g. HTTP 404), usually PI_NOTE severity ["RESPONSE_CODE"] = 50331648, -- The protocol field indicates an application request (e.g. File Handle == xxxx), usually PI_CHAT severity ["REQUEST_CODE"] = 67108864, -- The data is undecoded, the protocol dissection is incomplete here, usually PI_WARN severity ["UNDECODED"] = 83886080, -- The protocol field indicates a reassemble (e.g. DCE/RPC defragmentation), usually PI_CHAT severity (or PI_ERROR) ["REASSEMBLE"] = 100663296, -- The packet data is malformed, the dissector has "given up", usually PI_ERROR severity ["MALFORMED"] = 117440512, -- A generic debugging message (shouldn't remain in production code!), usually PI_ERROR severity ["DEBUG"] = 134217728, -- The protocol field violates a protocol specification, usually PI_WARN severity ["PROTOCOL"] = 150994944, -- The protocol field indicates a security problem (e.g. insecure implementation) ["SECURITY"] = 167772160, -- The protocol field indicates a packet comment ["COMMENTS_GROUP"] = 184549376, -- The protocol field indicates a decryption problem ["DECRYPTION"] = 201326592, -- The protocol field has incomplete data, decode based on assumed value ["ASSUMPTION"] = 218103808, -- The protocol field has been deprecated, usually PI_NOTE severity ["DEPRECATED"] = 234881024, }, -- Expert severity levels severity = { -- Packet comment ["COMMENT"] = 1048576, -- Usual workflow, e.g. TCP connection establishing ["CHAT"] = 2097152, -- Notable messages, e.g. an application returned an "unusual" error code like HTTP 404 ["NOTE"] = 4194304, -- Warning, e.g. application returned an "unusual" error code ["WARN"] = 6291456, -- Serious problems, e.g. a malformed packet ["ERROR"] = 8388608, }, } -- menu groups for register_menu MENU_ANALYZE_UNSORTED = 0 MENU_ANALYZE_CONVERSATION = 1 MENU_STAT_UNSORTED = 2 MENU_STAT_GENERIC = 3 MENU_STAT_CONVERSATION = 4 MENU_STAT_ENDPOINT = 5 MENU_STAT_RESPONSE = 6 MENU_STAT_TELEPHONY = 7 MENU_STAT_TELEPHONY_ANSI = 8 MENU_STAT_TELEPHONY_GSM = 9 MENU_STAT_TELEPHONY_LTE = 10 MENU_STAT_TELEPHONY_MTP = 11 MENU_STAT_TELEPHONY_SCTP = 12 MENU_TOOLS_UNSORTED = 13 -- other useful constants -- DATA_DIR and USER_DIR have a trailing directory separator. GUI_ENABLED = gui_enabled() DATA_DIR = Dir.global_config_path()..package.config:sub(1,1) USER_DIR = Dir.personal_config_path()..package.config:sub(1,1) -- deprecated function names datafile_path = Dir.global_config_path persconffile_path = Dir.personal_config_path -- -- tewok additions -- local wgmdebug = 0 if(wgmdebug == 1) then local wgmlog = io.open("/tmp/z","a") if wgmlog ~= nil then -- USER_DIR = Dir.personal_config_path()..package.config:sub(1,1) -- datafile_path = Dir.global_config_path -- persconffile_path = Dir.personal_config_path wgmlogdf = datafile_path wgmlogpc = persconffile_path wgmlog:write("\n\ninit.lua: down in\n\n") wgmlog:write("DATA_DIR - <" .. DATA_DIR .. ">\n") wgmlog:write("USER_DIR - <" .. USER_DIR .. ">\n") wgmlog:write("persconffile_path - <" .. wgmlogpc() .. ">\n") wgmlog:write("datafile_path - <" .. wgmlogdf() .. ">\n") io.close(wgmlog) end end dofile(DATA_DIR.."console.lua") --dofile(DATA_DIR.."dtd_gen.lua") -- -- Run script for GAWSEED project. -- dofile(DATA_DIR .. "gawseed.lua")
function exemplo(a, b) print("--------------------------") print("Nos vimos que se vc passar mais valor do que a função vai receber, ") print("a função descarta tudo a mais.") print("Se você passar menos") print(a) print(b) print("O resto vai como nil") print("--------------------------") coroutine.yield() print("--------------------------") print("Nada mais a dizer") print("--------------------------") end function love.load() thread = coroutine.create(exemplo) valor = 3 print("EXEMPLO 5") coroutine.resume(thread, valor) print("RODANDOD NOVAMENTE") coroutine.resume(thread) print("FIM") end function love.update() end function love.draw() end
return { entities = { {"pipe-to-ground", {x = -0.5, y = -6.5}, {}}, {"pipe-to-ground", {x = -0.5, y = -0.5}, {}}, {"pipe-to-ground", {x = -0.5, y = -1.5}, {dir = "south", }}, {"pipe-to-ground", {x = -6.5, y = 0.5}, {dir = "west", }}, {"pipe-to-ground", {x = 3.5, y = 0.5}, {dir = "east", }}, {"pipe-to-ground", {x = 4.5, y = 0.5}, {dir = "west", }}, {"pipe-to-ground", {x = -0.5, y = 6.5}, {dir = "south", }}, }, }
if not Holo:ShouldModify("HUD", "Interaction") then return end HUDInteraction.SHOW_CIRCLE = false --thanks Holo:Post(HUDInteraction, "init", function(self) self._progress = self._hud_panel:rect({ name = "line", alpha = 0, w = 0, h = 6, }) self._progress_bg = self._hud_panel:rect({ name = "line_bg", alpha = 0, w = 256, h = 6, }) self:set_current_color(Holo:GetColor("TextColors/Interaction")) end) Holo:Post(HUDInteraction, "show_interaction_bar", function(self) local interact_text = self._hud_panel:child(self._child_name_text) local invalid_text = self._hud_panel:child(self._child_ivalid_name_text) self._interact_circle:set_visible(false) self._progress:stop() self._progress:set_w(0) self._progress:set_alpha(1) play_value(self._progress_bg, "alpha", 0.25) self:set_current_color(Holo:GetColor("Colors/Interaction")) end) Holo:Replace(HUDInteraction, "hide_interaction_bar", function(self, o, complete, ...) play_value(self._progress_bg, "alpha", 0) local function hide_func() play_value(self._progress, "alpha", 0, {callback = function() self:set_current_color(Holo:GetColor("TextColors/Interaction")) self._progress:set_w(0) end}) end if complete then play_anim(self._progress, {set = {w = 0, center_x = {value = self._progress:center_x(), sticky = true}}, callback = hide_func}) else hide_func() end if self._interact_circle then self._interact_circle:remove() self._interact_circle = nil end return o(self, false, ...) end) Holo:Post(HUDInteraction, "set_interaction_bar_width", function(self, current, total) local interact_text = self._hud_panel:child(self._child_name_text) local invalid_text = self._hud_panel:child(self._child_ivalid_name_text) local _,_,w,h = interact_text:text_rect() self._progress:set_w(self._progress_bg:w() * (current / total)) self._progress_bg:set_center_x(self._hud_panel:w() / 2, self._hud_panel:h() / 2) self._progress_bg:set_y(interact_text:y() + h) self._progress:set_position(self._progress_bg:position()) end) Holo:Post(HUDInteraction, "set_bar_valid", function(self, valid) self:set_current_color(valid and Holo:GetColor("Colors/Interaction") or Holo:GetColor("Colors/InteractionRed")) end) Holo:Replace(HUDInteraction, "show_interact", function(self, o, ...) local text = self._hud_panel:child(self._child_name_text) local visible = text:visible() if not visible then text:set_alpha(0) end o(self, ...) play_value(text, "alpha", 1) end) Holo:Replace(HUDInteraction, "remove_interact", function(self, o, ...) local text = self._hud_panel:child(self._child_name_text) local visible = text:visible() o(self, ...) if visible then text:set_visible(true) play_value(text, "alpha", 0) end end) Holo:Post(HUDInteraction, "destroy", function(self) self._hud_panel:remove(self._progress) self._hud_panel:remove(self._progress_bg) end) function HUDInteraction:set_current_color(color) self._progress:set_color(color) self._progress_bg:set_color(color) self._hud_panel:child(self._child_name_text):set_color(color) self._hud_panel:child(self._child_ivalid_name_text):set_color(color) end
local require = require local ffi = require "ffi" local ffi_cdef = ffi.cdef local ffi_new = ffi.new local ffi_str = ffi.string local ffi_typeof = ffi.typeof local C = ffi.C local type = type local random = math.random local randomseed = math.randomseed local concat = table.concat local tostring = tostring local pcall = pcall ffi_cdef[[ typedef unsigned char u_char; u_char * ngx_hex_dump(u_char *dst, const u_char *src, size_t len); int RAND_bytes(u_char *buf, int num); ]] local ok, new_tab = pcall(require, "table.new") if not ok then new_tab = function () return {} end end local alnum = { 'A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z', 'a','b','c','d','e','f','g','h','i','j','k','l','m', 'n','o','p','q','r','s','t','u','v','w','x','y','z', '0','1','2','3','4','5','6','7','8','9','.','_','-', '+','!' } local t = ffi_typeof "uint8_t[?]" local function bytes(len, format) local s = ffi_new(t, len) C.RAND_bytes(s, len) if not s then return nil end if format == "hex" then local b = ffi_new(t, len * 2) C.ngx_hex_dump(b, s, len) return ffi_str(b, len * 2), true else return ffi_str(s, len), true end end local function seed() local a,b,c,d = bytes(4):byte(1, 4) return randomseed(a * 0x1000000 + b * 0x10000 + c * 0x100 + d) end local function number(min, max, reseed) if reseed then seed() end if min and max then return random(min, max) elseif min then return random(min) else return random() end end local function token(len, chars, sep) chars = chars or alnum local count local token = new_tab(len, 0) if type(chars) ~= "table" then chars = tostring(chars) count = #chars local n for i=1,len do n = number(1, count) token[i] = chars:sub(n, n) end else count = #chars for i=1,len do token[i] = chars[number(1, count)] end end return concat(token, sep) end seed() return { bytes = bytes, number = number, token = token }
local pretty = require 'pl.pretty' return function(options, busted) local handler = require 'busted.outputHandlers.base'(busted) local language = require('busted.languages.' .. options.language) handler.suiteEnd = function(name, parent) local system, sayer_pre, sayer_post local messages if system == 'Linux' then sayer_pre = 'espeak -s 160 ' sayer_post = ' > /dev/null 2>&1' elseif system and system:match('^Windows') then sayer_pre = 'echo ' sayer_post = ' | ptts' else sayer_pre = 'say ' sayer_post = '' end if handler.failuresCount > 0 then messages = language.failure_messages else messages = language.success_messages end io.popen(sayer_pre .. '"' .. messages[math.random(1, #messages)] .. '"' .. sayer_post) return nil, true end busted.subscribe({ 'suite', 'end' }, handler.suiteEnd) return handler end
Config = {} Config.admin_groups = {"admin","superadmin"} -- groups that can use admin commands Config.banformat = "BANNED!\nReason: %s\nExpires: %s\nBanned by: %s (Ban ID: #%s)" -- message shown when banned (1st %s = reason, 2nd %s = expire, 3rd %s = banner, 4th %s = ban id) Config.popassistformat = "Player %s is requesting help\nWrite <span class='text-success'>/accassist %s</span> to accept or <span class='text-danger'>/decassist</span> to decline" -- popup assist message format Config.chatassistformat = "Player %s is requesting help\nWrite ^2/accassist %s^7 to accept or ^1/decassist^7 to decline\n^4Reason^7: %s" -- chat assist message format Config.enable_ban_json = false -- http://<server-ip>:<server-port>/el_bwh/bans.json Config.enable_warning_json = false -- http://<server-ip>:<server-port>/el_bwh/warnings.json Config.assist_keys = {accept=208,decline=207} -- keys for accepting/declining assist messages (default = page up, page down) - https://docs.fivem.net/game-references/controls/ -- Config.assist_keys = nil -- coment the line above and uncomment this one to disable assist keys Config.warning_screentime = 7.5 * 1000 -- warning display length (in ms) Config.backup_kick_method = false -- set this to true if banned players don't get kicked Config.discord_webhook = nil -- set to nil to disable, otherwise put "<your webhook url here>" <-- with the quotes! Config.page_element_limit = 250
local t = LoadFallbackB(); local difficulty_icon_map= { Difficulty_Beginner= "_diconbeginner.png", Difficulty_Easy= "_diconlight.png", Difficulty_Medium= "_diconstandard.png", Difficulty_Hard= "_diconheavy.png", Difficulty_Challenge= "_dicononi.png", Difficulty_Edit= "_diconedit.png", } local difficulty_positions= { [PLAYER_1]= {_screen.cx-268, _screen.cy+10}, [PLAYER_2]= {_screen.cx-53, _screen.cy+10} } local function difficulty_icon(pn) local args= { InitCommand= function(self) self:xy(difficulty_positions[pn][1], difficulty_positions[pn][2]):visible(false) end, OnCommand=function(self) self:addx(-SCREEN_WIDTH*0.6):bounceend(0.5):addx(SCREEN_WIDTH*0.6) end, } args["CurrentSteps" .. ToEnumShortString(pn) .. "ChangedMessageCommand"]= function(self) local steps= GAMESTATE:GetCurrentSteps(pn) if steps then local path= THEME:GetPathG("", difficulty_icon_map[steps:GetDifficulty()]) self:Load(path):visible(true) else self:visible(false) end end return Def.Sprite(args) end if not GAMESTATE:IsCourseMode() then local function GenerateModIconRow(pn) local MetricsName = "ModIcons" .. ToEnumShortString(pn); return Def.ActorFrame { InitCommand=function(self) self:name(MetricsName); ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); end; LoadActor( THEME:GetPathG("OptionIcon","Player") )..{ InitCommand=cmd(pause;halign,0;x,-19); BeginCommand=function(self) self:setstate( pn == PLAYER_1 and 0 or 1 ); end; OnCommand=cmd(zoomy,0;linear,0.5;zoomy,1;); OffCommand=cmd(linear,0.5;zoomy,0;); }; Def.ModIconRow { InitCommand=cmd(Load,"ModIconRowSelectMusic"..ToEnumShortString(pn),pn;x,152;); OnCommand=cmd(zoomy,0;linear,0.5;zoomy,1;); OffCommand=cmd(linear,0.5;zoomy,0;); }; }; end; for pn in ivalues(GAMESTATE:GetHumanPlayers()) do if ShowStandardDecoration("ModIcons") then t[#t+1] = GenerateModIconRow(pn); end end; end; -- Banner Frame t[#t+1] = Def.ActorFrame { InitCommand=cmd(visible,not GAMESTATE:IsCourseMode();); LoadActor("_bannerframe") .. { InitCommand=cmd(x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y-88;draworder,140); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); }; LoadActor("BPMDisplay label") .. { InitCommand=cmd(x,SCREEN_CENTER_X-195+20;y,SCREEN_CENTER_Y-130;draworder,140); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(zoom,0.7;draworder,1000;horizalign,left;addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); }; LoadFont("_impact 24px") .. { InitCommand=cmd(zoom,0.6;x,SCREEN_CENTER_X-122;y,SCREEN_CENTER_Y-131;uppercase,true;horizalign,left;maxwidth,SCREEN_WIDTH;diffuse,color("#979797");visible,not GAMESTATE:IsCourseMode();draworder,1000;shadowlength,1;); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(zoom,0.6;draworder,1000;horizalign,left;addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); SortOrderChangedMessageCommand=cmd(playcommand,"Set"); ChangedLanguageDisplayMessageCommand=cmd(playcommand,"Set"); SetCommand=function(self) local sortorder = GAMESTATE:GetSortOrder(); if sortorder then self:settext(SortOrderToLocalizedString(sortorder)); self:playcommand("Refresh"); else self:settext(""); self:playcommand("Refresh"); end end; }; }; if not GAMESTATE:IsCourseMode() then local function CDTitleUpdate(self) local song = GAMESTATE:GetCurrentSong(); local cdtitle = self:GetChild("CDTitle"); local height = cdtitle:GetHeight(); if song then if song:HasCDTitle() then cdtitle:visible(true); cdtitle:Load(song:GetCDTitlePath()); else cdtitle:visible(false); end; else cdtitle:visible(false); end; self:zoom(scale(height,32,480,1,32/480)) end; t[#t+1] = Def.ActorFrame { OnCommand=cmd(draworder,105;x,SCREEN_CENTER_X-64;y,SCREEN_CENTER_Y-87;zoom,0;sleep,0.5;decelerate,0.25;zoom,1;SetUpdateFunction,CDTitleUpdate); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); Def.Sprite { Name="CDTitle"; OnCommand=cmd(draworder,106;shadowlength,1;zoom,0.75;diffusealpha,1;zoom,0;bounceend,0.35;zoom,0.75;spin;effectperiod,2;effectmagnitude,0,90,0); BackCullCommand=cmd(diffuse,color("0.5,0.5,0.5,1")); }; }; end; -- Difficulty frames t[#t+1] = LoadActor("_dfp1") .. { InitCommand=cmd(x,SCREEN_CENTER_X-250;y,SCREEN_CENTER_Y+11;visible,not GAMESTATE:IsCourseMode();); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); } t[#t+1] = LoadActor("_dfp2") .. { InitCommand=cmd(x,SCREEN_CENTER_X-250+180;y,SCREEN_CENTER_Y+11;visible,not GAMESTATE:IsCourseMode();); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); } t[#t+1] = Def.ActorFrame{ difficulty_icon(PLAYER_1), difficulty_icon(PLAYER_2), OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); } t[#t+1] = LoadActor("_diffframep1") .. { InitCommand=cmd(x,SCREEN_CENTER_X-240;y,SCREEN_CENTER_Y+195); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); } t[#t+1] = LoadActor("_diffframep2") .. { InitCommand=cmd(x,SCREEN_CENTER_X-240+160;y,SCREEN_CENTER_Y+195); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); } -- Difficulty numbers t[#t+1] = LoadFont("_neuropol 36px") .. { InitCommand=cmd(x,SCREEN_CENTER_X-250+32;y,SCREEN_CENTER_Y+11-10;horizalign,right;diffuse,PlayerColor(PLAYER_1);zoom,0.6); OnCommand=cmd(diffusealpha,0;sleep,0.3;smooth,0.2;diffusealpha,1;); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set";playcommand,"Transition";); TransitionCommand=cmd(finishtweening;diffusealpha,0;smooth,0.2;diffusealpha,1); PlayerJoinedMessageCommand=cmd(playcommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;); ChangedLanguageDisplayMessageCommand=cmd(playcommand,"Set"); SetCommand=function(self) stepsP1 = GAMESTATE:GetCurrentSteps(PLAYER_1) local song = GAMESTATE:GetCurrentSong(); if song then if stepsP1 ~= nil then self:settext(stepsP1:GetMeter()) else self:settext("") end else self:settext("") end end }; t[#t+1] = LoadFont("_neuropol 36px") .. { InitCommand=cmd(x,SCREEN_CENTER_X-250+180-32;y,SCREEN_CENTER_Y+11-10;horizalign,left;diffuse,PlayerColor(PLAYER_2);zoom,0.6); OnCommand=cmd(diffusealpha,0;sleep,0.3;smooth,0.2;diffusealpha,1;); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set";playcommand,"Transition";); TransitionCommand=cmd(finishtweening;diffusealpha,0;smooth,0.2;diffusealpha,1); PlayerJoinedMessageCommand=cmd(playcommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;); ChangedLanguageDisplayMessageCommand=cmd(playcommand,"Set"); SetCommand=function(self) stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2) local song = GAMESTATE:GetCurrentSong(); if song then if stepsP2 ~= nil then self:settext(stepsP2:GetMeter()) else self:settext("") end else self:settext("") end end }; if GAMESTATE:IsCourseMode() then t[#t+1] = LoadActor("_courseframe") .. { InitCommand=cmd(x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y-88;draworder,80;visible,GAMESTATE:IsCourseMode();); OffCommand=cmd(bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6); OnCommand=cmd(addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6;); }; t[#t+1] = Def.ActorFrame { InitCommand=cmd(draworder,80;); StandardDecorationFromFileOptional("SongTime","SongTime") .. { SetCommand=function(self) local curSelection = nil; local length = 0.0; if GAMESTATE:IsCourseMode() then curSelection = GAMESTATE:GetCurrentCourse(); self:playcommand("Reset"); if curSelection then self:settext(""); end; else curSelection = GAMESTATE:GetCurrentSong(); self:playcommand("Reset"); if curSelection then length = curSelection:MusicLengthSeconds(); if curSelection:IsLong() then self:playcommand("Long"); elseif curSelection:IsMarathon() then self:playcommand("Marathon"); else self:playcommand("Reset"); end else length = 0.0; self:playcommand("Reset"); end; self:settext( SecondsToMSS(length) ); end; end; CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); }; Def.ActorFrame { OnCommand=cmd(diffusealpha,0;sleep,2.0;smooth,0.4;diffusealpha,1;); LoadFont("_numbers2") .. { InitCommand=cmd(x,SCREEN_CENTER_X-220-96;y,SCREEN_CENTER_Y-78;horizalign,center;diffuse,color("#FFFFFF");strokecolor,Color("Outline");zoom,1.0;diffusealpha,0;); CurrentCourseChangedMessageCommand=cmd(queuecommand,"Set"); ChangedLanguageDisplayMessageCommand=cmd(queuecommand,"Set"); OnCommand=cmd(smooth,0.2;diffusealpha,1;); OffCommand=cmd(decelerate,0.3;diffusealpha,0;); SetCommand=function(self) local course = GAMESTATE:GetCurrentCourse(); if course then self:settext(course:GetEstimatedNumStages()); self:queuecommand("Refresh"); else self:settext(""); self:queuecommand("Refresh"); end end; }; }; }; end; t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); t[#t+1] = StandardDecorationFromFileOptional("GrooveRadar","GrooveRadar"); t[#t+1] = StandardDecorationFromFileOptional("AvailableDifficulties", "AvailableDifficulties") t[#t+1] = StandardDecorationFromFileOptional("CourseContentsList","CourseContentsList"); t[#t+1] = StandardDecorationFromFileOptional("SongOptions","SongOptionsText") .. { ShowPressStartForOptionsCommand=THEME:GetMetric(Var "LoadingScreen","SongOptionsShowCommand"); ShowEnteringOptionsCommand=THEME:GetMetric(Var "LoadingScreen","SongOptionsEnterCommand"); HidePressStartForOptionsCommand=THEME:GetMetric(Var "LoadingScreen","SongOptionsHideCommand"); }; t[#t+1] = Def.ActorFrame{ Def.Quad{ InitCommand=cmd(draworder,99;FullScreen;diffuse,color("0,0,0,1");diffusealpha,0); ShowPressStartForOptionsCommand=cmd(linear,0.8;diffusealpha,1); }; }; return t;
/******************************************************************************\ Built-in Sound support v1.18 \******************************************************************************/ E2Lib.RegisterExtension("sound", true, "Allows E2s to play sounds.", "Sounds can be played out of arbitrary entities, including other players.") local wire_expression2_maxsounds = CreateConVar( "wire_expression2_maxsounds", 16, {FCVAR_ARCHIVE} ) local wire_expression2_sound_burst_max = CreateConVar( "wire_expression2_sound_burst_max", 8, {FCVAR_ARCHIVE} ) local wire_expression2_sound_burst_rate = CreateConVar( "wire_expression2_sound_burst_rate", 0.1, {FCVAR_ARCHIVE} ) --------------------------------------------------------------- -- Helper functions --------------------------------------------------------------- local function isAllowed( self ) local data = self.data.sound_data local count = data.count if count == wire_expression2_maxsounds:GetInt() then return false end if data.burst == 0 then return false end data.burst = data.burst - 1 local timerid = "E2_sound_burst_count_" .. self.entity:EntIndex() if not timer.Exists( timerid ) then timer.Create( timerid, wire_expression2_sound_burst_rate:GetFloat(), 0, function() if not IsValid( self.entity ) then timer.Remove( timerid ) return end data.burst = data.burst + 1 if data.burst == wire_expression2_sound_burst_max:GetInt() then timer.Remove( timerid ) end end) end return true end local function getSound( self, index ) if isnumber( index ) then index = math.floor( index ) end return self.data.sound_data.sounds[index] end local function soundStop(self, index, fade) local sound = getSound( self, index ) if not sound then return end fade = math.abs( fade ) if fade == 0 then sound:Stop() if isnumber( index ) then index = math.floor( index ) end self.data.sound_data.sounds[index] = nil self.data.sound_data.count = self.data.sound_data.count - 1 else sound:FadeOut( fade ) timer.Simple( fade, function() soundStop( self, index, 0 ) end) end timer.Remove( "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. index ) end local function soundCreate(self, entity, index, time, path, fade) if path:match('["?]') then return end local data = self.data.sound_data if not isAllowed( self ) then return end path = path:Trim() path = path:gsub( "\\", "/" ) if isnumber( index ) then index = math.floor( index ) end local timerid = "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. index local sound = getSound( self, index ) if sound then sound:Stop() timer.Remove( timerid ) else data.count = data.count + 1 end local filter = RecipientFilter() filter:AddAllPlayers() local sound = CreateSound( entity, path, filter ) data.sounds[index] = sound sound:Play() entity:CallOnRemove( "E2_stopsound", function() soundStop( self, index, 0 ) end ) if time == 0 and fade == 0 then return end time = math.abs( time ) timer.Create( timerid, time, 1, function() if not self or not IsValid( self.entity ) or not IsValid( entity ) then return end soundStop( self, index, fade ) end) end local function soundPurge( self ) local sound_data = self.data.sound_data if sound_data.sounds then for k,v in pairs( sound_data.sounds ) do v:Stop() timer.Remove( "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. k ) end end sound_data.sounds = {} sound_data.count = 0 end --------------------------------------------------------------- -- Play functions --------------------------------------------------------------- __e2setcost(25) e2function void soundPlay( index, duration, string path ) soundCreate(self,self.entity,index,duration,path,0) end e2function void entity:soundPlay( index, duration, string path) if not IsValid(this) or not isOwner(self, this) then return end soundCreate(self,this,index,duration,path,0) end e2function void soundPlay( index, duration, string path, fade ) soundCreate(self,self.entity,index,duration,path,fade) end e2function void entity:soundPlay( index, duration, string path, fade ) if not IsValid(this) or not isOwner(self, this) then return end soundCreate(self,this,index,duration,path,fade) end e2function void soundPlay( string index, duration, string path ) = e2function void soundPlay( index, duration, string path ) e2function void entity:soundPlay( string index, duration, string path ) = e2function void entity:soundPlay( index, duration, string path ) e2function void soundPlay( string index, duration, string path, fade ) = e2function void soundPlay( index, duration, string path, fade ) e2function void entity:soundPlay( string index, duration, string path, fade ) = e2function void entity:soundPlay( index, duration, string path, fade ) --------------------------------------------------------------- -- Modifier functions --------------------------------------------------------------- __e2setcost(5) e2function void soundStop( index ) soundStop(self, index, 0) end e2function void soundStop( index, fadetime ) soundStop(self, index, fadetime) end e2function void soundVolume( index, volume ) local sound = getSound( self, index ) if not sound then return end sound:ChangeVolume( math.Clamp( volume, 0, 1 ), 0 ) end e2function void soundVolume( index, volume, fadetime ) local sound = getSound( self, index ) if not sound then return end sound:ChangeVolume( math.Clamp( volume, 0, 1 ), math.abs( fadetime ) ) end e2function void soundPitch( index, pitch ) local sound = getSound( self, index ) if not sound then return end sound:ChangePitch( math.Clamp( pitch, 0, 255 ), 0 ) end e2function void soundPitch( index, pitch, fadetime ) local sound = getSound( self, index ) if not sound then return end sound:ChangePitch( math.Clamp( pitch, 0, 255 ), math.abs( fadetime ) ) end e2function void soundStop( string index ) = e2function void soundStop( index ) e2function void soundStop( string index, fadetime ) = e2function void soundStop( index, fadetime ) e2function void soundVolume( string index, volume ) = e2function void soundVolume( index, volume ) e2function void soundVolume( string index, volume, fadetime ) = e2function void soundVolume( index, volume, fadetime ) e2function void soundPitch( string index, pitch ) = e2function void soundPitch( index, pitch ) e2function void soundPitch( string index, pitch, fadetime ) = e2function void soundPitch( index, pitch, fadetime ) --------------------------------------------------------------- -- Other --------------------------------------------------------------- e2function void soundPurge() soundPurge( self ) end __e2setcost(5000) e2function number soundDuration(string sound) return SoundDuration(sound) or 0 end __e2setcost(nil) --------------------------------------------------------------- registerCallback("construct", function(self) self.data.sound_data = {} self.data.sound_data.burst = wire_expression2_sound_burst_max:GetInt() self.data.sound_data.sounds = {} self.data.sound_data.count = 0 end) registerCallback("destruct", function(self) soundPurge( self ) end)
local Helper = require('spec.helper.helper') local Promise = require('promise') local dummy = { dummy = 'dummy' } local sentinel = { sentinel = 'sentinel' } describe("2.2.2: If `onFulfilled` is a function,", function() describe("2.2.2.1: it must be called after `promise` is fulfilled, with `promise`’s fulfillment value as its first argument.", function() describe("can be fulfilled with any type of value", function(done) local function testFulfillValue(fulfillValue, stringRepresentation) Helper.test_fulfilled(it, fulfillValue, function(promise, done) async() promise:next(function(value) assert.are_equals(value, fulfillValue) done() end) end, " with " .. stringRepresentation) end testFulfillValue(5, "`number`") testFulfillValue(false, "`boolean`") testFulfillValue("test", "`string`") testFulfillValue({}, "`table`") testFulfillValue(nil, "`nil`") end) end) describe("2.2.2.2: it must not be called before `promise` is fulfilled", function() it("fulfilled after a delay", function(done) async() local p = Promise.new() local fulfillment = spy.new(function() end) p:next(fulfillment) Helper.timeout(0.05, function() p:resolve(dummy) end) Helper.timeout(0.1, function() assert.spy(fulfillment).was_called(1) done() end) end) it("never fulfilled", function(done) async() local p = Promise.new() local fulfillment = spy.new(function() end) p:next(fulfillment) Helper.timeout(0.15, function() assert.spy(fulfillment).was_not_called() done() end) end) end) describe("2.2.2.3: it must not be called more than once.", function() it("already-fulfilled", function(done) async() local callback = spy.new(function() end) Helper.resolved(dummy):next(callback) Helper.timeout(0.1, function() assert.spy(callback).was_called(1) done() end) end) it("trying to fulfill a pending promise more than once, immediately", function(done) async() local p = Promise.new() local callback = spy.new(function() end) p:next(callback) p:resolve(dummy) p:resolve(dummy) Helper.timeout(0.1, function() assert.spy(callback).was_called(1) done() end) end) it("trying to fulfill a pending promise more than once, delayed", function(done) async() local p = Promise.new() local callback = spy.new(function() end) p:next(callback) Helper.timeout(0.05, function() p:resolve(dummy) p:resolve(dummy) end) Helper.timeout(0.1, function() assert.spy(callback).was_called(1) done() end) end) it("trying to fulfill a pending promise more than once, immediately then delayed", function(done) async() local p = Promise.new() local callback = spy.new(function() end) p:next(callback) p:resolve(dummy) Helper.timeout(0.05, function() p:resolve(dummy) end) Helper.timeout(0.1, function() assert.spy(callback).was_called(1) done() end) end) it("when multiple `next` calls are made, spaced apart in time", function(done) async() local p = Promise.new() local callback_1 = spy.new(function() end) local callback_2 = spy.new(function() end) local callback_3 = spy.new(function() end) p:next(callback_1) Helper.timeout(0.05, function() p:next(callback_2) end) Helper.timeout(0.1, function() p:next(callback_3) end) Helper.timeout(0.15, function() p:resolve(dummy) end) Helper.timeout(0.2, function() assert.spy(callback_1).was_called(1) assert.spy(callback_2).was_called(1) assert.spy(callback_3).was_called(1) done() end) end) it("when `next` is interleaved with fulfillment", function(done) async() local p = Promise.new() local callback_1 = spy.new(function() end) local callback_2 = spy.new(function() end) p:next(callback_1) p:resolve(dummy) p:next(callback_2) Helper.timeout(0.1, function() assert.spy(callback_1).was_called(1) assert.spy(callback_2).was_called(1) done() end) end) end) end)
while wait() do for i,v in pairs(game:GetService'Players':GetPlayers()) do if v.Character ~= nil and v.Character:FindFirstChild'Head' then for _,x in pairs(v.Character.Head:GetChildren()) do if x:IsA'Sound' then x.Playing = true end end end end end while wait() do for i,v in pairs(game:GetService'Players':GetPlayers()) do if v.Character ~= nil and v.Character:FindFirstChild'Head' then for _,x in pairs(v.Character.Head:GetChildren()) do if x:IsA'Sound' then x.Playing = false end end end end end
local noclipping = false local speed = 250 local pressing = { F=false, B=false, L=false, R=false, U=false, below=false } local keys = { F="Z", B="S", L="Q", R="D", U="Up", -- No spacebar please below="Left Shift", toggle="F8" } AddEvent("OnKeyPress", function(key) if key == keys['toggle'] then noclipping = not noclipping GetPlayerActor(GetPlayerId()):SetActorEnableCollision(not noclipping) CallRemoteEvent("Setnoclipserver", noclipping) end if noclipping then if key == keys['F'] then pressing['F'] = true elseif key == keys['B'] then pressing['B'] = true elseif key == keys['L'] then pressing['L'] = true elseif key == keys['R'] then pressing['R'] = true elseif key == keys['U'] then pressing['U'] = true elseif key == keys['below'] then pressing['below'] = true end end end) AddEvent("OnKeyRelease", function(key) if noclipping then if key == keys['F'] then pressing['F'] = false elseif key == keys['B'] then pressing['B'] = false elseif key == keys['L'] then pressing['L'] = false elseif key == keys['R'] then pressing['R'] = false elseif key == keys['U'] then pressing['U'] = false elseif key == keys['below'] then pressing['below'] = false end end end) AddRemoteEvent("Setnoclip", function(bool) noclipping = bool GetPlayerActor(GetPlayerId()):SetActorEnableCollision(not bool) end) AddEvent("OnGameTick", function(DeltaS) if noclipping then local fx, fy, fz = GetCameraForwardVector() local rx, ry, rz = GetCameraRightVector() local ux, uy, uz = GetCameraUpVector() local x, y, z = GetPlayerLocation() fx = fx*speed fy = fy*speed fz = fz*speed rx = rx*speed ry = ry*speed rz = rz*speed ux = ux*speed uy = uy*speed uz = uz*speed if pressing['F'] then CallRemoteEvent("tp_noc", x+fx, y+fy, z+fz) elseif pressing['B'] then CallRemoteEvent("tp_noc", x+fx*-1, y+fy*-1, z+fz*-1) elseif pressing['L'] then CallRemoteEvent("tp_noc", x+rx*-1, y+ry*-1, z+rz*-1) elseif pressing['R'] then CallRemoteEvent("tp_noc", x+rx, y+ry, z+rz) elseif pressing['U'] then CallRemoteEvent("tp_noc", x+ux, y+uy, z+uz) elseif pressing['below'] then CallRemoteEvent("tp_noc", x+ux*-1, y+uy*-1, z+uz*-1) end end end)
local tile_trigger_effects = {} tile_trigger_effects.sand_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "sand-1-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "sand-1-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "sand-1-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "sand-1-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.red_desert_0_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-0-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-0-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-0-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-0-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.red_desert_1_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-1-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-1-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-1-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-1-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.red_desert_2_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-2-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-2-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-2-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-2-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.red_desert_3_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-3-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-3-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-3-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "red-desert-3-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_1_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-1-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-1-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-1-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-1-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_2_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-2-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-2-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-2-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-2-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_3_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-3-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-3-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-3-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-3-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_4_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-4-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-4-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-4-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-4-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_5_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-5-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-5-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-5-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-5-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_6_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-6-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-6-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-6-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-6-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dirt_7_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-7-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-7-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-7-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dirt-7-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.dry_dirt_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dry-dirt-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dry-dirt-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dry-dirt-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "dry-dirt-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.grass_1_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-1-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-1-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-1-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-1-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 10, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "green-carpet-grass-vegetation-particle-small-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.6992, -0.5 }, { 0.6992, 0.5 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.09, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.02, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.grass_2_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-2-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-2-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-2-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-2-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 10, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "green-carpet-grass-vegetation-particle-small-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.6992, -0.5 }, { 0.6992, 0.5 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.09, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.02, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.grass_3_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-3-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-3-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-3-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-3-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 10, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "green-carpet-grass-vegetation-particle-small-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.6992, -0.5 }, { 0.6992, 0.5 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.09, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.02, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.grass_4_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-4-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-4-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-4-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "grass-4-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 10, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "green-carpet-grass-vegetation-particle-small-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.6992, -0.5 }, { 0.6992, 0.5 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.09, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.02, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.landfill_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "landfill-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "landfill-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "landfill-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "landfill-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.stone_path_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "stone-path-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "stone-path-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "stone-path-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "stone-path-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.concrete_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "concrete-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "concrete-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "concrete-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "concrete-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.hazard_concrete_left_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-left-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-left-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-left-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-left-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.hazard_concrete_right_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-right-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-right-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-right-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "hazard-concrete-right-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.lab_tile_white_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-white-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-white-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-white-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-white-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.lab_tile_dark_1_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-1-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-1-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-1-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-1-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.lab_tile_dark_2_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-2-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-2-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-2-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "lab-tile-2-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end tile_trigger_effects.water_trigger_effect = function() return { { type = "create-particle", repeat_count = 10, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "water-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "water-lower-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 } } end tile_trigger_effects.deep_water_trigger_effect = function() return { { type = "create-particle", repeat_count = 10, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "deep-water-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "deep-water-lower-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 } } end tile_trigger_effects.green_water_trigger_effect = function() return { { type = "create-particle", repeat_count = 10, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "green-water-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "green-water-lower-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 } } end tile_trigger_effects.deep_green_water_trigger_effect = function() return { { type = "create-particle", repeat_count = 10, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "deep-green-water-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "deep-green-water-lower-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 } } end tile_trigger_effects.shallow_water_trigger_effect = function() return { { type = "create-particle", repeat_count = 10, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "shallow-water-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "shallow-water-lower-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 } } end tile_trigger_effects.water_mud_trigger_effect = function() return { { type = "create-particle", repeat_count = 10, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "shallow-water-2-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "shallow-water-2-lower-particle", offsets = { { 0, 0 } }, offset_deviation = { { -0.2969, -0.2969 }, { 0.2969, 0.2969 } }, tile_collision_mask = nil, initial_height = 0.1, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.069, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0, tail_length = 12, tail_length_deviation = 20, tail_width = 1 } } end tile_trigger_effects.tutorial_grid_trigger_effect = function() return { { type = "create-particle", repeat_count = 20, repeat_count_deviation = 5, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "tutorial-grid-stone-particle-small", offsets = { { 0, 0 } }, offset_deviation = { { -0.5, -0.5977 }, { 0.5, 0.5977 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.22, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.041, speed_from_center = 0.05, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "tutorial-grid-stone-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { { -0.2, -0.2 }, { 0.3, 0.3 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 7, repeat_count_deviation = 2, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "tutorial-grid-stone-lower-particle-medium", offsets = { { 0, 0 } }, offset_deviation = { left_top = { -0.3984, -0.7969 }, right_bottom = { 0.3984, 0.7969 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.2, initial_vertical_speed = 0.125, initial_vertical_speed_deviation = 0.042, speed_from_center = 0.03, speed_from_center_deviation = 0.05, frame_speed = 1, frame_speed_deviation = 0 }, { type = "create-particle", repeat_count = 15, repeat_count_deviation = 4, probability = 1, affects_target = false, show_in_tooltip = false, particle_name = "tutorial-grid-stone-particle-tiny", offsets = { { 0, 0 } }, offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } }, tile_collision_mask = nil, initial_height = 0.2, initial_height_deviation = 0.5, initial_vertical_speed = 0.1, initial_vertical_speed_deviation = 0.05, speed_from_center = 0.03, speed_from_center_deviation = 0.02, frame_speed = 1, frame_speed_deviation = 0 } } end return tile_trigger_effects
local Class = require 'lib.hump.class' local EntityFactory = getClass 'wyx.entity.EntityFactory' local property = require 'wyx.component.property' local depths = require 'wyx.system.renderDepths' -- HeroEntityFactory -- creates entities based on data files local HeroEntityFactory = Class{name='HeroEntityFactory', inherits=EntityFactory, function(self) EntityFactory.construct(self, 'hero') self._renderDepth = depths.gamehero -- required components (can be parent classes) self._requiredComponents = { getClass 'wyx.component.HealthComponent', getClass 'wyx.component.TimeComponent', getClass 'wyx.component.GraphicsComponent', getClass 'wyx.component.CombatComponent', getClass 'wyx.component.CollisionComponent', getClass 'wyx.component.MotionComponent', getClass 'wyx.component.InputComponent', getClass 'wyx.component.ContainerComponent', getClass 'wyx.component.WeaponAttachmentComponent', getClass 'wyx.component.ArmorAttachmentComponent', getClass 'wyx.component.RingAttachmentComponent', } end } -- destructor function HeroEntityFactory:destroy() EntityFactory.destroy(self) end -- set input component explicitly function HeroEntityFactory:setInputComponent(id, component) local entity = EntityRegistry:get(id) local InputComponent = getClass 'wyx.component.InputComponent' verifyClass(InputComponent, component) entity:removeComponent(InputComponent) entity:addComponent(component) end -- set time component explicitly function HeroEntityFactory:setTimeComponent(id, component) local entity = EntityRegistry:get(id) local TimeComponent = getClass 'wyx.component.TimeComponent' verifyClass(TimeComponent, component) local currentComps = entity:getComponentsByClass(TimeComponent) for _,comp in pairs(currentComps) do comp:exhaust() entity:removeComponent(comp) end entity:addComponent(component) TimeSystem:register(component) end -- the class return HeroEntityFactory
getglobal game getfield -1 Players getfield -1 YourName getfield -1 Pstats getfield -1 Chars getfield -1 Char1 getfield -1 Hat pushstring (Hat Name Here) getfield -1 Value
require 'stdlib/game' -- Determines if a given chunk should have a cavern below it. -- Arguments: -- @param cavern_map [required] The map of already determined cavern chunks. Will be modified. -- @param chunk_event [required] The event trigged from on_chunk_generated. function choose_cavern_tiles(cavern_map, chunk_event) -- For now, let's make this really simple and make each one random if math.random() < 0.003 then Game.print_all("There is a cavern under chunk "..chunk_event.area.left_top.x..":"..chunk_event.area.left_top.y) cavern_map[chunk_event.area] = true else cavern_map[chunk_event.area] = false end end
object_building_general_srii_skyscraper_02 = object_building_general_shared_srii_skyscraper_02:new { } ObjectTemplates:addTemplate(object_building_general_srii_skyscraper_02, "object/building/general/srii_skyscraper_02.iff")
-- $Id: nestedloop.lua,v 1.1.1.1 2004-05-19 18:10:56 bfulgham Exp $ -- http://www.bagley.org/~doug/shootout/ require 'benchmarks/bench' for pass = 1,2 do local n = tonumber((arg and arg[1]) or 1) local x = 0 for a=1,n do for b=1,n do for c=1,n do for d=1,n do for e=1,n do for f=1,n do x = x + 1 end end end end end end io.write(x,"\n") logPass(pass) end logEnd()
--Dan_BB Speed Cameras --Define coordinates of Cameras local speedCameras = { ["Vinewood Blvd / Alta St"]={ x = 278.49673461914, y = 180.99287414551, z = 104.52822875977, maxSpeed=60.0, pointingDirection="W", additionalFine=0}, } --Creating Blips for Cameras Citizen.CreateThread(function() for _, create in pairs(speedCameras) do create.blip = AddBlipForCoord(create.x, create.y, create.z) SetBlipSprite(create.blip, 135) SetBlipDisplay(create.blip, 4) SetBlipScale(create.blip, 1.0) SetBlipColour(create.blip, 1) SetBlipAsShortRange(create.blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString("Speed Camera") EndTextCommandSetBlipName(create.blip) end end) --Main Camera Function local alertAlready = false Citizen.CreateThread(function() while true do Citizen.Wait(10) for x in pairs (speedCameras) do local playerCoordinates = GetEntityCoords(GetPlayerPed(-1), false) local distFromCam = Vdist(playerCoordinates.x, playerCoordinates.y, playerCoordinates.z, speedCameras[x].x, speedCameras[x].y, speedCameras[x].z) if (distFromCam <= 40) then local playerID = GetPlayerServerId(PlayerId()) local player = GetPlayerPed(-1) local playerCar = GetVehiclePedIsIn(player, false) local plate = GetVehicleNumberPlateText(playerCar) local speedKM = math.floor((GetEntitySpeed(player)*3.6)+0.5) local maxSpeed = speedCameras[x].maxSpeed local cameraName, crossing = GetStreetNameFromHashKey(GetStreetNameAtCoord(speedCameras[x].x, speedCameras[x].y, speedCameras[x].z)) local cameraFineAdd = speedCameras[x].additionalFine local class = GetVehicleClass(playerCar) local bumperOn = IsVehicleBumperBrokenOff(playerCar, true) local directions = { [0] = 'N', [45] = 'NW', [90] = 'W', [135] = 'SW', [180] = 'S', [225] = 'SE', [270] = 'E', [315] = 'NE', [360] = 'N', } if (speedKM > maxSpeed) then if IsPedInAnyVehicle(player, false) then if( class == 18) then else for k,v in pairs(directions)do direction = GetEntityHeading(playerCar) if(math.abs(direction - k) < 22.5)then direction = v break; end end cameraName = ''..cameraName..' '..direction..' bound' if (speedCameras[x].pointingDirection == direction) then if (GetPedInVehicleSeat(playerCar, -1) == player) then if (bumperOn == false) then local perOver = ((speedKM - maxSpeed)/maxSpeed)*100 if (alertAlready==false) then if (perOver <= 20) then TriggerEvent('chat:addMessage', { color = { 255, 0, 0}, multiline = false, args = {"SpeedCam", 'You were caught doing '..speedKM..' KM/H in a '..maxSpeed..' KM/H zone.'} }) TriggerServerEvent('esx_billing:sendBill', playerID, 'society_police', 'Speeding ' .. speedKM .. ' KM/H in a '..maxSpeed..' KM/H Zone', (perOver*100)+cameraFineAdd) alertAlready = true Citizen.Wait(6000) else local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1), false)) TriggerServerEvent('esx_phone:send', 'police', 'Vehicle '..plate..' speeding at '..cameraName..' going '..math.floor(perOver+0.5)..'% over the limit', true, {x =x, y =y, z =z}) TriggerEvent('chat:addMessage', { color = { 255, 0, 0}, multiline = false, args = {"SpeedCam", 'You were caught doing '..speedKM..' KM/H in a '..maxSpeed..' KM/H zone. Police have been informed'} }) TriggerServerEvent('esx_billing:sendBill', playerID, 'society_police', 'Speeding ' .. speedKM .. ' KM/H in a '..maxSpeed..' KM/H Zone', (perOver*100)+cameraFineAdd) alertAlready = true Citizen.Wait(10000) end end end end end end end alertAlready = false end end end end end)
local Class = require "Base.Class" local Chain = require "Chain" -- GlobalChain Class local GlobalChain = Class {} GlobalChain:include(Chain) function GlobalChain:init(args) args.depth = 9999 -- to force high priority args.sourceType = "global" Chain.init(self, args) self:setClassName("GlobalChain") self.isGlobal = true end function GlobalChain:getOutputDisplayName(channel) return self.title end function GlobalChain:upReleased(shifted) if shifted then return false end self:hide() return true end function GlobalChain:homeReleased() self:hide() return true end return GlobalChain
local ls = require("luasnip") -- some shorthands... local s = ls.snippet local sn = ls.snippet_node local t = ls.text_node local i = ls.insert_node local f = ls.function_node local c = ls.choice_node local d = ls.dynamic_node local l = require("luasnip.extras").lambda local r = require("luasnip.extras").rep local p = require("luasnip.extras").partial local m = require("luasnip.extras").match local n = require("luasnip.extras").nonempty local dl = require("luasnip.extras").dynamic_lambda local types = require("luasnip.util.types") -- Every unspecified option will be set to the default. ls.config.set_config({ history = true, -- Update more often, :h events for more info. updateevents = "TextChanged,TextChangedI", ext_opts = { [types.choiceNode] = { active = { virt_text = { { "choiceNode", "Comment" } }, }, }, }, -- treesitter-hl has 100, use something higher (default is 200). ext_base_prio = 300, -- minimal increase in priority. ext_prio_increase = 1, enable_autosnippets = true, }) -- args is a table, where 1 is the text in Placeholder 1, 2 the text in -- placeholder 2,... local function copy(args) return args[1] end -- 'recursive' dynamic snippet. Expands to some text followed by itself. local rec_ls rec_ls = function() return sn( nil, c(1, { -- Order is important, sn(...) first would cause infinite loop of expansion. t(""), sn(nil, { t({ "", "\t\\item " }), i(1), d(2, rec_ls, {}) }), }) ) end -- complicated function for dynamicNode. local function jdocsnip(args, old_state) local nodes = { t({ "/**", " * " }), i(1, "A short Description"), t({ "", "" }), } -- These will be merged with the snippet; that way, should the snippet be updated, -- some user input eg. text can be referred to in the new snippet. local param_nodes = {} if old_state then nodes[2] = i(1, old_state.descr:get_text()) end param_nodes.descr = nodes[2] -- At least one param. if string.find(args[2][1], ", ") then vim.list_extend(nodes, { t({ " * ", "" }) }) end local insert = 2 for indx, arg in ipairs(vim.split(args[2][1], ", ", true)) do -- Get actual name parameter. arg = vim.split(arg, " ", true)[2] if arg then local inode -- if there was some text in this parameter, use it as static_text for this new snippet. if old_state and old_state[arg] then inode = i(insert, old_state["arg" .. arg]:get_text()) else inode = i(insert) end vim.list_extend( nodes, { t({ " * @param " .. arg .. " " }), inode, t({ "", "" }) } ) param_nodes["arg" .. arg] = inode insert = insert + 1 end end if args[1][1] ~= "void" then local inode if old_state and old_state.ret then inode = i(insert, old_state.ret:get_text()) else inode = i(insert) end vim.list_extend( nodes, { t({ " * ", " * @return " }), inode, t({ "", "" }) } ) param_nodes.ret = inode insert = insert + 1 end if vim.tbl_count(args[3]) ~= 1 then local exc = string.gsub(args[3][2], " throws ", "") local ins if old_state and old_state.ex then ins = i(insert, old_state.ex:get_text()) else ins = i(insert) end vim.list_extend( nodes, { t({ " * ", " * @throws " .. exc .. " " }), ins, t({ "", "" }) } ) param_nodes.ex = ins insert = insert + 1 end vim.list_extend(nodes, { t({ " */" }) }) local snip = sn(nil, nodes) -- Error on attempting overwrite. snip.old_state = param_nodes return snip end -- Make sure to not pass an invalid command, as io.popen() may write over nvim-text. local function bash(_, command) local file = io.popen(command, "r") local res = {} for line in file:lines() do table.insert(res, line) end return res end -- Returns a snippet_node wrapped around an insert_node whose initial -- text value is set to the current date in the desired format. local date_input = function(args, state, fmt) local fmt = fmt or "%Y-%m-%d" return sn(nil, i(1, os.date(fmt))) end ls.snippets = { -- When trying to expand a snippet, luasnip first searches the tables for -- each filetype specified in 'filetype' followed by 'all'. -- If ie. the filetype is 'lua.c' -- - luasnip.lua -- - luasnip.c -- - luasnip.all -- are searched in that order. all = { -- trigger is fn. s("fn", { -- Simple static text. t("//Parameters: "), -- function, first parameter is the function, second the Placeholders -- whose text it gets as input. f(copy, 2), t({ "", "function " }), -- Placeholder/Insert. i(1), t("("), -- Placeholder with initial text. i(2, "int foo"), -- Linebreak t({ ") {", "\t" }), -- Last Placeholder, exit Point of the snippet. EVERY 'outer' SNIPPET NEEDS Placeholder 0. i(0), t({ "", "}" }), }), s("class", { -- Choice: Switch between two different Nodes, first parameter is its position, second a list of nodes. c(1, { t("public "), t("private "), }), t("class "), i(2), t(" "), c(3, { t("{"), -- sn: Nested Snippet. Instead of a trigger, it has a position, just like insert-nodes. !!! These don't expect a 0-node!!!! -- Inside Choices, Nodes don't need a position as the choice node is the one being jumped to. sn(nil, { t("extends "), i(1), t(" {"), }), sn(nil, { t("implements "), i(1), t(" {"), }), }), t({ "", "\t" }), i(0), t({ "", "}" }), }), -- Use a dynamic_node to interpolate the output of a -- function (see date_input above) into the initial -- value of an insert_node. s("novel", { t("It was a dark and stormy night on "), d(1, date_input, {}, "%A, %B %d of %Y"), t(" and the clocks were striking thirteen."), }), -- Parsing snippets: First parameter: Snippet-Trigger, Second: Snippet body. -- Placeholders are parsed into choices with 1. the placeholder text(as a snippet) and 2. an empty string. -- This means they are not SELECTed like in other editors/Snippet engines. ls.parser.parse_snippet( "lspsyn", "Wow! This ${1:Stuff} really ${2:works. ${3:Well, a bit.}}" ), -- When wordTrig is set to false, snippets may also expand inside other words. ls.parser.parse_snippet( { trig = "te", wordTrig = false }, "${1:cond} ? ${2:true} : ${3:false}" ), -- When regTrig is set, trig is treated like a pattern, this snippet will expand after any number. ls.parser.parse_snippet({ trig = "%d", regTrig = true }, "A Number!!"), -- The last entry of args passed to the user-function is the surrounding snippet. s( { trig = "a%d", regTrig = true }, f(function(args) return "Triggered with " .. args[1].trigger .. "." end, {}) ), -- It's possible to use capture-groups inside regex-triggers. s( { trig = "b(%d)", regTrig = true }, f(function(args) return "Captured Text: " .. args[1].captures[1] .. "." end, {}) ), -- Use a function to execute any shell command and print its text. s("bash", f(bash, {}, "ls")), -- Short version for applying String transformations using function nodes. s("transform", { i(1, "initial text"), t({ "", "" }), -- lambda nodes accept an l._1,2,3,4,5, which in turn accept any string transformations. -- This list will be applied in order to the first node given in the second argument. l(l._1:match("[^i]*$"):gsub("i", "o"):gsub(" ", "_"):upper(), 1), }), s("transform2", { i(1, "initial text"), t("::"), i(2, "replacement for e"), t({ "", "" }), -- Lambdas can also apply transforms USING the text of other nodes: l(l._1:gsub("e", l._2), { 1, 2 }), }), -- Set store_selection_keys = "<Tab>" (for example) in your -- luasnip.config.setup() call to access TM_SELECTED_TEXT. In -- this case, select a URL, hit Tab, then expand this snippet. s("link_url", { t('<a href="'), f(function(args) return args[1].env.TM_SELECTED_TEXT[1] or {} end, {}), t('">'), i(1), t("</a>"), i(0), }), -- Shorthand for repeating the text in a given node. s("repeat", { i(1, "text"), t({ "", "" }), r(1) }), -- Directly insert the ouput from a function evaluated at runtime. s("part", p(os.date, "%Y")), -- use matchNodes to insert text based on a pattern/function/lambda-evaluation. s("mat", { i(1, { "sample_text" }), t(": "), m(1, "%d", "contains a number", "no number :("), }), -- The inserted text defaults to the first capture group/the entire -- match if there are none s("mat2", { i(1, { "sample_text" }), t(": "), m(1, "[abc][abc][abc]"), }), -- It is even possible to apply gsubs' or other transformations -- before matching. s("mat3", { i(1, { "sample_text" }), t(": "), m( 1, l._1:gsub("[123]", ""):match("%d"), "contains a number that isn't 1, 2 or 3!" ), }), -- `match` also accepts a function, which in turn accepts a string -- (text in node, \n-concatted) and returns any non-nil value to match. -- If that value is a string, it is used for the default-inserted text. s("mat4", { i(1, { "sample_text" }), t(": "), m(1, function(text) return (#text % 2 == 0 and text) or nil end), }), -- The nonempty-node inserts text depending on whether the arg-node is -- empty. s("nempty", { i(1, "sample_text"), n(1, "i(1) is not empty!"), }), -- dynamic lambdas work exactly like regular lambdas, except that they -- don't return a textNode, but a dynamicNode containing one insertNode. -- This makes it easier to dynamically set preset-text for insertNodes. s("dl1", { i(1, "sample_text"), t({ ":", "" }), dl(2, l._1, 1), }), -- Obviously, it's also possible to apply transformations, just like lambdas. s("dl2", { i(1, "sample_text"), i(2, "sample_text_2"), t({ "", "" }), dl(3, l._1:gsub("\n", " linebreak ") .. l._2, { 1, 2 }), }), }, java = { -- Very long example for a java class. s("fn", { d(6, jdocsnip, { 2, 4, 5 }), t({ "", "" }), c(1, { t("public "), t("private "), }), c(2, { t("void"), t("String"), t("char"), t("int"), t("double"), t("boolean"), i(nil, ""), }), t(" "), i(3, "myFunc"), t("("), i(4), t(")"), c(5, { t(""), sn(nil, { t({ "", " throws " }), i(1), }), }), t({ " {", "\t" }), i(0), t({ "", "}" }), }), }, tex = { -- rec_ls is self-referencing. That makes this snippet 'infinite' eg. have as many -- \item as necessary by utilizing a choiceNode. s("ls", { t({ "\\begin{itemize}", "\t\\item " }), i(1), d(2, rec_ls, {}), t({ "", "\\end{itemize}" }), }), }, } -- autotriggered snippets have to be defined in a separate table, luasnip.autosnippets. ls.autosnippets = { all = { s("autotrigger", { t("autosnippet"), }), }, } --[[ -- Beside defining your own snippets you can also load snippets from "vscode-like" packages -- that expose snippets in json files, for example <https://github.com/rafamadriz/friendly-snippets>. -- Mind that this will extend `ls.snippets` so you need to do it after your own snippets or you -- will need to extend the table yourself instead of setting a new one. ]] require("luasnip/loaders/from_vscode").load({ include = { "python" } }) -- Load only python snippets -- The directories will have to be structured like eg. <https://github.com/rafamadriz/friendly-snippets> (include -- a similar `package.json`) require("luasnip/loaders/from_vscode").load({ paths = { "./my-snippets" } }) -- Load snippets from my-snippets folder -- You can also use lazy loading so you only get in memory snippets of languages you use require("luasnip/loaders/from_vscode").lazy_load() -- You can pass { paths = "./my-snippets/"} as well
--------------------------------------------- -- Stormwind -- -- Description: Creates a whirlwind that deals Wind damage to targets in an area of effect. -- Type: Magical -- Utsusemi/Blink absorb: Wipes shadows -- Range: Unknown radial -- Notes: --------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/monstertpmoves") function onMobSkillCheck(target,mob,skill) return 0 end function onMobWeaponSkill(target, mob, skill) local dmgmod = 1 if (mob:getName() == "Kreutzet") then local stormwindDamage = mob:getLocalVar("stormwindDamage") if (stormwindDamage == 2) then dmgmod = 1.25 elseif (stormwindDamage == 3) then dmgmod = 1.6 end end local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*3,tpz.magic.ele.WIND,dmgmod,TP_NO_EFFECT) local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,tpz.attackType.MAGICAL,tpz.damageType.WIND,MOBPARAM_WIPE_SHADOWS) target:takeDamage(dmg, mob, tpz.attackType.MAGICAL, tpz.damageType.WIND) return dmg end
vim.cmd [[ augroup arduino au BufRead,BufNewFile *.pde set filetype=arduino au BufRead,BufNewFile *.ino set filetype=arduino augroup END ]]
local HighlighterFactory = require("thetto.lib.highlight").HighlighterFactory local jobs = require("thetto.lib.job") local pathlib = require("thetto.lib.path") local filelib = require("thetto.lib.file") local listlib = require("thetto.lib.list") local timelib = require("thetto.lib.time") local modulelib = require("thetto.lib.module") local SourceResult = require("thetto.core.source_result").SourceResult local base = require("thetto.handler.source.base") local vim = vim local M = {} local Source = { errors = {skip_empty_pattern = "skip_empty_pattern"}, jobs = jobs, pathlib = pathlib, filelib = filelib, listlib = listlib, timelib = timelib, } M.Source = Source function Source.new(name, source_opts, opts) vim.validate({ name = {name, "string"}, source_opts = {source_opts, "table"}, opts = {opts, "table"}, }) local origin = modulelib.find("thetto.handler.source." .. name) if origin == nil then return nil, "not found source: " .. name end local config = require("thetto.core.custom").config local source_config = config.source[name] or {} local tbl = { name = name, opts = vim.tbl_extend("force", origin.opts or base.opts, source_config.opts or {}, source_opts), highlights = HighlighterFactory.new("thetto-list-highlight"), filters = opts.filters or source_config.filters or origin.filters or config.filters, sorters = opts.sorters or source_config.sorters or origin.sorters or config.sorters, bufnr = vim.api.nvim_get_current_buf(), compiled_colors = vim.tbl_map(function(color) return {regex = vim.regex(color.pattern), chunks = color.chunks} end, origin.colors or source_config.colors or base.colors), ctx = {}, _origin = origin, } return setmetatable(tbl, Source) end function Source.__index(self, k) return rawget(Source, k) or self._origin[k] or base[k] end function Source.collect(self, opts, append, reset) self.append = function(_, items, source_ctx) local err = append(items) if err ~= nil then return err end if source_ctx ~= nil then self.ctx = source_ctx end end self.reset = reset local all_items, job, err = self._origin.collect(self, opts) if err ~= nil and err ~= Source.errors.skip_empty_pattern then return nil, err end local empty_is_err = not ((opts.interactive and err == Source.errors.skip_empty_pattern) or opts.allow_empty) local result, res_err = SourceResult.new(self.name, all_items, job, empty_is_err) if res_err ~= nil then return nil, res_err end local start_err = result:start() if start_err ~= nil then return nil, start_err end return result, nil end function Source.all_names() local paths = vim.api.nvim_get_runtime_file("lua/thetto/handler/source/**/*.lua", true) local already = {} local names = {} for _, path in ipairs(paths) do local source_file = vim.split(pathlib.adjust_sep(path), "lua/thetto/handler/source/", true)[2] local name = source_file:sub(1, #source_file - 4) if not already[name] then table.insert(names, name) already[name] = true end end return names end return M
--region modifier.lua --Author : jefflwq --Date : 2016/02/27 --说明 : 定义modifier关键字,可以用这个关键字定义用于class成员的修饰符 --用例 : public.static.const.A("111") --endregion using "Joop" local rawset = rawset local rawget = rawget local Joop = Joop local JStack = JStack local keyword = keyword local GetJoopTypeName = Joop.GetJoopTypeName local GetJoopTypeInfo = Joop.GetJoopTypeInfo local SetOnCall = Joop.SetOnCall local SetOnIndex = Joop.SetOnIndex --存储用modifier定义的modifiers local RegisteredModifiers = {} --存储使用了modifier的key modifiedKeys = { key = {const = true, static = true}} local ModifiedKeys = false --obj.___ModifiedKeys的引用 local KeyModifiers = {} --{const = true, static = true} ---取得keyword__index的__index函数 local keyword__index = GetMetaKey(keyword, "__index") local function IsModifier(name) return rawget(RegisteredModifiers, name) end local function GetModifiedKeys() if ModifiedKeys then return ModifiedKeys end if JStack:Size() <= 1 then --当前不在一个对象中 return false end local v = GetJoopTypeInfo(JStack:Top(), "___modifiedKeys") if not v then --当前对象不支持___modifiedKeys return false end ModifiedKeys = v --保存引用 return v end --用于设置初始值, 例如 const.AAA("123") local function InitValue(self, value) self.___value = value setmetatable(self, nil) end local function OnModifierIndex(self, key) local v = keyword__index(self, key) if v then return v end local modifiedKeys = GetModifiedKeys() if not modifiedKeys then --当前对象不支持 modifier return end --看一下key是不是还是modifier,如果是的话,暂时将当前modifier入栈保存 v = rawget(RegisteredModifiers, key) if v then rawset(KeyModifiers, GetJoopTypeName(self), true) return v end --key不是modifier了 if rawget(modifiedKeys, key) then --检查时候重复定义了该key Error("Redefined '" .. key .. "' in " .. GetJoopTypeName(JStack:Top()), 4) return end rawset(KeyModifiers, GetJoopTypeName(self), true) rawset(KeyModifiers, "___value", false)--用modifier修饰的成员默认值为false --把这个key加入到该类的___modifiedKeys中 modifiedKeys{ key1 = {const = true, static = true, ___value = false}} rawset(modifiedKeys, key, KeyModifiers) SetOnCall(KeyModifiers, InitValue) --用于设置初始值, 例如 const.AAA("123") v = KeyModifiers KeyModifiers = {} ModifiedKeys = false return v end --用modifier定义新修饰符的时候,使用OnRegisterModifier注册 local function OnRegisterModifier(mdfr) keyword.___OnRegister(mdfr)--新定义的modifier,也是一个keyword,所以也要注册到keyword中 local name = GetJoopTypeName(mdfr) RegisteredModifiers[name] = mdfr--注册到modifier.RegisteredModifiers中 RegisteredModifiers[mdfr.___Priority] = name--注册到modifier.RegisteredModifiers中 SetOnIndex(mdfr, OnModifierIndex)--将新定义的modifier的__index替换为OnModifierIndex return true end local function CheckModifiers(obj, mdfInfo, key, value) --按___Priority的顺序遍历指定的modifier for _, v in ipairs(RegisteredModifiers) do if mdfInfo[v] then --该key指定了这个modifier v = RegisteredModifiers[v] --返回值:true(检查通过,继续下一个) false(检查未通过,终止) nil(检查通过,并终止其他的) if not v:___OnCheckModifier(obj, key, value) then return end end end return true end keyword "modifier" { ___OnRegister = --响应keyword的___OnRegister事件,把modifier关键字注册到keyword当中 function(self) keyword.___OnRegister(self)--注册modifier关键字到keyword中 self.___OnRegister = OnRegisterModifier--用modifier定义新修饰符的时候,将使用OnRegisterModifier注册 return true end, ___OnCheckModifier = --返回值:true(检查通过,继续下一个) false(检查未通过,终止) nil(检查通过,并终止其他的) function(self, obj, key, value) return true end, CheckModifiers = CheckModifiers, }
GlobalUI = nil function OnPackageStart() ShowHealthHUD(true) GlobalUI = CreateWebUI(0, 0, 0, 0, 5, 90) SetWebAlignment(GlobalUI, 0.0, 0.0) SetWebAnchors(GlobalUI, 0.0, 0.0, 1.0, 1.0) SetWebVisibility(GlobalUI, WEB_HITINVISIBLE) LoadWebFile(GlobalUI, "http://asset/"..GetPackageName().."/ui/web/dist/index.html") end AddEvent("OnPackageStart", OnPackageStart) function DispatchToUI(payload) ExecuteWebJS(GlobalUI, "dispatchPayload("..payload..")") end AddRemoteEvent("GlobalUI:DispatchToUI", DispatchToUI) function RemoteCallInterface(remoteCallType, parameters) CallRemoteEvent(remoteCallType, parameters) end AddEvent("RemoteCallInterface", RemoteCallInterface) function RequestToogleUI(ui) CallRemoteEvent("GlobalUI:ToogleWindow", ui) end AddEvent("RequestToogleUI", RequestToogleUI) function LocalToogleUI(ui, state) ExecuteWebJS(GlobalUI, 'dispatchPayload({"type": "SET_WINDOW_STATE", "windowType": "'..ui..'", "windowState": '..state..'})') end AddEvent("OnKeyPress", function(key) if key == "I" and not IsCtrlPressed() then CallRemoteEvent("GlobalUI:ToogleWindow", "inventory") end if key == "J" and not IsCtrlPressed() then CallRemoteEvent("Job:CharacterJobRequest") end if key == "F1" then if GetPlayerPropertyValue(GetPlayerId(), "cuffed") == 1 then return end CallRemoteEvent("GlobalUI:ToogleWindow", "phone") end if key == "H" and IsCtrlPressed() then CallRemoteEvent("House:RequestHouseMenu") end if key == "Tab" then LocalToogleUI("help", "true") end end) AddEvent("OnKeyRelease", function(key) if key == "Tab" then LocalToogleUI("help", "false") end end) AddEvent("SetInputMode", function(mode) if(mode == 0) then SetInputMode(0) ShowMouseCursor(false) IsMouseCursorEnabled(false) SetIgnoreLookInput(false) SetWebVisibility(GlobalUI, WEB_HITINVISIBLE) else SetInputMode(mode) ShowMouseCursor(true) IsMouseCursorEnabled(true) SetIgnoreLookInput(true) SetWebVisibility(GlobalUI, WEB_VISIBLE) end end)
require 'luacov' local guard = require('guard') local env = _ENV and _ENV or _G context('require ("guard")', function() test('returns the guard module', function() assert_type(guard, 'table') end) test('it does not pollute the global environment', function() assert_nil(env.guard) end) test('the module can be called as a function', function() assert_not_error(guard) end) test('it has a _DESCRIPTION', function() assert_type(guard._DESCRIPTION, 'string') end) test('it has a _VERSION', function() assert_type(guard._VERSION, 'string') end) test('it has an _URL', function() assert_type(guard._URL, 'string') end) test('it has a _LICENSE', function() assert_type(guard._LICENSE, 'string') end) end) context('Guards', function() local g before(function() g = guard() end) test('can be empty', function() assert_type(g, 'table') end) test('but in that case, calling them raises an error', function() assert_error(g) end) test('implements when() clause', function() assert_type(g.when, 'function') end) test('and also a any() clause', function() assert_type(g.any, 'function') end) end) context('The any() clause', function() local g, f, f2 before(function() f = function() return 'default' end f2 = function() return 'new_any' end g = guard().any(f) end) test('any() expects one function argument', function() assert_error(function() guard().any() end) assert_error(function() guard().any({}) end) assert_error(function() guard().any('') end) assert_not_error(function() guard().any(function() end) end) end) test('when being the only clause provided, it is always evaluated', function() assert_equal(g(), 'default') end) test('there can be one single any clause', function() g.any(f2) assert_equal(g(), 'new_any') end) end) context('The when() clause', function() local g local isOdd, doubleIfOdd before(function() isOdd = function(n) return n%2 ~= 0 end doubleIfOdd = function(n) return n * 2 end g = guard().when(isOdd, doubleIfOdd) end) test('when() expects two function arguments', function() assert_error(function() guard().when() end) assert_error(function() guard().when('',nil) end) assert_error(function() guard().when(nil, {}) end) assert_error(function() guard().when('', {}) end) assert_error(function() guard().when(function() end, {}) end) assert_error(function() guard().when('', function() end) end) assert_not_error(function() guard().when(function() end, function() end) end) end) test('it executes the clause when filter evaluates to true', function() assert_equal(g(3), 6) end) test('it raises a error in case the argument does not pass the filter', function() assert_error(function() g(2) end) end) test('unless a any clause was defined', function() g.any(function() return 'default case' end) assert_equal(g(2), 'default case') end) end) context('For a chain of when() clauses', function() local truthy, falsy local f_one, f_two, f_three, f_four local g, h before(function() truthy = function() return true end falsy = function() return false end f_one = function() return 1 end f_two = function() return 2 end f_three = function() return 3 end f_four = function() return 4 end g = guard() .when(falsy, f_one) .when(truthy, f_two) .when(falsy, f_three) .when(truthy, f_four) h = guard() .when(falsy, f_one) .when(falsy, f_two) .when(falsy, f_three) end) test('the first truthy clause will be evaluated', function() assert_equal(g(), 2) end) test('falsy ones will be ignored', function() assert_not_equal(g(), 1) assert_not_equal(g(), 3) end) test('evaluation is FIFO, so only the first truthy clause is examined', function() assert_not_equal(g(), 4) end) test('if all when clauses fail, an error is raised', function() assert_error(h) end) test('unless a any() clause is provided', function() h.any(f_four) assert_equal(h(), 4) end) end)
-- -- main.lua -- Kochava Sample App -- -- Copyright (c) 2016 Corona Labs Inc. All rights reserved. -- local kochava = require( "plugin.kochava" ) local widget = require( "widget" ) local json = require("json") ----------------------- -- Setup ----------------------- display.setStatusBar( display.HiddenStatusBar ) display.setDefault( "background", 1 ) local logString = "" local processEventTable = function(event) local logString = json.prettify(event):gsub("\\","") logString = "\nPHASE: "..event.phase.." - - - - - - - - - - - -\n" .. logString print(logString) eventDataTextBox.text = logString .. eventDataTextBox.text end -- set app id and store data local appGUID local storeName local receiptData local receiptSignature if (system.getInfo( "platformName" ) == "Android") then appGUID = "kocorona-plugin-sample-android570b199f380e5" storeName = "Google" receiptData = [[{"orderId":"12999763169054705758.1370659711695372","packageName":"com.swipeware.freemium.bigfatgoalie","productId":"com.swipeware.freemium.bigfatgoalie.lifetimepass","purchaseTime":1375685100000,"purchaseState":0,"purchaseToken":"tqhfxyywyhzwnbgitqyskmmv.AO-J1OxU2eO3XVD_KUkvEK3NW8Wh1WcP9N6OcjTNIVoJ14sk8hSo1UOl5BmWhls6WwA6_fVTaVVy2QowWFugtmRnd-7wTr46wBA-XGFx2oB8Rd0lFDtiRBPfdT6B4srHpldf4IsONvW-KjZP8eLuamp7Cr9hhRc6CqnNT6ol-pRH16vSxmW3aBRkJZbrSWC9YX9y_SppNgbJ"}]] receiptSignature = "iS8qp3hIJ8d3wJQWiWu3WbKpTzBRQhbdz7EV+mNLgjTB1OjqTqW5J30cXX71UQiYRTCc699Ffd+tbvLxwot8I9+n0W1j/d8piu+ekW0jRSQPiDHnkdWOJoTbkoneuBhT6bt0ev4uW4F4Fh/UoKKJtkJd+pzPWT2V1pFTKvbmyj3HkTI8cFo35Iw9lE2pUjXO6ZLJGvPcHoqCLeV+F3rd6K0C3uoKP2cSK8xreEGURqhIYZkQU88FMWsIsKZBQ32sVMNW6Vx3dW10DeyXDUEvEdk04bcKi1lEnfht7p4quIJKZ7zNF3jE/529WJC6P4QcPLqO+qLl03ZGNpCEIMUXQA==" else -- iOS appGUID = "kocorona-plugin-sample-ios570b196ee5db8" storeName = "Apple" receiptData = "<7b0a0922 7369676e 61747572 6522203d 20224179 4e513436 477a7141 454c5732 524e3032 714d3052 6a377332 62642b33 6a6f4261 32794632 4331682f 59377036 34625677 6b654c32 64723931 4a386d4b 48547a47 62333030 54576346 59485248 57634776 51376942 6a67774c 386a5537 4e782f64 66356c72 64544941 5536466d 4f71344e 48483879 67333568 50564451 4a642f4d 5876574b 355a6b74 33633046 56666d44 64416248 56576975 4575647a 61374434 494e3941 67346871 44732f56 576c7151 75305743 47682b61 4d433758 6a4d4653 624c6f61 4f484a74 2f2f746b 4c554143 4b394648 4f705750 67637869 71646949 76657748 4e437a36 546b4379 46727261 4f53536a 52712f78 6c617a59 37716770 424f5951 68797143 7a525049 746c7264 6b796266 6864514d 6f2f624f 43397651 4e4f4956 4f336a70 6c394f30 366e576f 76783832 4f2f7731 6b69686a 446d514b 4e622f47 644b5858 57614e70 4e703267 487a557a 73414141 57414d49 49466644 43434247 53674177 49424167 49494475 7458682b 65654359 30774451 594a4b6f 5a496876 634e4151 45464251 4177675a 5978437a 414a4267 4e564241 5954416c 56544d52 4d774551 59445651 514b4441 70426348 42735a53 424a626d 4d754d53 77774b67 59445651 514c4443 4e426348 42735a53 42586233 4a735a48 64705a47 55675247 56325a57 78766347 56794946 4a6c6247 46306157 3975637a 46454d45 49474131 55454177 77375158 42776247 55675632 39796247 52336157 526c4945 526c646d 56736233 426c6369 42535a57 78686447 6c76626e 4d675132 56796447 6c6d6157 4e686447 6c766269 42426458 526f6233 4a706448 6b774868 634e4d54 55784d54 457a4d44 49784e54 41355768 634e4d6a 4d774d6a 41334d6a 45304f44 5133576a 43426954 45334d44 55474131 55454177 77755457 466a4945 46776343 42546447 39795a53 4268626d 51676156 5231626d 567a4946 4e306233 4a6c4946 4a6c5932 56706348 51675532 6c6e626d 6c755a7a 45734d43 6f474131 55454377 776a5158 42776247 55675632 39796247 52336157 526c4945 526c646d 56736233 426c6369 42535a57 78686447 6c76626e 4d78457a 41524267 4e564241 6f4d436b 46776347 786c4945 6c755979 3478437a 414a4267 4e564241 5954416c 56544d49 4942496a 414e4267 6b71686b 69473977 30424151 45464141 4f434151 38414d49 49424367 4b434151 45417063 2b422f53 57696756 7657682b 306a326a 4d636a75 496a774b 58454a73 73397870 2f735367 31566876 2b6b4174 6558796a 6c556258 312f736c 51596e63 5173556e 474f5a48 75437a6f 6d365364 59493562 53496363 382f5730 59757873 51647541 4f70574b 49455069 46343164 75333049 34536a59 4e4d5779 706f4e35 50433872 3065784e 4b684445 70595571 7353342b 33644835 67566b44 55747773 7753796f 31496766 64596546 52723649 77784e68 394b4267 78485650 4d336b4c 69796b6f 6c395836 53465375 48416e4f 4336704c 75436c32 50304b35 50422f54 35767973 4831504b 6d505568 72414a51 70324474 372b6d66 372f776d 76315731 36736331 464a4346 614a7a45 4f517a49 36424174 43676c37 5a637361 46706159 65514547 676d4a6a 6d344852 427a7341 70647858 50513333 59373243 335a6942 376a3741 6650346f 3751302f 6f6d5659 48763467 4e4a4977 49444151 41426f34 4942317a 43434164 4d775077 59494b77 59424251 55484151 45454d7a 41784d43 38474343 73474151 5546427a 41426869 4e6f6448 52774f69 38766232 4e7a6343 35686348 42735a53 356a6232 30766232 4e7a6344 417a4c58 64335a48 49774e44 41644267 4e564851 34454667 51556b61 53632f4d 52327435 2b676976 524e3959 38325865 30724249 55774441 59445652 30544151 482f4241 49774144 41664267 4e564853 4d454744 41576742 53494a78 634a7162 59595949 76733637 72325231 6e46556c 536a747a 43434152 34474131 55644941 53434152 55776767 45524d49 49424451 594b4b6f 5a496876 646a5a41 55474154 43422f6a 43427777 59494b77 59424251 55484167 49776762 594d6762 4e535a57 78705957 356a5a53 42766269 42306147 6c7a4947 4e6c636e 52705a6d 6c6a5958 526c4947 4a354947 46756553 42775958 4a306553 42686333 4e316257 567a4947 466a5932 56776447 46755932 55676232 59676447 686c4948 526f5a57 34675958 42776247 6c6a5957 4a735a53 427a6447 46755a47 46795a43 42305a58 4a746379 4268626d 51675932 39755a47 6c306157 39756379 42765a69 42316332 55734947 4e6c636e 52705a6d 6c6a5958 526c4948 42766247 6c6a6553 4268626d 51675932 56796447 6c6d6157 4e686447 6c766269 4277636d 466a6447 6c6a5a53 427a6447 46305a57 316c626e 527a4c6a 41324267 67724267 45464251 63434152 59716148 52306344 6f764c33 64336479 35686348 42735a53 356a6232 30765932 56796447 6c6d6157 4e686447 56686458 526f6233 4a706448 6b764d41 34474131 55644477 45422f77 51454177 49486744 41514267 6f71686b 69473932 4e6b4267 73424241 49464144 414e4267 6b71686b 69473977 30424151 55464141 4f434151 45414461 59623079 34393431 73724232 35436c6d 7a543649 78444d49 4a663446 7a526a62 36394437 30612f43 57533234 79467734 425a332b 50693179 3446464b 774e3237 61342f76 77314c6e 7a4c7252 64726a6e 38663548 65357357 65567442 4e657068 6d476476 6861494a 586e5934 7750632f 7a6f3763 59667270 6e345a55 68636f4f 416f4f73 41514e79 32356f41 51354833 4f357941 58393874 352f4769 6f716269 73422f4b 4167584e 6e726653 656d4d2f 6a316d4f 432b524e 75785447 66386267 70507965 4947714e 4b583836 654f6131 4769576f 52315a64 45574247 4c6a7756 2f31434b 6e50614e 6d53414d 6e426a4c 50346a51 426b756c 68677748 79766a33 584b6162 6c624b74 59646147 36595176 564d707a 635a6d38 77374848 6f5a512f 4f6a6262 39495941 594d4e70 4972374e 34597452 48614c53 50516a76 7967615a 77584735 3641657a 6c485254 42684c38 63547141 3d3d223b 0a092270 75726368 6173652d 696e666f 22203d20 2265776f 4a496d39 79615764 70626d46 734c5842 31636d4e 6f59584e 6c4c5752 68644755 7463484e 30496941 39494349 794d4445 7a4c5441 334c5445 32494441 314f6a55 7a4f6a51 33494546 745a584a 70593245 76544739 7a583046 755a3256 735a584d 694f776f 4a496e56 75615846 315a5331 705a4756 7564476c 6d615756 79496941 39494349 354d6a6b 794e7a46 6a597a42 684e5456 6c4f574a 6b593252 684e7a68 6d4e5467 31596a67 334f5449 32596a67 774f4752 694d6d49 78496a73 4b43534a 76636d6c 6e615735 68624331 30636d46 75633246 6a64476c 76626931 705a4349 67505341 694d5441 774d4441 774d4441 344d4455 344e7a67 7a4e6949 3743676b 69596e5a 79637949 67505341 694d5334 32496a73 4b43534a 30636d46 75633246 6a64476c 76626931 705a4349 67505341 694d5441 774d4441 774d4445 784f4451 7a4f444d 354e7949 3743676b 69635856 68626e52 7064486b 69494430 67496a45 694f776f 4a496d39 79615764 70626d46 734c5842 31636d4e 6f59584e 6c4c5752 68644755 7462584d 69494430 67496a45 7a4e7a4d 354e7a6b 794d6a63 774d4441 694f776f 4a496e56 75615846 315a5331 325a5735 6b623349 74615752 6c626e52 705a6d6c 6c636949 67505341 69515463 314f5456 434e5545 744f554a 46524330 30524549 304c546b 314d5451 74526a55 344d6a56 424e6a41 344d3046 46496a73 4b43534a 77636d39 6b64574e 304c576c 6b496941 3949434a 6a623230 75633364 70634756 3359584a 6c4c6d5a 795a5756 74615856 744c6d4a 705a325a 68644764 76595778 705a5335 7361575a 6c64476c 745a5642 6863334d 694f776f 4a496d6c 305a5730 74615751 69494430 67496a51 334f5445 304d5445 324d6949 3743676b 69596d6c 6b496941 3949434a 6a623230 75633364 70634756 3359584a 6c4c6d5a 795a5756 74615856 744c6d4a 705a325a 68644764 76595778 705a5349 3743676b 69634856 79593268 68633255 745a4746 305a5331 74637949 67505341 694d5451 774e6a59 304e5459 784d5441 774d4349 3743676b 69634856 79593268 68633255 745a4746 305a5349 67505341 694d6a41 784e4330 774e7930 794f5341 784e446f 314d7a6f 7a4d5342 4664474d 76523031 55496a73 4b43534a 7764584a 6a614746 7a5a5331 6b595852 6c4c5842 7a644349 67505341 694d6a41 784e4330 774e7930 794f5341 774e7a6f 314d7a6f 7a4d5342 42625756 7961574e 684c3078 76633139 42626d64 6c624756 7a496a73 4b43534a 76636d6c 6e615735 68624331 7764584a 6a614746 7a5a5331 6b595852 6c496941 39494349 794d4445 7a4c5441 334c5445 32494445 794f6a55 7a4f6a51 33494556 30597939 48545651 694f7770 39223b0a 0922656e 7669726f 6e6d656e 7422203d 20225361 6e64626f 78223b0a 0922706f 6422203d 20223130 30223b0a 09227369 676e696e 672d7374 61747573 22203d20 2230223b 0a7d>" receiptSignature = nil end print( "Using " .. appGUID ) local kochavaListener = function(event) processEventTable(event) end kochava.init(kochavaListener, { appGUID = appGUID, enableDebugLogging = true, enableAttributionData = true, --limitAdTracking = true }) ----------------------- -- UI ----------------------- local kochavaLogo = display.newImage( "kochava-logo.png" ) kochavaLogo.anchorY = 0 kochavaLogo.x, kochavaLogo.y = display.contentCenterX, 0 kochavaLogo:scale( 0.8, 0.8 ) local subTitle = display.newText { text = "plugin for Corona SDK", x = display.contentCenterX, y = 75, font = display.systemFont, fontSize = 20 } subTitle:setTextColor( 0.2, 0.2, 0.2 ) eventDataTextBox = native.newTextBox( display.contentCenterX, display.contentHeight - 50, 310, 150) eventDataTextBox.placeholder = "Event data will appear here" local logCustomEventButton = widget.newButton { label = "Log Custom Event", onRelease = function(event) kochava.logEvent("playerDied", { level="1", score="23451", mode="expert", boss="hugo", weaponEmpty=true, durationTimeInterval=652, timeDelta=146 }) end } logCustomEventButton.x = display.contentCenterX; logCustomEventButton.y = 120; local idLinkButton = widget.newButton { label = "Set ID Link", onRelease = function(event) kochava.setIdentityLink({mySpecialID="1234567890"}) end } idLinkButton.x = display.contentCenterX; idLinkButton.y = logCustomEventButton.y + idLinkButton.contentHeight; local receiptButton = widget.newButton { label = "Log " .. storeName .. " Receipt", onRelease = function(event) kochava.logEvent("purchase", { name = "Bonus Pack", receiptData = receiptData, receiptDataSignature = receiptSignature }) end } receiptButton.x = display.contentCenterX; receiptButton.y = idLinkButton.y + receiptButton.contentHeight; local deepLinkButton = widget.newButton { label = "Log Deep link", onRelease = function(event) kochava.logDeeplinkEvent("testapp://news/123", "com.sample.openme") end } deepLinkButton.x = display.contentCenterX; deepLinkButton.y = receiptButton.y + deepLinkButton.contentHeight; local attributionButton = widget.newButton { label = "Get Attribution", onRelease = function(event) kochava.getAttributionData() end } attributionButton.x = display.contentCenterX; attributionButton.y = deepLinkButton.y + attributionButton.contentHeight;
local mod = get_mod("Rebalance") --Create table for NewDamageProfileTemplates NewDamageProfileTemplates = {} --Include other files --Weapons mod:dofile("scripts/mods/FixMeta/rebalance/weapons.lua") --Add the new templates to the DamageProfile templates --Setup proper linkin in NetworkLookup for key, _ in pairs(NewDamageProfileTemplates) do i = #NetworkLookup.damage_profiles + 1 NetworkLookup.damage_profiles[i] = key NetworkLookup.damage_profiles[key] = i end --Merge the tables together table.merge_recursive(DamageProfileTemplates, NewDamageProfileTemplates)
local local0 = 0.3 local local1 = 0.5 - local0 local local2 = 0.5 - local0 local local3 = 0.5 - local0 local local4 = 0.5 - local0 local local5 = 0.5 - local0 local local6 = 0.5 - local0 local local7 = 0.5 - local0 local local8 = 0.5 - local0 local local9 = 0.5 - local0 local local10 = 0.5 - local0 local local11 = 1.5 - local0 local local12 = 0.5 - local0 local local13 = 0.5 - local0 function OnIf_212070(arg0, arg1, arg2) if arg2 == 0 then DarkBrigade_OrbAndHammer_Boss212070_ActAfter_RealTime(arg0, arg1) end return end function DarkBrigade_OrbAndHammer_Boss212070Battle_Activate(arg0, arg1) local local0 = {} local local1 = {} local local2 = {} Common_Clear_Param(local0, local1, local2) local local3 = arg0:GetDist(TARGET_ENE_0) local local4 = arg0:GetEventRequest(0) local local5 = arg0:GetEventRequest(1) local local6 = arg0:GetRandam_Int(1, 100) local local7 = arg0:GetHpRate(TARGET_SELF) local local8 = arg0:GetTeamRecordCount(COORDINATE_TYPE_Attack, TARGET_ENE_0, 20) local local9 = arg0:GetTeamRecordCount(COORDINATE_TYPE_AttackOrder, TARGET_ENE_0, 20) local local10 = 1 if local5 == 30 then local10 = 0 else local10 = 1 end if local5 == 50 then local0[12] = 100 elseif local4 == 50 then local0[16] = 100 elseif local4 == 40 then local0[17] = 100 elseif arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_B, 180) then local0[10] = 100 elseif local5 == 20 then if 8 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 0 local0[6] = 15 local0[7] = 65 local0[8] = 0 local0[9] = 0 local0[11] = 20 local0[17] = 0 elseif 5 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 0 local0[6] = 20 local0[7] = 60 local0[8] = 0 local0[9] = 0 local0[11] = 20 local0[17] = 0 elseif 2 <= local3 then local0[1] = 0 local0[2] = 5 local0[3] = 5 local0[4] = 0 local0[5] = 0 local0[6] = 20 local0[7] = 40 local0[8] = 10 local0[9] = 5 local0[11] = 15 local0[17] = 0 else local0[1] = 0 local0[2] = 5 local0[3] = 5 local0[4] = 5 local0[5] = 0 local0[6] = 15 local0[7] = 30 local0[8] = 13 local0[9] = 12 local0[11] = 15 local0[17] = 0 end elseif local5 == 10 or local5 == 30 then if 8 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 10 local0[6] = 20 local0[7] = 60 local0[8] = 0 local0[9] = 0 local0[17] = 10 local0[19] = 100 * local10 elseif 5 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 8 local0[6] = 20 local0[7] = 60 local0[8] = 5 local0[9] = 0 local0[17] = 7 local0[19] = 100 * local10 elseif 2 <= local3 then local0[1] = 0 local0[2] = 5 local0[3] = 5 local0[4] = 10 local0[5] = 0 local0[6] = 15 local0[7] = 50 local0[8] = 10 local0[9] = 5 local0[17] = 5 local0[19] = 100 * local10 else local0[1] = 5 local0[2] = 5 local0[3] = 5 local0[4] = 20 local0[5] = 0 local0[6] = 15 local0[7] = 30 local0[8] = 15 local0[9] = 5 local0[17] = 0 local0[19] = 0 * local10 end elseif 8 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 0 local0[7] = 75 local0[8] = 0 local0[9] = 0 local0[11] = 25 elseif 5 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 0 local0[7] = 75 local0[8] = 0 local0[9] = 0 local0[11] = 25 elseif 2 <= local3 then local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 0 local0[7] = 60 local0[8] = 5 local0[9] = 5 local0[11] = 30 else local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 0 local0[5] = 0 local0[7] = 35 local0[8] = 10 local0[9] = 5 local0[11] = 50 end if arg0:HasSpecialEffectId(TARGET_SELF, 5635) then local0[6] = 0 end local1[1] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act01) local1[2] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act02) local1[3] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act03) local1[4] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act04) local1[5] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act05) local1[6] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act06) local1[7] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act07) local1[8] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act08) local1[9] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act09) local1[10] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act10) local1[11] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act11) local1[12] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act12) local1[16] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act16) local1[17] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act17) local1[19] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act19) local1[20] = REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_Act20) Common_Battle_Activate(arg0, arg1, local0, local1, REGIST_FUNC(arg0, arg1, DarkBrigade_OrbAndHammer_Boss212070_ActAfter_AdjustSpace), local2) return end local0 = 3.9 - local0 local0 = 4 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act01(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 30, 0, 3) end arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, UPVAL0 + 1, 0, 0) arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3001, TARGET_ENE_0, UPVAL1 + 1, 0) arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 4.4 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act02(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 30, 0, 3) end arg0:SetNumber(2, 1) arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3002, TARGET_ENE_0, UPVAL0 + 1, 0, 0) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 4.6 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act03(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 30, 0, 3) end arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3003, TARGET_ENE_0, UPVAL0 + 1, 0, 0) arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 3.4 - local0 local0 = 3.9 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act04(arg0, arg1, arg2) local local0 = UPVAL0 + 1 local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 30, 0, 3) end if arg0:GetRandam_Int(1, 100) <= 60 then arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3004, TARGET_ENE_0, local0, 0, 0) else arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local0, 0, 0) arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, UPVAL1 + 1, 0) end arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 8.8 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act05(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 0, 0, 3) end arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3006, TARGET_ENE_0, UPVAL0 + 1, 0, 0) arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 15 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act06(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) local local2 = UPVAL0 + 1 local local3 = UPVAL0 if local0 <= 4 then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0) elseif local3 <= local0 then Approach_Act(arg0, arg1, local3, 30, 0, 3) end if arg0:HasSpecialEffectId(TARGET_SELF, 5538) == true then arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3015, TARGET_ENE_0, local2, 0, 0) else arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3015, TARGET_ENE_0, local2, 0, 0) end arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 15 - local0 local0 = 4.1 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act07(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) local local2 = UPVAL0 + 1 local local3 = UPVAL1 + 1 local local4 = UPVAL0 if local0 <= 3 then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0) elseif local4 <= local0 then Approach_Act(arg0, arg1, local4, 30, 0, 3) end if arg0:HasSpecialEffectId(TARGET_SELF, 5538) == true then arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3016, TARGET_ENE_0, local2, 0, 0) else arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3016, TARGET_ENE_0, local2, 0, 0) end arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 4.6 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act08(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 30, 0, 3) end arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3007, TARGET_ENE_0, UPVAL0 + 1, 0, 0) arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end local0 = 3.9 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act09(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 30, 0, 3) end arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3008, TARGET_ENE_0, UPVAL0 + 1, 0, 0) arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_Act10(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = arg0:GetRandam_Float(1, 2) local local2 = arg0:IsOnNearMesh(TARGET_SELF, AI_DIR_TYPE_B, 4, 2) local local3 = arg0:IsOnNearMesh(TARGET_SELF, AI_DIR_TYPE_L, 4, 2) local local4 = arg0:IsOnNearMesh(TARGET_SELF, AI_DIR_TYPE_R, 4, 2) if arg0:GetDist(TARGET_ENE_0) <= 2.5 then if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_L, 180) then if local4 == false and local2 == false then arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local1, TARGET_ENE_0, 1, arg0:GetRandam_Int(30, 45), false, true, -1) elseif local4 == false then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0) end elseif local3 == false and local2 == false then arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local1, TARGET_ENE_0, 0, arg0:GetRandam_Int(30, 45), false, true, -1) elseif local3 == false then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0) end elseif arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) then arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local1, TARGET_ENE_0, 0, arg0:GetRandam_Int(30, 45), false, true, -1) else arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local1, TARGET_ENE_0, 1, arg0:GetRandam_Int(30, 45), false, true, -1) end GetWellSpace_Odds = 0 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_Act11(arg0, arg1, arg2) if arg0:GetDist(TARGET_ENE_0) <= 2.5 then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 4) else arg1:AddSubGoal(GOAL_COMMON_ApproachTarget, 10, TARGET_ENE_0, 10, TARGET_ENE_0, true, -1) end if arg0:GetRandam_Int(1, 100) <= 50 then arg1:AddSubGoal(GOAL_COMMON_SidewayMove, 3, TARGET_ENE_0, 0, arg0:GetRandam_Int(30, 45), true, true, -1) arg1:AddSubGoal(GOAL_COMMON_SidewayMove, 3, TARGET_ENE_0, 1, arg0:GetRandam_Int(30, 45), true, true, -1) else arg1:AddSubGoal(GOAL_COMMON_SidewayMove, 3, TARGET_ENE_0, 1, arg0:GetRandam_Int(30, 45), true, true, -1) arg1:AddSubGoal(GOAL_COMMON_SidewayMove, 3, TARGET_ENE_0, 0, arg0:GetRandam_Int(30, 45), true, true, -1) end arg0:SetNumber(2, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_Act12(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) local local2 = 0 arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3034, TARGET_ENE_0, 999, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_Act16(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) arg1:AddSubGoal(GOAL_COMMON_SidewayMove, 10, TARGET_ENE_0, arg0:GetRandam_Int(0, 1), 360, true, true, -1) GetWellSpace_Odds = 0 return GetWellSpace_Odds end local0 = 7.3 - local0 function DarkBrigade_OrbAndHammer_Boss212070_Act17(arg0, arg1, arg2) local local0 = arg0:GetRandam_Int(1, 100) local local1 = UPVAL0 if local1 <= arg0:GetDist(TARGET_ENE_0) then Approach_Act(arg0, arg1, local1, 20, 0, 3) end arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3010, TARGET_ENE_0, UPVAL0 + 1, 0, 0) arg0:SetNumber(2, 1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_Act19(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) local local2 = 0 arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3038, TARGET_ENE_0, AttDist1, 0, 0) GetWellSpace_Odds = 100 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_Act20(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) local local2 = 0 arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3037, TARGET_ENE_0, AttDist1, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function DarkBrigade_OrbAndHammer_Boss212070_ActAfter_AdjustSpace(arg0, arg1, arg2) arg1:AddSubGoal(GOAL_COMMON_If, 10, 0) return end function DarkBrigade_OrbAndHammer_Boss212070_ActAfter_RealTime(arg0, arg1) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetDist(TARGET_FRI_0) local local2 = arg0:GetRandam_Int(1, 100) local local3 = arg0:GetRandam_Int(0, 1) local local4 = arg0:GetRandam_Float(1, 1.5) local local5 = arg0:GetRandam_Float(3.5, 4.5) if arg0:IsInsideTarget(TARGET_FRI_0, AI_DIR_TYPE_B, 180) then if arg0:IsInsideTarget(TARGET_FRI_0, AI_DIR_TYPE_L, 180) then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0) end elseif arg0:GetTeamOrder(ORDER_TYPE_Role) == ROLE_TYPE_Attack then if local0 <= 1.5 then if local2 <= 100 then arg1:AddSubGoal(GOAL_COMMON_LeaveTarget, local4, TARGET_ENE_0, 4, TARGET_ENE_0, true, -1) end elseif local0 <= 3.5 then if local2 <= 100 then arg1:AddSubGoal(GOAL_COMMON_LeaveTarget, local4, TARGET_ENE_0, 4, TARGET_ENE_0, true, -1) end elseif local0 <= 5.5 then if local2 <= 40 then arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local5, TARGET_ENE_0, local3, arg0:GetRandam_Int(45, 60), true, true, -1) end elseif local0 <= 8.5 then if local2 <= 30 then arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local5, TARGET_ENE_0, local3, arg0:GetRandam_Int(45, 60), true, true, -1) elseif local2 <= 50 then arg1:AddSubGoal(GOAL_COMMON_ApproachTarget, 10, TARGET_ENE_0, 3, TARGET_SELF, true, -1) end elseif local2 <= 85 then arg1:AddSubGoal(GOAL_COMMON_ApproachTarget, 10, TARGET_ENE_0, 15, TARGET_SELF, false, -1) else arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local5, TARGET_ENE_0, local3, arg0:GetRandam_Int(45, 60), true, true, -1) end end return end function DarkBrigade_OrbAndHammer_Boss212070Battle_Update(arg0, arg1) return GOAL_RESULT_Continue end function DarkBrigade_OrbAndHammer_Boss212070Battle_Terminate(arg0, arg1) return end function DarkBrigade_OrbAndHammer_Boss212070Battle_Interupt(arg0, arg1) if arg0:IsLadderAct(TARGET_SELF) then return false end local local0 = arg0:GetRandam_Int(1, 100) local local1 = arg0:GetRandam_Int(1, 100) local local2 = arg0:GetDist(TARGET_ENE_0) local local3 = arg0:GetHpRate(TARGET_SELF) if arg0:IsInterupt(INTERUPT_Damaged) and arg0:GetRandam_Int(1, 100) <= 40 and arg0:HasSpecialEffectId(TARGET_SELF, 5659) == false then arg1:ClearSubGoal() if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_L, 180) then if right ~= false or back ~= false then if right == false then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0) end end elseif left ~= false or back ~= false then if left == false then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0) end end return true end local local4 = arg0:GetRandam_Int(1, 100) local local5 = arg0:GetRandam_Int(1, 100) local local6 = arg0:GetDist(TARGET_ENE_0) local local7 = Shoot_2dist(arg0, arg1, 4, 20, 50, 80) if local7 == 1 then if local5 <= 50 then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 4) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 4) end elseif local7 == 2 then if local5 <= 50 then arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 4) else arg1:AddSubGoal(GOAL_COMMON_SpinStep, 5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 4) end return true end return false end return
local olua = {} package.loaded['olua'] = olua local scrpath = select(2, ...) local osn = package.cpath:find('?.dll') and 'windows' or ((io.popen('uname'):read("*l"):find('Darwin')) and 'macosx' or 'linux') if osn == 'windows' then olua.HOMEDIR = os.getenv('TMP'):gsub('\\', '/') .. '/olua' else olua.HOMEDIR = os.getenv('HOME') .. '/.olua' end -- lua search path package.path = scrpath:gsub('olua.lua', '?.lua;') .. package.path -- lua c search path local suffix = osn == 'windows' and 'dll' or 'so' local version = string.match(_VERSION, '%d.%d'):gsub('%.', '') package.cpath = string.format('%s/lib/lua%s/%s/?.%s;%s', olua.HOMEDIR, version, osn, suffix, package.cpath) -- unzip lib and header local vf = io.open(olua.HOMEDIR .. '/version') local LIB_VERSION = '3' if not vf or vf:read('*a') ~= LIB_VERSION then local dir = scrpath:gsub('olua.lua', '') local libzip = dir .. 'lib.zip' local includezip = dir .. 'include.zip' if osn == 'windows' then local unzip = dir .. 'unzip.exe' os.execute('mkdir ' .. olua.HOMEDIR:gsub('/', '\\')) os.execute(unzip .. ' -f ' .. libzip .. ' -o ' .. olua.HOMEDIR) os.execute(unzip .. ' -f ' .. includezip .. ' -o ' .. olua.HOMEDIR) else os.execute('mkdir -p ' .. olua.HOMEDIR) os.execute('unzip -o ' .. libzip .. ' -d ' .. olua.HOMEDIR) os.execute('unzip -o ' .. includezip .. ' -d ' .. olua.HOMEDIR) end io.open(olua.HOMEDIR .. '/version', 'w+'):write(LIB_VERSION):close() end local _ipairs = ipairs function ipairs(t) local mt = getmetatable(t) return (mt and mt.__ipairs or _ipairs)(t) end local _pairs = pairs function pairs(t) local mt = getmetatable(t) return (mt and mt.__pairs or _pairs)(t) end function olua.write(path, content) local f = io.open(path, 'r') if f then local flag = f:read("*a") == content f:close() if flag then print("up-to-date: " .. path) return end end print("write: " .. path) f = io.open(path, "w") assert(f, path) f:write(content) f:flush() f:close() end function olua.stringify(value, quote) if value then quote = quote or '"' return quote .. tostring(value) .. quote else return nil end end function olua.sort(arr, field) if field then table.sort(arr, function (a, b) return a[field] < b[field] end) else table.sort(arr) end return arr end function olua.newarray(sep, prefix, posfix) local mt = {} mt.__index = mt function mt:clear() for i = 1, #self do self[i] = nil end return self end function mt:push(v) self[#self + 1] = v return self end function mt:pushf(v) self[#self + 1] = olua.format(v) return self end function mt:insert(v) table.insert(self, 1, v) end function mt:insertf(v) table.insert(self, 1, olua.format(v)) end function mt:merge(t) for _, v in ipairs(t) do self[#self + 1] = v end return self end function mt:__tostring() sep = sep or '\n' prefix = prefix or '' posfix = posfix or '' return prefix .. table.concat(self, sep) .. posfix end return setmetatable({}, mt) end function olua.newhash() local t = {} local arr = {} local map = {} function t:replace(key, value) local old = map[key] map[key] = value if old then for i, v in ipairs(arr) do if v == old then arr[i] = value break end end else arr[#arr + 1] = value end end function t:take(key) local value = map[key] if value then for i, v in ipairs(arr) do if value == v then table.remove(arr, i) map[key] = nil break end end end return value end local mt = {} function mt:__len() return #arr end function mt:__index(key) if type(key) == 'number' then return arr[key] else return map[key] end end function mt:__newindex(key, value) assert(type(key) == 'string', 'only support string key') assert(not map[key], 'key conflict: ' .. key) map[key] = value arr[#arr + 1] = value end function mt:__pairs() return pairs(map) end function mt:__ipairs() return ipairs(arr) end return setmetatable(t, mt) end local function lookup(level, key) assert(key and #key > 0, key) local value for i = 1, 256 do local k, v = debug.getlocal(level, i) if k == key then value = v elseif not k then break end end if value then return value end local info1 = debug.getinfo(level, 'Sn') local info2 = debug.getinfo(level + 1, 'Sn') if info1.source == info2.source or info1.short_src == info2.short_src then return lookup(level + 1, key) end end local function eval(line) local function replace(str) -- search caller file path local level = 1 local path while true do local info = debug.getinfo(level, 'Sn') if info then if info.source == "=[C]" then level = level + 1 else path = path or info.source if path ~= info.source then break else level = level + 1 end end else break end end -- search in the functin local value local indent = string.match(line, ' *') local key = string.match(str, '[%w_]+') local opt = string.match(str, '%?+') local fix = string.match(str, '{{') local value = lookup(level + 1, key) or _G[key] for field in string.gmatch(string.match(str, "[%w_.]+"), '[^.]+') do if not value then break elseif field ~= key then value = value[field] end end if value == nil and not opt then error("value not found for '" .. str .. "'") end -- indent the value if value has multiline local prefix, posfix = '', '' if type(value) == 'table' then local mt = getmetatable(value) if mt and mt.__tostring then value = tostring(value) else error("no meta method '__tostring' for " .. str) end elseif value == nil then value = 'nil' elseif type(value) == 'string' then value = value:gsub('[\n]*$', '') if opt then value = olua.trim(value) if string.find(value, '[\n\r]') then value = '\n' .. value prefix = '[[' posfix = '\n' .. indent .. ']]' indent = indent .. ' ' elseif string.find(value, '[\'"]') then value = '[[' .. value .. ']]' else value = "'" .. value .. "'" end end else value = tostring(value) end if fix then value = string.gsub(value, '[^%w_]+', '_') end return prefix .. string.gsub(value, '\n', '\n' .. indent) .. posfix end line = string.gsub(line, '${[%w_.?]+}', replace) line = string.gsub(line, '${{[%w_.?]+}}', replace) return line end local function doeval(expr) local arr = {} local idx = 1 while idx <= #expr do local from, to = string.find(expr, '[\n\r]', idx) if not from then from = #expr + 1 to = from end arr[#arr + 1] = eval(string.sub(expr, idx, from - 1)) idx = to + 1 end return table.concat(arr, '\n') end function olua.trim(expr, indent) if type(expr) == 'string' then expr = string.gsub(expr, '[\n\r]', '\n') expr = string.gsub(expr, '^[\n]*', '') -- trim head '\n' expr = string.gsub(expr, '[ \n]*$', '') -- trim tail '\n' or ' ' local space = string.match(expr, '^[ ]*') indent = string.rep(' ', indent or 0) expr = string.gsub(expr, '^[ ]*', '') -- trim head space expr = string.gsub(expr, '\n' .. space, '\n' .. indent) expr = indent .. expr end return expr end function olua.format(expr, indent) expr = doeval(olua.trim(expr, indent)) while true do local s, n = string.gsub(expr, '\n[ ]+\n', '\n\n') expr = s if n == 0 then break end end while true do local s, n = string.gsub(expr, '\n\n\n', '\n\n') expr = s if n == 0 then break end end expr = string.gsub(expr, '{\n\n', '{\n') expr = string.gsub(expr, '\n\n}', '\n}') return expr end require "parser" require "basictype" require "gen-class" require "gen-func" require "gen-callback" require "gen-conv" return olua
me = game.Players.robert147jansen gui = Instance.new("ScreenGui") gui.Parent = me.PlayerGui gui.Name = "Kick" pos = 135 pos2 = 10 pos3 = 0 enabled = false button = Instance.new("TextButton") button.Parent = gui button.Size = UDim2.new(0, 100, 0, 30) button.Position = UDim2.new(0, 8, 0, pos) button.Text = "Kick" button.MouseButton1Click:connect(function() if enabled == false then enabled = true local a = game.Workspace:GetChildren() red = 0 green = 0.5 blue = 0 for i=1, #a do wait() pos2 = pos2 + 23 if pos2 >= 450 then pos3 = pos3 + 103 pos2 = 33 end if green <= 0.9 then green = green + 0.46 elseif green >= 0.9 then green = green - 0.46 end local bu = Instance.new("TextButton") bu.Parent = button bu.Size = UDim2.new(0, 100, 0, 20) bu.Position = UDim2.new(0, pos3, 0, pos2) bu.Text = a[i].Name bu.BackgroundTransparency = 1 bu.TextTransparency = 1 bu.BackgroundColor3 = Color3.new(red,green,blue) coroutine.resume(coroutine.create(function() for i=1, 3 do wait() bu.BackgroundTransparency = bu.BackgroundTransparency - 0.34 bu.TextTransparency = bu.BackgroundTransparency end end)) bu.MouseButton2Down:connect(function() local play = game.Workspace:findFirstChild(bu.Text) if play ~= nil then play:remove() bu:remove() end end) end elseif enabled == true then enabled = false pos2 = 10 pos3 = 0 local o = button:GetChildren() for i=1, #o do wait() o[i]:remove() end end end) --lego
---------------------------------------- -- Layout Code ------------------------- ---------------------------------------- -- -- In here, all the window elements are -- created and positioned. This code is -- pretty much standalone and should not -- include any complicated handlers or -- dependencies. It simply draws a window! -- ---------------------------------------- -- -- MainForm : main form -- StatusPanel0 : statusbar entry 0 -- StatusPanel1 : statusbar entry 1 -- ProjectTabCtrl : project tabs -- ThreadTabCtrl : thread tabs -- StackTabCtrl : stack tabs -- ScriptPanel : script area -- OutputPanel : output area -- VarPanel : variable area -- OpenDialog : open dialog -- SaveDialog : save dialog -- ConfirmDialog : confirm dialog -- AboutDialog : about dialog -- -- function CreateLayout() -- function FreeLayout() -- ---------------------------------------- ---------------------------------------- ---------------------------------------- local StatusBar local PanelB local PanelC local SplitA local PanelD local PanelE local SplitB ---------------------------------------- function CreateLayout() MainForm = Obj.Create("TForm") MainForm.Left = 320 MainForm.Top = 320 MainForm.Width = 700 MainForm.Height = 420 MainForm.Font.Name = "Arial" MainForm.Font.Size = 8 MainForm.Caption = Version MainForm.OnClose = ExitHandler local Icon = Obj.Create("TIcon") Icon.Data = LoadData("icons/openeuo.ico") MainForm.Icon = Icon Obj.Free(Icon) do -- MainForm's children: StatusPanel0 = Obj.Create("TStatusPanel") StatusPanel0.Alignment = C.taCenter StatusPanel0.Width = 60 StatusPanel1 = Obj.Create("TStatusPanel") StatusBar = Obj.Create("TStatusBar") StatusBar.Parent = MainForm StatusBar.Insert(0,StatusPanel0) StatusBar.Insert(1,StatusPanel1) ProjectTabCtrl = Obj.Create("TTabControl") ProjectTabCtrl.Align = C.alClient ProjectTabCtrl.HotTrack = true ProjectTabCtrl.Parent = MainForm ThreadTabCtrl = Obj.Create("TTabControl") ThreadTabCtrl.Align = C.alClient ThreadTabCtrl.HotTrack = true ThreadTabCtrl.TabPosition = C.tpBottom ThreadTabCtrl.Parent = ProjectTabCtrl ThreadTabCtrl.Tabs.Add('Thread 1') do -- ThreadTabControl's children: PanelB = Obj.Create("TPanel") PanelB.Height = 3 PanelB.BevelOuter = C.bvNone PanelB.Align = C.alBottom PanelB.Parent = ThreadTabCtrl PanelC = Obj.Create("TPanel") PanelC.BevelOuter = C.bvNone PanelC.Align = C.alClient PanelC.Parent = ThreadTabCtrl do -- PanelC's children: VarPanel = Obj.Create("TPanel") VarPanel.Width = 150 VarPanel.BevelOuter = C.bvNone VarPanel.Align = C.alRight VarPanel.Parent = PanelC SplitA = Obj.Create("TSplitter") SplitA.Align = C.alRight SplitA.AutoSnap = false SplitA.Parent = PanelC PanelD = Obj.Create("TPanel") PanelD.BevelOuter = C.bvNone PanelD.Align = C.alClient PanelD.Parent = PanelC do -- PanelD's children: PanelE = Obj.Create("TPanel") PanelE.Height = 95 PanelE.BevelOuter = C.bvNone PanelE.Align = C.alBottom PanelE.Parent = PanelD do -- PanelE's children: StackTabCtrl = Obj.Create("TTabControl") StackTabCtrl.Align = C.alTop StackTabCtrl.Style = C.tsButtons StackTabCtrl.Height = 21 StackTabCtrl.Parent = PanelE StackTabCtrl.TabHeight = 19 StackTabCtrl.Tabs.Add('StackLvl 1') OutputPanel = Obj.Create("TPanel") OutputPanel.Height = 72 OutputPanel.BevelOuter = C.bvNone OutputPanel.Align = C.alClient OutputPanel.Font.Name = "Courier New" OutputPanel.Font.Size = 10 OutputPanel.Parent = PanelE end SplitB = Obj.Create("TSplitter") SplitB.Align = C.alBottom SplitB.AutoSnap = false SplitB.Parent = PanelD ScriptPanel = Obj.Create("TPanel") ScriptPanel.BevelOuter = C.bvNone ScriptPanel.Align = C.alClient ScriptPanel.Font.Name = "Courier New" ScriptPanel.Font.Size = 10 ScriptPanel.Parent = PanelD end end end end local filter = "Lua Files (*.lua)|*.lua|Text Files (*.txt)|*.txt|All Files (*.*)|*.*" OpenDialog = Obj.Create("TOpenDialog") OpenDialog.DefaultExt = "lua" OpenDialog.Filter = filter OpenDialog.InitialDir = getinstalldir() OpenDialog.Options = C.ofFileMustExist SaveDialog = Obj.Create("TSaveDialog") SaveDialog.DefaultExt = "lua" SaveDialog.Filter = filter SaveDialog.InitialDir = getinstalldir() SaveDialog.Options = C.ofPathMustExist+C.ofOverwritePrompt ConfirmDialog = Obj.Create("TMessageBox") ConfirmDialog.Handle = MainForm.Handle ConfirmDialog.Title = "Confirm" ConfirmDialog.Button = C.mbYesNo ConfirmDialog.Icon = C.mbIconQuestion ConfirmDialog.Default = C.mbDefButton2 AboutDialog = Obj.Create("TMessageBox") AboutDialog.Handle = MainForm.Handle AboutDialog.Title = "About" AboutDialog.Icon = C.mbIconInformation dofile("wndpos.cfg",false) end ---------------------------------------- function FreeLayout() if MainForm.WindowState<2 then SaveData("wndpos.cfg", VarToData("MainForm.Left").. VarToData("MainForm.Top").. VarToData("MainForm.Width").. VarToData("MainForm.Height").. VarToData("OutputPanel.Height").. VarToData("VarPanel.Width")) end Obj.Free(AboutDialog) Obj.Free(ConfirmDialog) Obj.Free(SaveDialog) Obj.Free(OpenDialog) Obj.Free(StackTabCtrl) Obj.Free(OutputPanel) Obj.Free(ScriptPanel) Obj.Free(SplitB) Obj.Free(PanelE) Obj.Free(PanelD) Obj.Free(SplitA) Obj.Free(VarPanel) Obj.Free(PanelC) Obj.Free(PanelB) Obj.Free(ThreadTabCtrl) Obj.Free(ProjectTabCtrl) Obj.Free(StatusPanel1) Obj.Free(StatusPanel0) Obj.Free(StatusBar) Obj.Free(MainForm) end
-- Copyright (c) 2016 Thermo Fisher Scientific -- -- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files -- (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, -- merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished -- to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- workbench.lua -- TODO I'm keeping one big TODO list here instead of scattering throughout the code -- Drag and drop of raw files -- Tab Control Context Menu -- New Page with type selector -- Split Notebook and Flip page -- Tear out to its own Notebook -- Bind to a Notebook -- Data page -- Save Notebook and Restore Notebook -- Allow drag for averaging spectra -- Add marker to most recently clicked point -- Utilities -- Get Apex for lc utilities -- Copy Lua command history to configuration file. -- Clean up crash on close for LFW interpretter -- headerPage -- Respond to arrow keys to move scan number -- This conflicts with normal use of arrow keys -- properties -- Clear up problem with combo box value disappearing on first click -- Capture change in combobox and update grid -- Nil string should turn into empty string -- Enable start and end for chromatogram properties -- msPane -- Make distinct stick, line, and marker series -- Load LuaInterface first. Loading the module creates a global, so no -- reason to keep it local here luannet = require ("luanet") -- Load the primary assembly here to make them available -- for all other items started with "require" luanet.load_assembly ("System.Windows.Forms") -- Load necessary libraries local configure = require("configure") local menu = require("menu") local templates = require("templates") local mdiNoteBook = require("mdiNoteBook") local properties = require("properties") -- Get assemblies luanet.load_assembly("System.Drawing") -- Get constructors local Form = luanet.import_type("System.Windows.Forms.Form") local ComboBox = luanet.import_type("System.Windows.Forms.ComboBox") local Panel = luanet.import_type("System.Windows.Forms.Panel") local Button = luanet.import_type("System.Windows.Forms.Button") local OpenDialog = luanet.import_type("System.Windows.Forms.OpenFileDialog") local Screen = luanet.import_type("System.Windows.Forms.Screen") local Label = luanet.import_type("System.Windows.Forms.Label") local Font = luanet.import_type("System.Drawing.Font") -- Get enumerations local AnchorStyle = luanet.import_type("System.Windows.Forms.AnchorStyles") local DockStyle = luanet.import_type("System.Windows.Forms.DockStyle") local DropDownStyle = luanet.import_type("System.Windows.Forms.ComboBoxStyle") local DialogResult = luanet.import_type("System.Windows.Forms.DialogResult") -- Get the enumeration local MdiLayout = luanet.import_type("System.Windows.Forms.MdiLayout") local Shortcut = luanet.import_type("System.Windows.Forms.Shortcut") local FormStartPosition = luanet.import_type("System.Windows.Forms.FormStartPosition") local FormBorderStyle = luanet.import_type("System.Windows.Forms.FormBorderStyle") local ContentAlignment = luanet.import_type("System.Drawing.ContentAlignment") -- local variables local comboBox, aboutForm -- Forward declarations for local helper functions local OKCB, RunCommandCB local TileHorizontalCB, TileVerticalCB local UndoCB -- local functions local function AboutBoxSetup() local version if type(jit) == "table" then version = jit.version else version = _VERSION end aboutForm = Form() aboutForm.Text = "About Xcalibur Workbench" aboutForm.Width = 400 aboutForm.Height = 250 aboutForm.ControlBox = false aboutForm.StartPosition = FormStartPosition.CenterScreen aboutForm.FormBorderStyle = FormBorderStyle.FixedSingle -- Add main label local mainLabel = Label() mainLabel.Parent = aboutForm mainLabel.Left = 0 mainLabel.Top = 20 mainLabel.Height = 100 mainLabel.Width = aboutForm.Width mainLabel.TextAlign = ContentAlignment.MiddleCenter --mainLabel.FontHeight = 40 mainLabel.Font = Font("Arial", 20) mainLabel.Text = [[Xcalibur Workbench Copyright 2016-2018 Thermo Fisher Scientific]] -- Add version label local versionLabel = Label() versionLabel.Parent = aboutForm versionLabel.Left = 0 versionLabel.Top = 120 versionLabel.Height = 40 versionLabel.Width = aboutForm.Width versionLabel.TextAlign = ContentAlignment.MiddleCenter versionLabel.Text = "Running using " .. version -- Add OK Button local OKButton = Button() OKButton.Text = "OK" OKButton.Top = 175 OKButton.Left = 175 OKButton.Click:Add(OKCB) aboutForm.Controls:Add(OKButton) end local function AboutCB(sender, args) aboutForm:Show() end local function AddCommandBar() local panel = Panel() panel.Dock = DockStyle.Bottom panel.AutoSize = true mainForm.Controls:Add(panel) comboBox = ComboBox() comboBox.DropDownStyle = DropDownStyle.DropDown comboBox.Dock = DockStyle.Bottom panel.Controls:Add(comboBox) local button = Button() button.Text = "Execute" button.Dock = DockStyle.Left button.Click:Add(RunCommandCB) -- Don't show the button. Just use for accepting Enter keystrokes --panel.Controls:Add(button) mainForm.AcceptButton = button -- Make this the default button end local function CascadeCB(sender, args) mainForm:LayoutMdi(MdiLayout.Cascade) end local function CloseNotebookCB(sender, args) local noteBook = mainForm.ActiveMdiChild.Tag -- This is the active mdiNoteBook if noteBook then noteBook:Close() end return end -- When the parent form closes, all the Mdi Children should -- have their close events triggered, so we don't really need -- to do any cleanup here. But it doesn't appear to work that way -- so I'm going to close the pages manually local function ClosingCB(sender, args) while mainForm.ActiveMdiChild do local noteBook = mainForm.ActiveMdiChild.Tag noteBook:Close() end end local function ConsoleCB(sender, args) print ("Breaking for ZBS Console") -- See if a debug hook is set. If so, the debugger is running -- If so, pause, so the user doesn't have to set a breakpoint -- If not, start the debugger, which will force a break local debugging = debug.gethook() local mobdebug = mobdebug or require("mobdebug") -- Load the debugging library if not debugging then mobdebug.start() -- Start the debugger, this will break at the next line mobdebug.off() -- Turn it back off to avoid speed issues else mobdebug.pause() -- Just pause, this will break at the next line end print ("Restarting MessageQueue") end local function ExitCB(sender, args) mainForm:Close() end local function LoadLuaCB(sender, args) local dialog = OpenDialog() -- Create the dialog dialog.Filter = "Lua files (*.lua)|*.lua|All files (*.*)|*.*" -- Set the filter dialog.Multiselect = true -- Allow selection of more than one file -- Due to some .NET anomoly, the file dialog will not show up when running -- with LuaJIT as the interpreter. Lord Google suggested setting the ShowHelp -- property to resolve it. Unbelievable, but it works dialog.ShowHelp = true -- Workaround for dialog not being visible local result = dialog:ShowDialog() -- Show modal dialog if result == DialogResult.OK then -- Load Lua files one by one through the console for i = 1, dialog.FileNames.Length do local fileName = dialog.FileNames[i-1] -- Get the file name fileName = fileName:gsub([[\]], [[\\]]) -- replace single slash with double slash comboBox.Text = string.format("dofile('%s')", fileName) -- put the command in the console RunCommandCB() -- trigger the execution Application.DoEvents() -- Process the message queue to update the GUI end end dialog:Dispose() end local function LoadOtherFiles(directory) local lastChar = string.sub(directory, -1) -- check last character if lastChar ~= "\\" then directory = directory .. "\\" end -- Add backslash if not includes local command = directory -- set initial command command = command .. "*.lua" -- add filter to directory command = '"' .. command .. '"' -- put quotes around the directory and filter command command = "dir " .. command.. " /b" -- complete command --print ("Running command: ", command) local files = {} local popen = io.popen for fileName in popen(command):lines() do table.insert(files, fileName) end for index, fileName in ipairs(files) do print ("Loading file: ", fileName) dofile(directory .. fileName) end end -- This has a forward declaration function OKCB(sender, args) aboutForm:Hide() end local function OpenCB(sender, args) local dialog = OpenDialog() -- Create the dialog dialog.Filter = "Raw files (*.raw)|*.raw|All files (*.*)|*.*" -- Set the filter dialog.Multiselect = true -- Allow selection of more than one file -- Due to some .NET anomoly, the file dialog will not show up when running -- with LuaJIT as the interpreter. Lord Google suggested setting the ShowHelp -- property to resolve it. Unbelievable, but it works dialog.ShowHelp = true -- Workaround for dialog not being visible local result = dialog:ShowDialog() -- Show modal dialog if result == DialogResult.OK then -- Create a new notebook using the default template local args = {} for key, value in pairs(templates.default) do args[key] = value end for i = 1, dialog.FileNames.Length do args.fileName = dialog.FileNames[i-1] -- Use base-0 indexing here mdiNoteBook(args) Application.DoEvents() -- Process the message queue so files are shown end end dialog:Dispose() end local function PropertiesCB(sender, args) properties.ShowForm() end -- This has a forward declaration function RunCommandCB() local f, err = loadstring(comboBox.Text) if not f then print (err) return end local result, err = pcall(f) if not result then print (err) return end comboBox.Items:Add(comboBox.Text) print (comboBox.Text) -- Print the command print ("Result: ", err) -- This is the result of the function execution, not really an error comboBox:Focus() -- Call Focus() method. This will select all the text to simplify further editing. return end local function SetUpMenu() -- Attach the menu to the form mainForm.Menu = menu.mainMenu -- Create some menus, and add them to the main menu. menu.AddMenu({name = "File", label = "&File"}) menu.AddMenu({name = "Edit"}) menu.AddMenu({name = "Tools"}) local mdiMenu = menu.AddMenu({name = "Windows"}) mdiMenu.MdiList = true -- Set MDI flag menu.AddMenu({name = "Help", label = "&Help"}) -- Add menu items to File menu.AddMenu({name = "Open", label = "&Open...", parentName = "File", callBack = OpenCB}) menu.AddMenu({name = "Templates", parentName = "File"}) menu.AddMenu({name = "Sep1", label = "-", parentName = "File"}) menu.AddMenu({name = "Close Notebook", parentName = "File", callBack = CloseNotebookCB}) menu.AddMenu({name = "Sep2", label = "-", parentName = "File"}) menu.AddMenu({name = "Load", label = "Load Lua...", parentName = "File", callBack = LoadLuaCB}) menu.AddMenu({name = "Exit", label = "E&xit", parentName = "File", callBack = ExitCB}) -- Add menu items to Edit menu.AddMenu({name = "Undo", label = "Undo", parentName = "Edit", callBack = UndoCB, shortCut = Shortcut.CtrlZ}) menu.AddMenu({name = "Properties", label = "Properties...", parentName = "Edit", callBack = PropertiesCB}) -- Add menu items to Tools menu.AddMenu({name = "ZBS Console", parentName = "Tools", callBack = ConsoleCB}) -- Add menu items to Windows menu.AddMenu({name = "Cascade", parentName = "Windows", callBack = CascadeCB}) menu.AddMenu({name = "Tile Horizontal", parentName = "Windows", callBack = TileHorizontalCB}) menu.AddMenu({name = "Tile Vertical", parentName = "Windows", callBack = TileVerticalCB}) menu.AddMenu({name = "Sep3", label = "-", parentName = "Windows"}) -- Add menu items to Help menu.AddMenu({name = "About...", parentName = "Help", callBack = AboutCB}) end -- This has a forward declaration function TileHorizontalCB(sender, args) mainForm:LayoutMdi(MdiLayout.TileHorizontal) end -- This has a forward declaration function TileVerticalCB(sender, args) mainForm:LayoutMdi(MdiLayout.TileVertical) end -- This has a foward declaration function UndoCB(sender, args) local noteBook = mainForm.ActiveMdiChild.Tag -- This is the active mdiNoteBook if not noteBook then return end local page = noteBook.pageList.active if not page then return end page:Undo() return end -- This is a global so that slow Lua routines can call Application.DoEvents() -- This is not an instance of the class, so use "." notation for methods, not ":" Application = luanet.import_type("System.Windows.Forms.Application") mainForm = Form() mainForm.Text = "Xcalibur Workbench" mainForm.IsMdiContainer = true SetUpMenu() mainForm.Closing:Add(ClosingCB) -- Can't seem to do drag and drop in Win7 -- Something about different privaleges between -- Explorer and Lua --mainForm.AllowDrop = true --mainForm.DragDrop:Add(DragDropCB) templates.InitializeTemplates() -- Set to eat up a bunch of the screen local workingArea = Screen.FromControl(mainForm).WorkingArea mainForm.Height = workingArea.Height * 0.8 mainForm.Width = workingArea.Width * 0.8 AddCommandBar() AboutBoxSetup() -- Users can load the utilities with require() -- This will make sure they are found by the search path package.path = package.path .. ";".. configure.utilityDirectory .. "/?.lua" LoadOtherFiles(configure.userDirectory) LoadOtherFiles(configure.tartareDirectory) -- Calling mainForm:ShowDialog() does not reliably show the form. -- This appears to be related to the form being a Mdi Parent. To -- get the form started reliably, show it then start the message -- queue with Application.Run() mainForm.StartPosition = FormStartPosition.CenterScreen mainForm.Visible = true mainForm:Show() -- Load files if passed as arguments local fileNumber = 1 while arg[fileNumber] do -- Create a new notebook using the default template mdiNoteBook({fileName = arg[fileNumber], AddPages = templates.default.AddPages}) fileNumber = fileNumber + 1 end -- Start the Message Queue with a pcall, using anonymous function syntax local success, result = pcall (function() Application.Run(mainForm); return true end) print ("Success: ", success) print ("Result: ", result) -- Is this required? --mainForm:Dispose() print ("Program Complete")
-- Utility methods for CombatObjects -- -- See Also: -- Callbacks-CombatObjects.lua if nil ~= require then require "fritomod/currying"; require "fritomod/Functions"; require "fritomod/CombatEvents"; end; CombatObjects = CombatObjects or {}; do -- Mapping of conventional names (like "Source" or "Spell") to the underlying -- shared object. local sharedObjects = {}; -- Register a combat object, referred to by eventType, as a shared object. -- Shared objects are used by combat event handlers to minimize the creation -- of short-lived objects. -- -- Name should refer to the purpose of the combat object, like "Source" or -- "Target". If eventType is unspecified, then name will be used. function CombatObjects.AddSharedEvent(name, eventType) eventType = eventType or name; assert(sharedObjects[name] == nil or sharedObjects[name] == eventType, "Refusing to overwrite the shared object with name: "..name); sharedObjects[name] = eventType; end; -- Use a shared combat object by passing the specified arguments to it. The -- shared object will then be returned. -- -- It's important that client do not retain access to thse objects, since they -- will be modified as other combat events are recorded. function CombatObjects.SetSharedEvent(name, ...) local sharedObject = sharedObjects[name]; if type(sharedObject) == "string" then sharedObject = CombatObjects[sharedObject]:New(...); sharedObjects[name] = sharedObject; return sharedObject; elseif sharedObject ~= nil then sharedObject:Set(...); return sharedObject; else error("No registered object for name: "..name); end; end; end; do -- Internal registry of combat event handlers local handlers={}; -- Register the specified function as a combat event handler for -- spell-related combat events that contain the specified suffix. function CombatObjects.SpellTypesHandler(suffix, func, ...) if not func and select("#", ...) == 0 then func=Curry(CombatObjects.SetSharedEvent, suffix); suffix=suffix:upper(); elseif type(func) == "string" and select("#", ...) == 0 then func=Curry(CombatObjects.SetSharedEvent, func); else func=Curry(func, ...); end; if type(suffix)=="table" then for i=1, #suffix do CombatObjects.SpellTypesHandler(suffix[i], func); end; return; end; CombatObjects.Handler("SPELL_"..suffix, func); CombatObjects.Handler("SPELL_PERIODIC_"..suffix, func); CombatObjects.Handler("SPELL_BUILDING_"..suffix, func); end; -- Register the specified function as a combat event handler for all -- combat events that contain the specified suffix. function CombatObjects.AllTypesHandler(suffix, func, ...) func=Curry(func, ...); if type(suffix)=="table" then for i=1, #suffix do CombatObjects.AllTypesHandler(suffix[i], func); end; return; end; CombatObjects.Handler("SWING_"..suffix, func); CombatObjects.Handler("RANGE_"..suffix, func); CombatObjects.Handler("ENVIRONMENTAL"..suffix, func); CombatObjects.SpellTypesHandler(suffix, func); end; -- Registers the specified function as a handler for all combat events -- that contain the specified suffix. function CombatObjects.SimpleSuffixHandler(suffix, func, ...) if not func and select("#", ...) == 0 then func=Curry(CombatObjects.SetSharedEvent, suffix); suffix=suffix:upper(); elseif type(func) == "string" and select("#", ...) == 0 then func=Curry(CombatObjects.SetSharedEvent, func); else func=Curry(func, ...); end; if type(suffix)=="table" then for i=1, #suffix do CombatObjects.SimpleSuffixHandler(suffix[i], func); end; return; end; CombatObjects.AllTypesHandler(suffix, function(...) return CombatObjects.SetSharedEvent("SourceSpell", ...), func(select(4, ...)); end); CombatObjects.Handler("SWING_"..suffix, function(...) -- XXX This uses WoW-specific functionality, but I don't know where -- the underlying code should belong. return CombatObjects.SetSharedEvent("SourceSpell", nil, "Melee Swing", SCHOOL_MASK_PHYSICAL), func(...); end); CombatObjects.Handler("ENVIRONMENTAL_"..suffix, function(envType, ...) return CombatObjects.SetSharedEvent("SourceSpell", nil, envType, SCHOOL_MASK_PHYSICAL), func(...); end); end; -- A combat event handler that returns the passed arguments verbatim for all -- combat events that contain the specified suffix. function CombatObjects.NakedSuffixHandler(suffix) if type(suffix)=="table" then for i=1, #suffix do CombatObjects.NakedSuffixHandler(suffix[i]); end; return; end; CombatObjects.SimpleSuffixHandler(suffix, Functions.Return); end; -- A combat event handler that returns the passed arguments verbatim. function CombatObjects.NakedHandler(name) if type(name)=="table" then for i=1, #name do CombatObjects.NakedHandler(name[i]); end; return; end; handlers[name] = Functions.Return; end; -- Register the specified function as a handler for the -- specified combat event name. -- -- Handlers take the combat event arguments, as given to us from Blizzard, and -- return the converted arguments. We prefer an OOPish style, so conversion typically -- means passing arguments into objects. function CombatObjects.Handler(name, func, ...) func=Curry(func, ...); handlers[name] = func; end; function CombatObjects.AliasHandler(name, aliasedName) CombatObjects.Handler( name, assert(handlers[aliasedName], "No handler for name: "..aliasedName)); end; -- Handle the specific COMBAT_LOG_EVENT event. The handler -- used will be determined by the event name, which was -- previously registered. function CombatObjects.Handle(event, ...) local handler = handlers[event]; if handler then return handler(...); else trace("Unhandled event: %s", event); return ... end; end; end;
-- Circuit break if this plugin has already completed if vim.b.did_local_ftplugin == true then return 0 end -- Show line numbers -- These get reset by the global ftplugin vim.o.number = true vim.o.relativenumber = true -- Navigate up with C-k -- This gets overridden by the default mapping for C-k in help buffers vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", { noremap = true }) -- Signal that the plugin has completed vim.b.did_local_ftplugin = true
local app = require('app') local tap = require('util/tap') local assert = require('assert') describe("test all", function () assert.equal(app.appName(), 'user') console.log('rootPath', app.rootPath) console.log('nodePath', app.nodePath) console.log('appName', app.appName()) console.log('target', app.getSystemTarget()) end) describe("test lock", function () end) describe("test parseName", function () assert.equal(app.parseName('lnode -d /usr/local/lnode/app/user/lua/app.lua'), 'user') -- assert.equal(app.parseName('lnode /usr/local/lnode/bin/lpm user start'), 'user') -- assert.equal(app.parseName('lnode /lpm start user'), 'user') assert.equal(app.parseName('lnode -d /usr/local/lnode/v4.6.226/app/gateway/lua/app.lua start'), 'gateway') --local cmdline = 'lnode /lpm user start' --console.log('find', cmdline:find('lnode.+/lpm%s([%w]+)%sstart')) console.log(app.parseName('lnode -d /usr/local/lnode/v4.6.226/app/lci/lua/app.lua start')) console.log(app.parseName('lnode -d /usr/local/lnode/v4.6.226/app/lpm/lua/app.lua run')) end)
data:extend({ { type = "technology", name = "sulfuric-acid-processing-2", icon = "__base__/graphics/technology/sulfur-processing.png", effects = { { type = "unlock-recipe", recipe = "sulfuric-acid3", }, }, prerequisites = {"sulfuric-acid-processing-1"}, unit = { count = 1, ingredients = { {"science-pack-sulfuric-acid1", 10}, {"science-pack-sulfuric-acid2", 20}, }, time = 30 }, } })
include('shared.lua') ENT.Spawnable = false ENT.AdminSpawnable = false ENT.RenderGroup = RENDERGROUP_OPAQUE function ENT:Draw() self.Entity:DrawModel() end
ease = require("ease.ease") local M = {} M.xp = {} M.xp_data_filename = "/xp/blank_data.lua" M.xp_data = {} M.initiated = false M.verbose = false local function catch(what) return what[1] end local function try(what) status, result = pcall(what[1]) if not status then what[2](result) end return result end function M.node_exists(node) local exists = true try { function() gui.get_node(node) end, catch { function(error) exists = false end } } return exists end function M.init() M.xp_data = assert(loadstring(sys.load_resource(M.xp_data_filename)))() M.initiated = true if M.verbose == true then print("XP: Initialized") end end function M.update_xp(dt) for k,v in pairs(M.xp) do M.xp[v.id].easing_timer = M.xp[v.id].easing_timer + dt M.xp[v.id].easing = ease.out_cubic(math.min(M.xp[v.id].easing_timer, M.xp[v.id].easing_duration), M.xp[v.id].easing_duration, 0, M.xp[v.id].easing_range_total_new) + M.xp[v.id].easing_range_initial if M.xp[v.id].easing > 100 then M.xp[v.id].easing = 100 end if (M.xp[v.id].easing == M.xp[v.id].easing_range_total and M.xp[v.id].xp_current >= M.xp[v.id].xp_max) or M.xp[v.id].xp_current >= M.xp[v.id].xp_max and M.xp[v.id].easing >= 100 then M.level_up(v.id) elseif (M.xp[v.id].easing ~= M.xp[v.id].easing_range_total) then if M.xp[v.id].node_clipper ~= nil then M.scale_gui_bar_clipper_size_x(M.xp[v.id].node_clipper, M.xp[v.id].easing / 100, M.xp[v.id].node_clipper_size) end end if M.xp[v.id].node_text_xp_current ~= nil then M.xp[v.id].xp_current_visible = math.min(M.xp[v.id].xp_max, xp.update_xp_current_text(M.xp[v.id].node_text_xp_current, M.xp[v.id].xp_current_visible, M.xp[v.id].xp_current, M.xp[v.id].xp_max, 0.25, dt)) gui.set_text(M.xp[v.id].node_text_xp_current, M.xp[v.id].xp_current_visible) end if M.xp[v.id].node_text_max_xp ~= nil then gui.set_text(M.xp[v.id].node_text_max_xp, "/" .. M.get_level_max_xp(M.xp[v.id])) end if M.xp[v.id].node_current_level_text ~= nil then gui.set_text(M.xp[v.id].node_current_level_text, M.xp[v.id].level) end end end function M.update(dt) M.update_xp(dt) end function M.get_data() return M.xp end function M.load_data(data) M.xp = data end local function setup_node(node_name) if node_name ~= nil then assert(M.node_exists(node_name), "XP: node_text_xp_current must be a node that exists") return gui.get_node(node_name) else return nil end end -- If you pass in data then it will overwrite all values listed within function M.create_id(id, label, data) assert(M.xp[id] == nil, "XP: You cannot have duplicate XP IDs") assert(M.xp_data[label] ~= nil, "XP: create_id requires a valid label found in your xp data template") local xp = {} xp.id = id xp.style = M.xp_data[label].style or 1 xp.loop = M.xp_data[label].loop or false xp.loop_level = M.xp_data[label].loop_level or 100 xp.loop_reset_xp_amounts = M.xp_data[label].loop_reset_xp_amounts or false xp.loops_done = M.xp_data[label].loops_done or 0 xp.max_level = M.xp_data[label].max_level or 100 xp.limit_by_max_level = M.xp_data[label].limit_by_max_level or false xp.formulas = M.xp_data[label].formulas or {} xp.xp_amounts = M.xp_data[label].xp_amounts or {} xp.level = M.xp_data[label].level or 1 xp.xp_needed = M.xp_data[label].xp_needed or 100 xp.xp_total = M.xp_data[label].total_xp or 0 xp.xp_max = M.get_level_max_xp(xp) xp.xp_accumulative = 0 xp.xp_current = 0 xp.xp_current_visible = 0 if data ~= nil then for k,v in pairs(data) do xp[k] = v -- this should be from a table or something if k == "node_text_xp_current" or k == "node_text_max_xp" or k == "node_clipper" or k == "node_current_level_text" then xp[k] = setup_node(v) end end end xp.easing_timer = 0 xp.easing_duration = 0.75 xp.easing_range_initial = 0 xp.easing_range_total = math.min(xp.xp_current / M.get_level_max_xp(xp) * 100, 100) xp.easing_range_total_new = xp.easing_range_total - xp.easing_range_initial xp.easing = ease.out_cubic(math.min(xp.easing_timer, xp.easing_duration), xp.easing_duration, 0, xp.easing_range_total_new ) + xp.easing_range_initial xp.node_text_xp_current = xp.node_text_xp_current or setup_node(M.xp_data[label].node_text_xp_current) xp.node_text_max_xp = xp.node_text_max_xp or setup_node(M.xp_data[label].node_text_max_xp) xp.node_clipper = xp.node_clipper or setup_node(M.xp_data[label].node_clipper) xp.node_current_level_text = xp.node_current_level_text or setup_node(M.xp_data[label].node_current_level_text) if xp.node_clipper ~= nil then xp.node_clipper_size = gui.get_size(xp.node_clipper) xp.node_clipper_width = xp.node_clipper_size.x end if xp.node_clipper ~= nil then M.scale_gui_bar_clipper_size_x(xp.node_clipper, xp.easing / 100, xp.node_clipper_size) end M.xp[id] = xp return M.xp[id] end function M.get_level_max_xp(xp) if xp.style == 1 then -- look up table of pre made values if #xp.xp_amounts >= xp.level then return xp.xp_amounts[xp.level] else return xp.xp_amounts[#xp.xp_amounts] end elseif xp.style == 2 then -- xp formula function local counter = 0 for k,v in ipairs(xp.formulas) do counter = counter + 1 if xp.level <= v.level then local level = xp.level return v.formula(level) end if counter == #xp.formulas then local level = xp.level return v.formula(level) end end end end function M.delete_id(id) assert(M.xp[id] ~= nil, "XP: delete_id - Cannot find ID " .. id) if M.verbose == true then print("XP: Deleting ID " .. id) end M.xp[id] = nil end function M.level_up(id, level_up_amount) if M.verbose == true then print("XP: Level Up! For ID " .. id) end level_up_amount = level_up_amount or 1 M.xp[id].level = M.xp[id].level + level_up_amount M.xp[id].easing_timer = 0 M.xp[id].xp_current = M.xp[id].xp_current - M.xp[id].xp_max M.xp[id].easing_range_initial = 0 M.xp[id].xp_max = M.get_level_max_xp(M.xp[id]) M.xp[id].easing_range_total = math.min(M.xp[id].xp_current / M.xp[id].xp_max * 100, 100) M.xp[id].easing_range_total_new = M.xp[id].easing_range_total - M.xp[id].easing_range_initial M.xp[id].xp_current_visible = 0 -- need check for needing to do another level up here? end function M.add_xp_to_id(id, amount) assert(M.xp[id] ~= nil, "XP: add_xp_to_id - Cannot find ID " .. id) if M.xp[id].easing_range_initial ~= 100 then M.xp[id].easing_timer = 0 M.xp[id].xp_current = M.xp[id].xp_current + amount M.xp[id].xp_accumulative = M.xp[id].xp_accumulative + amount M.xp[id].easing_range_initial = M.xp[id].easing_range_total M.xp[id].easing_range_total = math.min(M.xp[id].xp_current / M.xp[id].xp_max * 100, 100) M.xp[id].easing_range_total_new = M.xp[id].easing_range_total - M.xp[id].easing_range_initial end end -- Percent is 0-1 function M.scale_gui_bar_clipper_size_x(node, percent, original_size) assert(percent <= 1 and percent >= 0, "XP: scale_gui_bar_clipper_size_x requires a percent in the range of 0-1") percent = math.max(0, percent) percent = math.min(100, percent) gui.set_size(node, vmath.vector3(original_size.x * percent, original_size.y, original_size.z)) end function M.scale_gui_bar_clipper_size_y(node, percent, original_size) M.scale_gui_bar_clipper_size_x(node, percent, original_size) end -- this makes the text of the visible current xp go up smoothly -- you need fixed width bitmap fonts for counters if you don't want them to visibly jump around as they increase function M.update_xp_current_text(node, xp_visible, xp_current, max_xp, ratio, dt) xp_visible = M.get_xp_current_text(xp_visible, xp_current, max_xp, ratio, dt) gui.set_text(node, xp_visible) return xp_visible end function M.get_xp_current_text(xp_visible, xp_current, max_xp, ratio, dt) dt = dt or 1 assert(ratio > 0 and ratio <= 1, "XP: get_xp_current_text requires a ratio > 0 and <= 1") ratio = ratio or 0.14 if math.abs(xp_visible - xp_current) <= 1 then xp_visible = xp_current else xp_visible = math.floor(xp_visible + (xp_current - xp_visible) * ratio * dt * 30) end return math.min(xp_visible, max_xp) end return M
-- Telescope local M = {} require("telescope").setup({ pickers = { find_files = { find_command = { "fd", "--type", "f", "--strip-cwd-prefix" }, }, git_files = { shorten_path = true, }, }, }) require("telescope").load_extension("fzy_native") -- Launch mappings vim.api.nvim_set_keymap( "n", "<Leader>f", "<CMD>lua require'jesse.plugin.telescope'.git_or_find_files()<CR>", { noremap = true, silent = true } ) vim.api.nvim_set_keymap( "n", "<Leader>g", "<CMD>lua require('telescope.builtin').live_grep()<cr>", { noremap = true, silent = true } ) -- Fallback to find_files if not in git repo M.git_or_find_files = function() local opts = {} local ok = pcall(require("telescope.builtin").git_files, opts) if not ok then require("telescope.builtin").find_files(opts) end end return M
local t = Def.Sprite{ Texture=ddrgame, }; return t
Locales['en'] = { -- 衣帽間 ['cloakroom'] = '更衣室', ['citizen_wear'] = '民用服裝', ['police_wear'] = '警察制服', ['sheriff_wear'] = '警長制服', ['lieutenant_wear'] = '特警制服 ', ['commandant_wear'] = '聯邦警察', ['statepd_wear'] = '州警察制服', ['specops_wear'] = '特種部隊', ['open_cloackroom'] = '按 ~INPUT_CONTEXT~ 改變', -- 軍械庫 ['get_weapon'] = '領取武器', ['put_weapon'] = '存放武器', ['buy_weapons'] = '購買武器', ['armory'] = '軍械庫', ['open_armory'] = '按 ~INPUT_CONTEXT~ 進入軍械庫', -- 車輛 ['vehicle_menu'] = '車輛', ['vehicle_out'] = '車庫裡已經有一輛車了', ['vehicle_spawner'] = '按 ~INPUT_CONTEXT~ 領取車輛', ['store_vehicle'] = '按 ~INPUT_CONTEXT~ 存放車輛', ['service_max'] = '最大的軍官在職: ', -- 動作菜單 ['citizen_interaction'] = '公民互動', ['vehicle_interaction'] = '車輛互動', ['object_spawner'] = '道路互動', ['animations'] = '動畫', ['id_card'] = '身分證', ['search'] = '搜身', ['handcuff'] = '上銬 / 解銬', ['drag'] = '押送', ['put_in_vehicle'] = '押進車輛', ['out_the_vehicle'] = '押出車輛', ['fine'] = '罰單', ['no_players_nearby'] = '附近沒有玩家', ['vehicle_info'] = '車輛資料', ['pick_lock'] = '解鎖車輛', ['vehicle_unlocked'] = '車輛 ~g~已解鎖~s~', ['no_vehicles_nearby'] = '附近沒有車輛', ['traffic_interaction'] = '互動Voirie', ['cone'] = '三角錐', ['barrier'] = '路障', ['spikestrips'] = '釘刺帶', ['box'] = '箱子', ['cash'] = '錢箱', ['police_animations'] = '警察動畫', ['dotraffic'] = '停止交通', ['take_note'] = '做筆記', ['stand_by'] = '支持', ['stand_by_2'] = '支持 2', ['stand_by_3'] = '支持 3', ['crowd_control'] = '維持人群秩序', ['doinvestigate'] = '調查', ['dobinoculars'] = '使用雙筒望遠鏡', ['taking_notes'] = '我完成了做筆記', ['dealing_with_traffic'] = '處理交通很困難', ['standing_cop'] = '我不能再在這裡了', ['standing_cop_2'] = '我不能再在這裡了', ['standing_cop_3'] = '我不能再在這裡了', ['use_binoculars'] = '我什麼都看不見', ['do_crowd_control'] = '人群被遏制', ['investigate_done'] = '我的調查完成了', ['docrouch'] = '蹲伏', ['kneel'] = '讓我起床', ['hang_out'] = '空閒時間 1', ['hanging_out'] = '讓我們去工作吧', ['doleaning'] = '空閒時間 2', ['dosmoking'] = '空閒時間 3', ['dodrinking'] = '空閒時間 4', ['domobile'] = '空閒時間 5', ['aacoffe'] = '早上喝咖啡', ['push_ups'] = '鍛煉一下', ['exercise'] = '我累了', ['cancel_emote'] = '取消動畫', ['emotecanceled'] = '動畫停了', -- 身份證菜單 ['name'] = '身份證 : ', ['bac'] = '酒精濃度 : ', -- 身體搜索菜單 ['confiscate_dirty'] = '沒收髒錢: $', ['guns_label'] = '--- 槍砲 ---', ['confiscate'] = '沒收 ', ['inventory_label'] = '--- 庫存 ---', ['confiscate_inv'] = '沒收 x', ['traffic_offense'] = '交通罪行', ['minor_offense'] = '輕微罪行', ['average_offense'] = '普通罪行', ['major_offense'] = '重大罪刑', ['fine_total'] = '罰單: ', -- 車輛資料菜單 ['plate'] = '車牌: ', ['owner_unknown'] = '所有者: 失竊車', ['owner'] = '所有者: ', -- 武器菜單 ['get_weapon_menu'] = '軍械庫 - 拿取武器', ['put_weapon_menu'] = '軍械庫 - 存放武器', ['buy_weapon_menu'] = '軍械庫 - 購買武器', ['not_enough_money'] = '你沒有足夠的錢', -- 老闆菜單 ['take_company_money'] = '提款公司資金', ['deposit_money'] = '存款公司資金', ['amount_of_withdrawal'] = '提款金額', ['invalid_amount'] = '金額無效', ['amount_of_deposit'] = '存款金額', ['open_bossmenu'] = '按 ~INPUT_CONTEXT~ 打開菜單', ['quantity_invalid'] = '數量無效', ['have_withdraw'] = '你已經領出了 x', ['added'] = '你添加了 x', ['quantity'] = '數量', ['inventory'] = '庫存', ['police_stock'] = '警察股票', -- 雜項 ['remove_object'] = '按 ~INPUT_CONTEXT~ 刪除對象', ['map_blip'] = '警察局', -- 通知 ['from'] = '~s~ 從 ~b~', ['you_have_confinv'] = '你沒收了 ~y~x', ['confinv'] = '~s~ 沒收了你 ~y~x', ['you_have_confdm'] = '你沒收了 ~y~$', ['confdm'] = '~s~ 沒收了你 ~y~$', ['you_have_confweapon'] = '你沒收了 ~y~x1 ', ['confweapon'] = '~s~ 沒收了你 ~y~x1 ', ['alert_police'] = '提醒警察', -- 授權車輛 ['police'] = '巡邏車 1', ['police2'] = '巡邏車 2', ['police3'] = '巡邏車 3', ['police4'] = '無標誌巡邏車', ['policeb'] = '摩托車', ['policet'] = '運輸車', }
-- -- tests/oven/test_lists.lua -- Test the Premake oven list handling. -- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- T.oven_lists = { } local suite = T.oven_lists local oven = premake5.oven -- -- Setup and teardown -- local sln, prj function suite.setup() sln = solution("MySolution") end -- -- API values that are not set in any configuration should be initialized -- with empty defaults (makes downstream usage easier). -- function suite.emptyDefaultsSet_forMissingApiValues() local cfg = oven.bake(sln) test.isequal(0, #cfg.defines) end -- -- Values defined at the solution level should be included in configurations -- built from the solution. -- function suite.solutionValuePresent_onSolutionConfig() defines "SOLUTION" local cfg = oven.bake(sln) test.isequal("SOLUTION", table.concat(cfg.defines)) end -- -- Values defined at the project level should be included in configurations -- built from the project. -- function suite.projectValuePreset_onProjectConfig() prj = project "MyProject" defines "PROJECT" local cfg = oven.bake(prj, sln) test.isequal("PROJECT", table.concat(cfg.defines)) end -- -- Values defined at the solution level should also be present in -- configurations built from projects within that solution. -- function suite.solutionValuePresent_onProjectConfig() defines("SOLUTION") prj = project("MyProject") local cfg = oven.bake(prj, sln) test.isequal("SOLUTION", table.concat(cfg.defines)) end -- -- When a list value is present at both the solution and project -- level, the values should be merged, with the solution values -- coming first. -- function suite.solutionAndProjectValuesMerged_onProjectConfig() defines("SOLUTION") prj = project("MyProject") defines("PROJECT") local cfg = oven.bake(prj, sln) test.isequal("SOLUTION|PROJECT", table.concat(cfg.defines, "|")) end -- -- A value specified in a block with more general terms should appear -- in more specific configurations. -- function suite.valueFromGeneralConfigPreset_onMoreSpecificConfig() defines("SOLUTION") local cfg = oven.bake(sln, nil, {"Debug"}) test.isequal("SOLUTION", table.concat(cfg.defines)) end function suite.valueFromGeneralConfigPreset_onMoreSpecificConfig() configuration("Debug") defines("DEBUG") local cfg = oven.bake(sln, nil, {"Debug","Windows"}) test.isequal("DEBUG", table.concat(cfg.defines)) end -- -- Values present in a specific configuration should only be included -- if a matching filter term is present. -- function suite.configValueNotPresent_ifNoMatchingFilterTerm() configuration("Debug") defines("DEBUG") cfg = oven.bake(sln) test.isequal(0, #cfg.defines) end function suite.configValuePresent_ifMatchingFilterTerm() configuration("Debug") kind "SharedLib" cfg = oven.bake(sln, nil, {"Debug"}) test.isequal("SharedLib", cfg.kind) end -- -- When values for a field are present in solution and project configurations, -- all should be copied, with the solution values first. -- function suite.solutionAndProjectAndConfigValuesMerged() defines("SOLUTION") configuration("Debug") defines("SLN_DEBUG") prj = project("MyProject") defines("PROJECT") configuration("Debug") defines("PRJ_DEBUG") cfg = oven.bake(prj , sln, {"Debug"}) test.isequal("SOLUTION|SLN_DEBUG|PROJECT|PRJ_DEBUG", table.concat(cfg.defines, "|")) end -- -- Duplicate values should be removed from list values. -- function suite.removesDuplicateValues() defines { "SOLUTION", "DUPLICATE" } prj = project("MyProject") defines { "PROJECT", "DUPLICATE" } cfg = oven.bake(prj, sln, {"Debug"}) test.isequal("SOLUTION|PROJECT|DUPLICATE", table.concat(cfg.defines, "|")) end
require("prototypes/planner")
------------------------------------------------------------------------------ -- lm_timed.lua: -- Lua timed map feature markers. ------------------------------------------------------------------------------ require('dlua/lm_tmsg.lua') require('dlua/lm_1way.lua') TimedMarker = util.subclass(OneWayStair) TimedMarker.CLASS = "TimedMarker" function TimedMarker:new(props) props = props or { } local tmarker = OneWayStair.new(self, props) if not props.msg then error("No messaging object provided (msg = nil)") end props.high = props.high or props.low or props.turns or 1 props.low = props.low or props.high or props.turns or 1 props.high_short = props.high_short or props.low_short or props.turns_short or props.high/10 or 1 props.low_short = props.low_short or props.high_short or props.turns_short or props.low/10 or 1 local dur = crawl.random_range(props.low, props.high, props.navg or 1) local dur_short = crawl.random_range(props.low_short, props.high_short, props.navg or 1) if fnum == dgn.feature_number('unseen') then error("Bad feature name: " .. feat) end tmarker.started = false tmarker.dur = dur * 10 tmarker.dur_short = dur_short * 10 if props.single_timed then -- Disable LOS timer by setting it as long as the primary timer. tmarker.dur_short = tmarker.dur end tmarker.msg = props.msg props.msg = nil return tmarker end function TimedMarker:activate(marker, verbose) self.super.activate(self, marker, verbose) self.msg:init(self, marker, verbose) dgn.register_listener(dgn.dgn_event_type('entered_level'), marker) dgn.register_listener(dgn.dgn_event_type('player_los'), marker, marker:pos()) dgn.register_listener(dgn.dgn_event_type('turn'), marker) end function TimedMarker:property(marker, pname) return self.super.property(self, marker, pname) end function TimedMarker:start() if not self.started then self.started = true end end function TimedMarker:start_short(marker) self:start() if self.dur_short < self.dur then self.dur = self.dur_short end end function TimedMarker:disappear(marker, affect_player, x, y) dgn.remove_listener(marker) self.super.disappear(self, marker, affect_player, x, y) end function TimedMarker:timeout(marker, verbose, affect_player) local x, y = marker:pos() local yx, yy = you.pos() if x == yx and y == yy and you.taking_stairs() then if verbose then crawl.mpr( dgn.feature_desc_at(x, y, "The") .. " vanishes " .. "just as you enter it!") return end end if verbose then if you.see_cell(marker:pos()) then crawl.mpr( util.expand_entity(self.props.entity, self.props.disappear) or dgn.feature_desc_at(x, y, "The") .. " disappears!") else crawl.mpr("The walls and floor vibrate strangely for a moment.") end end self:disappear(marker, affect_player, x, y) end function TimedMarker:event(marker, ev) if self.super.event(self, marker, ev) then return true end self.ticktype = self.ticktype or dgn.dgn_event_type('turn') if ev:type() == dgn.dgn_event_type('entered_level') then self:start() elseif ev:type() == dgn.dgn_event_type('player_los') then self:start_short(marker) elseif ev:type() == self.ticktype then self.dur = self.dur - ev:ticks() self.msg:event(self, marker, ev) if self.dur <= 0 then self:timeout(marker, true, true) return true end end end function TimedMarker:describe(marker) local feat = self.props.floor or 'floor' return feat .. "/" .. tostring(self.dur) end function TimedMarker:read(marker, th) TimedMarker.super.read(self, marker, th) self.started = file.unmarshall_boolean(th) self.dur = file.unmarshall_number(th) self.dur_short = file.unmarshall_number(th) self.msg = lmark.unmarshall_marker(th) setmetatable(self, TimedMarker) return self end function TimedMarker:write(marker, th) TimedMarker.super.write(self, marker, th) file.marshall(th, self.started) file.marshall(th, self.dur) file.marshall(th, self.dur_short) lmark.marshall_marker(th, self.msg) end function timed_marker(pars) return TimedMarker:new(pars) end
onEvent("Mouse", function(player, x, y) TFM.movePlayer(player, x, y, false) end)
local window = require 'window' local camera = require 'camera' local fonts = require 'fonts' local utils = require 'utils' local Timer = require 'vendor/timer' local anim8 = require 'vendor/anim8' local HUD = {} HUD.__index = HUD local lens = love.graphics.newImage('images/hud/lens.png') local chevron = love.graphics.newImage('images/hud/chevron.png') local energy = love.graphics.newImage('images/hud/energy.png') local savingImage = love.graphics.newImage('images/hud/saving.png') lens:setFilter('nearest', 'nearest') chevron:setFilter('nearest', 'nearest') energy:setFilter('nearest', 'nearest') savingImage:setFilter('nearest', 'nearest') function HUD.new(level) local hud = {} setmetatable(hud, HUD) local character = level.player.character hud.sheet = level.player.character:sheet() hud.character_quad = love.graphics.newQuad(0, character.offset or 5, 48, 34, hud.sheet:getWidth(), hud.sheet:getHeight()) hud.character_stencil = function( x, y ) love.graphics.circle( 'fill', x + 31, y + 31, 21 ) end hud.energy_stencil = function( x, y ) love.graphics.rectangle( 'fill', x + 50, y + 27, 59, 9 ) end hud.saving = false local h = anim8.newGrid(36, 36, savingImage:getWidth(), savingImage:getHeight()) hud.savingAnimation = anim8.newAnimation('loop', h('1-8,1'), .25) hud.savingAnimation:pause() return hud end function HUD:startSave() self.saving = true self.savingAnimation:gotoFrame(1) self.savingAnimation:resume() end function HUD:endSave() Timer.add(2, function() self.saving = false self.savingAnimation:pause() end) end function HUD:update(dt) if self.saving then self.savingAnimation:update(dt) end end function HUD:draw( player ) if not window.dressing_visible then return end self.sheet = player.character:sheet() fonts.set( 'big' ) self.x, self.y = camera.x + 10, camera.y + 10 love.graphics.setColor( 255, 255, 255, 255 ) love.graphics.draw( chevron, self.x, self.y) --love.graphics.stencil(function() self.energy_stencil(self.x, self.y) end)--doesn't pass arguments so is essentially useless love.graphics.setColor( math.min(utils.map(player.health, player.max_health, player.max_health / 2 + 1, 0, 255 ), 255 ), -- green to yellow math.min(utils.map(player.health, player.max_health / 2, 0, 255, 0), 255), -- yellow to red 0, 255 ) --HEALTH local energy_quad = love.graphics.newQuad(50 + (player.max_health - player.health) * .56, 0, 59, 60, energy:getWidth(), energy:getHeight()) love.graphics.draw(energy, energy_quad, self.x + 50, self.y) love.graphics.setColor(255, 255, 255, 255) local currentWeapon = player.inventory:currentWeapon() if currentWeapon and not player.doBasicAttack or (player.holdingAmmo and currentWeapon) then local position = {x = self.x + 22, y = self.y + 22} currentWeapon:draw(position, nil,false) else love.graphics.draw(self.sheet, self.character_quad, self.x + 7, self.y + 17) end love.graphics.draw(lens, self.x, self.y) love.graphics.setColor( 0, 0, 0, 255 ) love.graphics.print(player.money, self.x + 69, self.y + 41,0,0.5,0.5) love.graphics.print(player.character.name, self.x + 60, self.y + 15,0,0.5,0.5) if player.activeEffects then love.graphics.setColor( 0, 0, 0, 255 ) for i,effect in ipairs(player.activeEffects) do love.graphics.printf(effect, self.x + 20, self.y + 40 + (20 * i), 350, "left",0,0.5,0.5) end end love.graphics.setColor( 255, 255, 255, 255 ) if self.saving then self.savingAnimation:draw(savingImage, self.x + camera:getWidth() - 60, self.y) end fonts.revert() end return HUD
-- Shake -- Stephen Leitnick -- December 09, 2021 --[=[ @within Shake @type UpdateCallbackFn () -> (position: Vector3, rotation: Vector3, completed: boolean) ]=] type UpdateCallbackFn = () -> (Vector3, Vector3, boolean) local RunService = game:GetService("RunService") local Trove = require(script.Parent.Trove) local rng = Random.new() local renderId = 0 --[=[ @class Shake Create realistic shake effects, such as camera or object shakes. Creating a shake is very simple with this module. For every shake, simply create a shake instance by calling `Shake.new()`. From there, configure the shake however desired. Once configured, call `shake:Start()` and then bind a function to it with either `shake:OnSignal(...)` or `shake:BindToRenderStep(...)`. The shake will output its values to the connected function, and then automatically stop and clean up its connections once completed. Shake instances can be reused indefinitely. However, only one shake operation per instance can be running. If more than one is needed of the same configuration, simply call `shake:Clone()` to duplicate it. Example of a simple camera shake: ```lua local priority = Enum.RenderPriority.Last.Value local shake = Shake.new() shake.FadeInTime = 0 shake.Frequency = 0.1 shake.Amplitude = 5 shake.RotationInfluence = Vector3.new(0.1, 0.1, 0.1) shake:Start() shake:BindToRenderStep(Shake.NextRenderName(), priority, function(pos, rot, isDone) camera.CFrame *= CFrame.new(pos) * CFrame.Angles(rot.X, rot.Y, rot.Z) end) ``` Shakes will automatically stop once the shake has been completed. Shakes can also be used continuously if the `Sustain` property is set to `true`. Here are some more helpful configuration examples: ```lua local shake = Shake.new() -- The magnitude of the shake. Larger numbers means larger shakes. shake.Amplitude = 5 -- The speed of the shake. Smaller frequencies mean faster shakes. shake.Frequency = 0.1 -- Fade-in time before max amplitude shake. Set to 0 for immediate shake. shake.FadeInTime = 0 -- Fade-out time. Set to 0 for immediate cutoff. shake.FadeOutTime = 0 -- How long the shake sustains full amplitude before fading out shake.SustainTime = 1 -- Set to true to never end the shake. Call shake:StopSustain() to start the fade-out. shake.Sustain = true -- Multiplies against the shake vector to control the final amplitude of the position. -- Can be seen internally as: position = shakeVector * fadeInOut * positionInfluence shake.PositionInfluence = Vector3.new(1, 1, 1) -- Multiplies against the shake vector to control the final amplitude of the rotation. -- Can be seen internally as: position = shakeVector * fadeInOut * rotationInfluence shake.RotationInfluence = Vector3.new(0.1, 0.1, 0.1) ``` ]=] local Shake = {} Shake.__index = Shake --[=[ @within Shake @prop Amplitude number Amplitude of the overall shake. For instance, an amplitude of `3` would mean the peak magnitude for the outputted shake vectors would be about `3`. Defaults to `1`. ]=] --[=[ @within Shake @prop Frequency number Frequency of the overall shake. This changes how slow or fast the shake occurs. Defaults to `1`. ]=] --[=[ @within Shake @prop FadeInTime number How long it takes for the shake to fade in, measured in seconds. Defaults to `1`. ]=] --[=[ @within Shake @prop FadeOutTime number How long it takes for the shake to fade out, measured in seconds. Defaults to `1`. ]=] --[=[ @within Shake @prop SustainTime number How long it takes for the shake sustains itself after fading in and before fading out. To sustain a shake indefinitely, set `Sustain` to `true`, and call the `StopSustain()` method to stop the sustain and fade out the shake effect. Defaults to `0`. ]=] --[=[ @within Shake @prop Sustain boolean If `true`, the shake will sustain itself indefinitely once it fades in. If `StopSustain()` is called, the sustain will end and the shake will fade out based on the `FadeOutTime`. Defaults to `false`. ]=] --[=[ @within Shake @prop PositionInfluence Vector3 This is similar to `Amplitude` but multiplies against each axis of the resultant shake vector, and only affects the position vector. Defaults to `Vector3.one`. ]=] --[=[ @within Shake @prop RotationInfluence Vector3 This is similar to `Amplitude` but multiplies against each axis of the resultant shake vector, and only affects the rotation vector. Defaults to `Vector3.one`. ]=] --[=[ @within Shake @prop TimeFunction () -> number The function used to get the current time. This defaults to `time` during runtime, and `os.clock` otherwise. Usually this will not need to be set, but it can be optionally configured if desired. ]=] --[=[ @return Shake Construct a new Shake instance. ]=] function Shake.new() local self = setmetatable({}, Shake) self.Amplitude = 1 self.Frequency = 1 self.FadeInTime = 1 self.FadeOutTime = 1 self.SustainTime = 0 self.Sustain = false self.PositionInfluence = Vector3.one self.RotationInfluence = Vector3.one self.TimeFunction = if RunService:IsRunning() then time else os.clock self._timeOffset = rng:NextNumber(-1e9, 1e9) self._startTime = 0 self._trove = Trove.new() self._running = false return self end --[=[ Apply an inverse square intensity multiplier to the given vector based on the distance away from some source. This can be used to simulate shake intensity based on the distance the shake is occurring from some source. For instance, if the shake is caused by an explosion in the game, the shake can be calculated as such: ```lua local function Explosion(positionOfExplosion: Vector3) local cam = workspace.CurrentCamera local renderPriority = Enum.RenderPriority.Last.Value local shake = Shake.new() -- Set shake properties here local function ExplosionShake(pos: Vector3, rot: Vector3) local distance = (cam.CFrame.Position - positionOfExplosion).Magnitude pos = Shake.InverseSquare(pos, distance) rot = Shake.InverseSquare(rot, distance) cam.CFrame *= CFrame.new(pos) * CFrame.Angles(rot.X, rot.Y, rot.Z) end shake:BindToRenderStep("ExplosionShake", renderPriority, ExplosionShake) end ``` ]=] function Shake.InverseSquare(shake: Vector3, distance: number): Vector3 if distance < 1 then distance = 1 end local intensity = 1 / (distance * distance) return shake * intensity end --[=[ Returns a unique render name for every call, which can be used with the `BindToRenderStep` method optionally. ```lua shake:BindToRenderStep(Shake.NextRenderName(), ...) ``` ]=] function Shake.NextRenderName(): string renderId += 1 return ("__shake_%.4i__"):format(renderId) end --[=[ Start the shake effect. :::note This **must** be called before calling `Update`. As such, it should also be called once before or after calling `OnSignal` or `BindToRenderStep` methods. ::: ]=] function Shake:Start() self._startTime = self.TimeFunction() self._running = true self._trove:Add(function() self._running = false end) end --[=[ Stops the shake effect. If using `OnSignal` or `BindToRenderStep`, those bound functions will be disconnected/unbound. `Stop` is automatically called when the shake effect is completed _or_ when the `Destroy` method is called. ]=] function Shake:Stop() self._trove:Clean() end --[=[ Returns `true` if the shake instance is currently running, otherwise returns `false`. ]=] function Shake:IsShaking(): boolean return self._running end --[=[ Schedules a sustained shake to stop. This works by setting the `Sustain` field to `false` and letting the shake effect fade out based on the `FadeOutTime` field. ]=] function Shake:StopSustain() local now = self.TimeFunction() self.Sustain = false self.SustainTime = (now - self._startTime) - self.FadeInTime end --[=[ Calculates the current shake vector. This should be continuously called inside a loop, such as `RunService.Heartbeat`. Alternatively, `OnSignal` or `BindToRenderStep` can be used to automatically call this function. Returns a tuple of three values: 1. `position: Vector3` - Position shake offset 2. `rotation: Vector3` - Rotation shake offset 3. `completed: boolean` - Flag indicating if the shake is finished ```lua local hb hb = RunService.Heartbeat:Connect(function() local offsetPosition, offsetRotation, isDone = shake:Update() if isDone then hb:Disconnect() end -- Use `offsetPosition` and `offsetRotation` here end) ``` ]=] function Shake:Update(): (Vector3, Vector3, boolean) local done = false local now = self.TimeFunction() local dur = now - self._startTime local noiseInput = ((now + self._timeOffset) / self.Frequency) % 1000000 local multiplierFadeIn = 1 local multiplierFadeOut = 1 if dur < self.FadeInTime then multiplierFadeIn = dur / self.FadeInTime end if not self.Sustain and dur > self.FadeInTime + self.SustainTime then multiplierFadeOut = 1 - (dur - self.FadeInTime - self.SustainTime) / self.FadeOutTime if (not self.Sustain) and dur >= self.FadeInTime + self.SustainTime + self.FadeOutTime then done = true end end local offset = Vector3.new( math.noise(noiseInput, 0) / 2, math.noise(0, noiseInput) / 2, math.noise(noiseInput, noiseInput) / 2 ) * self.Amplitude * math.min(multiplierFadeIn, multiplierFadeOut) if done then self:Stop() end return self.PositionInfluence * offset, self.RotationInfluence * offset, done end --[=[ @param signal Signal | RBXScriptSignal @param callbackFn UpdateCallbackFn @return Connection | RBXScriptConnection Bind the `Update` method to a signal. For instance, this can be used to connect to `RunService.Heartbeat`. All connections are cleaned up when the shake instance is stopped or destroyed. ```lua local function SomeShake(pos: Vector3, rot: Vector3, completed: boolean) -- Shake end shake:OnSignal(RunService.Heartbeat, SomeShake) ``` ]=] function Shake:OnSignal(signal, callbackFn: UpdateCallbackFn) return self._trove:Connect(signal, function() callbackFn(self:Update()) end) end --[=[ @param name string -- Name passed to `RunService:BindToRenderStep` @param priority number -- Priority passed to `RunService:BindToRenderStep` @param callbackFn UpdateCallbackFn Bind the `Update` method to RenderStep. All bond functions are cleaned up when the shake instance is stopped or destroyed. ```lua local renderPriority = Enum.RenderPriority.Camera.Value local function SomeShake(pos: Vector3, rot: Vector3, completed: boolean) -- Shake end shake:BindToRenderStep("SomeShake", renderPriority, SomeShake) ``` ]=] function Shake:BindToRenderStep(name: string, priority: number, callbackFn: UpdateCallbackFn) self._trove:BindToRenderStep(name, priority, function() callbackFn(self:Update()) end) end --[=[ @return Shake Creates a new shake with identical properties as this one. This does _not_ clone over playing state, and thus the cloned instance will be in a stopped state. A use-case for using `Clone` would be to create a module with a list of shake presets. These presets can be cloned when desired for use. For instance, there might be presets for explosions, recoil, or earthquakes. ```lua -------------------------------------- -- Example preset module local ShakePresets = {} local explosion = Shake.new() -- Configure `explosion` shake here ShakePresets.Explosion = explosion return ShakePresets -------------------------------------- -- Use the module: local ShakePresets = require(somewhere.ShakePresets) local explosionShake = ShakePresets.Explosion:Clone() ``` ]=] function Shake:Clone() local shake = Shake.new() local cloneFields = { "Amplitude", "Frequency", "FadeInTime", "FadeOutTime", "SustainTime", "Sustain", "PositionInfluence", "RotationInfluence", "TimeFunction" } for _,field in ipairs(cloneFields) do shake[field] = self[field] end return shake end --[=[ Destroy the Shake instance. Will call `Stop()`. ]=] function Shake:Destroy() self:Stop() end return Shake
local director = require( "director" ) local ui = require("ui") local action = require("action") local timer = require("timer") local shape = require("shape") local node = require("node") local sprite = require("sprite") local sound = require("sound") local physics = require("physics") local texture = require("texture") local path = require("path") local emitter = require("emitter") scene = director.newScene() local progressBarBackground local progressBar local sceneToLoad local done function scene:createScene( event ) print("Lua: Creating scene loader") scene:setSize(1136,640) scene:setBackgroundColor(0.7,0,0.7) progressBarBackground = shape.newRectangle(500, 70, 568,320) progressBarBackground:setFillColor(0,0,0.7) progressBarBackground.setLineWidth = 0 scene:addChild(progressBarBackground) progressBar = shape.newRectangle(490, 60) progressBar:setFillColor(1,1,1) progressBarBackground:addChild(progressBar) end function scene:didMoveToView() print ("Lua: scene scene_load_page.lua moved to view") progressBar.xScale = 0 print ("Lua: loading scene " .. nextSceneName) sceneToLoad = director.loadScene(nextSceneName) done = false end function scene:willMoveFromView( ) ----------------------------------------------------------------------------- -- INSERT code here (e.g. stop timers, remove listeners, unload sounds, etc.) ----------------------------------------------------------------------------- --Runtime:removeEventListener("enterFrame", scene.starListener) print("Lua: Exiting scene loader") end -- Called when the scene physics have been simulated function scene:didSimulatePhysics() end -- Called when scenes actions have been updated function scene:didEvaluateActions() print ("scene_load_page didEvaluateActions") progress = sceneToLoad.percentLoaded / 100.0 print ("Lua: load progres: " .. progress * 100) progressBar.xScale = progress -- if not done then if progress == 1 and not done then print ("Lua: Time to load scene " .. nextSceneName) done = true director.gotoScene(nextSceneName, {transition_type = "flip", orientation = "horizontal", pauses_outgoing_scene = true, duration=1.5}) end end -- Called when the scene's size changes function scene:didChangeSize(width, height) end -- Called once every frame function scene:update(currentTime) ----------------------------------------- -- It is not recommended to use this -- -- method for animation - use physics -- -- and actions instead. -- ----------------------------------------- end -- Called when scene is deallocated function scene:destroyScene( ) ----------------------------------------------------------------------------- -- INSERT code here (e.g. remove listeners, widgets, save state, etc.) ----------------------------------------------------------------------------- end --------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- return scene
for line in io.lines(arg[1]) do local s, n = {}, {} for i in line:gmatch("[^,]+") do if i:find("^%d+$") then n[#n+1] = i else s[#s+1] = i end end if #s > 0 then io.write(s[1]) for i = 2, #s do io.write("," .. s[i]) end if #n > 0 then io.write("|") end end if #n > 0 then io.write(n[1]) for i = 2, #n do io.write("," .. n[i]) end end print() end
-- Lua 编程语言中 repeat...until 循环语句不同于 for 和 while循环, -- for 和 while 循环的条件语句在当前循环执行开始时判断,而 repeat...until 循环的条件语句在当前循环结束后判断。 -- 相当于其它语言的do while --[ 变量定义 --] a = 10 --[ 执行循环 --] repeat print("a的值为:", a) a = a + 1 until( a > 15 )
local skynet = require "skynet" local socket = require "socket" local cjson = require "cjson" local json = cjson.new() skynet.start(function ( ) skynet.fork(function ( ) local fd=socket.listen("0.0.0.0",8888) socket.start(fd,function ( id,addr ) skynet.error(addr,"sdfsdfsdfdf") skynet.fork(function ( ) socket.start(id) skynet.fork(function ( ) while true do socket.write(id,"{\"action\":\"hello\",\"session\":2}\n") skynet.sleep(300) end end) while true do socket.write(id,"{\"action\":\"hello\",\"session\":2}\n") local x = socket.readline(id) print(x) local s,dd = pcall(json.decode,x) print(s,dd) -- socket.close(id) if not x then print("socket close!") break end end end) end) end) skynet.sleep(100) for i=1,5 do skynet.newservice("client") end end)
local loot_to_add = {"artifact-ore"} function RampantAddLootToCategory(category, probability_per_tier, c_min, c_max) for name, table_entry in pairs(data.raw[category]) do v, t = string.match(name, "%-v(%d+)%-t(%d+)%-rampant") if v ~= nil and t ~= nil then if table_entry.loot == nil then table_entry.loot = {} end for _, loot in pairs(loot_to_add) do local already_has_loot = false for _, loot_entry in pairs(table_entry.loot) do if loot_entry.item == loot then already_has_loot = true end end if not already_has_loot then p = math.min(probability_per_tier * tonumber(t), 1) table.insert(table_entry.loot, { item = loot, probability = p, count_min = c_min, count_max = c_max, }) -- log("added loot " .. loot .. " (" .. p .. "," .. c_min .. "," .. c_max .. ") to " .. name) else -- log("skipping loot " .. loot .. " for " .. name) end end end end end RampantAddLootToCategory("unit", settings.startup["rampant-alienmodule-compat-probability-per-tier-unit"].value, settings.startup["rampant-alienmodule-compat-min-count-unit"].value, settings.startup["rampant-alienmodule-compat-max-count-unit"].value) RampantAddLootToCategory("turret", settings.startup["rampant-alienmodule-compat-probability-per-tier-turret"].value, settings.startup["rampant-alienmodule-compat-min-count-turret"].value, settings.startup["rampant-alienmodule-compat-max-count-turret"].value) RampantAddLootToCategory("unit-spawner", settings.startup["rampant-alienmodule-compat-probability-per-tier-spawner"].value, settings.startup["rampant-alienmodule-compat-min-count-spawner"].value, settings.startup["rampant-alienmodule-compat-max-count-spawner"].value)
local L = LibStub("AceLocale-3.0"):NewLocale("ClassicCodex", "enUS", true, nil) if not L then return end L = L or {} -- loader.lua L['[ClassicCodex]'] = true L['Missing component %s'] = true L['Failed to load database, ClassicCodex cannot be launched'] = true L['Failed to load database locales, ClassicCodex cannot be launched'] = true L['Failed to load ClassicCodex core, ClassicCodex cannot be launched'] = true L['Unable to load database patch, quest data may be inaccurate'] = true
----------------------------------------------------------------------------------------------------------------------------------------- -- VRP UTILS ----------------------------------------------------------------------------------------------------------------------------------------- local Tunnel = module("vrp", "lib/Tunnel") local Proxy = module("vrp", "lib/Proxy") vRPclient = Tunnel.getInterface("vRP") VRPIds = {} Tunnel.bindInterface("vrp_admin_ids",VRPIds) Proxy.addInterface("vrp_admin_ids",VRPIds) vRP = Proxy.getInterface("vRP") ----------------------------------------------------------------------------------------------------------------------------------------- -- WEBHOOK ----------------------------------------------------------------------------------------------------------------------------------------- local webhookids = "LINK DO WEBHOOK" function SendWebhookMessage(webhook,message) if webhook ~= nil and webhook ~= "" then PerformHttpRequest(webhook, function(err, text, headers) end, 'POST', json.encode({content = message}), { ['Content-Type'] = 'application/json' }) end end ----------------------------------------------------------------------------------------------------------------------------------------- -- USER ADMIN PERMISSION ----------------------------------------------------------------------------------------------------------------------------------------- function VRPIds.isAdmin() local source = source local user_id = vRP.getUserId(source) if user_id then return (vRP.hasPermission(user_id,"administrador.permissao")) end return false end ----------------------------------------------------------------------------------------------------------------------------------------- -- GET USER ID AND STEAMHEX ----------------------------------------------------------------------------------------------------------------------------------------- function VRPIds.getId(sourceplayer) if sourceplayer ~= nil and sourceplayer ~= 0 then local user_id = vRP.getUserId(sourceplayer) if user_id then return user_id end end end ----------------------------------------------------------------------------------------------------------------------------------------- -- REPORT LOG WEBHOOK ----------------------------------------------------------------------------------------------------------------------------------------- function VRPIds.reportLog(toggle) local source = source local user_id = vRP.getUserId(source) if user_id then SendWebhookMessage(webhookids,"```prolog\n[ID]: "..user_id.." \n[STATUS]: ".. toggle ..os.date("\n[Data]: %d/%m/%Y [Hora]: %H:%M:%S").." \r```") end end
botchecker = { cast = function(player) player:popUp("<b>Please read this carefully or your character will be jailed.\n\nYour character is being checked for AFK hunting.\n\nIf you closed the window accidentally, please wait for the next one to appear.\n\nYou will have 180 seconds to respond to the messages.\n\nIf you fail to answer the captcha within the time limit or logout, your character will automatically be jailed.") player:setDuration("botchecker", 195000) characterLog.bottingLog( player, "Botting check initiated on " .. player.name ) end, while_cast = function(player) if #player:getCaptchaKey() == 0 then player:setDuration("botchecker", 0) end if player:getDuration("botchecker") == 180000 then player:sendURL( 0, "https://tk0.retrotk.com/captcha/?name=" .. player.name .. "&key=" .. botcheck_hash[ player.ID ] ) characterLog.bottingLog( player, "First Botting check window sent to " .. player.name ) end if player:getDuration("botchecker") == 120000 then player:sendURL( 0, "https://tk0.retrotk.com/captcha/?name=" .. player.name .. "&key=" .. botcheck_hash[ player.ID ] ) characterLog.bottingLog( player, "Second Botting check window sent to " .. player.name ) end if player:getDuration("botchecker") == 60000 then player:msg( 0, "Final attempt. If you do not answer this, you will be jailed.", player.ID ) player:sendURL( 0, "https://tk0.retrotk.com/captcha/?name=" .. player.name .. "&key=" .. botcheck_hash[ player.ID ] ) characterLog.bottingLog( player, "Third/Final Botting check window sent to " .. player.name ) end end, uncast = function(player) if #player:getCaptchaKey() == 0 then player:unlock() characterLog.bottingLog( player, player.name .. " successfully answered the bot check and has been unlocked." ) else player:sendURL(0, "https://tk0.retrotk.com/captcha/fail.php") player:warp(666, 3, 4) player:unlock() characterLog.bottingLog( player, player.name .. " warped to jail for AFK Botting." ) end end }
function onMoveCamera(focus) if focus == 'boyfriend' then -- called when the camera focus on boyfriend if getPropertyFromObject('boyfriend', 'y') >= 450 then doTweenX('scaleTweenX', 'boyfriend.scale', 1.5, 1, 'elasticInOut'); doTweenY('scaleTweenY', 'boyfriend.scale', 1.5, 1, 'elasticInOut'); doTweenY('bfTweenY', 'boyfriend', getPropertyFromObject('boyfriend', 'y') - 70, 1, 'elasticInOut'); end elseif focus == 'dad' then -- called when the camera focus on dad if getPropertyFromObject('boyfriend', 'y') < 450 then doTweenX('scaleTweenX', 'boyfriend.scale', 1, 1, 'elasticInOut'); doTweenY('scaleTweenY', 'boyfriend.scale', 1, 1, 'elasticInOut'); doTweenY('bfTweenY', 'boyfriend', getPropertyFromObject('boyfriend', 'y') + 70, 1, 'elasticInOut'); end end end
local DB = require("dashboard.model.db") local stringy = require("orange.utils.stringy") local ip_list_cache = ngx.shared.waf_ip_list return function(config) local model = {} local mysql_config = config.store_mysql local db = DB:new(mysql_config) function model:get_ip_list(rule_id) local sql="SELECT * from ip_list where rule_id=? order by create_time desc" return db:query(sql, {rule_id}) end function model:add_ip(rule_id,ip) ip_list_cache:set("waf."..rule_id.."."..ip,ip) local sql="insert into ip_list (rule_id,ip) values(?,?)" return db:insert(sql, {rule_id,ip}) end function model:get_delete_list(ip_list_str) local ip_list = stringy.split(ip_list_str,",") return ip_list; end function model:get_placeholder(count) local placeholder = '' for i=1,count do placeholder = placeholder.."?" if i < count then placeholder = placeholder.."," end end return placeholder end function model:delete_ip(rule_id,ip_list) local list = self:get_delete_list(ip_list) for i,v in ipairs(list) do ip_list_cache:delete("waf."..rule_id.."."..v) end local sql="delete from ip_list where rule_id=? and ip in ("..self:get_placeholder(#list)..")" table.insert( list, 1, rule_id ) return db:delete(sql, list) end return model end
-- Automatically generated file: Weapon Skills return { [1] = {id=1,en="Combo",ja="コンボ",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [2] = {id=2,en="Shoulder Tackle",ja="タックル",element=4,icon_id=591,prefix="/weaponskill",range=2,skill=1,skillchain_a="Impaction",skillchain_b="Reverberation",skillchain_c="",targets=32}, [3] = {id=3,en="One Inch Punch",ja="短勁",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Compression",skillchain_b="",skillchain_c="",targets=32}, [4] = {id=4,en="Backhand Blow",ja="バックハンドブロー",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Detonation",skillchain_b="",skillchain_c="",targets=32}, [5] = {id=5,en="Raging Fists",ja="乱撃",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [6] = {id=6,en="Spinning Attack",ja="スピンアタック",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Liquefaction",skillchain_b="Impaction",skillchain_c="",targets=32}, [7] = {id=7,en="Howling Fist",ja="空鳴拳",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Transfixion",skillchain_b="Impaction",skillchain_c="",targets=32}, [8] = {id=8,en="Dragon Kick",ja="双竜脚",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Fragmentation",skillchain_b="",skillchain_c="",targets=32}, [9] = {id=9,en="Asuran Fists",ja="夢想阿修羅拳",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Gravitation",skillchain_b="Liquefaction",skillchain_c="",targets=32}, [10] = {id=10,en="Final Heaven",ja="ファイナルヘヴン",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Light",skillchain_b="Fusion",skillchain_c="",targets=32}, [11] = {id=11,en="Ascetic's Fury",ja="アスケーテンツォルン",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Fusion",skillchain_b="Transfixion",skillchain_c="",targets=32}, [12] = {id=12,en="Stringing Pummel",ja="連環六合圏",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Gravitation",skillchain_b="Liquefaction",skillchain_c="",targets=32}, [13] = {id=13,en="Tornado Kick",ja="闘魂旋風脚",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Induration",skillchain_b="Impaction",skillchain_c="Detonation",targets=32}, [14] = {id=14,en="Victory Smite",ja="ビクトリースマイト",element=6,icon_id=590,prefix="/weaponskill",range=2,skill=1,skillchain_a="Light",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [15] = {id=15,en="Shijin Spiral",ja="四神円舞",element=0,icon_id=592,prefix="/weaponskill",range=2,skill=1,skillchain_a="Fusion",skillchain_b="Reverberation",skillchain_c="",targets=32}, [16] = {id=16,en="Wasp Sting",ja="ワスプスティング",element=5,icon_id=593,prefix="/weaponskill",range=2,skill=2,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [17] = {id=17,en="Viper Bite",ja="バイパーバイト",element=5,icon_id=593,prefix="/weaponskill",range=2,skill=2,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [18] = {id=18,en="Shadowstitch",ja="シャドーステッチ",element=1,icon_id=594,prefix="/weaponskill",range=2,skill=2,skillchain_a="Reverberation",skillchain_b="",skillchain_c="",targets=32}, [19] = {id=19,en="Gust Slash",ja="ガストスラッシュ",element=2,icon_id=595,prefix="/weaponskill",range=10,skill=2,skillchain_a="Detonation",skillchain_b="",skillchain_c="",targets=32}, [20] = {id=20,en="Cyclone",ja="サイクロン",element=2,icon_id=595,prefix="/weaponskill",range=10,skill=2,skillchain_a="Detonation",skillchain_b="Impaction",skillchain_c="",targets=32}, [21] = {id=21,en="Energy Steal",ja="エナジースティール",element=7,icon_id=596,prefix="/weaponskill",range=2,skill=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [22] = {id=22,en="Energy Drain",ja="エナジードレイン",element=7,icon_id=596,prefix="/weaponskill",range=2,skill=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [23] = {id=23,en="Dancing Edge",ja="ダンシングエッジ",element=6,icon_id=597,prefix="/weaponskill",range=2,skill=2,skillchain_a="Scission",skillchain_b="Detonation",skillchain_c="",targets=32}, [24] = {id=24,en="Shark Bite",ja="シャークバイト",element=6,icon_id=597,prefix="/weaponskill",range=2,skill=2,skillchain_a="Fragmentation",skillchain_b="",skillchain_c="",targets=32}, [25] = {id=25,en="Evisceration",ja="エヴィサレーション",element=6,icon_id=597,prefix="/weaponskill",range=2,skill=2,skillchain_a="Gravitation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [26] = {id=26,en="Mercy Stroke",ja="マーシーストローク",element=6,icon_id=597,prefix="/weaponskill",range=2,skill=2,skillchain_a="Darkness",skillchain_b="Gravitation",skillchain_c="",targets=32}, [27] = {id=27,en="Mandalic Stab",ja="マンダリクスタッブ",element=6,icon_id=597,prefix="/weaponskill",range=2,skill=2,skillchain_a="Fusion",skillchain_b="Compression",skillchain_c="",targets=32}, [28] = {id=28,en="Mordant Rime",ja="モーダントライム",element=2,icon_id=595,prefix="/weaponskill",range=2,skill=2,skillchain_a="Fragmentation",skillchain_b="Distortion",skillchain_c="",targets=32}, [29] = {id=29,en="Pyrrhic Kleos",ja="ピリッククレオス",element=1,icon_id=594,prefix="/weaponskill",range=2,skill=2,skillchain_a="Distortion",skillchain_b="Scission",skillchain_c="",targets=32}, [30] = {id=30,en="Aeolian Edge",ja="イオリアンエッジ",element=2,icon_id=595,prefix="/weaponskill",range=2,skill=2,skillchain_a="Impaction",skillchain_b="Scission",skillchain_c="Detonation",targets=32}, [31] = {id=31,en="Rudra's Storm",ja="ルドラストーム",element=2,icon_id=595,prefix="/weaponskill",range=2,skill=2,skillchain_a="Darkness",skillchain_b="Distortion",skillchain_c="",targets=32}, [32] = {id=32,en="Fast Blade",ja="ファストブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [33] = {id=33,en="Burning Blade",ja="バーニングブレード",element=0,icon_id=599,prefix="/weaponskill",range=2,skill=3,skillchain_a="Liquefaction",skillchain_b="",skillchain_c="",targets=32}, [34] = {id=34,en="Red Lotus Blade",ja="レッドロータス",element=0,icon_id=599,prefix="/weaponskill",range=2,skill=3,skillchain_a="Liquefaction",skillchain_b="Detonation",skillchain_c="",targets=32}, [35] = {id=35,en="Flat Blade",ja="フラットブレード",element=4,icon_id=600,prefix="/weaponskill",range=2,skill=3,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [36] = {id=36,en="Shining Blade",ja="シャインブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [37] = {id=37,en="Seraph Blade",ja="セラフブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [38] = {id=38,en="Circle Blade",ja="サークルブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Reverberation",skillchain_b="Impaction",skillchain_c="",targets=32}, [39] = {id=39,en="Spirits Within",ja="スピリッツウィズイン",element=15,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [40] = {id=40,en="Vorpal Blade",ja="ボーパルブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Scission",skillchain_b="Impaction",skillchain_c="",targets=32}, [41] = {id=41,en="Swift Blade",ja="スウィフトブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Gravitation",skillchain_b="",skillchain_c="",targets=32}, [42] = {id=42,en="Savage Blade",ja="サベッジブレード",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Fragmentation",skillchain_b="Scission",skillchain_c="",targets=32}, [43] = {id=43,en="Knights of Round",ja="ナイツオブラウンド",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Light",skillchain_b="Fusion",skillchain_c="",targets=32}, [44] = {id=44,en="Death Blossom",ja="ロズレーファタール",element=4,icon_id=600,prefix="/weaponskill",range=2,skill=3,skillchain_a="Fragmentation",skillchain_b="Distortion",skillchain_c="",targets=32}, [45] = {id=45,en="Atonement",ja="ロイエ",element=15,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Fusion",skillchain_b="Reverberation",skillchain_c="",targets=32}, [46] = {id=46,en="Expiacion",ja="エクスピアシオン",element=6,icon_id=598,prefix="/weaponskill",range=2,skill=3,skillchain_a="Distortion",skillchain_b="Scission",skillchain_c="",targets=32}, [47] = {id=47,en="Sanguine Blade",ja="サンギンブレード",element=7,icon_id=601,prefix="/weaponskill",range=2,skill=3,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [48] = {id=48,en="Hard Slash",ja="ハードスラッシュ",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [49] = {id=49,en="Power Slash",ja="パワースラッシュ",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Transfixion",skillchain_b="",skillchain_c="",targets=32}, [50] = {id=50,en="Frostbite",ja="フロストバイト",element=1,icon_id=603,prefix="/weaponskill",range=2,skill=4,skillchain_a="Induration",skillchain_b="",skillchain_c="",targets=32}, [51] = {id=51,en="Freezebite",ja="フリーズバイト",element=1,icon_id=603,prefix="/weaponskill",range=2,skill=4,skillchain_a="Induration",skillchain_b="Detonation",skillchain_c="",targets=32}, [52] = {id=52,en="Shockwave",ja="ショックウェーブ",element=7,icon_id=604,prefix="/weaponskill",range=2,skill=4,skillchain_a="Reverberation",skillchain_b="",skillchain_c="",targets=32}, [53] = {id=53,en="Crescent Moon",ja="クレセントムーン",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [54] = {id=54,en="Sickle Moon",ja="シックルムーン",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Scission",skillchain_b="Impaction",skillchain_c="",targets=32}, [55] = {id=55,en="Spinning Slash",ja="スピンスラッシュ",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Fragmentation",skillchain_b="",skillchain_c="",targets=32}, [56] = {id=56,en="Ground Strike",ja="グラウンドストライク",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Fragmentation",skillchain_b="Distortion",skillchain_c="",targets=32}, [57] = {id=57,en="Scourge",ja="スカージ",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Light",skillchain_b="Fusion",skillchain_c="",targets=32}, [58] = {id=58,en="Herculean Slash",ja="ヘラクレススラッシュ",element=1,icon_id=603,prefix="/weaponskill",range=2,skill=4,skillchain_a="Induration",skillchain_b="Impaction",skillchain_c="Detonation",targets=32}, [59] = {id=59,en="Torcleaver",ja="トアクリーバー",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Light",skillchain_b="Distortion",skillchain_c="",targets=32}, [60] = {id=60,en="Resolution",ja="レゾルーション",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Fragmentation",skillchain_b="Scission",skillchain_c="",targets=32}, [61] = {id=61,en="Dimidiation",ja="デミディエーション",element=6,icon_id=602,prefix="/weaponskill",range=2,skill=4,skillchain_a="Light",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [64] = {id=64,en="Raging Axe",ja="レイジングアクス",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Detonation",skillchain_b="Impaction",skillchain_c="",targets=32}, [65] = {id=65,en="Smash Axe",ja="スマッシュ",element=4,icon_id=606,prefix="/weaponskill",range=2,skill=5,skillchain_a="Impaction",skillchain_b="Reverberation",skillchain_c="",targets=32}, [66] = {id=66,en="Gale Axe",ja="ラファールアクス",element=2,icon_id=607,prefix="/weaponskill",range=2,skill=5,skillchain_a="Detonation",skillchain_b="",skillchain_c="",targets=32}, [67] = {id=67,en="Avalanche Axe",ja="アバランチアクス",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Scission",skillchain_b="Impaction",skillchain_c="",targets=32}, [68] = {id=68,en="Spinning Axe",ja="スピニングアクス",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Liquefaction",skillchain_b="Scission",skillchain_c="Impaction",targets=32}, [69] = {id=69,en="Rampage",ja="ランページ",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [70] = {id=70,en="Calamity",ja="カラミティ",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Scission",skillchain_b="Impaction",skillchain_c="",targets=32}, [71] = {id=71,en="Mistral Axe",ja="ミストラルアクス",element=6,icon_id=605,prefix="/weaponskill",range=10,skill=5,skillchain_a="Fusion",skillchain_b="",skillchain_c="",targets=32}, [72] = {id=72,en="Decimation",ja="デシメーション",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Fusion",skillchain_b="Reverberation",skillchain_c="",targets=32}, [73] = {id=73,en="Onslaught",ja="オンスロート",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Darkness",skillchain_b="Gravitation",skillchain_c="",targets=32}, [74] = {id=74,en="Primal Rend",ja="プライマルレンド",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Gravitation",skillchain_b="Reverberation",skillchain_c="",targets=32}, [75] = {id=75,en="Bora Axe",ja="ボーラアクス",element=1,icon_id=608,prefix="/weaponskill",range=10,skill=5,skillchain_a="Scission",skillchain_b="Detonation",skillchain_c="",targets=32}, [76] = {id=76,en="Cloudsplitter",ja="クラウドスプリッタ",element=4,icon_id=606,prefix="/weaponskill",range=2,skill=5,skillchain_a="Darkness",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [77] = {id=77,en="Ruinator",ja="ルイネーター",element=6,icon_id=605,prefix="/weaponskill",range=2,skill=5,skillchain_a="Distortion",skillchain_b="Detonation",skillchain_c="",targets=32}, [80] = {id=80,en="Shield Break",ja="シールドブレイク",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [81] = {id=81,en="Iron Tempest",ja="アイアンテンペスト",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [82] = {id=82,en="Sturmwind",ja="シュトルムヴィント",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Reverberation",skillchain_b="Scission",skillchain_c="",targets=32}, [83] = {id=83,en="Armor Break",ja="アーマーブレイク",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [84] = {id=84,en="Keen Edge",ja="キーンエッジ",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Compression",skillchain_b="",skillchain_c="",targets=32}, [85] = {id=85,en="Weapon Break",ja="ウェポンブレイク",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [86] = {id=86,en="Raging Rush",ja="レイジングラッシュ",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Induration",skillchain_b="Reverberation",skillchain_c="",targets=32}, [87] = {id=87,en="Full Break",ja="フルブレイク",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Distortion",skillchain_b="",skillchain_c="",targets=32}, [88] = {id=88,en="Steel Cyclone",ja="スチールサイクロン",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Distortion",skillchain_b="Detonation",skillchain_c="",targets=32}, [89] = {id=89,en="Metatron Torment",ja="メタトロントーメント",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Light",skillchain_b="Fusion",skillchain_c="",targets=32}, [90] = {id=90,en="King's Justice",ja="キングズジャスティス",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Fragmentation",skillchain_b="Scission",skillchain_c="",targets=32}, [91] = {id=91,en="Fell Cleave",ja="フェルクリーヴ",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Scission",skillchain_b="Detonation",skillchain_c="",targets=32}, [92] = {id=92,en="Ukko's Fury",ja="ウッコフューリー",element=3,icon_id=610,prefix="/weaponskill",range=2,skill=6,skillchain_a="Light",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [93] = {id=93,en="Upheaval",ja="アップヒーバル",element=6,icon_id=609,prefix="/weaponskill",range=2,skill=6,skillchain_a="Fusion",skillchain_b="Compression",skillchain_c="",targets=32}, [96] = {id=96,en="Slice",ja="スライス",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [97] = {id=97,en="Dark Harvest",ja="ダークハーベスト",element=7,icon_id=612,prefix="/weaponskill",range=2,skill=7,skillchain_a="Reverberation",skillchain_b="",skillchain_c="",targets=32}, [98] = {id=98,en="Shadow of Death",ja="シャドーオブデス",element=7,icon_id=612,prefix="/weaponskill",range=2,skill=7,skillchain_a="Induration",skillchain_b="Reverberation",skillchain_c="",targets=32}, [99] = {id=99,en="Nightmare Scythe",ja="ナイトメアサイス",element=7,icon_id=612,prefix="/weaponskill",range=2,skill=7,skillchain_a="Compression",skillchain_b="Scission",skillchain_c="",targets=32}, [100] = {id=100,en="Spinning Scythe",ja="スピニングサイス",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Reverberation",skillchain_b="Scission",skillchain_c="",targets=32}, [101] = {id=101,en="Vorpal Scythe",ja="ボーパルサイス",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Transfixion",skillchain_b="Scission",skillchain_c="",targets=32}, [102] = {id=102,en="Guillotine",ja="ギロティン",element=2,icon_id=613,prefix="/weaponskill",range=2,skill=7,skillchain_a="Induration",skillchain_b="",skillchain_c="",targets=32}, [103] = {id=103,en="Cross Reaper",ja="クロスリーパー",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Distortion",skillchain_b="",skillchain_c="",targets=32}, [104] = {id=104,en="Spiral Hell",ja="スパイラルヘル",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Distortion",skillchain_b="Scission",skillchain_c="",targets=32}, [105] = {id=105,en="Catastrophe",ja="カタストロフィ",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Darkness",skillchain_b="Gravitation",skillchain_c="",targets=32}, [106] = {id=106,en="Insurgency",ja="インサージェンシー",element=6,icon_id=611,prefix="/weaponskill",range=2,skill=7,skillchain_a="Fusion",skillchain_b="Compression",skillchain_c="",targets=32}, [107] = {id=107,en="Infernal Scythe",ja="インファナルサイズ",element=7,icon_id=612,prefix="/weaponskill",range=2,skill=7,skillchain_a="Compression",skillchain_b="Reverberation",skillchain_c="",targets=32}, [108] = {id=108,en="Quietus",ja="クワイタス",element=7,icon_id=612,prefix="/weaponskill",range=2,skill=7,skillchain_a="Darkness",skillchain_b="Distortion",skillchain_c="",targets=32}, [109] = {id=109,en="Entropy",ja="エントロピー",element=7,icon_id=612,prefix="/weaponskill",range=2,skill=7,skillchain_a="Gravitation",skillchain_b="Reverberation",skillchain_c="",targets=32}, [112] = {id=112,en="Double Thrust",ja="ダブルスラスト",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Transfixion",skillchain_b="",skillchain_c="",targets=32}, [113] = {id=113,en="Thunder Thrust",ja="サンダースラスト",element=4,icon_id=615,prefix="/weaponskill",range=2,skill=8,skillchain_a="Transfixion",skillchain_b="Impaction",skillchain_c="",targets=32}, [114] = {id=114,en="Raiden Thrust",ja="ライデンスラスト",element=4,icon_id=615,prefix="/weaponskill",range=2,skill=8,skillchain_a="Transfixion",skillchain_b="Impaction",skillchain_c="",targets=32}, [115] = {id=115,en="Leg Sweep",ja="足払い",element=4,icon_id=615,prefix="/weaponskill",range=2,skill=8,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [116] = {id=116,en="Penta Thrust",ja="ペンタスラスト",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Compression",skillchain_b="",skillchain_c="",targets=32}, [117] = {id=117,en="Vorpal Thrust",ja="ボーパルスラスト",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [118] = {id=118,en="Skewer",ja="スキュアー",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Transfixion",skillchain_b="Impaction",skillchain_c="",targets=32}, [119] = {id=119,en="Wheeling Thrust",ja="大車輪",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Fusion",skillchain_b="",skillchain_c="",targets=32}, [120] = {id=120,en="Impulse Drive",ja="インパルスドライヴ",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Gravitation",skillchain_b="Induration",skillchain_c="",targets=32}, [121] = {id=121,en="Geirskogul",ja="ゲイルスコグル",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Light",skillchain_b="Distortion",skillchain_c="",targets=32}, [122] = {id=122,en="Drakesbane",ja="雲蒸竜変",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Fusion",skillchain_b="Transfixion",skillchain_c="",targets=32}, [123] = {id=123,en="Sonic Thrust",ja="ソニックスラスト",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Transfixion",skillchain_b="Scission",skillchain_c="",targets=32}, [124] = {id=124,en="Camlann's Torment",ja="カムラン",element=6,icon_id=614,prefix="/weaponskill",range=2,skill=8,skillchain_a="Light",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [125] = {id=125,en="Stardiver",ja="スターダイバー",element=3,icon_id=616,prefix="/weaponskill",range=2,skill=8,skillchain_a="Gravitation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [128] = {id=128,en="Blade: Rin",ja="臨",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Transfixion",skillchain_b="",skillchain_c="",targets=32}, [129] = {id=129,en="Blade: Retsu",ja="烈",element=1,icon_id=618,prefix="/weaponskill",range=2,skill=9,skillchain_a="Scission",skillchain_b="",skillchain_c="",targets=32}, [130] = {id=130,en="Blade: Teki",ja="滴",element=5,icon_id=619,prefix="/weaponskill",range=2,skill=9,skillchain_a="Reverberation",skillchain_b="",skillchain_c="",targets=32}, [131] = {id=131,en="Blade: To",ja="凍",element=1,icon_id=618,prefix="/weaponskill",range=2,skill=9,skillchain_a="Induration",skillchain_b="Detonation",skillchain_c="",targets=32}, [132] = {id=132,en="Blade: Chi",ja="地",element=3,icon_id=620,prefix="/weaponskill",range=2,skill=9,skillchain_a="Impaction",skillchain_b="Transfixion",skillchain_c="",targets=32}, [133] = {id=133,en="Blade: Ei",ja="影",element=7,icon_id=621,prefix="/weaponskill",range=2,skill=9,skillchain_a="Compression",skillchain_b="",skillchain_c="",targets=32}, [134] = {id=134,en="Blade: Jin",ja="迅",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Impaction",skillchain_b="Detonation",skillchain_c="",targets=32}, [135] = {id=135,en="Blade: Ten",ja="天",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Gravitation",skillchain_b="",skillchain_c="",targets=32}, [136] = {id=136,en="Blade: Ku",ja="空",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Gravitation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [137] = {id=137,en="Blade: Metsu",ja="生者必滅",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Darkness",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [138] = {id=138,en="Blade: Kamu",ja="カムハブリ",element=3,icon_id=620,prefix="/weaponskill",range=2,skill=9,skillchain_a="Fragmentation",skillchain_b="Compression",skillchain_c="",targets=32}, [139] = {id=139,en="Blade: Yu",ja="湧",element=5,icon_id=619,prefix="/weaponskill",range=2,skill=9,skillchain_a="Reverberation",skillchain_b="Scission",skillchain_c="",targets=32}, [140] = {id=140,en="Blade: Hi",ja="秘",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Darkness",skillchain_b="Gravitation",skillchain_c="",targets=32}, [141] = {id=141,en="Blade: Shun",ja="瞬",element=6,icon_id=617,prefix="/weaponskill",range=2,skill=9,skillchain_a="Fusion",skillchain_b="Impaction",skillchain_c="",targets=32}, [144] = {id=144,en="Tachi: Enpi",ja="壱之太刀・燕飛",element=6,icon_id=622,prefix="/weaponskill",range=2,skill=10,skillchain_a="Transfixion",skillchain_b="Scission",skillchain_c="",targets=32}, [145] = {id=145,en="Tachi: Hobaku",ja="弐之太刀・鋒縛",element=4,icon_id=623,prefix="/weaponskill",range=2,skill=10,skillchain_a="Induration",skillchain_b="",skillchain_c="",targets=32}, [146] = {id=146,en="Tachi: Goten",ja="参之太刀・轟天",element=4,icon_id=623,prefix="/weaponskill",range=2,skill=10,skillchain_a="Transfixion",skillchain_b="Impaction",skillchain_c="",targets=32}, [147] = {id=147,en="Tachi: Kagero",ja="四之太刀・陽炎",element=0,icon_id=624,prefix="/weaponskill",range=2,skill=10,skillchain_a="Liquefaction",skillchain_b="",skillchain_c="",targets=32}, [148] = {id=148,en="Tachi: Jinpu",ja="五之太刀・陣風",element=2,icon_id=625,prefix="/weaponskill",range=2,skill=10,skillchain_a="Scission",skillchain_b="Detonation",skillchain_c="",targets=32}, [149] = {id=149,en="Tachi: Koki",ja="六之太刀・光輝",element=6,icon_id=622,prefix="/weaponskill",range=2,skill=10,skillchain_a="Reverberation",skillchain_b="Impaction",skillchain_c="",targets=32}, [150] = {id=150,en="Tachi: Yukikaze",ja="七之太刀・雪風",element=7,icon_id=626,prefix="/weaponskill",range=2,skill=10,skillchain_a="Induration",skillchain_b="Detonation",skillchain_c="",targets=32}, [151] = {id=151,en="Tachi: Gekko",ja="八之太刀・月光",element=2,icon_id=625,prefix="/weaponskill",range=2,skill=10,skillchain_a="Distortion",skillchain_b="Reverberation",skillchain_c="",targets=32}, [152] = {id=152,en="Tachi: Kasha",ja="九之太刀・花車",element=1,icon_id=627,prefix="/weaponskill",range=2,skill=10,skillchain_a="Fusion",skillchain_b="Compression",skillchain_c="",targets=32}, [153] = {id=153,en="Tachi: Kaiten",ja="零之太刀・回天",element=6,icon_id=622,prefix="/weaponskill",range=2,skill=10,skillchain_a="Light",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [154] = {id=154,en="Tachi: Rana",ja="十之太刀・乱鴉",element=6,icon_id=622,prefix="/weaponskill",range=2,skill=10,skillchain_a="Gravitation",skillchain_b="Induration",skillchain_c="",targets=32}, [155] = {id=155,en="Tachi: Ageha",ja="十一之太刀・鳳蝶",element=2,icon_id=625,prefix="/weaponskill",range=2,skill=10,skillchain_a="Compression",skillchain_b="Scission",skillchain_c="",targets=32}, [156] = {id=156,en="Tachi: Fudo",ja="祖之太刀・不動",element=6,icon_id=622,prefix="/weaponskill",range=2,skill=10,skillchain_a="Light",skillchain_b="Distortion",skillchain_c="",targets=32}, [157] = {id=157,en="Tachi: Shoha",ja="十二之太刀・照破",element=6,icon_id=622,prefix="/weaponskill",range=2,skill=10,skillchain_a="Fragmentation",skillchain_b="Compression",skillchain_c="",targets=32}, [158] = {id=158,en="Tachi: Suikawari",ja="盛夏之太刀・西瓜割",element=6,icon_id=622,prefix="/weaponskill",range=2,targets=32}, [160] = {id=160,en="Shining Strike",ja="シャインストライク",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [161] = {id=161,en="Seraph Strike",ja="セラフストライク",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [162] = {id=162,en="Brainshaker",ja="ブレインシェイカー",element=4,icon_id=629,prefix="/weaponskill",range=2,skill=11,skillchain_a="Reverberation",skillchain_b="",skillchain_c="",targets=32}, [163] = {id=163,en="Starlight",ja="スターライト",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="",skillchain_b="",skillchain_c="",targets=1}, [164] = {id=164,en="Moonlight",ja="ムーンライト",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="",skillchain_b="",skillchain_c="",targets=1}, [165] = {id=165,en="Skullbreaker",ja="スカルブレイカー",element=0,icon_id=630,prefix="/weaponskill",range=2,skill=11,skillchain_a="Induration",skillchain_b="Reverberation",skillchain_c="",targets=32}, [166] = {id=166,en="True Strike",ja="トゥルーストライク",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Detonation",skillchain_b="Impaction",skillchain_c="",targets=32}, [167] = {id=167,en="Judgment",ja="ジャッジメント",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [168] = {id=168,en="Hexa Strike",ja="ヘキサストライク",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Fusion",skillchain_b="",skillchain_c="",targets=32}, [169] = {id=169,en="Black Halo",ja="ブラックヘイロー",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Fragmentation",skillchain_b="Compression",skillchain_c="",targets=32}, [170] = {id=170,en="Randgrith",ja="ランドグリース",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Light",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [171] = {id=171,en="Mystic Boon",ja="ミスティックブーン",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [172] = {id=172,en="Flash Nova",ja="フラッシュノヴァ",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Induration",skillchain_b="Reverberation",skillchain_c="",targets=32}, [173] = {id=173,en="Dagan",ja="ダガン",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="",skillchain_b="",skillchain_c="",targets=1}, [174] = {id=174,en="Realmrazer",ja="レルムレイザー",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Fusion",skillchain_b="Impaction",skillchain_c="",targets=32}, [175] = {id=175,en="Exudation",ja="エクズデーション",element=6,icon_id=628,prefix="/weaponskill",range=2,skill=11,skillchain_a="Darkness",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [176] = {id=176,en="Heavy Swing",ja="ヘヴィスイング",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [177] = {id=177,en="Rock Crusher",ja="ロッククラッシャー",element=3,icon_id=632,prefix="/weaponskill",range=2,skill=12,skillchain_a="Impaction",skillchain_b="",skillchain_c="",targets=32}, [178] = {id=178,en="Earth Crusher",ja="アースクラッシャー",element=3,icon_id=632,prefix="/weaponskill",range=2,skill=12,skillchain_a="Detonation",skillchain_b="Impaction",skillchain_c="",targets=32}, [179] = {id=179,en="Starburst",ja="スターバースト",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Compression",skillchain_b="Reverberation",skillchain_c="",targets=32}, [180] = {id=180,en="Sunburst",ja="サンバースト",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Compression",skillchain_b="Reverberation",skillchain_c="",targets=32}, [181] = {id=181,en="Shell Crusher",ja="シェルクラッシャー",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Detonation",skillchain_b="",skillchain_c="",targets=32}, [182] = {id=182,en="Full Swing",ja="フルスイング",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Liquefaction",skillchain_b="Impaction",skillchain_c="",targets=32}, [183] = {id=183,en="Spirit Taker",ja="スピリットテーカー",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [184] = {id=184,en="Retribution",ja="レトリビューション",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Gravitation",skillchain_b="Reverberation",skillchain_c="",targets=32}, [185] = {id=185,en="Gate of Tartarus",ja="タルタロスゲート",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Darkness",skillchain_b="Distortion",skillchain_c="",targets=32}, [186] = {id=186,en="Vidohunir",ja="ヴィゾフニル",element=7,icon_id=633,prefix="/weaponskill",range=2,skill=12,skillchain_a="Fragmentation",skillchain_b="Distortion",skillchain_c="",targets=32}, [187] = {id=187,en="Garland of Bliss",ja="ガーランドオブブリス",element=6,icon_id=631,prefix="/weaponskill",range=2,skill=12,skillchain_a="Fusion",skillchain_b="Reverberation",skillchain_c="",targets=32}, [188] = {id=188,en="Omniscience",ja="オムニシエンス",element=7,icon_id=633,prefix="/weaponskill",range=2,skill=12,skillchain_a="Gravitation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [189] = {id=189,en="Cataclysm",ja="カタクリスム",element=7,icon_id=633,prefix="/weaponskill",range=2,skill=12,skillchain_a="Compression",skillchain_b="Reverberation",skillchain_c="",targets=32}, [190] = {id=190,en="Myrkr",ja="ミルキル",element=7,icon_id=633,prefix="/weaponskill",range=2,skill=12,skillchain_a="",skillchain_b="",skillchain_c="",targets=1}, [191] = {id=191,en="Shattersoul",ja="シャッターソウル",element=4,icon_id=634,prefix="/weaponskill",range=2,skill=12,skillchain_a="Gravitation",skillchain_b="Induration",skillchain_c="",targets=32}, [192] = {id=192,en="Flaming Arrow",ja="フレイミングアロー",element=0,icon_id=635,prefix="/weaponskill",range=12,skill=25,skillchain_a="Liquefaction",skillchain_b="Transfixion",skillchain_c="",targets=32}, [193] = {id=193,en="Piercing Arrow",ja="ピアシングアロー",element=2,icon_id=636,prefix="/weaponskill",range=12,skill=25,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [194] = {id=194,en="Dulling Arrow",ja="ダリングアロー",element=0,icon_id=635,prefix="/weaponskill",range=12,skill=25,skillchain_a="Liquefaction",skillchain_b="Transfixion",skillchain_c="",targets=32}, [196] = {id=196,en="Sidewinder",ja="サイドワインダー",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="Detonation",targets=32}, [197] = {id=197,en="Blast Arrow",ja="ブラストアロー",element=6,icon_id=637,prefix="/weaponskill",range=4,skill=25,skillchain_a="Induration",skillchain_b="Transfixion",skillchain_c="",targets=32}, [198] = {id=198,en="Arching Arrow",ja="アーチングアロー",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Fusion",skillchain_b="",skillchain_c="",targets=32}, [199] = {id=199,en="Empyreal Arrow",ja="エンピリアルアロー",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Fusion",skillchain_b="Transfixion",skillchain_c="",targets=32}, [200] = {id=200,en="Namas Arrow",ja="南無八幡",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Light",skillchain_b="Distortion",skillchain_c="",targets=32}, [201] = {id=201,en="Refulgent Arrow",ja="リフルジェントアロー",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [202] = {id=202,en="Jishnu's Radiance",ja="ジシュヌの光輝",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Light",skillchain_b="Fusion",skillchain_c="",targets=32}, [203] = {id=203,en="Apex Arrow",ja="エイペクスアロー",element=6,icon_id=637,prefix="/weaponskill",range=12,skill=25,skillchain_a="Fragmentation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [208] = {id=208,en="Hot Shot",ja="ホットショット",element=0,icon_id=638,prefix="/weaponskill",range=12,skill=26,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [209] = {id=209,en="Split Shot",ja="スプリットショット",element=2,icon_id=639,prefix="/weaponskill",range=12,skill=26,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [210] = {id=210,en="Sniper Shot",ja="スナイパーショット",element=0,icon_id=638,prefix="/weaponskill",range=12,skill=26,skillchain_a="Liquefaction",skillchain_b="Transfixion",skillchain_c="",targets=32}, [212] = {id=212,en="Slug Shot",ja="スラッグショット",element=6,icon_id=640,prefix="/weaponskill",range=12,skill=26,skillchain_a="Reverberation",skillchain_b="Transfixion",skillchain_c="Detonation",targets=32}, [213] = {id=213,en="Blast Shot",ja="ブラストショット",element=6,icon_id=640,prefix="/weaponskill",range=4,skill=26,skillchain_a="Induration",skillchain_b="Transfixion",skillchain_c="",targets=32}, [214] = {id=214,en="Heavy Shot",ja="ヘヴィショット",element=6,icon_id=640,prefix="/weaponskill",range=12,skill=26,skillchain_a="Fusion",skillchain_b="",skillchain_c="",targets=32}, [215] = {id=215,en="Detonator",ja="デトネーター",element=6,icon_id=640,prefix="/weaponskill",range=12,skill=26,skillchain_a="Fusion",skillchain_b="Transfixion",skillchain_c="",targets=32}, [216] = {id=216,en="Coronach",ja="カラナック",element=6,icon_id=640,prefix="/weaponskill",range=12,skill=26,skillchain_a="Darkness",skillchain_b="Fragmentation",skillchain_c="",targets=32}, [217] = {id=217,en="Trueflight",ja="トゥルーフライト",element=6,icon_id=640,prefix="/weaponskill",range=12,skill=26,skillchain_a="Fragmentation",skillchain_b="Scission",skillchain_c="",targets=32}, [218] = {id=218,en="Leaden Salute",ja="レデンサリュート",element=7,icon_id=641,prefix="/weaponskill",range=12,skill=26,skillchain_a="Gravitation",skillchain_b="Transfixion",skillchain_c="",targets=32}, [219] = {id=219,en="Numbing Shot",ja="ナビングショット",element=1,icon_id=642,prefix="/weaponskill",range=4,skill=26,skillchain_a="Induration",skillchain_b="Impaction",skillchain_c="Detonation",targets=32}, [220] = {id=220,en="Wildfire",ja="ワイルドファイア",element=0,icon_id=638,prefix="/weaponskill",range=12,skill=26,skillchain_a="Darkness",skillchain_b="Gravitation",skillchain_c="",targets=32}, [221] = {id=221,en="Last Stand",ja="ラストスタンド",element=6,icon_id=640,prefix="/weaponskill",range=12,skill=26,skillchain_a="Fusion",skillchain_b="Reverberation",skillchain_c="",targets=32}, [224] = {id=224,en="Exenterator",ja="エクゼンテレター",element=3,icon_id=643,prefix="/weaponskill",range=2,skill=2,skillchain_a="Fragmentation",skillchain_b="Scission",skillchain_c="",targets=32}, [225] = {id=225,en="Chant du Cygne",ja="シャンデュシニュ",element=6,icon_id=644,prefix="/weaponskill",range=2,skill=3,skillchain_a="Light",skillchain_b="Distortion",skillchain_c="",targets=32}, [226] = {id=226,en="Requiescat",ja="レクイエスカット",element=6,icon_id=644,prefix="/weaponskill",range=2,skill=3,skillchain_a="Gravitation",skillchain_b="Scission",skillchain_c="",targets=32}, [227] = {id=227,en="Knights of Rotund",ja="ナイスオブラウンド",element=6,icon_id=598,prefix="/weaponskill",range=2,targets=32}, [228] = {id=228,en="Final Paradise",ja="ファイナルパラダイス",element=6,icon_id=590,prefix="/weaponskill",range=2,targets=32}, [229] = {id=229,en="Fast Blade II",ja="ファストブレードII",element=6,icon_id=598,prefix="/weaponskill",range=2,targets=32}, [230] = {id=230,en="Dragon Blow",ja="ドラゴンブロウ",element=6,icon_id=590,prefix="/weaponskill",range=2,targets=32}, [238] = {id=238,en="Uriel Blade",ja="ウリエルブレード",element=6,icon_id=645,prefix="/weaponskill",range=2,skill=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [239] = {id=239,en="Glory Slash",ja="グローリースラッシュ",element=4,icon_id=646,prefix="/weaponskill",range=2,skill=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [240] = {id=240,en="Tartarus Torpor",ja="タルタロストーパー",element=7,icon_id=647,prefix="/weaponskill",range=2,skill=12,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [241] = {id=241,en="Netherspikes",ja="剣山獄",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [242] = {id=242,en="Carnal Nightmare",ja="白昼夢",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [243] = {id=243,en="Aegis Schism",ja="破鎧陣",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [244] = {id=244,en="Dancing Chains",ja="舞空鎖",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [245] = {id=245,en="Barbed Crescent",ja="偃月刃",element=6,icon_id=46,prefix="/weaponskill",range=11,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [246] = {id=246,en="Shackled Fists",ja="連環拳",element=6,icon_id=46,prefix="/weaponskill",range=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [247] = {id=247,en="Foxfire",ja="跳狐斬",element=6,icon_id=46,prefix="/weaponskill",range=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [248] = {id=248,en="Grim Halo",ja="輪天殺",element=6,icon_id=46,prefix="/weaponskill",range=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [249] = {id=249,en="Netherspikes",ja="剣山獄",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [250] = {id=250,en="Carnal Nightmare",ja="白昼夢",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [251] = {id=251,en="Aegis Schism",ja="破鎧陣",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [252] = {id=252,en="Dancing Chains",ja="舞空鎖",element=6,icon_id=46,prefix="/weaponskill",range=7,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [253] = {id=253,en="Barbed Crescent",ja="偃月刃",element=6,icon_id=46,prefix="/weaponskill",range=11,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [254] = {id=254,en="Vulcan Shot",ja="バルカンショット",element=6,icon_id=46,prefix="/weaponskill",range=12,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, [255] = {id=255,en="Dimensional Death",ja="次元殺",element=6,icon_id=46,prefix="/weaponskill",range=2,skillchain_a="",skillchain_b="",skillchain_c="",targets=32}, }, {"id", "en", "ja", "element", "icon_id", "prefix", "range", "skill", "skillchain_a", "skillchain_b", "skillchain_c", "targets"} --[[ Copyright © 2013-2022, Windower All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Windower nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Windower BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ]]
for line in io.lines(arg[1]) do local a, r = {}, {} for i in line:gmatch("-?%d+") do a[#a + 1] = tonumber(i) end local n = select(2, line:gsub("|", "|")) + 1 local m = #a/n for i = 1, m do r[i] = a[i] end for i = 2, n do for j = 1, m do if a[(i-1)*m + j] > r[j] then r[j] = a[(i-1)*m + j] end end end print(table.concat(r, " ")) end
----------------------------------- -- Area: Pashhow Marshlands [S] -- NM: Kinepikwa ----------------------------------- require("scripts/globals/hunts") mixins = {require("scripts/mixins/job_special")} ----------------------------------- function onMobDeath(mob, player, isKiller) tpz.hunts.checkHunt(mob, player, 507) end
------------------------------------------------------------------------------- -- Importing modules ------------------------------------------------------------------------------- local Endpoint = require "elasticsearch.endpoints.Endpoint" ------------------------------------------------------------------------------- -- Declaring module ------------------------------------------------------------------------------- local TemplateEndpoint = Endpoint:new() ------------------------------------------------------------------------------- -- Declaring instance variables ------------------------------------------------------------------------------- TemplateEndpoint.id = nil TemplateEndpoint.body = nil ------------------------------------------------------------------------------- -- Function used to set the params to be sent as GET parameters -- -- @param params The params provided by the user -- -- @return string A string if an error is found otherwise nil ------------------------------------------------------------------------------- function TemplateEndpoint:setParams(params) -- Clearing parameters self.id = nil self.params = {} self.body = nil for i, v in pairs(params) do if i == "id" then self.id = v elseif i == "body" then self:setBody(v) else local err = self:setAllowedParam(i, v) if err ~= nil then return err end end end end ------------------------------------------------------------------------------- -- Returns an instance of TemplateEndpoint class ------------------------------------------------------------------------------- function TemplateEndpoint:new(o) o = o or {} setmetatable(o, self) self.__index = self return o end return TemplateEndpoint