repo_name
stringlengths
6
78
path
stringlengths
4
206
copies
stringclasses
281 values
size
stringlengths
4
7
content
stringlengths
625
1.05M
license
stringclasses
15 values
TheAnswer/FirstTest
bin/scripts/object/static/space/ship/objects.lua
1
5080
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_static_space_ship_shared_cargo_freighter = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/cargo_freighter.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 536870915, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 1 } ObjectTemplates:addTemplate(object_static_space_ship_shared_cargo_freighter, 141305204) object_static_space_ship_shared_corellian_corvette = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/corellian_corvette.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 536870915, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 1 } ObjectTemplates:addTemplate(object_static_space_ship_shared_corellian_corvette, 785804943) object_static_space_ship_shared_nebulon_frigate = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/nebulon_frigate.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 536870915, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 1 } ObjectTemplates:addTemplate(object_static_space_ship_shared_nebulon_frigate, 4161425774)
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/corellia/npcs/lordNyax/lordNyaxServant.lua
1
4683
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. lordNyaxServant = Creature:new { objectName = "lordNyaxServant", -- Lua Object Name creatureType = "NPC", faction = "followers_of_lord_nyax", factionPoints = 20, gender = "", speciesName = "lord_nyax_servant", stfName = "mob/creature_names", objectCRC = 2873284654, socialGroup = "followers_of_lord_nyax", level = 8, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 495, healthMin = 405, strength = 500, constitution = 500, actionMax = 495, actionMin = 405, quickness = 500, stamina = 500, mindMax = 495, mindMin = 405, focus = 500, willpower = 500, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 300, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 1, ferocity = 0, aggressive = 1, invincible = 0, meleeDefense = 1, rangedDefense = 1, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/ranged/carbine/shared_carbine_laser.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "a Laser Carbine", -- Name ex. 'a Vibrolance' weaponTemp = "carbine_laser", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "CarbineRangedWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 1, weaponMinDamage = 70, weaponMaxDamage = 75, weaponAttackSpeed = 2, weaponDamageType = "ENERGY", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateweaponAttackSpeed = 2, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateweaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0,11,15,19,33,39,40", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "nyaxAttack1", "nyaxAttack2" }, respawnTimer = 300, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(lordNyaxServant, 2873284654) -- Add to Global Table
lgpl-3.0
wincent/wincent
aspects/nvim/files/.config/nvim/lua/wincent/autocmds.lua
1
9470
local leader = wincent.mappings.leader local autocmds = {} local ownsyntax_flag = 'wincent_ownsyntax' local number_flag = leader.number_flag -- stylua: ignore local focused_colorcolumn = '+' .. table.concat({ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100', '101', '102', '103', '104', '105', '106', '107', '108', '109', '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '120', '121', '122', '123', '124', '125', '126', '127', '128', '129', '130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '150', '151', '152', '153', '154', '155', '156', '157', '158', '159', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169', '170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '180', '181', '182', '183', '184', '185', '186', '187', '188', '189', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '200', '201', '202', '203', '204', '205', '206', '207', '208', '209', '210', '211', '212', '213', '214', '215', '216', '217', '218', '219', '220', '221', '222', '223', '224', '225', '226', '227', '228', '229', '230', '231', '232', '233', '234', '235', '236', '237', '238', '239', '240', '241', '242', '243', '244', '245', '246', '247', '248', '249', '250', '251', '252', '253', '254' }, ',+') local winhighlight_blurred = table.concat({ 'CursorLineNr:LineNr', 'EndOfBuffer:ColorColumn', 'IncSearch:ColorColumn', 'Normal:ColorColumn', 'NormalNC:ColorColumn', 'Search:ColorColumn', 'SignColumn:ColorColumn', }, ',') -- As described in a7e4d8b8383a375d124, `ownsyntax` resets spelling -- settings, so we capture and restore them. Note that there is some trickiness -- here because multiple autocmds can trigger "focus" or "blur" operations; this -- means that we can't just naively save and restore: we have to use a flag to -- make sure that we only capture the initial state. local ownsyntax = function(active) local flag = vim.w[ownsyntax_flag] if active and flag == false then -- We are focussing; restore previous settings. vim.cmd('ownsyntax on') vim.wo.spell = vim.w.saved_spell or false vim.bo.spellcapcheck = vim.w.saved_spellcapcheck or '' vim.bo.spellfile = vim.w.saved_spellfile or '' vim.bo.spelllang = vim.w.saved_spelllang or 'en' -- Set flag to show that we have restored the captured options. vim.w[ownsyntax_flag] = true elseif not active and vim.bo.filetype ~= '' and flag ~= false then -- We are blurring; save settings for later restoration. vim.w.saved_spell = vim.wo.spell vim.w.saved_spellcapcheck = vim.bo.spellcapcheck vim.w.saved_spellfile = vim.bo.spellfile vim.w.saved_spelllang = vim.bo.spelllang vim.cmd('ownsyntax off') -- Suppress spelling in blurred buffer. vim.wo.spell = false -- Set flag to show that we have captured options. vim.w[ownsyntax_flag] = false end end local should_mkview = function() return vim.bo.buftype == '' and autocmds.mkview_filetype_blacklist[vim.bo.filetype] == nil and vim.fn.exists('$SUDO_USER') == 0 -- Don't create root-owned files. end local focus_window = function() local filetype = vim.bo.filetype -- Turn on relative numbers, unless user has explicitly changed numbering. if filetype ~= '' and autocmds.number_blacklist[filetype] ~= true and vim.w[number_flag] == nil then vim.wo.number = true vim.wo.relativenumber = true end if filetype == '' or autocmds.winhighlight_filetype_blacklist[filetype] ~= true then vim.wo.winhighlight = '' end if filetype == '' or autocmds.colorcolumn_filetype_blacklist[filetype] ~= true then vim.wo.colorcolumn = focused_colorcolumn end if filetype == '' or autocmds.ownsyntax_filetypes[filetype] ~= true then ownsyntax(true) end if filetype == '' then vim.wo.list = true else local list = autocmds.list_filetypes[filetype] vim.wo.list = list == nil and true or list end local conceallevel = autocmds.conceallevel_filetypes[filetype] or 2 vim.wo.conceallevel = conceallevel wincent.statusline.focus_statusline() end local blur_window = function() local filetype = vim.bo.filetype -- Turn off relative numbers (and turn on non-relative numbers), unless user -- has explicitly changed the numbering. if filetype ~= '' and autocmds.number_blacklist[filetype] ~= true and vim.w[number_flag] == nil then vim.wo.number = true vim.wo.relativenumber = false end if filetype == '' or autocmds.winhighlight_filetype_blacklist[filetype] ~= true then vim.wo.winhighlight = winhighlight_blurred end if filetype == '' or autocmds.ownsyntax_filetypes[filetype] ~= true then ownsyntax(false) end if filetype == '' then vim.wo.list = false else local list = autocmds.list_filetypes[filetype] if list == nil then vim.wo.list = false else vim.wo.list = list end end if filetype == '' or autocmds.conceallevel_filetypes[filetype] == nil then vim.wo.conceallevel = 0 end wincent.statusline.blur_statusline() end -- http://vim.wikia.com/wiki/Make_views_automatic local mkview = function() if should_mkview() then local success, err = pcall(function() if vim.fn.haslocaldir() == 1 then -- We never want to save an :lcd command, so hack around it... vim.cmd('cd -') vim.cmd('mkview') vim.cmd('lcd -') else vim.cmd('mkview') end end) if not success then if err:find('%f[%w]E32%f[%W]') == nil -- No file name; could be no buffer (eg. :checkhealth) and err:find('%f[%w]E186%f[%W]') == nil -- No previous directory: probably a `git` operation. and err:find('%f[%w]E190%f[%W]') == nil -- Could be name or path length exceeding NAME_MAX or PATH_MAX. and err:find('%f[%w]E5108%f[%W]') == nil then error(err) end end end end local set_cursorline = function(active) local filetype = vim.bo.filetype if autocmds.cursorline_blacklist[filetype] ~= true then vim.wo.cursorline = active end end autocmds.buf_enter = function() focus_window() end autocmds.buf_leave = function() mkview() end autocmds.buf_win_enter = function() if should_mkview() then vim.cmd('silent! loadview') vim.cmd('silent! ' .. vim.fn.line('.') .. 'foldopen!') end end autocmds.buf_write_post = function() mkview() end autocmds.focus_gained = function() focus_window() end autocmds.focus_lost = function() blur_window() end autocmds.insert_enter = function() set_cursorline(false) end autocmds.insert_leave = function() set_cursorline(true) end autocmds.vim_enter = function() set_cursorline(true) focus_window() end autocmds.win_enter = function() set_cursorline(true) focus_window() end autocmds.win_leave = function() set_cursorline(false) blur_window() mkview() end -- Don't use colorcolumn when these filetypes get focus (we want them to appear -- full-width irrespective of 'textwidth'). autocmds.colorcolumn_filetype_blacklist = { ['CommandTMatchListing'] = true, ['CommandTPrompt'] = true, ['CommandTTitle'] = true, ['command-t'] = true, ['diff'] = true, ['dirvish'] = true, ['fugitiveblame'] = true, ['undotree'] = true, ['qf'] = true, ['sagahover'] = true, } -- Don't mess with 'conceallevel' for these. autocmds.conceallevel_filetypes = { ['dirvish'] = 2, ['help'] = 2, } autocmds.cursorline_blacklist = { ['CommandTMatchListing'] = true, ['CommandTPrompt'] = true, ['CommandTTitle'] = true, ['command-t'] = true, } -- Don't use 'winhighlight' to make these filetypes seem blurred. autocmds.winhighlight_filetype_blacklist = { ['CommandTMatchListing'] = true, ['CommandTPrompt'] = true, ['CommandTTitle'] = true, ['diff'] = true, ['fugitiveblame'] = true, ['undotree'] = true, ['qf'] = true, ['sagahover'] = true, } -- Force 'list' (when `true`) or 'nolist' (when `false`) for these. autocmds.list_filetypes = { ['CommandTMatchListing'] = false, ['CommandTPrompt'] = false, ['CommandTTitle'] = false, ['command-t'] = false, ['help'] = false, } autocmds.mkview_filetype_blacklist = { ['diff'] = true, ['gitcommit'] = true, ['hgcommit'] = true, } -- Don't mess with numbers in these filetypes. autocmds.number_blacklist = { ['CommandTMatchListing'] = true, ['CommandTPrompt'] = true, ['CommandTTitle'] = true, ['command-t'] = true, ['diff'] = true, ['fugitiveblame'] = true, ['help'] = true, ['qf'] = true, ['sagahover'] = true, ['undotree'] = true, } -- Don't do "ownsyntax on/off" for these. autocmds.ownsyntax_filetypes = { ['CommandTMatchListing'] = true, ['CommandTPrompt'] = true, ['CommandTTitle'] = true, ['NvimTree'] = true, ['dirvish'] = true, ['help'] = true, ['qf'] = true, } return autocmds
unlicense
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/tailor/formalWearIvHighFashion/dignifiedBelt.lua
1
3955
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. dignifiedBelt = Object:new { objectName = "Dignified Belt", stfName = "belt_s13", stfFile = "wearables_name", objectCRC = 3144292293, groupName = "craftClothingFormalGroupD", -- Group schematic is awarded in (See skills table) craftingToolTab = 8, -- (See DraftSchemticImplementation.h) complexity = 18, size = 3, xpType = "crafting_clothing_general", xp = 120, assemblySkill = "clothing_assembly", experimentingSkill = "clothing_experimentation", ingredientTemplateNames = "craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n", ingredientTitleNames = "shell, binding_and_reinforcement, hardware, jewelry_setting", ingredientSlotType = "0, 0, 0, 1", resourceTypes = "hide, petrochem_inert, ore, object/tangible/component/clothing/shared_jewelry_setting.iff", resourceQuantities = "25, 15, 5, 2", combineTypes = "0, 0, 0, 1", contribution = "100, 100, 100, 100", numberExperimentalProperties = "1, 1, 1, 1", experimentalProperties = "XX, XX, XX, XX", experimentalWeights = "1, 1, 1, 1", experimentalGroupTitles = "null, null, null, null", experimentalSubGroupTitles = "null, null, sockets, hitpoints", experimentalMin = "0, 0, 0, 1000", experimentalMax = "0, 0, 0, 1000", experimentalPrecision = "0, 0, 0, 0", tanoAttributes = "objecttype=16777218:objectcrc=492461254:stfFile=wearables_name:stfName=belt_s13:stfDetail=:itemmask=65535::", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "/private/index_color_1, /private/index_color_2", customizationDefaults = "0, 0", customizationSkill = "clothing_customization" } DraftSchematics:addDraftSchematic(dignifiedBelt, 3144292293)--- Add to global DraftSchematics table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/static/flora/objects.lua
1
40659
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_static_flora_shared_flora_base = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/edb_con_glass_s1_empty.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_base, 3282656608) object_static_flora_shared_flora_bush_dathomir_hwotha = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/leaf_dath_hwotha.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_bush_dathomir_hwotha, 3380635776) object_static_flora_shared_flora_bush_endor_rainbowbush = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/leaf_endr_rainbowbush.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_bush_endor_rainbowbush, 2385797177) object_static_flora_shared_flora_bush_talus_razorcoil = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/leaf_tals_razorcoil.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_bush_talus_razorcoil, 1622915798) object_static_flora_shared_flora_bush_yavin_blueleaf = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/shrb_blueleaf.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_bush_yavin_blueleaf, 4112833826) object_static_flora_shared_flora_decd_dath_azerontree = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_dath_azerontree.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_dath_azerontree, 1303000302) object_static_flora_shared_flora_decd_dath_blacktree = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_dath_blacktree.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_dath_blacktree, 1239955396) object_static_flora_shared_flora_decd_endr_destree_dead = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_endr_destree_dead.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_endr_destree_dead, 3087503053) object_static_flora_shared_flora_decd_scorched_massassi = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_scorched_massassi.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_scorched_massassi, 1850241596) object_static_flora_shared_flora_decd_scorched_massassi_broke = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_scorched_massassi_broke.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_scorched_massassi_broke, 1334140957) object_static_flora_shared_flora_decd_scorched_tallbirch = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_scorched_tallbirch.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_scorched_tallbirch, 4131259780) object_static_flora_shared_flora_decd_scorched_tallbirch_broke = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_scorched_tallbirch_broke.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_decd_scorched_tallbirch_broke, 2780610841) object_static_flora_shared_flora_flower_all_bauhin = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/flow_bauhin.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_flower_all_bauhin, 2323835715) object_static_flora_shared_flora_flower_endor_scrubwort = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/flow_endr_scrubwort.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_flower_endor_scrubwort, 1951625577) object_static_flora_shared_flora_flower_tato_funnel = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/flow_tatt_funnel_lrg.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_flower_tato_funnel, 3210762519) object_static_flora_shared_flora_flower_tato_funnel_med = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/flow_tatt_funnel_med.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_flower_tato_funnel_med, 1114511484) object_static_flora_shared_flora_flower_tato_funnel_sm = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/flow_tatt_funnel_sm.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_flower_tato_funnel_sm, 3419088004) object_static_flora_shared_flora_plant_tato_falotil = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/succ_tatt_falotil_nuts.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_plant_tato_falotil, 3330222752) object_static_flora_shared_flora_plant_tato_falotil_bare = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/succ_tatt_falotil_bare.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_plant_tato_falotil_bare, 3257873338) object_static_flora_shared_flora_plant_tato_hubba = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/succ_tatt_hubba_lrg.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_plant_tato_hubba, 998793848) object_static_flora_shared_flora_plant_tato_pika = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/succ_tatt_pika_solo.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_plant_tato_pika, 2097396056) object_static_flora_shared_flora_plant_tato_pika_tri = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/succ_tatt_pika_tri.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_plant_tato_pika_tri, 753105168) object_static_flora_shared_flora_shrb_dath_glingi = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/shrb_dath_glingi.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_shrb_dath_glingi, 4134879921) object_static_flora_shared_flora_tree_lok_mkpud = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_lok_mkpud.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_lok_mkpud, 3776365618) object_static_flora_shared_flora_tree_palm_fngi = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/ever_palmtree_fngi.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_palm_fngi, 2866142506) object_static_flora_shared_flora_tree_palm_sm = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/ever_palmtree_sm.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_palm_sm, 2535930087) object_static_flora_shared_flora_tree_palm_thk = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/ever_palmtree_thk.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_palm_thk, 758632558) object_static_flora_shared_flora_tree_rori_mkpodtree = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_mkpodtree.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pod tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pod tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_rori_mkpodtree, 1443720376) object_static_flora_shared_flora_tree_rori_windswept_s00 = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_windswept.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_rori_windswept_s00, 4015418034) object_static_flora_shared_flora_tree_rori_windswept_s01 = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_windswept_a1.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_rori_windswept_s01, 2790985023) object_static_flora_shared_flora_tree_rori_windswept_s02 = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_windswept_a2.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_rori_windswept_s02, 2102175144) object_static_flora_shared_flora_tree_rori_windswept_s03 = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_windswept_a3.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:windswept tree", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:windswept tree", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_rori_windswept_s03, 876724773) object_static_flora_shared_flora_tree_tato_touchnot = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/decd_touchnot1.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_flora_tree_tato_touchnot, 1020776426) object_static_flora_shared_potted_plant_flowers_orange = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/frn_all_potted_plants_sml_s01.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_potted_plant_flowers_orange, 248082179) object_static_flora_shared_potted_plant_flowers_purple = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/frn_all_potted_plants_sml_s02.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_potted_plant_flowers_purple, 3892348345) object_static_flora_shared_potted_plant_leaves_fern = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/frn_all_potted_plants_sml_s03.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_potted_plant_leaves_fern, 877469590) object_static_flora_shared_potted_plant_leaves_ivy = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/frn_all_potted_plants_sml_s04.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_potted_plant_leaves_ivy, 1315610543) object_static_flora_shared_potted_plant_leaves_small = SharedStaticObjectTemplate:new { appearanceFilename = "appearance/frn_all_potted_plants_sml_s05.apt", arrangementDescriptorFilename = "", clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 255, collisionActionFlags = 1, collisionActionPassFlags = 0, collisionMaterialBlockFlags = 1, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 0, detailedDescription = "@string_table:pristine wall", gameObjectType = 8201, locationReservationRadius = 0, lookAtText = "@string_table:pristine wall", noBuildRadius = 0, objectName = "@obj_n:unknown_object", onlyVisibleInTools = 0, portalLayoutFilename = "", scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 0, surfaceType = 0 } ObjectTemplates:addTemplate(object_static_flora_shared_potted_plant_leaves_small, 622948670)
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/slashcommands/admin/wipeItems.lua
1
2433
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. --true = 1, false = 0 WipeItemsSlashCommand = { name = "wipeitems", alternativeNames = "", animation = "", invalidStateMask = 2097152, --glowingJedi, invalidPostures = "", target = 2, targeType = 2, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 0, } AddWipeItemsSlashCommand(WipeItemsSlashCommand)
lgpl-3.0
Modified-MW-DF/modified-MDF
MWDF Project/Dwarf Fortress/hack/scripts/modtools/spawn-flow.lua
2
2082
-- spawns flows at locations --author expwnent local usage = [====[ modtools/spawn-flow =================== Creates flows at the specified location. Arguments:: -material mat specify the material of the flow, if applicable examples: INORGANIC:IRON CREATURE_MAT:DWARF:BRAIN PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK -location [ x y z] the location to spawn the flow -flowType type specify the flow type examples: Miasma Steam Mist MaterialDust MagmaMist Smoke Dragonfire Fire Web MaterialGas MaterialVapor OceanWave SeaFoam -flowSize size specify how big the flow is ]====] local utils = require 'utils' validArgs = validArgs or utils.invert({ 'help', 'material', 'flowType', 'location', 'flowSize', }) local args = utils.processArgs({...}, validArgs) if args.help then print(usage) return end local mat_index = -1; local mat_type = -1; if args.material then local mat = dfhack.matinfo.find(args.material) if not mat then error ('Invalid material: ' .. mat) end mat_index = mat.index mat_type = mat['type'] end if args.flowSize and not tonumber(args.flowSize) then error ('Invalid flow size: ' .. args.flowSize) end args.flowSize = tonumber(args.flowSize or 'z') or 100 if not args.flowType or not df.flow_type[args.flowType] then error ('Invalid flow type: ' .. (args.flowType or 'none specified')) end args.flowType = df.flow_type[args.flowType] if not args.location then error 'Specify a location.' end local pos = df.coord:new(); pos.x = tonumber(args.location[1] or 'a') pos.y = tonumber(args.location[2] or 'a') pos.z = tonumber(args.location[3] or 'a') if not pos.x or not pos.y or not pos.z then error ('Invalid pos.') end dfhack.maps.spawnFlow(pos, args.flowType, mat_type, mat_index, args.flowSize)
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/endor/npcs/donkuwah/frenziedDonkuwah.lua
1
4610
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. frenziedDonkuwah = Creature:new { objectName = "frenziedDonkuwah", -- Lua Object Name creatureType = "NPC", faction = "donkuwah_tribe", factionPoints = 20, gender = "", speciesName = "frenzied_donkuwah", stfName = "mob/creature_names", objectCRC = 2350961206, socialGroup = "donkuwah_tribe", level = 39, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 11000, healthMin = 9000, strength = 0, constitution = 0, actionMax = 11000, actionMin = 9000, quickness = 0, stamina = 0, mindMax = 11000, mindMin = 9000, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 40, energy = 0, electricity = -1, stun = -1, blast = 0, heat = 50, cold = 50, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 1, ferocity = 0, aggressive = 1, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 365, weaponMaxDamage = 440, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "donkuwahAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(frenziedDonkuwah, 2350961206) -- Add to Global Table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/npcs/missionNpcs/questCrowdPleaserJudge.lua
1
4767
--Copyright (C) 2008 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. questCrowdPleaserJudge = Creature:new { objectName = "questCrowdPleaserJudge", -- Lua Object Name creatureType = "NPC", faction = "Townsperson", gender = "", name = "judge", objectCRC = 1517198202, socialGroup = "Townsperson", named = FALSE, level = 4, xp = 85, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 138, healthMin = 113, strength = 0, constitution = 0, actionMax = 138, actionMin = 113, quickness = 0, stamina = 0, mindMax = 138, mindMin = 113, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 1, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, aggressive = 0, invincible = 1, attackCreatureOnSight = "", -- Enter socialGroups weapon = "", -- File path to weapon -> object\xxx\xxx\xx weaponName = "", -- Name ex. 'a Vibrolance' weaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 0, weaponMaxDamage = 0, weaponAttackSpeed = 0, weaponDamageType = "", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = 0, -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "", "", "" } -- respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(questCrowdPleaserJudge, 1517198202) -- Add to Global Table
lgpl-3.0
Invertika/data
scripts/maps/ow-n0002-n0015-o0000.lua
1
1400
---------------------------------------------------------------------------------- -- Map File -- -- -- -- In dieser Datei stehen die entsprechenden externen NPC's, Trigger und -- -- anderer Dinge. -- -- -- ---------------------------------------------------------------------------------- -- Copyright 2010 The Invertika Development Team -- -- -- -- This file is part of Invertika. -- -- -- -- Invertika is free software; you can redistribute it and/or modify it -- -- under the terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2 of the License, or any later version. -- ---------------------------------------------------------------------------------- require "scripts/lua/npclib" require "scripts/libs/warp" atinit(function() create_inter_map_warp_trigger(170, 131, 172, 211) --- Intermap warp end)
gpl-3.0
mendsley/premake-core
modules/vstudio/tests/sln2005/test_dependencies.lua
15
2331
-- -- tests/actions/vstudio/sln2005/test_dependencies.lua -- Validate generation of Visual Studio 2005+ solution project dependencies. -- Copyright (c) 2009-2012 Jason Perkins and the Premake project -- local p = premake local suite = test.declare("vstudio_sln2005_dependencies") local sln2005 = p.vstudio.sln2005 -- -- Setup -- local wks, prj1, prj2 function suite.setup() p.action.set("vs2005") wks, prj1 = test.createWorkspace() uuid "AE61726D-187C-E440-BD07-2556188A6565" prj2 = test.createproject(wks) uuid "2151E83B-997F-4A9D-955D-380157E88C31" prj3 = test.createproject(wks) uuid "CAA68162-8B96-11E1-8D5E-5885BBE59B18" links "MyProject" dependson "MyProject2" end local function prepare(language) prj1.language = language prj2.language = language prj2 = test.getproject(wks, 2) sln2005.projectdependencies(prj2) prj3.language = language prj3 = test.getproject(wks, 3) sln2005.projectdependencies(prj3) end -- -- Verify dependencies between C++ projects are listed. -- function suite.dependency_onCppProjects() prepare("C++") test.capture [[ ProjectSection(ProjectDependencies) = postProject {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end -- -- Verify dependencies between C# projects are listed. -- function suite.dependency_onCSharpProjects() prepare("C#") test.capture [[ ProjectSection(ProjectDependencies) = postProject {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end -- -- Most C# references should go into the project rather than the solution, -- but until I know the conditions, put everything here to be safe. -- function suite.dependency_onCSharpProjectsVs2010() p.action.set("vs2010") prepare("C#") test.capture [[ ProjectSection(ProjectDependencies) = postProject {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end -- -- Verify dependencies between projects C# are listed for VS2012. -- function suite.dependency_onCSharpProjectsVs2012() p.action.set("vs2012") prepare("C#") test.capture [[ ProjectSection(ProjectDependencies) = postProject {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end
bsd-3-clause
metakermit/vlc
share/lua/sd/jamendo.lua
58
6732
--[[ $Id$ Copyright © 2010 VideoLAN and AUTHORS Authors: Fabio Ritrovato <sephiroth87 at videolan dot org> Rémi Duraffort <ivoire at videolan dot org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. --]] require "simplexml" function descriptor() return { title="Jamendo Selections" } end function main() add_top_tracks( "ratingweek_desc", "rock", 100 ) add_top_tracks( "ratingweek_desc", "pop", 100 ) add_top_tracks( "ratingweek_desc", "jazz", 100 ) add_top_tracks( "ratingweek_desc", "dance", 100 ) add_top_tracks( "ratingweek_desc", "hipop+rap", 100 ) add_top_tracks( "ratingweek_desc", "world+reggae", 100 ) add_top_tracks( "ratingweek_desc", "lounge+ambient", 100 ) add_top_tracks( "ratingweek_desc", nil, 100 ) add_top_albums( "ratingweek_desc", nil, 20 ) add_radio_from_id( "9", 20 ) add_radio_from_id( "8", 20 ) add_radio_from_id( "6", 20 ) add_radio_from_id( "5", 20 ) add_radio_from_id( "7", 20 ) add_radio_from_id( "4", 20 ) end function add_top_albums( album_order, tag, max_results ) local url = "http://api.jamendo.com/get2/id+name+artist_name+album_image/album/xml/?imagesize=500&order=" .. album_order .. "&n=" .. max_results if tag ~= nil then url = url .. "&tag_idstr=" .. tag end local tree = simplexml.parse_url( url ) local node_name = "Top " .. max_results if album_order == "rating_desc" then node_name = node_name .. " most popular albums" elseif album_order == "ratingmonth_desc" then node_name = node_name .. " most popular albums this month" elseif album_order == "ratingweek_desc" then node_name = node_name .. " most popular albums this week" elseif album_order == "releasedate_desc" then node_name = node_name .. " latest released albums" elseif album_order == "downloaded_desc" then node_name = node_name .. " most downloaded albums" elseif album_order == "listened_desc" then node_name = node_name .. " most listened to albums" elseif album_order == "starred_desc" then node_name = node_name .. " most starred albums" elseif album_order == "playlisted_desc" then node_name = node_name .. " most playlisted albums" elseif album_order == "needreviews_desc" then node_name = node_name .. " albums requiring review" end if tag ~= nil then node_name = tag .. " - " .. node_name end local node = vlc.sd.add_node( {title=node_name} ) for _, album in ipairs( tree.children ) do simplexml.add_name_maps( album ) local album_node = node:add_subitem( { path = 'http://api.jamendo.com/get2/id+name+duration+artist_name+album_name+album_genre+album_dates+album_image/track/xml/track_album+album_artist/?album_id=' .. album.children_map["id"][1].children[1], title = album.children_map["artist_name"][1].children[1] .. ' - ' .. album.children_map["name"][1].children[1], arturl = album.children_map["album_image"][1].children[1] }) end end function add_top_tracks( track_order, tag, max_results ) local url = "http://api.jamendo.com/get2/id+name+duration+artist_name+album_name+genre+album_image+album_dates/track/xml/track_album+album_artist/?imagesize=500&order=" .. track_order .. "&n=" .. max_results if tag ~= nil then url = url .. "&tag_minweight=0.35&tag_idstr=" .. tag end local tree = simplexml.parse_url( url ) local node_name = "Top " .. max_results if track_order == "rating_desc" then node_name = node_name .. " most popular tracks" elseif track_order == "ratingmonth_desc" then node_name = node_name .. " most popular tracks this month" elseif track_order == "ratingweek_desc" then node_name = node_name .. " most popular tracks this week" elseif track_order == "releasedate_desc" then node_name = node_name .. " latest released tracks" elseif track_order == "downloaded_desc" then node_name = node_name .. " most downloaded tracks" elseif track_order == "listened_desc" then node_name = node_name .. " most listened to tracks" elseif track_order == "starred_desc" then node_name = node_name .. " most starred tracks" elseif track_order == "playlisted_desc" then node_name = node_name .. " most playlisted tracks" elseif track_order == "needreviews_desc" then node_name = node_name .. " tracks requiring review" end if tag ~= nil then node_name = string.upper(tag) .. " - " .. node_name end local node = vlc.sd.add_node( {title=node_name} ) for _, track in ipairs( tree.children ) do simplexml.add_name_maps( track ) node:add_subitem( {path="http://api.jamendo.com/get2/stream/track/redirect/?id=" .. track.children_map["id"][1].children[1], title=track.children_map["artist_name"][1].children[1].." - "..track.children_map["name"][1].children[1], artist=track.children_map["artist_name"][1].children[1], album=track.children_map["album_name"][1].children[1], genre=track.children_map["genre"][1].children[1], date=track.children_map["album_dates"][1].children_map["year"][1].children[1], arturl=track.children_map["album_image"][1].children[1], duration=track.children_map["duration"][1].children[1]} ) end end function add_radio_from_id( id, max_results ) local radio_name if id == "9" then radio_name="Rock" elseif id == "8" then radio_name="Pop / Songwriting" elseif id == "6" then radio_name="Jazz" elseif id == "5" then radio_name="Hip-Hop" elseif id == "7" then radio_name="Lounge" elseif id == "4" then radio_name="Dance / Electro" end vlc.sd.add_item( {path="http://api.jamendo.com/get2/id+name+artist_name+album_name+duration+album_genre+album_image+album_dates/track/xml/radio_track_inradioplaylist+track_album+album_artist/?imagesize=500&order=random_desc&radio_id=" .. id .. "&n=" .. max_results, title=radio_name} ) end
gpl-2.0
zjohn4/PD2-lua-src
lib/units/weapons/trip_mine/tripminebase.lua
1
20316
TripMineBase = TripMineBase or class( UnitBase ) TripMineBase.EVENT_IDS = {} TripMineBase.EVENT_IDS.sensor_beep = 1 TripMineBase.EVENT_IDS.explosion_beep = 2 function TripMineBase.spawn( pos, rot, sensor_upgrade ) -- Only called from server --[[local brush = Draw:brush( Color.red:with_alpha( 0.5 ) ) brush:set_persistance( 2 ) brush:sphere( pos, 2 ) brush:set_color( Color.blue:with_alpha( 0.5 ) ) brush:cylinder( pos, pos + rot:z() * 50, 1 ) brush:set_color( Color.green:with_alpha( 0.5 ) ) brush:cylinder( pos, pos + rot:y() * 50, 1 )]] local unit = World:spawn_unit( Idstring( "units/payday2/equipment/gen_equipment_tripmine/gen_equipment_tripmine" ), pos, rot ) managers.network:session():send_to_peers_synched( "sync_trip_mine_setup", unit, sensor_upgrade ) unit:base():setup( sensor_upgrade ) return unit end ----------------------------------------------------------------------------------- -- This is only set by server. This way he can find the unit and remove it if the owning peer id leaves function TripMineBase:set_server_information( peer_id ) self._server_information = { owner_peer_id = peer_id } managers.network:game():member( peer_id ):peer():set_used_deployable( true ) end -- Called by server when client leaves function TripMineBase:server_information() return self._server_information end --[[ function TripMineBase:set_sensor_upgrade( sensor_upgrade ) self._sensor_upgrade = sensor_upgrade if managers.network:session() then managers.network:session():send_to_peers_synched( "sync_trip_mine_set_sensor_upgrade", self._unit, self._sensor_upgrade ) end end ]] ----------------------------------------------------------------------------------- function TripMineBase:init( unit ) UnitBase.init( self, unit, false ) self._unit = unit self._position = self._unit:position() self._rotation = self._unit:rotation() self._forward = self._rotation:y() self._ray_from_pos = Vector3() self._ray_to_pos = Vector3() self._init_length = 500 self._length = self._init_length self._ids_laser = Idstring( "laser" ) self._g_laser = self._unit:get_object( Idstring( "g_laser" ) ) self._g_laser_sensor = self._unit:get_object( Idstring( "g_laser_sensor" ) ) -- self._g_trip_mine = self._unit:get_object( Idstring( "g_trip_mine" ) ) self._use_draw_laser = SystemInfo:platform() == Idstring( "PS3" ) if self._use_draw_laser then self._laser_color = Color( 0.15, 1, 0, 0 ) self._laser_sensor_color = Color( 0.15, 0.1, 0.1, 1 ) self._laser_brush = Draw:brush( self._laser_color ) -- Color( 0.05, 0, 1, 0 ) ) self._laser_brush:set_blend_mode( "opacity_add" ) end -- self:_setup() end function TripMineBase:get_name_id() return "trip_mine" end function TripMineBase:interaction_text_id() return self._sensor_upgrade and "hud_int_equipment_sensor_trip_mine" or "debug_interact_trip_mine" end ----------------------------------------------------------------------------------- function TripMineBase:sync_setup( sensor_upgrade ) self:setup( sensor_upgrade ) end ----------------------------------------------------------------------------------- function TripMineBase:setup( sensor_upgrade ) self._slotmask = managers.slot:get_mask( "trip_mine_targets" ) self._first_armed = false self._armed = false self._sensor_upgrade = sensor_upgrade self:set_active( false ) self._unit:sound_source():post_event( "trip_mine_attach" ) end ----------------------------------------------------------------------------------- function TripMineBase:set_active( active, owner ) self._active = active self._unit:set_extension_update_enabled( Idstring( "base" ), self._active or self._use_draw_laser ) if self._active then self._owner = owner self._owner_peer_id = managers.network:session():local_peer():id() local from_pos = self._unit:position() + self._unit:rotation():y() * 10 local to_pos = from_pos + self._unit:rotation():y() * self._init_length local ray = self._unit:raycast( "ray", from_pos, to_pos, "slot_mask", managers.slot:get_mask( "world_geometry" ) ) self._length = math.clamp( ray and (ray.distance + 10) or self._init_length, 0, self._init_length ) self._unit:anim_set_time( self._ids_laser, self._length/self._init_length ) self._activate_timer = 3 mvector3.set( self._ray_from_pos, self._position ) mvector3.set( self._ray_to_pos, self._forward ) mvector3.multiply( self._ray_to_pos, self._length ) mvector3.add( self._ray_to_pos, self._ray_from_pos ) local from_pos = self._unit:position() + self._unit:rotation():y() * 10 local to_pos = self._unit:position() + self._unit:rotation():y() * -10 local ray = self._unit:raycast( "ray", from_pos, to_pos, "slot_mask", managers.slot:get_mask( "world_geometry" ) ) if ray then self._attached_data = {} self._attached_data.body = ray.body self._attached_data.position = ray.body:position() self._attached_data.rotation = ray.body:rotation() self._attached_data.index = 1 self._attached_data.max_index = 3 end self._alert_filter = owner:movement():SO_access() elseif self._use_draw_laser then local from_pos = self._unit:position() + self._unit:rotation():y() * 10 local to_pos = from_pos + self._unit:rotation():y() * self._init_length local ray = self._unit:raycast( "ray", from_pos, to_pos, "slot_mask", managers.slot:get_mask( "world_geometry" ) ) self._length = math.clamp( ray and (ray.distance + 10) or self._init_length, 0, self._init_length ) mvector3.set( self._ray_from_pos, self._position ) mvector3.set( self._ray_to_pos, self._forward ) mvector3.multiply( self._ray_to_pos, self._length ) mvector3.add( self._ray_to_pos, self._ray_from_pos ) end end ----------------------------------------------------------------------------------- function TripMineBase:active() return self._active end ----------------------------------------------------------------------------------- function TripMineBase:armed() return self._armed end function TripMineBase:_set_armed( armed ) self._armed = not self._activate_timer and armed self._g_laser:set_visibility( self._armed ) self._g_laser_sensor:set_visibility( self._sensor_upgrade and (not self._armed) ) if self._use_draw_laser then self._laser_brush:set_color( self._armed and self._laser_color or self._sensor_upgrade and self._laser_sensor_color or self._laser_color ) end if not self._first_armed then self._first_armed = true self._activate_timer = nil self._unit:sound_source():post_event( "trip_mine_beep_armed" ) end self._unit:sound_source():post_event( self._armed and "trip_mine_arm" or "trip_mine_disarm" ) end function TripMineBase:set_armed( armed ) if not managers.network:session() then return end self:_set_armed( armed ) if managers.network:session() then managers.network:session():send_to_peers_synched( "sync_trip_mine_set_armed", self._unit, self._armed, self._length ) end end function TripMineBase:sync_trip_mine_set_armed( armed, length ) -- local brush = Draw:brush( Color.red:with_alpha( 0.5 ) ) -- brush:set_persistance( 2 ) -- brush:sphere( self._unit:position(), 30 ) self._length = length self._unit:anim_set_time( self._ids_laser, length/self._init_length ) self:_set_armed( armed ) end --[[ function TripMineBase:sync_trip_mine_set_sensor_upgrade( sensor_upgrade ) self._sensor_upgrade = sensor_upgrade end ]] ----------------------------------------------------------------------------------- function TripMineBase:_update_draw_laser() if self._use_draw_laser and self._first_armed then if self._armed or self._sensor_upgrade then self._laser_brush:cylinder( self._ray_from_pos, self._ray_to_pos, 0.5 ) end end end function TripMineBase:update( unit, t, dt ) self:_update_draw_laser() if not self._owner then return end self:_check_body() if self._explode_timer then self._explode_timer = self._explode_timer - dt if self._explode_timer <= 0 then self:_explode( self._explode_ray ) return end end if self._activate_timer then self._activate_timer = self._activate_timer - dt if self._activate_timer <= 0 then self._activate_timer = nil self:set_armed( true ) end return end if self._deactive_timer then self._deactive_timer = self._deactive_timer - dt if self._deactive_timer <= 0 then self._deactive_timer = nil end return end if not self._armed then if( self._sensor_upgrade ) then self:_sensor( t ) if( self._sensor_units_detected and self._sensor_last_unit_time and t > self._sensor_last_unit_time ) then self._sensor_units_detected = nil self._sensor_last_unit_time = nil end end return end if not self._explode_timer then self:_check() end end ----------------------------------------------------------------------------------- function TripMineBase:_raycast() return self._unit:raycast( "ray", self._ray_from_pos, self._ray_to_pos, "slot_mask", self._slotmask, "ray_type", "trip_mine body" ) end ----------------------------------------------------------------------------------- function TripMineBase:_sensor( t ) local ray = self:_raycast() -- local brush = Draw:brush( Color.green:with_alpha( 0.25 ) ) -- brush:cylinder( self._ray_from_pos, self._ray_to_pos, 1 ) if ray and ray.unit and not tweak_data.character[ ray.unit:base()._tweak_table ].is_escort then self._sensor_units_detected = self._sensor_units_detected or {} if( not self._sensor_units_detected[ ray.unit:key() ] ) then self._sensor_units_detected[ ray.unit:key() ] = true self:_emit_sensor_sound_and_effect() if managers.network:session() then managers.network:session():send_to_peers_synched( "sync_unit_event_id_8", self._unit, "base", TripMineBase.EVENT_IDS.sensor_beep ) end self._sensor_last_unit_time = t + 5 end end end function TripMineBase:sync_trip_mine_beep_sensor() self:_emit_sensor_sound_and_effect() end ----------------------------------------------------------------------------------- -- If the body where the trip mine is placed is disabled, moved or rotated - boom. function TripMineBase:_check_body() if not self._attached_data then return end if self._attached_data.index == 1 then if not alive( self._attached_data.body ) or not self._attached_data.body:enabled() then self:explode() end elseif self._attached_data.index == 2 then if not alive( self._attached_data.body ) or not mrotation.equal( self._attached_data.rotation, self._attached_data.body:rotation() ) then self:explode() end elseif self._attached_data.index == 3 then if not alive( self._attached_data.body ) or mvector3.not_equal( self._attached_data.position, self._attached_data.body:position() ) then self:explode() end end self._attached_data.index = (self._attached_data.index < self._attached_data.max_index and self._attached_data.index or 0) + 1 end ----------------------------------------------------------------------------------- function TripMineBase:_check() if not managers.network:session() then return end local ray = self:_raycast() if ray and ray.unit and not tweak_data.character[ ray.unit:base()._tweak_table ].is_escort then self._explode_timer = tweak_data.weapon.trip_mines.delay + managers.player:upgrade_value( "trip_mine", "explode_timer_delay", 0 ) self._explode_ray = ray self._unit:sound_source():post_event( "trip_mine_beep_explode" ) if managers.network:session() then managers.network:session():send_to_peers_synched( "sync_unit_event_id_8", self._unit, "base", TripMineBase.EVENT_IDS.explosion_beep ) end end -- self:_debug_draw( from_pos, to_pos ) end ----------------------------------------------------------------------------------- function TripMineBase:sync_trip_mine_beep_explode() self._unit:sound_source():post_event( "trip_mine_beep_explode" ) end ----------------------------------------------------------------------------------- -- Sequencemanager callback on bullet damage. Only run it on the client that owns the mine. function TripMineBase:explode() if not self._active then return end self._active = false local col_ray = {} col_ray.ray = self._forward col_ray.position = self._position self:_explode( col_ray ) end function TripMineBase:_explode( col_ray ) if not managers.network:session() then return end local damage_size = tweak_data.weapon.trip_mines.damage_size * managers.player:upgrade_value( "trip_mine", "explosion_size_multiplier", 1 ) * managers.player:upgrade_value( "trip_mine", "damage_multiplier", 1 ) local player = managers.player:player_unit() if alive( player ) then player:character_damage():damage_explosion( { position = self._position, range = damage_size, damage = 6 } ) else player = nil end self._unit:set_extension_update_enabled( Idstring( "base" ), false ) self._deactive_timer = 5 self:_play_sound_and_effects() local slotmask = managers.slot:get_mask( "bullet_impact_targets" ) local bodies = World:find_bodies( "intersect", "cylinder", self._ray_from_pos, self._ray_to_pos, damage_size, slotmask ) -- local brush = Draw:brush( Color.green:with_alpha( 0.25 ) ) -- brush:set_persistance( 2 ) -- brush:cylinder( self._ray_from_pos, self._ray_to_pos, damage_size ) local damage = tweak_data.weapon.trip_mines.damage * managers.player:upgrade_value( "trip_mine", "damage_multiplier", 1 ) local amount = 0 local characters_hit = {} for _, hit_body in ipairs( bodies ) do local character = hit_body:unit():character_damage() and hit_body:unit():character_damage().damage_explosion local apply_dmg = hit_body:extension() and hit_body:extension().damage local dir, ray_hit if character and not characters_hit[ hit_body:unit():key() ] then local com = hit_body:center_of_mass() local ray_from = math.point_on_line( self._ray_from_pos, self._ray_to_pos, com ) ray_hit = not World:raycast( "ray", ray_from, com, "slot_mask", slotmask, "ignore_unit", { hit_body:unit() }, "report" ) if ray_hit then -- brush:cylinder( ray_from, hit_body:position(), 3 ) characters_hit[ hit_body:unit():key() ] = true end elseif apply_dmg or hit_body:dynamic() then ray_hit = true end if ray_hit then dir = hit_body:center_of_mass() mvector3.direction( dir, self._ray_from_pos, dir ) if apply_dmg then local normal = dir local prop_damage = math.min( damage, 200 ) local network_damage = math.ceil( prop_damage * 163.84 ) prop_damage = network_damage / 163.84 hit_body:extension().damage:damage_explosion( player, normal, hit_body:position(), dir, prop_damage ) hit_body:extension().damage:damage_damage( player, normal, hit_body:position(), dir, prop_damage ) if hit_body:unit():id() ~= -1 then if player then managers.network:session():send_to_peers_synched( "sync_body_damage_explosion", hit_body, player, normal, hit_body:position(), dir, math.min( 32768, network_damage ) ) else managers.network:session():send_to_peers_synched( "sync_body_damage_explosion_no_attacker", hit_body, normal, hit_body:position(), dir, math.min( 32768, network_damage ) ) end end end if hit_body:unit():in_slot( managers.game_play_central._slotmask_physics_push ) then hit_body:unit():push( 5, dir * 500 ) end if character then self:_give_explosion_damage( col_ray, hit_body:unit(), damage ) amount = amount + 1 end end end if amount >= 2 then managers.challenges:count_up( "dual_tripmine" ) end if amount >= 3 then managers.challenges:count_up( "tris_tripmine" ) end if amount >= 4 then managers.challenges:count_up( "quad_tripmine" ) end if managers.network:session() then if player then managers.network:session():send_to_peers_synched( "sync_trip_mine_explode", self._unit, player, self._ray_from_pos, self._ray_to_pos, damage_size, damage ) else managers.network:session():send_to_peers_synched( "sync_trip_mine_explode_no_user", self._unit, self._ray_from_pos, self._ray_to_pos, damage_size, damage ) end end if Network:is_server() then local alert_event = { "aggression", self._position, tweak_data.weapon.trip_mines.alert_radius, self._alert_filter, self._unit } managers.groupai:state():propagate_alert( alert_event ) end self._unit:set_slot( 0 ) end function TripMineBase:sync_trip_mine_explode( user_unit, ray_from, ray_to, damage_size, damage ) self:_play_sound_and_effects() self._unit:set_slot( 0 ) local bodies = World:find_bodies( "intersect", "cylinder", ray_from, ray_to, damage_size, managers.slot:get_mask( "bullet_impact_targets" ) ) for _, hit_body in ipairs( bodies ) do local apply_dmg = hit_body:extension() and hit_body:extension().damage local dir if apply_dmg or hit_body:dynamic() then dir = hit_body:center_of_mass() mvector3.direction( dir, ray_from, dir ) if apply_dmg then local normal = dir if hit_body:unit():id() == -1 then hit_body:extension().damage:damage_explosion( user_unit, normal, hit_body:position(), dir, damage ) hit_body:extension().damage:damage_damage( user_unit, normal, hit_body:position(), dir, damage ) end end if hit_body:unit():in_slot( managers.game_play_central._slotmask_physics_push ) then hit_body:unit():push( 5, dir * 500 ) end end end end function TripMineBase:_play_sound_and_effects() World:effect_manager():spawn( { effect = Idstring( "effects/particles/explosions/explosion_grenade" ), position = self._unit:position(), normal = self._unit:rotation():y() } ) local sound_source = SoundDevice:create_source( "TripMineBase" ) sound_source:set_position( self._unit:position() ) sound_source:post_event( "trip_mine_explode" ) managers.enemy:add_delayed_clbk( "TrMiexpl", callback( TripMineBase, TripMineBase, "_dispose_of_sound", { sound_source = sound_source } ), TimerManager:game():time() + 4 ) end -- Needs new sound and effect function TripMineBase:_emit_sensor_sound_and_effect() -- World:effect_manager():spawn( { effect = Idstring( "effects/particles/explosions/explosion_grenade" ), position = self._unit:position(), normal = self._unit:rotation():y() } ) self._unit:sound_source():post_event( "trip_mine_sensor_alarm" ) end function TripMineBase._dispose_of_sound( ... ) -- When this callback is called the table parameter is unreferenced and the sound source can be garbage collected end function TripMineBase:sync_net_event( event_id ) if event_id == TripMineBase.EVENT_IDS.sensor_beep then self:sync_trip_mine_beep_sensor() elseif event_id == TripMineBase.EVENT_IDS.explosion_beep then self:sync_trip_mine_beep_explode() end end ----------------------------------------------------------------------------------- function TripMineBase:_give_explosion_damage( col_ray, unit, damage ) local action_data = {} action_data.variant = "explosion" action_data.damage = damage action_data.weapon_unit = self._unit action_data.attacker_unit = managers.player:player_unit() action_data.col_ray = col_ray action_data.owner = managers.player:player_unit() action_data.owner_peer_id = self._owner_peer_id local defense_data = unit:character_damage():damage_explosion( action_data ) return defense_data end ----------------------------------------------------------------------------------- function TripMineBase:save( data ) local state = {} state.armed = self._armed state.length = self._length state.first_armed = self._first_armed state.sensor_upgrade = self._sensor_upgrade state.ray_from_pos = self._ray_from_pos state.ray_to_pos = self._ray_to_pos data.TripMineBase = state end function TripMineBase:load( data ) local state = data.TripMineBase self._init_length = 500 self._first_armed = state.first_armed self._sensor_upgrade = state.sensor_upgrade self._ray_from_pos = state.ray_from_pos self._ray_to_pos = state.ray_to_pos if self._use_draw_laser then self._unit:set_extension_update_enabled( Idstring( "base" ), self._use_draw_laser ) end self:sync_trip_mine_set_armed( state.armed, state.length ) end ----------------------------------------------------------------------------------- function TripMineBase:_debug_draw( from, to ) local brush = Draw:brush( Color.red:with_alpha( 0.5 ) ) brush:cylinder( from, to, 1 ) end function TripMineBase:destroy() end
gpl-2.0
beatgammit/luasocket
test/mimetest.lua
44
8413
local socket = require("socket") local ltn12 = require("ltn12") local mime = require("mime") local unpack = unpack or table.unpack dofile("testsupport.lua") local qptest = "qptest.bin" local eqptest = "qptest.bin2" local dqptest = "qptest.bin3" local b64test = "b64test.bin" local eb64test = "b64test.bin2" local db64test = "b64test.bin3" -- from Machado de Assis, "A Mão e a Rosa" local mao = [[ Cursavam estes dois moços a academia de S. Paulo, estando Luís Alves no quarto ano e Estêvão no terceiro. Conheceram-se na academia, e ficaram amigos íntimos, tanto quanto podiam sê-lo dois espíritos diferentes, ou talvez por isso mesmo que o eram. Estêvão, dotado de extrema sensibilidade, e não menor fraqueza de ânimo, afetuoso e bom, não daquela bondade varonil, que é apanágio de uma alma forte, mas dessa outra bondade mole e de cera, que vai à mercê de todas as circunstâncias, tinha, além de tudo isso, o infortúnio de trazer ainda sobre o nariz os óculos cor-de-rosa de suas virginais ilusões. Luís Alves via bem com os olhos da cara. Não era mau rapaz, mas tinha o seu grão de egoísmo, e se não era incapaz de afeições, sabia regê-las, moderá-las, e sobretudo guiá-las ao seu próprio interesse. Entre estes dois homens travara-se amizade íntima, nascida para um na simpatia, para outro no costume. Eram eles os naturais confidentes um do outro, com a diferença que Luís Alves dava menos do que recebia, e, ainda assim, nem tudo o que dava exprimia grande confiança. ]] local function random(handle, io_err) if handle then return function() if not handle then error("source is empty!", 2) end local len = math.random(0, 1024) local chunk = handle:read(len) if not chunk then handle:close() handle = nil end return chunk end else return ltn12.source.empty(io_err or "unable to open file") end end local function named(f) return f end local what = nil local function transform(input, output, filter) local source = random(io.open(input, "rb")) local sink = ltn12.sink.file(io.open(output, "wb")) if what then sink = ltn12.sink.chain(filter, sink) else source = ltn12.source.chain(source, filter) end --what = not what ltn12.pump.all(source, sink) end local function encode_qptest(mode) local encode = mime.encode("quoted-printable", mode) local split = mime.wrap("quoted-printable") local chain = ltn12.filter.chain(encode, split) transform(qptest, eqptest, chain) end local function compare_qptest() io.write("testing qp encoding and wrap: ") compare(qptest, dqptest) end local function decode_qptest() local decode = mime.decode("quoted-printable") transform(eqptest, dqptest, decode) end local function create_qptest() local f, err = io.open(qptest, "wb") if not f then fail(err) end -- try all characters for i = 0, 255 do f:write(string.char(i)) end -- try all characters and different line sizes for i = 0, 255 do for j = 0, i do f:write(string.char(i)) end f:write("\r\n") end -- test latin text f:write(mao) -- force soft line breaks and treatment of space/tab in end of line local tab f:write(string.gsub(mao, "(%s)", function(c) if tab then tab = nil return "\t" else tab = 1 return " " end end)) -- test crazy end of line conventions local eol = { "\r\n", "\r", "\n", "\n\r" } local which = 0 f:write(string.gsub(mao, "(\n)", function(c) which = which + 1 if which > 4 then which = 1 end return eol[which] end)) for i = 1, 4 do for j = 1, 4 do f:write(eol[i]) f:write(eol[j]) end end -- try long spaced and tabbed lines f:write("\r\n") for i = 0, 255 do f:write(string.char(9)) end f:write("\r\n") for i = 0, 255 do f:write(' ') end f:write("\r\n") for i = 0, 255 do f:write(string.char(9),' ') end f:write("\r\n") for i = 0, 255 do f:write(' ',string.char(32)) end f:write("\r\n") f:close() end local function cleanup_qptest() os.remove(qptest) os.remove(eqptest) os.remove(dqptest) end -- create test file local function create_b64test() local f = assert(io.open(b64test, "wb")) local t = {} for j = 1, 100 do for i = 1, 100 do t[i] = math.random(0, 255) end f:write(string.char(unpack(t))) end f:close() end local function encode_b64test() local e1 = mime.encode("base64") local e2 = mime.encode("base64") local e3 = mime.encode("base64") local e4 = mime.encode("base64") local sp4 = mime.wrap() local sp3 = mime.wrap(59) local sp2 = mime.wrap("base64", 30) local sp1 = mime.wrap(27) local chain = ltn12.filter.chain(e1, sp1, e2, sp2, e3, sp3, e4, sp4) transform(b64test, eb64test, chain) end local function decode_b64test() local d1 = named(mime.decode("base64"), "d1") local d2 = named(mime.decode("base64"), "d2") local d3 = named(mime.decode("base64"), "d3") local d4 = named(mime.decode("base64"), "d4") local chain = named(ltn12.filter.chain(d1, d2, d3, d4), "chain") transform(eb64test, db64test, chain) end local function cleanup_b64test() os.remove(b64test) os.remove(eb64test) os.remove(db64test) end local function compare_b64test() io.write("testing b64 chained encode: ") compare(b64test, db64test) end local function identity_test() io.write("testing identity: ") local chain = named(ltn12.filter.chain( named(mime.encode("quoted-printable"), "1 eq"), named(mime.encode("base64"), "2 eb"), named(mime.decode("base64"), "3 db"), named(mime.decode("quoted-printable"), "4 dq") ), "chain") transform(b64test, eb64test, chain) compare(b64test, eb64test) os.remove(eb64test) end local function padcheck(original, encoded) local e = (mime.b64(original)) local d = (mime.unb64(encoded)) if e ~= encoded then fail("encoding failed") end if d ~= original then fail("decoding failed") end end local function chunkcheck(original, encoded) local len = string.len(original) for i = 0, len do local a = string.sub(original, 1, i) local b = string.sub(original, i+1) local e, r = mime.b64(a, b) local f = (mime.b64(r)) if (e .. (f or "") ~= encoded) then fail(e .. (f or "")) end end end local function padding_b64test() io.write("testing b64 padding: ") padcheck("a", "YQ==") padcheck("ab", "YWI=") padcheck("abc", "YWJj") padcheck("abcd", "YWJjZA==") padcheck("abcde", "YWJjZGU=") padcheck("abcdef", "YWJjZGVm") padcheck("abcdefg", "YWJjZGVmZw==") padcheck("abcdefgh", "YWJjZGVmZ2g=") padcheck("abcdefghi", "YWJjZGVmZ2hp") padcheck("abcdefghij", "YWJjZGVmZ2hpag==") chunkcheck("abcdefgh", "YWJjZGVmZ2g=") chunkcheck("abcdefghi", "YWJjZGVmZ2hp") chunkcheck("abcdefghij", "YWJjZGVmZ2hpag==") print("ok") end local function test_b64lowlevel() io.write("testing b64 low-level: ") local a, b a, b = mime.b64("", "") assert(a == "" and b == "") a, b = mime.b64(nil, "blablabla") assert(a == nil and b == nil) a, b = mime.b64("", nil) assert(a == nil and b == nil) a, b = mime.unb64("", "") assert(a == "" and b == "") a, b = mime.unb64(nil, "blablabla") assert(a == nil and b == nil) a, b = mime.unb64("", nil) assert(a == nil and b == nil) local binary=string.char(0x00,0x44,0x1D,0x14,0x0F,0xF4,0xDA,0x11,0xA9,0x78,0x00,0x14,0x38,0x50,0x60,0xCE) local encoded = mime.b64(binary) local decoded=mime.unb64(encoded) assert(binary == decoded) print("ok") end local t = socket.gettime() create_b64test() identity_test() encode_b64test() decode_b64test() compare_b64test() cleanup_b64test() padding_b64test() test_b64lowlevel() create_qptest() encode_qptest() decode_qptest() compare_qptest() encode_qptest("binary") decode_qptest() compare_qptest() cleanup_qptest() print(string.format("done in %.2fs", socket.gettime() - t))
mit
zjohn4/PD2-lua-src
core/lib/utils/dev/smoketest/suites/coresmoketesteditorsuite.lua
1
1844
core:module("CoreSmoketestEditorSuite") core:import("CoreClass") core:import("CoreSmoketestCommonSuite") EditorSuite = EditorSuite or class(CoreSmoketestCommonSuite.CommonSuite) function EditorSuite:init() EditorSuite.super.init(self) self:add_step( "load_editor", CoreSmoketestCommonSuite.WaitEventSubstep, CoreSmoketestCommonSuite.WaitEventSubstep.step_arguments(Idstring("game_state_editor")) ) self:add_step( "load_level", CoreSmoketestCommonSuite.CallAndDoneSubstep, CoreSmoketestCommonSuite.CallAndDoneSubstep.step_arguments(callback(self, self, "load_level")) ) --[[ self:add_step( "run_mission_simulation", CoreSmoketestCommonSuite.CallAndWaitEventSubstep, CoreSmoketestCommonSuite.CallAndWaitEventSubstep.step_arguments(callback(self, self, "run_mission_simulation"), Idstring("game_state_ingame")) ) self:add_step( "stop_mission_simulation", CoreSmoketestCommonSuite.CallAndWaitEventSubstep, CoreSmoketestCommonSuite.CallAndWaitEventSubstep.step_arguments(callback(self, self, "run_mission_simulation"), Idstring("game_state_editor")) ) ]] --[[ self:add_step( "environment_editor", CoreSmoketestCommonSuite.CallAndDoneSubstep, CoreSmoketestCommonSuite.CallAndDoneSubstep.step_arguments(callback(self, self, "environment_editor")) ) ]] end function EditorSuite:load_level() managers.editor:load_level(self:get_argument("editor_dir"), self:get_argument("editor_level")) end function EditorSuite:run_mission_simulation() managers.editor:run_simulation_callback(true) -- simulation with mission script end function EditorSuite:stop_mission_simulation() managers.editor:run_simulation_callback(true) -- simulation with mission script end function EditorSuite:environment_editor() managers.toolhub:open("Environment Editor") managers.toolhub:close("Environment Editor") end
gpl-2.0
zjohn4/PD2-lua-src
lib/managers/menu/circleguiobject.lua
1
5000
CircleGuiObject = CircleGuiObject or class() function CircleGuiObject:init( panel, config ) -- config.total, config.current, config.radius --[[local name = config.name or "" local color = config.color or Color.white local layer = config.layer or 0 local visible = config.visible or true local rotation = config.rotation or nil local render_template = config.render_template or nil]] self._panel = panel self._radius = config.radius or 20 self._sides = config.sides or 10 self._total = config.total or 1 config.triangles = self:_create_triangles( config ) -- { Vector3( 0, 0, 0 ), Vector3( 20, 0, 0 ), Vector3( 0, 20, 0 ) } config.w = self._radius * 2 config.h = self._radius * 2 self._circle = self._panel:polygon( config ) -- self._circle:set_size( self._radius * 2, self._radius * 2) -- self._circle:set_debug( true ) --[[ * color * rotation * render_template * blend_mode * convex * triangles * colored_triangles]] -- self._circle = end function CircleGuiObject:_create_triangles( config ) local amount = 360 * (config.current or 1)/(config.total or 1) -- x math.sin( 270 ) -- y math.cos( 270 ) local s = self._radius local triangles = {} local step = 360 / self._sides for i = step, amount, step do local mid = Vector3( self._radius, self._radius, 0 ) table.insert( triangles, mid ) table.insert( triangles, mid + Vector3( math.sin( i ) * self._radius, -math.cos( i ) * self._radius, 0 ) ) table.insert( triangles, mid + Vector3( math.sin( i - step ) * self._radius, -math.cos( i - step ) * self._radius, 0 ) ) end return triangles end function CircleGuiObject:set_current( current ) local triangles = self:_create_triangles( { current = current, total = self._total } ) self._circle:clear() self._circle:add_triangles( triangles ) end function CircleGuiObject:set_position( x, y ) self._circle:set_position( x, y ) end function CircleGuiObject:set_layer( layer ) self._circle:set_layer( layer ) end function CircleGuiObject:layer() return self._circle:layer() end function CircleGuiObject:remove() self._panel:remove( self._circle ) end --------------------------------------------------- CircleBitmapGuiObject = CircleBitmapGuiObject or class() function CircleBitmapGuiObject:init( panel, config ) self._panel = panel self._radius = config.radius or 20 self._sides = config.sides or 64 self._total = config.total or 1 self._size = 128 config.texture_rect = nil -- { 0, 0, self._size, self._size } -- config.texture = config.image or "guis/textures/radialmap" config.texture = config.image or "guis/textures/pd2/hud_progress_active" config.w = self._radius * 2 config.h = self._radius * 2 self._circle = self._panel:bitmap( config ) self._circle:set_render_template( Idstring( "VertexColorTexturedRadial" ) ) self._alpha = self._circle:color().alpha self._circle:set_color( self._circle:color():with_red( 0 ) ) if config.use_bg then local bg_config = deep_clone( config ) bg_config.texture = "guis/textures/pd2/hud_progress_bg" bg_config.layer = bg_config.layer - 1 bg_config.blend_mode = "normal" self._bg_circle = self._panel:bitmap( bg_config ) end end function CircleBitmapGuiObject:radius() return self._radius end function CircleBitmapGuiObject:set_current( current ) local j = math.mod( math.floor( current ), 8 ) local i = math.floor(current/8) -- print( current, j, i ) -- self._circle:set_texture_rect( j * self._size, i * self._size, self._size, self._size ) self._circle:set_color( Color( self._alpha, current, self._circle:color().blue, self._circle:color().green ) ) end function CircleBitmapGuiObject:position() return self._circle:position() end function CircleBitmapGuiObject:set_position( x, y ) self._circle:set_position( x, y ) if self._bg_circle then self._bg_circle:set_position( x, y ) end end function CircleBitmapGuiObject:set_visible( visible ) self._circle:set_visible( visible ) if self._bg_circle then self._bg_circle:set_visible( visible ) end end function CircleBitmapGuiObject:visible() return self._circle:visible() end function CircleBitmapGuiObject:set_alpha( alpha ) self._circle:set_alpha( alpha ) end function CircleBitmapGuiObject:alpha() self._circle:alpha() end function CircleBitmapGuiObject:set_color( color ) self._circle:set_color( color ) end function CircleBitmapGuiObject:color() return self._circle:color() end function CircleBitmapGuiObject:size() return self._circle:size() end function CircleBitmapGuiObject:set_image( texture ) self._circle:set_image( texture ) end function CircleBitmapGuiObject:set_layer( layer ) self._circle:set_layer( layer ) if self._bg_circle then self._bg_circle:set_layer( layer - 1 ) end end function CircleBitmapGuiObject:layer() return self._circle:layer() end function CircleBitmapGuiObject:remove() self._panel:remove( self._circle ) if self._bg_circle then self._panel:remove( self._bg_circle ) end self._panel = nil end
gpl-2.0
zjohn4/PD2-lua-src
core/lib/utils/dev/ews/corepointpickerpanel.lua
1
3958
core:module "CorePointPickerPanel" core:import "CorePointPicker" core:import "CorePointerDraw" core:import "CoreClass" core:import "CoreEvent" core:import "CoreDebug" PointPickerPanel = PointPickerPanel or CoreClass.class() function PointPickerPanel:init(parent_frame, title) assert(managers.viewport) self.__point_picker = CorePointPicker.PointPicker:new(managers.viewport:get_active_vp()) self.__point_picker:connect("EVT_PICKING", CoreEvent.callback(self, self, "_on_picking"), self.__point_picker) self.__point_picker:connect("EVT_FINISHED_PICKING", CoreEvent.callback(self, self, "_on_finished_picking"), self.__point_picker) self.__point_draw = CorePointerDraw.PointerDraw:new(Color("ffffff"), 10) self:_create_panel(parent_frame) end function PointPickerPanel:_create_panel(parent_frame) local panel_sizer = EWS:BoxSizer("HORIZONTAL") self.__panel = EWS:Panel(parent_frame) self.__panel:set_sizer(panel_sizer) self.__picker_button = EWS:ToggleButton(self.__panel, "Pick", "", "NO_BORDER") self.__picker_button:connect("", "EVT_COMMAND_TOGGLEBUTTON_CLICKED", CoreEvent.callback( self, self, "_on_picker_toggle"), "") self.__x_textctrl = EWS:TextCtrl(self.__panel, 0, "", "TE_PROCESS_ENTER,TE_RIGHT") self.__y_textctrl = EWS:TextCtrl(self.__panel, 0, "", "TE_PROCESS_ENTER,TE_RIGHT") self.__z_textctrl = EWS:TextCtrl(self.__panel, 0, "", "TE_PROCESS_ENTER,TE_RIGHT") panel_sizer:add(self.__picker_button, 1, 2, "ALL,EXPAND") panel_sizer:add(EWS:StaticText(self.__panel, "x:"), 0, 4, "ALL,ALIGN_CENTER_VERTICAL,ALIGN_RIGHT") panel_sizer:add(self.__x_textctrl, 1, 2, "ALL,EXPAND,ALIGN_RIGHT") panel_sizer:add(EWS:StaticText(self.__panel, "y:"), 0, 4, "ALL,ALIGN_CENTER_VERTICAL,ALIGN_RIGHT") panel_sizer:add(self.__y_textctrl, 1, 2, "ALL,EXPAND,ALIGN_RIGHT") panel_sizer:add(EWS:StaticText(self.__panel, "z:"), 0, 4, "ALL,ALIGN_CENTER_VERTICAL,ALIGN_RIGHT") panel_sizer:add(self.__z_textctrl, 1, 2, "ALL,EXPAND,ALIGN_RIGHT") end function PointPickerPanel:panel() return self.__panel end function PointPickerPanel:get_value() return self.__current_position end function PointPickerPanel:set_value(vector) self.__current_position = vector self:_set_text(vector) end function PointPickerPanel:update(time, delta_time) if self:_text_ctrl_has_focus() then self.__current_position = Vector3( self.__x_textctrl:get_value(), self.__y_textctrl:get_value(), self.__z_textctrl:get_value() ) self.__draw_position = self.__current_position end self.__point_draw:set_position(self.__draw_position) self.__point_picker:update(time, delta_time) self.__point_draw:update(time, delta_time) end function PointPickerPanel:_text_ctrl_has_focus() return ( EWS:get_window_in_focus() == self.__x_textctrl ) or ( EWS:get_window_in_focus() == self.__y_textctrl ) or ( EWS:get_window_in_focus() == self.__z_textctrl ) end function PointPickerPanel:_set_text(vector) self.__x_textctrl:set_value( string.format('%.3f', vector.x) ) self.__y_textctrl:set_value( string.format('%.3f', vector.y) ) self.__z_textctrl:set_value( string.format('%.3f', vector.z) ) end function PointPickerPanel:_on_picker_toggle() if self.__picker_button:get_value() == false then self.__point_picker:stop_picking() self.__picker_button:set_value(true) else self.__point_picker:start_picking() self.__picker_button:set_value(false) end end function PointPickerPanel:_on_picking(sender, raycast) if raycast then self:_set_text(raycast.position) self.__current_position = raycast.position self.__draw_position = raycast.position else self:set_value( Vector3(0, 0, 0) ) self.__draw_position = nil self.__current_position = nil end end function PointPickerPanel:_on_finished_picking(sender, raycast) if raycast then self.__picker_button:set_value(false) self.__current_position = raycast.position self.__draw_position = nil self:set_value(raycast.position) end end
gpl-2.0
GoogleFrog/Zero-K
scripts/corvamp.lua
9
3396
include "constants.lua" --pieces local base = piece "base" local wingR, wingL, wingtipR, wingtipL = piece("wingr", "wingl", "wingtip1", "wingtip2") local engineR, engineL, thrust1, thrust2, thrust3 = piece("jetr", "jetl", "thrust1", "thrust2", "thrust3") local missR, missL = piece("m1", "m2") local smokePiece = {base, engineL, engineR} --constants --variables local gun = false local RESTORE_DELAY = 250 local FIRE_SLOWDOWN = tonumber(UnitDef.customParams.combat_slowdown) --signals local SIG_Aim = 1 local SIG_RESTORE = 2 ---------------------------------------------------------- local function getState() local state = Spring.GetUnitStates(unitID) return state and state.active end function script.Create() Turn(thrust1, x_axis, -math.rad(90), 1) Turn(thrust2, x_axis, -math.rad(90), 1) end function script.StartMoving() Turn(engineL, z_axis, -1.57, 1) Turn(engineR, z_axis, 1.57, 1) Turn(engineL, y_axis, -1.57, 1) Turn(engineR, y_axis, 1.57, 1) Turn(engineL, x_axis, 0, 1) Turn(engineR, x_axis, 0, 1) end function script.StopMoving() Turn(engineL, z_axis, 0, 1) Turn(engineR, z_axis, 0, 1) Turn(engineL, y_axis, 0, 1) Turn(engineR, y_axis, 0, 1) Turn(engineL, x_axis, 0, 1) Turn(engineR, x_axis, 0, 1) end function script.QueryWeapon(num) if gun then return missR else return missL end end function script.AimFromWeapon(num) return base end function script.AimWeapon(num, heading, pitch) return not (GetUnitValue(COB.CRASHING) == 1) end function script.Shot(num) gun = not gun end local function RestoreAfterDelay() Signal(SIG_RESTORE) SetSignalMask(SIG_RESTORE) if getState() then Turn(engineL, z_axis, -1.2, 1) Turn(engineR, z_axis, 1.2, 1) Turn(engineL, y_axis, -1.2, 1) Turn(engineR, y_axis, 1.2, 1) Turn(engineL, x_axis, 0.6, 1) Turn(engineR, x_axis, 0.6, 1) end Sleep(RESTORE_DELAY) Spring.SetUnitRulesParam(unitID, "selfMoveSpeedChange", 1) -- Don't ask me why this must be called twice for planes, Spring is crazy GG.UpdateUnitAttributes(unitID) GG.UpdateUnitAttributes(unitID) if getState() then script.StartMoving() else script.StopMoving() end end function script.BlockShot(num) if GetUnitValue(CRASHING) == 1 then return true else if Spring.GetUnitRulesParam(unitID, "selfMoveSpeedChange") ~= FIRE_SLOWDOWN then Spring.SetUnitRulesParam(unitID, "selfMoveSpeedChange", FIRE_SLOWDOWN) GG.UpdateUnitAttributes(unitID) end StartThread(RestoreAfterDelay) return false end end function script.Killed(recentDamage, maxHealth) local severity = recentDamage/maxHealth if severity < 0.25 then Explode(base, sfxNone) Explode(wingL, sfxNone) Explode(wingR, sfxNone) return 1 elseif severity < 0.5 or (Spring.GetUnitMoveTypeData(unitID).aircraftState == "crashing") then Explode(base, sfxNone) Explode(engineL, sfxSmoke) Explode(engineR, sfxSmoke) Explode(wingL, sfxNone) Explode(wingR, sfxNone) return 1 elseif severity < 0.75 then Explode(engineL, sfxSmoke + sfxFire + sfxExplode) Explode(engineR, sfxSmoke + sfxFire + sfxExplode) Explode(wingL, sfxFall + sfxSmoke) Explode(wingR, sfxFall + sfxSmoke) return 2 else Explode(base, sfxShatter) Explode(engineL, sfxSmoke + sfxFire + sfxExplode) Explode(engineR, sfxSmoke + sfxFire + sfxExplode) Explode(wingL, sfxSmoke + sfxExplode) Explode(wingR, sfxSmoke + sfxExplode) return 2 end end
gpl-2.0
remakeelectric/luci
modules/luci-base/luasrc/model/firewall.lua
17
10704
-- Copyright 2009 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. local type, pairs, ipairs, table, luci, math = type, pairs, ipairs, table, luci, math local tpl = require "luci.template.parser" local utl = require "luci.util" local uci = require "luci.model.uci" module "luci.model.firewall" local uci_r, uci_s function _valid_id(x) return (x and #x > 0 and x:match("^[a-zA-Z0-9_]+$")) end function _get(c, s, o) return uci_r:get(c, s, o) end function _set(c, s, o, v) if v ~= nil then if type(v) == "boolean" then v = v and "1" or "0" end return uci_r:set(c, s, o, v) else return uci_r:delete(c, s, o) end end function init(cursor) uci_r = cursor or uci_r or uci.cursor() uci_s = uci_r:substate() return _M end function save(self, ...) uci_r:save(...) uci_r:load(...) end function commit(self, ...) uci_r:commit(...) uci_r:load(...) end function get_defaults() return defaults() end function new_zone(self) local name = "newzone" local count = 1 while self:get_zone(name) do count = count + 1 name = "newzone%d" % count end return self:add_zone(name) end function add_zone(self, n) if _valid_id(n) and not self:get_zone(n) then local d = defaults() local z = uci_r:section("firewall", "zone", nil, { name = n, network = " ", input = d:input() or "DROP", forward = d:forward() or "DROP", output = d:output() or "DROP" }) return z and zone(z) end end function get_zone(self, n) if uci_r:get("firewall", n) == "zone" then return zone(n) else local z uci_r:foreach("firewall", "zone", function(s) if n and s.name == n then z = s['.name'] return false end end) return z and zone(z) end end function get_zones(self) local zones = { } local znl = { } uci_r:foreach("firewall", "zone", function(s) if s.name then znl[s.name] = zone(s['.name']) end end) local z for z in utl.kspairs(znl) do zones[#zones+1] = znl[z] end return zones end function get_zone_by_network(self, net) local z uci_r:foreach("firewall", "zone", function(s) if s.name and net then local n for n in utl.imatch(s.network or s.name) do if n == net then z = s['.name'] return false end end end end) return z and zone(z) end function del_zone(self, n) local r = false if uci_r:get("firewall", n) == "zone" then local z = uci_r:get("firewall", n, "name") r = uci_r:delete("firewall", n) n = z else uci_r:foreach("firewall", "zone", function(s) if n and s.name == n then r = uci_r:delete("firewall", s['.name']) return false end end) end if r then uci_r:foreach("firewall", "rule", function(s) if s.src == n or s.dest == n then uci_r:delete("firewall", s['.name']) end end) uci_r:foreach("firewall", "redirect", function(s) if s.src == n or s.dest == n then uci_r:delete("firewall", s['.name']) end end) uci_r:foreach("firewall", "forwarding", function(s) if s.src == n or s.dest == n then uci_r:delete("firewall", s['.name']) end end) end return r end function rename_zone(self, old, new) local r = false if _valid_id(new) and not self:get_zone(new) then uci_r:foreach("firewall", "zone", function(s) if old and s.name == old then if not s.network then uci_r:set("firewall", s['.name'], "network", old) end uci_r:set("firewall", s['.name'], "name", new) r = true return false end end) if r then uci_r:foreach("firewall", "rule", function(s) if s.src == old then uci_r:set("firewall", s['.name'], "src", new) end if s.dest == old then uci_r:set("firewall", s['.name'], "dest", new) end end) uci_r:foreach("firewall", "redirect", function(s) if s.src == old then uci_r:set("firewall", s['.name'], "src", new) end if s.dest == old then uci_r:set("firewall", s['.name'], "dest", new) end end) uci_r:foreach("firewall", "forwarding", function(s) if s.src == old then uci_r:set("firewall", s['.name'], "src", new) end if s.dest == old then uci_r:set("firewall", s['.name'], "dest", new) end end) end end return r end function del_network(self, net) local z if net then for _, z in ipairs(self:get_zones()) do z:del_network(net) end end end defaults = utl.class() function defaults.__init__(self) uci_r:foreach("firewall", "defaults", function(s) self.sid = s['.name'] return false end) self.sid = self.sid or uci_r:section("firewall", "defaults", nil, { }) end function defaults.get(self, opt) return _get("firewall", self.sid, opt) end function defaults.set(self, opt, val) return _set("firewall", self.sid, opt, val) end function defaults.syn_flood(self) return (self:get("syn_flood") == "1") end function defaults.drop_invalid(self) return (self:get("drop_invalid") == "1") end function defaults.input(self) return self:get("input") or "DROP" end function defaults.forward(self) return self:get("forward") or "DROP" end function defaults.output(self) return self:get("output") or "DROP" end zone = utl.class() function zone.__init__(self, z) if uci_r:get("firewall", z) == "zone" then self.sid = z self.data = uci_r:get_all("firewall", z) else uci_r:foreach("firewall", "zone", function(s) if s.name == z then self.sid = s['.name'] self.data = s return false end end) end end function zone.get(self, opt) return _get("firewall", self.sid, opt) end function zone.set(self, opt, val) return _set("firewall", self.sid, opt, val) end function zone.masq(self) return (self:get("masq") == "1") end function zone.name(self) return self:get("name") end function zone.network(self) return self:get("network") end function zone.input(self) return self:get("input") or defaults():input() or "DROP" end function zone.forward(self) return self:get("forward") or defaults():forward() or "DROP" end function zone.output(self) return self:get("output") or defaults():output() or "DROP" end function zone.add_network(self, net) if uci_r:get("network", net) == "interface" then local nets = { } local n for n in utl.imatch(self:get("network") or self:get("name")) do if n ~= net then nets[#nets+1] = n end end nets[#nets+1] = net _M:del_network(net) self:set("network", table.concat(nets, " ")) end end function zone.del_network(self, net) local nets = { } local n for n in utl.imatch(self:get("network") or self:get("name")) do if n ~= net then nets[#nets+1] = n end end if #nets > 0 then self:set("network", table.concat(nets, " ")) else self:set("network", " ") end end function zone.get_networks(self) local nets = { } local n for n in utl.imatch(self:get("network") or self:get("name")) do nets[#nets+1] = n end return nets end function zone.clear_networks(self) self:set("network", " ") end function zone.get_forwardings_by(self, what) local name = self:name() local forwards = { } uci_r:foreach("firewall", "forwarding", function(s) if s.src and s.dest and s[what] == name then forwards[#forwards+1] = forwarding(s['.name']) end end) return forwards end function zone.add_forwarding_to(self, dest) local exist, forward for _, forward in ipairs(self:get_forwardings_by('src')) do if forward:dest() == dest then exist = true break end end if not exist and dest ~= self:name() and _valid_id(dest) then local s = uci_r:section("firewall", "forwarding", nil, { src = self:name(), dest = dest }) return s and forwarding(s) end end function zone.add_forwarding_from(self, src) local exist, forward for _, forward in ipairs(self:get_forwardings_by('dest')) do if forward:src() == src then exist = true break end end if not exist and src ~= self:name() and _valid_id(src) then local s = uci_r:section("firewall", "forwarding", nil, { src = src, dest = self:name() }) return s and forwarding(s) end end function zone.del_forwardings_by(self, what) local name = self:name() uci_r:delete_all("firewall", "forwarding", function(s) return (s.src and s.dest and s[what] == name) end) end function zone.add_redirect(self, options) options = options or { } options.src = self:name() local s = uci_r:section("firewall", "redirect", nil, options) return s and redirect(s) end function zone.add_rule(self, options) options = options or { } options.src = self:name() local s = uci_r:section("firewall", "rule", nil, options) return s and rule(s) end function zone.get_color(self) if self and self:name() == "lan" then return "#90f090" elseif self and self:name() == "wan" then return "#f09090" elseif self then math.randomseed(tpl.hash(self:name())) local r = math.random(128) local g = math.random(128) local min = 0 local max = 128 if ( r + g ) < 128 then min = 128 - r - g else max = 255 - r - g end local b = min + math.floor( math.random() * ( max - min ) ) return "#%02x%02x%02x" % { 0xFF - r, 0xFF - g, 0xFF - b } else return "#eeeeee" end end forwarding = utl.class() function forwarding.__init__(self, f) self.sid = f end function forwarding.src(self) return uci_r:get("firewall", self.sid, "src") end function forwarding.dest(self) return uci_r:get("firewall", self.sid, "dest") end function forwarding.src_zone(self) local z = zone(self:src()) return z.sid and z end function forwarding.dest_zone(self) local z = zone(self:dest()) return z.sid and z end rule = utl.class() function rule.__init__(self, f) self.sid = f end function rule.get(self, opt) return _get("firewall", self.sid, opt) end function rule.set(self, opt, val) return _set("firewall", self.sid, opt, val) end function rule.src(self) return uci_r:get("firewall", self.sid, "src") end function rule.dest(self) return uci_r:get("firewall", self.sid, "dest") end function rule.src_zone(self) return zone(self:src()) end function rule.dest_zone(self) return zone(self:dest()) end redirect = utl.class() function redirect.__init__(self, f) self.sid = f end function redirect.get(self, opt) return _get("firewall", self.sid, opt) end function redirect.set(self, opt, val) return _set("firewall", self.sid, opt, val) end function redirect.src(self) return uci_r:get("firewall", self.sid, "src") end function redirect.dest(self) return uci_r:get("firewall", self.sid, "dest") end function redirect.src_zone(self) return zone(self:src()) end function redirect.dest_zone(self) return zone(self:dest()) end
apache-2.0
linxiulei/sysdig
userspace/sysdig/chisels/topcontainers_cpu.lua
16
2796
--[[ Copyright (C) 2013-2015 Draios inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. --]] -- Chisel description description = "Show the top containers defined by the highest CPU utilization." short_description = "Top containers by CPU usage" category = "CPU Usage" -- Chisel argument list args = {} require "common" terminal = require "ansiterminal" grtable = {} islive = false fkeys = {} vizinfo = { key_fld = {"container.name"}, key_desc = {"container.name"}, value_fld = "thread.exectime", value_desc = "CPU%", value_units = "timepct", top_number = 10, output_format = "normal" } -- Initialization callback function on_init() -- Request the fields we need for i, name in ipairs(vizinfo.key_fld) do fkeys[i] = chisel.request_field(name) end -- Request the fields we need fvalue = chisel.request_field(vizinfo.value_fld) fcpu = chisel.request_field("thread.cpu") chisel.set_filter("evt.type=procinfo") return true end -- Final chisel initialization function on_capture_start() islive = sysdig.is_live() vizinfo.output_format = sysdig.get_output_format() if islive then chisel.set_interval_s(1) if vizinfo.output_format ~= "json" then terminal.clearscreen() terminal.hidecursor() end end return true end -- Event parsing callback function on_event() local key = nil local kv = nil for i, fld in ipairs(fkeys) do kv = evt.field(fld) if kv == nil then return end if key == nil then key = kv else key = key .. "\001\001" .. evt.field(fld) end end local cpu = evt.field(fcpu) if grtable[key] == nil then grtable[key] = cpu * 10000000 else grtable[key] = grtable[key] + (cpu * 10000000) end return true end -- Periodic timeout callback function on_interval(ts_s, ts_ns, delta) if vizinfo.output_format ~= "json" then terminal.clearscreen() terminal.moveto(0, 0) end print_sorted_table(grtable, ts_s, 0, delta, vizinfo) -- Clear the table grtable = {} return true end -- Called by the engine at the end of the capture (Ctrl-C) function on_capture_end(ts_s, ts_ns, delta) if islive and vizinfo.output_format ~= "json" then terminal.clearscreen() terminal.moveto(0 ,0) terminal.showcursor() return true end print_sorted_table(grtable, ts_s, 0, delta, vizinfo) return true end
gpl-2.0
Ninjistix/darkstar
scripts/zones/Waughroon_Shrine/npcs/Burning_Circle.lua
8
2249
----------------------------------- -- Area: Waughroon Shrine -- NPC: Burning Circle -- Waughroon Shrine Burning Circle -- !pos -345 104 -260 144 ------------------------------------- package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil; ------------------------------------- require("scripts/globals/bcnm"); require("scripts/globals/titles"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/globals/missions"); require("scripts/zones/Waughroon_Shrine/TextIDs"); ---- 0: Rank 2 Final Mission for Bastok "The Emissary" and Sandy "Journey Abroad" ---- 1: Worms Turn ---- 2: Grimshell Shocktroopers ---- 3: On my Way ---- 4: Thief in Norg ---- 5: 3, 2, 1 ---- 6: Shattering Stars (RDM) ---- 7: Shattering Stars (THF) ---- 8: Shattering Stars (BST) ---- 9: Birds of the feather ---- 10: Crustacean Conundrum ---- 11: Grove Gardians ---- 12: The Hills are alive ---- 13: Royal Jelly ---- 14: The Final Bout ---- 15: Up in arms ---- 16: Copy Cat ---- 17: Operation Desert Swarm ---- 18: Prehistoric Pigeons ---- 19: The Palborough Project ---- 20: Shell Shocked ---- 21: Beyond infinity ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (TradeBCNM(player,player:getZoneID(),trade,npc)) then return; end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (EventTriggerBCNM(player,npc)) then return; end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("onUpdate CSID: %u",csid); -- printf("onUpdate RESULT: %u",option); if (EventUpdateBCNM(player,csid,option)) then return; end end; ----------------------------------- -- onEventFinish Action ----------------------------------- function onEventFinish(player,csid,option) -- printf("onFinish CSID: %u",csid); -- printf("onFinish RESULT: %u",option); if (EventFinishBCNM(player,csid,option)) then return; end end;
gpl-3.0
kbullaughey/lstm-play
toys/lstm/model-1_layer-variable-one.lua
1
6992
#!/usr/bin/env th toy = require '../toy/toy' check = require '../scripts/check_gradients' require 'lstm' -- Allow for command-line control over the seed and number of examples. cmd = torch.CmdLine() cmd:text() cmd:text('Train single-layer LSTM model using toy data.') cmd:text() cmd:text('Options') cmd:option('-seed',0,'initial random seed (defaults to current time)') cmd:option('-hidden',16,'hidden state size') cmd:option('-batch',16,'batch size') cmd:option('-rate',0.05,'learn rate') cmd:option('-iter',5,'max number of iterations of SGD') cmd:option('-data','../toy/variable_width_2-4-direct.t7','simulated data tensor file') cmd:text() -- parse input params params = cmd:parse(arg) -- Make it reproducible torch.manualSeed(params.seed) -- Read in the toy model data. This is a Tensor with five columns, the first -- four are inputs and the last is the targets. d = torch.load(params.data) N = d:size(1) maxLength = 4 -- Separate data into inputs (x) and targets (y) x = d:narrow(2, 1, maxLength):clone() y = d:narrow(2, maxLength+1, 1):clone() lengths = d:narrow(2, 2*maxLength+1, 1):clone():view(-1) -- Decide on the train/test split test_frac = 0.3 test_n = torch.floor(N * test_frac) train_n = N - test_n -- Extract out the training data x_train = x:narrow(1, 1, train_n) y_train = y:narrow(1, 1, train_n) lengths_train = lengths:narrow(1, 1, train_n) -- Extract out the test data x_test = x:narrow(1, train_n+1, test_n) y_test = y:narrow(1, train_n+1, test_n) lengths_test = lengths:narrow(1, train_n+1, test_n) -- This method returns a vector containing L ones with the rest zeros. local mapRow = function(L) v = torch.zeros(maxLength) v:narrow(1,1,L):fill(1) return v:view(1,-1) end -- We use mapRow to make a mask matrix so we can zero out inputs that -- are not really part of each example. mask_train = nn.JoinTable(1):forward(tablex.map(mapRow, lengths_train:totable())) mask_test = nn.JoinTable(1):forward(tablex.map(mapRow, lengths_test:totable())) -- Normalize the training inputs numCells = mask_train:sum() norm_mean = x_train:sum() / numCells norm_std = math.sqrt((x_train - norm_mean):cmul(mask_train):pow(2):sum() / numCells) x_train_n = (x_train - norm_mean) / norm_std -- Normalize the test inputs according to the training data normalization -- parameters. x_test_n = (x_test - norm_mean) / norm_std x_train_n:cmul(mask_train) x_test_n:cmul(mask_test) print("x_train_n:sum(): " .. x_train_n:sum()) print("y_train:sum(): " .. y_train:sum()) print("x_test_n:sum(): " .. x_test_n:sum()) print("y_test:sum(): " .. y_test:sum()) function makeDataset(x, y, lengths, hiddenSize, batchSize, maxLength) dataset={batchSize=batchSize}; local n = torch.floor(x:size(1) / batchSize) -- The nn SGD trainer will need a data structure whereby examples can be accessed -- via the index operator, [], and which has a size() method. function dataset:size() return n end for i=1,dataset:size() do local start = (i-1)*batchSize + 1 local inputs = torch.reshape(x:narrow(1,start,batchSize), batchSize, maxLength, 1) local targets = torch.reshape(y:narrow(1,start,batchSize), batchSize, 1, 1) -- Encode lengths using a one-hot per row strategy local batchLengths = torch.zeros(batchSize,maxLength) for b=1,batchSize do batchLengths[b][lengths:narrow(1,start,batchSize)[b]] = 1 end -- Add a zero matrix to every example for the initial h state dataset[i] = {{inputs,batchLengths}, targets} end return dataset end -- Train the model, based on nn.StochasticGradient function lstmTrainer(module, criterion) local trainer = {} trainer.learningRate = 0.01 trainer.learningRateDecay = 0 trainer.maxIteration = 25 trainer.module = module trainer.criterion = criterion trainer.verbose = true function trainer:train(dataset) local iteration = 1 local currentLearningRate = self.learningRate local module = self.module local criterion = self.criterion local shuffledIndices = torch.randperm(dataset:size(), 'torch.LongTensor') local par = module.par local gradPar = module.gradPar par:uniform(-0.02, 0.02) while true do local currentError = 0 local batches = 0 for t = 1,dataset:size() do local example = dataset[shuffledIndices[t]] local input = example[1] local target = example[2] gradPar:zero() -- Perform forward propagation on both the lstm to compute the predictions -- and on the criterion to compute the error. module:forward(input) criterion:forward(module.output, target) -- Perform back propagation criterion:backward(module.output, target) module:backward(input, criterion.gradInput) currentError = currentError + criterion.output par:add(-self.learningRate, gradPar) batches = batches + 1 if t % 1000 == 0 then print ("current partial error = " .. currentError / batches) end end currentError = currentError / dataset:size() if self.hookIteration then self.hookIteration(self, iteration, currentError) end iteration = iteration + 1 currentLearningRate = self.learningRate / (1 + iteration * self.learningRateDecay) if self.maxIteration > 0 and iteration > self.maxIteration then print("# you have reached the maximum number of iterations") print("# training error = " .. currentError) break end end end return trainer end function averageError(d) local err = 0 for i=1,d:size() do err = err + criterion:forward(net:forward(d[i][1]), d[i][2]) end return err / d:size() end trainingDataset = makeDataset(x_train_n, y_train, lengths_train, params.hidden, params.batch, maxLength) testingDataset = makeDataset(x_test_n, y_test, lengths_test, params.hidden, params.batch, maxLength) chainIn = nn.Identity()() chainMod = lstm.MemoryChain(1, {params.hidden}, maxLength) chainOut = chainMod(chainIn) predicted = nn.Linear(params.hidden,1)(chainOut) net = nn.gModule({chainIn},{predicted}) net.par, net.gradPar = net:getParameters() -- Need to reenable sharing after getParameters(), which broke my sharing. net.par, net.gradPar = net:getParameters() chainMod:setupSharing() -- Use least-squares loss function and SGD. criterion = nn.MSECriterion() net.par:uniform(-0.02, 0.02) torch.save("test_par", net.par) net:zeroGradParameters() net:forward(trainingDataset[1][1]) criterion:forward(net.output, trainingDataset[1][2]) criterion:backward(net.output, trainingDataset[1][2]) net:backward(trainingDataset[1][1], criterion.gradInput) print("forward sum: " .. net.output:sum()) print("object: " .. criterion.output) print("objective grad sum: " .. criterion.gradInput:sum()) print("backward sum[1]: " .. net.gradInput[1]:sum()) print("backward sum[2]: " .. net.gradInput[2]:sum()) print("par sum: " .. net.par:sum()) print("gradPar sum: " .. net.gradPar:sum()) -- END
mit
Ninjistix/darkstar
scripts/globals/weaponskills/blade_retsu.lua
3
2053
----------------------------------- -- Blade Retsu -- Katana weapon skill -- Skill Level: 30 -- Delivers a two-hit attack. Paralyzes enemy. Duration of paralysis varies with TP. -- Proc rate of Paralyze seems to be based on your level in comparison to the targets level. The higher level you are compared to your target, it will be Paralyzed more often. -- Will stack with Sneak Attack. -- Aligned with the Soil Gorget. -- Aligned with the Soil Belt. -- Element: None -- Modifiers: STR:20% ; DEX:20% -- 100%TP 200%TP 300%TP -- 1.00 1.00 1.00 ----------------------------------- require("scripts/globals/status"); require("scripts/globals/settings"); require("scripts/globals/weaponskills"); ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {}; params.numHits = 2; params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1; params.str_wsc = 0.2; params.dex_wsc = 0.2; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.dex_wsc = 0.6; end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params); if (damage > 0 and target:hasStatusEffect(EFFECT_PARALYSIS) == false) then local duration = (tp/1000 * 30) * applyResistanceAddEffect(player,target,ELE_ICE,0); -- paralyze proc based on lvl difference local power = 30 + (player:getMainLvl() - target:getMainLvl())*3; if (power > 35) then power = 35; elseif (power < 5) then power = 5; end target:addStatusEffect(EFFECT_PARALYSIS, power, 0, duration); end return tpHits, extraHits, criticalHit, damage; end
gpl-3.0
galtek/c4pr-maltrato
App_WIP/utility.lua
1
1163
local m = {} function m.print_r ( t ) local print_r_cache={} local function sub_print_r(t,indent) if (print_r_cache[tostring(t)]) then print(indent.."*"..tostring(t)) else print_r_cache[tostring(t)]=true if (type(t)=="table") then for pos,val in pairs(t) do if (type(val)=="table") then print(indent.."["..pos.."] => "..tostring(t).." {") sub_print_r(val,indent..string.rep(" ",string.len(pos)+8)) print(indent..string.rep(" ",string.len(pos)+6).."}") elseif (type(val)=="string") then print(indent.."["..pos..'] => "'..val..'"') else print(indent.."["..pos.."] => "..tostring(val)) end end else print(indent..tostring(t)) end end end if (type(t)=="table") then print(tostring(t).." {") sub_print_r(t," ") print("}") else sub_print_r(t," ") end print() end return m
gpl-2.0
Ninjistix/darkstar
scripts/zones/Buburimu_Peninsula/npcs/Cavernous_Maw.lua
4
1555
----------------------------------- -- Area: Buburimu Peninsula -- NPC: Cavernous Maw -- !pos -334 -24 52 -- Teleports Players to Abyssea - Attohwa ----------------------------------- package.loaded["scripts/zones/Buburimu_Peninsula/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/globals/abyssea"); require("scripts/zones/Buburimu_Peninsula/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) if (ENABLE_ABYSSEA == 1 and player:getMainLvl() >= 30) then local HasStone = getTravStonesTotal(player); if (HasStone >= 1 and player:getQuestStatus(ABYSSEA, DAWN_OF_DEATH) == QUEST_ACCEPTED and player:getQuestStatus(ABYSSEA, A_FLUTTERY_FIEND) == QUEST_AVAILABLE) then player:startEvent(62); else player:startEvent(61,0,1); -- No param = no entry. end else player:messageSpecial(NOTHING_HAPPENS); end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 62) then player:addQuest(ABYSSEA, A_FLUTTERY_FIEND); elseif (csid == 63) then -- Killed Itzpapalotl elseif (csid == 61 and option == 1) then player:setPos(-140, 20, -181, 131, 215); end end;
gpl-3.0
chroteus/clay
misc/msgBox.lua
1
2563
local PADDING = 5 msgBox = { x = PADDING, y = PADDING, width = 350, height = 120, headSize = 18, bodySize = 16, } local Msg = class("Msg") function Msg:initialize(str) self.str = str self.x = PADDING if love.graphics.getFont():getWidth(self.str) > msgBox.width then -- double-line self.y = msgBox.y + msgBox.height - msgBox.bodySize*2 - PADDING*3 self.dbline = true else -- single-line self.y = msgBox.y + msgBox.height - msgBox.bodySize - PADDING*2.5 end end function Msg:draw(x,y) if self.y > PADDING then love.graphics.printf(self.str, x + self.x, y + self.y, msgBox.width, "left") end end function msgBox:reset() self.x = PADDING self.y = PADDING self.width = 350 self.height = 120 end msgBox.list = {} function msgBox:add(str) local function slide(amount) for _,m in pairs(msgBox.list) do Timer.tween(0.3, m, {y = m.y + amount}, "out-quad") end end if love.graphics.getFont():getWidth(str) > self.width then slide(-40) else slide(-20) end table.insert(self.list, Msg(str)) for k,msg in pairs(msgBox.list) do if msg.y < PADDING then table.remove(msgBox.list, k) end end end function msgBox:update(dt) if venus.current ~= battle then if checkCollision(msgBox.x,msgBox.y,msgBox.width,msgBox.height, the.mouse.x,the.mouse.y,1,1) then if msgBox.x+msgBox.width+PADDING == the.screen.width then msgBox.x = PADDING else msgBox.x = the.screen.width - msgBox.width - PADDING end end end end function msgBox:draw(x,y) local x = x or self.x local y = y or self.y love.graphics.setColor(guiColors.bg) love.graphics.rectangle("fill", x,y, msgBox.width, msgBox.height) love.graphics.setColor(guiColors.fg) love.graphics.rectangle("line", x,y, msgBox.width, msgBox.height) for i,msg in ipairs(msgBox.list) do msg:draw(x,y) end love.graphics.setColor(guiColors.bg[1], guiColors.bg[2], guiColors.bg[3], 255) love.graphics.rectangle("fill", x,y, msgBox.width, gameFont[self.headSize]:getHeight()+PADDING*2) love.graphics.setColor(guiColors.fg) love.graphics.rectangle("line", x,y, msgBox.width, gameFont[self.headSize]:getHeight()+PADDING*2) love.graphics.setFont(gameFont[self.headSize]) love.graphics.printf("Global News", x+PADDING, y+PADDING, msgBox.width-PADDING, "left") love.graphics.setFont(gameFont[self.bodySize]) love.graphics.setColor(255,255,255) end
gpl-2.0
Ninjistix/darkstar
scripts/zones/Abyssea-Grauberg/npcs/Dominion_Tactician.lua
5
4326
----------------------------------- -- Area: Abyssea - Grauberg -- NPC: Dominion Tactician -- ----------------------------------- package.loaded["scripts/zones/Abyssea-Grauberg/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/abyssea"); require("scripts/zones/Abyssea-Grauberg/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local DM = player:getDominionNotes(); local Trophies = 0; -- Max all Trophy = 4294967295 sort out its bit mask later. player:startEvent(120, DM, 0, 0, 0, 0, Trophies); end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); local Price = 0; local TempItem = false; local ItemID = 0; local aug1 = 0; local aug2 = 0; local aug3 = 0; local aug4 = 0; local a1 = 0; local a2 = 0; local a3 = 0; local a4 = 0; local v1 = 0; local v2 = 0; local v3 = 0; local v4 = 0; ----------------------------------- -- Spending Dominion Notes if (option == 257) then -- Unkai Domaru Price = 1500; ItemID = 12039; elseif (option == 258) then -- Petrify Screen Price = 300; TempItem = true; ItemID = 5876; elseif (option == 259) then -- Augmented Yataghan Price = 2500; ItemID = 16485; -- Work out augment selection via math.random -- (see Lower Jeuno Tenshodo Coffer script) elseif (option == 513) then -- Inga Ningi Price = 1500; ItemID = 12040; elseif (option == 514) then -- Terror Screen Price = 300; TempItem = true; ItemID = 5877; elseif (option == 515) then -- Augmented Doom Tabar Price = 2500; ItemID = 16660; -- Aug crap here elseif (option == 769) then -- Lancer's Plackart Price = 1500; ItemID = 12041; elseif (option == 770) then -- Amnesia Screen Price = 300; TempItem = true; ItemID = 5878; elseif (option == 771) then -- Augmented Yukitsugu Price = 2500; ItemID = 16971; -- Aug crap here elseif (option == 1025) then -- Caller's Doublet Price = 1500; ItemID = 12042; elseif (option == 1026) then -- Doom Screen Price = 300; TempItem = true; ItemID = 5879; elseif (option == 1281) then -- Mavi Mintan Price = 1500; ItemID = 12043; elseif (option == 1282) then -- Poison Screen Price = 300; TempItem = true; ItemID = 5880; elseif (option == 1537) then -- Navarch's Frac Price = 1500; ItemID = 12044; elseif (option == 1793) then -- Cirque Farsetto Price = 1500; ItemID = 12045; elseif (option == 2049) then -- Charis Casaque Price = 1500; ItemID = 12046; elseif (option == 2305) then -- Savant's Gown Price = 1500; ItemID = 12047; elseif (option == 2561) then -- Incredescent Shade Price = 300; ItemID = 3295; elseif (option == 2817) then -- Decredescent Shade Price = 300; ItemID = 3296; end if (option > 256 and option < 2818) then if (player:getDominionNotes() > Price) then if (TempItem == true) then if (player:addTempItem(ItemID,1)) then player:delCurrency("dominion_note",Price); player:messageSpecial(ITEM_OBTAINED,ItemID); else player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,ItemID); end else if (player:addItem(ItemID,1,a1,v1,a2,v2,a3,v3,a4,v4)) then player:delCurrency("dominion_note",Price); player:messageSpecial(ITEM_OBTAINED,ItemID); else player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,ItemID); end end end end ----------------------------------- -- Trophy trades for gear -- if (option == 65796) then -- . -- elseif (option == -- . -- end end;
gpl-3.0
TRex22/hawkthorne-journey
src/nodes/activenpc.lua
1
4512
--MUST READ: -- to use this file do the following -- 1)find and replace each capitalized instance of Activenpc -- with a capitalized version of your node's name -- 2) find and replace each lowercase instance of activenpc -- with a lowercase version of your node's name(this should be the same as the filename) -- 3) start coding ----------------------------------------------- -- Activenpc.lua ----------------------------------------------- local Activenpc = {} Activenpc.__index = Activenpc Activenpc.isActivenpc = true --include necessary files local anim8 = require 'vendor/anim8' local sound = require 'vendor/TEsound' --- -- Creates a new Activenpc object -- @param node the table used to create this -- @param a collider of objects -- @return the Activenpc object created function Activenpc.new(node, collider) --creates a new object local activenpc = {} --sets it to use the functions and variables defined in Activenpc -- if it doesn;t have one by that name setmetatable(activenpc, Activenpc) --stores all the parameters from the tmx file activenpc.node = node --stores parameters from a lua file activenpc.props = require('nodes/activenpcs/' .. node.name) --sets the position from the tmx file activenpc.position = {x = node.x, y = node.y} activenpc.width = node.width activenpc.height = node.height --initialize the node's bounding box activenpc.collider = collider activenpc.bb = collider:addRectangle(0,0,activenpc.props.bb_width,activenpc.props.bb_height) activenpc.bb.node = activenpc activenpc.collider:setPassive(activenpc.bb) --define some offsets for the bounding box that can be used each update cycle activenpc.bb_offset = {x = activenpc.props.bb_offset_x or 0, y = activenpc.props.bb_offset_y or 0} --add more initialization code here if you want activenpc.controls = nil activenpc.state = "default" activenpc.direction = "right" local npcImage = love.graphics.newImage('images/activenpcs/'..node.name..'.png') local g = anim8.newGrid(activenpc.props.width, activenpc.props.height, npcImage:getWidth(), npcImage:getHeight()) activenpc.image = npcImage activenpc.animations = {} for state, data in pairs( activenpc.props.animations ) do activenpc.animations[ state ] = anim8.newAnimation( data[1], g( unpack(data[2]) ), data[3]) end activenpc.lastSoundUpdate = math.huge return activenpc end function Activenpc:enter( previous ) if self.props.enter then self.props.enter(self, previous) end end --- -- Draws the Activenpc to the screen -- @return nil function Activenpc:draw() local anim = self:animation() anim:draw(self.image, self.position.x, self.position.y, 0, (self.direction=="left") and -1 or 1) if self.prompt then self.prompt:draw(self.position.x + 20, self.position.y - 35) end end function Activenpc:keypressed( button, player ) if self.prompt then return self.prompt:keypressed( button ) end if button == "INTERACT" then self.props.onInteract(self, player) end end --- -- Called when the Activenpc begins colliding with another node -- @param node the node you're colliding with -- @param dt ? -- @param mtv_x amount the node must be moved in the x direction to stop colliding -- @param mtv_y amount the node must be moved in the y direction to stop colliding -- @return nil function Activenpc:collide(node, dt, mtv_x, mtv_y) end function Activenpc:animation() return self.animations[self.state] end --- -- Called when the Activenpc finishes colliding with another node -- @return nil function Activenpc:collide_end(node, dt) end --- -- Updates the Activenpc -- dt is the amount of time in seconds since the last update function Activenpc:update(dt) if self.prompt then self.prompt:update(dt) end self:animation():update(dt) self:handleSounds(dt) local x1,y1,x2,y2 = self.bb:bbox() self.bb:moveTo( self.position.x + (x2-x1)/2 + self.bb_offset.x, self.position.y + (y2-y1)/2 + self.bb_offset.y ) end function Activenpc:handleSounds(dt) self.lastSoundUpdate = self.lastSoundUpdate + dt for _,v in pairs(self.props.sounds) do if self.state==v.state and self:animation().position==v.position and self.lastSoundUpdate > 0.5 then sound.playSfx(v.file) self.lastSoundUpdate = 0 end end end return Activenpc
mit
DDDGamer/factorio-dz-softmod
util/Time.lua
1
1867
-- Time Helper Module -- Common Time functions -- @usage local Time = require('util/Time') -- ------------------------------------------------------- -- -- @author Denis Zholob (DDDGamer) -- github: https://github.com/deniszholob/factorio-softmod-pack -- ======================================================= -- Time = { NEW_PLAYER_TIME = 30, -- minutes NEW_PLAYER_GAME_TIME = 8 -- hrs } -- Returns hours converted from game ticks -- @param t - Factorio game tick function Time.tick_to_day(t) return Time.tick_to_hour(t) / 24 end -- Returns hours converted from game ticks -- @param t - Factorio game tick function Time.tick_to_hour(t) return Time.tick_to_sec(t) / 3600 end -- Returns minutes converted from game ticks -- @param t - Factorio game tick function Time.tick_to_min(t) return Time.tick_to_sec(t) / 60 end -- Returns seconds converted from game ticks -- @param t - Factorio game tick function Time.tick_to_sec(t) -- return game.speed * (t / 60) return (t / 60) end -- Returns a time string in h:m:s format -- @param t - Factorio game tick -- @return hms object function Time.tick_to_time_hms(t) local total_sec = Time.tick_to_sec(t) return { h = math.floor(total_sec / 3600), m = math.floor(total_sec % 3600 / 60), s = math.floor(total_sec % 60) } end -- Returns a time object representing time passed in game -- @return hms object function Time.game_time_pased() return Time.tick_to_time_hms(game.tick) end -- Potential griefers are new players mid/late game -- @param player LuaPLayer function Time.new_player_threshold(player) if ( not player.admin and Time.tick_to_hour(game.tick) < Time.NEW_PLAYER_GAME_TIME and Time.tick_to_min(player.online_time) < Time.NEW_PLAYER_TIME ) then return true end return false end return Time
gpl-3.0
Ninjistix/darkstar
scripts/zones/Maze_of_Shakhrami/npcs/_5ia.lua
5
2882
----------------------------------- -- Area: Maze of Shakhrami -- NPC: Strange Apparatus -- !pos 375 20 -259 198 ----------------------------------- package.loaded["scripts/zones/Maze_of_Shakhrami/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Maze_of_Shakhrami/TextIDs"); require("scripts/globals/strangeapparatus"); ----------------------------------- function onTrade(player,npc,trade) local trade = tradeToStrApp(player, trade); if (trade ~= nil) then if ( trade == 1) then -- good trade local drop = player:getLocalVar("strAppDrop"); local dropQty = player:getLocalVar("strAppDropQty"); local docStatus = 0; -- Assistant if (hasStrAppDocStatus(player)) then docStatus = 1; -- Doctor end player:startEvent(55, drop, dropQty, INFINITY_CORE, 0, 0, 0, docStatus, 0); else -- wrong chip, spawn elemental nm spawnElementalNM(player); delStrAppDocStatus(player); player:messageSpecial(SYS_OVERLOAD); player:messageSpecial(YOU_LOST_THE, trade); end else -- Invalid trade, lose doctor status delStrAppDocStatus(player); player:messageSpecial(DEVICE_NOT_WORKING); end end; function onTrigger(player,npc) local docStatus = 0; -- Assistant if (hasStrAppDocStatus(player)) then docStatus = 1; -- Doctor else player:setLocalVar( "strAppPass", 1); end player:startEvent(53, docStatus, 0, INFINITY_CORE, 0, 0, 0, 0, player:getZoneID()); end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u", option); if (csid == 53) then if (hasStrAppDocStatus(player) == false) then local docStatus = 1; -- Assistant if ( option == strAppPass(player)) then -- Good password docStatus = 0; -- Doctor giveStrAppDocStatus(player); end player:updateEvent(docStatus, 0, INFINITY_CORE, 0, 0, 0, 0, 0); end end end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 55) then local drop = player:getLocalVar("strAppDrop"); local dropQty = player:getLocalVar("strAppDropQty"); if (drop ~= 0) then if ( dropQty == 0) then dropQty = 1; end if (player:getFreeSlotsCount() == 0) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,drop); else player:addItem(drop, dropQty); player:messageSpecial(ITEM_OBTAINED,drop); player:setLocalVar("strAppDrop", 0); player:setLocalVar("strAppDropQty", 0); end end end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Port_Bastok/npcs/Oggbi.lua
5
3051
----------------------------------- -- Area: Port Bastok -- NPC: Oggbi -- Starts and Finishes: Ghosts of the Past, The First Meeting -- @zone 236 -- !pos -159 -7 5 ----------------------------------- package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Port_Bastok/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(BASTOK,GHOSTS_OF_THE_PAST) == QUEST_ACCEPTED) then if (trade:hasItemQty(13122,1) and trade:getItemCount() == 1) then -- Trade Miner's Pendant player:startEvent(232); -- Finish Quest "Ghosts of the Past" end end end; function onTrigger(player,npc) ghostsOfThePast = player:getQuestStatus(BASTOK,GHOSTS_OF_THE_PAST); theFirstMeeting = player:getQuestStatus(BASTOK,THE_FIRST_MEETING); mLvl = player:getMainLvl(); mJob = player:getMainJob(); if (ghostsOfThePast == QUEST_AVAILABLE and mJob == 2 and mLvl >= 40) then player:startEvent(231); -- Start Quest "Ghosts of the Past" elseif (ghostsOfThePast == QUEST_COMPLETED and player:needToZone() == false and theFirstMeeting == QUEST_AVAILABLE and mJob == 2 and mLvl >= 50) then player:startEvent(233); -- Start Quest "The First Meeting" elseif (player:hasKeyItem(LETTER_FROM_DALZAKK) and player:hasKeyItem(SANDORIAN_MARTIAL_ARTS_SCROLL)) then player:startEvent(234); -- Finish Quest "The First Meeting" else player:startEvent(230); -- Standard Dialog end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 231) then player:addQuest(BASTOK,GHOSTS_OF_THE_PAST); elseif (csid == 232) then if (player:getFreeSlotsCount() == 0) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,17478); -- Beat Cesti else player:tradeComplete(); player:addItem(17478); player:messageSpecial(ITEM_OBTAINED,17478); -- Beat Cesti player:needToZone(true); player:addFame(BASTOK,AF1_FAME); player:completeQuest(BASTOK,GHOSTS_OF_THE_PAST); end elseif (csid == 233) then player:addQuest(BASTOK,THE_FIRST_MEETING); elseif (csid == 234) then if (player:getFreeSlotsCount() == 0) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,14090); -- Temple Gaiters else player:delKeyItem(LETTER_FROM_DALZAKK); player:delKeyItem(SANDORIAN_MARTIAL_ARTS_SCROLL); player:addItem(14090); player:messageSpecial(ITEM_OBTAINED,14090); -- Temple Gaiters player:addFame(BASTOK,AF2_FAME); player:completeQuest(BASTOK,THE_FIRST_MEETING); end end end;
gpl-3.0
EliasOenal/blobby
data/scripts/hyp014.lua
1
12001
g= -CONST_BALL_GRAVITY pg= -CONST_BLOBBY_GRAVITY v0=14.5 v_p=4.5 pj= pg/2 r1= CONST_BALL_RADIUS h=31.5+19+25 estt=0 p=0.654 s=math.random() function reset() est=0 imp,imp1,imp2=0,0,0 nettime=0 touch=0 esto1=0 esto2=0 esto3=0 esto4=0 esto5=0 esto6=0 phase=0 valid=1 active=1 nettime=0 y1p=posy() end function yb(y,vy,t) return y+(vy-g/10)*t-1/2*g*t^2 end function move(x) if (posx()<x) and (math.abs(posx()-x)>2.26) then right() elseif (posx()>x) and (math.abs(posx()-x)>2.26) then left() end end function tb(y,vy,height,typ) local sgn=0 if (typ==1) then sgn=-1 else sgn=1 end if vy^2/g^2-vy/(5*g)+1/100+2*(y-height)/g<0 then return -1 else return -1/10+vy/g+sgn*math.sqrt( vy^2/g^2-vy/(5*g)+1/100+2*(y-height)/g ) end end function time(t) return 1/5*math.ceil(5*t) end function pos2(x) local x1,x2 x1=4.5*math.ceil((1/4.5)*x) x2=4.5*math.floor((1/4.5)*x) if (x1<0) or (x2<0) then return 0 else if (math.abs(x1-x)<math.abs(x2-x)) then return x1 else return x2 end end end function pos(x) return pos2(x)+(posx()-pos2(posx())) end function yp(t) return 144.5+(14.5+pj/2+pg/10)*t-1/2*(pg-pj)*t^2 end function tp(y) return (14.5+pj/2+pg/10)/(pg-pj)-math.sqrt(((14.5+pj/2+pg/10)/(pg-pj))^2-(y-144.5)/(1/2*(pg-pj))) end function tp2(y1p,v1p) if (y1p>146) then return (v1p/0.88-1/2+math.sqrt((v1p/0.88-1/2)^2-(144.5-y1p)/0.44)) else return 0 end end function time(t) return 1/5*math.ceil(5*t) end -- </Abschnitt 2> function collide(x,y,vx,vy,objx,objy,r2) local t1=time(math.max(tb(y,vy,objy-(r1+r2),1)-0.2,0)) local t2=time(tb(y,vy,objy+(r1+r2),1)+0.2) local t3=time(math.max(tb(y,vy,objy+(r1+r2),2)-0.2,0)) local t4=time(tb(y,vy,objy-(r1+r2),2)+0.2) local t=-1 if (t1<t2) then for testimate=t1,t2,0.2 do if (yb(y,vy,testimate)<=316) and (x+vx*testimate>=400-(31.5+7)) then return -1 end if ( (yb(y,vy,testimate)-objy)^2+(x+vx*testimate-objx)^2 < (r1+r2)^2) then t=testimate break end end end if (t<=0) and (t3<t4) then for testimate=t3,t4,0.2 do if (yb(y,vy,testimate)<=316) and (x+vx*testimate>=400-(31.5+7)) then return -1 end if ( (yb(y,vy,testimate)-objy)^2+(x+vx*testimate-objx)^2 < (r1+r2)^2) then t=testimate break end end end if (t<=0) or (t>150) then t=-1 end return t end function estimate(x,y,vx,vy,height,typ) local collision=1 local tw,tn,ts=0,0,0 local tr,xr,yr,vxr,vyr,n=0,0,0,0,0,0 while(collision==1) do ts=collide(x,y,vx,vy,400,316,7) if (vx>0) then tw=time((768.5-x)/vx) tn=time((361.5-x)/vx) else tw=time((31.5-x)/vx) tn=time((438.5-x)/vx) end local th=time(tb(y,vy,height,typ)) local t=10000 if ((ts>0) and (ts<t)) then t=ts end if (((tn>0) and (tn<t)) and (yb(y,vy,tn)<316)) then t=tn end if ((tw>0) and (tw<t)) then t=tw end if (th>t) then if (ts>0) then tr=tr+t x=x+vx*t y=yb(y,vy,t) vy=vy-g*t xr=x yr=y vxr=vx vyr=vy n=1 collision=0 elseif ((t==tn) or (t==tw)) then tr=tr+t x=x+vx*t y=yb(y,vy,t) vx=-vx vy=vy-g*t collision=1 end else tr=tr+th vxr=vx vyr=vy-g*th xr=x+vx*th yr=yb(y,vy,th) collision=0 end end if (tr<0) then return -1,-1,-1,-1,-1,-1 else return xr,yr,vxr,vyr,tr,n end end function impact(x,y,vx,vy,xpos,ypos,targety,jum,move) local x1,y1,vx1,vy1=0,0,0,0 local x2,y2,vx2,vy2,t2,nn=0,0,0,0,0,0 local xpos1=xpos local ypos1=ypos for t=0,7,0.2 do if (jum==1) then ypos1=yp(tp(ypos)+t) end x1=x+vx*t if (x1<31.5) then x1=2*31.5-x1 end if (x1>368.5) then x1=2*368.5-x1 end y1=yb(y,vy,t) if ((xpos1-x1)^2+(ypos1+19-y1)^2<(31.5+25)^2) then local dx=x1-xpos1 local dy=y1-(ypos1+19) local l=math.sqrt(dx^2+dy^2) vx1=dx/l vy1=dy/l x1=x1+vx1*3 y1=y1+vy1*3 vy1=vy1*13.125 vx1=vx1*13.125 x2,y2,vx2,vy2,t2,nn=estimate(x1,y1,vx1,vy1,targety,2) break end end return x2,y2,x1,y1,vx1,vy1 end function playto(position,delta) if (math.abs(est-esto5)>0.2) then esto5=est imp,impt,impf=0,0,0 x1=0 t=27 typ1=60 typ2=120 if (position<400) then n1=2 n2=-3 elseif (position>600) then n1=-4 n2=-11 else n1=-1 n2=-8 end while (t>=0) do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,_=estimate(x,y,vx,vy,y2f-vy2f/30,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) if (t1f+math.abs(math.ceil((tp2(posy(),vp))))<t2f) and (t2g>1) and (t2f>1) then for x1f=pos(x2f)+n1*4.5,pos(x2f)+n2*4.5,-4.5 do impf,_,xaf,yaf,vxaf,vyaf=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) if (impf>position-delta) and (math.abs(posx()-x1f)/4.5+1<t2f) and (x1f>=0) and (x1f<=360) and (x2f<=365) and (impf<position+delta) then imp=impf x1=x1f y1=y1f t1=t1f x2=x2f y2=y2f t2=t2f vx2=vx2f vy2=vy2f xa=xaf ya=yaf vxa=vxaf vya=vyaf break end if (impf>position+delta) and ((x1f-pos(x2f))/4.5<0) then break end end end if (imp>position-delta) and (imp<position+delta) then break end if (t>15) then t=t-6 else t=t-3 end end t2=t2+1 end if (x1>=0) and (imp>0) then t2=t2-1 move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else if (delta>60) then save() else playto(600,100) end end end function save() if (math.abs(est-esto3)>0.2) then delta=30 esto3=est imp,impt,impf=0,0,0 x1=0 t=33 typ1=60 typ2=120 while (t>=0) do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,_=estimate(x,y,vx,vy,y2f+0.1,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) -- if (y1f<316-h) then break end -- (t1f+math.abs(math.ceil((tp2(posy(),vp))))<t2f) x1f=pos(x2f) if (t2g>1) and (t1f+tp2(posy(),vp)+1<t2f) and (math.abs((x1f-posx())/4.5)<t2f) and (x1f<=360) and (x1f>=0) then impf,_,xaf,yaf,vxaf,vyaf=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) imp=impf x1=x1f y1=y1f t1=t1f x2=x2f y2=y2f t2=t2f vx2=vx2f vy2=vy2f xa=xaf ya=yaf vxa=vxaf vya=vyaf t=-5 end if (t>15) then t=t-6 else t=t-3 end end t2=t2+1 end if (t2>-1) and (x1>=0) and (x1<=360) and (imp>0) then t2=t2-1 move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else move(200) end end function attack(low,high) if (math.abs(est-esto1)>0.2) then h2=900 esto1=est imp,impt,impf=0,0,0 x1=0 t=27 typ1=low--60 typ2=high--120 while (t>=0) do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,_=estimate(x,y,vx,vy,y2f-vy2f/30,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) if (t1f+math.abs(math.ceil((tp2(posy(),vp))))+2<t2f) and (t2g>1) and (t2f>1) then for x1f=pos(x2f)-20*4.5,pos(x2f)-4*4.5,4.5 do impf,_,xaf,yaf,vxaf,vyaf=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) h1=yb(yaf,vyaf,(380-xaf)/vxaf) h2=yb(yaf,vyaf,(420-xaf)/vxaf) height=316+7+31.5 if (impf>432) and (math.abs(posx()-x1f)/4.5+1<t2f) and (x1f>0) and (x2f<361) and (x1f<330) and (h2>height+typ1) and (h1>height+typ1) and (h2<height+typ2) and (h1<height+typ2)then imp=impf x1=x1f y1=y1f t1=t1f x2=x2f y2=y2f t2=t2f vx2=vx2f vy2=vy2f xa=xaf ya=yaf vxa=vxaf vya=vyaf break end if (impf>432) and (h2>height+typ2) then break end end end if (imp>0) then break end if (t>15) then t=t-6 else t=t-3 end end t2=t2+1 end if (x1>0) and (imp>0) then t2=t2-1 move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else playto(600,100) end end function wall() if (math.abs(est-esto4)>0.2) then delta=30 esto4=est imp,impt,impf=0,0,0 x1=0 t2=26 typ1=60 typ2=120 t1=t2 y1=yp(t1) t2g=math.floor(tb(y,vy,y1+h,2)) y2=yb(y,vy,t2g) vy2=vy-g*t2g x2,y2,vx2,vy2,t2,_=estimate(x,y,vx,vy,y2+vy2/30,2) t1=math.floor(tp(y2-h)) y1=yp(t1) x1=pos(x2)-10*4.5 t2=t2+1 end t2=t2-1 move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end end function OnOpponentServe() reset() if (math.abs(pos2(posx())-posx())>1) then move(400) else move(200) end end function OnServe(ballready) reset() if (math.abs(pos2(posx())-posx())>1) then move(400) else -- -10,-5,+8 if (s<0.3) then b=8 elseif (s>=0.3) and (s<0.7) then b=-10 elseif (s>=0.6) and (s<1) then b=-5 end a=198+b*4.5 if (math.abs(posx()-a)<2) then jump() else move(a) end end end function OnGame() s=math.random() yp2=y1p y1p=posy() vp=y1p-yp2 if (math.abs(imp1-imp)>0.1) then imp2=imp1 imp1=imp end esttold=estt netold=netc toucho=touch touch=touches() if (touch<toucho) then p=math.random() pp=math.random() reset() end --phase --0: Spielstop --1: eigenes Feld --2: gegnerisches Feld --3: Ball hängt fest --4: Netzblock --5: Netzblock weiterführen --6: Netzball vorher abfangen x,y,vx,vy=ballx(),bally(),bspeedx(),bspeedy() estt,yestt,vxestt,vyestt,tnet,netc=estimate(x,y,vx,vy,220) if (bally()<140) and (active==1) then active=0 end if (math.abs(esttold-estt)<0.1) then -- Schutz gegen Fehler bei der estimate-Funktion während Netz/Wandkollisionen est=estt end if (active==1) then if (phase==4) and ((est>438.5) or (est<361.5)) then nettime=10 phase=5 elseif (phase==5) and (nettime>0) then nettime=nettime-1 else if (est>438.5) then phase=2 elseif (est<438.5) and (est>361.5) then if (est<400) and (math.abs(bspeedx())<1) then phase=99 wall() else if (yb(y,vy,(31.5-x)/vx)>220) then phase=6 else phase=4 end end else phase=1 end end else phase=0 end if (math.sqrt((ballx()-400)^2+(bally()-316)^2)<(31.5+7)) and (math.sqrt((bspeedx())^2+(bspeedy())^2)<2) then phase=3 end --phase --0: Spielstop --1: eigenes Feld --2: gegnerisches Feld --3: Ball hängt fest --4: Netzblock --5: Netzblock weiterführen --6: Netzball vorher abfangen if (phase==2) then move(200) elseif (phase==1) then if (p<0.5) then if (touch==0) then playto(320,30) elseif(touch==1) then if (p<0.2) then attack(60,120) elseif (p>=0.2) and (p<0.25) then attack(30,60) elseif (p>=0.25) and (p<0.275) then playto(420,20) elseif (p>=0.275) and (p<0.3) then playto(480,40) elseif (p>=0.3) and (p<0.38) then playto(760,40) elseif (p>=0.38) and (p<0.5) then playto(380,20) end elseif (touch==2) then if (p<0.4) then playto(600,100) else wall() end end else if (touch==0) then if (p<0.8) then attack(60,120) elseif (p>=0.8) and (p<0.9) then attack(30,60) elseif (p>=0.9) and (p<1) then playto(760,40) end else playto(600,100) end end elseif (phase==4) then if (tnet<=tp(393)-4) or (nettime>0) then jump() end if (math.abs(posx()-360)/4.5+2<=tnet) then left() else right() end elseif (phase==5) then right() jump() elseif (phase==6) then -- move(200) save() elseif (phase==3) then if (posx()>300) then jump() end right() end if ((x1==0) or (imp==0)) and (phase==1) then move(est) end if ((x1==0) or (imp==0)) and (phase==6) then move(200) end -- debug(0) -- debug(est) -- debug(imp) end
gpl-2.0
blackman1380/antispam
libs/fakeredis.lua
650
40405
local unpack = table.unpack or unpack --- Bit operations local ok,bit if _VERSION == "Lua 5.3" then bit = (load [[ return { band = function(x, y) return x & y end, bor = function(x, y) return x | y end, bxor = function(x, y) return x ~ y end, bnot = function(x) return ~x end, rshift = function(x, n) return x >> n end, lshift = function(x, n) return x << n end, } ]])() else ok,bit = pcall(require,"bit") if not ok then bit = bit32 end end assert(type(bit) == "table", "module for bitops not found") --- default sleep local default_sleep do local ok, mod = pcall(require, "socket") if ok and type(mod) == "table" then default_sleep = mod.sleep else default_sleep = function(n) local t0 = os.clock() while true do local delta = os.clock() - t0 if (delta < 0) or (delta > n) then break end end end end end --- Helpers local xdefv = function(ktype) if ktype == "list" then return {head = 0, tail = 0} elseif ktype == "zset" then return { list = {}, set = {}, } else return {} end end local xgetr = function(self, k, ktype) if self.data[k] then assert( (self.data[k].ktype == ktype), "ERR Operation against a key holding the wrong kind of value" ) assert(self.data[k].value) return self.data[k].value else return xdefv(ktype) end end local xgetw = function(self, k, ktype) if self.data[k] and self.data[k].value then assert( (self.data[k].ktype == ktype), "ERR Operation against a key holding the wrong kind of value" ) else self.data[k] = {ktype = ktype, value = xdefv(ktype)} end return self.data[k].value end local empty = function(self, k) local v, t = self.data[k].value, self.data[k].ktype if t == nil then return true elseif t == "string" then return not v[1] elseif (t == "hash") or (t == "set") then for _,_ in pairs(v) do return false end return true elseif t == "list" then return v.head == v.tail elseif t == "zset" then if #v.list == 0 then for _,_ in pairs(v.set) do error("incoherent") end return true else for _,_ in pairs(v.set) do return(false) end error("incoherent") end else error("unsupported") end end local cleanup = function(self, k) if empty(self, k) then self.data[k] = nil end end local is_integer = function(x) return (type(x) == "number") and (math.floor(x) == x) end local overflows = function(n) return (n > 2^53-1) or (n < -2^53+1) end local is_bounded_integer = function(x) return (is_integer(x) and (not overflows(x))) end local is_finite_number = function(x) return (type(x) == "number") and (x > -math.huge) and (x < math.huge) end local toint = function(x) if type(x) == "string" then x = tonumber(x) end return is_bounded_integer(x) and x or nil end local tofloat = function(x) if type(x) == "number" then return x end if type(x) ~= "string" then return nil end local r = tonumber(x) if r then return r end if x == "inf" or x == "+inf" then return math.huge elseif x == "-inf" then return -math.huge else return nil end end local tostr = function(x) if is_bounded_integer(x) then return string.format("%d", x) else return tostring(x) end end local char_bitcount = function(x) assert( (type(x) == "number") and (math.floor(x) == x) and (x >= 0) and (x < 256) ) local n = 0 while x ~= 0 do x = bit.band(x, x-1) n = n+1 end return n end local chkarg = function(x) if type(x) == "number" then x = tostr(x) end assert(type(x) == "string") return x end local chkargs = function(n, ...) local arg = {...} assert(#arg == n) for i=1,n do arg[i] = chkarg(arg[i]) end return unpack(arg) end local getargs = function(...) local arg = {...} local n = #arg; assert(n > 0) for i=1,n do arg[i] = chkarg(arg[i]) end return arg end local getargs_as_map = function(...) local arg, r = getargs(...), {} assert(#arg%2 == 0) for i=1,#arg,2 do r[arg[i]] = arg[i+1] end return r end local chkargs_wrap = function(f, n) assert( (type(f) == "function") and (type(n) == "number") ) return function(self, ...) return f(self, chkargs(n, ...)) end end local lset_to_list = function(s) local r = {} for v,_ in pairs(s) do r[#r+1] = v end return r end local nkeys = function(x) local r = 0 for _,_ in pairs(x) do r = r + 1 end return r end --- Commands -- keys local del = function(self, ...) local arg = getargs(...) local r = 0 for i=1,#arg do if self.data[arg[i]] then r = r + 1 end self.data[arg[i]] = nil end return r end local exists = function(self, k) return not not self.data[k] end local keys = function(self, pattern) assert(type(pattern) == "string") -- We want to convert the Redis pattern to a Lua pattern. -- Start by escaping dashes *outside* character classes. -- We also need to escape percents here. local t, p, n = {}, 1, #pattern local p1, p2 while true do p1, p2 = pattern:find("%[.+%]", p) if p1 then if p1 > p then t[#t+1] = {true, pattern:sub(p, p1-1)} end t[#t+1] = {false, pattern:sub(p1, p2)} p = p2+1 if p > n then break end else t[#t+1] = {true, pattern:sub(p, n)} break end end for i=1,#t do if t[i][1] then t[i] = t[i][2]:gsub("[%%%-]", "%%%0") else t[i] = t[i][2]:gsub("%%", "%%%%") end end -- Remaining Lua magic chars are: '^$().[]*+?' ; escape them except '*?[]' -- Then convert '\' to '%', '*' to '.*' and '?' to '.'. Leave '[]' as is. -- Wrap in '^$' to enforce bounds. local lp = "^" .. table.concat(t):gsub("[%^%$%(%)%.%+]", "%%%0") :gsub("\\", "%%"):gsub("%*", ".*"):gsub("%?", ".") .. "$" local r = {} for k,_ in pairs(self.data) do if k:match(lp) then r[#r+1] = k end end return r end local _type = function(self, k) return self.data[k] and self.data[k].ktype or "none" end local randomkey = function(self) local ks = lset_to_list(self.data) local n = #ks if n > 0 then return ks[math.random(1, n)] else return nil end end local rename = function(self, k, k2) assert((k ~= k2) and self.data[k]) self.data[k2] = self.data[k] self.data[k] = nil return true end local renamenx = function(self, k, k2) if self.data[k2] then return false else return rename(self, k, k2) end end -- strings local getrange, incrby, set local append = function(self, k, v) local x = xgetw(self, k, "string") x[1] = (x[1] or "") .. v return #x[1] end local bitcount = function(self, k, i1, i2) k = chkarg(k) local s if i1 or i2 then assert(i1 and i2, "ERR syntax error") s = getrange(self, k, i1, i2) else s = xgetr(self, k, "string")[1] or "" end local r, bytes = 0,{s:byte(1, -1)} for i=1,#bytes do r = r + char_bitcount(bytes[i]) end return r end local bitop = function(self, op, k, ...) assert(type(op) == "string") op = op:lower() assert( (op == "and") or (op == "or") or (op == "xor") or (op == "not"), "ERR syntax error" ) k = chkarg(k) local arg = {...} local good_arity = (op == "not") and (#arg == 1) or (#arg > 0) assert(good_arity, "ERR wrong number of arguments for 'bitop' command") local l, vals = 0, {} local s for i=1,#arg do s = xgetr(self, arg[i], "string")[1] or "" if #s > l then l = #s end vals[i] = s end if l == 0 then del(self, k) return 0 end local vector_mt = {__index=function() return 0 end} for i=1,#vals do vals[i] = setmetatable({vals[i]:byte(1, -1)}, vector_mt) end local r = {} if op == "not" then assert(#vals[1] == l) for i=1,l do r[i] = bit.band(bit.bnot(vals[1][i]), 0xff) end else local _op = bit["b" .. op] for i=1,l do local t = {} for j=1,#vals do t[j] = vals[j][i] end r[i] = _op(unpack(t)) end end set(self, k, string.char(unpack(r))) return l end local decr = function(self, k) return incrby(self, k, -1) end local decrby = function(self, k, n) n = toint(n) assert(n, "ERR value is not an integer or out of range") return incrby(self, k, -n) end local get = function(self, k) local x = xgetr(self, k, "string") return x[1] end local getbit = function(self, k, offset) k = chkarg(k) offset = toint(offset) assert( (offset >= 0), "ERR bit offset is not an integer or out of range" ) local bitpos = offset % 8 -- starts at 0 local bytepos = (offset - bitpos) / 8 -- starts at 0 local s = xgetr(self, k, "string")[1] or "" if bytepos >= #s then return 0 end local char = s:sub(bytepos+1, bytepos+1):byte() return bit.band(bit.rshift(char, 7-bitpos), 1) end getrange = function(self, k, i1, i2) k = chkarg(k) i1, i2 = toint(i1), toint(i2) assert(i1 and i2) local x = xgetr(self, k, "string") x = x[1] or "" if i1 >= 0 then i1 = i1 + 1 end if i2 >= 0 then i2 = i2 + 1 end return x:sub(i1, i2) end local getset = function(self, k, v) local r = get(self, k) set(self, k, v) return r end local incr = function(self, k) return incrby(self, k, 1) end incrby = function(self, k, n) k, n = chkarg(k), toint(n) assert(n, "ERR value is not an integer or out of range") local x = xgetw(self, k, "string") local i = toint(x[1] or 0) assert(i, "ERR value is not an integer or out of range") i = i+n assert( (not overflows(i)), "ERR increment or decrement would overflow" ) x[1] = tostr(i) return i end local incrbyfloat = function(self, k, n) k, n = chkarg(k), tofloat(n) assert(n, "ERR value is not a valid float") local x = xgetw(self, k, "string") local i = tofloat(x[1] or 0) assert(i, "ERR value is not a valid float") i = i+n assert( is_finite_number(i), "ERR increment would produce NaN or Infinity" ) x[1] = tostr(i) return i end local mget = function(self, ...) local arg, r = getargs(...), {} for i=1,#arg do r[i] = get(self, arg[i]) end return r end local mset = function(self, ...) local argmap = getargs_as_map(...) for k,v in pairs(argmap) do set(self, k, v) end return true end local msetnx = function(self, ...) local argmap = getargs_as_map(...) for k,_ in pairs(argmap) do if self.data[k] then return false end end for k,v in pairs(argmap) do set(self, k, v) end return true end set = function(self, k, v) self.data[k] = {ktype = "string", value = {v}} return true end local setbit = function(self, k, offset, b) k = chkarg(k) offset, b = toint(offset), toint(b) assert( (offset >= 0), "ERR bit offset is not an integer or out of range" ) assert( (b == 0) or (b == 1), "ERR bit is not an integer or out of range" ) local bitpos = offset % 8 -- starts at 0 local bytepos = (offset - bitpos) / 8 -- starts at 0 local s = xgetr(self, k, "string")[1] or "" local pad = {s} for i=2,bytepos+2-#s do pad[i] = "\0" end s = table.concat(pad) assert(#s >= bytepos+1) local before = s:sub(1, bytepos) local char = s:sub(bytepos+1, bytepos+1):byte() local after = s:sub(bytepos+2, -1) local old = bit.band(bit.rshift(char, 7-bitpos), 1) if b == 1 then char = bit.bor(bit.lshift(1, 7-bitpos), char) else char = bit.band(bit.bnot(bit.lshift(1, 7-bitpos)), char) end local r = before .. string.char(char) .. after set(self, k, r) return old end local setnx = function(self, k, v) if self.data[k] then return false else return set(self, k, v) end end local setrange = function(self, k, i, s) local k, s = chkargs(2, k, s) i = toint(i) assert(i and (i >= 0)) local x = xgetw(self, k, "string") local y = x[1] or "" local ly, ls = #y, #s if i > ly then -- zero padding local t = {} for i=1, i-ly do t[i] = "\0" end y = y .. table.concat(t) .. s else y = y:sub(1, i) .. s .. y:sub(i+ls+1, ly) end x[1] = y return #y end local strlen = function(self, k) local x = xgetr(self, k, "string") return x[1] and #x[1] or 0 end -- hashes local hdel = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local r = 0 local x = xgetw(self, k, "hash") for i=1,#arg do if x[arg[i]] then r = r + 1 end x[arg[i]] = nil end cleanup(self, k) return r end local hget local hexists = function(self, k, k2) return not not hget(self, k, k2) end hget = function(self, k, k2) local x = xgetr(self, k, "hash") return x[k2] end local hgetall = function(self, k) local x = xgetr(self, k, "hash") local r = {} for _k,v in pairs(x) do r[_k] = v end return r end local hincrby = function(self, k, k2, n) k, k2, n = chkarg(k), chkarg(k2), toint(n) assert(n, "ERR value is not an integer or out of range") assert(type(n) == "number") local x = xgetw(self, k, "hash") local i = toint(x[k2] or 0) assert(i, "ERR value is not an integer or out of range") i = i+n assert( (not overflows(i)), "ERR increment or decrement would overflow" ) x[k2] = tostr(i) return i end local hincrbyfloat = function(self, k, k2, n) k, k2, n = chkarg(k), chkarg(k2), tofloat(n) assert(n, "ERR value is not a valid float") local x = xgetw(self, k, "hash") local i = tofloat(x[k2] or 0) assert(i, "ERR value is not a valid float") i = i+n assert( is_finite_number(i), "ERR increment would produce NaN or Infinity" ) x[k2] = tostr(i) return i end local hkeys = function(self, k) local x = xgetr(self, k, "hash") local r = {} for _k,_ in pairs(x) do r[#r+1] = _k end return r end local hlen = function(self, k) local x = xgetr(self, k, "hash") return nkeys(x) end local hmget = function(self, k, k2s) k = chkarg(k) assert((type(k2s) == "table")) local r = {} local x = xgetr(self, k, "hash") for i=1,#k2s do r[i] = x[chkarg(k2s[i])] end return r end local hmset = function(self, k, ...) k = chkarg(k) local arg = {...} if type(arg[1]) == "table" then assert(#arg == 1) local x = xgetw(self, k, "hash") for _k,v in pairs(arg[1]) do x[chkarg(_k)] = chkarg(v) end else assert(#arg % 2 == 0) local x = xgetw(self, k, "hash") local t = getargs(...) for i=1,#t,2 do x[t[i]] = t[i+1] end end return true end local hset = function(self, k, k2, v) local x = xgetw(self, k, "hash") local r = not x[k2] x[k2] = v return r end local hsetnx = function(self, k, k2, v) local x = xgetw(self, k, "hash") if x[k2] == nil then x[k2] = v return true else return false end end local hvals = function(self, k) local x = xgetr(self, k, "hash") local r = {} for _,v in pairs(x) do r[#r+1] = v end return r end -- lists (head = left, tail = right) local _l_real_i = function(x, i) if i < 0 then return x.tail+i+1 else return x.head+i+1 end end local _l_len = function(x) return x.tail - x.head end local _block_for = function(self, timeout) if timeout > 0 then local sleep = self.sleep or default_sleep if type(sleep) == "function" then sleep(timeout) else error("sleep function unavailable", 0) end else error("operation would block", 0) end end local rpoplpush local blpop = function(self, ...) local arg = {...} local timeout = toint(arg[#arg]) arg[#arg] = nil local vs = getargs(...) local x, l, k, v for i=1,#vs do k = vs[i] x = xgetw(self, k, "list") l = _l_len(x) if l > 0 then v = x[x.head+1] if l > 1 then x.head = x.head + 1 x[x.head] = nil else self.data[k] = nil end return {k, v} else self.data[k] = nil end end _block_for(self, timeout) end local brpop = function(self, ...) local arg = {...} local timeout = toint(arg[#arg]) arg[#arg] = nil local vs = getargs(...) local x, l, k, v for i=1,#vs do k = vs[i] x = xgetw(self, k, "list") l = _l_len(x) if l > 0 then v = x[x.tail] if l > 1 then x[x.tail] = nil x.tail = x.tail - 1 else self.data[k] = nil end return {k, v} else self.data[k] = nil end end _block_for(self, timeout) end local brpoplpush = function(self, k1, k2, timeout) k1, k2 = chkargs(2, k1, k2) timeout = toint(timeout) if not self.data[k1] then _block_for(self, timeout) end return rpoplpush(self, k1, k2) end local lindex = function(self, k, i) k = chkarg(k) i = assert(toint(i)) local x = xgetr(self, k, "list") return x[_l_real_i(x, i)] end local linsert = function(self, k, mode, pivot, v) mode = mode:lower() assert((mode == "before") or (mode == "after")) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") local p = nil for i=x.head+1, x.tail do if x[i] == pivot then p = i break end end if not p then return -1 end if mode == "after" then for i=x.head+1, p do x[i-1] = x[i] end x.head = x.head - 1 else for i=x.tail, p, -1 do x[i+1] = x[i] end x.tail = x.tail + 1 end x[p] = v return _l_len(x) end local llen = function(self, k) local x = xgetr(self, k, "list") return _l_len(x) end local lpop = function(self, k) local x = xgetw(self, k, "list") local l, r = _l_len(x), x[x.head+1] if l > 1 then x.head = x.head + 1 x[x.head] = nil else self.data[k] = nil end return r end local lpush = function(self, k, ...) local vs = getargs(...) local x = xgetw(self, k, "list") for i=1,#vs do x[x.head] = vs[i] x.head = x.head - 1 end return _l_len(x) end local lpushx = function(self, k, v) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") x[x.head] = v x.head = x.head - 1 return _l_len(x) end local lrange = function(self, k, i1, i2) k = chkarg(k) i1, i2 = toint(i1), toint(i2) assert(i1 and i2) local x, r = xgetr(self, k, "list"), {} i1 = math.max(_l_real_i(x, i1), x.head+1) i2 = math.min(_l_real_i(x, i2), x.tail) for i=i1,i2 do r[#r+1] = x[i] end return r end local _lrem_i = function(x, p) for i=p,x.tail do x[i] = x[i+1] end x.tail = x.tail - 1 end local _lrem_l = function(x, v, s) assert(v) if not s then s = x.head+1 end for i=s,x.tail do if x[i] == v then _lrem_i(x, i) return i end end return false end local _lrem_r = function(x, v, s) assert(v) if not s then s = x.tail end for i=s,x.head+1,-1 do if x[i] == v then _lrem_i(x, i) return i end end return false end local lrem = function(self, k, count, v) k, v = chkarg(k), chkarg(v) count = assert(toint(count)) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") local n, last = 0, nil local op = (count < 0) and _lrem_r or _lrem_l local limited = (count ~= 0) count = math.abs(count) while true do last = op(x, v, last) if last then n = n+1 if limited then count = count - 1 if count == 0 then break end end else break end end return n end local lset = function(self, k, i, v) k, v = chkarg(k), chkarg(v) i = assert(toint(i)) if not self.data[k] then error("ERR no such key") end local x = xgetw(self, k, "list") local l = _l_len(x) if i >= l or i < -l then error("ERR index out of range") end x[_l_real_i(x, i)] = v return true end local ltrim = function(self, k, i1, i2) k = chkarg(k) i1, i2 = toint(i1), toint(i2) assert(i1 and i2) local x = xgetw(self, k, "list") i1, i2 = _l_real_i(x, i1), _l_real_i(x, i2) for i=x.head+1,i1-1 do x[i] = nil end for i=i2+1,x.tail do x[i] = nil end x.head = math.max(i1-1, x.head) x.tail = math.min(i2, x.tail) assert( (x[x.head] == nil) and (x[x.tail+1] == nil) ) cleanup(self, k) return true end local rpop = function(self, k) local x = xgetw(self, k, "list") local l, r = _l_len(x), x[x.tail] if l > 1 then x[x.tail] = nil x.tail = x.tail - 1 else self.data[k] = nil end return r end rpoplpush = function(self, k1, k2) local v = rpop(self, k1) if not v then return nil end lpush(self, k2, v) return v end local rpush = function(self, k, ...) local vs = getargs(...) local x = xgetw(self, k, "list") for i=1,#vs do x.tail = x.tail + 1 x[x.tail] = vs[i] end return _l_len(x) end local rpushx = function(self, k, v) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") x.tail = x.tail + 1 x[x.tail] = v return _l_len(x) end -- sets local sadd = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x, r = xgetw(self, k, "set"), 0 for i=1,#arg do if not x[arg[i]] then x[arg[i]] = true r = r + 1 end end return r end local scard = function(self, k) local x = xgetr(self, k, "set") return nkeys(x) end local _sdiff = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x = xgetr(self, k, "set") local r = {} for v,_ in pairs(x) do r[v] = true end for i=1,#arg do x = xgetr(self, arg[i], "set") for v,_ in pairs(x) do r[v] = nil end end return r end local sdiff = function(self, k, ...) return lset_to_list(_sdiff(self, k, ...)) end local sdiffstore = function(self, k2, k, ...) k2 = chkarg(k2) local x = _sdiff(self, k, ...) self.data[k2] = {ktype = "set", value = x} return nkeys(x) end local _sinter = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x = xgetr(self, k, "set") local r = {} local y for v,_ in pairs(x) do r[v] = true for i=1,#arg do y = xgetr(self, arg[i], "set") if not y[v] then r[v] = nil; break end end end return r end local sinter = function(self, k, ...) return lset_to_list(_sinter(self, k, ...)) end local sinterstore = function(self, k2, k, ...) k2 = chkarg(k2) local x = _sinter(self, k, ...) self.data[k2] = {ktype = "set", value = x} return nkeys(x) end local sismember = function(self, k, v) local x = xgetr(self, k, "set") return not not x[v] end local smembers = function(self, k) local x = xgetr(self, k, "set") return lset_to_list(x) end local smove = function(self, k, k2, v) local x = xgetr(self, k, "set") if x[v] then local y = xgetw(self, k2, "set") x[v] = nil y[v] = true return true else return false end end local spop = function(self, k) local x, r = xgetw(self, k, "set"), nil local l = lset_to_list(x) local n = #l if n > 0 then r = l[math.random(1, n)] x[r] = nil end cleanup(self, k) return r end local srandmember = function(self, k, count) k = chkarg(k) local x = xgetr(self, k, "set") local l = lset_to_list(x) local n = #l if not count then if n > 0 then return l[math.random(1, n)] else return nil end end count = toint(count) if (count == 0) or (n == 0) then return {} end if count >= n then return l end local r = {} if count > 0 then -- distinct elements for i=0,count-1 do r[#r+1] = table.remove(l, math.random(1, n-i)) end else -- allow repetition for i=1,-count do r[#r+1] = l[math.random(1, n)] end end return r end local srem = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x, r = xgetw(self, k, "set"), 0 for i=1,#arg do if x[arg[i]] then x[arg[i]] = nil r = r + 1 end end cleanup(self, k) return r end local _sunion = function(self, ...) local arg = getargs(...) local r = {} local x for i=1,#arg do x = xgetr(self, arg[i], "set") for v,_ in pairs(x) do r[v] = true end end return r end local sunion = function(self, k, ...) return lset_to_list(_sunion(self, k, ...)) end local sunionstore = function(self, k2, k, ...) k2 = chkarg(k2) local x = _sunion(self, k, ...) self.data[k2] = {ktype = "set", value = x} return nkeys(x) end -- zsets local _z_p_mt = { __eq = function(a, b) if a.v == b.v then assert(a.s == b.s) return true else return false end end, __lt = function(a, b) if a.s == b.s then return (a.v < b.v) else return (a.s < b.s) end end, } local _z_pair = function(s, v) assert( (type(s) == "number") and (type(v) == "string") ) local r = {s = s, v = v} return setmetatable(r, _z_p_mt) end local _z_pairs = function(...) local arg = {...} assert((#arg > 0) and (#arg % 2 == 0)) local ps = {} for i=1,#arg,2 do ps[#ps+1] = _z_pair( assert(tofloat(arg[i])), chkarg(arg[i+1]) ) end return ps end local _z_insert = function(x, ix, p) assert( (type(x) == "table") and (type(ix) == "number") and (type(p) == "table") ) local l = x.list table.insert(l, ix, p) for i=ix+1,#l do x.set[l[i].v] = x.set[l[i].v] + 1 end x.set[p.v] = ix end local _z_remove = function(x, v) if not x.set[v] then return false end local l, ix = x.list, x.set[v] assert(l[ix].v == v) table.remove(l, ix) for i=ix,#l do x.set[l[i].v] = x.set[l[i].v] - 1 end x.set[v] = nil return true end local _z_remove_range = function(x, i1, i2) local l = x.list i2 = i2 or i1 assert( (i1 > 0) and (i2 >= i1) and (i2 <= #l) ) local ix, n = i1, i2-i1+1 for i=1,n do x.set[l[ix].v] = nil table.remove(l, ix) end for i=ix,#l do x.set[l[i].v] = x.set[l[i].v] - n end return n end local _z_update = function(x, p) local l = x.list local found = _z_remove(x, p.v) local ix = nil for i=1,#l do if l[i] > p then ix = i; break end end if not ix then ix = #l+1 end _z_insert(x, ix, p) return found end local _z_coherence = function(x) local l, s = x.list, x.set local found, n = {}, 0 for val,pos in pairs(s) do if found[pos] then return false end found[pos] = true n = n + 1 if not (l[pos] and (l[pos].v == val)) then return false end end if #l ~= n then return false end for i=1, n-1 do if l[i].s > l[i+1].s then return false end end return true end local _z_normrange = function(l, i1, i2) i1, i2 = assert(toint(i1)), assert(toint(i2)) if i1 < 0 then i1 = #l+i1 end if i2 < 0 then i2 = #l+i2 end i1, i2 = math.max(i1+1, 1), i2+1 if (i2 < i1) or (i1 > #l) then return nil end i2 = math.min(i2, #l) return i1, i2 end local _zrbs_opts = function(...) local arg = {...} if #arg == 0 then return {} end local ix, opts = 1, {} while type(arg[ix]) == "string" do if arg[ix] == "withscores" then opts.withscores = true ix = ix + 1 elseif arg[ix] == "limit" then opts.limit = { offset = assert(toint(arg[ix+1])), count = assert(toint(arg[ix+2])), } ix = ix + 3 else error("input") end end if type(arg[ix]) == "table" then local _o = arg[ix] opts.withscores = opts.withscores or _o.withscores if _o.limit then opts.limit = { offset = assert(toint(_o.limit.offset or _o.limit[1])), count = assert(toint(_o.limit.count or _o.limit[2])), } end ix = ix + 1 end assert(arg[ix] == nil) if opts.limit then assert( (opts.limit.count >= 0) and (opts.limit.offset >= 0) ) end return opts end local _z_store_params = function(dest, numkeys, ...) dest = chkarg(dest) numkeys = assert(toint(numkeys)) assert(numkeys > 0) local arg = {...} assert(#arg >= numkeys) local ks = {} for i=1, numkeys do ks[i] = chkarg(arg[i]) end local ix, opts = numkeys+1,{} while type(arg[ix]) == "string" do if arg[ix] == "weights" then opts.weights = {} ix = ix + 1 for i=1, numkeys do opts.weights[i] = assert(toint(arg[ix])) ix = ix + 1 end elseif arg[ix] == "aggregate" then opts.aggregate = assert(chkarg(arg[ix+1])) ix = ix + 2 else error("input") end end if type(arg[ix]) == "table" then local _o = arg[ix] opts.weights = opts.weights or _o.weights opts.aggregate = opts.aggregate or _o.aggregate ix = ix + 1 end assert(arg[ix] == nil) if opts.aggregate then assert( (opts.aggregate == "sum") or (opts.aggregate == "min") or (opts.aggregate == "max") ) else opts.aggregate = "sum" end if opts.weights then assert(#opts.weights == numkeys) for i=1,#opts.weights do assert(type(opts.weights[i]) == "number") end else opts.weights = {} for i=1, numkeys do opts.weights[i] = 1 end end opts.keys = ks opts.dest = dest return opts end local _zrbs_limits = function(x, s1, s2, descending) local s1_incl, s2_incl = true, true if s1:sub(1, 1) == "(" then s1, s1_incl = s1:sub(2, -1), false end s1 = assert(tofloat(s1)) if s2:sub(1, 1) == "(" then s2, s2_incl = s2:sub(2, -1), false end s2 = assert(tofloat(s2)) if descending then s1, s2 = s2, s1 s1_incl, s2_incl = s2_incl, s1_incl end if s2 < s1 then return nil end local l = x.list local i1, i2 local fst, lst = l[1].s, l[#l].s if (fst > s2) or ((not s2_incl) and (fst == s2)) then return nil end if (lst < s1) or ((not s1_incl) and (lst == s1)) then return nil end if (fst > s1) or (s1_incl and (fst == s1)) then i1 = 1 end if (lst < s2) or (s2_incl and (lst == s2)) then i2 = #l end for i=1,#l do if (i1 and i2) then break end if (not i1) then if l[i].s > s1 then i1 = i end if s1_incl and l[i].s == s1 then i1 = i end end if (not i2) then if l[i].s > s2 then i2 = i-1 end if (not s2_incl) and l[i].s == s2 then i2 = i-1 end end end assert(i1 and i2) if descending then return #l-i2, #l-i1 else return i1-1, i2-1 end end local dbg_zcoherence = function(self, k) local x = xgetr(self, k, "zset") return _z_coherence(x) end local zadd = function(self, k, ...) k = chkarg(k) local ps = _z_pairs(...) local x = xgetw(self, k, "zset") local n = 0 for i=1,#ps do if not _z_update(x, ps[i]) then n = n+1 end end return n end local zcard = function(self, k) local x = xgetr(self, k, "zset") return #x.list end local zcount = function(self, k, s1, s2) local x = xgetr(self, k, "zset") local i1, i2 = _zrbs_limits(x, s1, s2, false) if not (i1 and i2) then return 0 end assert(i2 >= i1) return i2 - i1 + 1 end local zincrby = function(self, k, n, v) k,v = chkargs(2, k, v) n = assert(tofloat(n)) local x = xgetw(self, k, "zset") local p = x.list[x.set[v]] local s = p and (p.s + n) or n _z_update(x, _z_pair(s, v)) return s end local zinterstore = function(self, ...) local params = _z_store_params(...) local x = xdefv("zset") local aggregate if params.aggregate == "sum" then aggregate = function(x, y) return x+y end elseif params.aggregate == "min" then aggregate = math.min elseif params.aggregate == "max" then aggregate = math.max else error() end local y = xgetr(self, params.keys[1], "zset") local p1, p2 for j=1,#y.list do p1 = _z_pair(y.list[j].s, y.list[j].v) _z_update(x, p1) end for i=2,#params.keys do y = xgetr(self, params.keys[i], "zset") local to_remove, to_update = {}, {} for j=1,#x.list do p1 = x.list[j] if y.set[p1.v] then p2 = _z_pair( aggregate( p1.s, params.weights[i] * y.list[y.set[p1.v]].s ), p1.v ) to_update[#to_update+1] = p2 else to_remove[#to_remove+1] = p1.v end end for j=1,#to_remove do _z_remove(x, to_remove[j]) end for j=1,#to_update do _z_update(x, to_update[j]) end end local r = #x.list if r > 0 then self.data[params.dest] = {ktype = "zset", value = x} end return r end local _zranger = function(descending) return function(self, k, i1, i2, opts) k = chkarg(k) local withscores = false if type(opts) == "table" then withscores = opts.withscores elseif type(opts) == "string" then assert(opts:lower() == "withscores") withscores = true else assert(opts == nil) end local x = xgetr(self, k, "zset") local l = x.list i1, i2 = _z_normrange(l, i1, i2) if not i1 then return {} end local inc = 1 if descending then i1 = #l - i1 + 1 i2 = #l - i2 + 1 inc = -1 end local r = {} if withscores then for i=i1, i2, inc do r[#r+1] = {l[i].v, l[i].s} end else for i=i1, i2, inc do r[#r+1] = l[i].v end end return r end end local zrange = _zranger(false) local zrevrange = _zranger(true) local _zrangerbyscore = function(descending) return function(self, k, s1, s2, ...) k, s1, s2 = chkargs(3, k, s1, s2) local opts = _zrbs_opts(...) local x = xgetr(self, k, "zset") local i1, i2 = _zrbs_limits(x, s1, s2, descending) if not (i1 and i2) then return {} end if opts.limit then if opts.limit.count == 0 then return {} end i1 = i1 + opts.limit.offset if i1 > i2 then return {} end i2 = math.min(i2, i1+opts.limit.count-1) end if descending then return zrevrange(self, k, i1, i2, opts) else return zrange(self, k, i1, i2, opts) end end end local zrangebyscore = _zrangerbyscore(false) local zrevrangebyscore = _zrangerbyscore(true) local zrank = function(self, k, v) local x = xgetr(self, k, "zset") local r = x.set[v] if r then return r-1 else return nil end end local zrem = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x, r = xgetw(self, k, "zset"), 0 for i=1,#arg do if _z_remove(x, arg[i]) then r = r + 1 end end cleanup(self, k) return r end local zremrangebyrank = function(self, k, i1, i2) k = chkarg(k) local x = xgetw(self, k, "zset") i1, i2 = _z_normrange(x.list, i1, i2) if not i1 then cleanup(self, k) return 0 end local n = _z_remove_range(x, i1, i2) cleanup(self, k) return n end local zremrangebyscore = function(self, k, s1, s2) local x = xgetr(self, k, "zset") local i1, i2 = _zrbs_limits(x, s1, s2, false) if not (i1 and i2) then return 0 end assert(i2 >= i1) return zremrangebyrank(self, k, i1, i2) end local zrevrank = function(self, k, v) local x = xgetr(self, k, "zset") local r = x.set[v] if r then return #x.list-r else return nil end end local zscore = function(self, k, v) local x = xgetr(self, k, "zset") local p = x.list[x.set[v]] if p then return p.s else return nil end end local zunionstore = function(self, ...) local params = _z_store_params(...) local x = xdefv("zset") local default_score, aggregate if params.aggregate == "sum" then default_score = 0 aggregate = function(x, y) return x+y end elseif params.aggregate == "min" then default_score = math.huge aggregate = math.min elseif params.aggregate == "max" then default_score = -math.huge aggregate = math.max else error() end local y, p1, p2 for i=1,#params.keys do y = xgetr(self, params.keys[i], "zset") for j=1,#y.list do p1 = y.list[j] p2 = _z_pair( aggregate( params.weights[i] * p1.s, x.set[p1.v] and x.list[x.set[p1.v]].s or default_score ), p1.v ) _z_update(x, p2) end end local r = #x.list if r > 0 then self.data[params.dest] = {ktype = "zset", value = x} end return r end -- connection local echo = function(self, v) return v end local ping = function(self) return true end -- server local flushdb = function(self) self.data = {} return true end --- Class local methods = { -- keys del = del, -- (...) -> #removed exists = chkargs_wrap(exists, 1), -- (k) -> exists? keys = keys, -- (pattern) -> list of keys ["type"] = chkargs_wrap(_type, 1), -- (k) -> [string|list|set|zset|hash|none] randomkey = randomkey, -- () -> [k|nil] rename = chkargs_wrap(rename, 2), -- (k,k2) -> true renamenx = chkargs_wrap(renamenx, 2), -- (k,k2) -> ! existed? k2 -- strings append = chkargs_wrap(append, 2), -- (k,v) -> #new bitcount = bitcount, -- (k,[start,end]) -> n bitop = bitop, -- ([and|or|xor|not],k,...) decr = chkargs_wrap(decr, 1), -- (k) -> new decrby = decrby, -- (k,n) -> new get = chkargs_wrap(get, 1), -- (k) -> [v|nil] getbit = getbit, -- (k,offset) -> b getrange = getrange, -- (k,start,end) -> string getset = chkargs_wrap(getset, 2), -- (k,v) -> [oldv|nil] incr = chkargs_wrap(incr, 1), -- (k) -> new incrby = incrby, -- (k,n) -> new incrbyfloat = incrbyfloat, -- (k,n) -> new mget = mget, -- (k1,...) -> {v1,...} mset = mset, -- (k1,v1,...) -> true msetnx = msetnx, -- (k1,v1,...) -> worked? (i.e. !existed? any k) set = chkargs_wrap(set, 2), -- (k,v) -> true setbit = setbit, -- (k,offset,b) -> old setnx = chkargs_wrap(setnx, 2), -- (k,v) -> worked? (i.e. !existed?) setrange = setrange, -- (k,offset,val) -> #new strlen = chkargs_wrap(strlen, 1), -- (k) -> [#v|0] -- hashes hdel = hdel, -- (k,sk1,...) -> #removed hexists = chkargs_wrap(hexists, 2), -- (k,sk) -> exists? hget = chkargs_wrap(hget,2), -- (k,sk) -> v hgetall = chkargs_wrap(hgetall, 1), -- (k) -> map hincrby = hincrby, -- (k,sk,n) -> new hincrbyfloat = hincrbyfloat, -- (k,sk,n) -> new hkeys = chkargs_wrap(hkeys, 1), -- (k) -> keys hlen = chkargs_wrap(hlen, 1), -- (k) -> [#sk|0] hmget = hmget, -- (k,{sk1,...}) -> {v1,...} hmset = hmset, -- (k,{sk1=v1,...}) -> true hset = chkargs_wrap(hset, 3), -- (k,sk1,v1) -> !existed? hsetnx = chkargs_wrap(hsetnx, 3), -- (k,sk1,v1) -> worked? (i.e. !existed?) hvals = chkargs_wrap(hvals, 1), -- (k) -> values -- lists blpop = blpop, -- (k1,...) -> k,v brpop = brpop, -- (k1,...) -> k,v brpoplpush = brpoplpush, -- (k1,k2,timeout) -> v lindex = lindex, -- (k,i) -> v linsert = chkargs_wrap(linsert, 4), -- (k,mode,pivot,v) -> #list (after) llen = chkargs_wrap(llen, 1), -- (k) -> #list lpop = chkargs_wrap(lpop, 1), -- (k) -> v lpush = lpush, -- (k,v1,...) -> #list (after) lpushx = chkargs_wrap(lpushx, 2), -- (k,v) -> #list (after) lrange = lrange, -- (k,start,stop) -> list lrem = lrem, -- (k,count,v) -> #removed lset = lset, -- (k,i,v) -> true ltrim = ltrim, -- (k,start,stop) -> true rpop = chkargs_wrap(rpop, 1), -- (k) -> v rpoplpush = chkargs_wrap(rpoplpush, 2), -- (k1,k2) -> v rpush = rpush, -- (k,v1,...) -> #list (after) rpushx = chkargs_wrap(rpushx, 2), -- (k,v) -> #list (after) -- sets sadd = sadd, -- (k,v1,...) -> #added scard = chkargs_wrap(scard, 1), -- (k) -> [n|0] sdiff = sdiff, -- (k1,...) -> set (of elements in k1 & not in any of ...) sdiffstore = sdiffstore, -- (k0,k1,...) -> #set at k0 sinter = sinter, -- (k1,...) -> set sinterstore = sinterstore, -- (k0,k1,...) -> #set at k0 sismember = chkargs_wrap(sismember, 2), -- (k,v) -> member? smembers = chkargs_wrap(smembers, 1), -- (k) -> set smove = chkargs_wrap(smove, 3), -- (k1,k2,v) -> moved? (i.e. !member? k1) spop = chkargs_wrap(spop, 1), -- (k) -> [v|nil] srandmember = srandmember, -- (k,[count]) -> v|[v1,v2,...] srem = srem, -- (k,v1,...) -> #removed sunion = sunion, -- (k1,...) -> set sunionstore = sunionstore, -- (k0,k1,...) -> #set at k0 -- zsets zadd = zadd, -- (k,score,member,[score,member,...]) zcard = chkargs_wrap(zcard, 1), -- (k) -> n zcount = chkargs_wrap(zcount, 3), -- (k,min,max) -> count zincrby = zincrby, -- (k,score,v) -> score zinterstore = zinterstore, -- (k,numkeys,k1,...,[opts]) -> card zrange = zrange, -- (k,start,stop,[opts]) -> depends on opts zrangebyscore = zrangebyscore, -- (k,min,max,[opts]) -> depends on opts zrank = chkargs_wrap(zrank, 2), -- (k,v) -> rank zrem = zrem, -- (k,v1,...) -> #removed zremrangebyrank = zremrangebyrank, -- (k,start,stop) -> #removed zremrangebyscore = chkargs_wrap(zremrangebyscore, 3), -- (k,min,max) -> #removed zrevrange = zrevrange, -- (k,start,stop,[opts]) -> depends on opts zrevrangebyscore = zrevrangebyscore, -- (k,min,max,[opts]) -> depends on opts zrevrank = chkargs_wrap(zrevrank, 2), -- (k,v) -> rank zscore = chkargs_wrap(zscore, 2), -- (k,v) -> score zunionstore = zunionstore, -- (k,numkeys,k1,...,[opts]) -> card -- connection echo = chkargs_wrap(echo, 1), -- (v) -> v ping = ping, -- () -> true -- server flushall = flushdb, -- () -> true flushdb = flushdb, -- () -> true -- debug dbg_zcoherence = dbg_zcoherence, } local new = function() local r = {data = {}} return setmetatable(r,{__index = methods}) end return { new = new, }
gpl-2.0
DEVll190ll/DEV_HR
libs/fakeredis.lua
650
40405
local unpack = table.unpack or unpack --- Bit operations local ok,bit if _VERSION == "Lua 5.3" then bit = (load [[ return { band = function(x, y) return x & y end, bor = function(x, y) return x | y end, bxor = function(x, y) return x ~ y end, bnot = function(x) return ~x end, rshift = function(x, n) return x >> n end, lshift = function(x, n) return x << n end, } ]])() else ok,bit = pcall(require,"bit") if not ok then bit = bit32 end end assert(type(bit) == "table", "module for bitops not found") --- default sleep local default_sleep do local ok, mod = pcall(require, "socket") if ok and type(mod) == "table" then default_sleep = mod.sleep else default_sleep = function(n) local t0 = os.clock() while true do local delta = os.clock() - t0 if (delta < 0) or (delta > n) then break end end end end end --- Helpers local xdefv = function(ktype) if ktype == "list" then return {head = 0, tail = 0} elseif ktype == "zset" then return { list = {}, set = {}, } else return {} end end local xgetr = function(self, k, ktype) if self.data[k] then assert( (self.data[k].ktype == ktype), "ERR Operation against a key holding the wrong kind of value" ) assert(self.data[k].value) return self.data[k].value else return xdefv(ktype) end end local xgetw = function(self, k, ktype) if self.data[k] and self.data[k].value then assert( (self.data[k].ktype == ktype), "ERR Operation against a key holding the wrong kind of value" ) else self.data[k] = {ktype = ktype, value = xdefv(ktype)} end return self.data[k].value end local empty = function(self, k) local v, t = self.data[k].value, self.data[k].ktype if t == nil then return true elseif t == "string" then return not v[1] elseif (t == "hash") or (t == "set") then for _,_ in pairs(v) do return false end return true elseif t == "list" then return v.head == v.tail elseif t == "zset" then if #v.list == 0 then for _,_ in pairs(v.set) do error("incoherent") end return true else for _,_ in pairs(v.set) do return(false) end error("incoherent") end else error("unsupported") end end local cleanup = function(self, k) if empty(self, k) then self.data[k] = nil end end local is_integer = function(x) return (type(x) == "number") and (math.floor(x) == x) end local overflows = function(n) return (n > 2^53-1) or (n < -2^53+1) end local is_bounded_integer = function(x) return (is_integer(x) and (not overflows(x))) end local is_finite_number = function(x) return (type(x) == "number") and (x > -math.huge) and (x < math.huge) end local toint = function(x) if type(x) == "string" then x = tonumber(x) end return is_bounded_integer(x) and x or nil end local tofloat = function(x) if type(x) == "number" then return x end if type(x) ~= "string" then return nil end local r = tonumber(x) if r then return r end if x == "inf" or x == "+inf" then return math.huge elseif x == "-inf" then return -math.huge else return nil end end local tostr = function(x) if is_bounded_integer(x) then return string.format("%d", x) else return tostring(x) end end local char_bitcount = function(x) assert( (type(x) == "number") and (math.floor(x) == x) and (x >= 0) and (x < 256) ) local n = 0 while x ~= 0 do x = bit.band(x, x-1) n = n+1 end return n end local chkarg = function(x) if type(x) == "number" then x = tostr(x) end assert(type(x) == "string") return x end local chkargs = function(n, ...) local arg = {...} assert(#arg == n) for i=1,n do arg[i] = chkarg(arg[i]) end return unpack(arg) end local getargs = function(...) local arg = {...} local n = #arg; assert(n > 0) for i=1,n do arg[i] = chkarg(arg[i]) end return arg end local getargs_as_map = function(...) local arg, r = getargs(...), {} assert(#arg%2 == 0) for i=1,#arg,2 do r[arg[i]] = arg[i+1] end return r end local chkargs_wrap = function(f, n) assert( (type(f) == "function") and (type(n) == "number") ) return function(self, ...) return f(self, chkargs(n, ...)) end end local lset_to_list = function(s) local r = {} for v,_ in pairs(s) do r[#r+1] = v end return r end local nkeys = function(x) local r = 0 for _,_ in pairs(x) do r = r + 1 end return r end --- Commands -- keys local del = function(self, ...) local arg = getargs(...) local r = 0 for i=1,#arg do if self.data[arg[i]] then r = r + 1 end self.data[arg[i]] = nil end return r end local exists = function(self, k) return not not self.data[k] end local keys = function(self, pattern) assert(type(pattern) == "string") -- We want to convert the Redis pattern to a Lua pattern. -- Start by escaping dashes *outside* character classes. -- We also need to escape percents here. local t, p, n = {}, 1, #pattern local p1, p2 while true do p1, p2 = pattern:find("%[.+%]", p) if p1 then if p1 > p then t[#t+1] = {true, pattern:sub(p, p1-1)} end t[#t+1] = {false, pattern:sub(p1, p2)} p = p2+1 if p > n then break end else t[#t+1] = {true, pattern:sub(p, n)} break end end for i=1,#t do if t[i][1] then t[i] = t[i][2]:gsub("[%%%-]", "%%%0") else t[i] = t[i][2]:gsub("%%", "%%%%") end end -- Remaining Lua magic chars are: '^$().[]*+?' ; escape them except '*?[]' -- Then convert '\' to '%', '*' to '.*' and '?' to '.'. Leave '[]' as is. -- Wrap in '^$' to enforce bounds. local lp = "^" .. table.concat(t):gsub("[%^%$%(%)%.%+]", "%%%0") :gsub("\\", "%%"):gsub("%*", ".*"):gsub("%?", ".") .. "$" local r = {} for k,_ in pairs(self.data) do if k:match(lp) then r[#r+1] = k end end return r end local _type = function(self, k) return self.data[k] and self.data[k].ktype or "none" end local randomkey = function(self) local ks = lset_to_list(self.data) local n = #ks if n > 0 then return ks[math.random(1, n)] else return nil end end local rename = function(self, k, k2) assert((k ~= k2) and self.data[k]) self.data[k2] = self.data[k] self.data[k] = nil return true end local renamenx = function(self, k, k2) if self.data[k2] then return false else return rename(self, k, k2) end end -- strings local getrange, incrby, set local append = function(self, k, v) local x = xgetw(self, k, "string") x[1] = (x[1] or "") .. v return #x[1] end local bitcount = function(self, k, i1, i2) k = chkarg(k) local s if i1 or i2 then assert(i1 and i2, "ERR syntax error") s = getrange(self, k, i1, i2) else s = xgetr(self, k, "string")[1] or "" end local r, bytes = 0,{s:byte(1, -1)} for i=1,#bytes do r = r + char_bitcount(bytes[i]) end return r end local bitop = function(self, op, k, ...) assert(type(op) == "string") op = op:lower() assert( (op == "and") or (op == "or") or (op == "xor") or (op == "not"), "ERR syntax error" ) k = chkarg(k) local arg = {...} local good_arity = (op == "not") and (#arg == 1) or (#arg > 0) assert(good_arity, "ERR wrong number of arguments for 'bitop' command") local l, vals = 0, {} local s for i=1,#arg do s = xgetr(self, arg[i], "string")[1] or "" if #s > l then l = #s end vals[i] = s end if l == 0 then del(self, k) return 0 end local vector_mt = {__index=function() return 0 end} for i=1,#vals do vals[i] = setmetatable({vals[i]:byte(1, -1)}, vector_mt) end local r = {} if op == "not" then assert(#vals[1] == l) for i=1,l do r[i] = bit.band(bit.bnot(vals[1][i]), 0xff) end else local _op = bit["b" .. op] for i=1,l do local t = {} for j=1,#vals do t[j] = vals[j][i] end r[i] = _op(unpack(t)) end end set(self, k, string.char(unpack(r))) return l end local decr = function(self, k) return incrby(self, k, -1) end local decrby = function(self, k, n) n = toint(n) assert(n, "ERR value is not an integer or out of range") return incrby(self, k, -n) end local get = function(self, k) local x = xgetr(self, k, "string") return x[1] end local getbit = function(self, k, offset) k = chkarg(k) offset = toint(offset) assert( (offset >= 0), "ERR bit offset is not an integer or out of range" ) local bitpos = offset % 8 -- starts at 0 local bytepos = (offset - bitpos) / 8 -- starts at 0 local s = xgetr(self, k, "string")[1] or "" if bytepos >= #s then return 0 end local char = s:sub(bytepos+1, bytepos+1):byte() return bit.band(bit.rshift(char, 7-bitpos), 1) end getrange = function(self, k, i1, i2) k = chkarg(k) i1, i2 = toint(i1), toint(i2) assert(i1 and i2) local x = xgetr(self, k, "string") x = x[1] or "" if i1 >= 0 then i1 = i1 + 1 end if i2 >= 0 then i2 = i2 + 1 end return x:sub(i1, i2) end local getset = function(self, k, v) local r = get(self, k) set(self, k, v) return r end local incr = function(self, k) return incrby(self, k, 1) end incrby = function(self, k, n) k, n = chkarg(k), toint(n) assert(n, "ERR value is not an integer or out of range") local x = xgetw(self, k, "string") local i = toint(x[1] or 0) assert(i, "ERR value is not an integer or out of range") i = i+n assert( (not overflows(i)), "ERR increment or decrement would overflow" ) x[1] = tostr(i) return i end local incrbyfloat = function(self, k, n) k, n = chkarg(k), tofloat(n) assert(n, "ERR value is not a valid float") local x = xgetw(self, k, "string") local i = tofloat(x[1] or 0) assert(i, "ERR value is not a valid float") i = i+n assert( is_finite_number(i), "ERR increment would produce NaN or Infinity" ) x[1] = tostr(i) return i end local mget = function(self, ...) local arg, r = getargs(...), {} for i=1,#arg do r[i] = get(self, arg[i]) end return r end local mset = function(self, ...) local argmap = getargs_as_map(...) for k,v in pairs(argmap) do set(self, k, v) end return true end local msetnx = function(self, ...) local argmap = getargs_as_map(...) for k,_ in pairs(argmap) do if self.data[k] then return false end end for k,v in pairs(argmap) do set(self, k, v) end return true end set = function(self, k, v) self.data[k] = {ktype = "string", value = {v}} return true end local setbit = function(self, k, offset, b) k = chkarg(k) offset, b = toint(offset), toint(b) assert( (offset >= 0), "ERR bit offset is not an integer or out of range" ) assert( (b == 0) or (b == 1), "ERR bit is not an integer or out of range" ) local bitpos = offset % 8 -- starts at 0 local bytepos = (offset - bitpos) / 8 -- starts at 0 local s = xgetr(self, k, "string")[1] or "" local pad = {s} for i=2,bytepos+2-#s do pad[i] = "\0" end s = table.concat(pad) assert(#s >= bytepos+1) local before = s:sub(1, bytepos) local char = s:sub(bytepos+1, bytepos+1):byte() local after = s:sub(bytepos+2, -1) local old = bit.band(bit.rshift(char, 7-bitpos), 1) if b == 1 then char = bit.bor(bit.lshift(1, 7-bitpos), char) else char = bit.band(bit.bnot(bit.lshift(1, 7-bitpos)), char) end local r = before .. string.char(char) .. after set(self, k, r) return old end local setnx = function(self, k, v) if self.data[k] then return false else return set(self, k, v) end end local setrange = function(self, k, i, s) local k, s = chkargs(2, k, s) i = toint(i) assert(i and (i >= 0)) local x = xgetw(self, k, "string") local y = x[1] or "" local ly, ls = #y, #s if i > ly then -- zero padding local t = {} for i=1, i-ly do t[i] = "\0" end y = y .. table.concat(t) .. s else y = y:sub(1, i) .. s .. y:sub(i+ls+1, ly) end x[1] = y return #y end local strlen = function(self, k) local x = xgetr(self, k, "string") return x[1] and #x[1] or 0 end -- hashes local hdel = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local r = 0 local x = xgetw(self, k, "hash") for i=1,#arg do if x[arg[i]] then r = r + 1 end x[arg[i]] = nil end cleanup(self, k) return r end local hget local hexists = function(self, k, k2) return not not hget(self, k, k2) end hget = function(self, k, k2) local x = xgetr(self, k, "hash") return x[k2] end local hgetall = function(self, k) local x = xgetr(self, k, "hash") local r = {} for _k,v in pairs(x) do r[_k] = v end return r end local hincrby = function(self, k, k2, n) k, k2, n = chkarg(k), chkarg(k2), toint(n) assert(n, "ERR value is not an integer or out of range") assert(type(n) == "number") local x = xgetw(self, k, "hash") local i = toint(x[k2] or 0) assert(i, "ERR value is not an integer or out of range") i = i+n assert( (not overflows(i)), "ERR increment or decrement would overflow" ) x[k2] = tostr(i) return i end local hincrbyfloat = function(self, k, k2, n) k, k2, n = chkarg(k), chkarg(k2), tofloat(n) assert(n, "ERR value is not a valid float") local x = xgetw(self, k, "hash") local i = tofloat(x[k2] or 0) assert(i, "ERR value is not a valid float") i = i+n assert( is_finite_number(i), "ERR increment would produce NaN or Infinity" ) x[k2] = tostr(i) return i end local hkeys = function(self, k) local x = xgetr(self, k, "hash") local r = {} for _k,_ in pairs(x) do r[#r+1] = _k end return r end local hlen = function(self, k) local x = xgetr(self, k, "hash") return nkeys(x) end local hmget = function(self, k, k2s) k = chkarg(k) assert((type(k2s) == "table")) local r = {} local x = xgetr(self, k, "hash") for i=1,#k2s do r[i] = x[chkarg(k2s[i])] end return r end local hmset = function(self, k, ...) k = chkarg(k) local arg = {...} if type(arg[1]) == "table" then assert(#arg == 1) local x = xgetw(self, k, "hash") for _k,v in pairs(arg[1]) do x[chkarg(_k)] = chkarg(v) end else assert(#arg % 2 == 0) local x = xgetw(self, k, "hash") local t = getargs(...) for i=1,#t,2 do x[t[i]] = t[i+1] end end return true end local hset = function(self, k, k2, v) local x = xgetw(self, k, "hash") local r = not x[k2] x[k2] = v return r end local hsetnx = function(self, k, k2, v) local x = xgetw(self, k, "hash") if x[k2] == nil then x[k2] = v return true else return false end end local hvals = function(self, k) local x = xgetr(self, k, "hash") local r = {} for _,v in pairs(x) do r[#r+1] = v end return r end -- lists (head = left, tail = right) local _l_real_i = function(x, i) if i < 0 then return x.tail+i+1 else return x.head+i+1 end end local _l_len = function(x) return x.tail - x.head end local _block_for = function(self, timeout) if timeout > 0 then local sleep = self.sleep or default_sleep if type(sleep) == "function" then sleep(timeout) else error("sleep function unavailable", 0) end else error("operation would block", 0) end end local rpoplpush local blpop = function(self, ...) local arg = {...} local timeout = toint(arg[#arg]) arg[#arg] = nil local vs = getargs(...) local x, l, k, v for i=1,#vs do k = vs[i] x = xgetw(self, k, "list") l = _l_len(x) if l > 0 then v = x[x.head+1] if l > 1 then x.head = x.head + 1 x[x.head] = nil else self.data[k] = nil end return {k, v} else self.data[k] = nil end end _block_for(self, timeout) end local brpop = function(self, ...) local arg = {...} local timeout = toint(arg[#arg]) arg[#arg] = nil local vs = getargs(...) local x, l, k, v for i=1,#vs do k = vs[i] x = xgetw(self, k, "list") l = _l_len(x) if l > 0 then v = x[x.tail] if l > 1 then x[x.tail] = nil x.tail = x.tail - 1 else self.data[k] = nil end return {k, v} else self.data[k] = nil end end _block_for(self, timeout) end local brpoplpush = function(self, k1, k2, timeout) k1, k2 = chkargs(2, k1, k2) timeout = toint(timeout) if not self.data[k1] then _block_for(self, timeout) end return rpoplpush(self, k1, k2) end local lindex = function(self, k, i) k = chkarg(k) i = assert(toint(i)) local x = xgetr(self, k, "list") return x[_l_real_i(x, i)] end local linsert = function(self, k, mode, pivot, v) mode = mode:lower() assert((mode == "before") or (mode == "after")) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") local p = nil for i=x.head+1, x.tail do if x[i] == pivot then p = i break end end if not p then return -1 end if mode == "after" then for i=x.head+1, p do x[i-1] = x[i] end x.head = x.head - 1 else for i=x.tail, p, -1 do x[i+1] = x[i] end x.tail = x.tail + 1 end x[p] = v return _l_len(x) end local llen = function(self, k) local x = xgetr(self, k, "list") return _l_len(x) end local lpop = function(self, k) local x = xgetw(self, k, "list") local l, r = _l_len(x), x[x.head+1] if l > 1 then x.head = x.head + 1 x[x.head] = nil else self.data[k] = nil end return r end local lpush = function(self, k, ...) local vs = getargs(...) local x = xgetw(self, k, "list") for i=1,#vs do x[x.head] = vs[i] x.head = x.head - 1 end return _l_len(x) end local lpushx = function(self, k, v) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") x[x.head] = v x.head = x.head - 1 return _l_len(x) end local lrange = function(self, k, i1, i2) k = chkarg(k) i1, i2 = toint(i1), toint(i2) assert(i1 and i2) local x, r = xgetr(self, k, "list"), {} i1 = math.max(_l_real_i(x, i1), x.head+1) i2 = math.min(_l_real_i(x, i2), x.tail) for i=i1,i2 do r[#r+1] = x[i] end return r end local _lrem_i = function(x, p) for i=p,x.tail do x[i] = x[i+1] end x.tail = x.tail - 1 end local _lrem_l = function(x, v, s) assert(v) if not s then s = x.head+1 end for i=s,x.tail do if x[i] == v then _lrem_i(x, i) return i end end return false end local _lrem_r = function(x, v, s) assert(v) if not s then s = x.tail end for i=s,x.head+1,-1 do if x[i] == v then _lrem_i(x, i) return i end end return false end local lrem = function(self, k, count, v) k, v = chkarg(k), chkarg(v) count = assert(toint(count)) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") local n, last = 0, nil local op = (count < 0) and _lrem_r or _lrem_l local limited = (count ~= 0) count = math.abs(count) while true do last = op(x, v, last) if last then n = n+1 if limited then count = count - 1 if count == 0 then break end end else break end end return n end local lset = function(self, k, i, v) k, v = chkarg(k), chkarg(v) i = assert(toint(i)) if not self.data[k] then error("ERR no such key") end local x = xgetw(self, k, "list") local l = _l_len(x) if i >= l or i < -l then error("ERR index out of range") end x[_l_real_i(x, i)] = v return true end local ltrim = function(self, k, i1, i2) k = chkarg(k) i1, i2 = toint(i1), toint(i2) assert(i1 and i2) local x = xgetw(self, k, "list") i1, i2 = _l_real_i(x, i1), _l_real_i(x, i2) for i=x.head+1,i1-1 do x[i] = nil end for i=i2+1,x.tail do x[i] = nil end x.head = math.max(i1-1, x.head) x.tail = math.min(i2, x.tail) assert( (x[x.head] == nil) and (x[x.tail+1] == nil) ) cleanup(self, k) return true end local rpop = function(self, k) local x = xgetw(self, k, "list") local l, r = _l_len(x), x[x.tail] if l > 1 then x[x.tail] = nil x.tail = x.tail - 1 else self.data[k] = nil end return r end rpoplpush = function(self, k1, k2) local v = rpop(self, k1) if not v then return nil end lpush(self, k2, v) return v end local rpush = function(self, k, ...) local vs = getargs(...) local x = xgetw(self, k, "list") for i=1,#vs do x.tail = x.tail + 1 x[x.tail] = vs[i] end return _l_len(x) end local rpushx = function(self, k, v) if not self.data[k] then return 0 end local x = xgetw(self, k, "list") x.tail = x.tail + 1 x[x.tail] = v return _l_len(x) end -- sets local sadd = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x, r = xgetw(self, k, "set"), 0 for i=1,#arg do if not x[arg[i]] then x[arg[i]] = true r = r + 1 end end return r end local scard = function(self, k) local x = xgetr(self, k, "set") return nkeys(x) end local _sdiff = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x = xgetr(self, k, "set") local r = {} for v,_ in pairs(x) do r[v] = true end for i=1,#arg do x = xgetr(self, arg[i], "set") for v,_ in pairs(x) do r[v] = nil end end return r end local sdiff = function(self, k, ...) return lset_to_list(_sdiff(self, k, ...)) end local sdiffstore = function(self, k2, k, ...) k2 = chkarg(k2) local x = _sdiff(self, k, ...) self.data[k2] = {ktype = "set", value = x} return nkeys(x) end local _sinter = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x = xgetr(self, k, "set") local r = {} local y for v,_ in pairs(x) do r[v] = true for i=1,#arg do y = xgetr(self, arg[i], "set") if not y[v] then r[v] = nil; break end end end return r end local sinter = function(self, k, ...) return lset_to_list(_sinter(self, k, ...)) end local sinterstore = function(self, k2, k, ...) k2 = chkarg(k2) local x = _sinter(self, k, ...) self.data[k2] = {ktype = "set", value = x} return nkeys(x) end local sismember = function(self, k, v) local x = xgetr(self, k, "set") return not not x[v] end local smembers = function(self, k) local x = xgetr(self, k, "set") return lset_to_list(x) end local smove = function(self, k, k2, v) local x = xgetr(self, k, "set") if x[v] then local y = xgetw(self, k2, "set") x[v] = nil y[v] = true return true else return false end end local spop = function(self, k) local x, r = xgetw(self, k, "set"), nil local l = lset_to_list(x) local n = #l if n > 0 then r = l[math.random(1, n)] x[r] = nil end cleanup(self, k) return r end local srandmember = function(self, k, count) k = chkarg(k) local x = xgetr(self, k, "set") local l = lset_to_list(x) local n = #l if not count then if n > 0 then return l[math.random(1, n)] else return nil end end count = toint(count) if (count == 0) or (n == 0) then return {} end if count >= n then return l end local r = {} if count > 0 then -- distinct elements for i=0,count-1 do r[#r+1] = table.remove(l, math.random(1, n-i)) end else -- allow repetition for i=1,-count do r[#r+1] = l[math.random(1, n)] end end return r end local srem = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x, r = xgetw(self, k, "set"), 0 for i=1,#arg do if x[arg[i]] then x[arg[i]] = nil r = r + 1 end end cleanup(self, k) return r end local _sunion = function(self, ...) local arg = getargs(...) local r = {} local x for i=1,#arg do x = xgetr(self, arg[i], "set") for v,_ in pairs(x) do r[v] = true end end return r end local sunion = function(self, k, ...) return lset_to_list(_sunion(self, k, ...)) end local sunionstore = function(self, k2, k, ...) k2 = chkarg(k2) local x = _sunion(self, k, ...) self.data[k2] = {ktype = "set", value = x} return nkeys(x) end -- zsets local _z_p_mt = { __eq = function(a, b) if a.v == b.v then assert(a.s == b.s) return true else return false end end, __lt = function(a, b) if a.s == b.s then return (a.v < b.v) else return (a.s < b.s) end end, } local _z_pair = function(s, v) assert( (type(s) == "number") and (type(v) == "string") ) local r = {s = s, v = v} return setmetatable(r, _z_p_mt) end local _z_pairs = function(...) local arg = {...} assert((#arg > 0) and (#arg % 2 == 0)) local ps = {} for i=1,#arg,2 do ps[#ps+1] = _z_pair( assert(tofloat(arg[i])), chkarg(arg[i+1]) ) end return ps end local _z_insert = function(x, ix, p) assert( (type(x) == "table") and (type(ix) == "number") and (type(p) == "table") ) local l = x.list table.insert(l, ix, p) for i=ix+1,#l do x.set[l[i].v] = x.set[l[i].v] + 1 end x.set[p.v] = ix end local _z_remove = function(x, v) if not x.set[v] then return false end local l, ix = x.list, x.set[v] assert(l[ix].v == v) table.remove(l, ix) for i=ix,#l do x.set[l[i].v] = x.set[l[i].v] - 1 end x.set[v] = nil return true end local _z_remove_range = function(x, i1, i2) local l = x.list i2 = i2 or i1 assert( (i1 > 0) and (i2 >= i1) and (i2 <= #l) ) local ix, n = i1, i2-i1+1 for i=1,n do x.set[l[ix].v] = nil table.remove(l, ix) end for i=ix,#l do x.set[l[i].v] = x.set[l[i].v] - n end return n end local _z_update = function(x, p) local l = x.list local found = _z_remove(x, p.v) local ix = nil for i=1,#l do if l[i] > p then ix = i; break end end if not ix then ix = #l+1 end _z_insert(x, ix, p) return found end local _z_coherence = function(x) local l, s = x.list, x.set local found, n = {}, 0 for val,pos in pairs(s) do if found[pos] then return false end found[pos] = true n = n + 1 if not (l[pos] and (l[pos].v == val)) then return false end end if #l ~= n then return false end for i=1, n-1 do if l[i].s > l[i+1].s then return false end end return true end local _z_normrange = function(l, i1, i2) i1, i2 = assert(toint(i1)), assert(toint(i2)) if i1 < 0 then i1 = #l+i1 end if i2 < 0 then i2 = #l+i2 end i1, i2 = math.max(i1+1, 1), i2+1 if (i2 < i1) or (i1 > #l) then return nil end i2 = math.min(i2, #l) return i1, i2 end local _zrbs_opts = function(...) local arg = {...} if #arg == 0 then return {} end local ix, opts = 1, {} while type(arg[ix]) == "string" do if arg[ix] == "withscores" then opts.withscores = true ix = ix + 1 elseif arg[ix] == "limit" then opts.limit = { offset = assert(toint(arg[ix+1])), count = assert(toint(arg[ix+2])), } ix = ix + 3 else error("input") end end if type(arg[ix]) == "table" then local _o = arg[ix] opts.withscores = opts.withscores or _o.withscores if _o.limit then opts.limit = { offset = assert(toint(_o.limit.offset or _o.limit[1])), count = assert(toint(_o.limit.count or _o.limit[2])), } end ix = ix + 1 end assert(arg[ix] == nil) if opts.limit then assert( (opts.limit.count >= 0) and (opts.limit.offset >= 0) ) end return opts end local _z_store_params = function(dest, numkeys, ...) dest = chkarg(dest) numkeys = assert(toint(numkeys)) assert(numkeys > 0) local arg = {...} assert(#arg >= numkeys) local ks = {} for i=1, numkeys do ks[i] = chkarg(arg[i]) end local ix, opts = numkeys+1,{} while type(arg[ix]) == "string" do if arg[ix] == "weights" then opts.weights = {} ix = ix + 1 for i=1, numkeys do opts.weights[i] = assert(toint(arg[ix])) ix = ix + 1 end elseif arg[ix] == "aggregate" then opts.aggregate = assert(chkarg(arg[ix+1])) ix = ix + 2 else error("input") end end if type(arg[ix]) == "table" then local _o = arg[ix] opts.weights = opts.weights or _o.weights opts.aggregate = opts.aggregate or _o.aggregate ix = ix + 1 end assert(arg[ix] == nil) if opts.aggregate then assert( (opts.aggregate == "sum") or (opts.aggregate == "min") or (opts.aggregate == "max") ) else opts.aggregate = "sum" end if opts.weights then assert(#opts.weights == numkeys) for i=1,#opts.weights do assert(type(opts.weights[i]) == "number") end else opts.weights = {} for i=1, numkeys do opts.weights[i] = 1 end end opts.keys = ks opts.dest = dest return opts end local _zrbs_limits = function(x, s1, s2, descending) local s1_incl, s2_incl = true, true if s1:sub(1, 1) == "(" then s1, s1_incl = s1:sub(2, -1), false end s1 = assert(tofloat(s1)) if s2:sub(1, 1) == "(" then s2, s2_incl = s2:sub(2, -1), false end s2 = assert(tofloat(s2)) if descending then s1, s2 = s2, s1 s1_incl, s2_incl = s2_incl, s1_incl end if s2 < s1 then return nil end local l = x.list local i1, i2 local fst, lst = l[1].s, l[#l].s if (fst > s2) or ((not s2_incl) and (fst == s2)) then return nil end if (lst < s1) or ((not s1_incl) and (lst == s1)) then return nil end if (fst > s1) or (s1_incl and (fst == s1)) then i1 = 1 end if (lst < s2) or (s2_incl and (lst == s2)) then i2 = #l end for i=1,#l do if (i1 and i2) then break end if (not i1) then if l[i].s > s1 then i1 = i end if s1_incl and l[i].s == s1 then i1 = i end end if (not i2) then if l[i].s > s2 then i2 = i-1 end if (not s2_incl) and l[i].s == s2 then i2 = i-1 end end end assert(i1 and i2) if descending then return #l-i2, #l-i1 else return i1-1, i2-1 end end local dbg_zcoherence = function(self, k) local x = xgetr(self, k, "zset") return _z_coherence(x) end local zadd = function(self, k, ...) k = chkarg(k) local ps = _z_pairs(...) local x = xgetw(self, k, "zset") local n = 0 for i=1,#ps do if not _z_update(x, ps[i]) then n = n+1 end end return n end local zcard = function(self, k) local x = xgetr(self, k, "zset") return #x.list end local zcount = function(self, k, s1, s2) local x = xgetr(self, k, "zset") local i1, i2 = _zrbs_limits(x, s1, s2, false) if not (i1 and i2) then return 0 end assert(i2 >= i1) return i2 - i1 + 1 end local zincrby = function(self, k, n, v) k,v = chkargs(2, k, v) n = assert(tofloat(n)) local x = xgetw(self, k, "zset") local p = x.list[x.set[v]] local s = p and (p.s + n) or n _z_update(x, _z_pair(s, v)) return s end local zinterstore = function(self, ...) local params = _z_store_params(...) local x = xdefv("zset") local aggregate if params.aggregate == "sum" then aggregate = function(x, y) return x+y end elseif params.aggregate == "min" then aggregate = math.min elseif params.aggregate == "max" then aggregate = math.max else error() end local y = xgetr(self, params.keys[1], "zset") local p1, p2 for j=1,#y.list do p1 = _z_pair(y.list[j].s, y.list[j].v) _z_update(x, p1) end for i=2,#params.keys do y = xgetr(self, params.keys[i], "zset") local to_remove, to_update = {}, {} for j=1,#x.list do p1 = x.list[j] if y.set[p1.v] then p2 = _z_pair( aggregate( p1.s, params.weights[i] * y.list[y.set[p1.v]].s ), p1.v ) to_update[#to_update+1] = p2 else to_remove[#to_remove+1] = p1.v end end for j=1,#to_remove do _z_remove(x, to_remove[j]) end for j=1,#to_update do _z_update(x, to_update[j]) end end local r = #x.list if r > 0 then self.data[params.dest] = {ktype = "zset", value = x} end return r end local _zranger = function(descending) return function(self, k, i1, i2, opts) k = chkarg(k) local withscores = false if type(opts) == "table" then withscores = opts.withscores elseif type(opts) == "string" then assert(opts:lower() == "withscores") withscores = true else assert(opts == nil) end local x = xgetr(self, k, "zset") local l = x.list i1, i2 = _z_normrange(l, i1, i2) if not i1 then return {} end local inc = 1 if descending then i1 = #l - i1 + 1 i2 = #l - i2 + 1 inc = -1 end local r = {} if withscores then for i=i1, i2, inc do r[#r+1] = {l[i].v, l[i].s} end else for i=i1, i2, inc do r[#r+1] = l[i].v end end return r end end local zrange = _zranger(false) local zrevrange = _zranger(true) local _zrangerbyscore = function(descending) return function(self, k, s1, s2, ...) k, s1, s2 = chkargs(3, k, s1, s2) local opts = _zrbs_opts(...) local x = xgetr(self, k, "zset") local i1, i2 = _zrbs_limits(x, s1, s2, descending) if not (i1 and i2) then return {} end if opts.limit then if opts.limit.count == 0 then return {} end i1 = i1 + opts.limit.offset if i1 > i2 then return {} end i2 = math.min(i2, i1+opts.limit.count-1) end if descending then return zrevrange(self, k, i1, i2, opts) else return zrange(self, k, i1, i2, opts) end end end local zrangebyscore = _zrangerbyscore(false) local zrevrangebyscore = _zrangerbyscore(true) local zrank = function(self, k, v) local x = xgetr(self, k, "zset") local r = x.set[v] if r then return r-1 else return nil end end local zrem = function(self, k, ...) k = chkarg(k) local arg = getargs(...) local x, r = xgetw(self, k, "zset"), 0 for i=1,#arg do if _z_remove(x, arg[i]) then r = r + 1 end end cleanup(self, k) return r end local zremrangebyrank = function(self, k, i1, i2) k = chkarg(k) local x = xgetw(self, k, "zset") i1, i2 = _z_normrange(x.list, i1, i2) if not i1 then cleanup(self, k) return 0 end local n = _z_remove_range(x, i1, i2) cleanup(self, k) return n end local zremrangebyscore = function(self, k, s1, s2) local x = xgetr(self, k, "zset") local i1, i2 = _zrbs_limits(x, s1, s2, false) if not (i1 and i2) then return 0 end assert(i2 >= i1) return zremrangebyrank(self, k, i1, i2) end local zrevrank = function(self, k, v) local x = xgetr(self, k, "zset") local r = x.set[v] if r then return #x.list-r else return nil end end local zscore = function(self, k, v) local x = xgetr(self, k, "zset") local p = x.list[x.set[v]] if p then return p.s else return nil end end local zunionstore = function(self, ...) local params = _z_store_params(...) local x = xdefv("zset") local default_score, aggregate if params.aggregate == "sum" then default_score = 0 aggregate = function(x, y) return x+y end elseif params.aggregate == "min" then default_score = math.huge aggregate = math.min elseif params.aggregate == "max" then default_score = -math.huge aggregate = math.max else error() end local y, p1, p2 for i=1,#params.keys do y = xgetr(self, params.keys[i], "zset") for j=1,#y.list do p1 = y.list[j] p2 = _z_pair( aggregate( params.weights[i] * p1.s, x.set[p1.v] and x.list[x.set[p1.v]].s or default_score ), p1.v ) _z_update(x, p2) end end local r = #x.list if r > 0 then self.data[params.dest] = {ktype = "zset", value = x} end return r end -- connection local echo = function(self, v) return v end local ping = function(self) return true end -- server local flushdb = function(self) self.data = {} return true end --- Class local methods = { -- keys del = del, -- (...) -> #removed exists = chkargs_wrap(exists, 1), -- (k) -> exists? keys = keys, -- (pattern) -> list of keys ["type"] = chkargs_wrap(_type, 1), -- (k) -> [string|list|set|zset|hash|none] randomkey = randomkey, -- () -> [k|nil] rename = chkargs_wrap(rename, 2), -- (k,k2) -> true renamenx = chkargs_wrap(renamenx, 2), -- (k,k2) -> ! existed? k2 -- strings append = chkargs_wrap(append, 2), -- (k,v) -> #new bitcount = bitcount, -- (k,[start,end]) -> n bitop = bitop, -- ([and|or|xor|not],k,...) decr = chkargs_wrap(decr, 1), -- (k) -> new decrby = decrby, -- (k,n) -> new get = chkargs_wrap(get, 1), -- (k) -> [v|nil] getbit = getbit, -- (k,offset) -> b getrange = getrange, -- (k,start,end) -> string getset = chkargs_wrap(getset, 2), -- (k,v) -> [oldv|nil] incr = chkargs_wrap(incr, 1), -- (k) -> new incrby = incrby, -- (k,n) -> new incrbyfloat = incrbyfloat, -- (k,n) -> new mget = mget, -- (k1,...) -> {v1,...} mset = mset, -- (k1,v1,...) -> true msetnx = msetnx, -- (k1,v1,...) -> worked? (i.e. !existed? any k) set = chkargs_wrap(set, 2), -- (k,v) -> true setbit = setbit, -- (k,offset,b) -> old setnx = chkargs_wrap(setnx, 2), -- (k,v) -> worked? (i.e. !existed?) setrange = setrange, -- (k,offset,val) -> #new strlen = chkargs_wrap(strlen, 1), -- (k) -> [#v|0] -- hashes hdel = hdel, -- (k,sk1,...) -> #removed hexists = chkargs_wrap(hexists, 2), -- (k,sk) -> exists? hget = chkargs_wrap(hget,2), -- (k,sk) -> v hgetall = chkargs_wrap(hgetall, 1), -- (k) -> map hincrby = hincrby, -- (k,sk,n) -> new hincrbyfloat = hincrbyfloat, -- (k,sk,n) -> new hkeys = chkargs_wrap(hkeys, 1), -- (k) -> keys hlen = chkargs_wrap(hlen, 1), -- (k) -> [#sk|0] hmget = hmget, -- (k,{sk1,...}) -> {v1,...} hmset = hmset, -- (k,{sk1=v1,...}) -> true hset = chkargs_wrap(hset, 3), -- (k,sk1,v1) -> !existed? hsetnx = chkargs_wrap(hsetnx, 3), -- (k,sk1,v1) -> worked? (i.e. !existed?) hvals = chkargs_wrap(hvals, 1), -- (k) -> values -- lists blpop = blpop, -- (k1,...) -> k,v brpop = brpop, -- (k1,...) -> k,v brpoplpush = brpoplpush, -- (k1,k2,timeout) -> v lindex = lindex, -- (k,i) -> v linsert = chkargs_wrap(linsert, 4), -- (k,mode,pivot,v) -> #list (after) llen = chkargs_wrap(llen, 1), -- (k) -> #list lpop = chkargs_wrap(lpop, 1), -- (k) -> v lpush = lpush, -- (k,v1,...) -> #list (after) lpushx = chkargs_wrap(lpushx, 2), -- (k,v) -> #list (after) lrange = lrange, -- (k,start,stop) -> list lrem = lrem, -- (k,count,v) -> #removed lset = lset, -- (k,i,v) -> true ltrim = ltrim, -- (k,start,stop) -> true rpop = chkargs_wrap(rpop, 1), -- (k) -> v rpoplpush = chkargs_wrap(rpoplpush, 2), -- (k1,k2) -> v rpush = rpush, -- (k,v1,...) -> #list (after) rpushx = chkargs_wrap(rpushx, 2), -- (k,v) -> #list (after) -- sets sadd = sadd, -- (k,v1,...) -> #added scard = chkargs_wrap(scard, 1), -- (k) -> [n|0] sdiff = sdiff, -- (k1,...) -> set (of elements in k1 & not in any of ...) sdiffstore = sdiffstore, -- (k0,k1,...) -> #set at k0 sinter = sinter, -- (k1,...) -> set sinterstore = sinterstore, -- (k0,k1,...) -> #set at k0 sismember = chkargs_wrap(sismember, 2), -- (k,v) -> member? smembers = chkargs_wrap(smembers, 1), -- (k) -> set smove = chkargs_wrap(smove, 3), -- (k1,k2,v) -> moved? (i.e. !member? k1) spop = chkargs_wrap(spop, 1), -- (k) -> [v|nil] srandmember = srandmember, -- (k,[count]) -> v|[v1,v2,...] srem = srem, -- (k,v1,...) -> #removed sunion = sunion, -- (k1,...) -> set sunionstore = sunionstore, -- (k0,k1,...) -> #set at k0 -- zsets zadd = zadd, -- (k,score,member,[score,member,...]) zcard = chkargs_wrap(zcard, 1), -- (k) -> n zcount = chkargs_wrap(zcount, 3), -- (k,min,max) -> count zincrby = zincrby, -- (k,score,v) -> score zinterstore = zinterstore, -- (k,numkeys,k1,...,[opts]) -> card zrange = zrange, -- (k,start,stop,[opts]) -> depends on opts zrangebyscore = zrangebyscore, -- (k,min,max,[opts]) -> depends on opts zrank = chkargs_wrap(zrank, 2), -- (k,v) -> rank zrem = zrem, -- (k,v1,...) -> #removed zremrangebyrank = zremrangebyrank, -- (k,start,stop) -> #removed zremrangebyscore = chkargs_wrap(zremrangebyscore, 3), -- (k,min,max) -> #removed zrevrange = zrevrange, -- (k,start,stop,[opts]) -> depends on opts zrevrangebyscore = zrevrangebyscore, -- (k,min,max,[opts]) -> depends on opts zrevrank = chkargs_wrap(zrevrank, 2), -- (k,v) -> rank zscore = chkargs_wrap(zscore, 2), -- (k,v) -> score zunionstore = zunionstore, -- (k,numkeys,k1,...,[opts]) -> card -- connection echo = chkargs_wrap(echo, 1), -- (v) -> v ping = ping, -- () -> true -- server flushall = flushdb, -- () -> true flushdb = flushdb, -- () -> true -- debug dbg_zcoherence = dbg_zcoherence, } local new = function() local r = {data = {}} return setmetatable(r,{__index = methods}) end return { new = new, }
gpl-2.0
ccyphers/kong
kong/plugins/basic-auth/migrations/postgres.lua
8
1152
return { { name = "2015-08-03-132400_init_basicauth", up = [[ CREATE TABLE IF NOT EXISTS basicauth_credentials( id uuid, consumer_id uuid REFERENCES consumers (id) ON DELETE CASCADE, username text, password text, created_at timestamp without time zone default (CURRENT_TIMESTAMP(0) at time zone 'utc'), PRIMARY KEY (id) ); DO $$ BEGIN IF (SELECT to_regclass('basicauth_username_idx')) IS NULL THEN CREATE INDEX basicauth_username_idx ON basicauth_credentials(username); END IF; IF (SELECT to_regclass('basicauth_consumer_id_idx')) IS NULL THEN CREATE INDEX basicauth_consumer_id_idx ON basicauth_credentials(consumer_id); END IF; END$$; ]], down = [[ DROP TABLE basicauth_credentials; ]] }, { name = "2017-01-25-180400_unique_username", up = [[ ALTER TABLE basicauth_credentials ADD CONSTRAINT basicauth_credentials_username_key UNIQUE(username); ]], down = [[ ALTER TABLE basicauth_credentials DROP CONSTRAINT basicauth_credentials_username_key; ]] } }
apache-2.0
EliasOenal/blobby
data/scripts/old/hyperion03.lua
4
4150
-- Hyperion v0.3 by Hyperion -- Ein paar Ideen stammen von anderen Bots, z.B. vom Combot -- Playtesting hauptsächlich gegen Combot und Dumpjump -- Bot hat noch einige Schwierigkeiten bei Netzbällen, der Aufschlag ist zu variabel und dadurch nicht gut genug -- Die Spielweise ist nicht berechnet, sondern durch Playtesting entstanden -- Wird sich vielleicht bei der nächsten Version ändern, ich habe allerdings noch keine echte Schwäche gefunden, deswegen bin ich ein bisschen unmotiviert. -- Kann noch nicht blocken und macht ab und zu Fehlaufschläge. -- Hat in meinen Tests gegen alle anderen Bots gewonnen (und gegen mich leider auch). Verliert zwar ab und zu durch Netzroller, aber ich habs nicht geschafft zwei Punkte hintereinander zu machen. -- Der Code ist stellenweise ziemlich schlecht, ich weiß. -- [Die Dimensionen der Blobbywelt] field_width = 800 field_middle = 400 ball_radius = 31.5 net_radius = 7 net_height = 323 -- Die Kugel am Netz mit eingeschlossen, das ist im Sourcecode falsch dokumentiert blobby_groesse = 89 blobby_head = 25 blobby_bottom_radius = 33 blobby_center = 100+89/2 ground = 100 plane = 220.5 -- [Die Physik in der Blobbywelt] -- Die Zeit wird in steps=t gemessen, ein step entspricht dabei einen Frame, die Geschwindigkeit ist also von der Framerate abhängig (die Spielgeschwindigkeit wird auch über die Framerate gesteuert!!! ball_grav = 0.28 -- Der Ball fällt also langsamer als der Blobby auf die Erde zurück blobby_grav = 0.44 --eigentlich 0.88 aber wenn man sprungtaste gedrückt hält dann so, da es ohne sinnlos ist, kümmern wir uns nicht um die andere blobby_speed = 4.5 blobby_jump_speed = 14.5 -- [Hilfsfunktionen] function timetoy(y) -- Funktion arbeitet korrekt, driftet nur t=0.001 pro step a=ball_grav v=bspeedy() y0=bally() t=(v/a-1/10+math.sqrt(v^2/a^2-v/(5*a)+1/100+2*(y0-y)/a)) return t end function timetox(x) v=bspeedx() x0=ballx() t=(x-x0)/v return t end function ypos(t) y=bally()+(bspeedy()-(ball_grav/10))*t-(1/2)*ball_grav*t^2 return y end function estimatef(height) x=ballx()+bspeedx()*timetoy(height) return x end function estimate(y) x=estimatef(y) if (x>ball_radius) and (x<361.5) then impact=x end if (x<ball_radius) then impact=(2*ball_radius)-x end if (x>361.5) then if (ballx()<361.5) then if(ypos(timetox(361.5))<net_height+ball_radius) then impact=2*361.5-x end else impact=x end end return impact end -- [Spielfunktionen] function retten() if (posx()<280) then x=estimate(333) if (math.abs((x-40)-posx())>3) then moveto(x-40) end if (timetoy(333)<10) then jump() end else x=estimate(333) if (math.abs((x-20)-posx())>3) then moveto(x-20) end if (timetoy(333)<10) then jump() end end end function ueberspielen() if (posx()<280) then x=estimate(437) if (math.abs((x-30)-posx())>3) then moveto(x-30) end if (timetoy(437)<24) then jump() end else x=estimate(437) if (math.abs((x-15)-posx())>3) then moveto(x-15) end if (timetoy(437)<24) then jump() end end end function schmettern() x=estimate(437) t=timetoy(437) if (t>24) and (math.abs((x-90)-posx())>3) then moveto(x-90) end if (t<24) then jump() end if (t<5) then right() end end -- [Hauptprogramm] function OnServe(ballready) if (new==nil) then new=1 end if (new==1) then j=math.random() p=math.random(30,55) new=2 end if (j>0.5) then if (math.abs(posx()-200)>3) then moveto(200) else jump() end else if (math.abs(posx()-(200-p))>3) then moveto(200-p) else jump() end end end function OnOpponentServe() moveto(200) end function OnGame() new=1 x=estimate(220.5) if (x<420) then if (touches()==0) then moveto(x) newp=1 end if (touches()==1) then if (newp==1) then p1=math.random() newp=2 end if (oppx()>300) then if(p1>0.4) then ueberspielen() else schmettern() end else if(p1>0.6) then ueberspielen() else schmettern() end end end if (touches()==2) then retten() end else moveto(200) end end
gpl-2.0
scan-bot/scan-bot
plugins/wiki.lua
735
4364
-- http://git.io/vUA4M local socket = require "socket" local JSON = require "cjson" local wikiusage = { "!wiki [text]: Read extract from default Wikipedia (EN)", "!wiki(lang) [text]: Read extract from 'lang' Wikipedia. Example: !wikies hola", "!wiki search [text]: Search articles on default Wikipedia (EN)", "!wiki(lang) search [text]: Search articles on 'lang' Wikipedia. Example: !wikies search hola", } local Wikipedia = { -- http://meta.wikimedia.org/wiki/List_of_Wikipedias wiki_server = "https://%s.wikipedia.org", wiki_path = "/w/api.php", wiki_load_params = { action = "query", prop = "extracts", format = "json", exchars = 300, exsectionformat = "plain", explaintext = "", redirects = "" }, wiki_search_params = { action = "query", list = "search", srlimit = 20, format = "json", }, default_lang = "en", } function Wikipedia:getWikiServer(lang) return string.format(self.wiki_server, lang or self.default_lang) end --[[ -- return decoded JSON table from Wikipedia --]] function Wikipedia:loadPage(text, lang, intro, plain, is_search) local request, sink = {}, {} local query = "" local parsed if is_search then for k,v in pairs(self.wiki_search_params) do query = query .. k .. '=' .. v .. '&' end parsed = URL.parse(self:getWikiServer(lang)) parsed.path = self.wiki_path parsed.query = query .. "srsearch=" .. URL.escape(text) else self.wiki_load_params.explaintext = plain and "" or nil for k,v in pairs(self.wiki_load_params) do query = query .. k .. '=' .. v .. '&' end parsed = URL.parse(self:getWikiServer(lang)) parsed.path = self.wiki_path parsed.query = query .. "titles=" .. URL.escape(text) end -- HTTP request request['url'] = URL.build(parsed) print(request['url']) request['method'] = 'GET' request['sink'] = ltn12.sink.table(sink) local httpRequest = parsed.scheme == 'http' and http.request or https.request local code, headers, status = socket.skip(1, httpRequest(request)) if not headers or not sink then return nil end local content = table.concat(sink) if content ~= "" then local ok, result = pcall(JSON.decode, content) if ok and result then return result else return nil end else return nil end end -- extract intro passage in wiki page function Wikipedia:wikintro(text, lang) local result = self:loadPage(text, lang, true, true) if result and result.query then local query = result.query if query and query.normalized then text = query.normalized[1].to or text end local page = query.pages[next(query.pages)] if page and page.extract then return text..": "..page.extract else local text = "Extract not found for "..text text = text..'\n'..table.concat(wikiusage, '\n') return text end else return "Sorry an error happened" end end -- search for term in wiki function Wikipedia:wikisearch(text, lang) local result = self:loadPage(text, lang, true, true, true) if result and result.query then local titles = "" for i,item in pairs(result.query.search) do titles = titles .. "\n" .. item["title"] end titles = titles ~= "" and titles or "No results found" return titles else return "Sorry, an error occurred" end end local function run(msg, matches) -- TODO: Remember language (i18 on future version) -- TODO: Support for non Wikipedias but Mediawikis local search, term, lang if matches[1] == "search" then search = true term = matches[2] lang = nil elseif matches[2] == "search" then search = true term = matches[3] lang = matches[1] else term = matches[2] lang = matches[1] end if not term then term = lang lang = nil end if term == "" then local text = "Usage:\n" text = text..table.concat(wikiusage, '\n') return text end local result if search then result = Wikipedia:wikisearch(term, lang) else -- TODO: Show the link result = Wikipedia:wikintro(term, lang) end return result end return { description = "Searches Wikipedia and send results", usage = wikiusage, patterns = { "^![Ww]iki(%w+) (search) (.+)$", "^![Ww]iki (search) ?(.*)$", "^![Ww]iki(%w+) (.+)$", "^![Ww]iki ?(.*)$" }, run = run }
gpl-2.0
area31/telegram-bot
plugins/wiki.lua
735
4364
-- http://git.io/vUA4M local socket = require "socket" local JSON = require "cjson" local wikiusage = { "!wiki [text]: Read extract from default Wikipedia (EN)", "!wiki(lang) [text]: Read extract from 'lang' Wikipedia. Example: !wikies hola", "!wiki search [text]: Search articles on default Wikipedia (EN)", "!wiki(lang) search [text]: Search articles on 'lang' Wikipedia. Example: !wikies search hola", } local Wikipedia = { -- http://meta.wikimedia.org/wiki/List_of_Wikipedias wiki_server = "https://%s.wikipedia.org", wiki_path = "/w/api.php", wiki_load_params = { action = "query", prop = "extracts", format = "json", exchars = 300, exsectionformat = "plain", explaintext = "", redirects = "" }, wiki_search_params = { action = "query", list = "search", srlimit = 20, format = "json", }, default_lang = "en", } function Wikipedia:getWikiServer(lang) return string.format(self.wiki_server, lang or self.default_lang) end --[[ -- return decoded JSON table from Wikipedia --]] function Wikipedia:loadPage(text, lang, intro, plain, is_search) local request, sink = {}, {} local query = "" local parsed if is_search then for k,v in pairs(self.wiki_search_params) do query = query .. k .. '=' .. v .. '&' end parsed = URL.parse(self:getWikiServer(lang)) parsed.path = self.wiki_path parsed.query = query .. "srsearch=" .. URL.escape(text) else self.wiki_load_params.explaintext = plain and "" or nil for k,v in pairs(self.wiki_load_params) do query = query .. k .. '=' .. v .. '&' end parsed = URL.parse(self:getWikiServer(lang)) parsed.path = self.wiki_path parsed.query = query .. "titles=" .. URL.escape(text) end -- HTTP request request['url'] = URL.build(parsed) print(request['url']) request['method'] = 'GET' request['sink'] = ltn12.sink.table(sink) local httpRequest = parsed.scheme == 'http' and http.request or https.request local code, headers, status = socket.skip(1, httpRequest(request)) if not headers or not sink then return nil end local content = table.concat(sink) if content ~= "" then local ok, result = pcall(JSON.decode, content) if ok and result then return result else return nil end else return nil end end -- extract intro passage in wiki page function Wikipedia:wikintro(text, lang) local result = self:loadPage(text, lang, true, true) if result and result.query then local query = result.query if query and query.normalized then text = query.normalized[1].to or text end local page = query.pages[next(query.pages)] if page and page.extract then return text..": "..page.extract else local text = "Extract not found for "..text text = text..'\n'..table.concat(wikiusage, '\n') return text end else return "Sorry an error happened" end end -- search for term in wiki function Wikipedia:wikisearch(text, lang) local result = self:loadPage(text, lang, true, true, true) if result and result.query then local titles = "" for i,item in pairs(result.query.search) do titles = titles .. "\n" .. item["title"] end titles = titles ~= "" and titles or "No results found" return titles else return "Sorry, an error occurred" end end local function run(msg, matches) -- TODO: Remember language (i18 on future version) -- TODO: Support for non Wikipedias but Mediawikis local search, term, lang if matches[1] == "search" then search = true term = matches[2] lang = nil elseif matches[2] == "search" then search = true term = matches[3] lang = matches[1] else term = matches[2] lang = matches[1] end if not term then term = lang lang = nil end if term == "" then local text = "Usage:\n" text = text..table.concat(wikiusage, '\n') return text end local result if search then result = Wikipedia:wikisearch(term, lang) else -- TODO: Show the link result = Wikipedia:wikintro(term, lang) end return result end return { description = "Searches Wikipedia and send results", usage = wikiusage, patterns = { "^![Ww]iki(%w+) (search) (.+)$", "^![Ww]iki (search) ?(.*)$", "^![Ww]iki(%w+) (.+)$", "^![Ww]iki ?(.*)$" }, run = run }
gpl-2.0
mohammad25253/persianguard12
plugins/wiki.lua
735
4364
-- http://git.io/vUA4M local socket = require "socket" local JSON = require "cjson" local wikiusage = { "!wiki [text]: Read extract from default Wikipedia (EN)", "!wiki(lang) [text]: Read extract from 'lang' Wikipedia. Example: !wikies hola", "!wiki search [text]: Search articles on default Wikipedia (EN)", "!wiki(lang) search [text]: Search articles on 'lang' Wikipedia. Example: !wikies search hola", } local Wikipedia = { -- http://meta.wikimedia.org/wiki/List_of_Wikipedias wiki_server = "https://%s.wikipedia.org", wiki_path = "/w/api.php", wiki_load_params = { action = "query", prop = "extracts", format = "json", exchars = 300, exsectionformat = "plain", explaintext = "", redirects = "" }, wiki_search_params = { action = "query", list = "search", srlimit = 20, format = "json", }, default_lang = "en", } function Wikipedia:getWikiServer(lang) return string.format(self.wiki_server, lang or self.default_lang) end --[[ -- return decoded JSON table from Wikipedia --]] function Wikipedia:loadPage(text, lang, intro, plain, is_search) local request, sink = {}, {} local query = "" local parsed if is_search then for k,v in pairs(self.wiki_search_params) do query = query .. k .. '=' .. v .. '&' end parsed = URL.parse(self:getWikiServer(lang)) parsed.path = self.wiki_path parsed.query = query .. "srsearch=" .. URL.escape(text) else self.wiki_load_params.explaintext = plain and "" or nil for k,v in pairs(self.wiki_load_params) do query = query .. k .. '=' .. v .. '&' end parsed = URL.parse(self:getWikiServer(lang)) parsed.path = self.wiki_path parsed.query = query .. "titles=" .. URL.escape(text) end -- HTTP request request['url'] = URL.build(parsed) print(request['url']) request['method'] = 'GET' request['sink'] = ltn12.sink.table(sink) local httpRequest = parsed.scheme == 'http' and http.request or https.request local code, headers, status = socket.skip(1, httpRequest(request)) if not headers or not sink then return nil end local content = table.concat(sink) if content ~= "" then local ok, result = pcall(JSON.decode, content) if ok and result then return result else return nil end else return nil end end -- extract intro passage in wiki page function Wikipedia:wikintro(text, lang) local result = self:loadPage(text, lang, true, true) if result and result.query then local query = result.query if query and query.normalized then text = query.normalized[1].to or text end local page = query.pages[next(query.pages)] if page and page.extract then return text..": "..page.extract else local text = "Extract not found for "..text text = text..'\n'..table.concat(wikiusage, '\n') return text end else return "Sorry an error happened" end end -- search for term in wiki function Wikipedia:wikisearch(text, lang) local result = self:loadPage(text, lang, true, true, true) if result and result.query then local titles = "" for i,item in pairs(result.query.search) do titles = titles .. "\n" .. item["title"] end titles = titles ~= "" and titles or "No results found" return titles else return "Sorry, an error occurred" end end local function run(msg, matches) -- TODO: Remember language (i18 on future version) -- TODO: Support for non Wikipedias but Mediawikis local search, term, lang if matches[1] == "search" then search = true term = matches[2] lang = nil elseif matches[2] == "search" then search = true term = matches[3] lang = matches[1] else term = matches[2] lang = matches[1] end if not term then term = lang lang = nil end if term == "" then local text = "Usage:\n" text = text..table.concat(wikiusage, '\n') return text end local result if search then result = Wikipedia:wikisearch(term, lang) else -- TODO: Show the link result = Wikipedia:wikintro(term, lang) end return result end return { description = "Searches Wikipedia and send results", usage = wikiusage, patterns = { "^![Ww]iki(%w+) (search) (.+)$", "^![Ww]iki (search) ?(.*)$", "^![Ww]iki(%w+) (.+)$", "^![Ww]iki ?(.*)$" }, run = run }
gpl-2.0
kbullaughey/lstm-play
lstm/ReverseSequenceEven.lua
1
1732
local ReverseSequenceEven, parent = torch.class('lstm.ReverseSequenceEven', 'nn.Module') -- This unit takes as input a tensor with the shape BxLxK and it reverses -- the L direction. This is appropriate for batches of sequences that are -- all the same length. -- -- lstm.ReverseSequenceEven(timeDim)(inputs) -- -- The timeDim skips the first dimension, so if the shape is BxTxK then timeDim -- should be 1 because the time dimension is the first dimenion after the batch -- dimenion. This parameterization was chosen to match ReverseSequence(), which -- works in either batch or non-batch mode. -- -- This module is only designed to work with mini-batch (not individual examples). For -- a single sequence, ReverseSequence() can be used. function ReverseSequenceEven:__init(timeDimension, forwardOnly) parent.__init(self) if timeDimension == nil or timeDimension <= 0 then error("Invalid timeDimension: " .. timeDimension) end self.timeDimension = timeDimension self.indices = torch.LongTensor() self.gradInput = lstm.Tensor() end -- This module has no parameters. function ReverseSequenceEven:parameters() return {} end function ReverseSequenceEven:reverse(dest, src) dest:resizeAs(src) local timeSteps = src:size(self.timeDimension+1) if self.indices:dim() ~= 1 or self.indices:size(1) ~= timeSteps then self.indices:resize(timeSteps):copy(torch.range(timeSteps, 1, -1)) end dest:indexCopy(self.timeDimension+1, self.indices, src) return dest end function ReverseSequenceEven:updateOutput(inputs) return self:reverse(self.output, inputs) end function ReverseSequenceEven:updateGradInput(inputs, upstreamGradOutput) return self:reverse(self.gradInput, upstreamGradOutput) end -- END
mit
Ninjistix/darkstar
scripts/zones/Western_Adoulin/npcs/Zaoso.lua
7
1244
----------------------------------- -- Area: Western Adoulin -- NPC: Zaoso -- Type: Standard NPC and Quest NPC -- Involved with Quest: 'A Certain Substitute Patrolman' -- @zone 256 -- !pos -94 3 -11 ----------------------------------- require("scripts/globals/missions"); require("scripts/globals/quests"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local ACSP = player:getQuestStatus(ADOULIN, A_CERTAIN_SUBSTITUTE_PATROLMAN); local SOA_Mission = player:getCurrentMission(SOA); if (SOA_Mission >= LIFE_ON_THE_FRONTIER) then if ((ACSP == QUEST_ACCEPTED) and (player:getVar("ACSP_NPCs_Visited") == 1)) then -- Progresses Quest: 'A Certain Substitute Patrolman' player:startEvent(2553); else -- Standard dialogue player:startEvent(574); end else -- Dialogue prior to joining colonization effort player:startEvent(506); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 2553) then -- Progresses Quest: 'A Certain Substitute Patrolman' player:setVar("ACSP_NPCs_Visited", 2); end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Lower_Jeuno/npcs/Hasim.lua
2
1530
----------------------------------- -- Area: Lower Jeuno -- NPC: Hasim -- Standard Merchant NPC ----------------------------------- require("scripts/globals/shop"); package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Lower_Jeuno/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) player:showText(npc,HASIM_SHOP_DIALOG); local stock = { 0x1244,930, -- Scroll of Baraera 0x123e,930, -- Scroll of Baraero 0x1243,3624, -- Scroll of Barblizzara 0x123d,3624, -- Scroll of Barblizzard 0x1242,1760, -- Scroll of Barfira 0x123c,1760, -- Scroll of Barfire 0x1245,156, -- Scroll of Barstonra 0x123f,156, -- Scroll of Barstone 0x1246,5754, -- Scroll of Barthundra 0x1240,5754, -- Scroll of Barthunder 0x1247,360, -- Scroll of Barwatera 0x1241,360, -- Scroll of Barwater 0x1208,11200, -- Scroll of Curaga II 0x1209,19932, -- Scroll of Curaga III 0x1204,23400, -- Scroll of Cure IV 0x122d,32000} -- Scroll of Protect III showShop(player, STATIC, stock); end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Apollyon/npcs/Sentinel_Column.lua
5
1157
----------------------------------- -- Area: Appolyon -- NPC: Sentinel_Column -- !pos ----------------------------------- require("scripts/globals/limbus"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:startEvent(221,127); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); --printf("RESULT: %u",option); player:updateEvent(0,player:getSpecialBattlefieldLeftTime(2),player:getSpecialBattlefieldLeftTime(1),player:getSpecialBattlefieldLeftTime(4),player:getSpecialBattlefieldLeftTime(3),player:getSpecialBattlefieldLeftTime(6),player:getSpecialBattlefieldLeftTime(5)); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0) then end end;
gpl-3.0
Ninjistix/darkstar
scripts/globals/abilities/pets/attachments/strobe.lua
4
1255
----------------------------------- -- Attachment: Strobe -- http://forum.square-enix.com/ffxi/threads/49065?p=565264#post565264 -- Values are currently PRIOR TO NOVEMBER 2015 UPDATE! ----------------------------------- require("scripts/globals/status"); function onEquip(pet) pet:addMod(MOD_ENMITY, 10) pet:addListener("AUTOMATON_ATTACHMENT_CHECK", "ATTACHMENT_STROBE", function(automaton, target) if automaton:getLocalVar("provoke") < VanadielTime() and (automaton:checkDistance(target) - target:getModelSize()) < 7 then automaton:useMobAbility(1945) else return 0 end end) end function onUnequip(pet) pet:delMod(MOD_ENMITY, 10) pet:removeListener("ATTACHMENT_STROBE") end function onManeuverGain(pet,maneuvers) if (maneuvers == 1) then pet:addMod(MOD_ENMITY, 15); elseif (maneuvers == 2) then pet:addMod(MOD_ENMITY, 15); elseif (maneuvers == 3) then pet:addMod(MOD_ENMITY, 20); end end function onManeuverLose(pet,maneuvers) if (maneuvers == 1) then pet:delMod(MOD_ENMITY, 15); elseif (maneuvers == 2) then pet:delMod(MOD_ENMITY, 15); elseif (maneuvers == 3) then pet:delMod(MOD_ENMITY, 20); end end
gpl-3.0
SHIELDTM/shieldbot
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses/by/3.0/deed.en_US -- -- It can be used for any purpose so long as the copyright notice above, -- the web-page links above, and the 'AUTHOR_NOTE' string below are -- maintained. Enjoy. -- local VERSION = 20141223.14 -- version history at end of file local AUTHOR_NOTE = "-[ JSON.lua package by Jeffrey Friedl (http://regex.info/blog/lua/json) version 20141223.14 ]-" -- -- The 'AUTHOR_NOTE' variable exists so that information about the source -- of the package is maintained even in compiled versions. It's also -- included in OBJDEF below mostly to quiet warnings about unused variables. -- local OBJDEF = { VERSION = VERSION, AUTHOR_NOTE = AUTHOR_NOTE, } -- -- Simple JSON encoding and decoding in pure Lua. -- http://www.json.org/ -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- -- -- -- DECODING (from a JSON string to a Lua table) -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- If the JSON text is for an object or an array, e.g. -- { "what": "books", "count": 3 } -- or -- [ "Larry", "Curly", "Moe" ] -- -- the result is a Lua table, e.g. -- { what = "books", count = 3 } -- or -- { "Larry", "Curly", "Moe" } -- -- -- The encode and decode routines accept an optional second argument, -- "etc", which is not used during encoding or decoding, but upon error -- is passed along to error handlers. It can be of any type (including nil). -- -- -- -- ERROR HANDLING -- -- With most errors during decoding, this code calls -- -- JSON:onDecodeError(message, text, location, etc) -- -- with a message about the error, and if known, the JSON text being -- parsed and the byte count where the problem was discovered. You can -- replace the default JSON:onDecodeError() with your own function. -- -- The default onDecodeError() merely augments the message with data -- about the text and the location if known (and if a second 'etc' -- argument had been provided to decode(), its value is tacked onto the -- message as well), and then calls JSON.assert(), which itself defaults -- to Lua's built-in assert(), and can also be overridden. -- -- For example, in an Adobe Lightroom plugin, you might use something like -- -- function JSON:onDecodeError(message, text, location, etc) -- LrErrors.throwUserError("Internal Error: invalid JSON data") -- end -- -- or even just -- -- function JSON.assert(message) -- LrErrors.throwUserError("Internal Error: " .. message) -- end -- -- If JSON:decode() is passed a nil, this is called instead: -- -- JSON:onDecodeOfNilError(message, nil, nil, etc) -- -- and if JSON:decode() is passed HTML instead of JSON, this is called: -- -- JSON:onDecodeOfHTMLError(message, text, nil, etc) -- -- The use of the fourth 'etc' argument allows stronger coordination -- between decoding and error reporting, especially when you provide your -- own error-handling routines. Continuing with the the Adobe Lightroom -- plugin example: -- -- function JSON:onDecodeError(message, text, location, etc) -- local note = "Internal Error: invalid JSON data" -- if type(etc) = 'table' and etc.photo then -- note = note .. " while processing for " .. etc.photo:getFormattedMetadata('fileName') -- end -- LrErrors.throwUserError(note) -- end -- -- : -- : -- -- for i, photo in ipairs(photosToProcess) do -- : -- : -- local data = JSON:decode(someJsonText, { photo = photo }) -- : -- : -- end -- -- -- -- -- -- DECODING AND STRICT TYPES -- -- Because both JSON objects and JSON arrays are converted to Lua tables, -- it's not normally possible to tell which original JSON type a -- particular Lua table was derived from, or guarantee decode-encode -- round-trip equivalency. -- -- However, if you enable strictTypes, e.g. -- -- JSON = assert(loadfile "JSON.lua")() --load the routines -- JSON.strictTypes = true -- -- then the Lua table resulting from the decoding of a JSON object or -- JSON array is marked via Lua metatable, so that when re-encoded with -- JSON:encode() it ends up as the appropriate JSON type. -- -- (This is not the default because other routines may not work well with -- tables that have a metatable set, for example, Lightroom API calls.) -- -- -- ENCODING (from a lua table to a JSON string) -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- local custom_pretty = JSON:encode(lua_table_or_value, etc, { pretty = true, indent = "| ", align_keys = false }) -- -- On error during encoding, this code calls: -- -- JSON:onEncodeError(message, etc) -- -- which you can override in your local JSON object. -- -- The 'etc' in the error call is the second argument to encode() -- and encode_pretty(), or nil if it wasn't provided. -- -- -- PRETTY-PRINTING -- -- An optional third argument, a table of options, allows a bit of -- configuration about how the encoding takes place: -- -- pretty = JSON:encode(val, etc, { -- pretty = true, -- if false, no other options matter -- indent = " ", -- this provides for a three-space indent per nesting level -- align_keys = false, -- see below -- }) -- -- encode() and encode_pretty() are identical except that encode_pretty() -- provides a default options table if none given in the call: -- -- { pretty = true, align_keys = false, indent = " " } -- -- For example, if -- -- JSON:encode(data) -- -- produces: -- -- {"city":"Kyoto","climate":{"avg_temp":16,"humidity":"high","snowfall":"minimal"},"country":"Japan","wards":11} -- -- then -- -- JSON:encode_pretty(data) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- The following three lines return identical results: -- JSON:encode_pretty(data) -- JSON:encode_pretty(data, nil, { pretty = true, align_keys = false, indent = " " }) -- JSON:encode (data, nil, { pretty = true, align_keys = false, indent = " " }) -- -- An example of setting your own indent string: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = "| " }) -- -- produces: -- -- { -- | "city": "Kyoto", -- | "climate": { -- | | "avg_temp": 16, -- | | "humidity": "high", -- | | "snowfall": "minimal" -- | }, -- | "country": "Japan", -- | "wards": 11 -- } -- -- An example of setting align_keys to true: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = " ", align_keys = true }) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- which I must admit is kinda ugly, sorry. This was the default for -- encode_pretty() prior to version 20141223.14. -- -- -- AMBIGUOUS SITUATIONS DURING THE ENCODING -- -- During the encode, if a Lua table being encoded contains both string -- and numeric keys, it fits neither JSON's idea of an object, nor its -- idea of an array. To get around this, when any string key exists (or -- when non-positive numeric keys exist), numeric keys are converted to -- strings. -- -- For example, -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- produces the JSON object -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To prohibit this conversion and instead make it an error condition, set -- JSON.noKeyConversion = true -- -- -- SUMMARY OF METHODS YOU CAN OVERRIDE IN YOUR LOCAL LUA JSON OBJECT -- -- assert -- onDecodeError -- onDecodeOfNilError -- onDecodeOfHTMLError -- onEncodeError -- -- If you want to create a separate Lua JSON object with its own error handlers, -- you can reload JSON.lua or use the :new() method. -- --------------------------------------------------------------------------- local default_pretty_indent = " " local default_pretty_options = { pretty = true, align_keys = false, indent = default_pretty_indent } local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject function OBJDEF:newArray(tbl) return setmetatable(tbl or {}, isArray) end function OBJDEF:newObject(tbl) return setmetatable(tbl or {}, isObject) end local function unicode_codepoint_as_utf8(codepoint) -- -- codepoint is a number -- if codepoint <= 127 then return string.char(codepoint) elseif codepoint <= 2047 then -- -- 110yyyxx 10xxxxxx <-- useful notation from http://en.wikipedia.org/wiki/Utf8 -- local highpart = math.floor(codepoint / 0x40) local lowpart = codepoint - (0x40 * highpart) return string.char(0xC0 + highpart, 0x80 + lowpart) elseif codepoint <= 65535 then -- -- 1110yyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x1000) local remainder = codepoint - 0x1000 * highpart local midpart = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midpart highpart = 0xE0 + highpart midpart = 0x80 + midpart lowpart = 0x80 + lowpart -- -- Check for an invalid character (thanks Andy R. at Adobe). -- See table 3.7, page 93, in http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#G28070 -- if ( highpart == 0xE0 and midpart < 0xA0 ) or ( highpart == 0xED and midpart > 0x9F ) or ( highpart == 0xF0 and midpart < 0x90 ) or ( highpart == 0xF4 and midpart > 0x8F ) then return "?" else return string.char(highpart, midpart, lowpart) end else -- -- 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x40000) local remainder = codepoint - 0x40000 * highpart local midA = math.floor(remainder / 0x1000) remainder = remainder - 0x1000 * midA local midB = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midB return string.char(0xF0 + highpart, 0x80 + midA, 0x80 + midB, 0x80 + lowpart) end end function OBJDEF:onDecodeError(message, text, location, etc) if text then if location then message = string.format("%s at char %d of: %s", message, location, text) else message = string.format("%s: %s", message, text) end end if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end OBJDEF.onDecodeOfNilError = OBJDEF.onDecodeError OBJDEF.onDecodeOfHTMLError = OBJDEF.onDecodeError function OBJDEF:onEncodeError(message, etc) if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end local function grok_number(self, text, start, etc) -- -- Grab the integer part -- local integer_part = text:match('^-?[1-9]%d*', start) or text:match("^-?0", start) if not integer_part then self:onDecodeError("expected number", text, start, etc) end local i = start + integer_part:len() -- -- Grab an optional decimal part -- local decimal_part = text:match('^%.%d+', i) or "" i = i + decimal_part:len() -- -- Grab an optional exponential part -- local exponent_part = text:match('^[eE][-+]?%d+', i) or "" i = i + exponent_part:len() local full_number_text = integer_part .. decimal_part .. exponent_part local as_number = tonumber(full_number_text) if not as_number then self:onDecodeError("bad number", text, start, etc) end return as_number, i end local function grok_string(self, text, start, etc) if text:sub(start,start) ~= '"' then self:onDecodeError("expected string's opening quote", text, start, etc) end local i = start + 1 -- +1 to bypass the initial quote local text_len = text:len() local VALUE = "" while i <= text_len do local c = text:sub(i,i) if c == '"' then return VALUE, i + 1 end if c ~= '\\' then VALUE = VALUE .. c i = i + 1 elseif text:match('^\\b', i) then VALUE = VALUE .. "\b" i = i + 2 elseif text:match('^\\f', i) then VALUE = VALUE .. "\f" i = i + 2 elseif text:match('^\\n', i) then VALUE = VALUE .. "\n" i = i + 2 elseif text:match('^\\r', i) then VALUE = VALUE .. "\r" i = i + 2 elseif text:match('^\\t', i) then VALUE = VALUE .. "\t" i = i + 2 else local hex = text:match('^\\u([0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if hex then i = i + 6 -- bypass what we just read -- We have a Unicode codepoint. It could be standalone, or if in the proper range and -- followed by another in a specific range, it'll be a two-code surrogate pair. local codepoint = tonumber(hex, 16) if codepoint >= 0xD800 and codepoint <= 0xDBFF then -- it's a hi surrogate... see whether we have a following low local lo_surrogate = text:match('^\\u([dD][cdefCDEF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if lo_surrogate then i = i + 6 -- bypass the low surrogate we just read codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16) else -- not a proper low, so we'll just leave the first codepoint as is and spit it out. end end VALUE = VALUE .. unicode_codepoint_as_utf8(codepoint) else -- just pass through what's escaped VALUE = VALUE .. text:match('^\\(.)', i) i = i + 2 end end end self:onDecodeError("unclosed string", text, start, etc) end local function skip_whitespace(text, start) local _, match_end = text:find("^[ \n\r\t]+", start) -- [http://www.ietf.org/rfc/rfc4627.txt] Section 2 if match_end then return match_end + 1 else return start end end local grok_one -- assigned later local function grok_object(self, text, start, etc) if text:sub(start,start) ~= '{' then self:onDecodeError("expected '{'", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '{' local VALUE = self.strictTypes and self:newObject { } or { } if text:sub(i,i) == '}' then return VALUE, i + 1 end local text_len = text:len() while i <= text_len do local key, new_i = grok_string(self, text, i, etc) i = skip_whitespace(text, new_i) if text:sub(i, i) ~= ':' then self:onDecodeError("expected colon", text, i, etc) end i = skip_whitespace(text, i + 1) local new_val, new_i = grok_one(self, text, i) VALUE[key] = new_val -- -- Expect now either '}' to end things, or a ',' to allow us to continue. -- i = skip_whitespace(text, new_i) local c = text:sub(i,i) if c == '}' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '}'", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '{'", text, start, etc) end local function grok_array(self, text, start, etc) if text:sub(start,start) ~= '[' then self:onDecodeError("expected '['", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '[' local VALUE = self.strictTypes and self:newArray { } or { } if text:sub(i,i) == ']' then return VALUE, i + 1 end local VALUE_INDEX = 1 local text_len = text:len() while i <= text_len do local val, new_i = grok_one(self, text, i) -- can't table.insert(VALUE, val) here because it's a no-op if val is nil VALUE[VALUE_INDEX] = val VALUE_INDEX = VALUE_INDEX + 1 i = skip_whitespace(text, new_i) -- -- Expect now either ']' to end things, or a ',' to allow us to continue. -- local c = text:sub(i,i) if c == ']' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '['", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '['", text, start, etc) end grok_one = function(self, text, start, etc) -- Skip any whitespace start = skip_whitespace(text, start) if start > text:len() then self:onDecodeError("unexpected end of string", text, nil, etc) end if text:find('^"', start) then return grok_string(self, text, start, etc) elseif text:find('^[-0123456789 ]', start) then return grok_number(self, text, start, etc) elseif text:find('^%{', start) then return grok_object(self, text, start, etc) elseif text:find('^%[', start) then return grok_array(self, text, start, etc) elseif text:find('^true', start) then return true, start + 4 elseif text:find('^false', start) then return false, start + 5 elseif text:find('^null', start) then return nil, start + 4 else self:onDecodeError("can't parse JSON", text, start, etc) end end function OBJDEF:decode(text, etc) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onDecodeError("JSON:decode must be called in method format", nil, nil, etc) end if text == nil then self:onDecodeOfNilError(string.format("nil passed to JSON:decode()"), nil, nil, etc) elseif type(text) ~= 'string' then self:onDecodeError(string.format("expected string argument to JSON:decode(), got %s", type(text)), nil, nil, etc) end if text:match('^%s*$') then return nil end if text:match('^%s*<') then -- Can't be JSON... we'll assume it's HTML self:onDecodeOfHTMLError(string.format("html passed to JSON:decode()"), text, nil, etc) end -- -- Ensure that it's not UTF-32 or UTF-16. -- Those are perfectly valid encodings for JSON (as per RFC 4627 section 3), -- but this package can't handle them. -- if text:sub(1,1):byte() == 0 or (text:len() >= 2 and text:sub(2,2):byte() == 0) then self:onDecodeError("JSON package groks only UTF-8, sorry", text, nil, etc) end local success, value = pcall(grok_one, self, text, 1, etc) if success then return value else -- if JSON:onDecodeError() didn't abort out of the pcall, we'll have received the error message here as "value", so pass it along as an assert. if self.assert then self.assert(false, value) else assert(false, value) end -- and if we're still here, return a nil and throw the error message on as a second arg return nil, value end end local function backslash_replacement_function(c) if c == "\n" then return "\\n" elseif c == "\r" then return "\\r" elseif c == "\t" then return "\\t" elseif c == "\b" then return "\\b" elseif c == "\f" then return "\\f" elseif c == '"' then return '\\"' elseif c == '\\' then return '\\\\' else return string.format("\\u%04x", c:byte()) end end local chars_to_be_escaped_in_JSON_string = '[' .. '"' -- class sub-pattern to match a double quote .. '%\\' -- class sub-pattern to match a backslash .. '%z' -- class sub-pattern to match a null .. '\001' .. '-' .. '\031' -- class sub-pattern to match control characters .. ']' local function json_string_literal(value) local newval = value:gsub(chars_to_be_escaped_in_JSON_string, backslash_replacement_function) return '"' .. newval .. '"' end local function object_or_array(self, T, etc) -- -- We need to inspect all the keys... if there are any strings, we'll convert to a JSON -- object. If there are only numbers, it's a JSON array. -- -- If we'll be converting to a JSON object, we'll want to sort the keys so that the -- end result is deterministic. -- local string_keys = { } local number_keys = { } local number_keys_must_be_strings = false local maximum_number_key for key in pairs(T) do if type(key) == 'string' then table.insert(string_keys, key) elseif type(key) == 'number' then table.insert(number_keys, key) if key <= 0 or key >= math.huge then number_keys_must_be_strings = true elseif not maximum_number_key or key > maximum_number_key then maximum_number_key = key end else self:onEncodeError("can't encode table with a key of type " .. type(key), etc) end end if #string_keys == 0 and not number_keys_must_be_strings then -- -- An empty table, or a numeric-only array -- if #number_keys > 0 then return nil, maximum_number_key -- an array elseif tostring(T) == "JSON array" then return nil elseif tostring(T) == "JSON object" then return { } else -- have to guess, so we'll pick array, since empty arrays are likely more common than empty objects return nil end end table.sort(string_keys) local map if #number_keys > 0 then -- -- If we're here then we have either mixed string/number keys, or numbers inappropriate for a JSON array -- It's not ideal, but we'll turn the numbers into strings so that we can at least create a JSON object. -- if self.noKeyConversion then self:onEncodeError("a table with both numeric and string keys could be an object or array; aborting", etc) end -- -- Have to make a shallow copy of the source table so we can remap the numeric keys to be strings -- map = { } for key, val in pairs(T) do map[key] = val end table.sort(number_keys) -- -- Throw numeric keys in there as strings -- for _, number_key in ipairs(number_keys) do local string_key = tostring(number_key) if map[string_key] == nil then table.insert(string_keys , string_key) map[string_key] = T[number_key] else self:onEncodeError("conflict converting table with mixed-type keys into a JSON object: key " .. number_key .. " exists both as a string and a number.", etc) end end end return string_keys, nil, map end -- -- Encode -- -- 'options' is nil, or a table with possible keys: -- pretty -- if true, return a pretty-printed version -- indent -- a string (usually of spaces) used to indent each nested level -- align_keys -- if true, align all the keys when formatting a table -- local encode_value -- must predeclare because it calls itself function encode_value(self, value, parents, etc, options, indent) if value == nil then return 'null' elseif type(value) == 'string' then return json_string_literal(value) elseif type(value) == 'number' then if value ~= value then -- -- NaN (Not a Number). -- JSON has no NaN, so we have to fudge the best we can. This should really be a package option. -- return "null" elseif value >= math.huge then -- -- Positive infinity. JSON has no INF, so we have to fudge the best we can. This should -- really be a package option. Note: at least with some implementations, positive infinity -- is both ">= math.huge" and "<= -math.huge", which makes no sense but that's how it is. -- Negative infinity is properly "<= -math.huge". So, we must be sure to check the ">=" -- case first. -- return "1e+9999" elseif value <= -math.huge then -- -- Negative infinity. -- JSON has no INF, so we have to fudge the best we can. This should really be a package option. -- return "-1e+9999" else return tostring(value) end elseif type(value) == 'boolean' then return tostring(value) elseif type(value) ~= 'table' then self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc) else -- -- A table to be converted to either a JSON object or array. -- local T = value if type(options) ~= 'table' then options = {} end if type(indent) ~= 'string' then indent = "" end if parents[T] then self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc) else parents[T] = true end local result_value local object_keys, maximum_number_key, map = object_or_array(self, T, etc) if maximum_number_key then -- -- An array... -- local ITEMS = { } for i = 1, maximum_number_key do table.insert(ITEMS, encode_value(self, T[i], parents, etc, options, indent)) end if options.pretty then result_value = "[ " .. table.concat(ITEMS, ", ") .. " ]" else result_value = "[" .. table.concat(ITEMS, ",") .. "]" end elseif object_keys then -- -- An object -- local TT = map or T if options.pretty then local KEYS = { } local max_key_length = 0 for _, key in ipairs(object_keys) do local encoded = encode_value(self, tostring(key), parents, etc, options, indent) if options.align_keys then max_key_length = math.max(max_key_length, #encoded) end table.insert(KEYS, encoded) end local key_indent = indent .. tostring(options.indent or "") local subtable_indent = key_indent .. string.rep(" ", max_key_length) .. (options.align_keys and " " or "") local FORMAT = "%s%" .. string.format("%d", max_key_length) .. "s: %s" local COMBINED_PARTS = { } for i, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, subtable_indent) table.insert(COMBINED_PARTS, string.format(FORMAT, key_indent, KEYS[i], encoded_val)) end result_value = "{\n" .. table.concat(COMBINED_PARTS, ",\n") .. "\n" .. indent .. "}" else local PARTS = { } for _, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, indent) local encoded_key = encode_value(self, tostring(key), parents, etc, options, indent) table.insert(PARTS, string.format("%s:%s", encoded_key, encoded_val)) end result_value = "{" .. table.concat(PARTS, ",") .. "}" end else -- -- An empty array/object... we'll treat it as an array, though it should really be an option -- result_value = "[]" end parents[T] = false return result_value end end function OBJDEF:encode(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode must be called in method format", etc) end return encode_value(self, value, {}, etc, options or nil) end function OBJDEF:encode_pretty(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode_pretty must be called in method format", etc) end return encode_value(self, value, {}, etc, options or default_pretty_options) end function OBJDEF.__tostring() return "JSON encode/decode package" end OBJDEF.__index = OBJDEF function OBJDEF:new(args) local new = { } if args then for key, val in pairs(args) do new[key] = val end end return setmetatable(new, OBJDEF) end return OBJDEF:new() -- -- Version history: -- -- 20141223.14 The encode_pretty() routine produced fine results for small datasets, but isn't really -- appropriate for anything large, so with help from Alex Aulbach I've made the encode routines -- more flexible, and changed the default encode_pretty() to be more generally useful. -- -- Added a third 'options' argument to the encode() and encode_pretty() routines, to control -- how the encoding takes place. -- -- Updated docs to add assert() call to the loadfile() line, just as good practice so that -- if there is a problem loading JSON.lua, the appropriate error message will percolate up. -- -- 20140920.13 Put back (in a way that doesn't cause warnings about unused variables) the author string, -- so that the source of the package, and its version number, are visible in compiled copies. -- -- 20140911.12 Minor lua cleanup. -- Fixed internal reference to 'JSON.noKeyConversion' to reference 'self' instead of 'JSON'. -- (Thanks to SmugMug's David Parry for these.) -- -- 20140418.11 JSON nulls embedded within an array were being ignored, such that -- ["1",null,null,null,null,null,"seven"], -- would return -- {1,"seven"} -- It's now fixed to properly return -- {1, nil, nil, nil, nil, nil, "seven"} -- Thanks to "haddock" for catching the error. -- -- 20140116.10 The user's JSON.assert() wasn't always being used. Thanks to "blue" for the heads up. -- -- 20131118.9 Update for Lua 5.3... it seems that tostring(2/1) produces "2.0" instead of "2", -- and this caused some problems. -- -- 20131031.8 Unified the code for encode() and encode_pretty(); they had been stupidly separate, -- and had of course diverged (encode_pretty didn't get the fixes that encode got, so -- sometimes produced incorrect results; thanks to Mattie for the heads up). -- -- Handle encoding tables with non-positive numeric keys (unlikely, but possible). -- -- If a table has both numeric and string keys, or its numeric keys are inappropriate -- (such as being non-positive or infinite), the numeric keys are turned into -- string keys appropriate for a JSON object. So, as before, -- JSON:encode({ "one", "two", "three" }) -- produces the array -- ["one","two","three"] -- but now something with mixed key types like -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- instead of throwing an error produces an object: -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To maintain the prior throw-an-error semantics, set -- JSON.noKeyConversion = true -- -- 20131004.7 Release under a Creative Commons CC-BY license, which I should have done from day one, sorry. -- -- 20130120.6 Comment update: added a link to the specific page on my blog where this code can -- be found, so that folks who come across the code outside of my blog can find updates -- more easily. -- -- 20111207.5 Added support for the 'etc' arguments, for better error reporting. -- -- 20110731.4 More feedback from David Kolf on how to make the tests for Nan/Infinity system independent. -- -- 20110730.3 Incorporated feedback from David Kolf at http://lua-users.org/wiki/JsonModules: -- -- * When encoding lua for JSON, Sparse numeric arrays are now handled by -- spitting out full arrays, such that -- JSON:encode({"one", "two", [10] = "ten"}) -- returns -- ["one","two",null,null,null,null,null,null,null,"ten"] -- -- In 20100810.2 and earlier, only up to the first non-null value would have been retained. -- -- * When encoding lua for JSON, numeric value NaN gets spit out as null, and infinity as "1+e9999". -- Version 20100810.2 and earlier created invalid JSON in both cases. -- -- * Unicode surrogate pairs are now detected when decoding JSON. -- -- 20100810.2 added some checking to ensure that an invalid Unicode character couldn't leak in to the UTF-8 encoding -- -- 20100731.1 initial public release --
gpl-2.0
Ninjistix/darkstar
scripts/globals/weaponskills/calamity.lua
25
1516
----------------------------------- -- Calamity -- Axe weapon skill -- Skill level: 200 (Beastmasters and Warriors only.) -- Delivers a single-hit attack. Damage varies with TP. -- Will stack with Sneak Attack. -- Aligned with the Soil Gorget & Thunder Gorget. -- Aligned with the Soil Belt & Thunder Belt. -- Element: None -- Modifiers: STR:32% ; VIT:32% -- 100%TP 200%TP 300%TP -- 1.00 1.50 4.00 ----------------------------------- require("scripts/globals/status"); require("scripts/globals/settings"); require("scripts/globals/weaponskills"); ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {}; params.numHits = 1; params.ftp100 = 1; params.ftp200 = 1.5; params.ftp300 = 4; params.str_wsc = 0.32; params.dex_wsc = 0.0; params.vit_wsc = 0.32; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.ftp100 = 2.5; params.ftp200 = 6.5; params.ftp300 = 10.375; params.str_wsc = 0.5; params.vit_wsc = 0.5; end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params); return tpHits, extraHits, criticalHit, damage; end
gpl-3.0
abosalah22/zak
plugins/info.lua
3
1116
--[[ $ :) -- - ( #ابو_شهوده) - -- $ :) -- - ( @abo_shosho98) - -- $ :) --Channel-( @aboaloshbot )-- $ :) ]]-- do function run(msg, matches) local reply_id = msg['id'] local info = '🈷 - ٱيـۧډيک : '..msg.from.id..'\n' ..'🈶 - مۘعرفک : @'..msg.from.username..'\n' ..'🈸 - ٱسـۧمـک ٲلٲول : '..(msg.from.first_name or '')..'\n' ..'🈸 - ٱسـۧمـک ٲلثـآنيَ : '..(msg.from.lastname or '')..'\n' ..'🈚️ - ٱيډي ٱڵمجـمۄعة : '..msg.to.id..'\n' ..'📳 - ٱسـۨم ٱڵمجـمۄعة : '..msg.to.title..'\n' ..'📴 - رقــۖـمــۗـک : '..(msg.from.phone or " لُايَوَجْدِ ⛔️‼️"..'\n' ..'📨 - ٱڵـرسـآلـةٌ : '..msg.text..'\n' ..'🗣 - ٱنـۧت فـۖي : ' ..msg.to.type..'\n' ..'⏱ - ٲڵـوقـت : '..os.date(' %T', os.time()))..'\n' ..'📆 - ٱڵـتاريـخ : '.. os.date('!%A %B:%d:%Y\n', timestamp)..'\n' ..'🔗 - رآبـط حـسـآبـک : telegram.me/'..msg.from.username..'\n' reply_msg(reply_id, info, ok_cb, false) end return { patterns = { "^/info" }, run = run } end
gpl-2.0
Ninjistix/darkstar
scripts/globals/items/annihilator.lua
3
2887
----------------------------------------- -- ID: 18336, 18337, 18649, 18663, 18677, 19758, 19851, 21260, 21261, 21267 -- Item: Annihilator ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/msg"); require("scripts/globals/weaponskills"); require("scripts/globals/weaponskillids"); ----------------------------------- local NAME_WEAPONSKILL = "AFTERMATH_ANNIHILATOR"; local NAME_EFFECT_LOSE = "AFTERMATH_LOST_ANNIHILATOR"; -- https://www.bg-wiki.com/bg/Relic_Aftermath local aftermathTable = {}; -- Annihilator 75 aftermathTable[18336] = { power=1, duration = function(tp) return math.floor(0.02 * tp); end, mods = { { id=MOD_ENMITY, power=-20 } } }; aftermathTable[18337] = aftermathTable[18336]; -- Annihilator (80) aftermathTable[18649] = aftermathTable[18336]; -- Annihilator (85) aftermathTable[18663] = aftermathTable[18336]; -- Annihilator (90) aftermathTable[18677] = aftermathTable[18336]; -- Annihilator (95) aftermathTable[19758] = aftermathTable[18336]; -- Annihilator (99) aftermathTable[19851] = aftermathTable[18336]; -- Annihilator (99/II) aftermathTable[21260] = aftermathTable[18336]; -- Annihilator (119) aftermathTable[21261] = aftermathTable[18336]; -- Annihilator (119/II) -- Annihilator (119/III) aftermathTable[21267] = { power=2, duration = function(tp) return math.floor(0.06 * tp); end, mods = { { id=MOD_ENMITY, power=-25}, { id=MOD_RATTP, power=10 } } }; function onWeaponskill(user, target, wsid, tp, action) if (wsid == WEAPONSKILL_CORONACH) then -- Coronach onry local itemId = user:getEquipID(SLOT_RANGED); if (aftermathTable[itemId]) then -- Apply the effect and add mods addAftermathEffect(user, tp, aftermathTable[itemId]); -- Add a listener for when aftermath wears (to remove mods) user:addListener("EFFECT_LOSE", NAME_EFFECT_LOSE, aftermathLost); end end end function aftermathLost(target, effect) if (effect:getType() == EFFECT_AFTERMATH) then local itemId = target:getEquipID(SLOT_RANGED); if (aftermathTable[itemId]) then -- Remove mods removeAftermathEffect(target, aftermathTable[itemId]); -- Remove the effect listener target:removeListener(NAME_EFFECT_LOSE); end end end function onItemCheck(player, param, caster) if (param == ITEMCHECK_EQUIP) then player:addListener("WEAPONSKILL_USE", NAME_WEAPONSKILL, onWeaponskill); elseif (param == ITEMCHECK_UNEQUIP) then -- Make sure we clean up the effect and mods if (player:hasStatusEffect(EFFECT_AFTERMATH)) then aftermathLost(player, player:getStatusEffect(EFFECT_AFTERMATH)); end player:removeListener(NAME_WEAPONSKILL); end return 0; end
gpl-3.0
abosalah22/zak
libs/redis.lua
566
1214
local Redis = require 'redis' local FakeRedis = require 'fakeredis' local params = { host = os.getenv('REDIS_HOST') or '127.0.0.1', port = tonumber(os.getenv('REDIS_PORT') or 6379) } local database = os.getenv('REDIS_DB') local password = os.getenv('REDIS_PASSWORD') -- Overwrite HGETALL Redis.commands.hgetall = Redis.command('hgetall', { response = function(reply, command, ...) local new_reply = { } for i = 1, #reply, 2 do new_reply[reply[i]] = reply[i + 1] end return new_reply end }) local redis = nil -- Won't launch an error if fails local ok = pcall(function() redis = Redis.connect(params) end) if not ok then local fake_func = function() print('\27[31mCan\'t connect with Redis, install/configure it!\27[39m') end fake_func() fake = FakeRedis.new() print('\27[31mRedis addr: '..params.host..'\27[39m') print('\27[31mRedis port: '..params.port..'\27[39m') redis = setmetatable({fakeredis=true}, { __index = function(a, b) if b ~= 'data' and fake[b] then fake_func(b) end return fake[b] or fake_func end }) else if password then redis:auth(password) end if database then redis:select(database) end end return redis
gpl-2.0
Ninjistix/darkstar
scripts/zones/The_Eldieme_Necropolis/Zone.lua
7
1263
----------------------------------- -- -- Zone: The_Eldieme_Necropolis (195) -- ----------------------------------- package.loaded["scripts/zones/The_Eldieme_Necropolis/TextIDs"] = nil; ----------------------------------- require("scripts/zones/The_Eldieme_Necropolis/TextIDs"); require("scripts/zones/The_Eldieme_Necropolis/MobIDs"); require("scripts/globals/conquest"); function onInitialize(zone) UpdateTreasureSpawnPoint(ELDIEME_TREASURE_CHEST); UpdateTreasureSpawnPoint(ELDIEME_TREASURE_COFFER); end; function onZoneIn(player,prevZone) -- rng af2 if (player:getVar("fireAndBrimstone") == 2) then return 4; end local cs = -1; if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then player:setPos(-438.878,-26.091,540.004,126); end return cs; end; function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; function onRegionEnter(player,region) end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 4) then player:setVar("fireAndBrimstone",3); end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/North_Gustaberg_[S]/npcs/Gebhardt.lua
5
1060
----------------------------------- -- Area: North Gustaberg (S) (I-6) -- NPC: Gebhardt -- Involved in Quests: The Fighting Fourth ----------------------------------- package.loaded["scripts/zones/North_Gustaberg_[S]/TextIDs"] = nil; package.loaded["scripts/globals/quests"] = nil; ----------------------------------- require("scripts/globals/quests"); require("scripts/zones/North_Gustaberg_[S]/TextIDs"); require("scripts/globals/keyitems"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) if (player:getQuestStatus(CRYSTAL_WAR,THE_FIGHTING_FOURTH) == QUEST_ACCEPTED and player:hasKeyItem(917)) == true then player:startEvent(102) else player:startEvent(110) end end; function onEventUpdate(player,csid,option) end function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 102) then player:delKeyItem(BATTLE_RATIONS); player:setVar("THE_FIGHTING_FOURTH",1); end end;
gpl-3.0
Ninjistix/darkstar
scripts/globals/abilities/naturalists_roll.lua
1
2609
----------------------------------- -- Ability: Naturalists's Roll -- Increases the duration of enhancing magic effects received for party members within area of effect. -- Optimal Job: Geomancer -- Lucky Number: 3 -- Unlucky Number: 7 -- Level: 67 -- -- Die Roll | Duration % -- -------- ------- -- 1 |+6 -- 2 |+7 -- 3 |+15 -- 4 |+8 -- 5 |+9 -- 6 |+10 -- 7 |+5 -- 8 |+11 -- 9 |+12 -- 10 |+13 -- 11 |+20 -- Bust |-5 ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/ability"); require("scripts/globals/status"); require("scripts/globals/msg"); ----------------------------------- function onAbilityCheck(player,target,ability) local effectID = EFFECT_NATURALISTS_ROLL ability:setRange(ability:getRange() + player:getMod(MOD_ROLL_RANGE)); if (player:hasStatusEffect(effectID)) then return msgBasic.ROLL_ALREADY_ACTIVE,0; elseif atMaxCorsairBusts(player) then return msgBasic.CANNOT_PERFORM,0; else return 0,0; end end; function onUseAbility(caster,target,ability,action) if (caster:getID() == target:getID()) then corsairSetup(caster, ability, action, EFFECT_NATURALISTS_ROLL, JOBS.GEO); end local total = caster:getLocalVar("corsairRollTotal") return applyRoll(caster,target,ability,action,total) end; function applyRoll(caster,target,ability,action,total) local duration = 300 + caster:getMerit(MERIT_WINNING_STREAK) local effectpowers = {6, 7, 15, 8, 9, 10, 5, 11, 12, 13, 20, -5} local effectpower = effectpowers[total]; if (caster:getLocalVar("corsairRollBonus") == 1 and total < 12) then -- TODO Add logic for Phantom Roll + effectpower = effectpower + 5 end if (caster:getMainJob() == JOBS.COR and caster:getMainLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getMainLvl() / target:getMainLvl()); elseif (caster:getSubJob() == JOBS.COR and caster:getSubLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getSubLvl() / target:getMainLvl()); end if (target:addCorsairRoll(caster:getMainJob(), caster:getMerit(MERIT_BUST_DURATION), EFFECT_NATURALISTS_ROLL, effectpower, 0, duration, caster:getID(), total, MOD_ENH_MAGIC_DURATION) == false) then ability:setMsg(msgBasic.ROLL_MAIN_FAIL); elseif total > 11 then ability:setMsg(msgBasic.DOUBLEUP_BUST); end return total; end
gpl-3.0
Ninjistix/darkstar
scripts/globals/items/grape_daifuku.lua
3
1845
----------------------------------------- -- ID: 6343 -- Item: grape_daifuku -- Food Effect: 30 Min, All Races ----------------------------------------- -- HP + 20 (Pet & Master) -- Vitality + 3 (Pet & Master) -- Master MAB + 3 , Pet MAB + 14 -- Accuracy/Ranged Accuracy +10% (cap 50 on master, cap 75 on pet) ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD)) then result = 246; end return result; end; function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,1800,6343); end; function onEffectGain(target, effect) target:addMod(MOD_HP, 20) target:addMod(MOD_VIT, 3) target:addMod(MOD_MATT, 3) target:addMod(MOD_FOOD_ACCP, 10) target:addMod(MOD_FOOD_ACC_CAP, 50) target:addMod(MOD_FOOD_RACCP, 10) target:addMod(MOD_FOOD_RACC_CAP, 50) target:addPetMod(MOD_HP, 20) target:addPetMod(MOD_VIT, 3) target:addPetMod(MOD_MATT, 14) target:addPetMod(MOD_FOOD_ACCP, 10) target:addPetMod(MOD_FOOD_ACC_CAP, 75) target:addPetMod(MOD_FOOD_RACCP, 10) target:addPetMod(MOD_FOOD_RACC_CAP, 75) end; function onEffectLose(target, effect) target:delMod(MOD_HP, 20) target:delMod(MOD_VIT, 3) target:delMod(MOD_MATT, 3) target:delMod(MOD_FOOD_ACCP, 10) target:delMod(MOD_FOOD_ACC_CAP, 50) target:delMod(MOD_FOOD_RACCP, 10) target:delMod(MOD_FOOD_RACC_CAP, 50) target:delPetMod(MOD_HP, 20) target:delPetMod(MOD_VIT, 3) target:delPetMod(MOD_MATT, 14) target:delPetMod(MOD_FOOD_ACCP, 10) target:delPetMod(MOD_FOOD_ACC_CAP, 75) target:delPetMod(MOD_FOOD_RACCP, 10) target:delPetMod(MOD_FOOD_RACC_CAP, 75) end;
gpl-3.0
neofob/sile
lua-libraries/std/debug.lua
6
2518
--[[-- Additions to the debug module @module std.debug ]] local init = require "std.debug_init" local io = require "std.io" local list = require "std.list" local string = require "std.string" --- To activate debugging set _DEBUG either to any true value -- (equivalent to {level = 1}), or as documented below. -- @class table -- @name _DEBUG -- @field level debugging level -- @field call do call trace debugging -- @field std do standard library debugging (run examples & test code) --- Print a debugging message. -- @param n debugging level, defaults to 1 -- @param ... objects to print (as for print) local function say (n, ...) local level = 1 local arg = {n, ...} if type (arg[1]) == "number" then level = arg[1] table.remove (arg, 1) end if init._DEBUG and ((type (init._DEBUG) == "table" and type (init._DEBUG.level) == "number" and init._DEBUG.level >= level) or level <= 1) then io.writelines (io.stderr, table.concat (list.map (string.tostring, arg), "\t")) end end --- Trace function calls. -- Use as debug.sethook (trace, "cr"), which is done automatically -- when _DEBUG.call is set. -- Based on test/trace-calls.lua from the Lua distribution. -- @class function -- @name trace -- @param event event causing the call local level = 0 local function trace (event) local t = debug.getinfo (3) local s = " >>> " .. string.rep (" ", level) if t ~= nil and t.currentline >= 0 then s = s .. t.short_src .. ":" .. t.currentline .. " " end t = getinfo (2) if event == "call" then level = level + 1 else level = math.max (level - 1, 0) end if t.what == "main" then if event == "call" then s = s .. "begin " .. t.short_src else s = s .. "end " .. t.short_src end elseif t.what == "Lua" then s = s .. event .. " " .. (t.name or "(Lua)") .. " <" .. t.linedefined .. ":" .. t.short_src .. ">" else s = s .. event .. " " .. (t.name or "(C)") .. " [" .. t.what .. "]" end io.writelines (io.stderr, s) end -- Set hooks according to init._DEBUG if type (init._DEBUG) == "table" and init._DEBUG.call then debug.sethook (trace, "cr") end --- @export local M = { say = say, trace = trace, } for k, v in pairs (debug) do M[k] = M[k] or v end --- The global function `debug` is an abbreviation for `debug.say (1, ...)` -- @function debug -- @see say local metatable = { __call = function (self, ...) say (1, ...) end, } return setmetatable (M, metatable)
mit
DEVll190ll/DEV_HR
plugins/help.lua
1
6246
--[[ BY ADOLF_HITLER (@LL190LL) BY:حسين محمد BY ADOLF_HITLER (@LLSNLL) --]] do function run(msg, matches) if matches[1] == "الاوامر" and is_momod(msg) then return "اهلا وسهلا بك 😻🎈 "..msg.from.first_name.."\n" .." ".."\n" ..[[ 💯اهلا بكم هناك 4 اوامر في البوت🤗 🔶🔻🔺🔻🔺🔻🔺🔷 🐉م1⃣ : لعرض اوامر الادمنيه و المدير😼 🐉م2⃣ : لعرض اوامر تخص المجموعه 😺 🐉م3⃣ : لعرض اوامر حمايه المجموعه 😾 🐉م4⃣ : لعرض اوامر المطورين 😽 ]].."\n" .."🔸------------------------🔸".."\n" ..'💯ɖєṽ🐉:@llSNll'..'\n' ..'💯.BOT : @MX313_bot'..'\n' ------------------ elseif matches[1] == "م1" and is_momod(msg) then return "اهلا وسهلا بك 😻🎈 "..msg.from.first_name.."\n" .." ".."\n" ..[[ 🔰 اوامر تـخص الادمنيـه و المـديـر 🔰 🔸--------------------------🔹 🔰 اوامر تـخص الادمنيـه و المـديـر 🔰 🔸--------------------------🔸 🔸رفع ادمن :- لرفع ادمن رد + معرف 🔸تنزيل ادمن :- لرفع ادمن رد + معرف 🔸رفع اداري:- لرفع اداري رد + معرف 🔸تنزيل اداري:- لرفع اداري رد + معرف 🔸حظر :- حظر عضو من المجموعه 🔸الغاء حظر :- الغاء الحظر عن عضو 🔸منع + الكلمه :- منع كلمه 🔸الغاء منع + الكلمه :- الغاء منع كلمه 🔸قائمه المنع:- اظهار الكلمات الممنوعه 🔸تنظيف قائمه المنع:- لمسح كل المنع 🔸ايدي :- عرض ايدي المجموعه 🔸ايدي بالرد :- عرض ايدي شخص 🔸كتم :- لكتم عضو رد + معرف + ايدي 🔸المكتومين :- لعرض قائمه المكتومين ]].."\n" .."🔸------------------------🔸".."\n" ..'💯ɖєṽ🐉: @llSNll'..'\n' ..'💯BOT : @MX313_bot'..'\n' ------------------ elseif matches[1] == "م2" and is_momod(msg) then return "اهلا وسهلا بك 😻🎈 "..msg.from.first_name.."\n" .." ".."\n" ..[[ 🔶- اوامــر تــخــص المـجـمـوعـه ♨️ |🕎| 🔺🔻🔺🔻🔺🔻|🕎| |🎭| ضع ترحيب📜 |🎏|لوضع ترحيب في المجموعه📜 |🎭| ضع صوره🎠 |🎏| لوضع صوره ☑️🎠 |🎭| ضع قوانين📝 |🎏| لوضع قوانين ☑️📝 |🎭| ضع وصف🗒 |🎏| لوضع وصف ☑️🗒 |🎭| ضع اسم🖊 |🎏| لوضع اسم ☑️🖊 |🎭| ضع معرف〽️ |🎏| لوضع معرف ☑️〽️ |🎭| ضع رابط🗃 |🎏| لخزن رابط المجموعه☑️🗃 |🎭| الرابط🗃 |🎏| لعرض رابط المجموعه 🗃📝 |🎭| معلوماتي📋 |🎏| لعرض معلوماتك📋〽️ |🎭| معلومات المجموعه📝 |🎏| لعرض معلومات المجموعه📝〽️ |🎭| اعدادت الوسائط✉️ |🎏| لاضهار الاعدادات الوسائط📩 |🕎| 🔺🔻🔺🔻🔺🔻|🕎|]].."\n" .."🔸------------------------🔸".."\n" ..'💯ɖєṽ🐉:@llSNll'..'\n' ..'💯BOT : @MX313_bot'..'\n' ------------------ elseif matches[1] == "م3" and is_momod(msg) then return "اهلا وسهلا بك 😻🎈 "..msg.from.first_name.."\n" .." ".."\n" ..[[ 🔒 اوامـــر حمـــايه الـــمجمـــوعه 🔓 🔸------------------------🔸 قفل + الامر / للقفل 🔐 فتح + الامر / للفتح 🔓 🔸------------------------🔸 🔸الصوت|📣 🔸الصور المتحركه|🌅 🔸الصور|🗻 🔸الفديو|📽 🔸اعاده توجيه|↪️ 🔸التكرار|📈 🔸البوتات|🤖 🔸الروابط|📥 🔸 المعرف|🌀 🔸 التاك|📥 🔸 الشارحه|〰 🔸الاضافه|🚸 🔸الاضافه الجماعية|⛎ 🔸الاشعارات|🌀 🔸جهات اتصال|💢 🔸الكلايش|📝 🔸الدردشه|🗣 🔸العربيه|✳️ 🔸 الانلاين|📡 🔸 الدخول بالرابط|📍 🔸 السمايل|😃 ]].."\n" .."🔸------------------------🔸".."\n" ..'💯ɖєṽ🐉:@llSNll'..'\n' ..'💯BOT : @MX313_bot'..'\n' ------------------ elseif matches[1] == "م4" and is_owner(msg) then return "اهلا وسهلا بك 😻🎈 "..msg.from.first_name.."\n" .." ".."\n" ..[[ 🔧 اوامـــر المــطـــوريـــن 🛠 |🕎| 🔺🔻🔺🔻🔺🔻 |🕎| |🕹| تفعيل 💯☑️ |⛏| لتفعيل البوت بالمجموعه 💯🆎 |🕹| تعطيل 🚫 |⛏| لتعطيل البوت بالمجموعه ⚠️🚫 |🕹| رفع المدير 👤 |⛏| لرفع المدير عن طريق الرد + معرف 〽️ |🕹| وضع وقت + عدد الايام📋 |🖲| لتفعيل البوت ع عدد الايام🆎⏳ |🕹| الوقت⏳ |⛏| لمعرفت عدد ايام تفعيل البوت🛠 |🕹| اذاعه ☢ |⛏| لنشر شئ بكل مجموعات البوت ➿ |🕹| زحلك 🏄🏻 |⛏| لطرد البوت من المجموعه 🆎🏄🏻 |🕹| جلب ملف + اسم الملف 🖊🗂 |⛏| لجلب ملف من سيرفر البوت ➿ |🕹| تفعيل + اسم الملف 🖊🗂 |⛏| لتفعيل ملف عن طريق البوت🆎 |🖲| تعطيل + اسم للملف📁 |🕹| لتعطيل ملف عن طريق البوت🆎 |🖲| صنع مجموعه + الاسم 🖊 |🕹| لصنع مجموعه بواسطه حساب البوت🆎 |🖲| ترقيه سوبر ♻️ |🕹| لترقيه المجموعه بواسطه حساب البوت🆎 |🕹| ريديس : لتعديل عمل البوت🆎 |🖲| حدث : لتحديث البوت🆎 |🕎| 🔺🔻🔺🔻🔺🔻|🕎| ]].."\n" .."🔸------------------------🔸".."\n" ..'💯ɖєṽ🐉:@llSNll'..'\n' ..'💯BOT : @MX313_bot'..'\n' end end return { patterns = { "^(الاوامر)", "^(م1)", "^(م2)", "^(م3)", "^(م4)", }, run = run } end
gpl-2.0
neofob/sile
languages/af.lua
3
110964
SILE.hyphenator.languages["af"] = {} SILE.hyphenator.languages["af"].patterns = { ".aan5s4", ".aä7lawa", ".a6bc-b", ".a4b5la", ".ab7salo", ".a6b-ja", ".ac7cra.", ".a6farm", ".af7arm.", ".a6feet", ".af7eet.", ".a4f5en", ".a6fets", ".af7ets.", ".a6foes", ".af7oes.", ".a4f5oo", ".a4f5ra", ".af6ro'", ".a7fro's", ".af6ro-", ".a7fro-h", ".a6fry.", ".af3s", ".ag6aam", ".agte6r5", ".a6guur", ".a9ha.", ".ah7lers", ".a3kw", ".a6leer", ".al7eer.", ".alf4", ".al7fagr", ".al5fr", ".al6lda", ".a4l3o", ".al6oïe", ".a7loïen", ".al3p", ".al5st", ".al7thea", ".al7twee", ".al6zhe", ".amp4s", ".amps5w", ".a6naër", ".an7aëro", ".an6cpl", ".and4", ".an5dr", ".ang4", ".an5gl", ".angs5", ".a4n5io", ".an7thro", ".a3pr", ".ap7side", ".a5rag", ".ara6p.", ".ar7thur", ".ar6zbe", ".as7jas.", ".a6snog", ".a6sof.", ".a5sti", ".a7straa", ".a7s6tral", ".at6hol", ".a7thol.", ".a5tsj", ".atte4", ".au7drey", ".b6aanv", ".ba6din", ".ba4d5o", ".ba7loi.", ".ba7ragw", ".ba7rins", ".ba6sek", ".ba7tho.", ".be7deks", ".be6kaf", ".bek7af.", ".be5la", ".be7lol.", ".be7skos", ".be7thel", ".be7thul", ".bi7sho.", ".bli4", ".blus5", ".bo7kerf", ".bo7kies", ".bo7kors", ".bo7maat", ".b4on", ".bo7plaa", ".bo5ro", ".bo7sor.", ".bo5sta", ".bo7trit", ".bo7tswa", ".bo7uit.", ".bout5j", ".b4re", ".bu6eno", ".bu6lol", ".bu7thel", ".by6ldr", ".by6lho", ".by6lne", ".by6lpi", ".by7port", ".bys4", ".by6tal", ".ca7thy.", ".ca7yenn", ".chlo7e.", ".ci6rca", ".ci7trus", ".cos7ta.", ".cy6pri", ".d2", ".da7gon.", ".dag5s", ".da6kat", ".da6koo", ".da7tage", ".da6tji", ".dat7jie", ".da6wki", ".de6k7laa", ".de6klo", ".de6kwe", ".de5la", ".de7roga", ".de6sal", ".de6sok", ".de4sp", ".diep5l", ".di6jks", ".di4si", ".di7thak", ".do4m5a", ".do4m5o", ".dor7ste.", ".dr6oef", ".dun5s", ".du6pre", ".dut5j", ".dy7spie", ".e6bcu.", ".ed5wa", ".ed7win.", ".eer6sk", ".ee4t", ".e6fron", ".ef7ron.", ".eg7gofo", ".e6indu", ".ei5st", ".ek4s5k", ".ek7sopa", ".ek7sord", ".eks7tri", ".eks7tro", ".en7dres", ".enk4", ".en5kl", ".e6noft", ".en7ofta", ".en4t5j", ".en7topt", ".ep7soms", ".er4d5a", ".er6dwo", ".er6fle", ".er6foo", ".er6inv", ".ern4", ".er4t4", ".er5te", ".ert5j", ".ert7se.", ".erts5w", ".e2s", ".e9sau", ".e4s3k", ".e3so", ".es3p", ".es8p.", ".es6pma", ".es3t", ".es6tco", ".es6tni", ".es5tr", ".e7tage.", ".et4sn", ".eur5a", ".eu7stac", ".ex7odus", ".e6zra.", ".f2", ".fo6chv", ".fo6wle", ".f4ri", ".fy6tji", ".g2", ".ga7lage", ".ga7lago", ".ga6lap", ".ga6loo", ".g6arbo", ".ga6sen", ".ge7dart", ".ge3g", ".ge7geks", ".ge7guil", ".gekun5", ".gekuns6", ".ge5la", ".ge7mopp", ".ge7muit", ".ge7nève", ".ge7rogg", ".ges4", ".ge7sjab", ".ge7sjar", ".ge5sk", ".ge5so", ".ges7pe.", ".ge7sper.", ".ge7steg", ".gif3", ".gi7gagr", ".gi6sen", ".gly3", ".gly5k", ".g6lyna", ".g4oo", ".gou7da.", ".gr6äbe", ".g6ruba", ".gui7do.", ".hang5s", ".he6blu", ".he6gor", ".he6gra", ".h6eind", ".hek5o", ".he7rakl", ".he6r5en", ".he6wle", ".hi8v.", ".ho6fet", ".ho6laa", ".ho6loo", ".hooi5", ".ho7taze", ".ho4t5o", ".hy6gro", ".ic7teru", ".i4gl", ".ile7us.", ".i2n1", ".i9n8a.", ".in6ari", ".i7narie", ".ind4", ".in7dwar", ".ing4", ".in5gr", ".in5gw", ".in6iti", ".in5kl", ".in6kly", ".in5kn", ".in5kw", ".in6osi", ".i7nosie", ".in3s4", ".in7snee", ".in7twyf", ".i5raa", ".i3sa", ".i4sk", ".i3so", ".ja6gli", ".jah7we.", ".ja6spa", ".ja7taga", ".j6äger", ".je7sopp", ".jo7dofo", ".jo7safa", ".ju6kos", ".juk7os.", ".j6ü6rge", ".jy6sel", ".k2", ".kaar4", ".kade4", ".kadet5", ".k4af", ".kaï7ro.", ".ka7nont", ".ka6pla", ".ka7plak", ".k6arbe", ".ka7thar", ".ka7thu.", ".ka6toë", ".kat7oë.", ".ka6tui", ".ke6ple", ".ker6k5a", ".ker6k5l", ".kerk5r", ".ker6sa", ".ker6sl", ".ker6s5p", ".ke4s5t", ".kie6st", ".ki6pli", ".ki4r", ".kit7se.", ".k4la", ".k6leyn", ".k4li", ".klip5", ".knik5", ".kn6opn", ".ko6maa", ".ko6maf", ".k4op", ".kope4", ".koper7a", ".ko6pla", ".kop5o", ".ko7rag.", ".kor6st", ".kors7te.", ".k6rak.", ".kr6üge", ".kryt5", ".ku7mon.", ".k4we", ".k4wo", ".ky7otop", ".l'7etji", ".la6eti", ".la6kwa", ".la5sa", ".lei5s4", ".lek7oë.", ".le6poo", ".le5pr", ".le7shab", ".le6son", ".le4sp", ".les5t", ".le6suu", ".lig5e", ".li4gi", ".li6gom", ".li6gre", ".li7pase", ".l6loyd", ".lo6chn", ".lof7ui.", ".lo6glê", ".l6ontd", ".los5k", ".lu6gen", ".lui5sl", ".l6üder", ".m2", ".m'7etji", ".ma6cdo", ".ma6nal", ".ma6nur", ".ma7stek", ".ma7thes", ".ma6zda", ".mel6k5a", ".mel6k5l", ".mer6k5l", ".mes5m", ".me4sw", ".me6tem", ".mi6dos", ".mi6rba", ".mi7traa", ".m4ne", ".mo7djad", ".mo7flam", ".mo6sin", ".mo4sk", ".mu4e", ".my6nen", ".my6n5in", ".my7unis", ".n2", ".n6aand", ".na5fl", ".na6gro", ".na7groe", ".na7smaa", ".na7stor", ".na7uurs", ".ne4k5a", ".ne4k5o", ".ne6kri", ".nek7rin", ".ne6kys", ".ne4s3", ".ne7serh", ".n6etik", ".ne4t5j", ".ne6tru", ".ne6wca", ".ne6wfo", ".ne6wla", ".ne6wma", ".ni4e", ".ni6jho", ".ni6rva", ".nix7on.", ".n6kosa", ".noet4", ".noe5tj", ".no6gee", ".no4k", ".n6ondu", ".nu4l", ".ny7lont", ".oe5kr", ".oe4r", ".oe7ralg", ".oe7rang", ".oer7os.", ".oe4s3", ".o4gl", ".oh7rigs", ".o6klah", ".ok7laho", ".ol6ieu", ".o7lieui", ".oms4", ".o2n1", ".ond6ui", ".on7duit", ".o6nemo", ".on6ias", ".o7nias.", ".on3k", ".on7parm", ".on3s4", ".on6she", ".on6sse", ".on6t7eer", ".on6t5er", ".on4tr", ".ont7ras", ".ont5ri", ".o9nus", ".on6us.", ".oon4", ".oon7de.", ".o4op", ".oor5n", ".oor5s4", ".oo4s", ".o6peet", ".op7eet.", ".o6peg.", ".o6pein", ".o6p5erd", ".o4pof", ".o4pr", ".op5ra", ".ops4", ".op7smuk", ".o7ragie", ".or6kne", ".o3ro", ".orto5", ".o4sk", ".os5ko", ".os7oog.", ".ot6hel", ".o7thell", ".ou6doo", ".ou7nôi.", ".ou5tj", ".p2", ".pa4d3", ".pa7die.", ".pa6vlo", ".pe5la", ".pel6sk", ".per6st", ".pe4sk", ".pe4st", ".pie6tj", ".pi7laf.", ".pit5s", ".p4la", ".po6dzo", ".p6oefe", ".poen4", ".p6ontw", ".po6sad", ".p4re", ".pu6tad", ".py6paa", ".py6pla", ".py6pol", ".pyp5r", ".py7thon", ".r2", ".r'7etji", ".r6aard", ".ra7dart", ".ra6seg", ".ras7eg.", ".re7aumu", ".re6gru", ".rek5s", ".re6mas", ".rem7as.", ".re6mco", ".re4sl", ".rie4t", ".riet5j", ".riet5r", ".ri6ple", ".roc7ky.", ".ro6gak", ".ron7do.", ".rond5s", ".ro5py", ".ros5t", ".ro6tre", ".ro6wli", ".ru7klip", ".ruk4o", ".ru7kope", ".ru7staa", ".ru6suu", ".ry4k5a", ".ry6ste", ".s6aans", ".s4af", ".s4ag", ".sa7gopa", ".s6akty", ".s4am", ".sa6vlo", ".s4ca", ".se6an.", ".see5ra", ".see7ys.", ".se7khuk", ".se6laa", ".se6lop", ".se7reni", ".se6sle", ".ses5t", ".se6suu", ".se6tap", ".se4tr", ".sex5y", ".s6fale", ".s4fi", ".s4gr", ".s4ha4", ".s4he", ".s4hi", ".s4ho", ".s4hu", ".s4in", ".si6nes", ".si7pho.", ".si7rag.", ".s4ja", ".s4ka", ".s4ke", ".s4kl", ".s4ko", ".s4kr", ".s4ku", ".slag5", ".s4ma", ".s4me", ".s4mi", ".s4mo", ".s4mu", ".s6nags", ".s4ne", ".sod4", ".so7dafa", ".so7dwan", ".so7iets", ".so6kop", ".some4", ".s6oms.", ".s4on", ".so6neg", ".s4op", ".so6pek", ".so7phok", ".so7ross", ".s4pe", ".s4pl", ".spo4g", ".s6pren", ".s4py", ".s8ri.", ".s4ta", ".s6temp", ".ste7rol", ".ster6ta", ".ster6t7j", ".s4ti", ".s4to", ".straf5", ".s6trei", ".s6tuar", ".stuc5", ".su7biet", ".sub5m", ".sub5p", ".su8e.", ".s4ui", ".su5kr", ".su7ther", ".su7tra.", ".s4we", ".s4wi", ".s4wo", ".sy1", ".sy6lvi", ".sy7nagr", ".sy7slag", ".t2", ".t6afsy", ".t4ag", ".tee5k", ".te6flo", ".te7rafi", ".te7ragr", ".ter6tj", ".tert7ji", ".te4s5t", ".te7stud", ".ti6ene", ".tie6t5j", ".ti4k", ".ti6ner", ".t6jaai", ".tjok5", ".toe7ys.", ".to6kla", ".to7ky7o.", ".to6lun", ".to7ront", ".tou3", ".trap5r", ".trek5", ".tre4s", ".trie4", ".tries5", ".t4sa", ".ts4h", ".ts6jaa", ".ty6daa", ".ty6dor", ".ty6dra", ".ui6laa", ".ui4t3", ".ui5ti", ".ui5t6ji", ".um7hlan", ".uns4", ".un5st", ".u5raa", ".u5tra", ".va6kad", ".va6kei", ".va6naf", ".va4n5o", ".va7raan", ".va6sen", ".va6swa", ".vas7ys.", ".ve7cino", ".ve7laar", ".ve7lare", ".ve7lêr.", ".ve7loer", ".ve7lome", ".ve7meng", ".ve7rema", ".ve7rena", ".ve7reve", ".ve7skaf", ".ve7tore", ".vlas5", ".vo6gin", ".vo6lyw", ".vo6sko", ".wa7ghri", ".wa4n", ".wa7smou", ".wa6spa", ".web5m", ".we4bo", ".we6b-o", ".week7lan", ".wee4t5", ".we6kuu", ".we4l5a", ".we6lin", ".wel7ing", ".we6nan", ".werk5l", ".wer6k5r", ".we4s5k", ".we6soe", ".we6swa", ".w8hê.", ".w4hi", ".wi6id.", ".wins5", ".wi4p", ".wi4t", ".wî9e.", ".wy7kwas", ".wy7nand", ".wy6net", ".x2", ".y6amin", ".y6anni", ".y6asud", ".yk7loon", ".ys3", ".ys6ere", ".ys5la", ".ze5us", ".z6üric", ".z4wa", ".z4wi", "aa2", "aad1", "aa4da", "aa4de", "aa4do", "aa4d3r", "aaf7emme", "aaf6sat", "aag5al", "aag7asem", "aag7elas", "aag3r", "aag7rond", "aag5s4l", "aag5sp", "aag5st", "aag7swee", "aai7lag.", "aak1", "aa4ka", "aa4ko", "aak3r", "aak7ster", "aak3w", "aal1", "aal6dys", "aald7ys.", "aal5fe", "aal6fpo", "aal5sa", "aal7sfee", "aam1", "aa4ma", "aa4me", "aa4mo", "aam7smul", "aan1", "aan6dou", "aand6re", "aan7dren", "aan7dros", "aan7gons", "aan3k4", "aan5kl", "5aankon", "aan7kry.", "5aanleg", "aan7sage", "aan6see", "aans7eer", "aan6sek", "5aansig", "aan7skem", "aan5sl", "aan5sn", "aan6som", "aan6son", "aan5sp", "aan7tuig", "5aanva", "aap1", "aa4pa", "aa4po", "aap3r", "aa4pu", "aar3a", "aar6dan", "aard7ang", "aard7as.", "aar5de", "aar7ding", "aar4du", "aar3e", "aar3i", "aar7kwek", "aar6lbe", "aar6lka", "aar6lva", "aar6lzi", "aar6l-o", "aar3o", "aar7ser.", "aar7seri", "aar6sid", "aars8teek", "aars8tell", "aars6ti", "5aartap", "aar6tin", "aar7tomo", "aar7tryb", "aar3u", "aas3", "aa4so", "aas7omel", "aat1", "aat7nagt", "aa4to", "aat3r", "aat6sef", "aat7sfee", "aat7slim", "aat6slo", "aat6sly", "aat7sonn", "aat6sow", "aat6sti", "aau6wbe", "aä5ron", "aba6kas", "abak7as.", "aba7komb", "abare4", "aba7ster", "ab3d", "aber6sp", "ab5lau", "ab5rup", "3abso", "abu7scha", "ab5wie", "ac5que", "a2d", "a3da", "a4d3aa", "adam4", "adam7pe.", "ada4r", "a3de", "ades7lan", "ade7smee", "a3di", "adi6eus", "5adjud", "5admin", "a3do", "a4dow", "a3dr", "5adres.", "ads7erwe", "ad4sn", "ads6op.", "ad5sor", "ads7teso", "ad4su", "a3du", "ad5uit", "adu7spel", "adu5tj", "5advert", "a3dy", "ady7smit", "a1e", "ael7atoo", "ae4l5ei", "ae4lo", "aes5to", "aes5tr", "aes7tuur", "aë1", "4afee", "af5eks", "afel5aa", "af4fre", "af5gha", "af5inr", "af3l", "a4fof", "af1r", "af5raa", "af5ram", "af5ran", "a4f3re", "3afri", "a4f5rit", "a4f3ro", "a5frod", "a4f3ru", "af3s4w", "3afva", "afval5", "ag3aa", "a6gaanv", "a4gaar", "ag5adv", "a4g3ak", "ag5alg", "ag5api", "ag5are", "4age.", "4ageb", "4aged", "age6ddo", "a4gei", "4agem", "a4g5erv", "4ages", "a6g5ewen", "agge7us.", "a3gi", "a5ging", "a4g5ins", "agi5s6tr", "ag1l", "ag5ogg", "ag5ord", "ag5ork", "ag5oud", "a4g3re", "ag5rei", "a4g3ru", "ag3sa", "ags7abno", "ag6sins", "ag5ska", "ags7koev", "ag5skol", "ag5skr", "ag5sky", "ags4lo", "ag4sn", "ags6oep", "ag5som.", "ags6oom", "ags6op.", "ag5spe", "ag5s6por", "ags4t", "ags7taal", "ag5sti", "ags6waa", "ags6wee", "ag4tu", "agt7uur.", "a4g3ui", "ag5ure", "ag5uur", "ag-7lag.", "aher4", "ahe5ri", "a4hs.", "ai1", "aig6ne.", "aiï5er", "ai4lp", "ain6ste", "aip6eis", "ai3s4k", "ai5sla", "ais4p", "ais7prys", "ais4t", "ai3tj", "ai3t4r", "a4k5aan", "ak5arb", "ake6lee", "ake6lof", "ak5ess", "ak5ins", "akis4", "akis7te.", "5akkoo", "a2k3l", "a5klank", "ak6leet", "a2k3n", "ako6bre", "ak5oms", "a1kr", "a4k3re", "ak5rig", "ak4sc", "ak5sme", "ak3sp", "a4k3ui", "a2kw", "ak3we", "ak5win", "a3ky", "a4kys", "a1la", "ala7gadi", "a5lagm", "al5agt", "ala7kled", "alan7gaa", "al5dei", "a4lef", "ale6str", "al4f3e", "alf6eni", "al4fh", "al5fie", "al4fj", "alf7olie", "alf6sko", "alf6sni", "alf6sta", "alfs7tan", "al4fu", "alf4-", "5algori", "alien5s", "ali6gal", "ali7glas", "alk7aard", "alk7laag", "alk7oond", "alk5sp", "al4kui", "alk7wyk.", "5alleen", "alm7eier", "alm7lont", "a1lo", "als4a", "als7agti", "als7ghaa", "al6skel", "als7kelk", "als5li", "al4s5oo", "als7pret", "als5waa", "als7werw", "alt6hea", "alt6hus", "alt7rots", "alt6sas", "alt6wee", "a1lu", "alve5o", "a2m", "a3ma", "ama3k4", "aman6t5j", "ama7rins", "am5atoo", "5ambag", "5ambass", "a3me", "am5egt", "ame6sin", "ame5sm", "ame6spo", "a3mi", "ami7skyw", "amm6afu", "5ammun", "a3mo", "amp7arre", "amp7lag.", "amp7leer", "amp7lig.", "amp7lug.", "amp7omhe", "amp7seël", "amp7sfee", "amp7sier", "amp7staf", "amp7staw", "ams7esel", "am6s5kop", "ams7lend", "am6smet", "ams7meti", "ams6mul", "am4s3o", "ams7pels", "am6swan", "am6swar", "ams7wyn.", "a3mu", "a4mui", "am5uit", "a3my", "an5agt", "ana7kwal", "an5alf", "ana6spi", "an4c-", "and7aans", "and7adel", "an6dakt", "an5dan", "and7anal", "an4dap", "an6dase", "an6datt", "and7attr", "an6degt", "and7egte", "and5eks", "and7emal", "an6derf", "and7erf.", "an6dete", "and7etes", "and7eval", "an6dinw", "and7inwa", "and6ja.", "and6jar", "an4d5om", "an4don", "an4d5op", "and7oud.", "an6drak", "an4dro", "and6ser", "and6s7kop", "and7spaa", "and7spre", "and7steg", "and7swee", "an7dwing", "and7wyn.", "ane6ron", "ang7aal.", "ang7adem", "ang7ghor", "ang6hai", "ang6lad", "an5g4li", "an6glig", "ang7lig.", "ang7lip.", "ang6nol", "ang6ons", "ang7ore.", "ang7repu", "ang7sakm", "ang6ska", "ang7snee", "ang6s7te.", "ang7stem", "ang6sur", "ang7ure.", "anie6t5r", "an5inl", "ani5sf", "ani7slaw", "an6kase", "ank7asem", "ank7refe", "an4kry", "ank3w", "an5ops", "an5opt", "an5opv", "an5ord", "an5org", "ano7roei", "ano7stoe", "anr6hyn", "ans7aalw", "an4s5am", "an6sass", "ans7asse", "an4sc", "ans7eila", "ans7eura", "an6sink", "ans7ink.", "an6sjek", "ans7jekk", "ans7jord", "an4ske", "ans5kei", "an6skin", "an6s5kop", "ans7kous", "an6slat", "ans7mada", "an4sn", "ans7oran", "an4s5pa", "an6sper", "ans7pet.", "an4spo", "ans4ti", "ans7toil", "ant5aan", "ant5aar", "an6tass", "ant7asso", "an4tei", "an6teks", "ant7ekst", "5antenn", "ant7ete.", "an6tins", "ant5jo", "an4tol", "ant7opru", "ant7rest", "ant5rin", "ant7rob.", "ant6ski", "ant6sko", "an4tui", "5antwo", "a1ny", "a1o", "a2p", "a3pa", "a4p5aan", "a4p5agt", "ap5aks", "ap5arm", "5aparth", "a3pe", "ape6nop", "a3pi", "api6rfa", "ap3l", "a3po", "apo6kaa", "ap5ond", "apo5sta", "5appar", "ap1r", "ap5rol", "ap3ru", "a4pry", "ap5ryk", "a5prys", "ap6sall", "aps7alli", "ap6seko", "aps7iden", "ap6skof", "ap6s5taa", "ap5sti", "aps7toet", "aps5we", "a3pu", "a4pui", "ap5uit", "a3py", "a1ra", "ara7gwan", "ara7klee", "ara6kop", "ara3p4", "ara6ppa", "ar6d5agt", "ar6das.", "ar6datm", "ar5der", "ar6deti", "ar6d5opp", "3area", "aree5s", "areg7swe", "ar3ei", "are7knip", "ar5fla", "arg4h", "ar5gha", "5argite", "ar4gl", "arg4o", "arie4f", "ari6jke", "ar6k5ana", "ar6kini", "ark7leer", "ar5klo", "ark6los", "ark7onvo", "arko6v.", "ark7snui", "ark5sp", "ar4kw", "ark5wa", "arn6avo", "a1ro", "aroet6j", "aroe7tji", "aroo5h", "aroom4", "aroo5p", "aroo5s", "ar3op", "aro6wva", "ar5rag", "arres5t", "ars5ag", "ars7elek", "5arsena", "ar5sie", "ars6kou", "ars7krap", "ar6skre", "ars7kree", "ar6skro", "ars7pan.", "ar4spr", "ar6stal", "ars7tall", "ars7tee.", "ars6-in", "ar6taas", "art7aasv", "ar6talb", "art7albu", "ar4t5as", "ar4tc", "ar5te.", "art7eend", "ar5teh", "ar4tei", "art6hol", "art6hur", "art6omo", "art5oog", "art5oor", "ar4tor", "art7reek", "art7roep", "art6ryb", "art7samb", "art6slu", "art6spr", "art7spyn", "a1ru", "arus6o.", "a1ry", "ary7taal", "as3ag", "as5app", "as3c", "as4d.", "as4dh", "as5egt", "ase6rak", "as5ete", "as3f", "asg6hit", "as4hi", "asi7freu", "a4sj.", "a4sjm", "a2s3k", "a5skool", "a5skri", "as5kru", "a2s3l", "as5laag", "as3m", "a4smy", "a4sna", "as3no", "as9of.", "as5ogi", "a4s3oo", "as3op", "as3p", "as4por", "as3t", "as4t.", "a5staa", "as4th", "ast6les", "a5stof", "a7strak.", "a5s6tran", "a5s6troo", "as3w", "a4sys", "as5yst", "at5aar", "a4tag", "ata3s4", "ata6sse", "atas7se.", "ata6wba", "ate5it", "5atelj", "ate6rar", "ate6rer", "ate6ron", "a6tetes", "ath7cart", "a5t4hee", "ath7kinp", "ath7lone", "atie6te", "a2t3j", "atk6v-s", "5atleet", "5atmos", "at5oog", "at5ry.", "ats7alma", "at6sint", "ats7inte", "at4sj", "at6skin", "ats6kom", "at6skop", "ats7kop.", "ats7krip", "at4s5le", "ats7lykh", "at4sm", "ats6maa", "ats7nood", "at6somw", "ats7omwe", "at4son", "ats5ond", "ats7onko", "ats7onlu", "ats5op", "ats7ower", "ats7tend", "ats7trek", "ats8treke", "at6stro", "ats3w", "at5the", "att6hys", "at4tu", "atu6maa", "2au", "aud6rey", "au5gra", "aug6sbu", "aul6spo", "au3p", "aure5u", "auri5s4", "aus4t", "aus7tin.", "au5str", "aus7tus.", "aut6ste", "ava6lop", "ave7lott", "avlo6v.", "3avon", "awa7glas", "awas4", "awe5ga", "awe4r5a", "awer6ui", "aws6han", "ax5ofo", "a3ya", "ay4a.", "ay5ist", "ayn6ard", "ayn6or.", "a3yo", "a3yw", "azoo7ka.", "azz7agti", "az4zl", "azz7orke", "1ä", "1b2", "2b.", "babak4", "bab7wiër", "ba4d5ra", "bad5sp", "ba4kin", "ba3kl", "ba4kla", "ba6kleu", "ba4k3o", "ba4k3r", "bak3w", "bal6kla", "ba4lo", "bal7onts", "bal5or", "bal7tsas", "ban4da", "ban6dek", "ban4d5r", "ban7glad", "bang7ste", "bangs8te.", "ban4k5a", "ban6kre", "ban4kw", "bar7kaan", "bar4s3", "bar5th", "bas7ekst", "bas7ghit", "bas7jan.", "ba4sn", "ba5spe", "bas7peer", "bat5aan", "ba3t4j", "2bb", "b3ba", "b3be", "b3bi", "b3bl", "b3bo", "b3by", "2bd", "b3de", "b3di", "b3do", "bed7slaa", "bed6sta", "beds7taa", "be3dw", "beel6dr", "bek7neus", "bek7wind", "bel6aga", "belk6li", "bel7klik", "bel6ldo", "ber6gaa", "berg7aar", "ber4gl", "ber4g5r", "ber7grys", "ber6gzi", "bers7pan", "ber6spr", "bers7pre", "bert6sk", "bes6aan", "bes4k", "be5ska", "be3sl", "be3sm", "be3so", "be5son", "be5sôr", "be3s4t", "be6s5ter", "be5sti", "be6stia", "bes7tial", "bes7trol", "bet4h", "be5tha", "bet7hesd", "be5ton", "be3tw", "2b1f", "2b1g", "b3ge", "bid3s", "bi4du", "bid7ure.", "bie6dui", "bie4g", "bieg5r", "bi4jl", "bin6dri", "bio7sfee", "bi4rc", "bis4a", "bis6ho.", "bis7scho", "bi3tr", "2bj", "b3je", "2b1k", "b3kl", "b3ko", "b3ku", "bla4d5a", "bla6don", "bla4d5r", "bla5so", "4blau", "bleem5", "ble4s", "ble7ser.", "bles5k", "ble6tji", "blet7jie", "blê6rfl", "blik5o", "blix7en.", "blo4k3", "blo7kaal", "blo4m3", "blu6sem", "bly7mare", "bly3s4", "2b1n", "b3no", "bob7slee", "boe6kil", "boe6kom", "boe6koo", "boer6st", "boers7te", "boe4s5k", "bog7gher", "bog7skut", "bo2k1", "bo3ka", "bok6aak", "bok6ale", "bok6as.", "bok6erf", "bok6ies", "bok3l", "bo7kleed", "bok6om.", "bok6ors", "bok6ost", "bok3r", "bok6rag", "bo4m5aa", "bom6aat", "bo4m3o", "bon6dam", "bon6dra", "bond7raa", "bon6tel", "bon4t5r", "bo9op.", "bop6laa", "bor6dak", "bor6des", "bor4g5a", "bor6gri", "b4ors", "bor6saa", "bor4s5k", "bor4s5l", "bor4s5t", "bo2s", "bos7anem", "bos7jamb", "bos7pepe", "bos7taai", "bo5s4tr", "bos7uil.", "bo5t4ha", "bot6sto", "bou6it.", "bou3s4", "b3pr", "brand5a", "breek5", "br4ei", "brei5s4", "brengs7t", "brie6kw", "briek7wa", "3bro", "bro4n", "bro4sk", "bro6vni", "bro6wni", "bru4l", "4brup", "br4üm", "2b1s", "b3se", "b3si", "b3sk", "b3so", "b3sp", "b3st", "bs4ti", "b3su", "2bt", "b3te", "b3ti", "buc7cleu", "buik5s", "bui5t4j", "bult7af.", "bul4t5j", "bul6top", "bult7op.", "bul6tui", "bun7senb", "bus6had", "bus7toer", "but6hel", "buu7rend", "2bv", "b3ve", "b3vi", "2bw", "b3we", "by1", "by3d", "by3k", "by4lb", "by4lt", "by3n4a", "by3s", "bys6kot", "bys4l", "bys6tek", "bys7ter.", "bys6tor", "bys4w", "byt7alka", "byt7eier", "by3tr", "1c2", "2c.", "ca4es", "cam5ph", "ca3pr", "ca3ra", "car6lto", "caru7so.", "cat4h", "ca5tha", "2cc", "c3ca", "c3ch", "c3ci", "c3co", "ce4st", "ces5te", "2ch.", "che6lan", "5chemi", "che6reg", "che5r4i", "che7ryl.", "che7styl", "che6vvi", "ch5hoe", "ch5lei", "ch5nik", "cho7rage", "ch5sia", "2cht", "2ck", "c3ke", "cot7rand", "cove7ry.", "2ct", "c3ta", "c3to", "c3tu", "cus5to", "cyp7rian", "1d", "2d.", "4d5aanb", "d5aand", "4d5aank", "d5aansl", "daard5u", "4dabs", "2d1af", "da2g", "da5gas", "dag5et", "da5gha", "dag6ham", "da5gra", "dag4sk", "dag5so", "dag7ster", "dak7lei.", "dak7oorh", "da4k3r", "dak5wa", "4d5alar", "4damb", "dam6plu", "3dan", "dan6k7erk", "dan6sak", "dan6sko", "dans5m", "dan4so", "dan4s5t", "dan4t5r", "daph7ne.", "dap4l", "da5pla", "4d3arm", "4dart", "d5arti", "da4s.", "das7lag.", "das7traa", "da3t4j", "2db", "dby6lvo", "2dd", "dda5kl", "dda3s4", "dde6lee", "ddel5so", "dder7aal", "dde6ras", "dder7as.", "d3dh", "dd4hi", "deba4t", "dee4g", "deeg5r", "dee4l", "dee7lig.", "4d5eenh", "deë7skou", "4deg.", "2dei", "de3ka", "dek6aan", "de6klad", "de6k5lat", "de6klei", "dek7lei.", "de4kna", "6dekono", "de6krie", "dek7riet", "4deksa", "dek6ska", "del7appe", "del5eeu", "del5egg", "d5elekt", "del7elek", "6d5eleme", "de6leng", "del7enge", "del6fer", "del5fi", "del6fos", "delf7os.", "del5oor", "del7oper", "del6ser", "del4so", "del7sold", "del7sone", "del4sp", "del6str", "del7stre", "delt6ag", "del7tagt", "del7weis", "4demm", "dem6pla", "den6din", "4d3eng", "4denj", "den6kar", "den6kja", "den4k5l", "den4kr", "dens7pre", "den4t5j", "den6tri", "deo7plek", "deo7sfee", "3dep", "der5ast", "de6reen", "der7een.", "der7emig", "der7ent.", "der7flap", "de6rin.", "derm7ins", "der5na", "de4ro", "de5rob", "de5roe", "der5of", "de5rol", "der5on", "der5ow", "der5ps", "der6sjo", "der5s6kr", "der6slu", "der6spu", "der7thal", "der6uit", "de5sag", "des7alni", "des5ap", "de6seng", "des7enge", "de4s5in", "deskat5", "de6skor", "des7leed", "de4sn", "des7offe", "des7oksi", "de4s5on", "de4sor", "de4spa", "des7pari", "des7poës", "des7prik", "des7taal", "des7tele", "de4sti", "de5stig", "de4sw", "des7weë.", "4d5ete.", "deten6te", "de3tw", "4deuro", "deur5s6w", "2d1f", "2d1g", "dge5sp", "dg4li", "2dh", "dias4", "dia7stol", "dia6zvi", "dic7kie.", "dic7tio.", "die6fal", "die6kes", "5diens", "die4pl", "die6tom", "die4t5u", "dig6ofa", "di4gre", "digs4", "dig7skro", "dig7som.", "di6kamp", "dik7amp.", "di4k3l", "di4kr", "dik7ribs", "di4kw", "dik7wyn.", "di4l5al", "din6gas", "din4gr", "4d3inl", "4dins", "4d3int", "4d3inv", "di6sass", "dis7assi", "di4so", "di5son", "dis6pne", "dis7quis", "dit6hak", "dit7jies", "2dj", "dja7dji.", "d4ji.", "d4jia", "2d1k", "dklo4", "2d1l", "d3la", "2dm", "2d1n", "doek5r", "doe6lon", "doe6sko", "does7kop", "2dof", "4dogi", "do4l5os", "dol6sou", "dols7ou.", "3dom", "dom6pli", "dom6sap", "4d5omse", "dom7slim", "dom6swê", "4domt", "don4sk", "4d5oord", "4dopn", "dop6rof", "dop6rys", "3dor", "4d3org", "dor7othy", "dor4sl", "dor4st", "dos6tel", "dou3t", "do3y", "doy4e", "2dp", "d2r", "3dra", "dra6gaa", "4d5rand", "dra7stan", "4dreë", "4d3reg", "d4rela", "d4rew", "4driff", "d5rigt", "d5riss", "4driv", "droë7ys.", "4d5rond", "d5rooi", "4d5roos", "dr4op", "dro6pan", "dro5pn", "dro7sfee", "4d3rug", "d5ruim", "d5ruit", "4d3rus", "4d3ry.", "4d3rye", "4d3ryk", "4drym", "d4ryw", "2ds", "ds5aamb", "ds5aar", "d4s3ad", "d5sakr", "ds5aks", "ds5angs", "d4s3ar", "ds3as", "d3se", "d4s5een", "ds5eis.", "d4s5eko", "dse4l", "dse7leer", "d4s5eng", "d4s5era", "dser6tj", "dsert7ji", "d4s5erv", "d5sfeer", "ds3id", "ds5imp", "ds5inde", "d4s5ins", "ds5int", "d2s3j", "d5skee", "d4skin", "ds5kind", "d4skis", "d5skole", "d4skom", "d5skoo", "d6skraa", "d6skrit", "d6skroo", "d4s3le", "ds3li", "ds6luie", "ds3m", "d5s4mee", "ds6moor", "d4sna", "ds5neu", "ds5noo", "ds5not", "d2s1o", "d3soe", "d5some", "ds3on", "d7sonde.", "d7sondes", "dson4t", "ds5oog", "ds3op", "ds3ow", "d5s4pel", "d5spes", "d3spi", "ds5pop", "ds6prek", "d7spreker", "ds7preki", "d1st", "ds5taak", "d4staf", "d5stand", "ds5tea", "d5stel", "ds5tent", "d5ster.", "ds5terr", "d5sters", "ds4ti", "d3str", "d3stu", "ds3w", "d3sy", "2dt", "dter6tj", "dtert7ji", "du4e-", "duns6te", "dur6rhe", "dusie5k", "dus6kap", "dus6pel", "2dv", "dverdiens9", "dverdien8st", "dve6sid", "dvie4", "2dw", "d4waal", "d5waar", "5d4wang", "dwa6nor", "4dwarm", "dwar7se.", "d3wat", "d4weil", "5dwerg", "dwerk5o", "dwe6tar", "d3wil", "d4wing", "4dwoo", "d4wyn", "dys5ag", "dys6mit", "dys7tuin", "2d-", "d-r6hod", "e1a", "eam6ses", "eang4", "eate4", "eau7mont", "e3ba", "eb5adr", "eb9cu.", "ebou5t", "ebou6t.", "eb4re", "ebrons5", "eb5tui", "ec5cle", "e4chn", "ech7tiaa", "eda7gaat", "eda5go", "e3de", "ed5eis", "eder7as.", "ede7ring", "ede6sap", "ed5off", "edors5", "ed4ra", "ed5rep", "ed6saks", "eds7kalm", "ed4sl", "eds7lafe", "eds5om", "ed3sp", "ed5s4we", "ed5uit", "ed2w", "ed5woo", "ed5yst", "ed3yw", "ee5agt", "eed6atu", "eed5we", "ee4dy", "ee2f", "eef7laag", "eef7lopi", "eef7rant", "eef7rek.", "eeg3l", "eeg5ru", "eeg3s4", "eeg6sdi", "e5eila", "ee2k", "eek5ass", "ee5klaa", "ee5klag", "eek5lo", "eek3n", "eek5og", "eek7oors", "eek7rooi", "eek3w", "eek6wal", "eel5ap", "eel6doo", "eel7doos", "eel5een", "eel7eer.", "eel5ei", "eel7indr", "eeling7s6", "ee6lins", "eel5int", "ee4l3o", "ee5lob", "eel6ood", "eel6oon", "eel5sa", "eel7snag", "eem7onde", "eem5ou", "ee2n1", "5eendj", "een6ema", "ee5nen", "3eenj", "eenk4", "een5kl", "een7slot", "een5sm", "eens6pa", "een7swee", "een7topp", "ee4ny", "eep7esel", "eep7leer", "eep7loog", "ee4pop", "eep7roes", "eep6sam", "eep7skep", "eeps5ko", "eep7skui", "eep6sti", "ee2r", "eer5ap", "ee5red", "eer5ee", "eer5end", "eer5in", "ee5rob", "eer7oes.", "eer5om", "eer5on", "ee5row", "eer5ps", "eer7skur", "eers7lam", "eer7smed", "eer6sow", "eer3u", "eer6ust", "eery4", "eer5ys", "ee2s3", "ee4s.", "ees6ala", "ees6ap.", "ees6lep", "ees5me", "ees7muil", "ee5sna", "ee5sny", "ees6op.", "ees6pre", "ee5staa", "ees6tal", "ees4tr", "ee6styd", "ee4sw", "ee5syd", "ees6yfe", "eet7appe", "eet7eenh", "ee4ti", "eet5in", "eet7rek.", "ee6troe", "eet7roed", "eet7ruik", "eet7wiel", "eeu3g4", "eeu5in", "eeus4", "eeu7spoe", "eeu5tj", "eeu6ur.", "ee5yst", "e3êr", "eë5aan", "eëks5t", "eël7eier", "eël7yste", "eë4na", "e3ër", "eër7agti", "eë5ran", "eër7arm.", "eë5rod", "eër6ske", "eë4sk", "eët6ste", "eëts7te.", "e4faf", "ef5afs", "ef5eks", "5effek", "ef5inh", "e1fl", "ef5loo", "e4fly", "ef5oms", "ef5oue", "ef3st", "efs6tal", "eg5amp", "ega5s4k", "e3ge", "ege6las", "egel7as.", "eges7per", "eges4t", "ege6vwo", "e6ginko", "eg5ogg", "eg5rig", "egs7enti", "eg6sins", "eg6s5int", "eg3sk", "egs6lot", "egs6pre", "egs6pri", "egs6pyk", "eg6s7taal", "egte6re", "e4g3ui", "eher6in", "ehe7rinn", "eho6kra", "eib7niz.", "eid7rok.", "eid7saam", "eid7salo", "eid7sirk", "eid7skou", "eid7sku.", "eid7spa.", "eid7spek", "eid7ste.", "eid7stoo", "eid7sug.", "ei1e", "eie7naan", "eig6h-n", "eig7opro", "eik7aard", "ei5kno", "eik7wydt", "eil6spa", "3eind", "ei4n5ed", "ein7eed.", "ein7glas", "ei4non", "ein7oord", "ei4n5op", "ein7otte", "ein6sad", "ein6sep", "eis7angs", "ei5sei", "ei6s5ind", "ei5sja", "eis7kamm", "eis6kaw", "ei5skê", "eis6kot", "eis6laa", "4eiso", "eis7ouer", "eis6pir", "ei5s6tel", "ei5s6tre", "eit2", "eit7hand", "ei3tj", "eit7klin", "eit7nisp", "eit7onde", "ei5tra", "eits5ko", "eits5l", "eits5o", "eit7spor", "eit7stak", "eit7stra", "eits5w", "eï5mit", "eï4na", "eïn7klin", "eï4no", "eï4nu", "eï5oni", "eï4sl", "eja7stas", "ek5aan", "ekaars8te", "ek5aks", "e3kan", "ek5asg", "e3ke", "ek5een", "eke7naar", "eke6tam", "e3kê", "e4k5ins", "ek3k", "e4k5les", "e5kleu", "e4klê", "ek5log", "e3koe", "eko6mol", "ekom4s", "ek5omsl", "ekoms5t", "5ekono", "ek5ooi", "e3kop", "eko6pap", "e4k5opm", "ek5opn", "ekor6da", "eko7rum.", "ekou6st", "ek5owe", "e1kr", "ek5rad", "e4k5rok", "e5krom", "ek5rug", "ek6sapp", "5eksemp", "eks5esk", "eks7inge", "eks7logi", "eks7loks", "eks7outo", "eks5pir", "eks5po", "eks6poe", "eks6tel", "ek6sten", "ek4sti", "eks7uur.", "ek5uit", "e4kwê", "ek5wie", "e4kwu", "e1ky", "e1la", "e6l5aand", "el5aanh", "e6laanv", "el5aard", "el5adm", "el5adv", "el3af", "el3ag", "e5lag.", "ela7klon", "e4l3al", "e5lari", "e4l5arm", "ela7slan", "el5asp", "eld7adel", "el4dap", "el5de.", "el6d5ele", "eld7erfe", "eld7evan", "eld7olie", "eld7onde", "eld7smid", "e3le", "el5eien", "eleis6t", "elei7sta", "e6lelek", "el5erts", "ele7sett", "ele6too", "el4faa", "elf6abr", "elf6eit", "elf7en-d", "elf5erk", "elf6lan", "elf6les", "el4fon", "elf7onth", "elf7ontp", "el6foop", "elf7oops", "el6foor", "elf7oors", "elf6ron", "elf7twyf", "e3li", "eling8stell", "el5inh", "e6linko", "el5inv", "elk7nage", "elks4", "el4kwi", "el4lv", "elm5agt", "e1lo", "el4ob", "e4lol", "el5oli", "el5ond", "el5ont", "e4loor", "e4l5opd", "el6ope.", "e4l3or", "el5phi", "els7angs", "el5sfe", "el6sind", "els7indr", "el6skan", "el6skom", "els7korr", "els7krit", "els7lof.", "el5smi", "els7mora", "els6nag", "els7nood", "els7onde", "els7oork", "el6stek", "el6s7tran", "els7ware", "el5swee", "elt7akke", "e1lu", "el5uit", "eluit6j", "elui7tji", "e3ly", "ely6kaa", "em5app", "e5masj", "eme6lek", "eme6lew", "eme6ron", "eme4s", "eme7sis.", "emes5m", "emes5t", "e5metf", "em5eva", "e4moef", "em3op", "em5org", "emp7laag", "emp6skr", "ems4p", "em5spl", "e4naf", "ena7glas", "en5agt", "en5akk", "en5alt", "e4n5art", "ena6spe", "en6d5agt", "ende7ro.", "end7raak", "end7rit.", "ends7oë.", "end7sons", "end7ure.", "end6wer", "en5eil", "en4en", "e4n5ent", "5energ", "ener6tj", "enert7ji", "eng6hor", "eng4la", "eng6lor", "e3ni", "en4ig", "en4im", "en5inh", "e6n5ink.", "eni7soms", "3enji", "en6kinh", "enkom4", "enkoms5", "enk3w", "e5nomm", "eno7ryn.", "en5out", "ens7adem", "en6sall", "ens7are.", "ens7eise", "ens7elek", "ens7elik", "en5sen", "ens5erv", "ens7esse", "ens6haw", "en5sie", "ens7inga", "en5sji", "ens7koei", "ens7kyke", "ens7luik", "ens6med", "ens7nuk.", "en4son", "ens7onru", "ens7onva", "en6spei", "ens7pist", "ens7pot.", "en6spou", "ens7pous", "ens7taak", "en6stak", "ens6tam", "en6steh", "ens6tei", "ens6tel", "ens7tele", "en7sters", "en7s6tes.", "ens6tet", "ens6teu", "ens6too", "ens7toom", "ens7trek", "ens7uil.", "ens7ure.", "en5sy.", "ent5akt", "en6teks", "ent7inte", "ent7rif.", "ent7rok.", "ent6sin", "ent6son", "ent6spa", "ent6wen", "en3ui", "enu6lin", "enu5sk", "enu5st", "e3ny", "en-7steg", "e1o", "eoe4s", "eo5fag", "eo3g4n", "eoi6ste", "eop6lek", "eo3ro", "eo1s", "eos4t", "eo3tr", "e4paf", "e4p3ag", "epe6loo", "ep5emm", "ep5epi", "epers7te", "5epidem", "e4p5int", "ep4la", "ep5lap", "ep5ligg", "ep5lus", "epoet4", "epo6nin", "ep5ops", "e4p5rei", "eps7ameu", "ep6s5eis", "eps5id", "ep4sj", "ep4sk", "eps7kano", "ep5ski", "eps7kohe", "ep4slu", "eps7luik", "eps6oms", "eps5on", "ep4s5pr", "eps7waar", "ep5uit", "e1ra", "er4a.", "er5aan", "er5afd", "er5afh", "er5afsk", "er5aft", "er5afv", "er5afw", "er3ag", "era7gree", "era7kles", "er5aks", "er5akt", "er5alb", "er6ald.", "er5alt", "er5ana", "e5randa", "e4rapp", "er3ar", "era6ser", "era7uitv", "erd7ryle", "erd7slip", "erd7tree", "er3dw", "er4eb", "er6eenk", "er5eers", "er5eff", "er5eie", "er5eil", "er4ek", "er5ekst", "er5elm", "e4r5emm", "e6rengt", "e4reni", "e4renj", "er5erg", "er5erv", "e3r4es", "er5esel", "ere7spio", "eres6ta", "ere6stp", "ere7temm", "e5rewa", "e1rê", "er4fh", "er6flaa", "erf7leen", "er6flet", "erf7lett", "er5flo", "erf7lug.", "erf7lus.", "erf7omhe", "erf7oom.", "er4fp", "erf7reuk", "erf7ruik", "erg7aren", "erg7lyn.", "erg7renm", "erg7rymp", "erg6rys", "erg6sho", "erg7stra", "erg7uitj", "er4id", "eri5fr", "e3rig", "eri4g5a", "e4r5ind", "e6rink.", "e6rinna", "er5ins", "e4r5int", "e6r5ital", "eri7trea", "erk5aan", "erk7esel", "erk6has", "erk7ink.", "er6kins", "erk7inwy", "er4kj", "er6klat", "er5kle", "erk7onde", "erk6opn", "erk6s5on", "erk7spas", "erk6sto", "erk7uurr", "er6kweë", "erk7weë.", "erk7ywer", "er5lik", "er5lui", "erm4a", "erm7aanh", "erm7afsl", "ern7eiwi", "ern7kwes", "er4nm", "er4nn", "ern7oes.", "er4nr", "e1ro", "er5oew", "er3oë", "er5ogg", "e3roï", "e5rok.", "e4r5oks", "e4r5oli", "er5om.", "er5omh", "er5oms", "er6ona.", "er5oog", "e5room", "er5oond", "e5roos", "e4r3op", "e5ropa", "er6opla", "e5ropo", "e4ror", "e5rora", "5erosi", "e4r5oss", "ero7stil", "er5oud", "er5oue", "erou6t.", "erp7anke", "er6pinh", "erp7inho", "erp6lan", "erp7ruik", "erp6sig", "err6ein", "ers7assi", "er6s5eli", "ers7ete.", "ers7inda", "ers7jean", "ers7kaia", "er6skaj", "ers7kaju", "er7skake", "ers7kaki", "ers7kete", "ers7kiss", "ers7koet", "ers7koor", "ers7kop.", "er5sky", "ers7less", "ers7lone", "ers7luid", "ers6mal", "er7smara", "er6smat", "er4s5om", "ers7onvr", "ers6opn", "ers7ower", "ers7pien", "ers7put.", "ers7scen", "er5ste", "ers7tele", "ers6teo", "ers4ti", "ers7treg", "ers7waar", "ert5aan", "er6taap", "ert7aap.", "er5tap", "ert7ape.", "er6tend", "ert7end.", "er5tes", "ert6hal", "ert7jakk", "ert7opin", "ert7orre", "er6tres", "ert7rok.", "erts5l", "ert7uur.", "ert6wak", "er5twi", "e1ru", "erug3", "er5uin", "er5uit", "er3uu", "e1ry", "ery7doel", "ery7salf", "erys6ma", "ery7smaa", "ery7suur", "ery7trek", "e5saan.", "e5sage", "es5agt", "es4ak", "es5all", "esa6mol", "es4an", "es3c", "es4dh", "e3se", "e4s5een", "e4s5epi", "es4er", "e3si", "es4ia", "es4ie", "es4if", "esi6gei", "e4sill", "esin6s5i", "es4it", "e2sj", "e4s5ke.", "es5kle", "eskor6s", "eskors7t", "e5s4kut", "e3sla", "es5lem", "es4lip", "e1sm", "es4me", "es5me.", "es5men", "es9mè.", "e5smou", "es4mu", "es5nie", "es5noo", "es4ny", "esoet6j", "esoe7tji", "eso7fagu", "es4ol", "e3s4oo", "es4ou", "e1sp", "e5spel", "es5pen", "e4sper", "es5pet", "es5pir", "es4pli", "es4pra", "ess6opv", "e1st", "es4t.", "e5stad", "es5tas", "e4s5te.", "es5tea", "es5teli", "e4s5tes", "estes5o", "est6her", "es6tik.", "es5toi", "es5tos", "e6strak", "es4tre", "e5stuk", "e3sw", "es4yd", "e4t3ag", "eta7stas", "e3te", "e4t5eie", "ete5r6aa", "etie4l5", "5etike", "et7jie-k", "etk6ysi", "eto6nop", "et5opv", "e4t5ord", "e4t5ram", "e6treke", "e6treko", "etre7kor", "et5rim", "ets7fyn.", "et6skat", "ets7kato", "ets7kous", "ets7krie", "et6s5lap", "ets6maa", "ets5ong", "et6spaa", "et4spr", "et6stek", "ett6re.", "et5uits", "et5unie", "et4wi", "et5win", "et4wy", "et5yst", "2eu.", "eug6rie", "e3uit", "euk7inte", "euk4l", "eul7eien", "eu4loo", "eu5mon", "eum7uitg", "eu4na", "eun6sla", "eup7aand", "eu4ra", "eur5aa", "eur6aal", "eu5ral", "eu4ree", "eur7eet.", "eu6reg.", "eu6regt", "eur7egth", "eur7ekst", "eur7elem", "eur7spar", "eu4sa", "eus7ape.", "eus7jig.", "eus6kot", "eus6tac", "eute4l", "eu5tem", "eu3tr", "e1uu", "2eu-", "eva7kwaa", "eva6les", "evr6ore", "evu6es.", "ewal4s5", "ew4ar", "ewee4", "ewe7gaan", "ewe7goed", "ewe7inde", "e5weis", "ewe6nee", "ewen8stes", "ewe6res", "ewe7span", "ewik4s", "ewiks7te", "exy7ste.", "eyn4o", "e5yste", "e3yw", "e4zka", "ez9ra.", "è1r", "ê1", "êe4ro", "êla7flui", "ê4rde", "êre6loe", "ê4rhe", "1ë", "ë1g", "ëi3e", "ëk4sk", "ëks3p", "ëks6pek", "ëk4st", "ë3laa", "ël5agt", "ël5alb", "ël5as.", "ë4lei", "ël5ent", "ëlf4l", "ël5fle", "ë5loop", "ëls7kuil", "ën5agt", "ën4tr", "ënt5re", "ëpre4", "ër5aan", "ër5afd", "ër5off", "ërog4", "ëro3s", "ër5owe", "ërs7kent", "ë1ry", "ë1s", "2f.", "1fa", "f5aanb", "f3aar", "f3ad", "2f1ag", "f4agi", "fah7renh", "fai6r-n", "fak6ste", "faks7te.", "fan4t5j", "fan4tr", "fant6s5t", "f3ap", "f3art", "faru6q.", "2fb", "2fd", "f5dein", "fde4s", "fde7sake", "fde7sess", "fde7skei", "fde7stor", "fde7stra", "fde7sust", "f3d2w", "1fe", "4feen", "3f4ees", "f3eie", "fe4l5ap", "fel7asem", "fel7enti", "fe6loon", "fel7oond", "fel5s4m", "fel6spoo", "fe4lu", "fe4ly", "fel5ys", "fer6skr", "fers7kra", "fer6sku", "fers7kui", "f5erts", "fe2s", "fes3t", "fet7ete.", "f1f", "ffe6las", "ffe6ret", "ffe6tet", "ffi6eek", "ffies6m", "ff5rei", "f1g", "fge7sper", "fg4ha", "fg4li", "fg4ly", "fgod4s5", "1fi", "fi3d", "fid6ji-", "fie7ekst", "fie7lafo", "fie7smaa", "fie4s5o", "fie6tol", "fi5lag", "fil4m5a", "4finr", "fi5sto", "fit4z", "2f1k", "fkom6st", "fkoms7te", "fla4p", "flap5o", "f2le", "f5lees", "f5lese", "fle4t", "flet5j", "flex7or.", "2fli", "5f4liek", "3f4lit", "2fm", "fmo4no", "f1n", "fni4s3", "1fo", "f3of", "4foff", "fok4s5t", "fol4k3", "4foms", "5fonds", "fond6sk", "fond6st", "fonds7te", "f5ontb", "5fonte", "f5ontl", "f5oorl", "2fop", "fo4po", "fop7spen", "f5orde", "f3org", "for7oksi", "fo5rom", "fo3ru", "fos7feen", "fout5j", "fox7hill", "fox7stra", "fp4sa", "1f2r", "frag6aa", "4fram", "f4ras", "f4ren", "fre4s5k", "4f3rig", "fri6too", "f4rod", "fru5ga", "f3ry", "2f1s", "fs5agt", "f4s5ank", "f4s5eko", "f4skon", "fs5log", "f3sm", "f4sma", "fs4me", "fs4mi", "f3sp", "fs4pl", "f4spro", "f4s5tak", "fs4ti", "2ft", "ftre4", "ftre5d", "ftrek5", "1fu", "fu4ch", "fur6ore", "fu3so", "4fuur", "f5uur.", "2fv", "fva4l", "2fw", "1fy", "fyn7goud", "2f1ys", "fyt7appe", "fyt7jie.", "2g.", "1ga", "g4aai", "gaam6s7te", "g4aan.", "g5aanbi", "g6aandh", "g5aanl", "g5aanw", "g4aat", "4g3add", "2g1af", "g4afo", "2g1ag", "g4agr", "ga5gre", "gag6rep", "gak4l", "ga5kla", "gal7afsk", "gal7appe", "galei5", "gal7oog.", "gan6gra", "4g5anke", "gans7ke.", "g3app", "ga3ra", "4g3arb", "4g3arm", "gar4s3", "gars6ti", "gar7stig", "g5arti", "ga6sarm", "gas7arm.", "gas6mok", "ga4so", "ga5sol", "gas6pel", "gas6tre", "ga4tr", "gat7ruik", "gay7nor.", "2gb", "gbys4", "2gd", "gde7roof", "gdut7jie", "g3dw", "gd4wa", "1ge", "ge3d", "gedi4s", "g5eenh", "gee6tal", "geet7al.", "geës3", "geë6sti", "ge3f", "4ge4ff", "gef4l", "ge1g2", "4geg.", "geges5p", "geg6uil", "g3eie", "geï7migr", "ge7k6lik.", "4geks", "gek4y", "gel6agk", "gel6dad", "gel4do", "ge5lol", "ge5loo", "ge6loon", "gel7oond", "gel6s7te.", "gemi7au.", "gem6opp", "3gen", "gen4dr", "gen6dur", "genes5t", "4geng", "ge4oi", "gep4a", "ge5pag", "geper6st", "gepon6s", "3ger", "ge5rap", "ger6ard", "ger5ete", "ger7iden", "ge6roef", "ger6ogg", "ger6spo", "ger5sw", "ger6uit", "ge3sa", "ge5sfe", "ge5sin", "ges7jagt", "ges4k", "ges7kade", "ge3sl", "ge3s4m", "ge5sne", "ge3sp", "ges7perb", "ges7pers", "ges7pes.", "ge3st", "ges6tas", "ges6tig", "ges4w", "ge5tja", "ge3tw", "ge3ui", "ge5um.", "gev7woes", "gewens7te", "ge1y", "2g1f", "g3fl", "gf4li", "2g1g2", "g3ga", "gga7kwee", "gga7stre", "gga5t4j", "gge6sti", "2gh", "5g4hoer", "gho7ghok", "gho4l", "5gholf", "g4hs.", "ghu6moe", "1gi", "g5iden", "gie6far", "gi4fa", "4gimp", "gin6gaa", "4g5inri", "gip4s", "gip7siet", "gis7enti", "gi5tra", "git5sw", "2g1k", "gkaar4", "5g4lans", "gla4sa", "gla6sel", "gla6ska", "glas5o", "g4le.", "5g4len.", "gli6don", "g4lif", "gli6gur", "4glik", "g4lim", "g4lip", "3glis", "g4lob", "4glod", "3g4loe", "g4lof", "3g4lom", "g3lop", "3g4lot", "g4lo-", "g3lus", "3g4luu", "g4ly.", "4glyn", "2gm", "gma7skui", "2g1n", "gneem5", "gneet5", "gnie6ko", "1go", "god6sak", "god6sid", "4g3oef", "goe7krui", "4goes", "g5oes.", "g5oeta", "goe7the.", "goë7lary", "2g1of", "3gogi", "gol4f5o", "4g5olie", "go4mag", "4g3ong", "gon6sto", "g3ont", "goo5gl", "4g3oor", "2g1op", "go5pla", "3g4opo", "g5orig", "go3sl", "gos7pelr", "g5osse", "go3s4t", "gou4d3", "goud6a.", "gou7dief", "gou7dini", "gou7dink", "goud6s.", "gow7rie.", "go9ya.", "2gp", "1g2r", "g4rab", "g5rak.", "gra4ma", "gra7mado", "gra4m5o", "g4ras", "gra4s5a", "gra4se", "4g3red", "g4ree4", "g5reek", "greep5", "4greë", "g4ren", "gren6st", "g5rese", "gre4sp", "gre6sur", "gre6tji", "gret7jie", "g4reu", "griek6s7t", "grie6t5j", "4grig", "gri4p", "g5rit.", "4g3rok", "g4ron", "4g5rooi", "g5rook", "g5room", "g5rowe", "4grug", "g5ruim", "4g3ryk", "4grym", "gry6ste", "2gs", "g2s1a", "g5saam", "gs3ad", "gs6ade.", "g4saf", "gs5agt", "gs5aks", "g5sala", "g5sale", "gs5ana", "gs5ant", "gs5app", "gs6appe", "gs3ar", "gs3as", "g4s5een", "g4s3ef", "gs5eis.", "g6seise", "gs5eko", "gs5eks", "g5sekt", "g4s5ele", "g4s5eli", "g4s5ene", "g4s5est", "g4sew", "gs5ewe", "gs3f", "g5s6feer", "g4sid", "gs5ide", "g6simpa", "gs5inde", "gs5ini", "gs5inl", "gs5ins", "g2s3j", "g2s1k", "g5skaal", "gs5kab", "g5skad", "g6skapa", "g5skatt", "g5sked", "g5sker", "g7skeur.", "gs7keurd", "g3ski", "g4s5kin", "g4skl", "g5skof", "g5skole", "g4skom", "g5skoo", "g6s5koor", "gs5korr", "g5skot", "g5skou", "gs3kr", "g2s3l", "g3s4la", "g5s4lop", "gs3m", "g5snel", "g2s3o", "gs4ol", "gso6pro", "gs4ou", "gs3p", "g5s4pel", "gs5per", "g5spes", "g3s4pi", "g6spill", "gs4poe", "gs6pore", "g7sports", "g5s4pru", "g1st", "g6s5taak", "g4s5tab", "gs6tabi", "g4stak", "g4stal", "g4star", "g4s5tek", "g6stelg", "g6stera", "gs5teri", "g6sterr", "gster6s", "g6stese", "g4sti", "g5stigt", "g4stoe", "g7stoele", "gs5toer", "gs5toet", "g4s5ton", "gs5trad", "g6strak", "g6stran", "g6strap", "g6strib", "gs5troe", "gs7troon", "g6struu", "g4s3ui", "gs3w", "gs6werw", "2gt", "gte7eenh", "gte7lagi", "gte6ras", "gte6rer", "gte4ro", "gte7roer", "gte7rol.", "gtes4", "gte7sfee", "gte7smee", "gt5uri", "1gu", "gu2a", "gu2e", "gu5ela", "guid6o.", "gui6rla", "4guit", "2gv", "2gw", "g3yst", "2g-", "1h2", "2h.", "2ha.", "hal4f3", "hal6m5ag", "4halo", "hal4s5k", "hal6s5tr", "ham7pagn", "ham6skr", "hams7kra", "han6dan", "han7dja.", "han4dr", "han4du", "han6gli", "han6gor", "hangs6l", "hang5s6w", "han4s5k", "han6ska", "har6dop", "hard7op.", "har6sel", "har6sol", "har6spa", "har6t5aa", "har4t5j", "har4to", "har7toem", "ha4wk", "haw7shan", "hay6eli", "heb7lus.", "hee4l", "heer8s7te.", "hees6e.", "heg7orga", "heg7rank", "heg7spyk", "5heid.", "heid7stem", "he4ko", "hek7saan", "he4k3w", "hel7ange", "hend4", "hen4so", "he2r", "her3a", "he9ra.", "her6akl", "he7rald.", "he5r4an", "he3re", "her7egpa", "he4r5ek", "he4r5ev", "herf4", "herfs5", "her3i", "her6ib.", "he5rid", "he5rod", "he5rol", "her5ond", "her7ontm", "he5ros", "her6oss", "he5rou", "her5ow", "her7sche", "her3u", "her5yk", "he4sp", "hes7peru", "he4s3t", "hete5r6o", "heu6paa", "he3us", "hev3", "he4vr", "hewen7st", "hie4r", "hier7in.", "hie7roni", "hie7rony", "hië1", "hil6lbr", "5hings", "hing6s5t", "hipe4", "hi4rl", "hi4sp", "his5pa", "hi4v-", "2hl", "h3li", "2hm", "h3ma", "2hn", "hode6sl", "hodes7la", "hoe7kaai", "hoe6kys", "hoe6spi", "hoe4s5t", "hoër7op.", "ho4fa", "hof5aa", "hof7amp.", "hof7uits", "hog6hok", "hoi7swer", "hok7rakk", "hol7aar.", "holes5", "4holf", "hol5in", "hol7oog.", "4hon.", "hon6daa", "hon6dag", "hon6dro", "hop7land", "hop7smaa", "ho3ro", "hor4s", "hor4t5j", "hos6hol", "ho4ta", "hou4t5a", "hout5j", "hou6tol", "hou6tom", "hou6who", "2hr", "hre6sto", "hrie4", "hries5", "hris5t", "h3te", "h3to", "hu9go.", "hui6daa", "hui6dui", "hui6sef", "huit6ji", "hui7tjie", "huk6hun", "hul4p5a", "hul6pek", "hul6ple", "hul6por", "hul6ste", "huls7te.", "hu3mo", "hum7oes.", "humus5", "huter6s", "hut7jie.", "hut6spo", "hut6ste", "huts7te.", "h5vill", "2hw", "hyg7roma", "hys3k", "hys7tang", "i1a", "iaan6so", "iaan6sp", "iaan6st", "iaans7te", "iam7son.", "ia4nop", "ias6koo", "ia5spo", "ia5sta", "ia5s4tr", "i4baf", "i4bag", "ibou6s.", "ic5ky.", "i2d", "i3da", "ida7groe", "id5agt", "idde6ra", "i3de", "ide7snui", "i3dê", "i3di", "idia5s", "id4ja", "i5djan", "i3do", "i3dr", "id2s1", "id4s5et", "ids7inoe", "id4ska", "ids7kerm", "ids5kr", "ids3l", "ids7lags", "ids7nye.", "ids3o", "ids3p", "ids6pa.", "ids6pek", "ids6pie", "id6spil", "ids6pri", "id6spry", "ids7taal", "ids7tee.", "ids7teks", "ids7tele", "ids5ti", "ids5toe", "id6s7trek", "ids7ure.", "i3du", "id3uu", "ieding6s7", "ied7ione", "ied5rol", "ied3w", "i1ee", "i4eee", "ie5een", "ieë7aard", "ieë6lys", "ief7alar", "ie5fie", "ie4f3r", "ief7stal", "ief7uitg", "ie5gla", "ieg7loka", "ieg7riem", "ie6grit", "ieg5st", "iek7asyn", "ie5ke.", "ie6k5erv", "iek7esse", "ie5kie", "ie6klaa", "iek7laai", "ie4kni", "ie6k5ond", "iek7ople", "ie6kops", "iek7opse", "iek5opv", "ie4kre", "iek7revu", "iek7rigt", "iek7ware", "iek7wees", "ie4k5wi", "iek6wos", "iek7wyd.", "ie4laa", "iel6afo", "ie6lene", "iel7oor.", "iel6san", "iel6s5on", "ien7anal", "ien7glor", "ien6kro", "ien7olie", "ie4n5oo", "ien4s", "ien7sakk", "iens5or", "ien7sout", "ien7span", "iens5t", "ien7stam", "ien7stel", "ien8stele", "ien7stet", "ien7stoo", "ien5suu", "ie4n5ur", "ie6poog", "iep7oog.", "ie6proo", "iep7rooi", "ier7afma", "ie6rafs", "ier7engt", "ier7eter", "ier7neff", "ier7omtr", "ie4r5on", "ier6oni", "ier6ony", "ier7swee", "ies6amp", "ie5se.", "ie6senk", "ies7enke", "ies7ents", "ies7ferw", "ies7kaf.", "ie6skon", "ies7kop.", "ies7kraa", "ies6kry", "ies7laag", "ie6slep", "ies7lepe", "ies5li", "ies7luik", "ies7meub", "ies7mooi", "ie3so", "ies7oes.", "ies5ond", "ies7oorp", "ie6sopn", "ies7opne", "ies7pane", "ies5per", "ies7plig", "ie6s7taal", "ies6tas", "ies7tee.", "ie6steh", "ies7tele", "ies7tent", "ies6tin", "ies5uil", "ie4s3w", "iet7aans", "iet7aard", "iet7alba", "ie5te.", "iet7erts", "iet7omse", "iet7reke", "iet7reko", "iet4sl", "iet7uie.", "ie5twi", "ie4tys", "i1eu", "i4eub", "i4eud", "i4eug", "ieu7grie", "i4e3ui", "ieu7ing.", "i4eul", "i4eum", "ieu7skot", "i4euu", "i4euv", "i4euw", "ie5wie", "ie4w-", "ie5yst", "ie-7klik", "i3èr", "i1ê", "iël6sku", "iën6tji", "iënt7jie", "ië4s3t", "i4fei", "i4fim", "i4fin", "if1l", "i2f3r", "i4f3ui", "i4g5aan", "i4gap", "igare4", "igaret5", "ig5eff", "ige6naa", "ig5ete", "ig5ins", "ig1l", "ig5loe", "ig4op", "ig5opt", "ig5org", "igo7roos", "ig5res", "ig5roo", "i4g3ry", "ig3sa", "igs6ins", "igs7kaps", "ig7skend", "igs5ko", "ig5sku", "igs6mee", "igs6ona", "ig5soo", "igs7poei", "ig5sti", "ig7stoei", "igu7era.", "ihu6ahu", "i1i", "ike6roe", "iket5j", "ik5kli", "i2k3n", "iko6nat", "i1kr", "ik6sakt", "iks7akte", "iks7iden", "ik4sin", "iks7inve", "iks7juk.", "ik6skom", "iks7paar", "iks6pad", "iks7pare", "iks6tik", "iks6tuu", "iks6wel", "ik5wan", "i4k3we", "i4kwy", "2il", "i1la", "il5agt", "ila6too", "ilbe6st", "ild7agti", "ild7smaa", "ild6stj", "ild7temm", "ilet5a", "ile6tji", "ilet7jie", "ilf4l", "il5fli", "il5gha", "ilinde6", "illo4w", "3illu", "il4m5at", "ilm7oper", "i1lo", "ilo5sk", "ils7insp", "ils7orde", "il4spr", "ilt7aar.", "i1lu", "i2m", "i3ma", "im5agt", "i3me", "i4mek", "im5eks", "ime7laar", "iment6s", "ime4s", "imes5t", "i3mê", "i3mi", "5immigr", "i3mo", "i4m3o4p", "imo7theu", "5implik", "i3mu", "imu6maa", "in5aard", "i4naf", "i4n3ag", "in5akk", "in5arg", "in4d5aa", "in4das", "inder7as", "5indiv", "ind6oef", "in6doog", "ind7oogm", "in6d5oor", "ind7sleu", "ind5sw", "3indu", "in5dwi", "inee7tji", "ine5ra", "2inf", "ing7aars", "in5gan", "ing7eter", "ing6hpa", "in6gind", "in6ginf", "ing7infr", "ing7inst", "ing6leb", "ing6ope", "ing6opl", "ing5ou", "ing7pseu", "in4g5ru", "ing7saag", "ing7sap.", "ing7see.", "ing7sekr", "ing7seku", "ing7sfer", "ing7sin.", "ing7sinj", "ing7skal", "ing7skêr", "ing7skud", "ing7slep", "ing7slym", "ing7sofa", "ing7som.", "ing7somm", "ing6s7pil", "ings9telle", "ing7stin", "ing7suie", "ing7suil", "ing7swel", "ing7uil.", "i3ni", "ini6gaa", "in4ik", "in5inf", "5inisia", "ink7erts", "ink7laag", "ink7ler.", "ink7nerf", "ink5nu", "ink7ogie", "in4kol", "ink7olie", "5inkom", "ink7ring", "in6krol", "ink5st", "ink7wit.", "5innam", "5innemi", "innes6t", "inne7ste", "in5ong", "ino7skaa", "in5rag", "5inrig", "ins7epou", "in6s5ete", "5insets", "in4sg", "ins7kaps", "ins6kin", "in3sl", "ins7molt", "ins7moor", "ins6ond", "5inspek", "ins7prie", "ins4t", "5insti", "insti7t.", "ins6ton", "ins7twis", "int7appe", "int5ess", "inte6s5t", "int6he.", "int6uit", "int6wyf", "inu5e.", "5invlo", "i1o", "io3pr", "ior6ubr", "io1s", "ios4k", "io5skl", "ios4p", "ios4t", "io3tr", "i2p", "i3pa", "i4p3ag", "i3pe", "i3pi", "i3pl", "ip4lo", "i3po", "ipo4s5t", "i3pr", "ipre4", "ip4s.", "ips7kopi", "i3pu", "i4pui", "i3py", "i1r", "ir4ch", "irke4", "irkel5o", "irop4", "iro5pr", "iru4s", "i4rwa", "is3ag", "i5sagi", "i4s5aks", "i6sangs", "is3ar", "i4sarg", "is5asp", "i4sav", "is3c", "i4s3ei", "i4s3et", "ise5um", "i5sfeer", "ish7nie.", "i4s5int", "is5inv", "i2sj", "i4sj.", "is5jan", "is5joe", "i2s3k", "is4k.", "i4ska", "is6kaaf", "is5kan", "is4kê", "is5kui", "i2s3l", "is5laa", "i5slag", "is3m", "i5s4mit", "i2s3n", "is5oes", "is5ond", "is3or", "is3p", "is4p.", "is3t", "is4t.", "is4th", "isto7pho", "i5s4tyn", "i4s3ui", "i5suik", "isu6maa", "is3w", "i2t", "i3ta", "it3ag", "ita6tis", "it3b", "i3te", "ite7dwal", "ite7glas", "itek7te.", "ite6mas", "i5tenh", "it4er", "ite5ru", "i4t5ete", "i3tê", "i3ti", "it4in", "i4t5ins", "i3to", "ito5fa", "ito7plan", "ito7rowe", "it1r", "it3re", "it3ry", "it4sc", "it5ser", "its5ete", "its7jood", "it4s5oo", "its7perk", "its6tek", "its7tori", "its7uur.", "i3tu", "itu6saa", "it5win", "i3ty", "ity7sokk", "itz7laan", "i1u", "ium1", "iu4ma", "iu4me", "iu4mi", "iu5mie", "ium6uur", "iwel6s5k", "iwe7mos.", "iwes4", "iwe7spor", "iwe5st", "1ï", "ï2m", "ïn5akt", "ïn3o", "ïns4t", "ïn5und", "ïs5lam", "ïs3t", "1j", "3jaa", "jaar6s7kr", "3jac", "ja4cq", "3jag", "ja4ga", "jan7ghai", "jan7knap", "jap4l", "ja5pla", "3jare", "3jari", "ja4sm", "jas7pant", "jas6tas", "jaz4z", "jaz7zeri", "je4kn", "je4kr", "jek7rasi", "je5rop", "jes7nië.", "jes4t", "je4t3r", "jet6sjn", "jeu4g", "5jie5kn", "jie6nan", "jie6nol", "jien5s", "5jieon", "5jieop", "jie6ska", "jie7skap", "jies7kat", "jie6ski", "jie6skop", "jie6s5lo", "jie6slu", "jie6sol", "jie6son", "jie6spa", "jie6s5tr", "jie6sui", "jie7suik", "ji4eu", "jin7gope", "ji4rp", "job4s3", "joe7kwee", "joen6sk", "5joern", "3jong", "jos6afa", "jou7kuit", "juit6sp", "juk7riem", "3jun", "jun6kre", "2k.", "1ka", "k4aal", "k5aand", "kaan8s7te.", "k5aanw", "kaar7se.", "kaars7te", "5kaart", "kaar6ti", "kaar6t5j", "kade6la", "kade6sl", "4k3adv", "5kafee", "kaf6oef", "4kafr", "4k3afs", "2k1ag", "5kagem", "k4agg", "5kagge", "k4ago", "k4agr", "4kaks", "kal4k5a", "kal4k5l", "5kalko", "kal6koo", "kal4kw", "kal4s5p", "kal4st", "3kam", "kam6par", "kam6ple", "kams4", "3kana", "kaner5o", "3kank", "kan6ont", "kan6sko", "kan6ste", "kans7te.", "3kant", "kan4t5j", "kant7om.", "kan4t5r", "ka4pak", "5kapas", "kap7inte", "5kapit", "kap6lak", "kap7lat.", "kapo4", "ka5pri", "kap7seis", "kap6spr", "kap6stek", "5kapte", "3kar.", "5karak", "4k5arbe", "k5arm.", "ka5roo", "kar6oor", "kar4st", "k5arti", "kar5to", "3kas", "4kasg", "kas7laai", "kas6maa", "kas7traa", "ka5s6tro", "5kateg", "kat7etes", "kat6har", "kat6hu.", "ka4too", "kat7ryk.", "kats4", "kat5sw", "kat7uil.", "kay6aku", "2kb", "kbe6kwi", "kbout7ji", "2kd", "k3de", "1ke", "kede6lo", "kee2", "keel5a", "4keen", "keep6s5t", "keer6so", "keer6ste", "keë6laa", "keël7aar", "4keff", "kei6dro", "keids7pr", "4keik", "keis4", "kei5st", "4k3eks", "ke4l5ak", "ke6lane", "kel7anem", "kel7assi", "kel7eenh", "4k5elem", "ke6linb", "kel7inbr", "kel6mag", "ke4l5ou", "kels8onde", "kem6afa", "4k3emm", "ken6aar", "ken6dra", "ken7eel.", "4k3enj", "3kenm", "3kenn", "ke4nou", "ken7son.", "kep7laai", "kep7ler.", "ke4p5lo", "kep5sk", "ker7een.", "ke4rel", "ker7els.", "ker7flan", "3kerk", "ker6kal", "ker6kin", "ker6k5or", "ker6kow", "ker4kr", "ker7kris", "ker6kui", "kerk7uil", "kerk5wy", "ker6m7eng", "ker6naf", "ker6nei", "ker6nen", "ker4n5o", "ker7oes.", "ke4r5on", "ker6pru", "ker6set", "ker4sk", "ker7skil", "kers7kom", "ker6slo", "ker4sn", "ker4so", "ker7son.", "ker6s5pi", "kers5w", "4kerts", "6k5ervar", "kes6el.", "ke4sn", "ke6trol", "ket6ska", "5ketti", "ke4tu", "keu6ror", "3keus", "keut7jie", "key7kleu", "key7nooi", "kê4rb", "2k1f", "2k1g", "kga7laga", "kge5la", "2kh", "kha7yeli", "k4hoi", "khu7khun", "1ki", "ki2e", "kie6dro", "kie7laai", "kie6mas", "kiem7as.", "kie6sent", "kie4s5k", "kie7skry", "kies5l", "kie6slo", "kies7tan", "kie4ta", "kieu5s", "ki4kl", "ki4ma", "4kimm", "5kind.", "6k5indel", "kin5dr", "4kindu", "k3inh", "4kinl", "4k5inst", "kio4s", "kios7ke.", "kip7ling", "ki4rc", "3kis.", "kis7obli", "ki5s4po", "ki5s6tew", "kit4s", "kits5k", "2k1k", "kk4ag", "kka7smaa", "kka5str", "k3ke", "kke6nee", "kker5kr", "kk4li", "1k2l", "k5ladi", "4kland", "k5lang", "k4lank", "klas3", "klas6e.", "kla6sin", "k5leerd", "4kleg", "k5lege", "k4l4ei", "4klel", "4k3len", "3kle4p", "klep7as.", "k4ler", "5klere", "kle5us", "k3lê", "4klied", "k4lier", "4k3lig", "4k3lik", "5klikk", "kli6kop", "k4lim", "kli6moe", "k4lin", "5klink", "k5linn", "kli4p3", "k4lis", "kli7sjee", "4klog", "klo6kon", "k5loos.", "k4lou", "klub5h", "klu6bre", "4klug", "2k3ly", "2km", "kman7spo", "1k2n", "k4nap", "4knav", "5kneg.", "4knei", "4knem", "kne4t", "knet5j", "3kni", "kni6kla", "kni4p3", "knoe4", "knoe7te.", "4k3nom", "k5noot", "k4nop", "knor7os.", "1ko", "kob7rego", "3kod", "4k3oef", "3koek", "koe6kei", "koe4l5o", "koe5pl", "3koer", "koe4s3", "koe7sist", "3koë", "4koë.", "k4ofi", "4kogi", "kok7onth", "kok6skr", "ko5lag", "kol6for", "3koll", "3kolo", "3kolw", "3kom", "kom7aan.", "kom7bina", "4komg", "kom7ghad", "k5omhu", "kom7miss", "kom7saal", "kom4sp", "kon7atoo", "4k5ontl", "kon5tr", "4k5onts", "4k3oog", "ko4op", "5koord", "3koö", "ko4pag", "kop7ape.", "kope7la.", "kop7las.", "4koplo", "3kopm", "4kopn", "5kopno", "ko4po", "6kopper", "kop7uits", "kord7aan", "kor6doe", "kor6foo", "k3org", "koring7s", "k3ork", "ko3ro", "3korp", "kor4s5l", "kor7sten", "kor4t5a", "kor6tji", "kort7jie", "3kos", "kos7eetp", "kos7inko", "kos7juff", "ko4sk", "ko5ski", "kos5ko", "kos5pe", "kos5taa", "ko4t5ak", "5kotel", "kous7te.", "kou5tj", "kovi7ev.", "ko4vk", "ko4vs", "k5owerh", "2kp", "kpro6pa", "kp4si", "k2r", "k5raad", "3kra4g", "kra7gers", "krag5o", "k5rak.", "4krand", "5krank", "5kredi", "5kreet.", "k4reëe", "4k3reg", "4k3rek", "k3rel", "k5rese", "3kret", "4kri4f3", "4krig", "kri4k3", "kri6moo", "3krin", "kri4p", "krip7lee", "3kris", "4k3riv", "k5roet", "k5rolp", "5kroon", "kr4or", "4k3row", "4krub", "3krui", "4kruim", "kru6kas", "kruk6s.", "kru4l", "k5rusp", "kry6fin", "krygs5t", "4k3ryk", "kry7sket", "3kryt", "2k1s", "ks6aan.", "ks5agt", "ks4ak", "ks5chi", "k4s5een", "k4s5erv", "k4s5eti", "k3si", "k6singe", "ks5ins", "ks6jari", "k4skan", "ks5kin", "k4skon", "k4slê", "ks3li", "k5s6maak", "ks5moo", "k5smou", "k2s3n", "k5snob", "k4sob", "ks5obj", "k4s5ond", "ks5onl", "ks5opk", "k2sp", "k5spek", "k5spel", "ks5pen", "ks5per", "k5spes", "k3spi", "k4spir", "k5spra", "k5spri", "ks5pur", "k6s5taal", "ks5tant", "k6steken", "k6stemp", "ks5tens", "k6stera", "k6s5teri", "k6sterr", "kster6t7j", "ks5tet", "ks5tip", "k7strado", "k6s5trah", "k5s6trak", "ks5tur", "ks5tuu", "k3sty", "ks3ui", "k4s5ure", "ks3w", "k5swei", "ksyn4", "2kt", "kte6rad", "kte6ron", "kter6sp", "ktes4", "k4the", "k3ti", "k3to", "kto6rev", "k3tu", "kt4wi", "1ku", "kud7aksi", "3kuik", "4kuim", "kuin4", "kuins5t", "4kuit", "kul6der", "kul6plo", "kul6poo", "3kult", "3kun", "4k3uni", "kun6sin", "3kurs", "3kus", "ku6seen", "kus7lang", "kus7node", "kus7taak", "kut3r", "kut6slu", "kuus6te", "kuu7ste.", "2kv", "kvang6s", "1k2w", "4k5waar", "k3wae", "k4wan", "3k4war", "kwa7skaa", "k4week", "4kwees", "4kweg", "4k3wer", "kwê7lafl", "kwik3", "kwi6kwa", "3kwis", "2k3wo", "3k4wot", "k3wu", "ky4fa", "kyk7uit.", "k1ys", "2k-", "k-5kli", "2l.", "4laanb", "4laanh", "4laard", "laat7slo", "laat6str", "lad7onde", "la4du", "4ladv", "2laf", "la4fa", "l3afd", "2lag", "l4ag.", "la4ga", "la5ga.", "la5gas", "l4agi", "la5gie", "l4agl", "lag7lag.", "l4ago", "lag5ri", "lag7some", "lai6rgo", "lak7albu", "lak6led", "lak7okul", "lak7oore", "4l5aksi", "lak3w", "lak7ware", "lamb7da.", "la4m5oo", "lam6pli", "lam6pol", "lamp7oli", "lam6sko", "lam6sle", "lam6spe", "3land", "lan6daa", "land7aar", "lan6dad", "lan4d5r", "land6sta", "land6s7te", "lan6gaa", "lan7gnol", "lan4go", "lang7ste", "langs8te.", "lan6gur", "lan4k5a", "lan4k5l", "lan6kop", "lank7ope", "lan4k5r", "lan6kwi", "lan4s5k", "lan4sp", "lan4s5t", "lan6taa", "lan7taat", "lan4t5j", "lan6tre", "4lantw", "lap3r", "4l3art", "las7elek", "las6ie.", "la4sn", "la4so", "la5sol", "la4sp", "las5pa", "late5r6a", "5lawaa", "lba6spe", "lbe6kne", "lbo6wvi", "lb4re", "ld5amb", "ldan7ha.", "ld5apt", "l4d5een", "ld5eis", "lde6rat", "lder7os.", "ld5ins", "ld3of", "ld5oor", "ld6oor.", "ld5ord", "l4dow", "ld5owe", "l5draa", "l4d3re", "lds4k", "lds6maa", "ld3so", "lds6ond", "ld3sp", "l4d5uit", "1le", "lec5tr", "lee2", "lee4g3", "4leep3", "leer5a", "leer7eis", "5leerl", "leer5o", "leer5s", "lee4s", "lees7tra", "lee7tjie", "lee7vaar", "4l3eff", "leg7slot", "4leien", "lei7gleu", "lei6kaa", "lei6naa", "lei6not", "lei7skoo", "lei6spa", "leis7pan", "lei7spir", "leit5s", "lek7loti", "le4kn", "lek6suu", "3leli", "5lengt", "4lenj", "len6sel", "len6ste", "lens7te.", "len6tji", "lent7jie", "le5pel", "lep5li", "lep7oog.", "lep7ratw", "lep5sk", "lep6szy", "leps7zy.", "ler4a", "5leraa", "ler6kam", "lerk7amp", "lerk5sp", "4lerts", "le4see", "le4set", "les5ete", "les6hab", "les7insl", "le4ske", "les7kes.", "les7lie.", "les7onde", "le4s5oo", "le3st", "les7taak", "le4ste", "le5stel", "les6tin", "les5tra", "les4ty", "les7uur.", "les7wete", "l5etan", "le4tc", "let5em", "let7oorb", "let7rol.", "let6sko", "4leuf", "le3u4m", "leun5s", "leur7eg.", "leu4r5o", "leute4", "lew6ein", "6l5ewena", "4l5ewig", "3ley", "1lê", "lê4rw", "lf5aan", "lfa7stra", "lf3ei", "l4fek", "lf5eks", "l4fen", "l4f3ev", "lf4ie", "l4fin", "lf5ing", "lf3l", "l5flap", "lf5onde", "l5fone", "lf5onts", "lf3op", "l2f3r", "lf6skar", "lfs7karm", "lfs7kop.", "lfs7kuil", "lfs7nier", "lfs7oog.", "lfs7perk", "lft4w", "l4f3ui", "l4f3uu", "l1g", "lg4ha", "l4gli", "lgo7lagn", "lg6ordy", "lgs6mee", "1li", "liat6ji", "lia7tjie", "3lid", "lid7onts", "3lied", "lie6gli", "lie6kwy", "lie5la", "liers5w", "lie5sme", "lie7steg", "lie7stys", "lie7swak", "4l3i4eu", "lig7inte", "lig6las", "lig6ny.", "lig7omge", "lig7rekl", "lig7riet", "li4gro", "lig7skag", "lig7sona", "lig5s4p", "lig5s4w", "lig7ure.", "lik7aspa", "4likk", "5likkew", "li4kl", "lik7opsi", "lik6see", "lik6sju", "lik6soo", "li4k5wa", "lin6gid", "lin6gin", "lin6gli", "lin6goo", "ling7ooi", "4linh", "lin4k5l", "lin4kr", "l5inli", "4l3inr", "l5insp", "lin4t5j", "4linv", "li4pa", "li4p3l", "lip5la", "li5plo", "li6poml", "lip7omly", "li4p3r", "lips4", "lip7soom", "5lisen", "l5item", "liter6t7j", "lit3j", "litjie6", "lit3r", "lit7sha.", "lit4sp", "lit4s5t", "lit6zdo", "ljus4", "l1k", "l4kaf", "lka6tio", "lkat7ion", "lk5een", "lks7emos", "lks7epos", "lk6skap", "lk4sku", "lk4sl", "lk4son", "lks7ower", "lk5spe", "lk5spr", "lk6stel", "lks7tell", "lkter6t", "lktert7j", "lk5uil", "lk5wat", "lk5wit", "l4kwy", "lk5wyf", "2l1l", "l3la", "llat6ji", "lla7tjie", "llei5s", "lle7knop", "lle6rui", "lle6swe", "lleve7ë.", "llo5sk", "lls7moor", "l4maf", "lmo6kal", "lmo4no", "lm3sm", "l1n", "lne4s", "lob7eend", "loe6dal", "loe6det", "loe7dja.", "loe6don", "loe4d5r", "4loef", "loe6gos", "loeg7os.", "loers7te", "loe6skr", "loe4st", "lof7opri", "lof6spa", "4logig", "log4o", "lo5gop", "log7sot.", "log4st", "log7stok", "lo4k3l", "lok7onde", "lok7swin", "lo5kwi", "l5olie.", "lomer4", "lomert5", "loms4", "4lond", "lon6gaa", "long7aar", "lon6spa", "lon6ste", "lons7te.", "4lont", "lon4t5j", "3lood", "loofs5w", "l4oop", "5loopb", "l5oore", "5loosh", "loo7stra", "lop7emme", "4lopl", "lop6rys", "lo3ro", "lo5ryn", "5lose.", "lo4sj", "lo4sk", "los7laat", "los5ta", "los7trum", "los7wikk", "lo4tak", "lot7riet", "lot7ruïn", "lot7swan", "lot5ui", "loui7sa.", "lou3t", "lou6wna", "lou6wre", "lou6wtj", "lo4wr", "low5ry", "lox7era.", "lö4jd", "löj6don", "lp5aan", "lpe6nin", "lp4he", "l4pon", "lp5ond", "l1r", "2l1s", "l4s5aar", "l4sad", "ls5arm", "l4s5asp", "l4s5eko", "lse4l", "lse5le", "lse6mek", "ls5erva", "ls5fei", "lsg6haa", "lsi6g5aa", "ls5jas", "l4s5kin", "l4skon", "l6skorr", "l4skre", "l4skru", "l5s6maak", "l5s4mee", "l4snaa", "ls5opw", "ls6plet", "l5s4pli", "l4spu", "l3st", "ls4ti", "l6stoeg", "ls5waar", "ls5wet", "ls5wyn", "l4t3ag", "l4t5amp", "lta7spie", "lter6sk", "lt5oond", "l5t4wak", "lu4bh", "lu4bl", "lub5le", "lub7loka", "lu2g1", "lug6er.", "lu5gub", "3lui.", "4l5uie.", "lui7masi", "lui7slan", "4luit", "luk5raa", "luk7rake", "luk6s5pa", "l5unie.", "luns6a.", "lur6pag", "lus7moor", "lu3t4h", "lut6zpu", "luus6te", "luu7ste.", "lva7soor", "lve5ti", "lwe4r5a", "lwe6rui", "1ly", "lyce7um.", "ly4fe", "ly4fo", "lyk7aant", "lyk7lope", "lyk7lug.", "ly4kn", "ly4k3o", "lyk6ont", "lyk7rede", "lyk5sk", "ly4ma", "lym5ag", "lym7uint", "3lyn", "lyn6aaf", "ly3pl", "ly3sp", "lyt7ring", "1m", "2m.", "mac7dona", "made7us.", "mae4s", "m1af", "4mafd", "m4afo", "ma5fro", "4mafs", "mag6sta", "ma4hd", "mah5di", "mak6lot", "ma3kw", "ma5lag", "mal7thus", "mamat6j", "mama7tji", "man7djar", "man3g4", "man7gona", "man6n-p", "man7salm", "man7spen", "man6spr", "man6s7taa", "man6sto", "man7ure.", "map4l", "ma3ra", "mar6kek", "mar6kle", "mar6kom", "mar6kon", "mar4k5r", "mar6lpr", "mar4s5k", "mar4s5t", "mar6tro", "mary7na.", "mas6koo", "mas6kri", "mas6kui", "mas6tek", "ma5s4tr", "mat6hes", "mat7thys", "may7nard", "2mb", "mb4re", "2md", "mdo6poë", "mdop7oë.", "md5soo", "m3dw", "md4wa", "4meder", "mee7kole", "mee5kr", "5meel.", "mee5l4o", "mee5ne", "mee7reis", "mee7reke", "mee5sl", "mee7spre", "meest7al", "mee6tre", "me3ga", "megas4", "mega5st", "4megt", "mei6nee", "mel6aar", "mel7ekwa", "mel6kal", "mel6kjo", "mel6kla", "mel6kna", "mel4k5r", "melk5s", "mel4k5w", "mel7spul", "mel6too", "mem7phis", "men7angs", "men7eise", "men7opga", "men6sky", "men6snu", "men4s5p", "men6s5ta", "men6tin", "men4t5j", "men4t5r", "me5phi", "me4rak", "me6rass", "mer7asse", "mer5ast", "mer7dein", "me4rei", "me6reng", "mer7enge", "mer7esse", "mering8s9taa", "mer6kli", "mer6kna", "mer7kopn", "mer4kw", "mer7kwar", "mer5oes", "mer7onth", "mer7treë", "mes4a", "me4sal", "me4s5ka", "me6s7koor", "me6skor", "mes7kore", "me6skro", "mes7kroe", "me4sl", "me5slu", "mes7moss", "mes7port", "me6stas", "me4s5to", "mes7ware", "me4t5ee", "met7emps", "meter6so", "meu6las", "meul7as.", "2m1f", "mfloer6", "2m1g", "mgang4", "mgangs5", "mgeper6", "mges7per", "2mh", "mh4ei", "4mid.", "mid7osea", "4mids", "mids5t", "mie6kas", "mie6kwa", "mie6ret", "mie4r5y", "mie6skr", "mie6taa", "mie6tji", "miet7jie", "mig6re.", "migu7el.", "mih7rab.", "mil6taa", "min7gopl", "4m5insp", "6minstu", "mi4rl", "mi3sf", "mis7sêr.", "mis6tkr", "mis6tok", "mit7swa.", "mi4v-", "2m1k", "mkaar4", "mkom6st", "mkoms7te", "2m1l", "m3la", "2mm", "mma5sp", "mmas6to", "mma7stor", "mmat6ji", "mma7tjie", "mme7loor", "mme6res", "mme4r5o", "mmi7stok", "2m1n", "3mod", "mode4l", "mod6jad", "3moe", "moed4s", "moe6nes", "moe4st", "mof6lam", "mok7alba", "mole4s5", "m5olie.", "mol4m5a", "mon6dch", "mon6dop", "4m5onts", "3moon", "moor6da", "2mop", "m3opl", "4morg", "mo3ro", "mor6sju", "mor6spo", "mor4s5t", "mo5saa", "mos3f", "mos7fles", "mos7inen", "mo4ske", "mos7keë.", "mo5sta", "3mot", "mote7us.", "mot6heu", "motor5a", "mou5fl", "mou7slip", "mou6ste", "mous7te.", "mou6tek", "mo9ya.", "5môre.", "2mp", "m4pag", "mpa7gne.", "mp5agt", "mpe6lys", "mpen6to", "mp4her", "mp5ops", "mps7kraa", "mp5sli", "mps7taal", "2m1r", "2m1s", "ms5app", "m4s5kat", "m4skon", "ms7kraal", "m5slin", "m3s4me", "ms3op", "ms5pen", "m6s5taal", "ms4te", "m5steg", "m5steo", "m3sw", "2mt", "mter6t5j", "muc7klen", "mues7li.", "muf7smaa", "mui6les", "4muit", "3mul", "mum7aant", "muns4", "mun5st", "mun6tou", "mur4g", "mur7gie.", "3mus", "2mv", "mvi6tra", "2mw", "myl7afst", "myl6sla", "3myn", "myn7ent.", "myn7impa", "myn7inge", "m1ys", "2m-", "2n.", "1na", "3naal", "3n4aam", "4n3aan", "6n5aardi", "naar6skr", "n5admi", "4n3adv", "nae6lys", "nael7yst", "n1af", "n4afi", "naf6lad", "nag6aand", "na6gaap", "na4g5ap", "na6gemm", "nag7emme", "nag6las", "n4ago", "nag5ron", "nag3s", "4nagt", "n5agtig", "na4gu", "nai7set.", "na5kli", "nak6lip", "4nalf", "4nalt", "3nam", "na3p4l", "na3pr", "nap7roet", "4n3arb", "4narea", "na3s4k", "nas7klip", "na3s4l", "nas6maa", "na3sp", "nas6pel", "nas4pr", "na5s4ta", "nas6ten", "nas6tor", "na5s4tr", "na5stu", "nas6tuu", "nas4w", "na5swe", "na5t4ha", "nat6jie", "nat7onde", "3nav", "5nawee", "na9yl.", "2nb", "nba6chs", "4nche", "2nd", "nda7gesk", "nd5akt", "nd5app", "n4d5arb", "nd5art", "n4d5ass", "nda7stoe", "nde7eier", "n4d5een", "nd5eg.", "nd3ei", "nd5eksa", "ndel8s7kor", "ndel8s7taa", "nd5emm", "nde6rad", "nde6raf", "nder7af.", "nde6rar", "nde6rem", "nde6r7ent", "nde6r7ess", "nde6rim", "nder7in.", "n6deros", "nde7rosi", "nde7sill", "nde6zvo", "nd5ide", "ndi5go", "nd5ins", "nd3of", "n5dome", "nd5omt", "nd5ond", "nd5ont", "n4d5opb", "ndo5st", "nd5rak", "nd5rat", "n4d3re", "nd6resd", "nd5riff", "nd5riv", "nd5roe", "nd5rok", "nd5rot", "n6druim", "nds7ertj", "nds7geru", "nd6sinl", "nds7kenn", "nds7koor", "nds7kraa", "nd6s7laag", "nds6leg", "nd5s6maa", "nds6ons", "nds7oorn", "nd5sor", "nd6spre", "nd5spu", "nds7taal", "nd6stek", "nds7toet", "nds7troe", "nds6wee", "ndt6wis", "ndu4e", "n4d5uit", "ndu7kraa", "n4d3ys", "1ne", "nebe6st", "nec7ticu", "5neder", "nee2", "nee4l", "neel5a", "n4eem", "4n5eend", "4n5eenh", "neer5o", "neer5s", "nee6tew", "neeu3", "nee7uur.", "nee7woor", "4neff", "4neg.", "ne5gla", "n3eie", "4neil", "4neksp", "n5ekspe", "nel6lma", "ne6loon", "nel7oond", "nel6spo", "3nem", "nem6afi", "nen4sl", "nep7olie", "3ner.", "ner6faf", "nerf7af.", "ne4ros", "ner7psig", "ner6sle", "ner5sw", "ners6we", "nes7evan", "nes6tas", "ne4ste", "net7omge", "ne4tri", "ne5um.", "neu7moko", "neu7raal", "neu6sji", "neu6ska", "neu7stoo", "neu6toë", "neut7oë.", "ne4wt", "3nez", "1nê", "2n1f2", "n3fl", "nfy6tap", "2ng", "n4gad", "n4g3ak", "n4g5apt", "n4g5ase", "ng5ass", "n4g5een", "n4g3ei", "ng5eks", "nge6r7aap", "nge6r5al", "nger6d5r", "nge6ret", "nges7per", "ng5eten", "n6geter", "ng5imp", "n4g5ink", "n6ginst", "ng1l", "ng6lasu", "n4goë", "ng5oë.", "n4g3on", "n4g5oog", "n4gou", "ngp6seu", "n6g5raad", "ng5ran", "ng5rat", "n4g3ri", "ng7sade.", "ngs7agit", "ng7sappe", "ng4see", "ngs7eise", "ng4sek", "ng6serk", "ngs7erke", "ng6sero", "ng6serv", "ngs6fer", "ngs7impa", "ng4sin", "ngs5int", "ngs5kan", "ng7skat.", "ng7skoel", "ngs7koep", "ngs7kop.", "ng7skors", "ngs7kort", "ngs7kurw", "ngs7kuur", "ng6s5laa", "ng6slab", "ngs7labo", "ngs7ladi", "ngs6lep", "ng7s6loop", "ngs6lym", "ng4sn", "ng5sni", "ngs6oet", "ngs6ofa", "ngs6omm", "ngs7pelo", "ngs7pill", "ng5spoe", "ng7stabi", "ngs7tal.", "ng6steh", "ng6stei", "ngs7teik", "ngs7telg", "ng6stem", "ngs7tema", "ng7stemm", "ngs7temp", "ng6s5ten", "ngs7tese", "ngs6tin", "ng6stou", "ngs7tou.", "ngs7trap", "ngs7truu", "ngs6uie", "ngs7ure.", "ngs6wel", "ng5uit", "2nh", "1ni", "nie6kaa", "nie7knik", "nie6raa", "nier7aar", "niers5w", "nie6uin", "nig7aard", "ni4g5ee", "ni4g5ie", "niks7py.", "nik7warm", "4n3ind", "4ninf", "nin6g7ele", "nin6get", "4ninh", "4n3ins", "4n3int", "4ninv", "n5invo", "n2is", "nis7alma", "nis6ara", "ni5see", "nis5id", "nis7insp", "nis6oms", "ni4son", "ni3tr", "nit7sare", "nje7glas", "nje7krui", "njie6st", "2n1k", "nkaar4", "nk5aard", "n4k3af", "n4kak", "nk5aks", "nk5eff", "n4kei", "nk5eie", "nke6las", "nke6lit", "nke6ree", "nkers6w", "nker7swe", "n4k3li", "n2kn", "nk3na", "nk5nes", "nk5neu", "n4k3of", "n5kofi", "nk5psi", "nk5rig", "nk5rol", "n4k5roo", "nk5ros", "nk5rye", "nks6noe", "nk4s5om", "nk3sp", "nks4t", "nk3s4w", "nk5uit", "n2kw", "nk5wat", "n5kwen", "2n1l", "n3la", "nli4ga", "nlu4s", "n1n", "nna6spo", "nna7tjie", "nne6pol", "nne6sev", "nni4s", "1no", "4noef", "4noes", "noe4st", "no4g5al", "nog7eens", "nok5as", "no9ko.", "nok7riww", "3n4oma", "n4omm", "nomo7yi.", "no4n3a", "4n3ond", "4n3ont", "noo6dan", "n3oog", "noor6di", "4nopb", "no5pla", "nop6laa", "4noplo", "nop7omhu", "nop6rod", "4norg", "n5orga", "nor6kla", "3norm", "nor7tham", "nos6kaa", "no3sp", "3nota", "3note", "not4r", "no5tre", "2np", "n1r", "nroet6j", "nroe7tji", "2n1s", "n4s5aar", "ns3ag", "ns4an", "ns5angs", "ns4e.", "ns4el", "nse4pr", "nser6to", "nser6tr", "ns3f", "ns6feer", "ns5gel", "n3si", "ns4ia", "ns4ie", "ns4ig", "nsi6gar", "ns7inges", "nsi6tri", "ns4iu", "ns3ja", "n6skafe", "n5skap", "n4skar", "n4s5kel", "ns5kin", "n6skous", "n4s5kra", "n2sl", "n3sla", "ns5lam", "n6sland", "ns3le", "n4s3li", "n4s3lo", "ns6lotg", "ns6lott", "n3slu", "ns4mee", "n5snar", "n4sne", "n5snel", "ns5noo", "n5soek", "n4soë", "ns5oë.", "ns5ond", "nson4t5", "ns5onw", "ns3op", "ns5par", "ns5pas", "n4s5per", "ns7portr", "n4spot", "n6sprat", "ns6prek", "n6staak", "n4staf", "ns5teh", "ns6tel.", "ns6tels", "n5s6ter.", "ns6ters", "ns5trak", "n3s4tu", "n4s3tw", "nst6wyf", "ns5tyd", "ns3w", "ns6weer", "n4syw", "ns5ywe", "2nt", "nt5ags", "nt5ark", "n4t5art", "nta5tj", "n4t5eie", "nte6ram", "nte5sm", "nte6sti", "n5t4hon", "nti7kwaa", "nt5inv", "nt3ja", "n4tjo", "nto7fakt", "nt7oksie", "n4t5oli", "nto6nad", "nt5ond", "n4top", "nt5ops", "n4t5org", "nt7radin", "nt5raf", "n5tref", "ntre7kor", "nt5rim", "nt5roe", "nt5rom", "nt5ron", "nt5room", "n5troos", "n5trou", "nt5row", "nt5rui", "nt5ryk", "nt3sa", "nts7inge", "nt6skan", "nts7kand", "nt4s5le", "nt3s4m", "nts7onde", "nts5paa", "nt3st", "nt5uit", "ntu4m3", "n4t3ys", "1nu", "3nua", "nu4e.", "nu4es.", "2nui", "nuk4w", "nu5kwa", "nul7soms", "4nuni", "nu5skr", "nu6skra", "nus4t", "nu3tr", "4n3uur", "2nv", "nva6lis", "2nw", "ny4so", "nza6cs.", "o1a", "o4bag", "ob5agt", "o3bo", "ob5vor", "oby6nro", "ock7wyn.", "oda5gr", "od5een", "ode7leie", "ode7spaa", "od5lui", "od3op", "od3re", "ods7akke", "ods7kish", "od6slak", "ods7lake", "ods7lopi", "ods5oo", "ods6op.", "ods6org", "ods7paar", "ods7rogg", "ods6uit", "ods6waa", "ods6war", "ods6wyg", "odu4k", "oe4d5aa", "oe4d5ag", "oe4dei", "oed7eie.", "oed7ette", "oe6dind", "oed6ja.", "oed7onde", "oe4d5oo", "oe4d5op", "oe4d5or", "oe4d5ro", "oed7stry", "oe4du", "oed3w", "oed7wyn.", "oe4f5aa", "oe4f5an", "3oefe", "oe4fek", "oe4f5lo", "oe4f3o", "oef7rit.", "oeg7aand", "oeg7laer", "oeg7lam.", "oe4gog", "oeg3s", "oeg7yska", "oei1", "oeien6a", "oeis4", "oei7sker", "oe4kaa", "oek7eier", "oe6kerf", "oek7erf.", "oek7eval", "oe4k3l", "oek6lap", "oek7olie", "oek7oort", "oe4kr", "oek5rak", "oek5re", "oek5ro", "oek7sten", "oe4k3w", "oe4lei", "oe5leie", "oe6lemm", "oel7emme", "oel7eter", "oeling6", "oelings7", "oe6lins", "oel7inst", "oel7onbe", "oel7opri", "oel6ser", "oel6skr", "oel7slik", "oe4nei", "oen7eike", "oe6nert", "oen7ertj", "oen7esse", "oenk4", "oen5kl", "oen7knoo", "oen5kw", "oe4n3o", "oens5ko", "oen5sm", "oens4o", "oen7ysbe", "oep7aang", "oep7inst", "oe6pinv", "oe4pl", "oe5pla", "oep5li", "oe5plo", "oep6s5ee", "oep6s5in", "oep4sl", "oe4pu", "oeras5e", "oer3k", "oe4r5on", "oer5ou", "oer6ske", "oer7twak", "oe5ser", "oe5sie", "oe5sje", "oes7kraa", "oes7limt", "oe4s5lo", "oes7medi", "oes7pil.", "oe4s5po", "oes5ter", "oes7troe", "oe4swe", "oet7aanp", "oe4t5am", "oet6he.", "oe4t3j", "oe6t5oli", "oe4t5oo", "oe4t5ri", "oe4t5ru", "oets7kra", "oet6sna", "oet6spe", "oet6s5te", "oet6sti", "oet5wy", "oë5rug", "of3at", "of5een", "5offis", "o4f3in", "of3l", "o4fok", "of5oks", "o4f3om", "of5psa", "o2f3r", "of6sant", "ofs7iden", "of6sins", "ofs7insi", "of4s5le", "of4s5oo", "ofs7paar", "o4fui", "o1g", "og4d.", "oge4s5t", "ogge6lo", "oggel7oo", "ogi7faal", "3ogig", "og1l", "og4nat", "ogo7steo", "o4gry", "og5rye", "og4s.", "og4sg", "ogs6inf", "og5ska", "ogs7last", "ogs6ot.", "ogs4p", "ogs7pad.", "ogs7pris", "ogs6uip", "ogs6wan", "oi1", "oig6aff", "oi3k", "oile4", "ois4a", "oi5sag", "oi5ski", "ois6kuu", "oi5sky", "oi5sla", "ois4p", "ois4t", "ois7teïs", "ois6wer", "oi3tj", "oje4k", "ojek5l", "o4k5aas", "o4kag", "ok4am", "ok4an", "oke4t", "oket5j", "okie4", "o4k5ins", "ok5lat", "ok6leed", "ok3n", "oko7seil", "oko6sol", "o4kou", "o1kr", "o4k3ro", "ok4s.", "ok5sig", "ok6sins", "ok4sj", "oks7kraa", "oks6lip", "ok3sp", "ok3st", "oks6win", "o2k3w", "ok4win", "o1la", "ol5agt", "olf7ent.", "ol5fèg", "olf6lap", "olf6sku", "olf6sme", "ol4gl", "olg7onde", "ol4g5or", "olg7smee", "5olieb", "olies6m", "olie7sma", "5olifa", "oli7gny.", "olk6sem", "olk6sep", "olk6sow", "olk6sti", "o1lo", "olo5kw", "o4l5oor", "olo5sp", "olp6hta", "ol4sar", "ols7are.", "olt6zha", "o1lu", "olyf5o", "o2m", "o3ma", "om5agt", "oma7pleg", "o4m5arm", "omat6ji", "oma7tjie", "o3me", "ome4s", "ome5us", "omg6had", "o3mi", "omka5s4", "5omloop", "o3mo", "omos6fe", "omo7sfee", "omp7ligs", "omp7oor.", "om6pop.", "oms6aal", "om5sla", "oms6lag", "oms7perk", "5omstan", "oms6tin", "o4n3ag", "o5n4age", "o3n4an", "ona6skl", "ona7sten", "ond7aap.", "ond5agt", "ond7ampt", "ond7dwaa", "4ondes", "onde7us.", "on4did", "on4dom", "ond7rol.", "ond5sle", "ond5so", "ond5sp", "ond6spl", "ond7twis", "on5eff", "o4n3ei", "ong5aan", "on4g5os", "o3n4ik", "o4nil", "onin6gr", "onk7ert7j", "on4kj", "on5kno", "onk7omge", "onk7rugh", "onne5st", "o4n5oks", "ono7sfee", "on4s.", "onse4p5", "ons7iden", "ons7kepe", "ons7kori", "ons7pamp", "ons7self", "ons4t", "on5ste", "ons7tol.", "on6t5aar", "3ontd", "ont7elsi", "5ontgi", "ont5raa", "on4tri", "ont7rol.", "on4t5ru", "ont7slik", "3ontw", "o1ny", "ony7okol", "oo2", "oo5agt", "ood3a", "oo5deb", "ood5ee", "oo5dek", "ood5er", "ood5et", "ood5ok", "ood7onge", "ood3r", "ood6san", "ood7smoo", "ood7sorg", "ood7spui", "ood7suit", "ood7swaa", "ood7swar", "ood5ui", "oof1", "oof6ser", "oof6sid", "oog3", "oog6enh", "oog6les", "5oogpu", "oog7sinf", "oog7suip", "oog6-lo", "ooi6spa", "ook3", "oo4ka", "ook6sst", "ool1", "ool6and", "ool7snaa", "oom1", "oo4ma", "oo4me", "oo4mo", "oon1", "oon6ag.", "oong4", "oons6ko", "oon5sl", "oop1", "oo4pa", "oo4pe", "oop7klik", "o4opn", "oo4po", "oop6swe", "oor1", "oor6daa", "oor7daad", "oor6dap", "oor7darm", "oor6dca", "oor6d5om", "oor7doop", "oor7frek", "oor3i", "oor7klik", "5oorlog", "oor6ot.", "4oort.", "oor6taa", "oor6t5in", "oort7ja.", "oor6tyl", "oort7yl.", "oorve7ë.", "oos3a", "oos3k", "oo4so", "oos7pers", "oot1", "oo4ta", "oot6aai", "oot6en.", "oo4ti", "oo4to", "oo4t3r", "oo4tu", "oo3v", "oö5spo", "o2p", "o3pa", "o4paf", "op5agt", "opa6les", "o4p3am", "5opdrag", "o3pe", "op5een", "op9eg.", "5openi", "op4er", "oper7aar", "ope7rage", "op6horu", "o3pi", "opie6le", "opk6lik", "op3l", "op4lan", "op6lein", "3oplo", "1opn", "4opno", "o3po", "opo7fagi", "op5off", "op5ont", "opo7sfee", "5opperv", "op3r", "o5p4rot", "o4pru", "op6skre", "ops6maa", "ops7neus", "op5son", "ops5or", "op3st", "op3sw", "ops7wels", "o3pu", "o1ra", "or5afd", "or5agt", "ora6lee", "ora6loo", "orat6ji", "ora7tjie", "ord7akti", "ord6arm", "ord7eksa", "ord7ierl", "ord7inst", "ord5oes", "or4d5oo", "ord6oop", "or6dord", "ord7orde", "or4d5ri", "ord7roma", "ore7ster", "o3rê", "orf7oond", "4org.", "or3gh", "or4glo", "4orgp", "org7ring", "3orië", "orings8ku", "or5kaa", "orkes5", "ork7lag.", "ork6lik", "ork7ney.", "orkom6s", "orkoms7t", "or6maan", "or4mj", "or4nj", "or5ond", "or5ong", "o5rot.", "oro7thy.", "or3p4h", "orp6ski", "orp4sn", "ors7aar.", "ors5ag", "ors7jurk", "ors5mo", "ors7pot.", "ors7teri", "ors7tery", "or4sti", "ors7trek", "ort7aan.", "ort5aar", "ort5akt", "or4tar", "ort6ham", "5ortod", "ort7onde", "ort7rol.", "ort7ruk.", "ort5sw", "or1u", "o3r4us", "o3ry.", "ory4s", "os3ag", "osa7phat", "os5api", "osas4", "osa7tjie", "os5cen", "o3se", "ose7phin", "ose7phus", "o3si", "osi6nen", "o4sjo", "os1k", "o4s3ka", "os5kee", "os5kis", "os5koe", "os5kop.", "os5kor", "os5kou", "os5kow", "os3kr", "o5skri", "o4sku", "o2s3l", "os3m", "o2s3n", "os5oli", "os5oor", "o4sor", "os5ord", "os3p", "os4pe", "os5ste", "os3t", "os4t.", "os4ta", "os5taf", "os5tak", "os5tal", "os5tar", "os4td", "os4th", "ost7impe", "os4tm", "o5strat", "os6trev", "ost7revo", "ost6roo", "os4tw", "os4t-", "os3w", "os-7lond", "o2t", "o3ta", "ot5akk", "otas4", "ota5st", "ota7tjie", "o3te", "oteek5", "ote4s5a", "ote6sno", "ote6spr", "ote4s5t", "o4the", "oth7nage", "o3ti", "ot3j", "o3to", "ot5opm", "oto6ran", "oto6ren", "otor5o", "otos4", "oto5sk", "ot3re", "o3tro", "ot5ryk", "ots7eila", "ots7karr", "ot4s5ko", "ot4sl", "ots5la", "ot4s5po", "ots7rûe.", "ots7tee.", "ot6stek", "ots7toet", "ot4stu", "otte6l5o", "o3tu", "o4tui", "otu6set", "oua6che", "oud7agti", "ou6dakt", "oud7akti", "oud6ief", "oud6ini", "oud6ink", "oud7oorg", "oud7styd", "ou4du", "oud7uitg", "oue6rio", "ou3g", "ou4gh", "ou4gl", "oug4r", "ou1i", "ou5ill", "ouis6a.", "ou1k", "oul7ontl", "ou3m", "ou5nyw", "ou5rei", "ous6kak", "ous6ken", "ou5ski", "ous6lip", "ous6ouw", "ou3s4p", "ous7pan.", "ou3s4t", "ous7tert", "ou7stiek", "ous7ties", "out7aar.", "out7aksy", "ou4t5as", "out7ekst", "out7emme", "5outoma", "out7omhe", "ou4t5oo", "out3r", "out6rap", "out6rei", "ou4wb", "ouw7rens", "ou4wv", "ou4-o", "ove5re", "over6y.", "ovie6v.", "ov5ket", "owe6nal", "owen7al.", "owe6ral", "ower7al.", "ower7kon", "oy4a.", "oy4eu", "ô1", "ô2i", "ôi3e", "ôre5st", "1ö", "öjd7onde", "ö1l", "1p", "2p.", "5paaie.", "4paanv", "paar7dui", "3pad.", "pa4da", "pad6ie.", "pa4d3r", "pad6-eg", "p1af", "pag6ne.", "3pak", "pa4ke", "pak5es", "paki3", "pakket5", "pa4ko", "pak5os", "4p5akti", "3pale", "pal7esse", "pal5fr", "pal6mol", "pa4nop", "pan5sp", "pan4t5j", "3pap", "pa5pri", "pap7ryp.", "paps4", "pap7saf.", "pap7smee", "3pa3ra", "pa6ramn", "par7amne", "3park", "par6kar", "par4ko", "park5r", "4parm", "par4sk", "par6ste", "pars7te.", "5party", "pa5sja", "pa4so", "p5aspi", "3pass", "5paste", "pas7til.", "pa4taa", "pat7are.", "4patel", "pat4j", "pa5tji", "3patr", "pats4", "pat5sj", "pav7lov.", "2pb", "pbe6koo", "pbreng6", "2pd", "p3dw", "pd4wa", "pd4wi", "3pe.", "pe4ak", "pe4ar", "3ped", "pede4r", "pe5dof", "pee2", "peel5a", "peel5u", "4peen", "peet3", "3pei", "4peie", "p5eien", "4p3eis", "pek7nek.", "pe4k3r", "pel7aktr", "pe4l5oe", "pel7oond", "pels7kra", "pel6tak", "pel7yste", "4pemm", "pe6nars", "3penn", "pen7opsl", "pen6slu", "pen7smed", "pen6sop", "4pepi", "3pera", "pe6raap", "per7aap.", "per7admi", "per6ary", "per7asid", "pera5s6t", "5perd.", "per6dag", "per6dry", "per6dwy", "per7enke", "per5est", "3peri", "pe4rok", "3pers", "pers5ag", "per6set", "per6sje", "pers7med", "5perso", "per6s7ond", "pers8tel.", "5pertj", "per6top", "per7tsja", "per7uran", "3pes.", "4pesi", "pe4sl", "pe4s5te", "peu6rel", "2p1f", "p3fl", "pf4li", "2p1g", "pges4", "pge5sp", "pg4ly", "2ph", "phe6ars", "p2hi", "phi5s4t", "p3hit", "piek5n", "pie6raf", "pie6rom", "pie4ru", "pie7samp", "pie6ska", "pik7erts", "pik3s4", "6p5inges", "ping6la", "pin7glas", "pin5kl", "4pinst", "pipe4", "pipet5", "pi3s4k", "pit3j", "pit4s5k", "pit4st", "pits5te", "pits7tek", "pit6suu", "pit6zko", "2pj", "2p1k", "pkom4s5", "p2l", "pla6kal", "pla6kok", "5plan.", "5p4lant", "4p3lap", "3p4las", "3p4lat", "pla4t5r", "plee4", "pleet5", "p5leie", "ple4k", "5pleks", "4p3lep", "pleu7ra.", "p3lê", "pli4g", "pli4t5e", "4plits", "p5loos", "p5lose", "plu6ska", "4plyn", "2pm", "2p1n", "p4neum", "poe6doe", "3poei", "poe4s5t", "poe6tol", "po4fa", "pog7rest", "pog5sk", "pok5aa", "pok7olie", "3pol", "3pom", "4pomh", "3pone", "pon7opbr", "pon4s5k", "pons7te.", "4pont", "5pont.", "p5onts", "4poor.", "5poort.", "3poot", "poo6tel", "po4pag", "4popd", "pop6lek", "4pops", "p5ordo", "po3ro", "por6tak", "6portso", "por6t5ui", "3pos", "po4sk", "pos6tim", "pos6tko", "pos6tna", "po4t5as", "3pote", "pou6ste", "2pp", "ppe6las", "ppel7as.", "ppe6rad", "ppe4ro", "ppie6sl", "ppoor6t", "ppoort7j", "p2r", "p4raa", "4praak", "p5raam", "5praat", "pra6esi", "5prakt", "3pren", "3pres", "pre4s5t", "4preu", "3p4ria", "p3rib", "p4rie4", "prie7ël.", "5pries5", "priet5j", "5prins", "3prio", "3prob", "3prod", "pr4oe", "3prof", "3p4rog", "3proj", "4p5rok.", "3p4rop", "pro6pop", "pro5pr", "pr4or", "3pros", "pro5sa", "pro7sopa", "pru4t", "3pry", "pry4st", "2p1s", "p4sad", "p4s5aks", "p4sakt", "5psalm.", "p4sas", "ps5asp", "p4sat", "p4sid", "5p4sigi", "5psigo", "p4s5ing", "p4s5int", "ps3j", "p5skaa", "p4s5ket", "ps5kof", "p4skon", "ps5loj", "ps3m", "ps4my", "p4son", "p5son.", "p4s3oo", "p4sor", "ps7portr", "p6stera", "ps4ti", "p6stoet", "p4ston", "p5swar", "ps5wer", "2pt", "ptos4", "3pub", "pue4b", "4puit", "3pun", "pun4t5j", "pus7tipo", "put7adde", "put7emme", "put5ji", "put7rioo", "2pv", "2pw", "3pyn", "3pyp", "pyp7aard", "pyp3l", "pyp7las.", "pyp3o", "py4pr", "pys3k", "4p5yste", "py5tha", "pyt6hon", "2p-", "1q", "qu2", "qua7driv", "que6str", "qui7nas.", "2r.", "raa6min", "4raan", "r6aans.", "4r5aard", "4rabs", "rac5te", "5radio", "4r3adv", "4rafd", "ra4fek", "4rafh", "ra4foe", "4raft", "ra4fu", "raf7urn.", "4rafv", "4rafw", "2rag", "rag6aal", "5rageb", "ra5gie", "ra6ginl", "rag7inli", "r4agr", "rag7raad", "rag7ryer", "rag6sab", "rag6sak", "rag6sin", "rag7soep", "ragu5e", "rag6wan", "rai7gne.", "rak6les", "rak7oper", "rak7wate", "4ralb", "ral7eer.", "ral7oor.", "4ralt", "ram7argi", "4r5ameu", "ram6pla", "r4anda", "ran6daa", "ran7dafe", "ran6d7akk", "ran6dem", "ran6dev", "ran6doe", "ran4dr", "ran4g5o", "rank5l", "ran4k5r", "ran6saa", "ran6seu", "ran6sjo", "ran6sko", "ran6sor", "ran4s5p", "ran4s5t", "ran6tad", "ran6tet", "ran4t5j", "ran4tr", "4r3any", "rapa7da.", "ra6pas.", "ra5pes", "rap7ewen", "rap6loï", "ra4pon", "rap7onge", "rap7para", "rap7rem.", "rap7righ", "r4ari", "4rarm", "4rarr", "4rart", "r5asia", "ras6tan", "ra5s4to", "ra5s4tr", "ra4su", "ras5ui", "ra5t4ho", "4r5atom", "rats5o", "rbo6lol", "rd5agti", "r4d5ame", "rd5eil", "r6delek", "rd5esel", "rde5sm", "rd5euro", "r3do", "r4d5oli", "r4d5ont", "r4d5oon", "rdô6nne", "rd7raais", "r6droma", "rds6lip", "rd3so", "rd3sp", "rdt6ree", "rdu6sol", "rd4wa", "r5dwar", "r4dwu", "r4d5yst", "1re", "3r2e.", "3reak", "reed5a", "ree4k", "reek5e", "ree7kier", "ree7loon", "4r5eend", "4r5eenh", "4reenv", "ree6pes", "ree6ple", "ree6pro", "4reers", "ree7sala", "ree7stra", "3reë", "4reë.", "4reff", "3reg.", "reg7ruk.", "reg6sen", "reg6skw", "regs7om.", "reg7spre", "4reie", "4reil", "rei6nar", "4reind", "rei6noo", "rei6ser", "rei6sou", "reit7ze.", "re4kn", "rek7naar", "rek5ne", "rek4r", "rek7spoe", "4rekst", "re4kwa", "rel4d", "rel7dae.", "rel7diag", "rel7dopp", "reld7ran", "rel7duik", "rel7oest", "ren6agt", "r4end", "5rend.", "r5enig", "ren7shaw", "ren4so", "ren4sp", "rens7te.", "ren6sto", "ren6str", "ren6tak", "ren6tcl", "ren4t5j", "ren4t5r", "4rerg", "4r3er4t", "rert5j", "4resel", "re4s5ka", "res7lap.", "res5lo", "re3s4m", "res7ore.", "re4spi", "re4ste", "re5stel", "re4sti", "res7toet", "res7toma", "res7ure.", "ret5art", "reu6kin", "reu4kl", "reu4k5o", "re5usg", "r4ewa", "rey5no", "rê4rh", "r4faa", "rf5laa", "rf5lat", "r3fle", "r5f4lie", "r5flui", "rf5opv", "r4fre", "rf5reg", "rf4sl", "r1g", "r4gak", "rg5akt", "rgek6li", "rge7klik", "rg5eng", "rgeper6", "rge6rid", "rg4hu", "rg5hut", "rg4len", "rg4let", "rg5loo", "r4g3lu", "rg4ly", "rgo6wri", "rgrie4", "rg5ros", "rg3s", "rg4s.", "rgs4p", "rguit6j", "rgui7tji", "1r2i", "3rib.", "rib7file", "rie6dio", "rie6dop", "rieket5", "rie6klo", "rie5me", "rie6pri", "ries6e.", "rie6skr", "rie6taa", "ri4fa", "rif6ree", "rig6ska", "rig7smee", "rig7styf", "ri4kl", "rik6sid", "rik5sj", "rik7spad", "ri4kw", "rim4s", "4r3inf", "rin6gaa", "rin7gaan", "ring7aar", "6r7ingest", "rin7gleb", "rin4g5r", "rin6gui", "4r3inh", "rin6kar", "4r5inko", "rink5w", "rin6kwa", "4r3inl", "4r3inr", "4rins", "r5inst", "rin7the.", "r3inv", "4rinve", "rio7rye.", "rip4s5t", "ri5s4ko", "ris4o", "ri5son", "ris5op", "ris6per", "rit5ji", "rit7oond", "rit6rea", "ri5tro", "rit6zri", "5rivie", "rix7tont", "2r1k", "r4kaan", "rk5een", "rk5eik", "rke6lap", "rke4s3", "rke7sel.", "r6kink.", "rk5inl", "rk5leie", "r4klid", "r5klip", "r4k5los", "rk5nei", "rk5omg", "rkom6sti", "r4k5opd", "r4k5ops", "rk5rand", "rk5red", "rk5rib", "rk5rok", "rks6maa", "rk5spo", "rks6uid", "rk5twi", "rk5uit", "r4k5ure", "rk5wag", "r4k5wat", "rk5wee", "r4k5wet", "rk5wil", "rk5win", "r4kwy", "r1l", "r3la", "rli4g", "rlo6gja", "rloo7ple", "rlo6wpa", "2rm", "r6maanh", "rma5gô", "rma6gun", "rma7klot", "rma7plaa", "rma7raan", "rme6raa", "rmer7aar", "rme5sa", "rmi4l", "rmos4", "rmo7stro", "rm5uit", "rmy6nim", "2r1n", "r5nagte", "rna6spl", "r4n5ele", "rne4s", "rne4t5a", "rne6tom", "rn5oor", "rn6stig", "rns6tin", "r3nu", "roduk5", "roe6fas", "roef7as.", "roe4f5l", "roe6fri", "roe4ga", "roe7glas", "roe4n5a", "roe4pa", "roep5l", "roe4p5o", "roe4s5k", "roe6sla", "roes7lag", "roe4s5t", "roes5w", "roe6taa", "4roew", "rog7akke", "4rogg", "rog6lis", "ro5gna", "ro4kn", "rok4r", "rok7slip", "rok4s5p", "ro5kyn", "ro4l5aa", "rol7gord", "r6olien", "rol7mops", "romp7op.", "4roms", "ron7aar.", "ron6dag", "ron6dak", "ron6d7er6t7", "ron6d5et", "ron4d5o", "rond6o.", "ron4d5r", "ronds4", "rond5sw", "ron4du", "ron6gaa", "ron6kaa", "ronker6", "ron6kert", "ron4k5l", "ron6kow", "ron4kr", "ronk7wa.", "ron6ske", "ron6ste", "rons7te.", "ron7stel", "ron6s5ti", "r5ontp", "ron4t5r", "ron6tui", "4rontw", "roo7dewa", "roo7dist", "3roof", "4roog", "roo7gron", "roo7mens", "roo7nag.", "4roond", "roop6la", "4r3oor", "roo7taai", "r4opa", "rop7aans", "rop7anys", "ro5pee", "rop6een", "4r5open", "r4opi", "r4opo", "r1or", "r4ora", "ro3ro", "ros6afr", "4r5osea", "ros7kie.", "ro3s4p", "ro5sta", "ros6til", "rot6hsc", "ro5ton", "ro3tr", "rot4sa", "4roud", "rou7floe", "rou5sk", "rou3t", "rovi7ch.", "rov7nik.", "ro4w-", "rox9y.", "r2ö", "rpe4s3", "r4pid", "rp5ide", "r4p5lik", "rp5opd", "r4p5reg", "rps7idio", "rp4sl", "rps5no", "rp6spri", "rp4stu", "2r1r2", "rre7glob", "rre7nagt", "rre4st", "rre7stau", "rres5tr", "rri6gin", "rron7kaa", "2rs", "r4sakt", "rs5alm", "r4s3ar", "r5scha", "rs5eila", "rseuns6", "rs3f", "r5s6feer", "rs4ie", "rsi7flag", "r6sinda", "rs5inko", "r6sinsp", "r6sinst", "r5sjam", "r6skaki", "r5skap", "r6skapa", "r6skapi", "r6skeus", "r4s5kin", "rs6kink", "r6skoet", "rs6komm", "rs6koni", "r4skor", "r5skors", "r5skou", "rs5krib", "r6skroo", "r4skur", "r4slê", "rs5lis", "r4s5los", "rs5lyf", "rs6maad", "rs6maai", "r5s6maak", "r6smaat", "rs6magt", "rs6mak.", "r6smake", "rs6mara", "rs6mede", "rs4mee", "r5smeer", "rs4mel", "rsnee5m", "r5snoo", "r4snot", "r4s3og", "rsonde6", "rsonder7", "rs5ong", "rs5oog", "r6soors", "rs3op", "rs4op.", "rs5ord", "r1sp", "r6spaar", "r4s5par", "r6spien", "r5spri", "r1st", "r6s5tal.", "r4stb", "r6stegn", "rs6terp", "r5s6ters", "rs6tigl", "rs4tik", "rs4tis", "r4s5tit", "r4stj", "r6s5toet", "r6streg", "r3sty", "rs3un", "rsu4s", "rs5wa.", "rs5wap", "rs3we", "rs6werf", "rs5wyk", "2rt", "rt5afd", "rt7angel", "rt5art", "r6teend", "rte6loe", "rtie4s", "rting4", "rti7saan", "r4t3om", "rt5ont", "rt5opr", "rt5org", "r6treda", "rt5reis", "rt5ren", "r4t5rie", "r6trol.", "r4t3ry", "rt6s5aar", "rts5ond", "rts6pyn", "rt5uits", "rt4wis", "rt4wyf", "3rub", "ru4ga", "rug6-sk", "rui6lek", "rui6moe", "5ruimte", "rui6niv", "4ruit5s", "ru2k3", "ru5kaa", "ruk6lip", "ruk6opp", "ruk6-en", "rul5aa", "rul7ape.", "rul7yste", "r2um", "rum7grok", "4runi", "rup7lys.", "ru5spi", "rus6tak", "rus6tka", "rus6tma", "rus6tvo", "rus7uur.", "rut7oond", "2ruu", "ruus6te", "ruu7ste.", "rweg5a", "rwe6gei", "rwe6skr", "rwi7sje.", "rwoes5", "rwy6sak", "rwy6see", "ry4fa", "ryf7ink.", "ry4fo", "ryf7ode.", "ryf6sch", "ryf6sin", "ryf6ska", "ryg7stek", "ryg6str", "ry6kinr", "ryk3l", "ry5klu", "3rym.", "ryn4s5l", "ryp7arm.", "ry5ple", "ryp7lus.", "ryp7nagt", "ry4s3a", "rys6alf", "ry6sinl", "rys5pi", "rys5po", "ry3st", "rys4ti", "ry4su", "ry4ta", "ry5tra", "s2", "2s.", "s'9ie.", "1sa", "3sa.", "s4aad", "saa6dui", "3saak", "3saal", "4s3aan", "4s3aap", "4s5aard", "4s3aas", "4s3adm", "s5adre", "4s3adv", "2s3af", "2sag", "3s4ag.", "sa4gal", "s3age", "s4agi", "s4ag4n", "sa5gne", "3s4ago", "sag6opa", "5sagte.", "5s6agtew", "3sak.", "s5akad", "3sake", "3sakk", "sa6k5rok", "sa6krus", "saks4", "s3akt", "4s5akti", "sa6lamm", "sal7ammo", "4salb", "s5albu", "3salf", "sal6fol", "4s3alg", "4salm", "sal6mei", "sal6tro", "3sam", "4samba", "same4n", "4s3amp", "sam6swy", "4sana", "s5anal", "san6d5ag", "san6dak", "sand7akk", "san6dru", "3sang", "san4g5a", "san6gre", "sang7ste", "4s5anke", "sap6hat", "s5appa", "s5appel", "sa3pr", "4s3arb", "4sarea", "sar7olie", "4s3art", "4sase", "s5asem", "4s5aspe", "sa5spr", "sat6jie", "4s3atl", "4s5atta", "sav7lon.", "2sb", "s3ba", "s3be", "s3bi", "s3bl", "s3bo", "s3br", "s3bu", "s3by", "s3ca", "s3ci", "2sd", "s3da", "s3de", "s3di", "s3do", "s3dr", "s3du", "s3dw", "sd4wa", "s3dy", "1se", "3se.", "s5eed.", "see3f", "see3k", "s5eenhe", "see6plo", "see5ram", "seer7as.", "see5rei", "see7roet", "see3s4", "see7soog", "see5sw", "seë7kran", "s5egpa", "4segt", "4s3eie", "4seik", "s5eik.", "4seila", "sei6nan", "4seind", "4seis.", "sek6huk", "4seksa", "s5eksam", "sek4s5k", "sek4s5p", "sek4st", "3sel", "sel5aan", "sel7anal", "se4l5el", "sel4f5a", "sel7fabr", "sel6fer", "self5i", "sel6fid", "6seliks", "sel5of", "sel7oor.", "sel5op", "sels7kak", "sel6slo", "sel7spen", "sel6s7taa", "se4m5ag", "4s5emal", "sem7ekst", "sen6dan", "sen7ghor", "sen7sord", "sen6str", "sep6hus", "ser7afse", "4serf", "s5erf.", "ser6s5in", "ser6skr", "ser6sta", "sers7taa", "ser7stad", "sers7tal", "ser6tuu", "s5ervar", "ses6aan", "4se4s5ka", "ses7lett", "se4s5po", "se4st", "se4s5ur", "ses7uur.", "se4sw", "ses7weke", "s4et.", "sewes6t", "sewe7ste", "sey7stof", "1sê", "2s1f2", "s3fa", "s3fi", "s3fl", "s3fo", "s3fr", "s3fu", "2s1g", "s3ga", "sga4s5e", "s3ge", "sges7per", "s3gi", "s3gl", "sg4ly", "s3go", "s3gr", "s3gu", "2sh", "s3ha", "s4ha.", "sha7ron.", "s3he", "s3hi", "s3ho", "sho7shol", "s3hu", "1si", "4s5idea", "s5idee.", "4s5ideo", "3sie", "sie7kwos", "sies6li", "sies7mee", "si5fle", "sif6reu", "4si3go", "si4gro", "4simpl", "3sin.", "si5nag", "s5indek", "5sindr", "4sindu", "sin7enti", "sin7este", "4s3inf", "s4ing", "sin6gaa", "sing7aan", "6singes", "sin7gle.", "sin6gre", "s5ingry", "4s3inh", "sin6kch", "sin4kl", "4sinko", "s5inlig", "4s3inm", "4s3inr", "sin6see", "sin6sin", "6sinslu", "sin5sn", "4sinv", "sip6ho.", "s4ist", "sit6are", "4s5item", "si3tr", "si4tre", "sit7riem", "sit6sik", "sit5sl", "3situ", "siu6mur", "1sj", "2sja", "sje6ans", "5sjoko", "4sjuf", "1sk2", "2sk.", "5skaaf", "skaar6s", "6skaart", "s5kafe", "3skak", "6skakeb", "s5kakt", "4s5kalf", "4skam", "4skant", "3skap", "ska6pin", "ska6pon", "skap5r", "4skar.", "4skara", "4skas", "s5kata", "ska6tel", "ska6tit", "5skawe", "3skem", "4skenn", "3s4kep", "ske6pla", "ske4p5r", "4skerk", "4s5kern", "ske7smee", "5skets", "4skett", "s5kiem", "ski7klub", "s4kil", "4s5kilj", "ski6lol", "s4kip", "5skip.", "4skis.", "2s3kl", "2s3kn", "4skod", "4s5koeë", "5s4koen", "4skoer", "sko6kaa", "sko4ko", "4skoll", "4skolo", "4skolw", "4skomb", "4skomi", "4skomp", "s3kon", "s4kone", "4skonf", "4skong", "4skons", "4skont", "6skoord", "s4koot", "4skoö", "4skos", "sko6see", "5skott", "4skow", "6skraan", "4skrag", "4skran", "sk4re", "6skreet", "s5kres", "5skrif", "4skrin", "5s4krip", "4skris", "4skrui", "3s4kry", "4s5kryt", "sku6dak", "4skuik", "s5kuip", "5skuld", "4skult", "4skun", "5skurf", "4skus", "sku6tar", "2s3kw", "sky7drin", "s4kyf", "s4kyw", "1sl", "s4laa", "4s3lad", "s4la4g", "4slam", "4s5land", "s4lang", "s5lant", "4s3las", "4s3lat", "s4law", "4s3led", "5sleep", "4s5leer", "4s3leë", "s4leë.", "4s3lei", "4s3lek", "4slel", "4sleng", "sle6tji", "slet7jie", "s4leu", "4s5leue", "s5leus", "5sleut", "4s3lew", "4sley", "s3lê", "2sli", "slib3", "5slier", "s3li4g", "5slinge", "slo6bee", "s4lof", "4sloj", "4slok", "4s5loon", "4s5loos", "4slop", "slo4t5a", "s5loter", "s4low", "sl4öj", "4s3lug", "4slui.", "4s5luia", "s5luih", "5sluit", "4s3lus", "4s3lye", "4slyf", "sly6mui", "4slyn", "sly6paf", "4s3lys", "2sm", "s3ma", "s4mad", "5s4mart", "s3me", "s5melk", "5s4melt", "s3mi", "5smid.", "smi4s", "smit4h5", "3smok", "s5mol.", "s3mon", "s3mu", "3smy", "smy6nin", "s4myt", "1sn", "s5naai", "4snaam", "s5naat", "4s3na4g", "snag5e", "snag6s.", "4snam", "sna6pro", "s4nar", "s3nas", "4snat", "4snav", "snee7tji", "4s3nek", "3s4nel", "4s3nes", "4s3net", "4sneu", "sni6kwa", "sni6tre", "s4nob", "5snoet", "4s3nom", "4snoo", "4snorm", "s4nui", "sny3", "s4nye", "5snyer", "sny6-ys", "1so", "4soef", "3s4oek", "soe6kal", "soe6kev", "soe6kol", "soe4k5u", "s4oen", "soe6nys", "4soes", "5soet.", "soets6t", "soet7ste", "sof6agu", "4soff", "so3fr", "sof6ree", "sog4l", "soi6ets", "sok7opho", "3sol", "s5olie.", "sol6lme", "solo5s", "s4om.", "s4ome", "4s3omg", "4s3oms", "4s3omv", "3s4on.", "s6onde.", "s7ondern", "3s4one", "so6neek", "son7eekh", "son5eg", "4son3g", "son7kwas", "so4n5op", "son4so", "4s3ont", "son7uit.", "s4onv", "4sonw", "4soog", "3s4ool", "4s5oond", "soon4s", "4s5oor.", "4s5oorb", "4s5oord", "4s5oore", "s5oorg", "4s5oorl", "s5oors", "5soort.", "s5oortr", "2s1op", "3sop.", "sop7ekst", "so5phi", "sop6hok", "s4opi", "5sopie", "s3opl", "3sopo", "so3pr", "5s4op4ra", "s3ops", "s3opt", "s3opv", "4sord", "5sorg.", "4s5orga", "sor6gee", "sor6gra", "sorg7raa", "s5orke", "so5ror", "4sorto", "sos4h", "so5sha", "so3th", "sot4ho", "so3tr", "3sou", "4soud", "s5oude", "sou6spa", "sou4s5t", "sou6taa", "sou6tak", "4souto", "s5outom", "so9ya.", "s5paal", "5spaan", "4spad", "4spak", "3s4pan", "span5o", "spa6noo", "4spap", "4spark", "4s5pas.", "4spast", "spa6tar", "4spatr", "4spe.", "3s4pee", "spe4k5l", "spe6kne", "spe6lak", "5speler", "s4pell", "6spelot", "4spen", "s5pen.", "4sperd", "4sperk", "5sperm.", "4spers", "4spes.", "5spesi", "4spet", "s4peu", "4s5piek", "s4pio", "2s3pl", "5s4plee", "5s4plin", "5splits", "3s4ply", "4spoei", "4spol", "4spom", "spon6st", "5spoor.", "4spoot", "5spore", "6sportr", "4spos", "4spote", "s5poti", "5spraak", "6sprakt", "4s5prat", "spreek5", "s5prem", "4spres", "5spreu", "4sprob", "5sproei", "4sprof", "4sprog", "5s4pron", "4spros", "5spruit", "4spry", "s3ps", "sp4si", "4spub", "3s4pul", "4spun", "4spyn", "4spyp", "2s1r", "s3ra", "sra4e", "s3re", "s3ri", "s3ro", "s3ru", "s3ry", "2s1s", "s3sa", "ss4af", "ss4ag", "ssa6rol", "ssay7is.", "s3se", "sse6nas", "sse4n5i", "sser4s", "sse5st", "s3si", "ssie6l7ei", "s3sk", "ss4ko", "s3sl", "s3sm", "ss4ma", "ss4me", "s3sn", "s3so", "s3sp", "ss4pl", "s3st", "ss4ti", "s3su", "s3sw", "s3sy", "2st.", "4sta.", "s4taa", "st5aard", "5staat", "3s4tad", "4stafe", "sta6las", "stal7as.", "4stale", "sta6lee", "sta6lem", "4stali", "5s4talt", "5s4tam.", "sta4m5o", "5s4tan.", "stand8s7ta", "4stari", "3s4tat", "s5tatr", "4stea", "s4tedd", "5s4tede", "s4tee4k", "5s4teen", "4steer", "4steg", "ste6gre", "st4ei", "ste6kli", "ste6lek", "stel7eks", "6stelev", "5s6telse", "stel6tj", "stelt7ji", "5s4tem.", "5stemm", "ste6mom", "ste6nou", "4stent", "s5teny", "4steo", "6sterap", "ste6r5ei", "5sterkt", "4sterm", "ste6rom", "ster5sm", "ste6rys", "ster7ys.", "ste6ser", "ste6sin", "ste6ska", "ste6ski", "ste4sl", "ste6sma", "2sth", "s3ti", "4stie", "s4tigt", "4s5tiku", "sti6laa", "s4timu", "sting5a", "5stinkh", "s4tip", "4stir", "4s5tite", "s3tj", "4sto.", "s5toeg", "s5toek", "5stoel.", "6stoela", "s5toen", "4stoer", "4stoes", "s5toev", "s4tof", "sto6fek", "sto6fem", "sto6fen", "sto4fo", "4stog", "sto4ka", "sto6kle", "sto6kre", "3s4tom", "4stone", "4stoon", "st4op", "sto6poo", "4stos", "sto4st", "3s4tot", "s4tow", "s4traa", "4strad", "s6trak.", "4s5trei", "s4trew", "4s5tril", "6strins", "4stroe", "s5trog", "str6ont", "6stroon", "6strosp", "4strot", "s5trots", "4strou", "4strov", "s4tru", "5struk", "4s5trus", "3s4try", "stu4c", "3s4tud", "4stuig", "3s4tuk", "stu6kin", "stu7klep", "stu7stra", "stu4to", "stu6tys", "st4wi", "2sty", "4styd", "5styf.", "3s4tyl", "sty6loo", "1su", "su2b1", "sub3a", "sub7gids", "sub7hoof", "sub7nasi", "sub5oo", "sub7reko", "3suid", "sui6daf", "sui6dei", "s4uik", "s4uil", "suip5l", "sui6pro", "4s3uit", "s4uiw", "sul6tin", "sum7aans", "2sun", "s3uni", "su4su", "sut6her", "su9yo.", "2sv", "s3va", "s3ve", "s3vi", "s3vl", "s3vo", "s3vr", "s3vu", "s3vy", "svy7kraa", "2sw", "5s4waai", "5swael", "s5waen", "3s4wak", "3s4wa4m", "swam5a", "s5wand", "5swart", "s3wat", "3s4waw", "6sweefs", "s6weeft", "s5week", "5s4weep", "5s4weet", "4sweg", "5sweis", "s4welg", "3s4we4m", "5s4werm", "swe6tre", "s3wê", "s3wi", "s4wik", "4swil", "s3wo", "5swoeg", "swor6st", "4swort", "s3wr", "s3wu", "3swyg", "1sy", "5syfer", "sy3k", "syn6agr", "syn6sin", "syn5sm", "sy5pla", "sy3sk", "4syst", "s5yster", "4sywe", "s5ywer", "2s-", "1t", "2t.", "3ta.", "taa6nam", "4taand", "taan5s6f", "6taansi", "4taant", "4t5aanv", "3tabb", "4tadm", "ta4d5ro", "tad6ser", "tad4s5i", "tad6ska", "tads5n", "tads5p", "tad6ste", "tad6s5to", "4taf.", "4tafd", "3tafe", "tafe4l", "4ta4fr", "4t3afs", "4tafv", "4t3afw", "t4age", "4t5agen", "4tags", "4t3agt", "tai4l", "ta5inv", "tai7peis", "5take.", "tak6lep", "ta5kli", "ta4kr", "tak7rol.", "3takt", "tak7wyn.", "3tale", "tal7eenh", "tal7emme", "5talig", "tal6kaa", "tal6sor", "ta6mind", "tam7inde", "tan6dat", "tan4dr", "tand7rin", "tand6sto", "tang5st", "4t5anna", "tan4sk", "tap5ro", "3tari", "4tark", "4tarm", "t5arm.", "tar5oo", "t5artik", "ta4s.", "t5asem", "tas4p", "tas6tas", "tat7isol", "tat4j", "tat7jies", "ta4t5ra", "2tb", "tba6lun", "tby6tei", "2td", "tdy7ing.", "teby6s.", "3tedo", "teek5r", "tee6lee", "tee7lood", "tee6mev", "tee4mo", "tee4n", "4teenh", "3teer", "tee7raad", "tee7renv", "tees4", "tee5sk", "tee5sl", "tee5st", "tee7suik", "4t3eeu", "tef7lon.", "3tegn", "teg6ori", "teg7ren.", "5tehui", "tei6noo", "tek2", "5tekam", "tek7bak.", "5teken", "teke8n7aap", "tek7haak", "tek7limi", "5tekor", "tek7semp", "tek6sin", "teks5k", "teks5t", "tek7stel", "tek5vo", "te6laap", "tel7aap.", "te4l5ak", "te4l5ap", "tel7dwei", "te4l5el", "tel7fles", "tel7idee", "5telik", "tel6lho", "tel7oes.", "tel7oog.", "te6loon", "tel7oond", "tel7smed", "tem7asse", "4temm", "tem7omva", "te6moog", "tem7oog.", "5tempo", "tena6ge", "5tend.", "t4enh", "ten6kaa", "ten6koo", "ten7ouer", "ten6san", "ten7slot", "5tenso", "ten4s5u", "ten4t5j", "ten4tr", "tent7reg", "ten7treu", "ten7twen", "3teo", "te3p4h", "ter7adel", "5te4r5af", "ter6afi", "ter6ago", "te4rak", "ter7akro", "ter7als.", "ter7aman", "ter7amer", "te6ramp", "ter7amp.", "5terap", "ter5app", "ter6arg", "ter6dro", "terd7roo", "ter5een", "te4r5el", "te4rem", "4terft", "te6rin.", "ter7ink.", "terk7wyn", "3term", "ter7omra", "ter5ond", "ter5ont", "5teror", "ter5os.", "te4r5ow", "ter7raan", "5terrei", "ter7rein", "5terri", "ter6sas", "ter6sef", "ter6seg", "ter6skop", "ter7sopn", "ters6we", "ter7swee", "ter7syst", "ter6tap", "te4rui", "ter7uie.", "te6ryst", "ter7yste", "ter6-in", "3tesi", "tes7inst", "tes7loe.", "tes7lydi", "tes7mart", "tes7meto", "tes7proe", "tes7teri", "tes6tud", "te5sty", "te4s3w", "3teti", "teun5s4", "2t1f", "tf4li", "2t1g", "tg4af", "tge6nap", "tg4li", "2th", "3tha.", "t4has", "4thei", "3t4hen", "ther6aa", "the7raan", "the5ro", "3t2hi", "4thit", "t5hitt", "th5leh", "t4ho.", "tho6nat", "ths7chil", "t4hy.", "tib7niet", "tie4f", "tief5o", "tie6gri", "tie6kap", "tie4k5l", "tie6kom", "tie4k5r", "tie4k5w", "tie6roë", "tie7smoo", "4tif.", "4tiff", "4tigm", "tike4", "ti4kla", "tik7lug.", "tik5ro", "tik6waa", "4til.", "til7aan.", "4tild", "4til3s", "4tilt", "4t3ind", "tin7erts", "tin4ga", "tin7gaal", "ting7aan", "ting7eg.", "tin4g5r", "ting6su", "tings7uu", "4tinkh", "tink7wa.", "4t3inl", "4tinv", "5tipe.", "5tipes", "ti4rp", "tis6aan", "ti3sj", "ti3tr", "tive5r", "t2j", "2tja", "tje6sni", "tjo4k", "2t1k", "tki6sob", "tkom4s5", "2t1l", "t3la", "tla6sin", "t3li", "t3lo", "t5lont", "2tm", "tme6sti", "2t1n", "tne6ywe", "tnot4s5", "3to.", "toe7eien", "4toef", "5toef.", "toe7gly.", "toe7klap", "toe5kr", "4toel.", "5toe5la", "4toele", "toe6let", "toe6lop", "4toelt", "4toep.", "toe7plei", "5toern", "toe6rou", "5toeru", "3toes", "toe5sl", "toe5sm", "toe7swel", "toë7roti", "to4fa", "tof7ekst", "tof7emis", "to4f5io", "tof7onde", "3tog", "to4gl", "tok7las.", "tok7lett", "tok5ou", "t5olie.", "4tom.", "4tond", "3tone", "ton4gr", "tong5s", "4tont", "t5ontl", "t5onts", "3toon", "t5oper", "to5p4he", "4topm", "top7oorl", "4topv", "tor7eien", "tor7eval", "to6rint", "tor7inte", "tor6m5ag", "tor6mom", "to1s", "to3sf", "tos6tro", "to3tr", "tot6ste", "tou3s4", "tou7tjie", "tou6wsr", "to4wn", "toy7ota.", "2tp", "tpen6sk", "tpie6tj", "tpiet7ji", "tplek5", "tpoor6t", "tpoort7j", "tp4sa", "t5psal", "t2r", "4t5raad", "t5raam", "5tradis", "4traf", "tra6fas", "traf5o", "tra6foo", "5trakta", "5transa", "5transf", "tra6paf", "trap7as.", "tra6pew", "tra7ploï", "5trapp", "trat4", "tra5tj", "4tratu", "4trea", "t3rec", "t5reda", "t5redd", "t4ree", "4treek", "4t5reen", "4treë", "4treg.", "t5regi", "tr4ei", "t5reini", "tre6ink", "4treis", "tre4ka", "tre4k5l", "tre4ko", "tre4kr", "trek5w", "tre6kwi", "t4rer", "t5rese", "tre4st", "tre4t", "tre7talb", "tret5j", "t5reuk", "t5rewo", "5tribu", "t5rief", "trie6kl", "5tries", "tri5g4l", "4tring", "trobo5", "4t5roer", "tro6las", "trol7as.", "tro6lin", "tro6naf", "troo4", "4troom", "tro6ski", "3trou", "3trov", "4trub", "4t3rug", "truit6j", "trui7tji", "4truk", "tru7kopp", "trust5r", "4tryk", "2t1s", "ts5agt", "t4sam", "t4sar", "ts5arg", "t4s5eks", "t4s5eng", "tse6raf", "tse6rys", "tser7ys.", "t6singr", "t4s5ins", "ts5inv", "tsi7tsik", "ts5jae", "t4skar", "ts5kok", "t4skon", "t4skor", "t6skrie", "t6skrip", "t4skru", "ts5lam", "t5s6maak", "t5s4mee", "ts4mel", "t4smo", "ts5mot", "t5smou", "ts5nat", "ts5neu", "ts5oon", "t4s5pas", "ts5pen", "ts5pot", "t4s5pro", "ts5tea", "t5stel", "t6stend", "ts4ti", "ts5toer", "ts5tron", "t3stu", "t3su", "ts5waar", "t5swar", "t5swen", "ts6wing", "ts5wyn", "2tt", "tta5tj", "tte6loë", "tte6ral", "tte6ram", "tte7ridg", "tte4ro", "tte7ruil", "tte6slo", "tte6s5ta", "tte5us", "tt4he", "tting5a", "tt5uur", "3tua", "3tue", "3tuig", "3tuin", "4tuits", "tu4kl", "tum7aanw", "tur6kna", "4turt", "tus7aart", "tus7eter", "tussen5", "tu5têr", "2tv", "tv4li", "2tw", "twee5k", "twee5l", "twees4", "twerp5o", "twi6sap", "3tyd", "tyd7aanw", "tyd7lont", "tyd7orde", "tyd3r", "tyd6sat", "3tye", "tyl7oorw", "3tyn", "tyn7spre", "ty3o", "t5yster", "2tz", "tze6nel", "2t-", "u1a", "ua4e4s", "uahu6a.", "u4b3ag", "ubas4", "uba7slag", "ub5eko", "ub3f", "ub5gro", "ub5int", "u3bl", "u4blu", "ub5lun", "ub3or", "ub5sch", "ub3t", "ub3v", "ub5wyk", "uck6len", "u4d3ar", "udi6top", "u4d3re", "u4dri", "uds6med", "ud5sor", "ud6stoe", "uds6tyd", "u1e", "ueb5lo", "uer7ione", "ue4ron", "uer7onde", "ues7tria", "ue5uni", "u4fri", "uf5rin", "ufs6maa", "ug5aan", "u4gei", "uge6ska", "ug1l", "u2go", "ugo6mol", "ug3or", "u2g3r", "ug3s", "ugs4k", "ugs4l", "ug4soo", "ugs4p", "ug5ste", "ugs6tek", "ug5sto", "ug5sui", "ug4ub", "ui4dag", "uid7arts", "ui4d3o", "ui4dr", "uid7reek", "uid7simb", "uid7skat", "uid7skel", "uid7skil", "uid7slui", "uid5spr", "uids6to", "uid7stoe", "uid7uits", "ui1e", "uiers6w", "uies6ma", "uie7smaa", "ui4f3a", "uif7eend", "uif5le", "ui4go", "ui4g3r", "uig3s4", "ui4k3a", "ui4k3l", "ui4k3r", "uik7sfee", "uik6sta", "uik7uitk", "ui4kw", "uil7aap.", "uil5eks", "uil7esel", "ui4l5oo", "uil7tjan", "ui4ma", "uim7oes.", "ui4na", "ui5nae", "uin5ar", "uin7asyn", "uind4", "uin7drek", "uin7ivoo", "uin7kole", "ui4n3o", "uin7ser.", "uin5si", "uin6ska", "ui4pl", "ui4po", "uip5oo", "uip7ore.", "uip7roes", "ui4s3a", "uis3j", "ui4s3o", "uis5ta", "ui4t3a", "uit7dein", "ui4t5ee", "ui5ter", "uit3j", "uit3r", "uit4sj", "uit6-as", "uk4aa", "ukaar4", "uk5loo", "u4kof", "uk5off", "u4kor", "u5krat", "uk3ry", "ukse4s", "uk4ski", "uks4m", "uks7pop.", "uk4sv", "uk4th", "uku7yama", "u2k3w", "u1la", "ul3ag", "uld5erk", "ule6sta", "ulê6r-w", "ulf6api", "ul5ins", "u1lo", "ul5oog", "ulp7eksa", "ulp7oort", "ulp7orga", "ul4saa", "uls6oms", "ult7inge", "ult7uit.", "u1lu", "u2m", "u3ma", "um5agt", "umat4", "uma5tj", "u3me", "umg6rok", "u3mi", "um4ie", "um5ond", "um4s.", "ums7feld", "u3mu", "u4mui", "umu4s", "un5arm", "uner6st", "5unifo", "3univ", "unk7reda", "un2s3", "uns6enb", "un4sid", "uns6kap", "un5s6kol", "un7s6kool", "uns7lagg", "uns7taal", "un5str", "unt7eenh", "un6tinn", "unt7real", "unt6roe", "unts6ko", "unt5sw", "unug6s.", "u1o", "upi6lop", "u4ply", "u4pon", "u1ra", "ur5aar", "ur3af", "ur5agt", "ur3ak", "u5ra5s4t", "ur5atl", "ur5een", "u4ref", "ur5eff", "ure5um", "urf7loop", "urg6h-s", "urg7laag", "u4r5int", "urke5s", "urk7nael", "u1ro", "uro7pesi", "urp7agti", "urr7heim", "urs7agte", "ur4s5ek", "urs6fee", "ur6sloo", "urs7mous", "ur4sno", "ur4s5oo", "urs7paar", "urs6par", "ur4spr", "urs6wee", "urs6wie", "ur6t5oor", "ur4top", "urt7room", "u1ru", "u1ry", "us3ag", "usa7lag.", "u4sap", "us5een", "use5st", "ush7die.", "ush7koal", "usie4k", "usiek5l", "u4s5ins", "u2s3k", "us4k.", "us4kok", "us4kri", "u2s3l", "u3s4lu", "u4sno", "u2s3o", "us4ol", "us4or", "us3p", "us4pie", "u4spo", "us5pot", "usse7us.", "us3t", "us4t.", "ust5akt", "usta6v.", "us4tb", "us4tf", "us4tg", "us4th", "us6tink", "us4to", "us6trek", "us5tru", "us4ts", "us3w", "u2t", "u3ta", "ut5adm", "u4t3ag", "uta7spek", "u3te", "ute7ling", "ute7rago", "u3ti", "u3to", "u4topl", "ut5org", "ut4rek", "uts7luis", "ut4spr", "u3tu", "u3ty", "uu2", "uur1", "uur3i", "uur6s5in", "uus3", "uus6khe", "uut3j", "uwees4", "uwe7smit", "u5yste", "u3yu", "û1", "1ü1", "1v2", "vaar6st", "va4kar", "vak7eie.", "va4kes", "va4ki", "va5kie", "va4k3o", "va4kr", "val7este", "val7fees", "val7funk", "val7isog", "valk7oë.", "val7opto", "val4sa", "val6spa", "vals7pan", "val6spo", "val6spr", "val6s5te", "val6sth", "va4n5ee", "van7effe", "van6gap", "van6gre", "van7uit.", "vari5et", "var6kja", "var6kle", "var4k5n", "var4k5o", "var4k5r", "vas7ent.", "vas6oor", "vas7waai", "ve2", "ve3d", "vee7kong", "vee5kr", "vee4l", "veer5a", "vee3s4", "ve9ga.", "veis4", "vei5st", "vel6don", "vel4d5r", "vel5oo", "ve5lop", "vel5sm", "vel7sple", "ve5lum", "ve3na", "ve3ne", "ve5nor", "ven4t5j", "ve3nu", "vep7legi", "3ver1", "ve9ra.", "verd4", "verdien7s8", "ve5reb", "ve5rek", "ver6ema", "ver6ena", "ve5rend", "ver6eve", "ver6flu", "ver6fru", "ve3ri", "ve6r5inn", "verk4", "ver5kl", "ver5kw", "ve7rona.", "ver5sa", "vers6ki", "ver7skin", "vers8kop.", "ver5sl", "ver5sm", "vers6mag", "ver5sp", "ver7stal", "ver5s4w", "vers8waar", "ver4t5j", "ver5tw", "ves3p", "ves3t", "ves7taal", "ve5suv", "vet5in", "vet5ji", "vet7opga", "vet3r", "vets4", "vet5sm", "vid5so", "vie7ring", "vig4s", "vi5rag", "vi4rg", "vi4r-", "vi4sar", "vi4so", "vis5ol", "vis7oog.", "vis5tr", "vi3tr", "vit7rate", "vlag5s", "vla4k", "vla7koek", "vla6sak", "vle4k", "vlek5l", "v4lie", "vlie6so", "voe6rek", "voe6rui", "voë4l", "voël7oë.", "vog7inho", "vo4gr", "vo4lei", "vol4g5a", "vol6gon", "vo4l3o", "vol7song", "vol7uit.", "vol7ywer", "vond6s7te", "von6klo", "voo7doo.", "voor5s4", "vor4s5t", "vor7ster", "vou7pops", "vou5tj", "vra6gry", "v4re.", "vree6tj", "vreet7ji", "vrie6sp", "vri6jze", "vry7duik", "vry7kyk.", "vry3s4", "vry5st", "vry7uit.", "vu4e.", "vu9yo.", "vyf7armi", "vy3s", "1w", "2w.", "4wael", "wae6lat", "4wa4eo", "3wag.", "wag6las", "wal6ste", "wand6sk", "wan6gaa", "wan7inge", "wans4", "wan5sm", "5wapen", "3warm", "war4s3", "wars6e.", "4wart", "war6thi", "war4t5j", "war6toë", "wart7oë.", "war6too", "war4t5r", "war6tys", "wa5shi", "was6kaa", "was5la", "was6mou", "was7pan.", "wa5str", "wate6ra", "water7aa", "wat5so", "we4bad", "we4bm", "we4b5ru", "web7taal", "web7vlie", "3wed", "we4d3r", "we5dra", "we5dry", "we4dy", "5weefse", "weeg6s.", "wee5ran", "wee5sa", "wee7skaa", "wee5sko", "wee5sl", "wee5s4p", "wee5st", "wee6tru", "3weg", "we4ga", "weg7dof.", "weg3l", "we4go", "weg7orde", "we4g3r", "weg3s4", "weg5st", "we4gu", "4weis", "we4k5ro", "wek7uur.", "wel7aanb", "we6larg", "we4l5ee", "wel7flan", "wel7fron", "wel5oor", "we4l5op", "wel6ske", "we4m3o", "wem6os.", "we4nak", "we4n5as", "wen7eens", "wen6sad", "wen6san", "wen6sar", "wen6sei", "wen6ser", "wen6ses", "wen4sk", "wens5ka", "wen7skud", "wen4s5l", "wen4so", "wen6spr", "wen6ste", "wens7tes", "wen4s5u", "wer7esse", "wer6fom", "wer6gar", "wer6gre", "wer6int", "3werk", "wer6kad", "wer6k5af", "wer6kes", "wer4kl", "werk7laa", "wer7klan", "wer7klap", "wer7klok", "wer6koms", "wer6kon", "wer7kony", "wer6kre", "wer6kro", "wer6kuu", "wer4kw", "wer5kwa", "wer4ky", "we4r3o", "wer6paf", "wer6pan", "wer6plo", "wer6pon", "wer6poo", "wer6por", "wer7smed", "wer7uil.", "wes6mit", "wes7oewe", "we4sp", "wes7pemi", "we4s3t", "we5sta", "wes4th", "we5s4tr", "wes7waar", "3wet.", "wet7regu", "wet4s5o", "wet4s5t", "wet7wysi", "3wêr", "4wfon", "wids7tor", "wiel5a", "wie4t5j", "wi4gr", "wi4kl", "wi4ko", "wiks7te.", "wil6dag", "wil6sin", "wil4sk", "wind7as.", "win6del", "win6dop", "wind7op.", "win4dr", "wind7ruk", "win6kle", "win4sk", "win7sky.", "win4s5t", "win7ston", "win6tap", "win6tes", "wip7lig.", "wip7roos", "wit5el", "wit7inkb", "wit5ji", "wi4t3o", "wit5ro", "2wj", "wje6tun", "4woeg", "woe4s", "wo4l3a", "wol7invo", "wol6klo", "wo4l3o", "woor6dr", "wo5rum", "wou6dag", "w2r", "wree4", "wri6gon", "2ws", "wur4gr", "wur4m", "wurm5a", "2ww", "wwe7rint", "wyd5oo", "wyd7uite", "wyk6was", "wyn6and", "wyn5sm", "3wys", "wys7aksi", "wys3k", "wys3p", "wys5ta", "wyt7raak", "x'9ie.", "x1a", "xe1", "x3em", "xerox7e.", "x2h", "x1i", "xys6te.", "y1a", "y4ama", "ybe6lil", "y2d", "y3da", "y3de", "yden4s", "ydgele6", "ydg6leu", "y3di", "yd3of", "yd3re", "yd3ro", "yd4sin", "yd6skat", "yds7krit", "yds7orde", "y1e", "y4enn", "yer2", "yer7hof.", "yer7maat", "yer4s", "yer7ton.", "yer7vill", "yer7voël", "yes6agt", "3yeu", "yf3aa", "y4far", "yf5as.", "yf3l", "y2f3r", "yf5ren", "yf4sl", "yf4su", "y1g", "yg4le", "yg4li", "yg4ly", "yg5saa", "ygs7kans", "yg5sko", "ygs5le", "ygs6tek", "yg4sto", "yg4stu", "ykaar4", "yker6st", "y4k5ins", "y2kl", "yk3li", "yk4lu", "yk5lui", "yk5lus", "ykoms4", "y4kor", "yk3ri", "yk4s5ad", "yk4sk", "yks7kans", "yk3sp", "yks4t", "yk4su", "y2k3w", "y1la", "y1lo", "y4loe", "yls7laar", "y2n1a", "yn4a.", "y4nei", "y4n5ete", "yn1g2", "yn5kli", "yn5kwa", "y2n1o", "y3n4om", "yns6agt", "yn4s5am", "yns5ins", "yn5sly", "yns4m", "yns7maan", "yn4s5or", "yn4sp", "yns7paar", "yns4t", "yn3u", "yo9yo.", "y2p", "y3pa", "y3pe", "y3pi", "y5plan", "yp3li", "yp5org", "y3pr", "y3pu", "y1r", "y4sam", "ys4ig", "y4s5ind", "y4s5ins", "y2sk", "ys5kar", "ys3ko", "y5s4koo", "y2s3l", "y2s3n", "y2s3o", "ys4ok", "ys4ou", "ys5poe", "ys3t", "ys4ta", "y4s5taf", "y5s4tel", "y4ster", "y3s4tr", "ys4tu", "ys3ui", "ys3w", "y2t", "y3ta", "yt3ag", "y3te", "yt4ha", "y3ti", "y3tj", "y3to", "y3tu", "y3ty", "yve7sant", "1z", "2z.", "4zbur", "zee7rust", "zen7elle", "zi2c", "zi5cat", "4zman", "zook6a.", "2zz", "2-1", "-er4t", "-ert5j", "-ha-7ha.", "-k4li", "-na6gew", "-s4ti", "-t4we", "-5twee", } SILE.hyphenator.languages["af"].exceptions = { "sandaal", "aand-e-tes", "aan-gons", "aan-sit-riem", "af-ets", "af-glooi", "a-fri-kaans-eer-ste-taal-spre-ker", "al-berts-kroon", "al-ler-geen", "baad-jie-mou-e", "baan-vak", "bar-mit-swa", "boek-il-lus-tra-sies", "bruids-ka-mer", "buf-fels-poort", "bur-ger-drag", "chris-sies-meer", "da-gha-men-ger", "dak-oor-hang", "dek-la-ding", "dek-weef-sel", "del-gings-fonds-plan", "deur-swer-we", "di-a-lek-woor-de-boek", "dik-bek-wind", "di-vi-dend-uit-ke-ring", "dom-siek-te", "drie-hoeks-me-ting", "druk-ker-fonts", "ei-en-doms-wê-reld", "eks-trin-sie-ke", "e-lands-kraal", "e-lek-tro-ne-ga-ti-wi-teit", "et-ter-sweer", "fru-ga-le", "gang-lig", "gars-aar", "ge-beds-ket-ting", "ge-bruik-sfeer", "ge-loofs-i-den-ti-teit", "gem-mer-es-sens", "ge-skoert", "ge-slags-om-gang", "ge-voels-kri-tiek", "ge-voels-waar-de", "ge-we-tens-angs", "ge-wrig-smeer", "gras-ta-pyt", "grie-kwa", "groeps-por-tret-te", "grond-sop", "haard-ys-ter", "haat-skrif", "han-dels-per-seel", "han-ger-tjie-hei-de", "har-sing-aan-doe-ning", "hel-toe-gaan-vloek-woor-de", "hond-ag-tig", "ie-der-een", "in-dink", "in-gaar", "in-skink", "in-steek-slot", "in-tap", "in-ter-net-om-ge-wing", "in-tree-da-tum", "in-twy-fel-trek-king", "ja-ka-ran-da-ko-nin-gin", "jong-mei-sie-dro-me", "ka-juits-maat", "ka-li-glas", "kam-de-bo-stink-hout", "ka-me-roens", "kam-sti-ge", "kant-ruit", "ka-ree-paal", "karst-treg-ter", "keg-an-ker", "kies-a-re-as", "klik-spaan", "knal-kwik", "kon-sep-or-don-nan-sie", "kooks-oond", "ko-tan-gens", "kui-pers-am-bag", "kuns-te-ra-de", "kwak-sal-wers-mid-del", "lamp-staan-der", "lands-op-me-ting", "lang-ter-myn-im-pak", "lang-u-re", "la-ven-tel-tak-kies", "le-wens-kiem", "lies-maat", "lig-gaams-tem-pe-ra-tuur", "limf-weef-sel", "lip-om-ly-ner", "maand-uit-ga-we", "man-gaan-staal", "mas-korf", "mens-ky-ker", "me-to-diek-es-sen-sies", "mid-o-se-a-nie-se", "mou-ska-kel", "na-gaan-de", "nar-re-slee", "ne-gev-woes-tyn", "nek-a-re", "om-me-swaai", "on-der-wys-ak-sie", "on-tra-di-si-o-ne-le", "oor-deels-plek", "o-ra-gie", "paarl-oos", "pa-si-ënt-re-kords", "pas-to-rie-tuin", "plan-ke-koors", "poe-toe-pap", "pos-a-dres", "pot-te-bak-kers-oond", "pries-ter-amp", "prins-loo-straat", "proe-gla-sie", "pte-ri-gi-um", "raar-der", "re-gi-ments-kom-man-dant", "regs-en-ti-teit", "res-lap", "rond-skink", "rooi-poot-el-sie", "room-ter-te", "ru-staal", "se-ren-ge-ti", "seun-so-praan", "siek-wees", "sies-tog", "skaats-loop-baan", "skree-tjies", "slet-jie", "snik-warm", "soet-o-lie", "son-de-val", "sor-ghum-oes", "spoed-oe-fe-nin-ge", "spoor-weg-in-kom-ste", "stads-nôi", "sti-let-jie", "stok-siel-sa-lig-al-leen", "straat-slim", "stre-pies-fer-weel", "suid-ein-de", "suip-roes", "swaan-nes-te", "swart-aas-vo-ëls", "swie-ren-ga", "ta-ke-la-sie", "teen-sank-sies", "tip-pe-ra-ry", "tref-en-trap-on-ge-luk", "tui-me-laar-dop", "twis-ap-pel", "tyds-ter-me", "ui-er-sweer", "uit-tree-loon", "val-reep-leer", "ver-band-uit-ma-ker", "ver-koops-wel-sla-e", "ver-sap-te", "ver-val-funk-sie", "ver-wy-sings-half-le-we-in-deks", "vin-ger-e-te", "volks-e-mo-sie", "volks-ka-pi-ta-lis-me", "vol-son-ge", "vond-se", "vos-kop", "vre-des-en-gel", "vre-des-par-ty", "wa-pen-stil-stand", "wa-ter-ver-koe-lings-to-rings", "we-du-wee-skof", "wel-oor-wo-ë", "werp-lood", "wes-oe-wer", "xho-sa-tjie", }
mit
Ninjistix/darkstar
scripts/zones/Bhaflau_Thickets/mobs/Greater_Colibri.lua
3
1411
----------------------------------- -- Area: Bhaflau Thickets -- MOB: Greater Colibri ----------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); ----------------------------------- function onMobFight(mob, target) local delay = mob:getLocalVar("delay"); local LastCast = mob:getLocalVar("LAST_CAST"); local spell = mob:getLocalVar("COPY_SPELL"); if (mob:AnimationSub() == 1) then if (mob:getBattleTime() - LastCast > 30) then mob:setLocalVar("COPY_SPELL", 0); mob:setLocalVar("delay", 0); mob:AnimationSub(0); end if (spell > 0 and mob:hasStatusEffect(EFFECT_SILENCE) == false) then if (delay >= 3) then mob:castSpell(spell); mob:setLocalVar("COPY_SPELL", 0); mob:setLocalVar("delay", 0); mob:AnimationSub(0); else mob:setLocalVar("delay", delay+1); end end end end; function onMagicHit(caster, target, spell) if (spell:tookEffect() and (caster:isPC() or caster:isPet()) and spell:getSpellGroup() ~= SPELLGROUP_BLUE ) then target:setLocalVar("COPY_SPELL", spell:getID()); target:setLocalVar("LAST_CAST", target:getBattleTime()); target:AnimationSub(1); end return 1; end; function onMobDeath(mob, player, isKiller) end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Upper_Jeuno/npcs/Leillaine.lua
5
1033
----------------------------------- -- Area: Upper Jeuno -- NPC: Leillaine -- Standard Merchant NPC ----------------------------------- require("scripts/globals/shop"); package.loaded["scripts/zones/Upper_Jeuno/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Upper_Jeuno/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) player:showText(npc,LEILLAINE_SHOP_DIALOG); local stock = { 0x119D,10, -- Distilled Water 0x1036,2387, -- Eye Drops 0x1034,290, -- Antidote 0x1037,736, -- Echo Drops 0x1010,837, -- Potion 0x1020,4445, -- Ether 0x103B,22400} -- Remedy showShop(player, STATIC, stock); end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
codedash64/Urho3D
bin/Data/LuaScripts/31_MaterialAnimation.lua
15
7449
-- Material animation example. -- This sample is base on StaticScene, and it demonstrates: -- - Usage of material shader animation for mush room material require "LuaScripts/Utilities/Sample" function Start() -- Execute the common startup for samples SampleStart() -- Create the scene content CreateScene() -- Create the UI content CreateInstructions() -- Setup the viewport for displaying the scene SetupViewport() -- Set the mouse mode to use in the sample SampleInitMouseMode(MM_RELATIVE) -- Hook up to the frame update events SubscribeToEvents() end function CreateScene() scene_ = Scene() -- Create the Octree component to the scene. This is required before adding any drawable components, or else nothing will -- show up. The default octree volume will be from (-1000, -1000, -1000) to (1000, 1000, 1000) in world coordinates it -- is also legal to place objects outside the volume but their visibility can then not be checked in a hierarchically -- optimizing manner scene_:CreateComponent("Octree") -- Create a child scene node (at world origin) and a StaticModel component into it. Set the StaticModel to show a simple -- plane mesh with a "stone" material. Note that naming the scene nodes is optional. Scale the scene node larger -- (100 x 100 world units) local planeNode = scene_:CreateChild("Plane") planeNode.scale = Vector3(100.0, 1.0, 100.0) local planeObject = planeNode:CreateComponent("StaticModel") planeObject.model = cache:GetResource("Model", "Models/Plane.mdl") planeObject.material = cache:GetResource("Material", "Materials/StoneTiled.xml") -- Create a directional light to the world so that we can see something. The light scene node's orientation controls the -- light direction we will use the SetDirection() function which calculates the orientation from a forward direction vector. -- The light will use default settings (white light, no shadows) local lightNode = scene_:CreateChild("DirectionalLight") lightNode.direction = Vector3(0.6, -1.0, 0.8) -- The direction vector does not need to be normalized local light = lightNode:CreateComponent("Light") light.lightType = LIGHT_DIRECTIONAL -- Create more StaticModel objects to the scene, randomly positioned, rotated and scaled. For rotation, we construct a -- quaternion from Euler angles where the Y angle (rotation about the Y axis) is randomized. The mushroom model contains -- LOD levels, so the StaticModel component will automatically select the LOD level according to the view distance (you'll -- see the model get simpler as it moves further away). Finally, rendering a large number of the same object with the -- same material allows instancing to be used, if the GPU supports it. This reduces the amount of CPU work in rendering the -- scene. local mushroomMat = cache:GetResource("Material", "Materials/Mushroom.xml") -- Apply shader parameter animation to material local specColorAnimation = ValueAnimation:new() specColorAnimation:SetKeyFrame(0.0, Variant(Color(0.1, 0.1, 0.1, 16.0))) specColorAnimation:SetKeyFrame(1.0, Variant(Color(1.0, 0.0, 0.0, 2.0))) specColorAnimation:SetKeyFrame(2.0, Variant(Color(1.0, 1.0, 0.0, 2.0))) specColorAnimation:SetKeyFrame(3.0, Variant(Color(0.1, 0.1, 0.1, 16.0))) -- Optionally associate material with scene to make sure shader parameter animation respects scene time scale mushroomMat.scene = scene_; mushroomMat:SetShaderParameterAnimation("MatSpecColor", specColorAnimation) local NUM_OBJECTS = 200 for i = 1, NUM_OBJECTS do local mushroomNode = scene_:CreateChild("Mushroom") mushroomNode.position = Vector3(Random(90.0) - 45.0, 0.0, Random(90.0) - 45.0) mushroomNode.rotation = Quaternion(0.0, Random(360.0), 0.0) mushroomNode:SetScale(0.5 + Random(2.0)) local mushroomObject = mushroomNode:CreateComponent("StaticModel") mushroomObject.model = cache:GetResource("Model", "Models/Mushroom.mdl") mushroomObject.material = mushroomMat end -- Create a scene node for the camera, which we will move around -- The camera will use default settings (1000 far clip distance, 45 degrees FOV, set aspect ratio automatically) cameraNode = scene_:CreateChild("Camera") cameraNode:CreateComponent("Camera") -- Set an initial position for the camera scene node above the plane cameraNode.position = Vector3(0.0, 5.0, 0.0) end function CreateInstructions() -- Construct new Text object, set string to display and font to use local instructionText = ui.root:CreateChild("Text") instructionText:SetText("Use WASD keys and mouse to move") instructionText:SetFont(cache:GetResource("Font", "Fonts/Anonymous Pro.ttf"), 15) -- Position the text relative to the screen center instructionText.horizontalAlignment = HA_CENTER instructionText.verticalAlignment = VA_CENTER instructionText:SetPosition(0, ui.root.height / 4) end function SetupViewport() -- Set up a viewport to the Renderer subsystem so that the 3D scene can be seen. We need to define the scene and the camera -- at minimum. Additionally we could configure the viewport screen size and the rendering path (eg. forward / deferred) to -- use, but now we just use full screen and default render path configured in the engine command line options local viewport = Viewport:new(scene_, cameraNode:GetComponent("Camera")) renderer:SetViewport(0, viewport) end function MoveCamera(timeStep) -- Do not move if the UI has a focused element (the console) if ui.focusElement ~= nil then return end -- Movement speed as world units per second local MOVE_SPEED = 20.0 -- Mouse sensitivity as degrees per pixel local MOUSE_SENSITIVITY = 0.1 -- Use this frame's mouse motion to adjust camera node yaw and pitch. Clamp the pitch between -90 and 90 degrees local mouseMove = input.mouseMove yaw = yaw +MOUSE_SENSITIVITY * mouseMove.x pitch = pitch + MOUSE_SENSITIVITY * mouseMove.y pitch = Clamp(pitch, -90.0, 90.0) -- Construct new orientation for the camera scene node from yaw and pitch. Roll is fixed to zero cameraNode.rotation = Quaternion(pitch, yaw, 0.0) -- Read WASD keys and move the camera scene node to the corresponding direction if they are pressed -- Use the Translate() function (default local space) to move relative to the node's orientation. if input:GetKeyDown(KEY_W) then cameraNode:Translate(Vector3(0.0, 0.0, 1.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_S) then cameraNode:Translate(Vector3(0.0, 0.0, -1.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_A) then cameraNode:Translate(Vector3(-1.0, 0.0, 0.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_D) then cameraNode:Translate(Vector3(1.0, 0.0, 0.0) * MOVE_SPEED * timeStep) end end function SubscribeToEvents() -- Subscribe HandleUpdate() function for processing update events SubscribeToEvent("Update", "HandleUpdate") end function HandleUpdate(eventType, eventData) -- Take the frame time step, which is stored as a float local timeStep = eventData["TimeStep"]:GetFloat() -- Move the camera, scale movement with time step MoveCamera(timeStep) end
mit
lukego/ljsyscall
include/constants.lua
1
44415
-- tables of constants -- so far almost all the single flag options have been converted to seperate tables with metamethods but still TODO -- are the multi flag ones -- TODO add test that we do not reallocate local ffi = require "ffi" local bit = require "bit" local arch = require("include.constants-" .. ffi.arch) -- architecture specific code local oldsm = setmetatable local function setmetatable(t, mt) assert(mt, "BUG: nil metatable") return oldsm(t, mt) end local function octal(s) return tonumber(s, 8) end local function split(delimiter, text) if delimiter == "" then return {text} end if #text == 0 then return {} end local list = {} local pos = 1 while true do local first, last = text:find(delimiter, pos) if first then list[#list + 1] = text:sub(pos, first - 1) pos = last + 1 else list[#list + 1] = text:sub(pos) break end end return list end local function trim(s) -- TODO should replace underscore with space return (s:gsub("^%s*(.-)%s*$", "%1")) end -- for single valued flags only local function flag(t, str) if not str then return 0 end if type(str) ~= "string" then return str end if #str == 0 then return 0 end local val = rawget(t, str) if val then return val end local s = trim(str):upper() if #s == 0 then return 0 end local val = rawget(t, s) if not val then return nil end rawset(t, str, val) -- this memoizes for future use return val end local stringflag = {__index = flag, __call = function(t, a) return t[a] end} -- take a bunch of flags in a string and return a number function flags(t, str) -- allows multiple comma sep flags that are ORed if not str then return 0 end if type(str) ~= "string" then return str end if #str == 0 then return 0 end local val = rawget(t, str) if val then return val end local f = 0 local a = split(",", str) for i, v in ipairs(a) do local s = trim(v):upper() local val = rawget(t, s) if not val then return nil end f = bit.bor(f, val) end rawset(t, str, f) return f end local multiflags = {__index = flags, __call = function(t, a) return t[a] end} -- single char flags, eg used for access which allows "rwx" local function chflags(t, s) if not s then return 0 end if type(s) ~= "string" then return s end s = trim(s:upper()) local flag = 0 for i = 1, #s do local c = s:sub(i, i) flag = bit.bor(flag, rawget(t, c)) end return flag end local charflags = {__index = chflags, __call = function(t, a) return t[a] end} local c = {} c.SYS = arch.SYS c.STD = setmetatable({ IN_FILENO = 0, OUT_FILENO = 1, ERR_FILENO = 2, IN = 0, OUT = 1, ERR = 2, }, stringflag) -- sizes c.PATH_MAX = 4096 -- open, fcntl TODO not setting largefile if matches exactly in upper case, potentially confusing c.O = setmetatable({ RDONLY = octal('0000'), WRONLY = octal('0001'), RDWR = octal('0002'), ACCMODE = octal('0003'), CREAT = octal('0100'), EXCL = octal('0200'), NOCTTY = octal('0400'), TRUNC = octal('01000'), APPEND = octal('02000'), NONBLOCK = octal('04000'), DSYNC = octal('010000'), ASYNC = octal('020000'), NOATIME = octal('01000000'), CLOEXEC = octal('02000000'), SYNC = octal('04010000'), }, multiflags) c.O.FSYNC = c.O.SYNC c.O.RSYNC = c.O.SYNC c.O.NDELAY = c.O.NONBLOCK -- these are arch dependent! if arch.oflags then arch.oflags(c) else -- generic values from asm-generic if ffi.abi("32bit") then c.O.LARGEFILE = octal('0100000') else c.O.LARGEFILE = 0 end c.O.DIRECT = octal('040000') c.O.DIRECTORY = octal('0200000') c.O.NOFOLLOW = octal('0400000') end -- just for pipe2 c.OPIPE = setmetatable({ NONBLOCK = octal('04000'), CLOEXEC = octal('02000000'), }, multiflags) -- modes and file types. note renamed second set from S_ to MODE_ plus note split c.S = setmetatable({ IFMT = octal('0170000'), IFSOCK = octal('0140000'), IFLNK = octal('0120000'), IFREG = octal('0100000'), IFBLK = octal('0060000'), IFDIR = octal('0040000'), IFCHR = octal('0020000'), IFIFO = octal('0010000'), ISUID = octal('0004000'), ISGID = octal('0002000'), ISVTX = octal('0001000'), IRWXU = octal('00700'), IRUSR = octal('00400'), IWUSR = octal('00200'), IXUSR = octal('00100'), IRWXG = octal('00070'), IRGRP = octal('00040'), IWGRP = octal('00020'), IXGRP = octal('00010'), IRWXO = octal('00007'), IROTH = octal('00004'), IWOTH = octal('00002'), IXOTH = octal('00001'), }, multiflags) c.MODE = setmetatable({ IRWXU = octal('00700'), IRUSR = octal('00400'), IWUSR = octal('00200'), IXUSR = octal('00100'), IRWXG = octal('00070'), IRGRP = octal('00040'), IWGRP = octal('00020'), IXGRP = octal('00010'), IRWXO = octal('00007'), IROTH = octal('00004'), IWOTH = octal('00002'), IXOTH = octal('00001'), }, multiflags) -- access c.OK = setmetatable({ R = 4, W = 2, X = 1, F = 0, }, charflags) -- fcntl c.F = setmetatable({ DUPFD = 0, GETFD = 1, SETFD = 2, GETFL = 3, SETFL = 4, GETLK = 5, SETLK = 6, SETLKW = 7, SETOWN = 8, GETOWN = 9, SETSIG = 10, GETSIG = 11, GETLK64 = 12, SETLK64 = 13, SETLKW64 = 14, SETOWN_EX = 15, GETOWN_EX = 16, SETLEASE = 1024, GETLEASE = 1025, NOTIFY = 1026, SETPIPE_SZ = 1031, GETPIPE_SZ = 1032, DUPFD_CLOEXEC = 1030, }, stringflag) -- messy if ffi.abi("64bit") then c.F.GETLK64 = c.F.GETLK c.F.SETLK64 = c.F.SETLK c.F.SETLKW64 = c.F.SETLKW else c.F.GETLK = c.F.GETLK64 c.F.SETLK = c.F.SETLK64 c.F.SETLKW = c.F.SETLKW64 end c.FD = setmetatable({ CLOEXEC = 1, }, multiflags) -- note changed from F_ to FCNTL_LOCK c.FCNTL_LOCK = setmetatable({ RDLCK = 0, WRLCK = 1, UNLCK = 2, }, stringflag) -- lockf, changed from F_ to LOCKF_ c.LOCKF = setmetatable({ ULOCK = 0, LOCK = 1, TLOCK = 2, TEST = 3, }, stringflag) --mmap c.PROT = setmetatable({ NONE = 0x0, READ = 0x1, WRITE = 0x2, EXEC = 0x4, GROWSDOWN = 0x01000000, GROWSUP = 0x02000000, }, multiflags) -- Sharing types c.MAP = setmetatable({ FILE = 0, SHARED = 0x01, PRIVATE = 0x02, TYPE = 0x0f, FIXED = 0x10, ANONYMOUS = 0x20, --32BIT = 0x40, GROWSDOWN = 0x00100, DENYWRITE = 0x00800, EXECUTABLE = 0x01000, LOCKED = 0x02000, NORESERVE = 0x04000, POPULATE = 0x08000, NONBLOCK = 0x10000, STACK = 0x20000, HUGETLB = 0x40000, }, multiflags) c.MAP["32BIT"] = 0x40 -- starts with number c.MAP.ANON = c.MAP.ANONYMOUS -- flags for `mlockall'. c.MCL = setmetatable({ CURRENT = 1, FUTURE = 2, }, multiflags) -- flags for `mremap'. c.MREMAP = setmetatable({ MAYMOVE = 1, FIXED = 2, }, multiflags) -- madvise advice parameter c.MADV = setmetatable({ NORMAL = 0, RANDOM = 1, SEQUENTIAL = 2, WILLNEED = 3, DONTNEED = 4, REMOVE = 9, DONTFORK = 10, DOFORK = 11, MERGEABLE = 12, UNMERGEABLE = 13, HUGEPAGE = 14, NOHUGEPAGE = 15, HWPOISON = 100, }, stringflag) -- posix fadvise c.POSIX_FADV = setmetatable({ NORMAL = 0, RANDOM = 1, SEQUENTIAL = 2, WILLNEED = 3, DONTNEED = 4, NOREUSE = 5, }, stringflag) -- fallocate c.FALLOC_FL = setmetatable({ KEEP_SIZE = 0x01, PUNCH_HOLE = 0x02, }, stringflag) -- getpriority, setpriority flags c.PRIO = setmetatable({ PROCESS = 0, PGRP = 1, USER = 2, }, stringflag) -- lseek c.SEEK = setmetatable({ SET = 0, CUR = 1, END = 2, }, stringflag) -- exit c.EXIT = setmetatable({ SUCCESS = 0, FAILURE = 1, }, stringflag) -- sigaction, note renamed SIGACT from SIG c.SIGACT = setmetatable({ ERR = -1, DFL = 0, IGN = 1, HOLD = 2, }, stringflag) c.SIG = setmetatable({ HUP = 1, INT = 2, QUIT = 3, ILL = 4, TRAP = 5, ABRT = 6, BUS = 7, FPE = 8, KILL = 9, USR1 = 10, SEGV = 11, USR2 = 12, PIPE = 13, ALRM = 14, TERM = 15, STKFLT = 16, CHLD = 17, CONT = 18, STOP = 19, TSTP = 20, TTIN = 21, TTOU = 22, URG = 23, XCPU = 24, XFSZ = 25, VTALRM = 26, PROF = 27, WINCH = 28, IO = 29, PWR = 30, SYS = 31, }, stringflag) local signals = {} for k, v in pairs(c.SIG) do signals[v] = k end c.SIG.IOT = 6 c.SIG.UNUSED = 31 c.SIG.CLD = c.SIG.CHLD c.SIG.POLL = c.SIG.IO c.NSIG = 65 -- TODO not sure we need -- sigprocmask note renaming of SIG to SIGPM c.SIGPM = setmetatable({ BLOCK = 0, UNBLOCK = 1, SETMASK = 2, }, stringflag) -- signalfd c.SFD = setmetatable({ CLOEXEC = octal('02000000'), NONBLOCK = octal('04000'), }, multiflags) -- sockets note mix of single and multiple flags TODO code to handle temporarily using multi which is kind of ok c.SOCK = setmetatable({ STREAM = 1, DGRAM = 2, RAW = 3, RDM = 4, SEQPACKET = 5, DCCP = 6, PACKET = 10, CLOEXEC = octal('02000000'), NONBLOCK = octal('04000'), }, multiflags) -- misc socket constants c.SCM = setmetatable({ RIGHTS = 0x01, CREDENTIALS = 0x02, }, stringflag) -- setsockopt c.SOL = setmetatable({ SOCKET = 1, RAW = 255, DECNET = 261, X25 = 262, PACKET = 263, ATM = 264, AAL = 265, IRDA = 266, }, stringflag) c.SO = setmetatable({ DEBUG = 1, REUSEADDR = 2, TYPE = 3, ERROR = 4, DONTROUTE = 5, BROADCAST = 6, SNDBUF = 7, RCVBUF = 8, KEEPALIVE = 9, OOBINLINE = 10, NO_CHECK = 11, PRIORITY = 12, LINGER = 13, BSDCOMPAT = 14, SNDBUFFORCE = 32, RCVBUFFORCE = 33, }, stringflag) if arch.socketoptions then arch.socketoptions(c) else c.SO.PASSCRED = 16 c.SO.PEERCRED = 17 c.SO.RCVLOWAT = 18 c.SO.SNDLOWAT = 19 c.SO.RCVTIMEO = 20 c.SO.SNDTIMEO = 21 end -- Maximum queue length specifiable by listen. c.SOMAXCONN = 128 -- shutdown c.SHUT = setmetatable({ RD = 0, WR = 1, RDWR = 2, }, stringflag) -- waitpid 3rd arg c.W = setmetatable({ NOHANG = 1, UNTRACED = 2, EXITED = 4, CONTINUED = 8, NOWAIT = 0x01000000, NOTHREAD = 0x20000000, -- __WNOTHREAD ALL = 0x40000000, -- __WALL CLONE = 0x80000000, -- __WCLONE }, multiflags) c.W.STOPPED = c.W.UNTRACED -- waitid c.P = setmetatable({ ALL = 0, PID = 1, PGID = 2, }, stringflag) -- struct siginfo, eg waitid c.SI = setmetatable({ ASYNCNL = -60, TKILL = -6, SIGIO = -5, ASYNCIO = -4, MESGQ = -3, TIMER = -2, QUEUE = -1, USER = 0, KERNEL = 0x80, }, stringflag) -- note renamed ILL to SIGILL etc as POLL clashes c.SIGILL = setmetatable({ ILLOPC = 1, ILLOPN = 2, ILLADR = 3, ILLTRP = 4, PRVOPC = 5, PRVREG = 6, COPROC = 7, BADSTK = 8, }, stringflag) c.SIGFPE = setmetatable({ INTDIV = 1, INTOVF = 2, FLTDIV = 3, FLTOVF = 4, FLTUND = 5, FLTRES = 6, FLTINV = 7, FLTSUB = 8, }, stringflag) c.SIGSEGV = setmetatable({ MAPERR = 1, ACCERR = 2, }, stringflag) c.SIGBUS = setmetatable({ ADRALN = 1, ADRERR = 2, OBJERR = 3, }, stringflag) c.SIGTRAP = setmetatable({ BRKPT = 1, TRACE = 2, }, stringflag) c.SIGCLD = setmetatable({ EXITED = 1, KILLED = 2, DUMPED = 3, TRAPPED = 4, STOPPED = 5, CONTINUED = 6, }, stringflag) c.SIGPOLL = setmetatable({ IN = 1, OUT = 2, MSG = 3, ERR = 4, PRI = 5, HUP = 6, }, stringflag) -- sigaction c.SA = setmetatable({ NOCLDSTOP = 0x00000001, NOCLDWAIT = 0x00000002, SIGINFO = 0x00000004, ONSTACK = 0x08000000, RESTART = 0x10000000, NODEFER = 0x40000000, RESETHAND = 0x80000000, RESTORER = 0x04000000, }, multiflags) c.SA.NOMASK = c.SA.NODEFER c.SA.ONESHOT = c.SA.RESETHAND -- timers c.ITIMER = setmetatable({ REAL = 0, VIRTUAL = 1, PROF = 2, }, stringflag) -- clocks c.CLOCK = setmetatable({ REALTIME = 0, MONOTONIC = 1, PROCESS_CPUTIME_ID = 2, THREAD_CPUTIME_ID = 3, MONOTONIC_RAW = 4, REALTIME_COARSE = 5, MONOTONIC_COARSE = 6, }, stringflag) c.TIMER = setmetatable({ ABSTIME = 1, }, stringflag) -- adjtimex c.ADJ = setmetatable({ OFFSET = 0x0001, FREQUENCY = 0x0002, MAXERROR = 0x0004, ESTERROR = 0x0008, STATUS = 0x0010, TIMECONST = 0x0020, TAI = 0x0080, MICRO = 0x1000, NANO = 0x2000, TICK = 0x4000, OFFSET_SINGLESHOT = 0x8001, OFFSET_SS_READ = 0xa001, }, multiflags) c.STA = setmetatable({ PLL = 0x0001, PPSFREQ = 0x0002, PPSTIME = 0x0004, FLL = 0x0008, INS = 0x0010, DEL = 0x0020, UNSYNC = 0x0040, FREQHOLD = 0x0080, PPSSIGNAL = 0x0100, PPSJITTER = 0x0200, PPSWANDER = 0x0400, PPSERROR = 0x0800, CLOCKERR = 0x1000, NANO = 0x2000, MODE = 0x4000, CLK = 0x8000, }, multiflags) -- return values for adjtimex c.TIME = setmetatable({ OK = 0, INS = 1, DEL = 2, OOP = 3, WAIT = 4, ERROR = 5, }, stringflag) c.TIME.BAD = c.TIME.ERROR -- xattr c.XATTR = setmetatable({ CREATE = 1, REPLACE = 2, }, stringflag) -- utime c.UTIME = setmetatable({ NOW = bit.lshift(1, 30) - 1, OMIT = bit.lshift(1, 30) - 2, }, stringflag) -- ...at commands note these are valid in different combinations so different tables provided local function atflag(t, str) if not str then return c.AT_FDCWD.FDCWD end -- non standard nil case if type(str) == "string" or type(str) == "number" then return flag(t, str) end -- normal case return str:getfd() -- fallback to file descriptor end c.AT_FDCWD = setmetatable({ FDCWD = -100, }, {__index = atflag, __call = function(t, a) return t[a] end}) c.AT_REMOVEDIR = setmetatable({ REMOVEDIR = 0x200, }, multiflags) c.AT_SYMLINK_FOLLOW = setmetatable({ SYMLINK_FOLLOW = 0x400, }, multiflags) c.AT_SYMLINK_NOFOLLOW = setmetatable({ SYMLINK_NOFOLLOW = 0x100, }, multiflags) c.AT_ACCESSAT = setmetatable({ SYMLINK_NOFOLLOW = 0x100, AT_EACCESS = 0x200, }, multiflags) c.AT_FSTATAT = setmetatable({ SYMLINK_NOFOLLOW = 0x100, NO_AUTOMOUNT = 0x800, }, multiflags) -- send, recv etc c.MSG = setmetatable({ OOB = 0x01, PEEK = 0x02, DONTROUTE = 0x04, CTRUNC = 0x08, PROXY = 0x10, TRUNC = 0x20, DONTWAIT = 0x40, EOR = 0x80, WAITALL = 0x100, FIN = 0x200, SYN = 0x400, CONFIRM = 0x800, RST = 0x1000, ERRQUEUE = 0x2000, NOSIGNAL = 0x4000, MORE = 0x8000, WAITFORONE = 0x10000, CMSG_CLOEXEC = 0x40000000, }, multiflags) c.MSG.TRYHARD = c.MSG.DONTROUTE -- rlimit c.RLIMIT = setmetatable({ CPU = 0, FSIZE = 1, DATA = 2, STACK = 3, CORE = 4, RSS = 5, NPROC = 6, NOFILE = 7, MEMLOCK = 8, AS = 9, LOCKS = 10, SIGPENDING = 11, MSGQUEUE = 12, NICE = 13, RTPRIO = 14, RTTIME = 15, }, stringflag) c.RLIMIT.OFILE = c.RLIMIT.NOFILE -- timerfd c.TFD = setmetatable({ CLOEXEC = octal("02000000"), NONBLOCK = octal("04000"), }, multiflags) c.TFD_TIMER = setmetatable({ ABSTIME = 1, }, stringflag) -- poll c.POLL = setmetatable({ IN = 0x001, PRI = 0x002, OUT = 0x004, ERR = 0x008, HUP = 0x010, NVAL = 0x020, RDNORM = 0x040, RDBAND = 0x080, WRNORM = 0x100, WRBAND = 0x200, MSG = 0x400, REMOVE = 0x1000, RDHUP = 0x2000, }, multiflags) -- epoll renamed from EPOLL_ to EPOLLCREATE c.EPOLLCREATE = setmetatable({ CLOEXEC = octal("02000000"), NONBLOCK = octal("04000"), }, multiflags) c.EPOLL = setmetatable({ IN = 0x001, PRI = 0x002, OUT = 0x004, RDNORM = 0x040, RDBAND = 0x080, WRNORM = 0x100, WRBAND = 0x200, MSG = 0x400, ERR = 0x008, HUP = 0x010, RDHUP = 0x2000, ONESHOT = bit.lshift(1, 30), ET = bit.lshift(1, 30) * 2, -- 2^31 but making sure no sign issue }, multiflags) c.EPOLL_CTL = setmetatable({ ADD = 1, DEL = 2, MOD = 3, }, stringflag) -- splice etc c.SPLICE_F = setmetatable({ MOVE = 1, NONBLOCK = 2, MORE = 4, GIFT = 8, }, multiflags) -- aio - see /usr/include/linux/aio_abi.h c.IOCB_CMD = setmetatable({ PREAD = 0, PWRITE = 1, FSYNC = 2, FDSYNC = 3, -- PREADX = 4, -- POLL = 5, NOOP = 6, PREADV = 7, PWRITEV = 8, }, stringflag) c.IOCB_FLAG_RESFD = 1 -- file types in directory c.DT = setmetatable({ UNKNOWN = 0, FIFO = 1, CHR = 2, DIR = 4, BLK = 6, REG = 8, LNK = 10, SOCK = 12, WHT = 14, }, stringflag) -- sync file range c.SYNC_FILE_RANGE = setmetatable({ WAIT_BEFORE = 1, WRITE = 2, WAIT_AFTER = 4, }, multiflags) -- netlink c.NETLINK = setmetatable({ ROUTE = 0, UNUSED = 1, USERSOCK = 2, FIREWALL = 3, INET_DIAG = 4, NFLOG = 5, XFRM = 6, SELINUX = 7, ISCSI = 8, AUDIT = 9, FIB_LOOKUP = 10, CONNECTOR = 11, NETFILTER = 12, IP6_FW = 13, DNRTMSG = 14, KOBJECT_UEVENT= 15, GENERIC = 16, SCSITRANSPORT = 18, ECRYPTFS = 19, }, stringflag) -- see man netlink(7) for details. NLM_F_ is generic, actually use NLMSG_GET, NLMSG_NEW. TODO cleanup usage. c.NLM_F = setmetatable({ REQUEST = 1, MULTI = 2, ACK = 4, ECHO = 8, }, multiflags) c.NLMSG_GETLINK = setmetatable({ REQUEST = 1, MULTI = 2, ACK = 4, ECHO = 8, ROOT = 0x100, MATCH = 0x200, ATOMIC = 0x400, }, multiflags) c.NLMSG_GETLINK.DUMP = bit.bor(c.NLMSG_GETLINK.ROOT, c.NLMSG_GETLINK.MATCH) c.NLMSG_NEWLINK = setmetatable({ REQUEST = 1, MULTI = 2, ACK = 4, ECHO = 8, REPLACE = 0x100, EXCL = 0x200, CREATE = 0x400, APPEND = 0x800, }, multiflags) -- generic types. These are part of same sequence as RTM c.NLMSG = setmetatable({ NOOP = 0x1, ERROR = 0x2, DONE = 0x3, OVERRUN = 0x4, }, stringflag) -- routing c.RTM = setmetatable({ NEWLINK = 16, DELLINK = 17, GETLINK = 18, SETLINK = 19, NEWADDR = 20, DELADDR = 21, GETADDR = 22, NEWROUTE = 24, DELROUTE = 25, GETROUTE = 26, NEWNEIGH = 28, DELNEIGH = 29, GETNEIGH = 30, NEWRULE = 32, DELRULE = 33, GETRULE = 34, NEWQDISC = 36, DELQDISC = 37, GETQDISC = 38, NEWTCLASS = 40, DELTCLASS = 41, GETTCLASS = 42, NEWTFILTER = 44, DELTFILTER = 45, GETTFILTER = 46, NEWACTION = 48, DELACTION = 49, GETACTION = 50, NEWPREFIX = 52, GETMULTICAST = 58, GETANYCAST = 62, NEWNEIGHTBL = 64, GETNEIGHTBL = 66, SETNEIGHTBL = 67, NEWNDUSEROPT = 68, NEWADDRLABEL = 72, DELADDRLABEL = 73, GETADDRLABEL = 74, GETDCB = 78, SETDCB = 79, }, stringflag) -- linux/if_linc.h c.IFLA = setmetatable({ UNSPEC = 0, ADDRESS = 1, BROADCAST = 2, IFNAME = 3, MTU = 4, LINK = 5, QDISC = 6, STATS = 7, COST = 8, PRIORITY = 9, MASTER = 10, WIRELESS = 11, PROTINFO = 12, TXQLEN = 13, MAP = 14, WEIGHT = 15, OPERSTATE = 16, LINKMODE = 17, LINKINFO = 18, NET_NS_PID= 19, IFALIAS = 20, NUM_VF = 21, VFINFO_LIST = 22, STATS64 = 23, VF_PORTS = 24, PORT_SELF = 25, AF_SPEC = 26, GROUP = 27, NET_NS_FD = 28, }, stringflag) c.IFLA_INET = setmetatable({ UNSPEC = 0, CONF = 1, }, stringflag) c.IFLA_INET6 = setmetatable({ UNSPEC = 0, FLAGS = 1, CONF = 2, STATS = 3, MCAST = 4, CACHEINFO = 5, ICMP6STATS = 6, }, stringflag) c.IFLA_INFO = setmetatable({ UNSPEC = 0, KIND = 1, DATA = 2, XSTATS = 3, }, stringflag) c.IFLA_VLAN = setmetatable({ UNSPEC = 0, ID = 1, FLAGS = 2, EGRESS_QOS = 3, INGRESS_QOS = 4, }, stringflag) c.IFLA_VLAN_QOS = setmetatable({ UNSPEC = 0, MAPPING = 1, }, stringflag) c.IFLA_MACVLAN = setmetatable({ UNSPEC = 0, MODE = 1, }, stringflag) c.MACVLAN_MODE = setmetatable({ PRIVATE = 1, VEPA = 2, BRIDGE = 4, PASSTHRU = 8, }, multiflags) c.IFLA_VF_INFO = setmetatable({ UNSPEC = 0, INFO = 1, -- note renamed IFLA_VF_INFO to IFLA_VF_INFO.INFO }, stringflag) c.IFLA_VF = setmetatable({ UNSPEC = 0, MAC = 1, VLAN = 2, TX_RATE = 3, SPOOFCHK = 4, }, stringflag) c.IFLA_VF_PORT = setmetatable({ UNSPEC = 0, PORT = 1, -- note renamed from IFLA_VF_PORT to IFLA_VF_PORT.PORT? }, stringflag) c.IFLA_PORT = setmetatable({ UNSPEC = 0, VF = 1, PROFILE = 2, VSI_TYPE = 3, INSTANCE_UUID = 4, HOST_UUID = 5, REQUEST = 6, RESPONSE = 7, }, stringflag) c.VETH_INFO = setmetatable({ UNSPEC = 0, PEER = 1, }, stringflag) c.PORT = setmetatable({ PROFILE_MAX = 40, UUID_MAX = 16, SELF_VF = -1, }, stringflag) c.PORT_REQUEST = setmetatable({ PREASSOCIATE = 0, PREASSOCIATE_RR = 1, ASSOCIATE = 2, DISASSOCIATE = 3, }, stringflag) c.PORT_VDP_RESPONSE = setmetatable({ SUCCESS = 0, INVALID_FORMAT = 1, INSUFFICIENT_RESOURCES = 2, UNUSED_VTID = 3, VTID_VIOLATION = 4, VTID_VERSION_VIOALTION = 5, -- seems to be misspelled in headers OUT_OF_SYNC = 6, }, stringflag) c.PORT_PROFILE_RESPONSE = setmetatable({ SUCCESS = 0x100, INPROGRESS = 0x101, INVALID = 0x102, BADSTATE = 0x103, INSUFFICIENT_RESOURCES = 0x104, RESPONSE_ERROR = 0x105, }, stringflag) -- from if_addr.h interface address types and flags c.IFA = setmetatable({ UNSPEC = 0, ADDRESS = 1, LOCAL = 2, LABEL = 3, BROADCAST = 4, ANYCAST = 5, CACHEINFO = 6, MULTICAST = 7, }, stringflag) c.IFA_F = setmetatable({ SECONDARY = 0x01, NODAD = 0x02, OPTIMISTIC = 0x04, DADFAILED = 0x08, HOMEADDRESS = 0x10, DEPRECATED = 0x20, TENTATIVE = 0x40, PERMANENT = 0x80, }, multiflags) c.IFA_F.TEMPORARY = c.IFA_F.SECONDARY -- routing c.RTN = setmetatable({ UNSPEC = 0, UNICAST = 1, LOCAL = 2, BROADCAST = 3, ANYCAST = 4, MULTICAST = 5, BLACKHOLE = 6, UNREACHABLE = 7, PROHIBIT = 8, THROW = 9, NAT = 10, XRESOLVE = 11, }, stringflag) c.RTPROT = setmetatable({ UNSPEC = 0, REDIRECT = 1, KERNEL = 2, BOOT = 3, STATIC = 4, GATED = 8, RA = 9, MRT = 10, ZEBRA = 11, BIRD = 12, DNROUTED = 13, XORP = 14, NTK = 15, DHCP = 16, }, stringflag) c.RT_SCOPE = setmetatable({ UNIVERSE = 0, SITE = 200, LINK = 253, HOST = 254, NOWHERE = 255, }, stringflag) c.RTM_F = setmetatable({ NOTIFY = 0x100, CLONED = 0x200, EQUALIZE = 0x400, PREFIX = 0x800, }, multiflags) c.RT_TABLE = setmetatable({ UNSPEC = 0, COMPAT = 252, DEFAULT = 253, MAIN = 254, LOCAL = 255, MAX = 0xFFFFFFFF, }, stringflag) c.RTA = setmetatable({ UNSPEC = 0, DST = 1, SRC = 2, IIF = 3, OIF = 4, GATEWAY = 5, PRIORITY = 6, PREFSRC = 7, METRICS = 8, MULTIPATH = 9, PROTOINFO = 10, FLOW = 11, CACHEINFO = 12, SESSION = 13, MP_ALGO = 14, TABLE = 15, MARK = 16, }, stringflag) -- route flags c.RTF = setmetatable({ UP = 0x0001, GATEWAY = 0x0002, HOST = 0x0004, REINSTATE = 0x0008, DYNAMIC = 0x0010, MODIFIED = 0x0020, MTU = 0x0040, WINDOW = 0x0080, IRTT = 0x0100, REJECT = 0x0200, -- ipv6 route flags DEFAULT = 0x00010000, ALLONLINK = 0x00020000, ADDRCONF = 0x00040000, PREFIX_RT = 0x00080000, ANYCAST = 0x00100000, NONEXTHOP = 0x00200000, EXPIRES = 0x00400000, ROUTEINFO = 0x00800000, CACHE = 0x01000000, FLOW = 0x02000000, POLICY = 0x04000000, LOCAL = 0x80000000, }, multiflags) c.RTF.MSS = c.RTF.MTU --#define RTF_PREF(pref) ((pref) << 27) --#define RTF_PREF_MASK 0x18000000 -- interface flags c.IFF = setmetatable({ UP = 0x1, BROADCAST = 0x2, DEBUG = 0x4, LOOPBACK = 0x8, POINTOPOINT= 0x10, NOTRAILERS = 0x20, RUNNING = 0x40, NOARP = 0x80, PROMISC = 0x100, ALLMULTI = 0x200, MASTER = 0x400, SLAVE = 0x800, MULTICAST = 0x1000, PORTSEL = 0x2000, AUTOMEDIA = 0x4000, DYNAMIC = 0x8000, LOWER_UP = 0x10000, DORMANT = 0x20000, ECHO = 0x40000, }, multiflags) c.IFF.ALL = 0xffffffff c.IFF.NONE = bit.bnot(0x7ffff) -- this is a bit of a fudge as zero should work, but does not for historical reasons see net/core/rtnetlinc.c c.IFF.VOLATILE = c.IFF.LOOPBACK + c.IFF.POINTOPOINT + c.IFF.BROADCAST + c.IFF.ECHO + c.IFF.MASTER + c.IFF.SLAVE + c.IFF.RUNNING + c.IFF.LOWER_UP + c.IFF.DORMANT -- not sure if we need these TODO another table as duplicated values --[[ c.IFF_SLAVE_NEEDARP = 0x40 c.IFF_ISATAP = 0x80 c.IFF_MASTER_ARPMON = 0x100 c.IFF_WAN_HDLC = 0x200 c.IFF_XMIT_DST_RELEASE = 0x400 c.IFF_DONT_BRIDGE = 0x800 c.IFF_DISABLE_NETPOLL = 0x1000 c.IFF_MACVLAN_PORT = 0x2000 c.IFF_BRIDGE_PORT = 0x4000 c.IFF_OVS_DATAPATH = 0x8000 c.IFF_TX_SKB_SHARING = 0x10000 c.IFF_UNICAST_FLT = 0x20000 ]] -- netlink multicast groups -- legacy names, which are masks. c.RTMGRP = setmetatable({ LINK = 1, NOTIFY = 2, NEIGH = 4, TC = 8, IPV4_IFADDR = 0x10, IPV4_MROUTE = 0x20, IPV4_ROUTE = 0x40, IPV4_RULE = 0x80, IPV6_IFADDR = 0x100, IPV6_MROUTE = 0x200, IPV6_ROUTE = 0x400, IPV6_IFINFO = 0x800, --DECNET_IFADDR = 0x1000, --DECNET_ROUTE = 0x4000, IPV6_PREFIX = 0x20000, }, multiflags) -- rtnetlink multicast groups (bit numbers not masks) c.RTNLGRP = setmetatable({ NONE = 0, LINK = 1, NOTIFY = 2, NEIGH = 3, TC = 4, IPV4_IFADDR = 5, IPV4_MROUTE = 6, IPV4_ROUTE = 7, IPV4_RULE = 8, IPV6_IFADDR = 9, IPV6_MROUTE = 10, IPV6_ROUTE = 11, IPV6_IFINFO = 12, -- DECNET_IFADDR = 13, NOP2 = 14, -- DECNET_ROUTE = 15, -- DECNET_RULE = 16, NOP4 = 17, IPV6_PREFIX = 18, IPV6_RULE = 19, ND_USEROPT = 20, PHONET_IFADDR = 21, PHONET_ROUTE = 22, DCB = 23, }, stringflag) -- address families c.AF = setmetatable({ UNSPEC = 0, LOCAL = 1, INET = 2, AX25 = 3, IPX = 4, APPLETALK = 5, NETROM = 6, BRIDGE = 7, ATMPVC = 8, X25 = 9, INET6 = 10, ROSE = 11, DECNET = 12, NETBEUI = 13, SECURITY = 14, KEY = 15, NETLINK = 16, PACKET = 17, ASH = 18, ECONET = 19, ATMSVC = 20, RDS = 21, SNA = 22, IRDA = 23, PPPOX = 24, WANPIPE = 25, LLC = 26, CAN = 29, TIPC = 30, BLUETOOTH = 31, IUCV = 32, RXRPC = 33, ISDN = 34, PHONET = 35, IEEE802154 = 36, CAIF = 37, ALG = 38, NFC = 39, }, stringflag) c.AF.UNIX = c.AF.LOCAL c.AF.FILE = c.AF.LOCAL c.AF.ROUTE = c.AF.NETLINK -- arp types, which are also interface types for ifi_type c.ARPHRD = setmetatable({ NETROM = 0, ETHER = 1, EETHER = 2, AX25 = 3, PRONET = 4, CHAOS = 5, IEEE802 = 6, ARCNET = 7, APPLETLK = 8, DLCI = 15, ATM = 19, METRICOM = 23, IEEE1394 = 24, EUI64 = 27, INFINIBAND = 32, SLIP = 256, CSLIP = 257, SLIP6 = 258, CSLIP6 = 259, RSRVD = 260, ADAPT = 264, ROSE = 270, X25 = 271, HWX25 = 272, CAN = 280, PPP = 512, CISCO = 513, LAPB = 516, DDCMP = 517, RAWHDLC = 518, TUNNEL = 768, TUNNEL6 = 769, FRAD = 770, SKIP = 771, LOOPBACK = 772, LOCALTLK = 773, FDDI = 774, BIF = 775, SIT = 776, IPDDP = 777, IPGRE = 778, PIMREG = 779, HIPPI = 780, ASH = 781, ECONET = 782, IRDA = 783, FCPP = 784, FCAL = 785, FCPL = 786, FCFABRIC = 787, IEEE802_TR = 800, IEEE80211 = 801, IEEE80211_PRISM = 802, IEEE80211_RADIOTAP = 803, IEEE802154 = 804, PHONET = 820, PHONET_PIPE = 821, CAIF = 822, VOID = 0xFFFF, NONE = 0xFFFE, }, stringflag) c.ARPHRD.HDLC = c.ARPHRD.CISCO -- IP c.IPPROTO = setmetatable({ IP = 0, HOPOPTS = 0, -- TODO overloaded namespace? ICMP = 1, IGMP = 2, IPIP = 4, TCP = 6, EGP = 8, PUP = 12, UDP = 17, IDP = 22, TP = 29, DCCP = 33, IPV6 = 41, ROUTING = 43, FRAGMENT = 44, RSVP = 46, GRE = 47, ESP = 50, AH = 51, ICMPV6 = 58, NONE = 59, DSTOPTS = 60, MTP = 92, ENCAP = 98, PIM = 103, COMP = 108, SCTP = 132, UDPLITE = 136, RAW = 255, }, stringflag) -- eventfd c.EFD = setmetatable({ SEMAPHORE = 1, CLOEXEC = octal("02000000"), NONBLOCK = octal("04000"), }, multiflags) -- mount c.MS = setmetatable({ RDONLY = 1, NOSUID = 2, NODEV = 4, NOEXEC = 8, SYNCHRONOUS = 16, REMOUNT = 32, MANDLOCK = 64, DIRSYNC = 128, NOATIME = 1024, NODIRATIME = 2048, BIND = 4096, MOVE = 8192, REC = 16384, SILENT = 32768, POSIXACL = bit.lshift(1, 16), UNBINDABLE = bit.lshift(1, 17), PRIVATE = bit.lshift(1, 18), SLAVE = bit.lshift(1, 19), SHARED = bit.lshift(1, 20), RELATIME = bit.lshift(1, 21), KERNMOUNT = bit.lshift(1, 22), I_VERSION = bit.lshift(1, 23), STRICTATIME = bit.lshift(1, 24), ACTIVE = bit.lshift(1, 30), NOUSER = bit.lshift(1, 31), }, multiflags) -- fake flags c.MS.RO = c.MS.RDONLY -- allow use of "ro" as flag as that is what /proc/mounts uses c.MS.RW = 0 -- allow use of "rw" as flag as appears in /proc/mounts -- flags to `msync'. - note was MS_ renamed to MSYNC_ c.MSYNC = setmetatable({ ASYNC = 1, INVALIDATE = 2, SYNC = 4, }, multiflags) -- one table for umount as it uses MNT_ and UMOUNT_ options c.UMOUNT = setmetatable({ FORCE = 1, DETACH = 2, EXPIRE = 4, NOFOLLOW = 8, }, multiflags) -- reboot c.LINUX_REBOOT_CMD = setmetatable({ RESTART = 0x01234567, HALT = 0xCDEF0123, CAD_ON = 0x89ABCDEF, CAD_OFF = 0x00000000, POWER_OFF = 0x4321FEDC, RESTART2 = 0xA1B2C3D4, SW_SUSPEND = 0xD000FCE2, KEXEC = 0x45584543, }, stringflag) -- clone c.CLONE = setmetatable({ VM = 0x00000100, FS = 0x00000200, FILES = 0x00000400, SIGHAND = 0x00000800, PTRACE = 0x00002000, VFORK = 0x00004000, PARENT = 0x00008000, THREAD = 0x00010000, NEWNS = 0x00020000, SYSVSEM = 0x00040000, SETTLS = 0x00080000, PARENT_SETTID = 0x00100000, CHILD_CLEARTID = 0x00200000, DETACHED = 0x00400000, UNTRACED = 0x00800000, CHILD_SETTID = 0x01000000, NEWUTS = 0x04000000, NEWIPC = 0x08000000, NEWUSER = 0x10000000, NEWPID = 0x20000000, NEWNET = 0x40000000, IO = 0x80000000, }, multiflags) -- inotify -- flags note rename from IN_ to IN_INIT c.IN_INIT = setmetatable({ CLOEXEC = octal("02000000"), NONBLOCK = octal("04000"), }, multiflags) -- events c.IN = setmetatable({ ACCESS = 0x00000001, MODIFY = 0x00000002, ATTRIB = 0x00000004, CLOSE_WRITE = 0x00000008, CLOSE_NOWRITE = 0x00000010, OPEN = 0x00000020, MOVED_FROM = 0x00000040, MOVED_TO = 0x00000080, CREATE = 0x00000100, DELETE = 0x00000200, DELETE_SELF = 0x00000400, MOVE_SELF = 0x00000800, UNMOUNT = 0x00002000, Q_OVERFLOW = 0x00004000, IGNORED = 0x00008000, ONLYDIR = 0x01000000, DONT_FOLLOW = 0x02000000, EXCL_UNLINK = 0x04000000, MASK_ADD = 0x20000000, ISDIR = 0x40000000, ONESHOT = 0x80000000, }, multiflags) c.IN.CLOSE = c.IN.CLOSE_WRITE + c.IN.CLOSE_NOWRITE c.IN.MOVE = c.IN.MOVED_FROM + c.IN.MOVED_TO c.IN.ALL_EVENTS = c.IN.ACCESS + c.IN.MODIFY + c.IN.ATTRIB + c.IN.CLOSE_WRITE + c.IN.CLOSE_NOWRITE + c.IN.OPEN + c.IN.MOVED_FROM + c.IN.MOVED_TO + c.IN.CREATE + c.IN.DELETE + c.IN.DELETE_SELF + c.IN.MOVE_SELF --prctl c.PR = setmetatable({ SET_PDEATHSIG = 1, GET_PDEATHSIG = 2, GET_DUMPABLE = 3, SET_DUMPABLE = 4, GET_UNALIGN = 5, SET_UNALIGN = 6, GET_KEEPCAPS = 7, SET_KEEPCAPS = 8, GET_FPEMU = 9, SET_FPEMU = 10, GET_FPEXC = 11, SET_FPEXC = 12, GET_TIMING = 13, SET_TIMING = 14, SET_NAME = 15, GET_NAME = 16, GET_ENDIAN = 19, SET_ENDIAN = 20, GET_SECCOMP = 21, SET_SECCOMP = 22, CAPBSET_READ = 23, CAPBSET_DROP = 24, GET_TSC = 25, SET_TSC = 26, GET_SECUREBITS= 27, SET_SECUREBITS= 28, SET_TIMERSLACK= 29, GET_TIMERSLACK= 30, TASK_PERF_EVENTS_DISABLE=31, TASK_PERF_EVENTS_ENABLE=32, MCE_KILL = 33, MCE_KILL_GET = 34, SET_PTRACER = 0x59616d61, -- Ubuntu extension }, stringflag) -- for PR get/set unalign c.PR_UNALIGN = setmetatable({ NOPRINT = 1, SIGBUS = 2, }, stringflag) -- for PR fpemu c.PR_FPEMU = setmetatable({ NOPRINT = 1, SIGFPE = 2, }, stringflag) -- for PR fpexc c.PR_FP_EXC = setmetatable({ SW_ENABLE = 0x80, DIV = 0x010000, OVF = 0x020000, UND = 0x040000, RES = 0x080000, INV = 0x100000, DISABLED = 0, NONRECOV = 1, ASYNC = 2, PRECISE = 3, }, stringflag) -- TODO should be a combo of stringflag and flags -- PR get set timing c.PR_TIMING = setmetatable({ STATISTICAL= 0, TIMESTAMP = 1, }, stringflag) -- PR set endian c.PR_ENDIAN = setmetatable({ BIG = 0, LITTLE = 1, PPC_LITTLE = 2, }, stringflag) -- PR TSC c.PR_TSC = setmetatable({ ENABLE = 1, SIGSEGV = 2, }, stringflag) c.PR_MCE_KILL = setmetatable({ CLEAR = 0, SET = 1, }, stringflag) -- note rename, this is extra option see prctl code c.PR_MCE_KILL_OPT = setmetatable({ LATE = 0, EARLY = 1, DEFAULT = 2, }, stringflag) -- capabilities c.CAP = setmetatable({ CHOWN = 0, DAC_OVERRIDE = 1, DAC_READ_SEARCH = 2, FOWNER = 3, FSETID = 4, KILL = 5, SETGID = 6, SETUID = 7, SETPCAP = 8, LINUX_IMMUTABLE = 9, NET_BIND_SERVICE = 10, NET_BROADCAST = 11, NET_ADMIN = 12, NET_RAW = 13, IPC_LOCK = 14, IPC_OWNER = 15, SYS_MODULE = 16, SYS_RAWIO = 17, SYS_CHROOT = 18, SYS_PTRACE = 19, SYS_PACCT = 20, SYS_ADMIN = 21, SYS_BOOT = 22, SYS_NICE = 23, SYS_RESOURCE = 24, SYS_TIME = 25, SYS_TTY_CONFIG = 26, MKNOD = 27, LEASE = 28, AUDIT_WRITE = 29, AUDIT_CONTROL = 30, SETFCAP = 31, MAC_OVERRIDE = 32, MAC_ADMIN = 33, SYSLOG = 34, WAKE_ALARM = 35, }, stringflag) -- new SECCOMP modes, now there is filter as well as strict c.SECCOMP_MODE = setmetatable({ DISABLED = 0, STRICT = 1, FILTER = 2, }, stringflag) c.SECCOMP_RET = setmetatable({ KILL = 0x00000000, TRAP = 0x00030000, ERRNO = 0x00050000, TRACE = 0x7ff00000, ALLOW = 0x7fff0000, ACTION = 0xffff0000, -- note unsigned DATA = 0x0000ffff, }, multiflags) -- termios c.NCCS = 32 -- termios - c_cc characters c.VINTR = 0 c.VQUIT = 1 c.VERASE = 2 c.VKILL = 3 c.VEOF = 4 c.VTIME = 5 c.VMIN = 6 c.VSWTC = 7 c.VSTART = 8 c.VSTOP = 9 c.VSUSP = 10 c.VEOL = 11 c.VREPRINT = 12 c.VDISCARD = 13 c.VWERASE = 14 c.VLNEXT = 15 c.VEOL2 = 16 -- termios - c_iflag bits c.IGNBRK = octal('0000001') c.BRKINT = octal('0000002') c.IGNPAR = octal('0000004') c.PARMRK = octal('0000010') c.INPCK = octal('0000020') c.ISTRIP = octal('0000040') c.INLCR = octal('0000100') c.IGNCR = octal('0000200') c.ICRNL = octal('0000400') c.IUCLC = octal('0001000') c.IXON = octal('0002000') c.IXANY = octal('0004000') c.IXOFF = octal('0010000') c.IMAXBEL = octal('0020000') c.IUTF8 = octal('0040000') -- termios - c_oflag bits c.OPOST = octal('0000001') c.OLCUC = octal('0000002') c.ONLCR = octal('0000004') c.OCRNL = octal('0000010') c.ONOCR = octal('0000020') c.ONLRET = octal('0000040') c.OFILL = octal('0000100') c.OFDEL = octal('0000200') c.NLDLY = octal('0000400') c.NL0 = octal('0000000') c.NL1 = octal('0000400') c.CRDLY = octal('0003000') c.CR0 = octal('0000000') c.CR1 = octal('0001000') c.CR2 = octal('0002000') c.CR3 = octal('0003000') c.TABDLY = octal('0014000') c.TAB0 = octal('0000000') c.TAB1 = octal('0004000') c.TAB2 = octal('0010000') c.TAB3 = octal('0014000') c.BSDLY = octal('0020000') c.BS0 = octal('0000000') c.BS1 = octal('0020000') c.FFDLY = octal('0100000') c.FF0 = octal('0000000') c.FF1 = octal('0100000') c.VTDLY = octal('0040000') c.VT0 = octal('0000000') c.VT1 = octal('0040000') c.XTABS = octal('0014000') -- TODO rework this with functions in a metatable local bits_speed_map = { } local speed_bits_map = { } local function defspeed(speed, bits) bits = octal(bits) bits_speed_map[bits] = speed speed_bits_map[speed] = bits c['B'..speed] = bits -- TODO in table end function c.bits_to_speed(bits) local speed = bits_speed_map[bits] if not speed then error("unknown speedbits: " .. bits) end return speed end function c.speed_to_bits(speed) local bits = speed_bits_map[speed] if not bits then error("unknown speed: " .. speed) end return bits end -- termios - c_cflag bit meaning c.CBAUD = octal('0010017') defspeed(0, '0000000') -- hang up defspeed(50, '0000001') defspeed(75, '0000002') defspeed(110, '0000003') defspeed(134, '0000004') defspeed(150, '0000005') defspeed(200, '0000006') defspeed(300, '0000007') defspeed(600, '0000010') defspeed(1200, '0000011') defspeed(1800, '0000012') defspeed(2400, '0000013') defspeed(4800, '0000014') defspeed(9600, '0000015') defspeed(19200, '0000016') defspeed(38400, '0000017') c.EXTA = c.B19200 c.EXTB = c.B38400 c.CSIZE = octal('0000060') c.CS5 = octal('0000000') c.CS6 = octal('0000020') c.CS7 = octal('0000040') c.CS8 = octal('0000060') c.CSTOPB = octal('0000100') c.CREAD = octal('0000200') c.PARENB = octal('0000400') c.PARODD = octal('0001000') c.HUPCL = octal('0002000') c.CLOCAL = octal('0004000') c.CBAUDEX = octal('0010000') defspeed(57600, '0010001') defspeed(115200, '0010002') defspeed(230400, '0010003') defspeed(460800, '0010004') defspeed(500000, '0010005') defspeed(576000, '0010006') defspeed(921600, '0010007') defspeed(1000000, '0010010') defspeed(1152000, '0010011') defspeed(1500000, '0010012') defspeed(2000000, '0010013') defspeed(2500000, '0010014') defspeed(3000000, '0010015') defspeed(3500000, '0010016') defspeed(4000000, '0010017') c.__MAX_BAUD = c.B4000000 c.CIBAUD = octal('002003600000') -- input baud rate (not used) c.CMSPAR = octal('010000000000') -- mark or space (stick) parity c.CRTSCTS = octal('020000000000') -- flow control -- termios - c_lflag bits c.ISIG = octal('0000001') c.ICANON = octal('0000002') c.XCASE = octal('0000004') c.ECHO = octal('0000010') c.ECHOE = octal('0000020') c.ECHOK = octal('0000040') c.ECHONL = octal('0000100') c.NOFLSH = octal('0000200') c.TOSTOP = octal('0000400') c.ECHOCTL = octal('0001000') c.ECHOPRT = octal('0002000') c.ECHOKE = octal('0004000') c.FLUSHO = octal('0010000') c.PENDIN = octal('0040000') c.IEXTEN = octal('0100000') -- termios - tcflow() and TCXONC use these. renamed from TC to TCFLOW c.TCFLOW = setmetatable({ OOFF = 0, OON = 1, IOFF = 2, ION = 3, }, stringflag) -- termios - tcflush() and TCFLSH use these. renamed from TC to TCFLUSH c.TCFLUSH = setmetatable({ IFLUSH = 0, OFLUSH = 1, IOFLUSH = 2, }, stringflag) -- termios - tcsetattr uses these c.TCSA = setmetatable({ NOW = 0, DRAIN = 1, FLUSH = 2, }, stringflag) -- TIOCM ioctls c.TIOCM_LE = 0x001 c.TIOCM_DTR = 0x002 c.TIOCM_RTS = 0x004 c.TIOCM_ST = 0x008 c.TIOCM_SR = 0x010 c.TIOCM_CTS = 0x020 c.TIOCM_CAR = 0x040 c.TIOCM_RNG = 0x080 c.TIOCM_DSR = 0x100 c.TIOCM_CD = c.TIOCM_CAR c.TIOCM_RI = c.TIOCM_RNG -- ioctls, filling in as needed TODO more general framework? c.SIOC = setmetatable({ GIFINDEX = 0x8933, BRADDBR = 0x89a0, BRDELBR = 0x89a1, BRADDIF = 0x89a2, BRDELIF = 0x89a3, }, stringflag) c.TIOC = setmetatable({ MGET = 0x5415, MBIS = 0x5416, MBIC = 0x5417, MSET = 0x5418, GPTN = 0x80045430LL, SPTLCK = 0x40045431LL, }, stringflag) -- sysfs values c.SYSFS_BRIDGE_ATTR = "bridge" c.SYSFS_BRIDGE_FDB = "brforward" c.SYSFS_BRIDGE_PORT_SUBDIR = "brif" c.SYSFS_BRIDGE_PORT_ATTR = "brport" c.SYSFS_BRIDGE_PORT_LINK = "bridge" -- sizes -- should we export? local HOST_NAME_MAX = 64 local IFNAMSIZ = 16 local IFHWADDRLEN = 6 -- errors c.E = { EPERM = 1, ENOENT = 2, ESRCH = 3, EINTR = 4, EIO = 5, ENXIO = 6, E2BIG = 7, ENOEXEC = 8, EBADF = 9, ECHILD = 10, EAGAIN = 11, ENOMEM = 12, EACCES = 13, EFAULT = 14, ENOTBLK = 15, EBUSY = 16, EEXIST = 17, EXDEV = 18, ENODEV = 19, ENOTDIR = 20, EISDIR = 21, EINVAL = 22, ENFILE = 23, EMFILE = 24, ENOTTY = 25, ETXTBSY = 26, EFBIG = 27, ENOSPC = 28, ESPIPE = 29, EROFS = 30, EMLINK = 31, EPIPE = 32, EDOM = 33, ERANGE = 34, EDEADLK = 35, ENAMETOOLONG = 36, ENOLCK = 37, ENOSYS = 38, ENOTEMPTY = 39, ELOOP = 40, ENOMSG = 42, EIDRM = 43, ECHRNG = 44, EL2NSYNC = 45, EL3HLT = 46, EL3RST = 47, ELNRNG = 48, EUNATCH = 49, ENOCSI = 50, EL2HLT = 51, EBADE = 52, EBADR = 53, EXFULL = 54, ENOANO = 55, EBADRQC = 56, EBADSLT = 57, EBFONT = 59, ENOSTR = 60, ENODATA = 61, ETIME = 62, ENOSR = 63, ENONET = 64, ENOPKG = 65, EREMOTE = 66, ENOLINK = 67, EADV = 68, ESRMNT = 69, ECOMM = 70, EPROTO = 71, EMULTIHOP = 72, EDOTDOT = 73, EBADMSG = 74, EOVERFLOW = 75, ENOTUNIQ = 76, EBADFD = 77, EREMCHG = 78, ELIBACC = 79, ELIBBAD = 80, ELIBSCN = 81, ELIBMAX = 82, ELIBEXEC = 83, EILSEQ = 84, ERESTART = 85, ESTRPIPE = 86, EUSERS = 87, ENOTSOCK = 88, EDESTADDRREQ = 89, EMSGSIZE = 90, EPROTOTYPE = 91, ENOPROTOOPT = 92, EPROTONOSUPPORT= 93, ESOCKTNOSUPPORT= 94, EOPNOTSUPP = 95, EPFNOSUPPORT = 96, EAFNOSUPPORT = 97, EADDRINUSE = 98, EADDRNOTAVAIL = 99, ENETDOWN = 100, ENETUNREACH = 101, ENETRESET = 102, ECONNABORTED = 103, ECONNRESET = 104, ENOBUFS = 105, EISCONN = 106, ENOTCONN = 107, ESHUTDOWN = 108, ETOOMANYREFS = 109, ETIMEDOUT = 110, ECONNREFUSED = 111, EHOSTDOWN = 112, EHOSTUNREACH = 113, EINPROGRESS = 115, ESTALE = 116, EUCLEAN = 117, ENOTNAM = 118, ENAVAIL = 119, EISNAM = 120, EREMOTEIO = 121, EDQUOT = 122, ENOMEDIUM = 123, EMEDIUMTYPE = 124, ECANCELED = 125, ENOKEY = 126, EKEYEXPIRED = 127, EKEYREVOKED = 128, EKEYREJECTED = 129, EOWNERDEAD = 130, ENOTRECOVERABLE= 131, ERFKILL = 132, } -- alternate names c.E.EWOULDBLOCK = c.E.EAGAIN c.E.EDEADLOCK = c.E.EDEADLK c.E.ENOATTR = c.E.ENODATA return c
mit
s-d-a/DCS-ExportScripts
Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua
1
20181
-- Su-25T Export ExportScript.FoundFCModule = true ExportScript.Version.Su25T = "1.2.1" -- auxiliary function dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") ----------------------------------------- -- FLAMING CLIFFS AIRCRAFT / Su-25T -- -- FC aircraft don't support GetDevice -- ----------------------------------------- function ExportScript.ProcessIkarusFCHighImportanceConfig() local lFunctionTyp = "Ikarus" -- function type for shared function local myData = LoGetSelfData() if (myData) then local lLatitude = myData.LatLongAlt.Lat -- LATITUDE local lLongitude = myData.LatLongAlt.Long -- LONGITUDE local lEngineTempLeft = LoGetEngineInfo().Temperature.left -- ENG1 EGT ?C local lEngineTempRight = LoGetEngineInfo().Temperature.right -- ENG2 EGT ?C --[[ local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE local lAltBar = LoGetAltitudeAboveSeaLevel() -- ALTITUDE SEA LEVEL (Meter) local lAltRad = LoGetAltitudeAboveGroundLevel() -- ALTITUDE GROUND LEVEL (Meter) local lTrueAirSpeed = LoGetTrueAirSpeed() -- TRUE AIRSPEED (Meter/Second) local lPitch, lBank, lYaw = LoGetADIPitchBankYaw() -- PITCH, BANK, YAW (Radian) local lHeading = myData.Heading -- HEADING (Radian) local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second) local lIAS = LoGetIndicatedAirSpeed() -- INDICATED AIRSPEED (Meter/Second) local lMachNumber = LoGetMachNumber() -- MACH local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian) local lGlide = LoGetGlideDeviation() -- VOR1 HORIZONTAL DEFLECTION (-1 +1) local lSide = LoGetSideDeviation() -- VOR1 VERTICAL DEFLECTION (-1 +1) local lSlipBallPosition = LoGetSlipBallPosition() -- SLIP BALL (-1 +1) local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD local lNavInfoPitch = LoGetNavigationInfo().Requirements.pitch -- AP REQUIRED PITCH (Radian) local lNavInfoRoll = LoGetNavigationInfo().Requirements.roll -- AP REQUIRED BANK (Radian) local lNavInfoSpeed = LoGetNavigationInfo().Requirements.speed -- AP SPEED (Meter/Second) local lNavInfoAltitude = LoGetNavigationInfo().Requirements.altitude -- AP ALTITUDE (Meter) local lNavInfoVerticalSpeed = LoGetNavigationInfo().Requirements.vertical_speed -- AP VERTICAL SPEED (Meter/Second) local lControlPanel_HSI = LoGetControlPanel_HSI() -- HSI Data local lHSI_RMI = LoGetControlPanel_HSI().RMI_raw -- VOR1 OBS (Radian) local lHSI_ADF = LoGetControlPanel_HSI().ADF_raw -- ADF OBS (Radian) local lHSI_Heading = LoGetControlPanel_HSI().Heading_raw -- Heading (Radian) local lEngineRPMleft = LoGetEngineInfo().RPM.left -- ENG1 RPM % local lEngineRPMright = LoGetEngineInfo().RPM.right -- ENG2 RPM % local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG) local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG) local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... local lPayloadInfo = LoGetPayloadInfo() -- Paylod, e.g. bombs, guns, rockets, fuel tanks,... ]] local lDistanceToWay = 999 local lRoute = LoGetRoute() if (myData and lRoute) then -- if neither are nil local myLoc = LoGeoCoordinatesToLoCoordinates(lLongitude, lLatitude) --lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.y - lRoute.goto_point.world_point.y)^2) lDistanceToWay = math.sqrt((myLoc.x - lRoute.goto_point.world_point.x)^2 + (myLoc.z - lRoute.goto_point.world_point.z)^2) end -- IAS-TAS Indicator ExportScript.AF.FC_Russian_AirSpeed_1100hkm() -- AOA Indicator and Accelerometer ExportScript.AF.FC_Russian_AOA_Su25() -- ADI ExportScript.AF.FC_Russian_ADI_Old() -- HSI ExportScript.AF.FC_Russian_HSI(lDistanceToWay) -- Vertical Velocity Indicator (VVI, TurnIndicator, SlipBallPosition) ExportScript.AF.FC_Russian_VVI_Old() -- Radar Altimeter (below 100m is warning light on) ExportScript.AF.FC_Russian_RadarAltimeter_1500m(100) -- Barometric Altimeter ExportScript.AF.FC_Russian_BarometricAltimeter_late_special() -- Tachometer (RPM) ExportScript.AF.FC_Russian_EngineRPM() -- Left Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID) ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempLeft, 70) -- Right Jet Engine Turbine Temperature Indicator (EngineTemp, ExportID) ExportScript.AF.FC_Russian_EGT_1000gc(lEngineTempRight, 71) -- Clock from Ka-50 ExportScript.AF.FC_Russian_Clock_late() else ExportScript.Tools.WriteToLog("Unknown FC Error, no LoGetSelfData.") end end function ExportScript.ProcessDACConfigHighImportance() local lFunctionTyp = "DAC" -- function type for shared function -- your script end function ExportScript.ProcessIkarusFCLowImportanceConfig() local lFunctionTyp = "Ikarus" -- function type for shared function -- Weapon Panel ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp) -- SPO15 Radar Warning Reciver ExportScript.AF.FC_SPO15RWR(lFunctionTyp) -- EKRAN Message ExportScript.AF.FC_EKRAN() -- Mechanical Configuration Indicator ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp) -- Fuel Quantity Indicator ExportScript.AF.FC_FuelQuantityIndicator(lFunctionTyp) local lEngineInfo = LoGetEngineInfo() if lEngineInfo ~= nil then -- Hydraulic Pressure Left ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.left, 240, 85) -- Hydraulic Pressure Right ExportScript.AF.FC_OneNeedleGauge(lEngineInfo.HydraulicPressure.right, 240, 86) end local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... if lMechInfo ~= nil then -- Wheelbrakes Hydraulic Pressure Left ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 87) -- Wheelbrakes Hydraulic Pressure Right ExportScript.AF.FC_OneNeedleGauge(lMechInfo.wheelbrakes.value, 240, 88) end -- (x < 0 and 'negative' or 'non-negative') --[[ local lPayloadInfo = LoGetPayloadInfo() ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo)) local lSnares = LoGetSnares() -- Flare and Chaff ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares)) local lSightingSystemInfo = LoGetSightingSystemInfo() ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)) local lTWSInfo = LoGetTWSInfo() -- SPO Informationen, z.B. Radarwarner F15C ExportScript.Tools.WriteToLog('lTWSInfo: '..ExportScript.Tools.dump(lTWSInfo)) local lTargetInformation = LoGetTargetInformation() -- detalierte Radar Infos z.B. F15C ExportScript.Tools.WriteToLog('lTargetInformation: '..ExportScript.Tools.dump(lTargetInformation)) local lLockedTargetInformation = LoGetLockedTargetInformation() ExportScript.Tools.WriteToLog('lLockedTargetInformation: '..ExportScript.Tools.dump(lLockedTargetInformation)) local lF15_TWS_Contacs = LoGetF15_TWS_Contacts() -- the same information but only for F-15 in TWS mode ExportScript.Tools.WriteToLog('lF15_TWS_Contacs: '..ExportScript.Tools.dump(lF15_TWS_Contacs)) local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... ExportScript.Tools.WriteToLog('lMechInfo: '..ExportScript.Tools.dump(lMechInfo)) local lMCPState = LoGetMCPState() -- Warnlichter ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState)) local lControlPanel_HSI = LoGetControlPanel_HSI() ExportScript.Tools.WriteToLog('lControlPanel_HSI: '..ExportScript.Tools.dump(lControlPanel_HSI)) local lRadioBeaconsStatus = LoGetRadioBeaconsStatus() ExportScript.Tools.WriteToLog('lRadioBeaconsStatus: '..ExportScript.Tools.dump(lRadioBeaconsStatus)) local lEngineInfo = LoGetEngineInfo() ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo)) ]] -- Weapon Control System -- local lNameByType = LoGetNameByType () -- args 4 (number : level1,level2,level3,level4), result string -- values from LoGetTargetInformation().type -- ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType)) end function ExportScript.ProcessDACConfigLowImportance() local lFunctionTyp = "DAC" -- function type for shared function -- Weapon Panel ExportScript.AF.FC_WeaponPanel_SU25(lFunctionTyp) -- SPO15 Radar Warning Reciver ExportScript.AF.FC_SPO15RWR(lFunctionTyp) -- Mechanical Configuration Indicator ExportScript.AF.FC_Russian_MDI_SU25(lFunctionTyp) -- Fuel ExportScript.AF.FC_FuelQuantityIndicator(lFunctionTyp) ExportScript.AF.FC_StatusLamp() ExportScript.AF.FC_SightingSystem() end ----------------------------- -- Custom functions -- ----------------------------- function ExportScript.AF.FC_SightingSystem() local lSightingSystemInfo = LoGetSightingSystemInfo() if lSightingSystemInfo == nil then return end --ExportScript.Tools.WriteToLog('lSightingSystemInfo: '..ExportScript.Tools.dump(lSightingSystemInfo)9 --[[ [PRF] = { [selection] = string: "ILV" [current] = string: "MED" } [laser_on] = boolean: "false" [scale] = { [azimuth] = number: "0.52359873056412" [distance] = number: "10000" } [radar_on] = boolean: "false" [optical_system_on] = boolean: "false" [LaunchAuthorized] = boolean: "false" [ECM_on] = boolean: "false" [Manufacturer] = string: "RUS" [TDC] = { [y] = number: "0" [x] = number: "0" } [ScanZone] = { [coverage_H] = { [min] = number: "0" [max] = number: "20000" } [size] = { [azimuth] = number: "1.0471974611282" [elevation] = number: "0.17453290522099" } [position] = { [exceeding_manual] = number: "0" [distance_manual] = number: "0" [azimuth] = number: "0" [elevation] = number: "0" } } ]] ExportScript.Tools.SendDataDAC("600", lSightingSystemInfo.ECM_on == true and 1 or 0 ) --ExportScript.Tools.SendDataDAC("601", lSightingSystemInfo.laser_on == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("602", lSightingSystemInfo.optical_system_on == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("603", lSightingSystemInfo.LaunchAuthorized == true and 1 or 0 ) --ExportScript.Tools.SendDataDAC("604", lSightingSystemInfo.radar_on == true and 1 or 0 ) end function ExportScript.AF.FC_FlareChaff() local lSnares = LoGetSnares() -- Flare and Chaff if lSnares == nil then return end --ExportScript.Tools.WriteToLog('lSnares: '..ExportScript.Tools.dump(lSnares)) --[chaff] = number: "128" --[flare] = number: "128" end function ExportScript.AF.FC_StatusLamp() local lMCPState = LoGetMCPState() -- Warning Lights if lMCPState == nil then return end --ExportScript.Tools.WriteToLog('lMCPState: '..ExportScript.Tools.dump(lMCPState)) --[[ [RightTailPlaneFailure] = boolean: "false" [EOSFailure] = boolean: "false" [ECMFailure] = boolean: "false" [RightAileronFailure] = boolean: "false" [MasterWarning] = boolean: "false" [RightEngineFailure] = boolean: "false" [CannonFailure] = boolean: "false" [MLWSFailure] = boolean: "false" [ACSFailure] = boolean: "false" [RadarFailure] = boolean: "false" [HelmetFailure] = boolean: "false" [HUDFailure] = boolean: "false" [LeftMainPumpFailure] = boolean: "false" [RightWingPumpFailure] = boolean: "false" [LeftWingPumpFailure] = boolean: "false" [MFDFailure] = boolean: "false" [RWSFailure] = boolean: "false" [GearFailure] = boolean: "false" [HydraulicsFailure] = boolean: "false" [AutopilotFailure] = boolean: "true" [FuelTankDamage] = boolean: "false" [LeftAileronFailure] = boolean: "false" [CanopyOpen] = boolean: "false" [RightMainPumpFailure] = boolean: "false" [StallSignalization] = boolean: "false" [LeftEngineFailure] = boolean: "false" [AutopilotOn] = boolean: "false" [LeftTailPlaneFailure] = boolean: "false" ]] ExportScript.Tools.SendDataDAC("700", lMCPState.LeftTailPlaneFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("701", lMCPState.RightTailPlaneFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("702", lMCPState.MasterWarning == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("703", lMCPState.LeftEngineFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("704", lMCPState.RightEngineFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("705", lMCPState.LeftAileronFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("706", lMCPState.RightAileronFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("707", lMCPState.LeftMainPumpFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("708", lMCPState.RightMainPumpFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("709", lMCPState.LeftWingPumpFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("710", lMCPState.RightWingPumpFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("711", lMCPState.EOSFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("712", lMCPState.ECMFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("713", lMCPState.CannonFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("714", lMCPState.MLWSFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("715", lMCPState.ACSFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("716", lMCPState.RadarFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("717", lMCPState.HelmetFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("718", lMCPState.HUDFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("719", lMCPState.MFDFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("720", lMCPState.RWSFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("721", lMCPState.GearFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("722", lMCPState.HydraulicsFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("723", lMCPState.AutopilotFailure == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("724", lMCPState.FuelTankDamage == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("725", lMCPState.CanopyOpen == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("726", lMCPState.StallSignalization == true and 1 or 0 ) ExportScript.Tools.SendDataDAC("727", lMCPState.AutopilotOn == true and 1 or 0 ) local lEngineInfo = LoGetEngineInfo() if lEngineInfo ~= nil then --ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo)) ExportScript.Tools.SendDataDAC("728", lEngineInfo.EngineStart.left ) -- lamp start left engine 1 (0|1) ExportScript.Tools.SendDataDAC("729", lEngineInfo.EngineStart.right ) -- lamp start right engine 1 (0|1) end local lAoA = LoGetAngleOfAttack() if lAoA ~= nil then lAoA = lAoA * 57.3 ExportScript.Tools.SendDataDAC("730", (lAoA > 20.0 and 1 or 0) ) -- lamp start AOA warning (0|1) end end function ExportScript.AF.FC_FuelQuantityIndicator(FunctionTyp) local lFunctionTyp = FunctionTyp or "Ikarus" -- Fuel quantity shows the fuel remaining in all tanks local lEngineInfo = LoGetEngineInfo() if lEngineInfo == nil then return end --ExportScript.Tools.WriteToLog('lEngineInfo: '..ExportScript.Tools.dump(lEngineInfo)) --[[ [fuel_external] = number: "0" [Temperature] = { [left] = number: "626.99444580078" [right] = number: "626.99444580078" } [RPM] = { [left] = number: "87.453765869141" [right] = number: "87.453758239746" } [FuelConsumption] = { [left] = number: "0.1500396137767" [right] = number: "0.1500396137767" } [fuel_internal] = number: "3773.2749023438" [EngineStart] = { [left] = number: "0" [right] = number: "0" } [HydraulicPressure] = { [left] = number: "210" [right] = number: "210" } lPayloadInfo.Stations[8].CLSID == E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF -- ext 800l Fuel Tank ]] local lTotalFuel = lEngineInfo.fuel_internal --local lTotalFuel = string.format("%3d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10) --local lTotalFuel = string.format("%4d", lEngineInfo.fuel_internal) -- total fuel in kg --local lTotalFuel = string.format("%4d", lEngineInfo.fuel_external) -- external fuel in kg local lFuelCounter = {[0] = 0.0, [1] = 0.11, [2] = 0.22, [3] = 0.33, [4] = 0.44, [5] = 0.55, [6] = 0.66, [7] = 0.77, [8] = 0.88, [9] = 0.99} lTotalFuel = string.format("%03d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil")) -- auf drei stellen bringen local lExtTank1 = 1.0 -- external tanks local lExtTank2 = 1.0 -- inner tanks local lPayloadInfo = LoGetPayloadInfo() if lPayloadInfo ~= nil then --ExportScript.Tools.WriteToLog('lPayloadInfo: '..ExportScript.Tools.dump(lPayloadInfo)) if lPayloadInfo.Stations[10].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or lPayloadInfo.Stations[9].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then -- external tanks presend and full (panel 6 and 5) lExtTank1 = ((lEngineInfo.fuel_external < 1240.0 ) and 1.0 or 0.0) end if lPayloadInfo.Stations[5].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" or lPayloadInfo.Stations[6].CLSID == "{E8D4652F-FD48-45B7-BA5B-2AE05BB5A9CF}" then-- inner tanks presend and full (panel 3 and 8) lExtTank2 = ((lEngineInfo.fuel_external < 1.0 ) and 1.0 or 0.0) end end -- TotalFuel_100 -- TotalFuel_10 -- TotalFuel_1 -- Light1 -- Light2 -- Light3 -- Light4 -- Light5 -- BingoLight if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then ExportScript.Tools.SendData(300, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 1, 1))])) ExportScript.Tools.SendData(301, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 2, 2))])) ExportScript.Tools.SendData(302, string.format("%0.2f", lFuelCounter[tonumber(string.sub(lTotalFuel, 3, 3))])) ExportScript.Tools.SendData(303, lExtTank1) -- external tanks ExportScript.Tools.SendData(304, lExtTank2) -- inner tanks ExportScript.Tools.SendData(305, (lEngineInfo.fuel_internal < 2800.0 and 1 or 0)) -- inner wing tank ExportScript.Tools.SendData(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank ExportScript.Tools.SendData(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank ExportScript.Tools.SendData(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel end if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then ExportScript.Tools.SendDataDAC("300", string.format("%d", ExportScript.Tools.round((lEngineInfo.fuel_internal / 10), 0, "ceil") * 10)) -- total fuel in kg --ExportScript.Tools.SendDataDAC("301", string.format("%d", lEngineInfo.fuel_internal)) -- total fuel in kg --ExportScript.Tools.SendDataDAC("302", string.format("%d", lEngineInfo.fuel_external)) -- external fuel in kg ExportScript.Tools.SendDataDAC(303, lExtTank1) -- external tanks ExportScript.Tools.SendDataDAC(304, lExtTank2) -- inner tanks ExportScript.Tools.SendDataDAC(305, (lEngineInfo.fuel_internal < 2800.0 and 1 or 0)) -- inner wing tank ExportScript.Tools.SendDataDAC(306, (lEngineInfo.fuel_internal < 1840.0 and 1 or 0)) -- inner hull tank ExportScript.Tools.SendDataDAC(307, (lEngineInfo.fuel_internal < 1.0 and 1 or 0)) -- central hull tank ExportScript.Tools.SendDataDAC(308, (lEngineInfo.fuel_internal < 600.0 and 1 or 0)) -- Bingo Fuel end end
lgpl-3.0
Ninjistix/darkstar
scripts/zones/Tahrongi_Canyon/npcs/qm2.lua
7
2137
----------------------------------- -- Area: Tahrongi Canyon -- NPC: qm2 (???) -- Note: Used to spawn Yara Ma Yha Who -- !pos 271 0.001 -334 117 ----------------------------------- package.loaded["scripts/zones/Tahrongi_Canyon/TextIDs"] = nil; ------------------------------------- require("scripts/zones/Tahrongi_Canyon/TextIDs"); require("scripts/zones/Tahrongi_Canyon/MobIDs"); require("scripts/globals/settings"); function onTrade(player,npc,trade) -- Trade Distilled water to Spawn Yara Ma Yha Who if (not GetMobByID(YARA_MA_YHA_WHO):isSpawned() and trade:hasItemQty(4509,1) and trade:getItemCount() == 1) then if (GetServerVariable("[POP]Yara-Ma-Yha-Who-Timer") < os.time()) then -- Checks to make sure trade has not been made in past 50 minutes player:tradeComplete(); local timesTraded = GetServerVariable("[POP]Yara-Ma-Yha-Who-Trades"); if (timesTraded == 3) then -- Takes a minimum of 3 trades before NM can be spawned if (math.random(0,2) == 2) then SpawnMob(YARA_MA_YHA_WHO):updateClaim(player); player:messageSpecial(REPULSIVE_CREATURE_EMERGES); else player:messageSpecial(SPROUT_LOOKING_BETTER); end else SetServerVariable("[POP]Yara-Ma-Yha-Who-Trades",timesTraded + 1) player:messageSpecial(SPROUT_LOOKING_BETTER); end else player:messageSpecial(SPROUT_DOES_NOT_NEED_WATER) end SetServerVariable("[POP]Yara-Ma-Yha-Who-Timer",os.time() + 3000); -- 50 minutes wait time before you can trade again else player:messageSpecial(NOTHING_HAPPENS); end end; function onTrigger(player,npc) if (GetServerVariable("[POP]Yara-Ma-Yha-Who-Timer") < os.time()) then -- Checks to make sure trade has not been made in past 50 minutes player:messageSpecial(SPROUT_LOOKS_WITHERED); else player:messageSpecial(SPROUT_LOOKING_BETTER); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) end;
gpl-3.0
ThomasSFL/ardupilot-solo
Tools/CHDK-Scripts/kap_uav.lua
183
28512
--[[ KAP UAV Exposure Control Script v3.1 -- Released under GPL by waterwingz and wayback/peabody http://chdk.wikia.com/wiki/KAP_%26_UAV_Exposure_Control_Script @title KAP UAV 3.1 @param i Shot Interval (sec) @default i 15 @range i 2 120 @param s Total Shots (0=infinite) @default s 0 @range s 0 10000 @param j Power off when done? @default j 0 @range j 0 1 @param e Exposure Comp (stops) @default e 6 @values e -2.0 -1.66 -1.33 -1.0 -0.66 -0.33 0.0 0.33 0.66 1.00 1.33 1.66 2.00 @param d Start Delay Time (sec) @default d 0 @range d 0 10000 @param y Tv Min (sec) @default y 0 @values y None 1/60 1/100 1/200 1/400 1/640 @param t Target Tv (sec) @default t 5 @values t 1/100 1/200 1/400 1/640 1/800 1/1000 1/1250 1/1600 1/2000 @param x Tv Max (sec) @default x 3 @values x 1/1000 1/1250 1/1600 1/2000 1/5000 1/10000 @param f Av Low(f-stop) @default f 4 @values f 1.8 2.0 2.2 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 @param a Av Target (f-stop) @default a 7 @values a 1.8 2.0 2.2 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 @param m Av Max (f-stop) @default m 13 @values m 1.8 2.0 2.2 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 @param p ISO Min @default p 1 @values p 80 100 200 400 800 1250 1600 @param q ISO Max1 @default q 2 @values q 100 200 400 800 1250 1600 @param r ISO Max2 @default r 3 @values r 100 200 400 800 1250 1600 @param n Allow use of ND filter? @default n 1 @values n No Yes @param z Zoom position @default z 0 @values z Off 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% @param c Focus @ Infinity Mode @default c 0 @values c None @Shot AFL MF @param v Video Interleave (shots) @default v 0 @values v Off 1 5 10 25 50 100 @param w Video Duration (sec) @default w 10 @range w 5 300 @param u USB Shot Control? @default u 0 @values u None On/Off OneShot PWM @param b Backlight Off? @default b 0 @range b 0 1 @param l Logging @default l 3 @values l Off Screen SDCard Both --]] props=require("propcase") capmode=require("capmode") -- convert user parameter to usable variable names and values tv_table = { -320, 576, 640, 736, 832, 896, 928, 960, 992, 1024, 1056, 1180, 1276} tv96target = tv_table[t+3] tv96max = tv_table[x+8] tv96min = tv_table[y+1] sv_table = { 381, 411, 507, 603, 699, 761, 795 } sv96min = sv_table[p+1] sv96max1 = sv_table[q+2] sv96max2 = sv_table[r+2] av_table = { 171, 192, 218, 265, 285, 322, 347, 384, 417, 446, 477, 510, 543, 576 } av96target = av_table[a+1] av96minimum = av_table[f+1] av96max = av_table[m+1] ec96adjust = (e - 6)*32 video_table = { 0, 1, 5, 10, 25, 50, 100 } video_mode = video_table[v+1] video_duration = w interval = i*1000 max_shots = s poff_if_done = j start_delay = d backlight = b log_mode= l focus_mode = c usb_mode = u if ( z==0 ) then zoom_setpoint = nil else zoom_setpoint = (z-1)*10 end -- initial configuration values nd96offset=3*96 -- ND filter's number of equivalent f-stops (f * 96) infx = 50000 -- focus lock distance in mm (approximately 55 yards) shot_count = 0 -- shot counter blite_timer = 300 -- backlight off delay in 100mSec increments old_console_timeout = get_config_value( 297 ) shot_request = false -- pwm mode flag to request a shot be taken -- check camera Av configuration ( variable aperture and/or ND filter ) if n==0 then -- use of nd filter allowed? if get_nd_present()==1 then -- check for ND filter only Av_mode = 0 -- 0 = ND disabled and no iris available else Av_mode = 1 -- 1 = ND disabled and iris available end else Av_mode = get_nd_present()+1 -- 1 = iris only , 2=ND filter only, 3= both ND & iris end function printf(...) if ( log_mode == 0) then return end local str=string.format(...) if (( log_mode == 1) or (log_mode == 3)) then print(str) end if ( log_mode > 1 ) then local logname="A/KAP.log" log=io.open(logname,"a") log:write(os.date("%Y%b%d %X ")..string.format(...),"\n") log:close() end end tv_ref = { -- note : tv_ref values set 1/2 way between shutter speed values -608, -560, -528, -496, -464, -432, -400, -368, -336, -304, -272, -240, -208, -176, -144, -112, -80, -48, -16, 16, 48, 80, 112, 144, 176, 208, 240, 272, 304, 336, 368, 400, 432, 464, 496, 528, 560, 592, 624, 656, 688, 720, 752, 784, 816, 848, 880, 912, 944, 976, 1008, 1040, 1072, 1096, 1129, 1169, 1192, 1225, 1265, 1376 } tv_str = { ">64", "64", "50", "40", "32", "25", "20", "16", "12", "10", "8.0", "6.0", "5.0", "4.0", "3.2", "2.5", "2.0", "1.6", "1.3", "1.0", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640", "1/800", "1/1000","1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000","1/5000","1/6400","1/8000","1/10000","hi" } function print_tv(val) if ( val == nil ) then return("-") end local i = 1 while (i <= #tv_ref) and (val > tv_ref[i]) do i=i+1 end return tv_str[i] end av_ref = { 160, 176, 208, 243, 275, 304, 336, 368, 400, 432, 464, 480, 496, 512, 544, 592, 624, 656, 688, 720, 752, 784 } av_str = {"n/a","1.8", "2.0","2.2","2.6","2.8","3.2","3.5","4.0","4.5","5.0","5.6","5.9","6.3","7.1","8.0","9.0","10.0","11.0","13.0","14.0","16.0","hi"} function print_av(val) if ( val == nil ) then return("-") end local i = 1 while (i <= #av_ref) and (val > av_ref[i]) do i=i+1 end return av_str[i] end sv_ref = { 370, 397, 424, 456, 492, 523, 555, 588, 619, 651, 684, 731, 779, 843, 907 } sv_str = {"n/a","80","100","120","160","200","250","320","400","500","640","800","1250","1600","3200","hi"} function print_sv(val) if ( val == nil ) then return("-") end local i = 1 while (i <= #sv_ref) and (val > sv_ref[i]) do i=i+1 end return sv_str[i] end function pline(message, line) -- print line function fg = 258 bg=259 end -- switch between shooting and playback modes function switch_mode( m ) if ( m == 1 ) then if ( get_mode() == false ) then set_record(1) -- switch to shooting mode while ( get_mode() == false ) do sleep(100) end sleep(1000) end else if ( get_mode() == true ) then set_record(0) -- switch to playback mode while ( get_mode() == true ) do sleep(100) end sleep(1000) end end end -- focus lock and unlock function lock_focus() if (focus_mode > 1) then -- focus mode requested ? if ( focus_mode == 2 ) then -- method 1 : set_aflock() command enables MF if (chdk_version==120) then set_aflock(1) set_prop(props.AF_LOCK,1) else set_aflock(1) end if (get_prop(props.AF_LOCK) == 1) then printf(" AFL enabled") else printf(" AFL failed ***") end else -- mf mode requested if (chdk_version==120) then -- CHDK 1.2.0 : call event proc or levents to try and enable MF mode if call_event_proc("SS.Create") ~= -1 then if call_event_proc("SS.MFOn") == -1 then call_event_proc("PT_MFOn") end elseif call_event_proc("RegisterShootSeqEvent") ~= -1 then if call_event_proc("PT_MFOn") == -1 then call_event_proc("MFOn") end end if (get_prop(props.FOCUS_MODE) == 0 ) then -- MF not set - try levent PressSw1AndMF post_levent_for_npt("PressSw1AndMF") sleep(500) end elseif (chdk_version >= 130) then -- CHDK 1.3.0 : set_mf() if ( set_mf(1) == 0 ) then set_aflock(1) end -- as a fall back, try setting AFL is set_mf fails end if (get_prop(props.FOCUS_MODE) == 1) then printf(" MF enabled") else printf(" MF enable failed ***") end end sleep(1000) set_focus(infx) sleep(1000) end end function unlock_focus() if (focus_mode > 1) then -- focus mode requested ? if (focus_mode == 2 ) then -- method 1 : AFL if (chdk_version==120) then set_aflock(0) set_prop(props.AF_LOCK,0) else set_aflock(0) end if (get_prop(props.AF_LOCK) == 0) then printf(" AFL unlocked") else printf(" AFL unlock failed") end else -- mf mode requested if (chdk_version==120) then -- CHDK 1.2.0 : call event proc or levents to try and enable MF mode if call_event_proc("SS.Create") ~= -1 then if call_event_proc("SS.MFOff") == -1 then call_event_proc("PT_MFOff") end elseif call_event_proc("RegisterShootSeqEvent") ~= -1 then if call_event_proc("PT_MFOff") == -1 then call_event_proc("MFOff") end end if (get_prop(props.FOCUS_MODE) == 1 ) then -- MF not reset - try levent PressSw1AndMF post_levent_for_npt("PressSw1AndMF") sleep(500) end elseif (chdk_version >= 130) then -- CHDK 1.3.0 : set_mf() if ( set_mf(0) == 0 ) then set_aflock(0) end -- fall back so reset AFL is set_mf fails end if (get_prop(props.FOCUS_MODE) == 0) then printf(" MF disabled") else printf(" MF disable failed") end end sleep(100) end end -- zoom position function update_zoom(zpos) local count = 0 if(zpos ~= nil) then zstep=((get_zoom_steps()-1)*zpos)/100 printf("setting zoom to "..zpos.." percent step="..zstep) sleep(200) set_zoom(zstep) sleep(2000) press("shoot_half") repeat sleep(100) count = count + 1 until (get_shooting() == true ) or (count > 40 ) release("shoot_half") end end -- restore camera settings on shutdown function restore() set_config_value(121,0) -- USB remote disable set_config_value(297,old_console_timeout) -- restore console timeout value if (backlight==1) then set_lcd_display(1) end -- display on unlock_focus() if( zoom_setpoint ~= nil ) then update_zoom(0) end if( shot_count >= max_shots) and ( max_shots > 1) then if ( poff_if_done == 1 ) then -- did script ending because # of shots done ? printf("power off - shot count at limit") -- complete power down sleep(2000) post_levent_to_ui('PressPowerButton') else set_record(0) end -- just retract lens end end -- Video mode function check_video(shot) local capture_mode if ((video_mode>0) and(shot>0) and (shot%video_mode == 0)) then unlock_focus() printf("Video mode started. Button:"..tostring(video_button)) if( video_button ) then click "video" else capture_mode=capmode.get() capmode.set('VIDEO_STD') press("shoot_full") sleep(300) release("shoot_full") end local end_second = get_day_seconds() + video_duration repeat wait_click(500) until (is_key("menu")) or (get_day_seconds() > end_second) if( video_button ) then click "video" else press("shoot_full") sleep(300) release("shoot_full") capmode.set(capture_mode) end printf("Video mode finished.") sleep(1000) lock_focus() return(true) else return(false) end end -- PWM USB pulse functions function ch1up() printf(" * usb pulse = ch1up") shot_request = true end function ch1mid() printf(" * usb pulse = ch1mid") if ( get_mode() == false ) then switch_mode(1) lock_focus() end end function ch1down() printf(" * usb pulse = ch1down") switch_mode(0) end function ch2up() printf(" * usb pulse = ch2up") update_zoom(100) end function ch2mid() printf(" * usb pulse = ch2mid") if ( zoom_setpoint ~= nil ) then update_zoom(zoom_setpoint) else update_zoom(50) end end function ch2down() printf(" * usb pulse = ch2down") update_zoom(0) end function pwm_mode(pulse_width) if pulse_width > 0 then if pulse_width < 5 then ch1up() elseif pulse_width < 8 then ch1mid() elseif pulse_width < 11 then ch1down() elseif pulse_width < 14 then ch2up() elseif pulse_width < 17 then ch2mid() elseif pulse_width < 20 then ch2down() else printf(" * usb pulse width error") end end end -- Basic exposure calculation using shutter speed and ISO only -- called for Tv-only and ND-only cameras (cameras without an iris) function basic_tv_calc() tv96setpoint = tv96target av96setpoint = nil local min_av = get_prop(props.MIN_AV) -- calculate required ISO setting sv96setpoint = tv96setpoint + min_av - bv96meter -- low ambient light ? if (sv96setpoint > sv96max2 ) then -- check if required ISO setting is too high sv96setpoint = sv96max2 -- clamp at max2 ISO if so tv96setpoint = math.max(bv96meter+sv96setpoint-min_av,tv96min) -- recalculate required shutter speed down to Tv min -- high ambient light ? elseif (sv96setpoint < sv96min ) then -- check if required ISO setting is too low sv96setpoint = sv96min -- clamp at minimum ISO setting if so tv96setpoint = bv96meter + sv96setpoint - min_av -- recalculate required shutter speed and hope for the best end end -- Basic exposure calculation using shutter speed, iris and ISO -- called for iris-only and "both" cameras (cameras with an iris & ND filter) function basic_iris_calc() tv96setpoint = tv96target av96setpoint = av96target -- calculate required ISO setting sv96setpoint = tv96setpoint + av96setpoint - bv96meter -- low ambient light ? if (sv96setpoint > sv96max1 ) then -- check if required ISO setting is too high sv96setpoint = sv96max1 -- clamp at first ISO limit av96setpoint = bv96meter + sv96setpoint - tv96setpoint -- calculate new aperture setting if ( av96setpoint < av96min ) then -- check if new setting is goes below lowest f-stop av96setpoint = av96min -- clamp at lowest f-stop sv96setpoint = tv96setpoint + av96setpoint - bv96meter -- recalculate ISO setting if (sv96setpoint > sv96max2 ) then -- check if the result is above max2 ISO sv96setpoint = sv96max2 -- clamp at highest ISO setting if so tv96setpoint = math.max(bv96meter+sv96setpoint-av96setpoint,tv96min) -- recalculate required shutter speed down to tv minimum end end -- high ambient light ? elseif (sv96setpoint < sv96min ) then -- check if required ISO setting is too low sv96setpoint = sv96min -- clamp at minimum ISO setting if so tv96setpoint = bv96meter + sv96setpoint - av96setpoint -- recalculate required shutter speed if (tv96setpoint > tv96max ) then -- check if shutter speed now too fast tv96setpoint = tv96max -- clamp at maximum shutter speed if so av96setpoint = bv96meter + sv96setpoint - tv96setpoint -- calculate new aperture setting if ( av96setpoint > av96max ) then -- check if new setting is goes above highest f-stop av96setpoint = av96max -- clamp at highest f-stop tv96setpoint = bv96meter + sv96setpoint - av96setpoint -- recalculate shutter speed needed and hope for the best end end end end -- calculate exposure for cams without adjustable iris or ND filter function exposure_Tv_only() insert_ND_filter = nil basic_tv_calc() end -- calculate exposure for cams with ND filter only function exposure_NDfilter() insert_ND_filter = false basic_tv_calc() if (tv96setpoint > tv96max ) then -- check if shutter speed now too fast insert_ND_filter = true -- flag the ND filter to be inserted bv96meter = bv96meter - nd96offset -- adjust meter for ND offset basic_tv_calc() -- start over, but with new meter value bv96meter = bv96meter + nd96offset -- restore meter for later logging end end -- calculate exposure for cams with adjustable iris only function exposure_iris() insert_ND_filter = nil basic_iris_calc() end -- calculate exposure for cams with both adjustable iris and ND filter function exposure_both() insert_ND_filter = false -- NOTE : assume ND filter never used automatically by Canon firmware basic_iris_calc() if (tv96setpoint > tv96max ) then -- check if shutter speed now too fast insert_ND_filter = true -- flag the ND filter to be inserted bv96meter = bv96meter - nd96offset -- adjust meter for ND offset basic_iris_calc() -- start over, but with new meter value bv96meter = bv96meter + nd96offset -- restore meter for later logging end end -- ========================== Main Program ================================= set_console_layout(1 ,1, 45, 14 ) printf("KAP 3.1 started - press MENU to exit") bi=get_buildinfo() printf("%s %s-%s %s %s %s", bi.version, bi.build_number, bi.build_revision, bi.platform, bi.platsub, bi.build_date) chdk_version= tonumber(string.sub(bi.build_number,1,1))*100 + tonumber(string.sub(bi.build_number,3,3))*10 + tonumber(string.sub(bi.build_number,5,5)) if ( tonumber(bi.build_revision) > 0 ) then build = tonumber(bi.build_revision) else build = tonumber(string.match(bi.build_number,'-(%d+)$')) end if ((chdk_version<120) or ((chdk_version==120)and(build<3276)) or ((chdk_version==130)and(build<3383))) then printf("CHDK 1.2.0 build 3276 or higher required") else if( props.CONTINUOUS_AF == nil ) then caf=-999 else caf = get_prop(props.CONTINUOUS_AF) end if( props.SERVO_AF == nil ) then saf=-999 else saf = get_prop(props.SERVO_AF) end cmode = capmode.get_name() printf("Mode:%s,Continuous_AF:%d,Servo_AF:%d", cmode,caf,saf) printf(" Tv:"..print_tv(tv96target).." max:"..print_tv(tv96max).." min:"..print_tv(tv96min).." ecomp:"..(ec96adjust/96).."."..(math.abs(ec96adjust*10/96)%10) ) printf(" Av:"..print_av(av96target).." minAv:"..print_av(av96minimum).." maxAv:"..print_av(av96max) ) printf(" ISOmin:"..print_sv(sv96min).." ISO1:"..print_sv(sv96max1).." ISO2:"..print_sv(sv96max2) ) printf(" MF mode:"..focus_mode.." Video:"..video_mode.." USB:"..usb_mode) printf(" AvM:"..Av_mode.." int:"..(interval/1000).." Shts:"..max_shots.." Dly:"..start_delay.." B/L:"..backlight) sleep(500) if (start_delay > 0 ) then printf("entering start delay of ".. start_delay.." seconds") sleep( start_delay*1000 ) end -- enable USB remote in USB remote moded if (usb_mode > 0 ) then set_config_value(121,1) -- make sure USB remote is enabled if (get_usb_power(1) == 0) then -- can we start ? printf("waiting on USB signal") repeat wait_click(20) until ((get_usb_power(1) == 1) or ( is_key("menu"))) else sleep(1000) end printf("USB signal received") end -- switch to shooting mode switch_mode(1) -- set zoom position update_zoom(zoom_setpoint) -- lock focus at infinity lock_focus() -- disable flash and AF assist lamp set_prop(props.FLASH_MODE, 2) -- flash off set_prop(props.AF_ASSIST_BEAM,0) -- AF assist off if supported for this camera set_config_value( 297, 60) -- set console timeout to 60 seconds if (usb_mode > 2 ) then repeat until (get_usb_power(2) == 0 ) end -- flush pulse buffer next_shot_time = get_tick_count() script_exit = false if( get_video_button() == 1) then video_button = true else video_button = false end set_console_layout(2 ,0, 45, 4 ) repeat if( ( (usb_mode < 2 ) and ( next_shot_time <= get_tick_count() ) ) or ( (usb_mode == 2 ) and (get_usb_power(2) > 0 ) ) or ( (usb_mode == 3 ) and (shot_request == true ) ) ) then -- time to insert a video sequence ? if( check_video(shot_count) == true) then next_shot_time = get_tick_count() end -- intervalometer timing next_shot_time = next_shot_time + interval -- set focus at infinity ? (maybe redundant for AFL & MF mode but makes sure its set right) if (focus_mode > 0) then set_focus(infx) sleep(100) end -- check exposure local count = 0 local timeout = false press("shoot_half") repeat sleep(50) count = count + 1 if (count > 40 ) then timeout = true end until (get_shooting() == true ) or (timeout == true) -- shoot in auto mode if meter reading invalid, else calculate new desired exposure if ( timeout == true ) then release("shoot_half") repeat sleep(50) until get_shooting() == false shoot() -- shoot in Canon auto mode if we don't have a valid meter reading shot_count = shot_count + 1 printf(string.format('IMG_%04d.JPG',get_exp_count()).." : shot in auto mode, meter reading invalid") else -- get meter reading values (and add in exposure compensation) bv96raw=get_bv96() bv96meter=bv96raw-ec96adjust tv96meter=get_tv96() av96meter=get_av96() sv96meter=get_sv96() -- set minimum Av to larger of user input or current min for zoom setting av96min= math.max(av96minimum,get_prop(props.MIN_AV)) if (av96target < av96min) then av96target = av96min end -- calculate required setting for current ambient light conditions if (Av_mode == 1) then exposure_iris() elseif (Av_mode == 2) then exposure_NDfilter() elseif (Av_mode == 3) then exposure_both() else exposure_Tv_only() end -- set up all exposure overrides set_tv96_direct(tv96setpoint) set_sv96(sv96setpoint) if( av96setpoint ~= nil) then set_av96_direct(av96setpoint) end if(Av_mode > 1) and (insert_ND_filter == true) then -- ND filter available and needed? set_nd_filter(1) -- activate the ND filter nd_string="NDin" else set_nd_filter(2) -- make sure the ND filter does not activate nd_string="NDout" end -- and finally shoot the image press("shoot_full_only") sleep(100) release("shoot_full") repeat sleep(50) until get_shooting() == false shot_count = shot_count + 1 -- update shooting statistic and log as required shot_focus=get_focus() if(shot_focus ~= -1) and (shot_focus < 20000) then focus_string=" foc:"..(shot_focus/1000).."."..(((shot_focus%1000)+50)/100).."m" if(focus_mode>0) then error_string=" **WARNING : focus not at infinity**" end else focus_string=" foc:infinity" error_string=nil end printf(string.format('%d) IMG_%04d.JPG',shot_count,get_exp_count())) printf(" meter : Tv:".. print_tv(tv96meter) .." Av:".. print_av(av96meter) .." Sv:"..print_sv(sv96meter).." "..bv96raw ..":"..bv96meter) printf(" actual: Tv:".. print_tv(tv96setpoint).." Av:".. print_av(av96setpoint).." Sv:"..print_sv(sv96setpoint)) printf(" AvMin:".. print_av(av96min).." NDF:"..nd_string..focus_string ) if ((max_shots>0) and (shot_count >= max_shots)) then script_exit = true end shot_request = false -- reset shot request flag end collectgarbage() end -- check if USB remote enabled in intervalometer mode and USB power is off -> pause if so if ((usb_mode == 1 ) and (get_usb_power(1) == 0)) then printf("waiting on USB signal") unlock_focus() switch_mode(0) repeat wait_click(20) until ((get_usb_power(1) == 1) or ( is_key("menu"))) switch_mode(1) lock_focus() if ( is_key("menu")) then script_exit = true end printf("USB wait finished") sleep(100) end if (usb_mode == 3 ) then pwm_mode(get_usb_power(2)) end if (blite_timer > 0) then blite_timer = blite_timer-1 if ((blite_timer==0) and (backlight==1)) then set_lcd_display(0) end end if( error_string ~= nil) then draw_string( 16, 144, string.sub(error_string.." ",0,42), 258, 259) end wait_click(100) if( not( is_key("no_key"))) then if ((blite_timer==0) and (backlight==1)) then set_lcd_display(1) end blite_timer=300 if ( is_key("menu") ) then script_exit = true end end until (script_exit==true) printf("script halt requested") restore() end --[[ end of file ]]--
gpl-3.0
istarIQ/Source
ar-map.lua
6
1868
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY SAJJAD NOORI ▀▄ ▄▀ ▀▄ ▄▀ BY SAJAD NOORI (@SAJJADNOORI) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY SAJJAD NOORI ▀▄ ▄▀ ▀▄ ▄▀ map : طقس ▀▄ ▄▀ ▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀ --]] do local api_key = nil local base_api = "https://maps.googleapis.com/maps/api" function get_staticmap(area) local api = base_api .. "/staticmap?" -- Get a sense of scale local lat,lng,acc,types = get_latlong(area) local scale = types[1] if scale=="locality" then zoom=8 elseif scale=="country" then zoom=4 else zoom = 13 end local parameters = "size=600x300" .. "&zoom=" .. zoom .. "&center=" .. URL.escape(area) .. "&markers=color:red"..URL.escape("|"..area) if api_key ~=nil and api_key ~= "" then parameters = parameters .. "&key="..api_key end return lat, lng, api..parameters end function run(msg, matches) local receiver = get_receiver(msg) local lat,lng,url = get_staticmap(matches[1]) -- Send the actual location, is a google maps link send_location(receiver, lat, lng, ok_cb, false) -- Send a picture of the map, which takes scale into account send_photo_from_url(receiver, url) -- Return a link to the google maps stuff is now not needed anymore return nil end return { description = "Get Man Location by Name", usage = "/خريطه (name) : get map and location", patterns = {"^خريطه (.*)$"}, run = run } end
gpl-2.0
Ninjistix/darkstar
scripts/zones/Lower_Jeuno/npcs/Zauko.lua
3
5417
----------------------------------- -- Area: Lower Jeuno -- NPC: Zauko -- Involved in Quests: Save the Clock Tower, Community Service -- @zone 245 -- !pos -3 0 11 ----------------------------------- package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil; ----------------------------------- require("scripts/globals/keyitems"); require("scripts/globals/titles"); require("scripts/globals/settings"); require("scripts/globals/quests"); require("scripts/zones/Lower_Jeuno/NPCIDs"); require("scripts/zones/Lower_Jeuno/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) ----- Save The Clock Tower Quest ----- if (trade:hasItemQty(555,1) == true and trade:getItemCount() == 1) then a = player:getVar("saveTheClockTowerNPCz2"); -- NPC Zone2 if (a == 0 or (a ~= 256 and a ~= 288 and a ~= 320 and a ~= 384 and a ~= 768 and a ~= 352 and a ~= 896 and a ~= 416 and a ~= 832 and a ~= 448 and a ~= 800 and a ~= 480 and a ~= 864 and a ~= 928 and a ~= 960 and a ~= 992)) then player:startEvent(50,10 - player:getVar("saveTheClockTowerVar")); -- "Save the Clock Tower" Quest end end end; function onTrigger(player,npc) local hour = VanadielHour(); local playerOnQuestId = GetServerVariable("[JEUNO]CommService"); local doneCommService = (player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) == QUEST_COMPLETED) and 1 or 0; local currCommService = player:getVar("currCommService"); local hasMembershipCard = player:hasKeyItem(LAMP_LIGHTERS_MEMBERSHIP_CARD) and 1 or 0; local allLampsLit = true; for i=0,11 do local lamp = GetNPCByID(lampIdOffset + i); if lamp:getAnimation() == ANIMATION_CLOSE_DOOR then allLampsLit = false; break; end end -- debug output -- player:PrintToPlayer(string.format("pid=%i done=%i curr=%i card=%i lamps=%i",playerOnQuestId,doneCommService,currCommService,hasMembershipCard,allLampsLit and 1 or 0)); -- quest has already been accepted. if currCommService == 1 then if playerOnQuestId ~= player:getID() then player:startEvent(119); -- quest left over from previous day. fail quest. else if hour >= 20 and hour < 21 then player:startEvent(115); -- tell player it's too early to start lighting lamps. elseif allLampsLit then player:startEvent(117,doneCommService); -- all lamps are lit. win quest. elseif hour >= 21 or hour < 1 then player:startEvent(114); -- tell player they can start lighting lamps. else SetServerVariable("[JEUNO]CommService",-1); -- frees player from quest, but don't allow anyone else to take it today. player:startEvent(119); -- player didn't light lamps in time. fail quest. end end -- quest is available to player, nobody is currently on it, and the hour is right elseif player:getFameLevel(JEUNO) >= 1 and playerOnQuestId == 0 and (hour >= 20 or hour < 1) then player:startEvent(116,doneCommService); -- default dialog including option to drop membership card else player:startEvent(118,hasMembershipCard); end end; function onEventUpdate(player,csid,option) if csid == 116 and option == 0 then -- player accepts quest -- if nobody else has already been assigned to the quest, including Vhana, give it to this player local doneCommService = (player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) == QUEST_COMPLETED) and 1 or 0; local playerOnQuestId = GetServerVariable("[JEUNO]CommService"); local hour = VanadielHour(); if playerOnQuestId == 0 and (hour >= 20 or hour < 1) then -- nobody is currently on the quest SetServerVariable("[JEUNO]CommService",player:getID()); player:addQuest(JEUNO,COMMUNITY_SERVICE); player:setVar("currCommService",1); player:updateEvent(1,doneCommService); else -- either another player or vasha have been assigned the quest player:updateEvent(0,doneCommService); end end end; function onEventFinish(player,csid,option) -- ClockTower Quest -- if (csid == 50) then player:setVar("saveTheClockTowerVar",player:getVar("saveTheClockTowerVar") + 1); player:setVar("saveTheClockTowerNPCz2",player:getVar("saveTheClockTowerNPCz2") + 256); ---- Community Service Quest ---- elseif csid == 117 then if player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) ~= QUEST_COMPLETED then -- first victory player:addFame(JEUNO,30); else -- repeat victory. offer membership card. player:addFame(JEUNO, 15); if option == 1 then player:addKeyItem(LAMP_LIGHTERS_MEMBERSHIP_CARD); player:messageSpecial(KEYITEM_OBTAINED,LAMP_LIGHTERS_MEMBERSHIP_CARD); end end player:completeQuest(JEUNO,COMMUNITY_SERVICE); player:addTitle(TORCHBEARER); player:setVar("currCommService",0); elseif csid == 118 and option == 1 then -- player drops membership card player:delKeyItem(LAMP_LIGHTERS_MEMBERSHIP_CARD); elseif csid == 119 then -- player fails quest player:setVar("currCommService",0); end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Selbina/npcs/Zaldon.lua
5
72546
----------------------------------- -- Area: Selbina -- NPC: Zaldon -- Involved in Quests: Under the sea, A Boy's Dream -- Starts and Finishes: Inside the Belly -- !pos -13 -7 -5 248 ----------------------------------- package.loaded["scripts/zones/Selbina/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Selbina/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(OTHER_AREAS,UNDER_THE_SEA) == QUEST_ACCEPTED and player:hasKeyItem(ETCHED_RING) == false) then if (trade:hasItemQty(4501,1) == true and trade:getItemCount() == 1) then rand = math.random(1,5); if (rand == 3) then player:startEvent(35); -- Ring found ! else player:startEvent(36); -- Ring not found... end end elseif (player:getVar("aBoysDreamCS") == 5 and trade:hasItemQty(4562,1) == true and trade:getItemCount() == 1) then player:startEvent(85); -- CS for the quest "A Boy's Dream" ------------------------- -- Begin Inside the Belly ------------------------- elseif (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED or player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_COMPLETED) then if (trade:hasItemQty(5455,1) == true and trade:getItemCount() == 1) then -- Ahtapot rand = math.random(1,1000); if (rand > 1 and rand <= 107) then -- 10.7% chance player:setVar("ItB_Var",1); player:startEvent(166,0,2886); -- Mildewy Ingot elseif (rand > 107 and rand <= 301) then -- 19.4% chance player:setVar("ItB_Var",2); player:startEvent(166,0,2887); -- Decayed Ingot else player:setVar("ItB_Var",3); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4316,1) == true and trade:getItemCount() == 1) then -- Armored Pisces rand = math.random(1,1000); if (rand >= 1 and rand <= 4) then -- 0.4% chance player:setVar("ItB_Var",4); player:startEvent(166,0,13736); -- Stolid Breastplate else player:setVar("ItB_Var",5); player:startEvent(167); -- Gil Only end ----------- This section designed to conform to data found at http://wiki.ffxiclopedia.org/wiki/Inside_the_Belly regarding Drop Rates of Charts -- elseif (trade:hasItemQty(4479,1) == true and trade:getItemCount() == 1) then -- Bhefhel Marlin rand = math.random(1,1000); if (rand >= 1 and rand <= 143 and player:hasItem(1873) == false) then -- 14.3% chance player:setVar("ItB_Var",6); player:startEvent(166,0,1873); -- Brigand's Chart elseif (rand > 143 and rand <= 187 and player:hasItem(1874) == false) then -- 4.4% chance player:setVar("ItB_Var",7); player:startEvent(166,0,1874); -- Pirate's Chart else player:setVar("ItB_Var",8); player:startEvent(167); -- Gil Only end ------------------------------------------------------------------------------------------------------------------------------------------------- elseif (trade:hasItemQty(4471,1) == true and trade:getItemCount() == 1) then -- Bladefish rand = math.random(1,1000); if (rand >= 1 and rand <= 109) then -- 10.9% chance player:setVar("ItB_Var",9); player:startEvent(166,0,17002); -- Robber Rig else player:setVar("ItB_Var",10); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4309,1) == true and trade:getItemCount() == 1) then -- Cave Cherax rand = math.random(1,1000); if (rand >= 1 and rand <= 237) then -- 23.7% chance player:setVar("ItB_Var",11); player:startEvent(166,0,17007); -- Dwarf Pugil else player:setVar("ItB_Var",12); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5814,1) == true and trade:getItemCount() == 1) then -- Crocodilos rand = math.random(1,1000); if (rand >= 1 and rand <= 30) then -- 3.0% chance player:setVar("ItB_Var",13); player:startEvent(166,0,11654); -- Puffin Ring else player:setVar("ItB_Var",14); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4428,1) == true and trade:getItemCount() == 1) then -- Dark Bass rand = math.random(1,1000); if (rand >= 1 and rand <= 46) then -- 4.6% chance player:setVar("ItB_Var",15); player:startEvent(166,0,772); -- Green Rock else player:setVar("ItB_Var",16); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4454,1) == true and trade:getItemCount() == 1) then -- Emperor Fish rand = math.random(1,1000); if (rand >= 1 and rand <= 10) then -- 1.0% chance; The wiki says 0%... player:setVar("ItB_Var",17); player:startEvent(166,0,12955); -- Cuir Highboots else player:setVar("ItB_Var",18); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4477,1) == true and trade:getItemCount() == 1) then -- Gavial Fish rand = math.random(1,1000); if (rand >= 1 and rand <= 50) then -- 5.0% chance player:setVar("ItB_Var",19); player:startEvent(166,0,13361); -- Drone Earring else player:setVar("ItB_Var",20); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5471,1) == true and trade:getItemCount() == 1) then -- Gerrothorax rand = math.random(1,1000); if (rand >= 1 and rand <= 12) then -- 1.2% chance player:setVar("ItB_Var",21); player:startEvent(166,0,11492); -- Risky Patch else player:setVar("ItB_Var",22); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5799,1) == true and trade:getItemCount() == 1) then -- Giant Catfish rand = math.random(1,1000); if (rand >= 1 and rand <= 66) then -- 6.6% chance player:setVar("ItB_Var",23); player:startEvent(166,0,17076); -- Earth Wand else player:setVar("ItB_Var",24); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4308,1) == true and trade:getItemCount() == 1) then -- Giant Chirai rand = math.random(1,1000); if (rand >= 1 and rand <= 12) then -- 1.2% chance player:setVar("ItB_Var",25); player:startEvent(166,0,1278); -- Spool of Twinthread else player:setVar("ItB_Var",26); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4306,1) == true and trade:getItemCount() == 1) then -- Giant Donko rand = math.random(1,1000); if (rand >= 1 and rand <= 48) then -- 4.8% chance player:setVar("ItB_Var",27); player:startEvent(166,0,1833); -- Broken Halcyon Fishing Rod else player:setVar("ItB_Var",28); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5475,1) == true and trade:getItemCount() == 1) then -- Gigant Octopus rand = math.random(1,1000); if (rand >= 1 and rand <= 100) then -- 10.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",29); player:startEvent(166,0,929); -- Jar of Black Ink else player:setVar("ItB_Var",30); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4474,1) == true and trade:getItemCount() == 1) then -- Gigant Squid rand = math.random(1,1000); if (rand >= 1 and rand <= 25) then -- 2.5% chance; The wiki has an unknown percentage player:setVar("ItB_Var",31); player:startEvent(166,0,12317); -- Flame shield else player:setVar("ItB_Var",32); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4304,1) == true and trade:getItemCount() == 1) then -- Grimmonite rand = math.random(1,1000); if (rand >= 1 and rand <= 50) then -- 5.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",33); player:startEvent(166,0,13456); -- Silver Ring else player:setVar("ItB_Var",34); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5127,1) == true and trade:getItemCount() == 1) then -- Gugrusaurus rand = math.random(1,1000); if (rand >= 1 and rand <= 4) then -- 0.4% chance player:setVar("ItB_Var",35); player:startEvent(166,0,1837); -- Saber Shoot else player:setVar("ItB_Var",36); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4480,1) == true and trade:getItemCount() == 1) then -- Gugru Tuna rand = math.random(1,1000); if (rand >= 1 and rand <= 50) then -- 5.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",37); player:startEvent(166,0,19186); -- Tiny Tathlum else player:setVar("ItB_Var",38); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5136,1) == true and trade:getItemCount() == 1) then -- Istavrit rand = math.random(1,1000); if (rand >= 1 and rand <= 100) then -- 10.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",39); player:startEvent(166,0,944); -- Pinch of Venom Dust else player:setVar("ItB_Var",40); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4307,1) == true and trade:getItemCount() == 1) then -- Jungle Catfish rand = math.random(1,1000); if (rand >= 1 and rand <= 30) then -- 3.0% chance player:setVar("ItB_Var",41); player:startEvent(166,0,1832); -- Broken Hume Fishing Rod else player:setVar("ItB_Var",42); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5140,1) == true and trade:getItemCount() == 1) then -- Kalkanbaligi rand = math.random(1,1000); if (rand >= 1 and rand <= 33) then -- 3.3% chance player:setVar("ItB_Var",43); player:startEvent(166,0,16184); -- Flat Shield else player:setVar("ItB_Var",44); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5451,1) == true and trade:getItemCount() == 1) then -- Kilicbaligi rand = math.random(1,1000); if (rand >= 1 and rand <= 25) then -- 2.5% chance; The wiki has an unknown percentage player:setVar("ItB_Var",45); player:startEvent(166,0,16606); -- Rusty Greatsword else player:setVar("ItB_Var",46); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5450,1) == true and trade:getItemCount() == 1) then -- Lakerda rand = math.random(1,1000); if (rand >= 1 and rand <= 19) then -- 1.9% chance player:setVar("ItB_Var",47); player:startEvent(166,0,793); -- Black Pearl elseif (rand >= 20 and rand <= 69) then -- 5.0% chance; The wiki has an unknown percentage, but pearl should be greater than black pearl player:setVar("ItB_Var",48); player:startEvent(166,0,792); -- Pearl else player:setVar("ItB_Var",49); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5129,1) == true and trade:getItemCount() == 1) then -- Lik rand = math.random(1,1000); if (rand >= 1 and rand <= 5) then -- 0.5% chance player:setVar("ItB_Var",50); player:startEvent(166,0,1826); -- Spool of Opal Silk else player:setVar("ItB_Var",51); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5467,1) == true and trade:getItemCount() == 1) then -- Megalodon rand = math.random(1,1000); if (rand >= 1 and rand <= 30) then -- 3.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",52); player:startEvent(166,0,483); -- Broken Mithran Fishing Rod else player:setVar("ItB_Var",53); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4462,1) == true and trade:getItemCount() == 1) then -- Monke-Onke rand = math.random(1,1000); if (rand >= 1 and rand <= 100) then -- 10.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",54); player:startEvent(166,0,943); -- Pinch of Poison Dust else player:setVar("ItB_Var",55); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5134,1) == true and trade:getItemCount() == 1) then -- Mola Mola rand = math.random(1,1000); if (rand >= 1 and rand <= 18) then -- 1.8% chance player:setVar("ItB_Var",56); player:startEvent(166,0,16850); -- Mercurial Spear else player:setVar("ItB_Var",57); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4481,1) == true and trade:getItemCount() == 1) then -- Ogre Eel rand = math.random(1,1000); if (rand >= 1 and rand <= 25) then -- 2.5% chance player:setVar("ItB_Var",58); player:startEvent(166,0,13480); -- Turquoise Ring else player:setVar("ItB_Var",59); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5815,1) == true and trade:getItemCount() == 1) then -- Pelazoea rand = math.random(1,1000); if (rand >= 1 and rand <= 16) then -- 1.6% chance player:setVar("ItB_Var",60); player:startEvent(166,0,11655); -- Noddy Ring else player:setVar("ItB_Var",61); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5470,1) == true and trade:getItemCount() == 1) then -- Pirarucu rand = math.random(1,1000); if (rand >= 1 and rand <= 50) then -- 5.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",62); player:startEvent(166,0,1122); -- Wyvern Skin elseif (rand >= 51 and rand <= 75) then -- 2.5% chance; The wiki has an unknown percentage player:setVar("ItB_Var",63); player:startEvent(166,0,2523); -- Peiste Skin else player:setVar("ItB_Var",64); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5133,1) == true and trade:getItemCount() == 1) then -- Pterygotus rand = math.random(1,1000); if (rand >= 1 and rand <= 68) then -- 6.8% chance player:setVar("ItB_Var",65); player:startEvent(166,0,795); -- Lapis Lazuli else player:setVar("ItB_Var",66); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5135,1) == true and trade:getItemCount() == 1) then -- Rhinochimera rand = math.random(1,1000); if (rand >= 1 and rand <= 13) then -- 1.3% chance player:setVar("ItB_Var",67); player:startEvent(166,0,11624); -- Solon Torque else player:setVar("ItB_Var",68); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4305,1) == true and trade:getItemCount() == 1) then -- Ryugu Titan rand = math.random(1,1000); if (rand >= 1 and rand <= 13) then -- 1.3% chance player:setVar("ItB_Var",69); player:startEvent(166,0,18377); -- Mercurial Sword else player:setVar("ItB_Var",70); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4475,1) == true and trade:getItemCount() == 1) then -- Sea Zombie rand = math.random(1,1000); if (rand >= 1 and rand <= 238) then -- 23.8% chance player:setVar("ItB_Var",71); player:startEvent(166,0,17006); -- Drill Calamary else player:setVar("ItB_Var",72); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4451,1) == true and trade:getItemCount() == 1) then -- Silver Shark rand = math.random(1,1000); if (rand >= 1 and rand <= 13) then -- 1.3% chance player:setVar("ItB_Var",73); player:startEvent(166,0,16837); -- Trident else player:setVar("ItB_Var",74); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4463,1) == true and trade:getItemCount() == 1) then -- Takitaro rand = math.random(1,1000); if (rand >= 1 and rand <= 22) then -- 2.2% chance player:setVar("ItB_Var",75); player:startEvent(166,0,942); -- Philosopher's Stone else player:setVar("ItB_Var",76); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4478,1) == true and trade:getItemCount() == 1) then -- Three-eyed Fish rand = math.random(1,1000); if (rand >= 1 and rand <= 100) then -- 10.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",77); player:startEvent(166,0,945); -- Pinch of Paralysis Dust else player:setVar("ItB_Var",78); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5120,1) == true and trade:getItemCount() == 1) then -- Titanic Sawfish rand = math.random(1,1000); if (rand >= 1 and rand <= 7) then -- 0.7% chance player:setVar("ItB_Var",79); player:startEvent(166,0,19290); -- Aizenkunitoshi else player:setVar("ItB_Var",80); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4476,1) == true and trade:getItemCount() == 1) then -- Titanictus rand = math.random(1,1000); if (rand >= 1 and rand <= 13) then -- 1.3% chance player:setVar("ItB_Var",81); player:startEvent(166,0,16533); -- Ancient Sword else player:setVar("ItB_Var",82); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4319,1) == true and trade:getItemCount() == 1) then -- Tricorn rand = math.random(1,1000); if (rand >= 1 and rand <= 40) then -- 4.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",83); player:startEvent(166,0,645); -- Chunk of Darksteel Ore else player:setVar("ItB_Var",84); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5137,1) == true and trade:getItemCount() == 1) then -- Turnabaligi rand = math.random(1,1000); if (rand >= 1 and rand <= 10) then -- 1.0% chance player:setVar("ItB_Var",85); player:startEvent(166,0,1262); -- Chunk of Dark Ore elseif (rand >= 11 and rand <= 24) then -- 1.4% chance player:setVar("ItB_Var",86); player:startEvent(166,0,1256); -- Chunk of Ice Ore elseif (rand >= 25 and rand <= 38) then -- 1.4% chance player:setVar("ItB_Var",87); player:startEvent(166,0,1260); -- Chunk of Water Ore else player:setVar("ItB_Var",88); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5141,1) == true and trade:getItemCount() == 1) then -- Veydal Wrasse rand = math.random(1,1000); if (rand >= 1 and rand <= 50) then -- 5.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",89); player:startEvent(166,0,4361); -- Nebimonite elseif (rand >= 51 and rand <= 100) then -- 5.0% chance; The wiki has an unknown percentage player:setVar("ItB_Var",90); player:startEvent(166,0,888); -- Seashell else player:setVar("ItB_Var",91); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(4385,1) == true and trade:getItemCount() == 1) then -- Zafmlug Bass rand = math.random(1,1000); if (rand >= 1 and rand <= 14) then -- 1.4% chance player:setVar("ItB_Var",92); player:startEvent(166,0,770); -- Blue Rock else player:setVar("ItB_Var",93); player:startEvent(167); -- Gil Only end elseif (trade:hasItemQty(5476,1) == true and trade:getItemCount() == 1) then -- Abaia rand = math.random(1,1000); if (rand >= 1 and rand <= 125) then -- 12.5% chance player:setVar("ItB_Var",94); player:startEvent(166,0,5818); -- Aurora Bass elseif (rand >= 126 and rand <= 204) then -- 7.8% chance player:setVar("ItB_Var",95); player:startEvent(166,0,5818); -- Aurora Bass x2 elseif (rand >= 205 and rand <= 230) then -- 2.5% chance player:setVar("ItB_Var",96); player:startEvent(166,0,5818); -- Aurora Bass x3 elseif (rand >= 231 and rand <= 238) then -- 0.7% chance player:setVar("ItB_Var",97); player:startEvent(166,0,10372); -- Plumb Boots else player:setVar("ItB_Var",98); player:startEvent (167); -- Gil Only end end end end; function onTrigger(player,npc) InsideTheBelly = player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY); TheRealGift = player:getQuestStatus(OTHER_AREAS,THE_REAL_GIFT); mLvl = player:getMainLvl(); -- This should be fishingLvl = player:getSkillLevel(SKILL_FISHING); but fishing doesn't work yet. if (player:getVar("underTheSeaVar") == 3) then player:startEvent(34,4501); -- During quest "Under the sea" - 3rd dialog elseif (mLvl >= 30 and TheRealGift == QUEST_COMPLETED and InsideTheBelly == QUEST_AVAILABLE) then -- This should be (fishingLvl >= 30) player:startEvent(161); elseif ((mLvl >= 30 and mLvl < 39) and (InsideTheBelly == QUEST_ACCEPTED or InsideTheBelly == QUEST_COMPLETED)) then -- This should be (fishingLvl >= 30 and fishingLvl < 39) player:startEvent(162,5799,4481,5802,4428); elseif ((mLvl >= 40 and mLvl < 49) and (InsideTheBelly == QUEST_ACCEPTED or InsideTheBelly == QUEST_COMPLETED)) then -- This should be (fishingLvl >= 40 and fishingLvl < 49) player:startEvent(163,5805,4385,5800,5802,5450); -- 5802(Istavrit) is skill cap 41, and therefore is used in this and the previous csid elseif ((mLvl >= 50 and mLvl <= 74) and (InsideTheBelly == QUEST_ACCEPTED or InsideTheBelly == QUEST_COMPLETED)) then -- This should be (fishingLvl >= 50 and fishingLvl < 75) player:startEvent(164,5806,5451,5801,5804,5807,5135); elseif (mLvl >= 75 and (InsideTheBelly == QUEST_ACCEPTED or InsideTheBelly == QUEST_COMPLETED)) then -- This should be (fishingLvl >= 75) player:startEvent(165,4451,4477,5803,4307,4478,5467,4304,4474); else player:startEvent(150); -- Standard dialog end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 34) then player:setVar("underTheSeaVar",4); elseif (csid == 36) then player:tradeComplete(); elseif (csid == 35) then player:addKeyItem(ETCHED_RING); player:messageSpecial(KEYITEM_OBTAINED,ETCHED_RING); player:tradeComplete(); elseif (csid == 85) then player:addKeyItem(KNIGHTS_BOOTS); player:messageSpecial(KEYITEM_OBTAINED,KNIGHTS_BOOTS); player:setVar("aBoysDreamCS",6); player:tradeComplete(); --------------------- Inside the Belly ----------------------------------------------------------------------------- elseif (csid == 161) then player:addQuest(OTHER_AREAS,INSIDE_THE_BELLY); -------------------------------------------------------------------------------------------------------------------- --------------------- Gil + Item(s) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------- elseif (csid == 166) then if (player:getVar("ItB_Var") == 1) then player:tradeComplete(); player:addItem(2886); player:messageSpecial(ITEM_OBTAINED,2886); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 2) then player:tradeComplete(); player:addItem(2887); player:messageSpecial(ITEM_OBTAINED,2887); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 4) then player:tradeComplete(); player:addItem(13736); player:messageSpecial(ITEM_OBTAINED,13736); player:addGil(GIL_RATE*475); player:messageSpecial(GIL_OBTAINED,GIL_RATE*475); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 6) then player:tradeComplete(); player:addItem(1873); player:messageSpecial(ITEM_OBTAINED,1873); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 7) then player:tradeComplete(); player:addItem(1874); player:messageSpecial(ITEM_OBTAINED,1874); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 9) then player:tradeComplete(); player:addItem(17002); player:messageSpecial(ITEM_OBTAINED,17002); player:addGil(GIL_RATE*200); player:messageSpecial(GIL_OBTAINED,GIL_RATE*200); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 11) then player:tradeComplete(); player:addItem(17007); player:messageSpecial(ITEM_OBTAINED,17007); player:addGil(GIL_RATE*800); player:messageSpecial(GIL_OBTAINED,GIL_RATE*800); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 13) then player:tradeComplete(); player:addItem(11654); player:messageSpecial(ITEM_OBTAINED,11654); player:addGil(GIL_RATE*1763); player:messageSpecial(GIL_OBTAINED,GIL_RATE*1763); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 15) then player:tradeComplete(); player:addItem(772); player:messageSpecial(ITEM_OBTAINED,772); player:addGil(GIL_RATE*10); player:messageSpecial(GIL_OBTAINED,GIL_RATE*10); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 17) then player:tradeComplete(); player:addItem(12955); player:messageSpecial(ITEM_OBTAINED,12955); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 19) then player:tradeComplete(); player:addItem(13361); player:messageSpecial(ITEM_OBTAINED,13361); player:addGil(GIL_RATE*250); player:messageSpecial(GIL_OBTAINED,GIL_RATE*250); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 21) then player:tradeComplete(); player:addItem(11492); player:messageSpecial(ITEM_OBTAINED,11492); player:addGil(GIL_RATE*423); player:messageSpecial(GIL_OBTAINED,GIL_RATE*423); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 23) then player:tradeComplete(); player:addItem(17076); player:messageSpecial(ITEM_OBTAINED,17076); player:addGil(GIL_RATE*50); player:messageSpecial(GIL_OBTAINED,GIL_RATE*50); player:addTitle(CORDON_BLEU_FISHER); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 25) then player:tradeComplete(); player:addItem(1278); player:messageSpecial(ITEM_OBTAINED,1278); player:addGil(GIL_RATE*550); player:messageSpecial(GIL_OBTAINED,GIL_RATE*550); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 27) then player:tradeComplete(); player:addItem(1833); player:messageSpecial(ITEM_OBTAINED,1833); player:addGil(GIL_RATE*96); player:messageSpecial(GIL_OBTAINED,GIL_RATE*96); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 29) then rand = math.random(1,6); player:tradeComplete(); player:addItem(929,rand); player:messageSpecial(ITEM_OBTAINED,929,rand); player:addGil(GIL_RATE*119); player:messageSpecial(GIL_OBTAINED,GIL_RATE*119); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 31) then player:tradeComplete(); player:addItem(12317); player:messageSpecial(ITEM_OBTAINED,12317); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 33) then player:tradeComplete(); player:addItem(13456); player:messageSpecial(ITEM_OBTAINED,13456); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 35) then player:tradeComplete(); player:addItem(1837); player:messageSpecial(ITEM_OBTAINED,1837); player:addGil(GIL_RATE*880); player:messageSpecial(GIL_OBTAINED,GIL_RATE*880); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 37) then player:tradeComplete(); player:addItem(19186); player:messageSpecial(ITEM_OBTAINED,19186); player:addGil(GIL_RATE*50); player:messageSpecial(GIL_OBTAINED,GIL_RATE*50); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 39) then rand = math.random(1,6); player:tradeComplete(); player:addItem(944,rand); player:messageSpecial(ITEM_OBTAINED,944,rand); player:addGil(GIL_RATE*50); player:messageSpecial(GIL_OBTAINED,GIL_RATE*50); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 41) then player:tradeComplete(); player:addItem(1832); player:messageSpecial(ITEM_OBTAINED,1832); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 43) then player:tradeComplete(); player:addItem(16184); player:messageSpecial(ITEM_OBTAINED,16184); player:addGil(GIL_RATE*390); player:messageSpecial(GIL_OBTAINED,GIL_RATE*390); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 45) then player:tradeComplete(); player:addItem(16606); player:messageSpecial(ITEM_OBTAINED,16606); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 47) then player:tradeComplete(); player:addItem(793); player:messageSpecial(ITEM_OBTAINED,793); player:addGil(GIL_RATE*51); player:messageSpecial(GIL_OBTAINED,GIL_RATE*51); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 48) then player:tradeComplete(); player:addItem(792); player:messageSpecial(ITEM_OBTAINED,792); player:addGil(GIL_RATE*51); player:messageSpecial(GIL_OBTAINED,GIL_RATE*51); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 50) then player:tradeComplete(); player:addItem(1826); player:messageSpecial(ITEM_OBTAINED,1826); player:addGil(GIL_RATE*880); player:messageSpecial(GIL_OBTAINED,GIL_RATE*880); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 52) then player:tradeComplete(); player:addItem(483); player:messageSpecial(ITEM_OBTAINED,483); player:addGil(GIL_RATE*532); player:messageSpecial(GIL_OBTAINED,GIL_RATE*532); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 54) then rand = math.random(1,6); player:tradeComplete(); player:addItem(943,rand); player:messageSpecial(ITEM_OBTAINED,943,rand); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 56) then player:tradeComplete(); player:addItem(16850); player:messageSpecial(ITEM_OBTAINED,16850); player:addGil(GIL_RATE*478); player:messageSpecial(GIL_OBTAINED,GIL_RATE*478); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 58) then player:tradeComplete(); player:addItem(13480); player:messageSpecial(ITEM_OBTAINED,13480); player:addGil(GIL_RATE*16); player:messageSpecial(GIL_OBTAINED,GIL_RATE*16); player:addTitle(CORDON_BLEU_FISHER); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 60) then player:tradeComplete(); player:addItem(11655); player:messageSpecial(ITEM_OBTAINED,11655); player:addGil(GIL_RATE*360); player:messageSpecial(GIL_OBTAINED,GIL_RATE*360); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 62) then player:tradeComplete(); player:addItem(1122); player:messageSpecial(ITEM_OBTAINED,1122); player:addGil(GIL_RATE*516); player:messageSpecial(GIL_OBTAINED,GIL_RATE*516); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 63) then player:tradeComplete(); player:addItem(11655); player:messageSpecial(ITEM_OBTAINED,2523); player:addGil(GIL_RATE*516); player:messageSpecial(GIL_OBTAINED,GIL_RATE*516); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 65) then player:tradeComplete(); player:addItem(795); player:messageSpecial(ITEM_OBTAINED,795); player:addGil(GIL_RATE*390); player:messageSpecial(GIL_OBTAINED,GIL_RATE*390); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 67) then player:tradeComplete(); player:addItem(11624); player:messageSpecial(ITEM_OBTAINED,11624); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 69) then player:tradeComplete(); player:addItem(18377); player:messageSpecial(ITEM_OBTAINED,18377); player:addGil(GIL_RATE*800); player:messageSpecial(GIL_OBTAINED,GIL_RATE*800); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 71) then player:tradeComplete(); player:addItem(17006); player:messageSpecial(ITEM_OBTAINED,17006); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 73) then player:tradeComplete(); player:addItem(16837); player:messageSpecial(ITEM_OBTAINED,16837); player:addGil(GIL_RATE*250); player:messageSpecial(GIL_OBTAINED,GIL_RATE*250); player:addTitle(ACE_ANGLER); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 75) then player:tradeComplete(); player:addItem(942); player:messageSpecial(ITEM_OBTAINED,942); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 77) then rand = math.random(1,10); player:tradeComplete(); player:addItem(945,rand); player:messageSpecial(ITEM_OBTAINED,945,rand); player:addGil(GIL_RATE*250); player:messageSpecial(GIL_OBTAINED,GIL_RATE*250); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 79) then player:tradeComplete(); player:addItem(19290); player:messageSpecial(ITEM_OBTAINED,19290); player:addGil(GIL_RATE*810); player:messageSpecial(GIL_OBTAINED,GIL_RATE*810); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 81) then player:tradeComplete(); player:addItem(16533); player:messageSpecial(ITEM_OBTAINED,16533); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:addTitle(LU_SHANGLIKE_FISHER_KING); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 83) then player:tradeComplete(); player:addItem(645); player:messageSpecial(ITEM_OBTAINED,645); player:addGil(GIL_RATE*810); player:messageSpecial(GIL_OBTAINED,GIL_RATE*810); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 85) then player:tradeComplete(); player:addItem(1262); player:messageSpecial(ITEM_OBTAINED,1262); player:addGil(GIL_RATE*340); player:messageSpecial(GIL_OBTAINED,GIL_RATE*340); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 86) then player:tradeComplete(); player:addItem(1256); player:messageSpecial(ITEM_OBTAINED,1256); player:addGil(GIL_RATE*340); player:messageSpecial(GIL_OBTAINED,GIL_RATE*340); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 87) then player:tradeComplete(); player:addItem(1260); player:messageSpecial(ITEM_OBTAINED,1260); player:addGil(GIL_RATE*340); player:messageSpecial(GIL_OBTAINED,GIL_RATE*340); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 89) then player:tradeComplete(); player:addItem(4361); player:messageSpecial(ITEM_OBTAINED,4361); player:addGil(GIL_RATE*225); player:messageSpecial(GIL_OBTAINED,GIL_RATE*225); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 90) then player:tradeComplete(); player:addItem(888); player:messageSpecial(ITEM_OBTAINED,888); player:addGil(GIL_RATE*225); player:messageSpecial(GIL_OBTAINED,GIL_RATE*225); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 92) then player:tradeComplete(); player:addItem(770); player:messageSpecial(ITEM_OBTAINED,770); player:addGil(GIL_RATE*15); player:messageSpecial(GIL_OBTAINED,GIL_RATE*15); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 94) then player:tradeComplete(); player:addItem(5818); player:messageSpecial(ITEM_OBTAINED,5818); player:addGil(GIL_RATE*960); player:messageSpecial(GIL_OBTAINED,GIL_RATE*960); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 95) then player:tradeComplete(); player:addItem(5818,2); player:messageSpecial(ITEM_OBTAINED,5818); player:messageSpecial(ITEM_OBTAINED,5818); player:addGil(GIL_RATE*960); player:messageSpecial(GIL_OBTAINED,GIL_RATE*960); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 96) then player:tradeComplete(); player:addItem(5818,3); player:messageSpecial(ITEM_OBTAINED,5818); player:messageSpecial(ITEM_OBTAINED,5818); player:messageSpecial(ITEM_OBTAINED,5818); player:addGil(GIL_RATE*960); player:messageSpecial(GIL_OBTAINED,GIL_RATE*960); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 97) then player:tradeComplete(); player:addItem(10372); player:messageSpecial(ITEM_OBTAINED,10372); player:addGil(GIL_RATE*960); player:messageSpecial(GIL_OBTAINED,GIL_RATE*960); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end end -------------------------------------------------------------------------------------------------------------------- ------------------------------------- Gil Only --------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------- elseif (csid == 167) then if (player:getVar("ItB_Var") == 3) then player:tradeComplete(); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 5) then player:tradeComplete(); player:addGil(GIL_RATE*475); player:messageSpecial(GIL_OBTAINED,GIL_RATE*475); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 8) then player:tradeComplete(); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 10) then player:tradeComplete(); player:addGil(GIL_RATE*200); player:messageSpecial(GIL_OBTAINED,GIL_RATE*200); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 12) then player:tradeComplete(); player:addGil(GIL_RATE*800); player:messageSpecial(GIL_OBTAINED,GIL_RATE*800); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 14) then player:tradeComplete(); player:addGil(GIL_RATE*1763); player:messageSpecial(GIL_OBTAINED,GIL_RATE*1763); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 16) then player:tradeComplete(); player:addGil(GIL_RATE*10); player:messageSpecial(GIL_OBTAINED,GIL_RATE*10); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 18) then player:tradeComplete(); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 20) then player:tradeComplete(); player:addGil(GIL_RATE*250); player:messageSpecial(GIL_OBTAINED,GIL_RATE*250); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 22) then player:tradeComplete(); player:addGil(GIL_RATE*423); player:messageSpecial(GIL_OBTAINED,GIL_RATE*423); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 24) then player:tradeComplete(); player:addGil(GIL_RATE*50); player:messageSpecial(GIL_OBTAINED,GIL_RATE*50); player:setVar("ItB_Var",0); player:addTitle(CORDON_BLEU_FISHER); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 26) then player:tradeComplete(); player:addGil(GIL_RATE*550); player:messageSpecial(GIL_OBTAINED,GIL_RATE*550); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 28) then player:tradeComplete(); player:addGil(GIL_RATE*96); player:messageSpecial(GIL_OBTAINED,GIL_RATE*96); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 30) then player:tradeComplete(); player:addGil(GIL_RATE*119); player:messageSpecial(GIL_OBTAINED,GIL_RATE*119); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 32) then player:tradeComplete(); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 34) then player:tradeComplete(); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 36) then player:tradeComplete(); player:addGil(GIL_RATE*880); player:messageSpecial(GIL_OBTAINED,GIL_RATE*880); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 38) then player:tradeComplete(); player:addGil(GIL_RATE*50); player:messageSpecial(GIL_OBTAINED,GIL_RATE*50); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 40) then player:tradeComplete(); player:addGil(GIL_RATE*50); player:messageSpecial(GIL_OBTAINED,GIL_RATE*50); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 42) then player:tradeComplete(); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 44) then player:tradeComplete(); player:addGil(GIL_RATE*390); player:messageSpecial(GIL_OBTAINED,GIL_RATE*390); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 46) then player:tradeComplete(); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 49) then player:tradeComplete(); player:addGil(GIL_RATE*51); player:messageSpecial(GIL_OBTAINED,GIL_RATE*51); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 51) then player:tradeComplete(); player:addGil(GIL_RATE*880); player:messageSpecial(GIL_OBTAINED,GIL_RATE*880); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 53) then player:tradeComplete(); player:addGil(GIL_RATE*532); player:messageSpecial(GIL_OBTAINED,GIL_RATE*532); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 55) then player:tradeComplete(); player:addGil(GIL_RATE*150); player:messageSpecial(GIL_OBTAINED,GIL_RATE*150); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 57) then player:tradeComplete(); player:addGil(GIL_RATE*478); player:messageSpecial(GIL_OBTAINED,GIL_RATE*478); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 59) then player:tradeComplete(); player:addGil(GIL_RATE*16); player:messageSpecial(GIL_OBTAINED,GIL_RATE*16); player:addTitle(CORDON_BLEU_FISHER); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 61) then player:tradeComplete(); player:addGil(GIL_RATE*360); player:messageSpecial(GIL_OBTAINED,GIL_RATE*360); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 64) then player:tradeComplete(); player:addGil(GIL_RATE*516); player:messageSpecial(GIL_OBTAINED,GIL_RATE*516); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 66) then player:tradeComplete(); player:addGil(GIL_RATE*390); player:messageSpecial(GIL_OBTAINED,GIL_RATE*390); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 68) then player:tradeComplete(); player:addGil(GIL_RATE*300); player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 70) then player:tradeComplete(); player:addGil(GIL_RATE*800); player:messageSpecial(GIL_OBTAINED,GIL_RATE*800); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 72) then player:tradeComplete(); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 74) then player:tradeComplete(); player:addGil(GIL_RATE*250); player:messageSpecial(GIL_OBTAINED,GIL_RATE*250); player:addTitle(ACE_ANGLER); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 76) then player:tradeComplete(); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 78) then player:tradeComplete(); player:addGil(GIL_RATE*250); player:messageSpecial(GIL_OBTAINED,GIL_RATE*250); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 80) then player:tradeComplete(); player:addGil(GIL_RATE*810); player:messageSpecial(GIL_OBTAINED,GIL_RATE*810); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 82) then player:tradeComplete(); player:addGil(GIL_RATE*350); player:messageSpecial(GIL_OBTAINED,GIL_RATE*350); player:addTitle(LU_SHANGLIKE_FISHER_KING); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 84) then player:tradeComplete(); player:addGil(GIL_RATE*810); player:messageSpecial(GIL_OBTAINED,GIL_RATE*810); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 88) then player:tradeComplete(); player:addGil(GIL_RATE*340); player:messageSpecial(GIL_OBTAINED,GIL_RATE*340); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 91) then player:tradeComplete(); player:addGil(GIL_RATE*225); player:messageSpecial(GIL_OBTAINED,GIL_RATE*225); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 93) then player:tradeComplete(); player:addGil(GIL_RATE*15); player:messageSpecial(GIL_OBTAINED,GIL_RATE*15); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end elseif (player:getVar("ItB_Var") == 98) then player:tradeComplete(); player:addGil(GIL_RATE*960); player:messageSpecial(GIL_OBTAINED,GIL_RATE*960); player:setVar("ItB_Var",0); if (player:getQuestStatus(OTHER_AREAS,INSIDE_THE_BELLY) == QUEST_ACCEPTED) then player:completeQuest(OTHER_AREAS,INSIDE_THE_BELLY); end end end end;
gpl-3.0
istarIQ/Source
anti_spam.lua
21
5248
--An empty table for solving multiple kicking problem(thanks to @topkecleon ) kicktable = {} do local TIME_CHECK = 2 -- seconds -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then return msg end if msg.from.id == our_id then return msg end -- Save user on Redis if msg.from.type == 'user' then local hash = 'user:'..msg.from.id print('Saving user', hash) if msg.from.print_name then redis:hset(hash, 'print_name', msg.from.print_name) end if msg.from.first_name then redis:hset(hash, 'first_name', msg.from.first_name) end if msg.from.last_name then redis:hset(hash, 'last_name', msg.from.last_name) end end -- Save stats on Redis if msg.to.type == 'chat' then -- User is on chat local hash = 'chat:'..msg.to.id..':users' redis:sadd(hash, msg.from.id) end -- Save stats on Redis if msg.to.type == 'channel' then -- User is on channel local hash = 'channel:'..msg.to.id..':users' redis:sadd(hash, msg.from.id) end if msg.to.type == 'user' then -- User is on chat local hash = 'PM:'..msg.from.id redis:sadd(hash, msg.from.id) end -- Total user msgs local hash = 'msgs:'..msg.from.id..':'..msg.to.id redis:incr(hash) --Load moderation data local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then --Check if flood is on or off if data[tostring(msg.to.id)]['settings']['flood'] == 'no' then return msg end end -- Check flood if msg.from.type == 'user' then local hash = 'user:'..msg.from.id..':msgs' local msgs = tonumber(redis:get(hash) or 0) local data = load_data(_config.moderation.data) local NUM_MSG_MAX = 5 if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings']['flood_msg_max'] then NUM_MSG_MAX = tonumber(data[tostring(msg.to.id)]['settings']['flood_msg_max'])--Obtain group flood sensitivity end end local max_msg = NUM_MSG_MAX * 1 if msgs > max_msg then local user = msg.from.id local chat = msg.to.id local whitelist = "whitelist" local is_whitelisted = redis:sismember(whitelist, user) -- Ignore mods,owner and admins if is_momod(msg) then return msg end if is_whitelisted == true then return msg end local receiver = get_receiver(msg) if msg.to.type == 'user' then local max_msg = 7 * 1 print(msgs) if msgs >= max_msg then print("Pass2") send_large_msg("user#id"..msg.from.id, "User ["..msg.from.id.."] blocked for spam.") savelog(msg.from.id.." PM", "User ["..msg.from.id.."] blocked for spam.") block_user("user#id"..msg.from.id,ok_cb,false)--Block user if spammed in private end end if kicktable[user] == true then return end delete_msg(msg.id, ok_cb, false) kick_user(user, chat) local username = msg.from.username local print_name = user_print_name(msg.from):gsub("‮", "") local name_log = print_name:gsub("_", "") if msg.to.type == 'chat' or msg.to.type == 'channel' then if username then savelog(msg.to.id, name_log.." @"..username.." ["..msg.from.id.."] kicked for #spam") send_large_msg(receiver , "ممنوع التكرار\n@"..username.."["..msg.from.id.."]\n") else savelog(msg.to.id, name_log.." ["..msg.from.id.."] kicked for #spam") send_large_msg(receiver , "ممنوع التكرار \nName:"..name_log.."["..msg.from.id.."]\n") end end -- incr it on redis local gbanspam = 'gban:spam'..msg.from.id redis:incr(gbanspam) local gbanspam = 'gban:spam'..msg.from.id local gbanspamonredis = redis:get(gbanspam) --Check if user has spammed is group more than 4 times if gbanspamonredis then if tonumber(gbanspamonredis) == 4 and not is_owner(msg) then --Global ban that user banall_user(msg.from.id) local gbanspam = 'gban:spam'..msg.from.id --reset the counter redis:set(gbanspam, 0) if msg.from.username ~= nil then username = msg.from.username else username = "---" end local print_name = user_print_name(msg.from):gsub("‮", "") local name = print_name:gsub("_", "") --Send this to that chat send_large_msg("chat#id"..msg.to.id, "User [ "..name.." ]"..msg.from.id.." globally banned (spamming)") send_large_msg("channel#id"..msg.to.id, "User [ "..name.." ]"..msg.from.id.." globally banned (spamming)") local GBan_log = 'GBan_log' local GBan_log = data[tostring(GBan_log)] for k,v in pairs(GBan_log) do log_SuperGroup = v gban_text = "User [ "..name.." ] ( @"..username.." )"..msg.from.id.." Globally banned from ( "..msg.to.print_name.." ) [ "..msg.to.id.." ] (spamming)" --send it to log group/channel send_large_msg(log_SuperGroup, gban_text) end end end kicktable[user] = true msg = nil end redis:setex(hash, TIME_CHECK, msgs+1) end return msg end local function cron() --clear that table on the top of the plugins kicktable = {} end return { patterns = {}, cron = cron, pre_process = pre_process } end
gpl-2.0
TRex22/hawkthorne-journey
src/nodes/dealer.lua
1
1465
local Gamestate = require 'vendor/gamestate' local Prompt = require 'prompt' local fonts = require 'fonts' local Dealer = {} Dealer.__index = Dealer function Dealer.new(node, collider) local dealer = {} setmetatable(dealer, Dealer) dealer.x = node.x dealer.y = node.y dealer.height = node.height dealer.width = node.width dealer.bb = collider:addRectangle(node.x, node.y, node.width, node.height) dealer.bb.node = dealer collider:setPassive(dealer.bb) return dealer end function Dealer:enter(dt) fonts.reset() end function Dealer:update(dt) end function Dealer:draw() end function Dealer:keypressed( button, player ) if button == 'INTERACT' then player.freeze = true local message = {'Choose a card game to play'} local options = {'Poker', 'Blackjack', 'Exit'} if player.money == 0 then message = {'You dont have enough money!','Come back again...'} options = {'Exit'} end local callback = function(result) self.prompt = nil player.freeze = false if result == 'Poker' or result == 'Blackjack' then local screenshot = love.graphics.newImage( love.graphics.newScreenshot() ) Gamestate.switch(result:lower() .. 'game', player, screenshot) end end self.prompt = Prompt.new(message, callback, options) return true end end return Dealer
mit
eugenesan/openwrt-luci
modules/base/luasrc/http/protocol/date.lua
88
2760
--[[ HTTP protocol implementation for LuCI - date handling (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ ]]-- --- LuCI http protocol implementation - date helper class. -- This class contains functions to parse, compare and format http dates. module("luci.http.protocol.date", package.seeall) require("luci.sys.zoneinfo") MONTHS = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } --- Return the time offset in seconds between the UTC and given time zone. -- @param tz Symbolic or numeric timezone specifier -- @return Time offset to UTC in seconds function tz_offset(tz) if type(tz) == "string" then -- check for a numeric identifier local s, v = tz:match("([%+%-])([0-9]+)") if s == '+' then s = 1 else s = -1 end if v then v = tonumber(v) end if s and v then return s * 60 * ( math.floor( v / 100 ) * 60 + ( v % 100 ) ) -- lookup symbolic tz elseif luci.sys.zoneinfo.OFFSET[tz:lower()] then return luci.sys.zoneinfo.OFFSET[tz:lower()] end end -- bad luck return 0 end --- Parse given HTTP date string and convert it to unix epoch time. -- @param data String containing the date -- @return Unix epoch time function to_unix(date) local wd, day, mon, yr, hr, min, sec, tz = date:match( "([A-Z][a-z][a-z]), ([0-9]+) " .. "([A-Z][a-z][a-z]) ([0-9]+) " .. "([0-9]+):([0-9]+):([0-9]+) " .. "([A-Z0-9%+%-]+)" ) if day and mon and yr and hr and min and sec then -- find month local month = 1 for i = 1, 12 do if MONTHS[i] == mon then month = i break end end -- convert to epoch time return tz_offset(tz) + os.time( { year = yr, month = month, day = day, hour = hr, min = min, sec = sec } ) end return 0 end --- Convert the given unix epoch time to valid HTTP date string. -- @param time Unix epoch time -- @return String containing the formatted date function to_http(time) return os.date( "%a, %d %b %Y %H:%M:%S GMT", time ) end --- Compare two dates which can either be unix epoch times or HTTP date strings. -- @param d1 The first date or epoch time to compare -- @param d2 The first date or epoch time to compare -- @return -1 - if d1 is lower then d2 -- @return 0 - if both dates are equal -- @return 1 - if d1 is higher then d2 function compare(d1, d2) if d1:match("[^0-9]") then d1 = to_unix(d1) end if d2:match("[^0-9]") then d2 = to_unix(d2) end if d1 == d2 then return 0 elseif d1 < d2 then return -1 else return 1 end end
apache-2.0
EliasOenal/blobby
data/scripts/old/hyp011.lua
4
11754
g=0.28 pg=0.88 v0=14.5 v_p=4.5 pj=0.44 r1=31.5 p0=0 p1=0.5 p2=1 h=31.5+19+25 estt=0 nettime=0 touch=0 est=0 p=0.4 esto1=10 esto2=10 esto3=10 function yb(y,vy,t) return y+(vy-g/10)*t-1/2*g*t^2 end function move(x) if (posx()<x) and (math.abs(posx()-x)>2.26) then right() elseif (posx()>x) and (math.abs(posx()-x)>2.26) then left() end end function tb(y,vy,height,typ) local sgn=0 if (typ==1) then sgn=-1 else sgn=1 end if vy^2/g^2-vy/(5*g)+1/100+2*(y-height)/g<0 then return -1 else return -1/10+vy/g+sgn*math.sqrt( vy^2/g^2-vy/(5*g)+1/100+2*(y-height)/g ) end end function time(t) return 1/5*math.ceil(5*t) end function pos(x) local x1,x2 x1=4.5*math.ceil((1/4.5)*x) x2=4.5*math.floor((1/4.5)*x) if (x1<0) or (x2<0) then return 0 else if (math.abs(x1-x)<math.abs(x2-x)) then return x1 else return x2 end end end function yp(t) -- Eingabe: Position und Geschwindigkeit des Players, Zeitpunkt an dem man die y-Koordinate des Players wissen möchte -- Ausgabe: Höhe des Players nach der Zeit t return 144.5+(14.5+pj/2+pg/10)*t-1/2*(pg-pj)*t^2 end function tp(y) return (14.5+pj/2+pg/10)/(pg-pj)-math.sqrt(((14.5+pj/2+pg/10)/(pg-pj))^2-(y-144.5)/(1/2*(pg-pj))) end function tp2(y1p,v1p) if (y1p>146) then return (v1p/0.88-1/2+math.sqrt((v1p/0.88-1/2)^2-(144.5-y1p)/0.44)) else return 0 end end function time(t) return 1/5*math.ceil(5*t) end -- </Abschnitt 2> function collide(x,y,vx,vy,objx,objy,r2) local t1=time(math.max(tb(y,vy,objy-(r1+r2),1)-0.2,0)) local t2=time(tb(y,vy,objy+(r1+r2),1)+0.2) local t3=time(math.max(tb(y,vy,objy+(r1+r2),2)-0.2,0)) local t4=time(tb(y,vy,objy-(r1+r2),2)+0.2) local t=-1 if (t1<t2) then for testimate=t1,t2,0.2 do if ( (yb(y,vy,testimate)-objy)^2+(x+vx*testimate-objx)^2 < (r1+r2)^2) then t=testimate break end end end if (t<=0) and (t3<t4) then for testimate=t3,t4,0.2 do if ( (yb(y,vy,testimate)-objy)^2+(x+vx*testimate-objx)^2 < (r1+r2)^2) then t=testimate break end end end if (t<=0) or (t>150) then t=-1 end return t end function estimate(x,y,vx,vy,height,typ) local collision=1 local tw,tn,ts=0,0,0 local tr,xr,yr,vxr,vyr,n=0,0,0,0,0,0 while(collision==1) do ts=collide(x,y,vx,vy,400,316,7) if (vx>0) then tw=time((768.5-x)/vx) tn=time((361.5-x)/vx) else tw=time((31.5-x)/vx) tn=time((438.5-x)/vx) end local th=time(tb(y,vy,height,typ)) local t=10000 if ((ts>0) and (ts<t)) then t=ts end if (((tn>0) and (tn<t)) and (yb(y,vy,tn)<316)) then t=tn end if ((tw>0) and (tw<t)) then t=tw end if (th>t) then if (t==ts) then tr=tr+t x=x+vx*t y=yb(y,vy,t) vy=vy-g*t xr=x yr=y vxr=0 vyr=0 n=1 collision=0 elseif ((t==tn) or (t==tw)) then tr=tr+t x=x+vx*t y=yb(y,vy,t) vx=-vx vy=vy-g*t collision=1 end else tr=tr+th vxr=vx vyr=vy-g*th xr=x+vx*th yr=yb(y,vy,th) collision=0 end end if (tr<0) then return -1,-1,-1,-1,-1,-1 else return xr,yr,vxr,vyr,tr,n end end function impact(x,y,vx,vy,xpos,ypos,targety,jump,move) local x1,y1,vx1,vy1=0,0,0,0 local x2,y2,vx2,vy2,t2,nn=0,0,0,0,0,0 local xpos1=xpos local ypos1=ypos for t=0,20,0.2 do if (jump==1) then ypos1=yp(tp(ypos)+t) end x1=x+vx*t if (x1<31.5) then x1=2*31.5-x1 end if (x1>368.5) then x1=2*368.5-x1 end y1=yb(y,vy,t) if ((xpos1-x1)^2+(ypos1+19-y1)^2<(31.5+25)^2) then local dx=x1-xpos1 local dy=y1-(ypos1+19) local l=math.sqrt(dx^2+dy^2) vx1=dx/l vy1=dy/l x1=x1+vx1*3 y1=y1+vy1*3 vy1=vy1*13.125 vx1=vx1*13.125 x2,y2,vx2,vy2,t2,nn=estimate(x1,y1,vx1,vy1,targety,2) break end end return x2,y2,x1,y1,vx1,vy1 end function lob() if (math.abs(est-esto2)>0.2) then x1,y1,t1,x2,y2,t2,vx2,vy2,x1f,y1f,t1f,x2f,y2f,t2f,vx2f,vy2f,x1t,y1t,t1t,x2t,y2t,t2t,vx2t,vy2t=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 t2g=0 -- debug(-10) esto2=est imp=0 x1=0 t=30 while (t>=0) do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,_=estimate(x,y,vx,vy,y2f-vy2f/30,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) if (t1f+math.abs(tp2(posy(),vp))<t2f) and (t2g>1) and (t2f>1) and ((math.abs(posx()-(x2f+4.5))/4.5<t2f) or (math.abs(posx()-(x2f-15*4.5))/4.5<t2f)) then impf=0 for x1f=pos(x2f)-2*4.5,pos(x2f)-12*4.5,-4.5 do impo=impf impf,_,_,_,_,_=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) if (impf>730) and (math.abs(posx()-x1f)/4.5<t2f) and (x1f<360) and (x1f>0) then impt=impf x1t=x1f y1t=y1f t1t=t1f x2t=x2f y2t=y2f t2t=t2f vx2t=vx2f vy2t=vy2f break end if (impf<impo) then break end end if (impt>imp) then imp=impt x1=x1t y1=y1t t1=t1t x2=x2t y2=y2t t2=t2t vx2=vx2t vy2=vy2t end if (imp>740) then break end end if (t>12) then t=t-6 else t=t-4 end end t2=t2+1 end t2=t2-1 if (x1>0) then move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else move(est) --p=0.5 end end function attack() if (math.abs(est-esto1)>0.2) then x1,y1,t1,x2,y2,t2,vx2,vy2,x1f,y1f,t1f,x2f,y2f,t2f,vx2f,vy2f,x1t,y1t,t1t,x2t,y2t,t2t,vx2t,vy2t=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 t2g=0 h2=900 -- debug(-10) esto1=est imp=0 x1=0 t=30 while (t>=0) do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,_=estimate(x,y,vx,vy,y2f-vy2f/30,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) if (t1f+math.abs(tp2(posy(),vp))<t2f) and (t2g>1) and (t2f>1) and ((math.abs(posx()-(x2f+4.5))/4.5<t2f) or (math.abs(posx()-(x2f-15*4.5))/4.5<t2f)) then for x1f=pos(x2f)-17*4.5,pos(x2f)+4.5,4.5 do impf,_,xaf,yaf,vxaf,vyaf=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) if (impf>400) and (math.abs(posx()-x1f)/4.5+1<t2f) and (x1f>0) and (x1f<360) then impt=impf x1t=x1f y1t=y1f t1t=t1f x2t=x2f y2t=y2f t2t=t2f vx2t=vx2f vy2t=vy2f xat=xaf yat=yaf vxat=vxaf vyat=vyaf break end end h2t=yb(yat,vyat,(400-xat)/vxat) if (h2t<h2) and (h2t>316+31.5+10) then imp=impt x1=x1t y1=y1t t1=t1t x2=x2t y2=y2t t2=t2t vx2=vx2t vy2=vy2t xa=xat ya=yat vxa=vxat vya=vyat end h2=yb(ya,vya,(400-xa)/vxa) if (h2>316+31.5+10) and (h2<316+31.5+45) then break end end if (t>12) then t=t-6 else t=t-4 end end t2=t2+1 end t2=t2-1 if (x1>0) then move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else move(est) --p=0.9 end end function netp() if (math.abs(est-esto3)>0.2) then x1,y1,t1,x2,y2,t2,vx2,vy2,x1f,y1f,t1f,x2f,y2f,t2f,vx2f,vy2f,x1t,y1t,t1t,x2t,y2t,t2t,vx2t,vy2t=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 t2g=0 -- debug(-10) esto3=est imp=500 x1=0 for t=33,0,-3 do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,nn=estimate(x,y,vx,vy,y2f-vy2f/30,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) if (t1f+math.abs(tp2(posy(),vp))<t2f) and (t2g>1) and (t2f>1) and ((math.abs(posx()-(x2f+4.5))/4.5<t2f) or (math.abs(posx()-(x2f-15*4.5))/4.5<t2f)) and (nn==0) then for x1f=pos(x2f)-4.5,pos(x2f)-8*4.5,-4.5 do impf,_,_,_,_,_=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) if (impf>380) and (math.abs(posx()-x1f)/4.5<t2f) and (x1f<360) and (x1f>0) then impt=impf x1t=x1f y1t=y1f t1t=t1f x2t=x2f y2t=y2f t2t=t2f vx2t=vx2f vy2t=vy2f break end end if (impt<imp) and (impt<430) then imp=impt x1=x1t y1=y1t t1=t1t x2=x2t y2=y2t t2=t2t vx2=vx2t vy2=vy2t end if (imp<390) then break end end end t2=t2+1 end t2=t2-1 if (x1>0) and (est<368.5) then move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else move(est-4.5) end end function posplay() if (math.abs(est-esto3)>0.2) then x1,y1,t1,x2,y2,t2,vx2,vy2,x1f,y1f,t1f,x2f,y2f,t2f,vx2f,vy2f,x1t,y1t,t1t,x2t,y2t,t2t,vx2t,vy2t=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 t2g=0 -- debug(-10) esto3=est imp=500 x1=0 for t=33,0,-3 do if (t==0) then j=0 else j=1 end t1f=t y1f=yp(t1f) t2g=math.floor(tb(y,vy,y1f+h,2)) y2f=yb(y,vy,t2g) vy2f=vy-g*t2g x2f,y2f,vx2f,vy2f,t2f,nn=estimate(x,y,vx,vy,y2f-vy2f/30,2) t1f=math.floor(tp(y2f-h)) y1f=yp(t1f) if (t1f+math.abs(tp2(posy(),vp))<t2f) and (t2g>1) and (t2f>1) and ((math.abs(posx()-(x2f+4.5))/4.5<t2f) or (math.abs(posx()-(x2f-15*4.5))/4.5<t2f)) and (nn==0) then for x1f=pos(x2f)+4*4.5,pos(x2f)-6*4.5,-4.5 do impf,_,_,_,_,_=impact(x2f,y2f,vx2f,vy2f,x1f,y1f,220,j,0) if (impf>280) and (impf<340) and (math.abs(posx()-x1f)/4.5<t2f) and (x1f<360) and (x1f>0) then impt=impf x1t=x1f y1t=y1f t1t=t1f x2t=x2f y2t=y2f t2t=t2f vx2t=vx2f vy2t=vy2f break end end if (math.abs(impt-310)<math.abs(imp-310)) then imp=impt x1=x1t y1=y1t t1=t1t x2=x2t y2=y2t t2=t2t vx2=vx2t vy2=vy2t end if (math.abs(imp-310)<20) then break end end end t2=t2+1 end t2=t2-1 if (x1>0) and (est<368.5) then move(x1) if (t2<=t1+0.1) and (y1>146) then jump() end else move(est) end end function OnOpponentServe() y1p=144.5 if (math.abs(pos(posx())-posx())>1) then move(400) else move(200) end valid=1 nettime=0 phase=0 end function OnServe(ballready) nettime=0 y1p=144.5 phase=0 est=700 if (math.abs(pos(posx())-posx())>1) then move(400) else if (math.abs(posx()-180)<2) then jump() else move(180) end end valid=1 end function OnGame() yp2=y1p y1p=oppy() vp=y1p-yp2 esttold=estt netold=net toucho=touch touch=touches() if (touch<toucho) then p=math.random() end x,y,vx,vy=ballx(),bally(),bspeedx(),bspeedy() estt,_,_,_,tnet,net=estimate(x,y,vx,vy,220) if (math.abs(esttold-estt)<0.1) then -- Schutz gegen Fehler bei der estimate-Funktion während Netz/Wandkollisionen est=estt end if (phase==2) and ((est>431.5) or (est<368.5)) then nettime=10 phase=4 elseif (phase==4) and (nettime>0) then nettime=nettime-1 else if (est>431.5) then phase=3 elseif (est<431.5) and (est>368.5) then phase=2 else phase=1 end end if (math.sqrt((ballx()-400)^2+(bally()-316)^2)<(31.5+7)) and (math.sqrt((bspeedx())^2+(bspeedy())^2)<2) then phase=5 end --1 Player --2 Ball -- debug(0) -- debug(est) -- debug(imp) -- debug(t2) -- -- if (est<(400-31.5)) then -- if (p<1) then netp() -- else lob() -- end -- elseif (est<400-22) and (est>400-31.5) then -- move (250) -- elseif (est<400-10) and (est>400-22) then -- move(200) -- elseif (est<400) and (est>400-10) then -- move(180) -- else -- move(100) -- end if (phase==3) then move(100) elseif (phase==1) then if (p<0.4) then attack() elseif (p>=0.4) and (p<0.7) then lob() else if (touches()==0) then posplay() elseif (touches()==1) then netp() else attack() end end elseif (phase==2) then if (tnet<=tp(393)+1) or (nettime>0) then jump() end if (math.abs(posx()-360)/4.5-10<=tnet) then left() else right() end elseif (phase==4) then right() jump() elseif (phase==5) then if (posx()>300) then jump() end right() end end
gpl-2.0
ahmetabdi/JC2-MP-Racing
client/cRaceGUIUtility.lua
2
1265
NormX = function(x) return (x * 0.5 + 0.5) * Render.Width end NormY = function(y) return (y * 0.5 + 0.5) * Render.Height end -- Normalized coords to pixels. From -1 to 1. NormVector2 = function(x , y) return Vector2( (x * 0.5 + 0.5) * Render.Width , (y * 0.5 + 0.5) * Render.Height ) end -- Draws shadowed, aligned text. DrawText = function(pos , text , color , size , alignment , scale) if not text then print("Warning: trying to draw nil text! This should never happen!") print("pos = " , pos , ", color = " , color , ", size = " , size) text = "***ERROR***" end if not alignment then alignment = "left" end if alignment == "center" then pos = pos + Vector2( Render:GetTextWidth(text , size) * -0.5 , Render:GetTextHeight(text , size) * -0.5 ) elseif alignment == "right" then pos = pos + Vector2( Render:GetTextWidth(text , size) * -1 , Render:GetTextHeight(text , size) * -0.5 ) else -- "left" pos = pos + Vector2( 0 , Render:GetTextHeight(text , size) * -0.5 ) end local shadowColor = Copy(settings.shadowColor) shadowColor.a = color.a Render:DrawText(pos + Vector2(-1 , -1) , text , shadowColor , size , scale or 1) Render:DrawText(pos , text , color , size , scale or 1) end
mit
NeCarbon/vice-players
Vendor/CEGUI/cegui/src/ScriptingModules/LuaScriptModule/support/tolua++bin/lua/feature.lua
7
2631
-- tolua: abstract feature class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: feature.lua 1004 2006-02-27 13:03:20Z lindquist $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Feature class -- Represents the base class of all mapped feature. classFeature = { } classFeature.__index = classFeature -- write support code function classFeature:supcode () end -- output tag function classFeature:decltype () end -- register feature function classFeature:register (pre) end -- translate verbatim function classFeature:preamble () end -- check if it is a variable function classFeature:isvariable () return false end -- check if it requires collection function classFeature:requirecollection (t) return false end -- build names function classFeature:buildnames () if self.name and self.name~='' then local n = split(self.name,'@') self.name = n[1] if not n[2] then n[2] = applyrenaming(n[1]) end self.lname = n[2] or gsub(n[1],"%[.-%]","") self.original_name = self.name self.lname = clean_template(self.lname) end if not self.is_parameter then self.name = getonlynamespace() .. self.name end local parent = classContainer.curr if parent then self.access = parent.curr_member_access else end end function classFeature:check_public_access() if self.access and self.access ~= 0 then return false end local parent = classContainer.curr while parent do if parent.access and parent.access ~= 0 then return false end parent = parent.prox end return true end function clean_template(t) return string.gsub(t, "[<>:, %*]", "_") end -- check if feature is inside a container definition -- it returns the container class name or nil. function classFeature:incontainer (which) if self.parent then local parent = self.parent while parent do if parent.classtype == which then return parent.name end parent = parent.parent end end return nil end function classFeature:inclass () return self:incontainer('class') end function classFeature:inmodule () return self:incontainer('module') end function classFeature:innamespace () return self:incontainer('namespace') end -- return C binding function name based on name -- the client specifies a prefix function classFeature:cfuncname (n) if self.parent then n = self.parent:cfuncname(n) end n = string.gsub(n..'_'.. (self.lname or self.name), "[<>:, \.%*&]", "_") return n end
gpl-3.0
Ninjistix/darkstar
scripts/zones/QuBia_Arena/mobs/Archlich_Taber_quoan.lua
5
1043
----------------------------------- -- Area: Qu'Bia Arena -- NM: Archlich Taber'quoan -- Mission 5-1 BCNM Fight ----------------------------------- mixins = {require("scripts/mixins/job_special")}; require("scripts/globals/status"); function onMobInitialize(mob) mob:setMobMod(MOBMOD_SOUND_RANGE, 32); end; function onMobFight(mob, target) local BattleTime = mob:getBattleTime(); if (BattleTime - mob:getLocalVar("RepopWarriors") > 30) then local warriorsSpawned = 0; for warrior = mob:getID()+3, mob:getID()+6 do if (not GetMobByID(warrior):isSpawned() and warriorsSpawned < 2) then SpawnMob(warrior):updateEnmity(target); if (warriorsSpawned == 1) then GetMobByID(warrior):stun(5000); end warriorsSpawned = warriorsSpawned + 1; end end mob:setLocalVar("RepopWarriors", BattleTime); end end; function onMobDeath(mob, player, isKiller) player:addTitle(ARCHMAGE_ASSASSIN); end;
gpl-3.0
moksha11/likwid
src/applications/likwid-topology.lua
2
11761
#!<PREFIX>/bin/likwid-lua --[[ * ======================================================================================= * * Filename: likwid-topology.lua * * Description: A application to determine the thread and cache topology * on x86 processors. * * Version: <VERSION> * Released: <DATE> * * Author: Thomas Roehl (tr), thomas.roehl@gmail.com * Project: likwid * * Copyright (C) 2014 Thomas Roehl * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. * * =======================================================================================]] package.path = package.path .. ';<PREFIX>/share/lua/?.lua' local likwid = require("likwid") stdout_print = print function version() print(string.format("likwid-topology -- Version %d.%d",likwid.version,likwid.release)) end function usage() version() print("A tool to print the thread and cache topology on x86 CPUs.\n") print("Options:") print("-h, --help\t\t Help message") print("-v, --version\t\t Version information") print("-V, --verbose <level>\t Set verbosity") print("-c, --caches\t\t List cache information") print("-C, --clock\t\t Measure processor clock") print("-o, --output <file>\t Store output to file. (Optional: Apply text filter)") print("-g\t\t\t Graphical output") end print_caches = false print_graphical = false measure_clock = false outfile = nil for opt,arg in likwid.getopt(arg, {"h","v","c","C","g","o:","V:","help","version","verbose:","clock","caches","output:"}) do if (type(arg) == "string") then local s,e = arg:find("-"); if s == 1 then print(string.format("Argmument %s to option -%s starts with invalid character -.", arg, opt)) print("Did you forget an argument to an option?") os.exit(1) end end if opt == "h" or opt == "help" then usage() os.exit(0) elseif opt == "v" or opt == "version" then version() os.exit(0) elseif opt == "V" or opt == "verbose" then likwid.setVerbosity(tonumber(arg)) elseif opt == "c" or opt == "caches" then print_caches = true elseif opt == "C" or opt == "clock" then measure_clock = true elseif opt == "g" then print_graphical = true elseif opt == "o" or opt == "output" then outfile = arg io.output(arg:gsub(string.match(arg, ".-[^\\/]-%.?([^%.\\/]*)$"),"tmp")) print = function(...) for k,v in pairs({...}) do io.write(v .. "\n") end end end end local config = likwid.getConfiguration() local cpuinfo = likwid.getCpuInfo() local cputopo = likwid.getCpuTopology() local numainfo = likwid.getNumaInfo() local affinity = likwid.getAffinityInfo() print(likwid.hline) print(string.format("CPU name:\t%s",cpuinfo["osname"])) print(string.format("CPU type:\t%s",cpuinfo["name"])) print(string.format("CPU stepping:\t%s",cpuinfo["stepping"])) if (measure_clock) then if cpuinfo["clock"] == 0 then print(string.format("CPU clock:\t%3.2f GHz", likwid.getCpuClock() * 1.E-09)) else print(string.format("CPU clock:\t%3.2f GHz", cpuinfo["clock"] * 1.E-09)) end end print(likwid.sline) print("Hardware Thread Topology") print(likwid.sline) print(string.format("Sockets:\t\t%u",cputopo["numSockets"])) print(string.format("Cores per socket:\t%u",cputopo["numCoresPerSocket"])) print(string.format("Threads per core:\t%u",cputopo["numThreadsPerCore"])) print(likwid.hline) print("HWThread\tThread\t\tCore\t\tSocket") for cntr=0,cputopo["numHWThreads"]-1 do print(string.format("%d\t\t%u\t\t%u\t\t%u",cntr, cputopo["threadPool"][cntr]["threadId"], cputopo["threadPool"][cntr]["coreId"], cputopo["threadPool"][cntr]["packageId"])) end print(likwid.hline) for socket=0,cputopo["numSockets"]-1 do str = string.format("Socket %d: (",cputopo["topologyTree"][socket]["ID"]) for core=0,cputopo["numCoresPerSocket"]-1 do for thread=0, cputopo["numThreadsPerCore"]-1 do str = str .. " " .. tostring(cputopo["topologyTree"][socket]["Childs"][core]["Childs"][thread]) end end print(str .. " )") end print(likwid.hline .. "\n") print(likwid.sline) print("Cache Topology") print(likwid.sline) for level=1,cputopo["numCacheLevels"] do if (cputopo["cacheLevels"][level]["type"] ~= "INSTRUCTIONCACHE") then print(string.format("Level:\t%d",cputopo["cacheLevels"][level]["level"])) if (cputopo["cacheLevels"][level]["size"] < 1048576) then print(string.format("Size:\t%d kB",cputopo["cacheLevels"][level]["size"]/1024)) else print(string.format("Size:\t%d MB",cputopo["cacheLevels"][level]["size"]/1048576)) end if (print_caches) then if (cputopo["cacheLevels"][level]["type"] == "DATACACHE") then print("Type:\tData cache") elseif (cputopo["cacheLevels"][level]["type"] == "UNIFIEDCACHE") then print("Type:\tUnified cache") end print(string.format("Associativity:\t%d",cputopo["cacheLevels"][level]["associativity"])) print(string.format("Number of sets:\t%d",cputopo["cacheLevels"][level]["sets"])) print(string.format("Cache line size:%d",cputopo["cacheLevels"][level]["lineSize"])) if (cputopo["cacheLevels"][level]["inclusive"] > 0) then print("Non Inclusive cache") else print("Inclusive cache") end print(string.format("Shared among %d threads",cputopo["cacheLevels"][level]["threads"])) end local threads = cputopo["cacheLevels"][level]["threads"] str = "Cache groups:\t( " for socket=0,cputopo["numSockets"]-1 do for core=0,cputopo["numCoresPerSocket"]-1 do for cpu=0,cputopo["numThreadsPerCore"]-1 do if (threads ~= 0) then str = str .. cputopo["topologyTree"][socket]["Childs"][core]["Childs"][cpu] .. " " threads = threads - 1 else str = str .. string.format(") ( %d ",cputopo["topologyTree"][socket]["Childs"][core]["Childs"][cpu]) threads = cputopo["cacheLevels"][level]["threads"] threads = threads - 1 end end end end print(str .. ")") print(likwid.hline) end end print("\n") print(likwid.sline) print("NUMA Topology") print(likwid.sline) if (numainfo["numberOfNodes"] == 0) then print("NUMA is not supported on this node!") else print(string.format("NUMA domains: %d",numainfo["numberOfNodes"])) print(likwid.hline) -- -2 because numberOfNodes is seen as one entry for node=1,numainfo["numberOfNodes"] do print(string.format("Domain %d:",numainfo["nodes"][node]["id"])) str = "Processors: " for cpu=1,numainfo["nodes"][node]["numberOfProcessors"] do str = str .. " " .. numainfo["nodes"][node]["processors"][cpu] end print(str) str = "Relative distance to nodes: " for cpu=1,numainfo["nodes"][node]["numberOfDistances"] do str = str .. " " .. numainfo["nodes"][node]["distances"][cpu][cpu-1] end print(str) print(string.format("Memory: %g MB free of total %g MB", tonumber(numainfo["nodes"][node]["freeMemory"]/1024.0), tonumber(numainfo["nodes"][node]["totalMemory"]/1024.0))) print(likwid.hline) end end if (print_graphical) then print("\n") print(likwid.sline) print("Graphical Topology") print(likwid.sline) for socket=0,cputopo["numSockets"]-1 do print(string.format("Socket %d:",cputopo["topologyTree"][socket]["ID"])) container = {} for core=0,cputopo["numCoresPerSocket"]-1 do local tmpString = "" for thread=0,cputopo["numThreadsPerCore"]-1 do if thread == 0 then tmpString = tmpString .. tostring(cputopo["topologyTree"][socket]["Childs"][core]["Childs"][thread]) else tmpString = tmpString .. " " .. tostring(cputopo["topologyTree"][socket]["Childs"][core]["Childs"][thread]).. " " end end likwid.addSimpleAsciiBox(container, 1, core+1, tmpString) end local columnCursor = 1 local lineCursor = 2 for cache=1,cputopo["numCacheLevels"] do if cputopo["cacheLevels"][cache]["type"] ~= "INSTRUCTIONCACHE" then local cachesAtCurLevel = 0 local sharedCores = cputopo["cacheLevels"][cache]["threads"]/cputopo["numThreadsPerCore"] if sharedCores >= cputopo["numCoresPerSocket"] then cachesAtCurLevel = 1 else cachesAtCurLevel = cputopo["numCoresPerSocket"]/sharedCores end columnCursor = 1 for cachesAtLevel=1,cachesAtCurLevel do local tmpString = "" local cacheWidth = 0 if cputopo["cacheLevels"][cache]["size"] < 1048576 then tmpString = string.format("%dkB", cputopo["cacheLevels"][cache]["size"]/1024) else tmpString = string.format("%dMB", cputopo["cacheLevels"][cache]["size"]/1048576) end if sharedCores > 1 then if sharedCores > cputopo["numCoresPerSocket"] then cacheWidth = sharedCores else cacheWidth = sharedCores - 1 end likwid.addJoinedAsciiBox(container, lineCursor, columnCursor,columnCursor + cacheWidth, tmpString) columnCursor = columnCursor + cacheWidth else likwid.addSimpleAsciiBox(container, lineCursor, columnCursor, tmpString) columnCursor = columnCursor + 1 end end lineCursor = lineCursor + 1 end end likwid.printAsciiBox(container); end end if outfile then local suffix = string.match(outfile, ".-[^\\/]-%.?([^%.\\/]*)$") local command = "<PREFIX>/share/likwid/filter/" .. suffix if suffix ~= "txt" then command = command .." ".. outfile:gsub("."..suffix,".tmp",1) .. " topology" local f = io.popen(command) local o = f:read("*a") if o:len() > 0 then print(string.format("Failed to executed filter script %s.",command)) end else os.rename(outfile:gsub("."..suffix,".tmp",1), outfile) end end likwid.putAffinityInfo() likwid.putNumaInfo() likwid.putTopology() likwid.putConfiguration()
gpl-3.0
Ninjistix/darkstar
scripts/zones/Horlais_Peak/mobs/Maat.lua
6
1031
----------------------------------- -- Area: Horlais Peak -- MOB: Maat -- Genkai 5 Fight ----------------------------------- package.loaded["scripts/zones/Horlais_Peak/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Horlais_Peak/TextIDs"); ----------------------------------- function onMobSpawn(mob) end; function onMobEngaged(mob,target) target:showText(mob,YOU_DECIDED_TO_SHOW_UP); -- printf("Maat Horlais Peak works"); -- When he take damage: target:showText(mob,THAT_LL_HURT_IN_THE_MORNING); -- He use dragon kick or tackle: target:showText(mob,TAKE_THAT_YOU_WHIPPERSNAPPER); -- He use spining attack: target:showText(mob,TEACH_YOU_TO_RESPECT_ELDERS); -- If you dying: target:showText(mob,LOOKS_LIKE_YOU_WERENT_READY); end; function onMobFight(mob, target) local bf = mob:getBattlefield(); if (mob:getHPP() <20) then bf:win(); return; end end; function onMobDeath(mob, player, isKiller) player:showText(mob,YOUVE_COME_A_LONG_WAY); end;
gpl-3.0
DGA-MI-SSI/YaCo
deps/swig-3.0.7/Examples/lua/funcptr3/runme.lua
4
1428
---- importing ---- if string.sub(_VERSION,1,7)=='Lua 5.0' then -- lua5.0 doesnt have a nice way to do this lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example') assert(lib)() else -- lua 5.1 does require('example') end a = 37 b = 42 -- Now call our C function print("Trying some C functions") print(" a =", a) print(" b =", b) print(" add(a,b) =", example.add(a,b)) print(" sub(a,b) =", example.sub(a,b)) print(" mul(a,b) =", example.mul(a,b)) print("Calling them using the my_func()") print(" add(a,b) =", example.callback(a,b,example.add)) print(" sub(a,b) =", example.callback(a,b,example.sub)) print(" mul(a,b) =", example.callback(a,b,example.mul)) print("Now let us write our own function") function foo(a,b) return 101 end print(" foo(a,b) =", example.callback(a,b,foo)) print("Now let us try something that will fail") local ok,c=pcall(example.callback,a,b,print) if ok==false then print("this failed as expected, error:",c) else print("oops, that worked! result:",c) end -- part2 stored function print("trying a stored fn") print("the_func=",example.the_func) print("setting to print") example.the_func=print print("the_func=",example.the_func) print("call_the_func(5)") example.call_the_func(5) function bar(i) print("bar",i) end print("setting to bar") example.the_func=bar print("call_the_func(5)") example.call_the_func(5)
gpl-3.0
chroteus/clay
class/country.lua
1
9637
require "class.region" Country = Base:subclass("Country") -- WARNING! The name of miniature and ball image should be the same as Country's name! -- Example: If we have an instance of Country with name variable "Ukraine", -- both balls and miniatures folder should have a Ukraine.png image. local lg = love.graphics function Country:initialize(name, color, attack, defense, hp, fighters) self.id = nil -- Id is defined in for-loop in coutries.lua self.name = name self.color = color -- Ball Images: If one of them is not present, one of the other images is used. -- rightImage [Image]: Picture of ball facing to right. -- leftImage [Image]: Picture of ball facing to left. self.rightImage = lg.newImage("assets/image/balls/right/"..self.name..".png") self.leftImage = lg.newImage("assets/image/balls/left/"..self.name..".png") -- Minature: A small pixel-art version of the ball. self.miniature = lg.newImage("assets/image/miniatures/"..self.name..".png") self.attack = attack self.defense = defense self.hp = hp self.energy = 10 self.money = 0 self.foes = {} self.allies = {} self.isDead = false self.deadMessagePrinted = false self.maxHP = self.hp self.maxEnergy = self.energy self.skills = { -- default skills heal = skills.heal:clone(), attack = skills.attack:clone(), fire = skills.fire:clone(), } -- table of fighters self.fighters = fighters or {} for k,fighter in pairs(self.fighters) do self.fighters[k] = FighterAI(fighter) -- init using stats of that fighter end self.invadeTimer = math.random(10,20) self.numOfInv = 0 self.midpoint = nil -- generated at game:init after placing regions Base.initialize(self) end function Country:_midpoint() local xmidpointSum = 0 local ymidpointSum = 0 local regionsNum = 0 for _,region in pairs(map) do if region.id == self.id then regionsNum = regionsNum + 1 xmidpointSum = xmidpointSum + region.midpoint.x ymidpointSum = ymidpointSum + region.midpoint.y end end return {x = xmidpointSum / regionsNum, y = ymidpointSum / regionsNum} end local function strongEnough(self, foe) local winChance = (self.attack/(foe.defense*5))*100 for _,fighter in pairs(self.fighters) do winChance = winChance + fighter.attack_stat/5 end for _,fighter in pairs(foe.fighters) do winChance = winChance - fighter.defense/5 end if winChance > 100 then winChance = 100 elseif winChance < 1 then winChance = 1 end math.randomseed(os.time()) local r = math.random(100) return winChance >= r end function Country:invade(dt) if not self.isDead and not self.inBattle and self.name ~= Player.country and self.name ~= "Sea" then self.invadeTimer = self.invadeTimer - dt if self.invadeTimer <= 0 then self.invadeTimer = math.random(20*worldTime.dayLength,40*worldTime.dayLength) local possible_regions = {} for _,foe in pairs(self.foes) do -- add neighbour regions for _,region in pairs(map) do if region.country.name == foe.name then if self:isNeighbour(region.name) then table.insert(possible_regions, region) end end end -- add sea bordering enemy regions for _,region in pairs(map) do if region.country.name == foe.name and region:hasSeaBorder() then table.insert(possible_regions, region) end end -- conquer region if #possible_regions > 0 then for _,region in pairs(map) do math.randomseed(math.random(os.time())) -- pick closest to country's center region table.sort(possible_regions, function(a,b) local a_d = math.dist(a.midpoint.x,a.midpoint.y, self.midpoint.x,self.midpoint.y) local b_d = math.dist(b.midpoint.x,b.midpoint.y, self.midpoint.x,self.midpoint.y) return a_d < b_d end ) local region = possible_regions[1] if self.numOfInv == 0 and strongEnough(self, region.country) then self.numOfInv = self.numOfInv + 1 if region.country.name == Player.country then msgBox:add(self.name.." took your clay!") end region:changeOwner(self) end end end end self.numOfInv = 0 end end end local soundT = love.filesystem.getDirectoryItems("assets/sounds/attack") function Country:loseHP(damage) local netDamage = damage - self.defense if netDamage < 0 then netDamage = 0 end local randNum = math.random(#soundT) local randSnd = soundT[randNum] TEsound.play("assets/sounds/attack/"..randSnd) self.hp = self.hp - netDamage end function Country:gainHP(amount) self.hp = self.hp + amount if self.hp > self.maxHP then self.hp = self.maxHP end end function Country:loseEnergy(amount) self.stats.energy = self.stats.energy - amount end function Country:isFoe(country) local country = country if type(country) == "string" then country = nameToCountry(country) end for _,foe in pairs(country.foes) do if self.name == foe.name then return true end end return false end function Country:war(foe, noPrintMsg) if not self.isDead and not foe.isDead then local foe = foe if type(foe) == "string" then foe = nameToCountry(foe) end if foe.name ~= "Sea" and foe.name ~= self.name then if not self:isFoe(foe.name) and not noPrintMsg then msgBox:add(self.name.." declared war on "..foe.name.."!") end if not foe:isFoe(Player.country) and not self:isFoe(foe.name) then table.insert(foe.foes, self) table.insert(self.foes, foe) end end end end function Country:peace(country) if not self.isDead then local country = country if type(country) == "string" then country = nameToCountry(country) end if country.name ~= "Sea" and country.name ~= self.name then local function peace(country) if type(country) == "table" then if #self.foes > 0 then for i,foe in ipairs(self.foes) do if country.name == foe.name then table.remove(self.foes, i) end end end if #country.foes > 0 then for i,foe in ipairs(country.foes) do if self.name == foe.name then table.remove(country.foes, i) end end end msgBox:add(self.name.." signed a peace treaty with "..country.name..".") else error("Country:peace method accepts the instance or name of country only.") end end if country.name == Player.country then local r = math.random(3) if r <= 2 then local dbox = DialogBoxes:new(self.name.." wants to sign a peace treaty with us.", {"Refuse", function() end}, {"Accept", function() peace(country) if Gamestate.current == battle then Gamestate.switch(game) end end} ) dbox:show(function() love.mouse.setVisible(false) end) else local moneyAmnt = math.random(self.attack*2, self.attack*3) local dbox = DialogBoxes:new( self.name.. " wants to sign a peace treaty with us. " ..tostring(moneyAmnt).."G will be given as a compensation.", {"Refuse", function() end}, {"Accept", function() peace(country) country:addMoney(moneyAmnt) game.loadStatusbarText() if Gamestate.current == battle then Gamestate.switch(game) end end }) dbox:show( function() if Gamestate.current == game then love.mouse.setVisible(false) end end) end else -- for AI peace(country) end end end end function Country:addMoney(amount) self.money = self.money + amount if self.money + amount < 0 then self.money = 0 end if self.name == Player.country then Player.money = self.money end end function Country:addSkill(argSkill, order) local order = order or 1 table.insert(self.skills, order, skills[argSkill]:clone()) removeDuplicates(self.skills) end function Country:isNeighbour(regionName) local i = 0 for _,region in pairs(map) do if region.country.id == self.id then for _,n in pairs(region.neighbours) do if n == regionName then i = i + 1 end end end end return i > 0 end
gpl-2.0
Ninjistix/darkstar
scripts/globals/items/caladbolg.lua
3
3310
----------------------------------------- -- ID: 19459 -- Item: Caladbolg ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/msg"); require("scripts/globals/weaponskills"); require("scripts/globals/weaponskillids"); ----------------------------------- local NAME_WEAPONSKILL = "AFTERMATH_CALADBOLG"; local NAME_EFFECT_LOSE = "AFTERMATH_LOST_CALADBOLG"; -- https://www.bg-wiki.com/bg/Relic_Aftermath local aftermathTable = {}; -- Caladbolg 85 aftermathTable[19459] = { { -- Tier 1 duration = 30, mods = { { id = MOD_REM_OCC_DO_DOUBLE_DMG, power = 30 } } }, { -- Tier 2 duration = 60, mods = { { id = MOD_REM_OCC_DO_DOUBLE_DMG, power = 40 } } }, { -- Tier 3 duration = 60, mods = { { id = MOD_REM_OCC_DO_DOUBLE_DMG, power = 50 } } } }; aftermathTable[19537] = aftermathTable[19459]; -- Caladbolg (90) aftermathTable[19635] = aftermathTable[19459]; -- Caladbolg (95) aftermathTable[19808] = aftermathTable[19459]; -- Caladbolg (99) aftermathTable[19856] = aftermathTable[19459]; -- Caladbolg (99/II) aftermathTable[20747] = aftermathTable[19459]; -- Caladbolg (119) aftermathTable[20748] = aftermathTable[19459]; -- Caladbolg (119/II) -- Caladbolg (119/III) aftermathTable[21684] = { { -- Tier 1 duration = 60, mods = { { id = MOD_REM_OCC_DO_TRIPLE_DMG, power = 30 } } }, { -- Tier 2 duration = 120, mods = { { id = MOD_REM_OCC_DO_TRIPLE_DMG, power = 40 } } }, { -- Tier 3 duration = 180, mods = { { id = MOD_REM_OCC_DO_TRIPLE_DMG, power = 50 } } } }; function onWeaponskill(user, target, wsid, tp, action) if (wsid == WEAPONSKILL_TORCLEAVER) then -- Torcleaver onry local itemId = user:getEquipID(SLOT_MAIN); if (shouldApplyAftermath(user, tp)) then if (aftermathTable[itemId]) then -- Apply the effect and add mods addEmpyreanAftermathEffect(user, tp, aftermathTable[itemId]); -- Add a listener for when aftermath wears (to remove mods) user:addListener("EFFECT_LOSE", NAME_EFFECT_LOSE, aftermathLost); end end end end function aftermathLost(target, effect) if (effect:getType() == EFFECT_AFTERMATH) then local itemId = target:getEquipID(SLOT_MAIN); if (aftermathTable[itemId]) then -- Remove mods removeEmpyreanAftermathEffect(target, effect, aftermathTable[itemId]); -- Remove the effect listener target:removeListener(NAME_EFFECT_LOSE); end end end function onItemCheck(player, param, caster) if (param == ITEMCHECK_EQUIP) then player:addListener("WEAPONSKILL_USE", NAME_WEAPONSKILL, onWeaponskill); elseif (param == ITEMCHECK_UNEQUIP) then -- Make sure we clean up the effect and mods if (player:hasStatusEffect(EFFECT_AFTERMATH)) then aftermathLost(player, player:getStatusEffect(EFFECT_AFTERMATH)); end player:removeListener(NAME_WEAPONSKILL); end return 0; end
gpl-3.0
DGA-MI-SSI/YaCo
deps/swig-3.0.7/Examples/lua/owner/runme.lua
2
3263
-- Operator overloading example ---- importing ---- if string.sub(_VERSION,1,7)=='Lua 5.0' then -- lua5.0 doesnt have a nice way to do this lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example') assert(lib)() else -- lua 5.1 does require('example') end print "ok, let's test Lua's ownership of C++ objects" print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)") print "\nLet's make a couple" a=example.Square(10) b=example.Circle(1) print("Currently there are",example.Shape_nshapes,"shapes (there should be 2)") print "\nNote let's use the createX functions" c=example.createCircle(5) d=example.createSquare(3) print("Currently there are",example.Shape_nshapes,"shapes (there should be 4)") print "\nWe will run the garbage collector & see if they are till here" collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 4)") print "\nLet's get rid of them all, collect garbage & see if they are till here" a,b,c,d=nil,nil,nil,nil collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)") print "\nLet's start putting stuff into the ShapeOwner" print "The ShapeOwner now owns the shapes, but Lua still has pointers to them" o=example.ShapeOwner() a=example.Square(10) b=example.Circle(1) o:add(a) o:add(b) o:add(example.createSquare(5)) print("Currently there are",example.Shape_nshapes,"shapes (there should be 3)") print "\nWe will nil our references,run the garbage collector & see if they are still here" print "they should be, as the ShapeOwner owns them" a,b=nil,nil collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 3)") print "\nWe will access them and check that they are still valid" a=o:get(0) b=o:get(1) print(" Area's are",a:area(),b:area(),o:get(2):area()) collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 3)") print "\nWe will remove one from the C++ owner & pass its ownership to Lua," print " then check that they are still unchanged" a,b=nil,nil a=o:remove(0) -- a now owns it collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 3)") print "\nDelete the ShapeOwner (this should destroy two shapes)," print " but we have one left in Lua" o=nil collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 1)") print "\nFinal tidy up " a=nil collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)") print "Final test, we will create some Shapes & pass them around like mad" print "If there is any memory leak, you will see it in the memory usage" io.flush() sh={} -- make some objects for i=0,10 do a=example.Circle(i) b=example.Square(i) sh[a]=true sh[b]=true end o=example.ShapeOwner() for i=0,10000 do for k,_ in pairs(sh) do o:add(k) end sh={} -- clear it while true do a=o:remove(0) if a==nil then break end sh[a]=true end if i%100==0 then collectgarbage() end end print "done" o,sh=nil,nil collectgarbage() print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)") print "that's all folks!"
gpl-3.0
mandersan/premake-core
tests/base/test_aliasing.lua
12
1354
-- -- tests/base/test_aliasing.lua -- Verify handling of function aliases. -- Copyright (c) 2015 Jason Perkins and the Premake project -- local suite = test.declare("premake_alias") local m = {} local p = premake function suite.setup() m.testfunc = function() return 48 end m.aliased = nil m.aliased2 = nil end function suite.returnsOriginalFunction_onNoAlias() local scope, f = p.resolveAlias(m, "testfunc") test.isequal("testfunc", f) end function suite.pointsAliasToOriginalFunction() p.alias(m, "testfunc", "aliased") test.isequal(48, m.aliased()) end function suite.returnsOriginalFunction_onAlias() p.alias(m, "testfunc", "aliased") local scope, f = p.resolveAlias(m, "aliased") test.isequal("testfunc", f) end function suite.returnsOriginalFunction_onChainedAliases() p.alias(m, "testfunc", "aliased") p.alias(m, "aliased", "aliased2") local scope, f = p.resolveAlias(m, "aliased2") test.isequal("testfunc", f) end function suite.overrideResolvesAliases() p.alias(m, "testfunc", "aliased") p.override(m, "aliased", function(base) return base() + 1 end) test.isequal(49, m.testfunc()) end function suite.aliasTracksOverrides() p.alias(m, "testfunc", "aliased") p.override(m, "testfunc", function(base) return base() + 1 end) test.isequal(49, m.aliased()) end
bsd-3-clause
Ninjistix/darkstar
scripts/zones/Northern_San_dOria/npcs/Andreas.lua
5
2530
----------------------------------- -- Area: Northern San d'Oria -- NPC: Andreas -- Type: Guildworker's Union Representative -- @zone 231 -- !pos -189.282 10.999 262.626 ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; ----------------------------------- require("scripts/globals/keyitems"); require("scripts/globals/crafting"); require("scripts/zones/Northern_San_dOria/TextIDs"); local keyitems = { [0] = { id = WOOD_PURIFICATION, rank = 3, cost = 40000 }, [1] = { id = WOOD_ENSORCELLMENT, rank = 3, cost = 40000 }, [2] = { id = LUMBERJACK, rank = 3, cost = 10000 }, [3] = { id = BOLTMAKER, rank = 3, cost = 10000 }, [4] = { id = WAY_OF_THE_CARPENTER, rank = 9, cost = 20000 } }; local items = { [0] = { id = 15444, -- Carpenter's Belt rank = 1, cost = 10000 }, [1] = { id = 14830, -- Carpenter's Gloves rank = 5, cost = 70000 }, [2] = { id = 14392, -- Carpenter's Apron rank = 7, cost = 100000 }, [3] = { id = 28, -- Drawing Desk rank = 9, cost = 150000 }, [4] = { id = 341, -- Carpenter's Signboard rank = 9, cost = 200000 }, [5] = { id = 15819, -- Carpenter's Ring rank = 6, cost = 80000 }, [6] = { id = 3672, -- Carpenter's Kit rank = 8, cost = 50000 }, [7] = { id = 3331, -- Carpenter's Emblem rank = 9, cost = 15000 } }; function onTrade(player,npc,trade) unionRepresentativeTrade(player, npc, trade, 732, 1); end; function onTrigger(player,npc) unionRepresentativeTrigger(player, 1, 731, "guild_woodworking", keyitems); end; function onEventUpdate(player,csid,option,target) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 731) then unionRepresentativeTriggerFinish(player, option, target, 1, "guild_woodworking", keyitems, items); end end; function onEventFinish(player,csid,option,target) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 731) then unionRepresentativeTriggerFinish(player, option, target, 1, "guild_woodworking", keyitems, items); elseif (csid == 732) then player:messageSpecial(GP_OBTAINED, option); end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Bastok_Mines/npcs/Tibelda.lua
5
1103
----------------------------------- -- Area: Bastok Mines -- NPC: Tibelda -- Only sells when Bastok controlls Valdeaunia Region ----------------------------------- package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Bastok_Mines/TextIDs"); require("scripts/globals/conquest"); require("scripts/globals/shop"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local RegionOwner = GetRegionOwner(VALDEAUNIA); if (RegionOwner ~= NATION_BASTOK) then player:showText(npc,TIBELDA_CLOSED_DIALOG); else player:showText(npc,TIBELDA_OPEN_DIALOG); local stock = { 0x111e, 29, --Frost Turnip 0x027e, 170 --Sage } showShop(player,BASTOK,stock); end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
scan-bot/scan-bot
plugins/lyrics.lua
695
2113
do local BASE_LNM_URL = 'http://api.lyricsnmusic.com/songs' local LNM_APIKEY = '1f5ea5cf652d9b2ba5a5118a11dba5' local BASE_LYRICS_URL = 'http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect' local function getInfo(query) print('Getting info of ' .. query) local url = BASE_LNM_URL..'?api_key='..LNM_APIKEY ..'&q='..URL.escape(query) local b, c = http.request(url) if c ~= 200 then return nil end local result = json:decode(b) local artist = result[1].artist.name local track = result[1].title return artist, track end local function getLyrics(query) local artist, track = getInfo(query) if artist and track then local url = BASE_LYRICS_URL..'?artist='..URL.escape(artist) ..'&song='..URL.escape(track) local b, c = http.request(url) if c ~= 200 then return nil end local xml = require("xml") local result = xml.load(b) if not result then return nil end if xml.find(result, 'LyricSong') then track = xml.find(result, 'LyricSong')[1] end if xml.find(result, 'LyricArtist') then artist = xml.find(result, 'LyricArtist')[1] end local lyric if xml.find(result, 'Lyric') then lyric = xml.find(result, 'Lyric')[1] else lyric = nil end local cover if xml.find(result, 'LyricCovertArtUrl') then cover = xml.find(result, 'LyricCovertArtUrl')[1] else cover = nil end return artist, track, lyric, cover else return nil end end local function run(msg, matches) local artist, track, lyric, cover = getLyrics(matches[1]) if track and artist and lyric then if cover then local receiver = get_receiver(msg) send_photo_from_url(receiver, cover) end return '🎵 ' .. artist .. ' - ' .. track .. ' 🎵\n----------\n' .. lyric else return 'Oops! Lyrics not found or something like that! :/' end end return { description = 'Getting lyrics of a song', usage = '!lyrics [track or artist - track]: Search and get lyrics of the song', patterns = { '^!lyrics? (.*)$' }, run = run } end
gpl-2.0
Ninjistix/darkstar
scripts/globals/items/ulbukan_lobster.lua
3
1055
----------------------------------------- -- ID: 5960 -- Item: Ulbukan Lobster -- Food Effect: 5 Min, Mithra only ----------------------------------------- -- Dexterity -3 -- Vitality 1 -- Defense +9% ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- function onItemCheck(target) local result = 0; if (target:getRace() ~= 7) then result = 247; end if (target:getMod(MOD_EAT_RAW_FISH) == 1) then result = 0; end if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,300,5960); end; function onEffectGain(target, effect) target:addMod(MOD_DEX, -3); target:addMod(MOD_VIT, 1); target:addMod(MOD_DEFP, 9); end; function onEffectLose(target, effect) target:delMod(MOD_DEX, -3); target:delMod(MOD_VIT, 1); target:delMod(MOD_DEFP, 9); end;
gpl-3.0
dinodeck/ninety_nine_days_of_dev
007_map_cure/code/combat_events/CEFlee.lua
10
2900
CEFlee = {} CEFlee.__index = CEFlee function CEFlee:Create(state, actor) local this = { mState = state, mOwner = actor, mCharacter = state.mActorCharMap[actor], mFleeParams = { dir = 1, distance = 180, time = 0.6 }, mIsFinished = false, } -- Decide if flee succeeds this.mCanFlee = Formula.CanFlee(state, actor) if this.mCanFlee then local storyboard = { SOP.Function(function() this:Notice("Attempting to Flee...") end), SOP.Wait(0.75), SOP.Function(function() this:DoFleeSuccessPart1() end), SOP.Wait(0.3), SOP.Function(function() this:DoFleeSuccessPart2() end), SOP.Wait(0.6) } this.mStoryboard = Storyboard:Create( this.mState.mStack, storyboard) else local storyboard = { SOP.Function(function() this:Notice("Attempting to Flee...") end), SOP.Wait(0.75), SOP.Function(function() this:Notice("Failed!") end), SOP.Wait(0.3), SOP.Function(function() this:OnFleeFail() end), } this.mStoryboard = Storyboard:Create( this.mState.mStack, storyboard) end -- Move the character into the prone state, as soon as the event is -- created this.mCharacter.mFacing = "right" this.mController = this.mCharacter.mController this.mController:Change(CSRunAnim.mName, {'prone'}) this.mName = string.format("Flee for %s", this.mOwner.mName) setmetatable(this, self) return this end function CEFlee:TimePoints(queue) -- Faster than an attack local speed = self.mOwner.mStats:Get("speed") return queue:SpeedToTimePoints(speed) * 0.5 end function CEFlee:Notice(text) self.mState:ShowNotice(text) end function CEFlee:DoFleeSuccessPart1() self:Notice("Success!") self.mController:Change(CSMove.mName, self.mFleeParams) end function CEFlee:DoFleeSuccessPart2() for k, v in ipairs(self.mState.mActors['party']) do local alive = v.mStats:Get("hp_now") > 0 local isFleer = v == self.mOwner if alive and not isFleer then local char = self.mState.mActorCharMap[v] char.mFacing = "right" char.mController:Change(CSMove.mName, self.mFleeParams) end end self.mState:OnFlee() self.mState:HideNotice() end function CEFlee:OnFleeFail() self.mCharacter.mFacing = "left" self.mController = self.mCharacter.mController self.mController:Change(CSStandby.mName) self.mIsFinished = true self.mState:HideNotice() end function CEFlee:IsFinished() return self.mIsFinished end function CEFlee:Execute() self.mState.mStack:Push(self.mStoryboard) end function CEFlee:Update(dt) end
mit
SvenRoederer/openwrt-packages
net/prosody/files/prosody.cfg.lua
65
9428
-- Prosody Example Configuration File -- -- Information on configuring Prosody can be found on our -- website at https://prosody.im/doc/configure -- -- Tip: You can check that the syntax of this file is correct -- when you have finished by running this command: -- prosodyctl check config -- If there are any errors, it will let you know what and where -- they are, otherwise it will keep quiet. -- -- The only thing left to do is rename this file to remove the .dist ending, and fill in the -- blanks. Good luck, and happy Jabbering! ---------- Server-wide settings ---------- -- Settings in this section apply to the whole server and are the default settings -- for any virtual hosts -- This is a (by default, empty) list of accounts that are admins -- for the server. Note that you must create the accounts separately -- (see https://prosody.im/doc/creating_accounts for info) -- Example: admins = { "user1@example.com", "user2@example.net" } admins = { } -- Enable use of libevent for better performance under high load -- For more information see: https://prosody.im/doc/libevent --use_libevent = true -- Prosody will always look in its source directory for modules, but -- this option allows you to specify additional locations where Prosody -- will look for modules first. For community modules, see https://modules.prosody.im/ --plugin_paths = {} -- This is the list of modules Prosody will load on startup. -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too. -- Documentation on modules can be found at: http://prosody.im/doc/modules modules_enabled = { -- Generally required "roster"; -- Allow users to have a roster. Recommended ;) "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in. "tls"; -- Add support for secure TLS on c2s/s2s connections "dialback"; -- s2s dialback support "disco"; -- Service discovery -- Not essential, but recommended "carbons"; -- Keep multiple clients in sync "pep"; -- Enables users to publish their avatar, mood, activity, playing music and more "private"; -- Private XML storage (for room bookmarks, etc.) "blocklist"; -- Allow users to block communications with other users "vcard4"; -- User profiles (stored in PEP) "vcard_legacy"; -- Conversion between legacy vCard and PEP Avatar, vcard -- Nice to have "version"; -- Replies to server version requests "uptime"; -- Report how long server has been running "time"; -- Let others know the time here on this server "ping"; -- Replies to XMPP pings with pongs "register"; -- Allow users to register on this server using a client and change passwords --"mam"; -- Store messages in an archive and allow users to access it --"csi_simple"; -- Simple Mobile optimizations -- Admin interfaces "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands --"admin_telnet"; -- Opens telnet console interface on localhost port 5582 -- HTTP modules --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" --"websocket"; -- XMPP over WebSockets --"http_files"; -- Serve static files from a directory over HTTP -- Other specific functionality --"limits"; -- Enable bandwidth limiting for XMPP connections --"groups"; -- Shared roster support --"server_contact_info"; -- Publish contact information for this service --"announce"; -- Send announcement to all online users --"welcome"; -- Welcome users who register accounts --"watchregistrations"; -- Alert admins of registrations --"motd"; -- Send a message to users when they log in --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots. --"proxy65"; -- Enables a file transfer proxy service which clients behind NAT can use } -- These modules are auto-loaded, but should you want -- to disable them then uncomment them here: modules_disabled = { -- "offline"; -- Store offline messages -- "c2s"; -- Handle client connections -- "s2s"; -- Handle server-to-server connections -- "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. } -- Disable account creation by default, for security -- For more information see https://prosody.im/doc/creating_accounts allow_registration = false -- Force clients to use encrypted connections? This option will -- prevent clients from authenticating unless they are using encryption. c2s_require_encryption = true -- Force servers to use encrypted connections? This option will -- prevent servers from authenticating unless they are using encryption. s2s_require_encryption = true -- Force certificate authentication for server-to-server connections? s2s_secure_auth = false -- Some servers have invalid or self-signed certificates. You can list -- remote domains here that will not be required to authenticate using -- certificates. They will be authenticated using DNS instead, even -- when s2s_secure_auth is enabled. --s2s_insecure_domains = { "insecure.example" } -- Even if you disable s2s_secure_auth, you can still require valid -- certificates for some domains by specifying a list here. --s2s_secure_domains = { "jabber.org" } -- Select the authentication backend to use. The 'internal' providers -- use Prosody's configured data storage to store the authentication data. authentication = "internal_hashed" -- Select the storage backend to use. By default Prosody uses flat files -- in its configured data directory, but it also supports more backends -- through modules. An "sql" backend is included by default, but requires -- additional dependencies. See https://prosody.im/doc/storage for more info. --storage = "sql" -- Default is "internal" -- For the "sql" backend, you can uncomment *one* of the below to configure: --sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename. --sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" } --sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" } -- Archiving configuration -- If mod_mam is enabled, Prosody will store a copy of every message. This -- is used to synchronize conversations between multiple clients, even if -- they are offline. This setting controls how long Prosody will keep -- messages in the archive before removing them. archive_expires_after = "1w" -- Remove archived messages after 1 week -- You can also configure messages to be stored in-memory only. For more -- archiving options, see https://prosody.im/doc/modules/mod_mam -- Logging configuration -- For advanced logging see http://prosody.im/doc/logging log = { info = "/var/log/prosody/prosody.log"; -- Change 'info' to 'debug' for verbose logging error = "/var/log/prosody/prosody.err"; -- "*syslog"; -- Uncomment this for logging to syslog; needs mod_posix -- "*console"; -- Log to the console, useful for debugging with daemonize=false } -- Uncomment to enable statistics -- For more info see https://prosody.im/doc/statistics -- statistics = "internal" -- Pidfile, used by prosodyctl and the init.d script pidfile = "/var/run/prosody/prosody.pid" -- User and group, used for daemon prosody_user = "prosody" prosody_group = "prosody" -- Certificates -- Every virtual host and component needs a certificate so that clients and -- servers can securely verify its identity. Prosody will automatically load -- certificates/keys from the directory specified here. -- For more information, including how to use 'prosodyctl' to auto-import certificates -- (from e.g. Let's Encrypt) see https://prosody.im/doc/certificates -- Location of directory to find certificates in (relative to main config file): --certificates = "certs" -- HTTPS currently only supports a single certificate, specify it here: --https_certificate = "certs/localhost.crt" ----------- Virtual hosts ----------- -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. -- Settings under each VirtualHost entry apply *only* to that host. VirtualHost "localhost" VirtualHost "example.com" enabled = false -- Remove this line to enable this host -- Assign this host a certificate for TLS, otherwise it would use the one -- set in the global section (if any). -- Note that old-style SSL on port 5223 only supports one certificate, and will always -- use the global one. ssl = { key = "/etc/prosody/certs/example.com.key"; certificate = "/etc/prosody/certs/example.com.crt"; } ------ Components ------ -- You can specify components to add hosts that provide special services, -- like multi-user conferences, and transports. -- For more information on components, see http://prosody.im/doc/components ---Set up a MUC (multi-user chat) room server on conference.example.com: --Component "conference.example.com" "muc" -- Set up a SOCKS5 bytestream proxy for server-proxied file transfers: --Component "proxy.example.com" "proxy65" --- Store MUC messages in an archive and allow users to access it --modules_enabled = { "muc_mam" } ---Set up an external component (default component port is 5347) -- -- External components allow adding various services, such as gateways/ -- transports to other networks like ICQ, MSN and Yahoo. For more info -- see: http://prosody.im/doc/components#adding_an_external_component -- --Component "gateway.example.com" -- component_secret = "password"
gpl-2.0
wangyi0226/skynet
examples/wsclient.lua
2
1792
package.cpath = "luaclib/?.so" package.path = "lualib/?.lua;examples/?.lua" if _VERSION ~= "Lua 5.3" then error "Use lua 5.3" end local socket = require "clientwebsocket" local proto = require "proto" local sproto = require "sproto" local host = sproto.new(proto.s2c):host "package" local request = host:attach(sproto.new(proto.c2s)) local fd = assert(socket.connect("127.0.0.1", 8888)) local function send_package(fd, pack) -- local package = string.pack(">s2", pack) socket.send(fd, pack) end local function recv_package() local r , istimeout= socket.recv(fd, 100) if not r then return nil end if r == "" and istimeout == 0 then error "Server closed" end return r end local session = 0 local function send_request(name, args) session = session + 1 local str = request(name, args, session) send_package(fd, str) print("Request:", session) end local last = "" local function print_request(name, args) print("REQUEST", name) if args then for k,v in pairs(args) do print(k,v) end end end local function print_response(session, args) print("RESPONSE", session) if args then for k,v in pairs(args) do print(k,v) end end end local function print_package(t, ...) if t == "REQUEST" then print_request(...) else assert(t == "RESPONSE") print_response(...) end end local function dispatch_package() while true do local v v = recv_package() if not v or v == "" then break end print_package(host:dispatch(v)) end end send_request("handshake") send_request("set", { what = "hello", value = "world, websoket" }) while true do dispatch_package() local cmd = socket.readstdin() if cmd then if cmd == "quit" then send_request("quit") else send_request("get", { what = cmd }) end else socket.usleep(100) end end
mit
neofob/sile
lua-libraries/lunamark/writer/latex.lua
4
7754
-- (c) 2009-2011 John MacFarlane. Released under MIT license. -- See the file LICENSE in the source for details. --- LaTeX writer for lunamark. -- Extends the [lunamark.writer.tex]. local M = {} local tex = require("lunamark.writer.tex") local util = require("lunamark.util") local format = string.format --- Returns a new LaTeX writer. -- -- * `options` is a table with parsing options. -- The following fields are significant: -- -- `citations` -- : Enable citations as in pandoc. Either a boolean or one of -- the following strings should be specified: -- -- - `latex` -- produce basic LaTeX2e citations, -- - `natbib` -- produce citations for the Natbib package, or -- - `biblatex` -- produce citations for the BibLaTeX package. -- -- For a list of fields in the writer, see [lunamark.writer.generic]. function M.new(options) options = options or {} local LaTeX = tex.new(options) function LaTeX.code(s) return {"\\texttt{",LaTeX.string(s),"}"} end function LaTeX.link(lab,src,tit) return {"\\href{",LaTeX.string(src),"}{",lab,"}"} end function LaTeX.image(lab,src,tit) return {"\\includegraphics{",LaTeX.string(src),"}"} end local function listitem(s) return {"\\item ",s} end function LaTeX.bulletlist(items) local buffer = {} for _,item in ipairs(items) do buffer[#buffer + 1] = listitem(item) end local contents = util.intersperse(buffer,"\n") return {"\\begin{itemize}\n",contents,"\n\\end{itemize}"} end function LaTeX.orderedlist(items) local buffer = {} for _,item in ipairs(items) do buffer[#buffer + 1] = listitem(item) end local contents = util.intersperse(buffer,"\n") return {"\\begin{enumerate}\n",contents,"\n\\end{enumerate}"} end function LaTeX.emphasis(s) return {"\\emph{",s,"}"} end function LaTeX.strong(s) return {"\\textbf{",s,"}"} end function LaTeX.blockquote(s) return {"\\begin{quote}\n",s,"\n\\end{quote}"} end function LaTeX.verbatim(s) return {"\\begin{verbatim}\n",s,"\\end{verbatim}"} end LaTeX.fenced_code = LaTeX.verbatim function LaTeX.header(s,level) local cmd if level == 1 then cmd = "\\section" elseif level == 2 then cmd = "\\subsection" elseif level == 3 then cmd = "\\subsubsection" elseif level == 4 then cmd = "\\paragraph" elseif level == 5 then cmd = "\\subparagraph" else cmd = "" end return {cmd,"{",s,"}"} end LaTeX.hrule = "\\hspace{\\fill}\\rule{.6\\linewidth}{0.4pt}\\hspace{\\fill}" function LaTeX.note(contents) return {"\\footnote{",contents,"}"} end local function citation_optargs(cite) if cite.prenote and cite.postnote then return {"[", cite.prenote, "][", cite.postnote, "]"} elseif cite.prenote and not cite.postnote then return {"[", cite.prenote, "][]"} elseif not cite.prenote and cite.postnote then return {"[", cite.postnote, "]"} else return "" end end if options.citations == true or options.citations == "latex" then --- Basic LaTeX2e citations function LaTeX.citations(_, cites) local buffer = {} local opened_braces = false for i, cite in ipairs(cites) do if cite.prenote or cite.postnote then -- A separate complex citation buffer[#buffer + 1] = {opened_braces and "}" or "", cite.prenote and {i == 1 and "" or " ", cite.prenote, "~"} or "", {(i == 1 or cite.prenote) and "" or " ", "\\cite"}, cite.postnote and {"[", cite.postnote, "]"} or "", "{", cite.name, cite_postnote and {"~", cite_postnote} or "", "}"} opened_braces = false else -- A string of simple citations buffer[#buffer + 1] = {opened_braces and ", " or {i == 1 and "" or " ", "\\cite{"}, cite.name} opened_braces = true end end if opened_braces then buffer[#buffer + 1] = "}" end return buffer end elseif options.citations == "natbib" then --- NatBib citations function LaTeX.citations(text_cites, cites) if #cites == 1 then -- A single citation local cite = cites[1] if text_cites then return {"\\citet", citation_optargs(cite), "{", cite.name, "}"} else return {cite.suppress_author and "\\citeyearpar" or "\\citep", citation_optargs(cite), "{", cite.name, "}"} end else -- A string of citations local complex = false local last_suppressed = nil for _, cite in ipairs(cites) do if cite.prenote or cite.postnote or cite.suppress_author == not last_suppressed then complex = true break end last_suppressed = cite.suppress_author end if complex then -- A string of complex citations local buffer = {"\\citetext{"} for i, cite in ipairs(cites) do buffer[#buffer + 1] = {i ~= 1 and "; " or "", cite.suppress_author and "\\citeyear" or (text_cites and "\\citealt" or "\\citealp"), citation_optargs(cite), "{", cite.name, "}"} end buffer[#buffer + 1] = "}" return buffer else -- A string of simple citations local buffer = {} for i, cite in ipairs(cites) do buffer[#buffer + 1] = {i == 1 and (text_cites and "\\citet{" or "\\citep{") or ", ", cite.name} end buffer[#buffer + 1] = "}" return buffer end end end elseif options.citations == "biblatex" then --- BibLaTeX citations function LaTeX.citations(text_cites, cites) if #cites == 1 then -- A single citation local cite = cites[1] if text_cites then return {"\\textcite", citation_optargs(cite), "{", cite.name, "}"} else return {"\\autocite", cite.suppress_author and "*" or "", citation_optargs(cite), "{", cite.name, "}"} end else -- A string of citations local buffer = {text_cites and "\\textcites" or "\\autocites"} for _, cite in ipairs(cites) do buffer[#buffer + 1] = {citation_optargs(cite), "{", cite.name, "}"} end return buffer end end end function LaTeX.definitionlist(items) local buffer = {} for _,item in ipairs(items) do buffer[#buffer + 1] = format("\\item[%s]\n%s", item.term, util.intersperse(item.definitions, LaTeX.interblocksep)) end local contents = util.intersperse(buffer, LaTeX.containersep) return {"\\begin{description}\n",contents,"\n\\end{description}"} end LaTeX.template = [===[ \documentclass{article} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \ifxetex \usepackage{fontspec,xltxtra,xunicode} \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \else \ifluatex \usepackage{fontspec} \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \else \usepackage[utf8]{inputenc} \fi \fi \ifxetex \usepackage[setpagesize=false, % page size defined by xetex unicode=false, % unicode breaks when used with xetex xetex]{hyperref} \else \usepackage[unicode=true]{hyperref} \fi \hypersetup{breaklinks=true, pdfborder={0 0 0}} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines \setcounter{secnumdepth}{0} \title{$title} \author{$sepby{author}[=[$it]=][=[ \and ]=]} \date{$date} \begin{document} $if{ title }[[\maketitle ]] $body \end{document} ]===] return LaTeX end return M
mit
PetarTilevRusev/EndlessWar
game/scripts/vscripts/libraries/modifiers/modifier_animation.lua
24
10825
modifier_animation = class({}) local _CODE_TO_ANIMATION_TRANSLATE = { [0]= "loadout", [1]= "split_shot", [2]= "chemical_rage", [3]= "agedspirit", [4]= "aggressive", [5]= "injured", [6]= "ancient_armor", [7]= "anvil", [8]= "arcana", [9]= "techies_arcana", [10]= "fast", [11]= "faster", [12]= "fastest", [13]= "abysm", [14]= "dualwield", [15]= "forcestaff_friendly", [16]= "phantom_attack", [17]= "snowangel", [18]= "suicide_squad", [19]= "taunt_fullbody", [20]= "armaments_set", [21]= "instagib", [22]= "tidehunter_boat", [23]= "shinobi_tail", [24]= "tidebringer", [25]= "masquerade", [26]= "pyre", [27]= "shinobi", [28]= "immortal", [29]= "cauldron", [30]= "red_moon", [31]= "when_nature_attacks", [32]= "odachi", [33]= "wraith_spin", [34]= "eyeoffetizu", [35]= "berserkers_blood", [36]= "flying", [37]= "frost_arrow", [38]= "manta", [39]= "come_get_it", [40]= "good_day_sir", [41]= "backstab", [42]= "offhand_basher", [43]= "batter_up", [44]= "black", [45]= "haste", [46]= "with_item", [47]= "bot", [48]= "web", [49]= "fountain", [50]= "broodmother_spin", [51]= "burrowed", [52]= "sandking_rubyspire_burrowstrike", [53]= "moth", [54]= "frostivus", [55]= "desolation", [56]= "sm_head", [57]= "chasm", [58]= "greevil_black_hole", [59]= "greevil_blade_fury", [60]= "greevil_bloodlust", [61]= "greevil_cold_snap", [62]= "greevil_decrepify", [63]= "greevil_diabolic_edict", [64]= "greevil_echo_slam", [65]= "greevil_fatal_bonds", [66]= "greevil_ice_wall", [67]= "ancestral_scepter", [68]= "greevil_laguna_blade", [69]= "greevil_leech_seed", [70]= "greevil_magic_missile", [71]= "greevil_maledict", [72]= "greevil_miniboss_black_brain_sap", [73]= "greevil_miniboss_black_nightmare", [74]= "greevil_miniboss_blue_cold_feet", [75]= "greevil_miniboss_blue_ice_vortex", [76]= "greevil_miniboss_green_living_armor", [77]= "greevil_miniboss_green_overgrowth", [78]= "greevil_miniboss_orange_dragon_slave", [79]= "greevil_miniboss_orange_lightstrike_array", [80]= "greevil_miniboss_purple_plague_ward", [81]= "greevil_miniboss_purple_venomous_gale", [82]= "greevil_miniboss_red_earthshock", [83]= "greevil_miniboss_red_overpower", [84]= "greevil_miniboss_white_purification", [85]= "greevil_miniboss_yellow_ion_shell", [86]= "greevil_miniboss_yellow_surge", [87]= "greevil_natures_attendants", [88]= "greevil_phantom_strike", [89]= "greevil_poison_nova", [90]= "greevil_purification", [91]= "greevil_shadow_strike", [92]= "greevil_shadow_wave", [93]= "stalker_exo", [94]= "death_protest", [95]= "nihility", [96]= "deadwinter_soul", [97]= "charge", [98]= "charge_attack", [99]= "iron_surge", [100]= "impatient_maiden", [101]= "glacier", [102]= "snowball", [103]= "corpse_dresstop", [104]= "corpse_dress", [105]= "corpse_scarf", [106]= "unbroken", [107]= "dc_sb_charge", [108]= "dc_sb_charge_attack", [109]= "dc_sb_charge_finish", [110]= "dc_sb_ultimate", [111]= "faces_hakama", [112]= "faces_wraps", [113]= "faces_mask", [114]= "lodestar", [115]= "reincarnate", [116]= "demon_drain", [117]= "divine_sorrow", [118]= "divine_sorrow_loadout", [119]= "divine_sorrow_loadout_spawn", [120]= "divine_sorrow_sunstrike", [121]= "duel_kill", [122]= "forcestaff_enemy", [123]= "fish_slap", [124]= "focusfire", [125]= "fear", [126]= "ftp_dendi_back", [127]= "triumphant_timelord", [128]= "ground_pound", [129]= "harlequin", [130]= "injured_aggressive", [131]= "f2p_doom", [132]= "obsidian_helmet", [133]= "item_style_2", [134]= "blood_chaser", [135]= "manias_mask", [136]= "punch", [137]= "thirst", [138]= "impetus", [139]= "taunt_killtaunt", [140]= "level_1", [141]= "level_2", [142]= "level_3", [143]= "dagger_twirl", [144]= "ancestors_edge", [145]= "ancestors_pauldron", [146]= "ancestors_vambrace", [147]= "bladebiter", [148]= "burning_fiend", [149]= "fiery_soul", [150]= "frostiron_raider", [151]= "obeisance_of_the_keeper", [152]= "salvaged_sword", [153]= "serene_honor", [154]= "shinobi_mask", [155]= "swordonshoulder", [156]= "whalehook", [157]= "winterblight", [158]= "lucentyr", [159]= "lyreleis_breeze", [160]= "mace", [161]= "tinker_rollermaw", [162]= "meld", [163]= "agrressive", [164]= "miniboss", [165]= "moonfall", [166]= "moon_griffon", [167]= "overpower1", [168]= "overpower2", [169]= "overpower3", [170]= "overpower4", [171]= "overpower5", [172]= "overpower6", [173]= "loda", [174]= "dark_wraith", [175]= "pinfold", [176]= "digger", [177]= "portrait_fogheart", [178]= "silent_ripper", [179]= "shake_moneymaker", [180]= "belly_flop", [181]= "roshan", [182]= "am_blink", [183]= "mana_void", [184]= "culling_blade", [185]= "brain_sap", [186]= "fiends_grip", [187]= "roar", [188]= "axes", [189]= "stolen_firefly", [190]= "firefly", [191]= "freezing_field", [192]= "frostbite", [193]= "crystal_nova", [194]= "black_hole", [195]= "fissure", [196]= "slam", [197]= "totem", [198]= "omnislash", [199]= "spin", [200]= "finger", [201]= "impale", [202]= "laguna", [203]= "lsa", [204]= "mana_drain", [205]= "wave", [206]= "leap", [207]= "requiem", [208]= "shadowraze", [209]= "sprout", [210]= "summon", [211]= "teleport", [212]= "wrath", [213]= "darkness", [214]= "void", [215]= "guardian_angel", [216]= "purification", [217]= "repel", [218]= "dismember", [219]= "life_drain", [220]= "hook", [221]= "qop_blink", [222]= "scream", [223]= "shadow_strike", [224]= "sonic_wave", [225]= "ravage", [226]= "snipe", [227]= "stolen_charge", [228]= "strike", [229]= "burrow", [230]= "shrapnel", [231]= "ball_lightning", [232]= "remnant", [233]= "bolt", [234]= "vortex", [235]= "earthshock", [236]= "gale", [237]= "plague_ward", [238]= "poison_nova", [239]= "viper_strike", [240]= "wall", [241]= "ward", [242]= "powershot", [243]= "end", [244]= "windrun", [245]= "windy", [246]= "chase", [247]= "injured rare", [248]= "pegleg", [249]= "start", [250]= "sb_helmet", [251]= "sb_bracers", [252]= "sb_shoulder", [253]= "sb_spear", [254]= "dominator", [255]= "iron", [256]= "sven_shield", [257]= "sven_warcry", [258]= "chicken_gesture", [259]= "emp", [260]= "slasher_weapon", [261]= "slasher_offhand", [262]= "slasher_chest", [263]= "slasher_mask", [264]= "sm_armor", [265]= "sm_shoulder", [266]= "wolfhound", [267]= "great_safari", [268]= "taunt_quickdraw_gesture", [269]= "sparrowhawk_bow", [270]= "sparrowhawk_cape", [271]= "sparrowhawk_quiver", [272]= "sparrowhawk_hood", [273]= "sparrowhawk_shoulder", [274]= "twister", [275]= "sprint", [276]= "sugarrush", [277]= "trickortreat", [278]= "transition", [279]= "torment", [280]= "stinger", [281]= "whats_that", [282]= "witchdoctor_jig", [283]= "backstroke_gesture", [284]= "bazooka", [285]= "cat_dancer_gesture", [286]= "face_me", [287]= "swag_gesture", [288]= "get_burned", [289]= "giddy_up_gesture", [290]= "guitar", [291]= "hang_loose_gesture", [292]= "horn", [293]= "happy_dance", [294]= "jump_gesture", [295]= "loser", [296]= "lute", [297]= "magic_ends_here", [298]= "mag_power_gesture", [299]= "mask_lord", [300]= "poundnpoint", [301]= "robot_gesture", [302]= "taunt_roll_gesture", [303]= "sharp_blade", [304]= "staff_swing", [305]= "groove_gesture", [306]= "telebolt", [307]= "admirals_prow", [308]= "turbulent_teleport", [309]= "timelord_head", [310]= "tree", [311]= "dryad_tree", [312]= "tidehunter_toss_fish", [313]= "enchant_totem", [314]= "trapper", [315]= "twinblade_attack", [316]= "twinblade_attack_b", [317]= "twinblade_attack_c", [318]= "twinblade_attack_d", [319]= "twinblade_attack_injured", [320]= "twinblade_death", [321]= "twinblade_idle", [322]= "twinblade_idle_injured", [323]= "twinblade_idle_rare", [324]= "twinblade_injured_attack_b", [325]= "twinblade_jinada", [326]= "twinblade_jinada_injured", [327]= "twinblade_shuriken_toss", [328]= "twinblade_shuriken_toss_injured", [329]= "twinblade_spawn", [330]= "twinblade_stun", [331]= "twinblade_track", [332]= "twinblade_track_injured", [333]= "twinblade_victory", [334]= "melee", [335]= "backward", [336]= "forward", [337]= "vendetta", [338]= "viridi_set", [339]= "fishstick", [340]= "dogofduty", [341]= "cryAnimationExportNode", [342]= "dog_of_duty", [343]= "dizzying_punch", [344]= "wardstaff", [345]= "glory", [346]= "white", [347]= "tidehunter_yippy", [348]= "rampant", [349]= "overload", [350]="surge", [351]="es_prosperity", [352]="Espada_pistola", [353]="overload_injured", [354]="ss_fortune", [355]="liquid_fire", [356]="jakiro_icemelt", [357]="jakiro_roar", [358]="chakram", [359]="doppelwalk", [360]="enrage", [361]="fast_run", [362]="overpower", [363]="overwhelmingodds", [364]="pregame", [365]="shadow_dance", [366]="shukuchi", [367]="strength", [368]="twinblade_run", [369]="twinblade_run_injured", [370]="windwalk", } function modifier_animation:OnCreated(keys) self.keys = keys if not IsServer() then local stack = keys.stack_count local activity = bit.band(stack, 0x07FF) local rate = bit.rshift(bit.band(stack, 0x7F800), 11) local rest = bit.rshift(bit.band(stack, 0xFFF80000), 19) self.activity = activity self.rate = rate / 20 self.rest = rest --print(self.activity) --print(self.rate) --print(self.rest) self.translate = _CODE_TO_ANIMATION_TRANSLATE[self.rest] else self.translate = keys.translate end end function modifier_animation:GetAttributes() return MODIFIER_ATTRIBUTE_PERMANENT + MODIFIER_ATTRIBUTE_IGNORE_INVULNERABLE --+ MODIFIER_ATTRIBUTE_MULTIPLE end function modifier_animation:IsHidden() return true end function modifier_animation:IsDebuff() return false end function modifier_animation:IsPurgable() return false end function modifier_animation:DeclareFunctions() local funcs = { MODIFIER_PROPERTY_OVERRIDE_ANIMATION, MODIFIER_PROPERTY_OVERRIDE_ANIMATION_RATE, MODIFIER_PROPERTY_OVERRIDE_ANIMATION_WEIGHT, MODIFIER_PROPERTY_TRANSLATE_ACTIVITY_MODIFIERS, } return funcs end function modifier_animation:GetOverrideAnimation(...) return self.activity end function modifier_animation:GetOverrideAnimationRate(...) return self.rate end function modifier_animation:GetOverrideAnimationWeight(...) return 1 end function modifier_animation:GetActivityTranslationModifiers(...) --print('MA: ', self.translate, IsServer()) return self.translate or 0 end
mit
Ninjistix/darkstar
scripts/zones/Western_Adoulin/npcs/Nylene.lua
7
1244
----------------------------------- -- Area: Western Adoulin -- NPC: Nylene -- Type: Standard NPC and Quest NPC -- Involved with Quest: 'A Certain Substitute Patrolman' -- @zone 256 -- !pos 12 0 -82 ----------------------------------- require("scripts/globals/missions"); require("scripts/globals/quests"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local ACSP = player:getQuestStatus(ADOULIN, A_CERTAIN_SUBSTITUTE_PATROLMAN); local SOA_Mission = player:getCurrentMission(SOA); if (SOA_Mission >= LIFE_ON_THE_FRONTIER) then if ((ACSP == QUEST_ACCEPTED) and (player:getVar("ACSP_NPCs_Visited") == 7)) then -- Progresses Quest: 'A Certain Substitute Patrolman' player:startEvent(2559); else -- Standard dialogue player:startEvent(562); end else -- Dialogue prior to joining colonization effort player:startEvent(533); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 2559) then -- Progresses Quest: 'A Certain Substitute Patrolman' player:setVar("ACSP_NPCs_Visited", 8); end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Al_Zahbi/npcs/Zafif.lua
5
1524
----------------------------------- -- Area: Al Zahbi -- NPC: Zafif -- Standard Merchant NPC ----------------------------------- require("scripts/globals/shop"); package.loaded["scripts/zones/Al_Zahbi/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Al_Zahbi/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) player:showText(npc,ZAFIF_SHOP_DIALOG); local stock = { 0x1204,23400, -- Scroll of Cure IV 0x1208,11200, -- Scroll of Curaga II 0x1209,19932, -- Scroll of Curaga III 0x122D,32000, -- Scroll of Protect III 0x122E,91116, -- Scroll of Protect IV 0x1280,85500, -- Scroll of Protectra IV 0x1215,35000, -- Scroll of Holy 0x1227,20000, -- Scroll of Banishga II 0x1211,2330, -- Scroll of Silena 0x1212,19200, -- Scroll of Stona 0x1213,13300, -- Scroll of Viruna 0x1214,8586, -- Scroll of Cursna 0x1304,77600, -- Scroll of Dispell 0x1270,27000, -- Scroll of Flash 0x128E,99375, -- Scroll of Reraise III 0x126B,28500} -- Scroll of Reprisal showShop(player, STATIC, stock); end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
jamiepg1/MCServer
lib/tolua++/src/bin/lua/package.lua
16
10650
-- tolua: package class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Package class -- Represents the whole package being bound. -- The following fields are stored: -- {i} = list of objects in the package. classPackage = { classtype = 'package' } classPackage.__index = classPackage setmetatable(classPackage,classContainer) -- Print method function classPackage:print () print("Package: "..self.name) local i=1 while self[i] do self[i]:print("","") i = i+1 end end function classPackage:preprocess () -- avoid preprocessing embedded Lua code local L = {} self.code = gsub(self.code,"\n%s*%$%[","\1") -- deal with embedded lua code self.code = gsub(self.code,"\n%s*%$%]","\2") self.code = gsub(self.code,"(%b\1\2)", function (c) tinsert(L,c) return "\n#["..getn(L).."]#" end) -- avoid preprocessing embedded C code local C = {} self.code = gsub(self.code,"\n%s*%$%<","\3") -- deal with embedded C code self.code = gsub(self.code,"\n%s*%$%>","\4") self.code = gsub(self.code,"(%b\3\4)", function (c) tinsert(C,c) return "\n#<"..getn(C)..">#" end) -- avoid preprocessing embedded C code self.code = gsub(self.code,"\n%s*%$%{","\5") -- deal with embedded C code self.code = gsub(self.code,"\n%s*%$%}","\6") self.code = gsub(self.code,"(%b\5\6)", function (c) tinsert(C,c) return "\n#<"..getn(C)..">#" end) --self.code = gsub(self.code,"\n%s*#[^d][^\n]*\n", "\n\n") -- eliminate preprocessor directives that don't start with 'd' self.code = gsub(self.code,"\n[ \t]*#[ \t]*[^d%<%[]", "\n//") -- eliminate preprocessor directives that don't start with 'd' -- avoid preprocessing verbatim lines local V = {} self.code = gsub(self.code,"\n(%s*%$[^%[%]][^\n]*)",function (v) tinsert(V,v) return "\n#"..getn(V).."#" end) -- perform global substitution self.code = gsub(self.code,"(//[^\n]*)","") -- eliminate C++ comments self.code = gsub(self.code,"/%*","\1") self.code = gsub(self.code,"%*/","\2") self.code = gsub(self.code,"%b\1\2","") self.code = gsub(self.code,"\1","/%*") self.code = gsub(self.code,"\2","%*/") self.code = gsub(self.code,"%s*@%s*","@") -- eliminate spaces beside @ self.code = gsub(self.code,"%s?inline(%s)","%1") -- eliminate 'inline' keyword --self.code = gsub(self.code,"%s?extern(%s)","%1") -- eliminate 'extern' keyword --self.code = gsub(self.code,"%s?virtual(%s)","%1") -- eliminate 'virtual' keyword --self.code = gsub(self.code,"public:","") -- eliminate 'public:' keyword self.code = gsub(self.code,"([^%w_])void%s*%*","%1_userdata ") -- substitute 'void*' self.code = gsub(self.code,"([^%w_])void%s*%*","%1_userdata ") -- substitute 'void*' self.code = gsub(self.code,"([^%w_])char%s*%*","%1_cstring ") -- substitute 'char*' self.code = gsub(self.code,"([^%w_])lua_State%s*%*","%1_lstate ") -- substitute 'lua_State*' -- restore embedded Lua code self.code = gsub(self.code,"%#%[(%d+)%]%#",function (n) return L[tonumber(n)] end) -- restore embedded C code self.code = gsub(self.code,"%#%<(%d+)%>%#",function (n) return C[tonumber(n)] end) -- restore verbatim lines self.code = gsub(self.code,"%#(%d+)%#",function (n) return V[tonumber(n)] end) self.code = string.gsub(self.code, "\n%s*%$([^\n]+)", function (l) Verbatim(l.."\n") return "\n" end) end -- translate verbatim function classPackage:preamble () output('/*\n') output('** Lua binding: '..self.name..'\n') output('** Generated automatically by '..TOLUA_VERSION..' on '..date()..'.\n') output('*/\n\n') output('#ifndef __cplusplus\n') output('#include "stdlib.h"\n') output('#endif\n') output('#include "string.h"\n\n') output('#include "tolua++.h"\n\n') if not flags.h then output('/* Exported function */') output('TOLUA_API int tolua_'..self.name..'_open (lua_State* tolua_S);') output('\n') end local i=1 while self[i] do self[i]:preamble() i = i+1 end if self:requirecollection(_collect) then output('\n') output('/* function to release collected object via destructor */') output('#ifdef __cplusplus\n') for i,v in pairs(_collect) do output('\nstatic int '..v..' (lua_State* tolua_S)') output('{') output(' '..i..'* self = ('..i..'*) tolua_tousertype(tolua_S,1,0);') output(' Mtolua_delete(self);') output(' return 0;') output('}') end output('#endif\n\n') end output('\n') output('/* function to register type */') output('static void tolua_reg_types (lua_State* tolua_S)') output('{') if flags.t then output("#ifndef Mtolua_typeid\n#define Mtolua_typeid(L,TI,T)\n#endif\n") end foreach(_usertype,function(n,v) if (not _global_classes[v]) or _global_classes[v]:check_public_access() then output(' tolua_usertype(tolua_S,"',v,'");') if flags.t then output(' Mtolua_typeid(tolua_S,typeid(',v,'), "',v,'");') end end end) output('}') output('\n') end -- register package -- write package open function function classPackage:register (pre) pre = pre or '' push(self) output(pre.."/* Open function */") output(pre.."TOLUA_API int tolua_"..self.name.."_open (lua_State* tolua_S)") output(pre.."{") output(pre.." tolua_open(tolua_S);") output(pre.." tolua_reg_types(tolua_S);") output(pre.." tolua_module(tolua_S,NULL,",self:hasvar(),");") output(pre.." tolua_beginmodule(tolua_S,NULL);") local i=1 while self[i] do self[i]:register(pre.." ") i = i+1 end output(pre.." tolua_endmodule(tolua_S);") output(pre.." return 1;") output(pre.."}") output("\n\n") output("#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501\n"); output(pre.."TOLUA_API int luaopen_"..self.name.." (lua_State* tolua_S) {") output(pre.." return tolua_"..self.name.."_open(tolua_S);") output(pre.."};") output("#endif\n\n") pop() end -- write header file function classPackage:header () output('/*\n') output('** Lua binding: '..self.name..'\n') output('** Generated automatically by '..TOLUA_VERSION..' on '..date()..'.\n') output('*/\n\n') if not flags.h then output('/* Exported function */') output('TOLUA_API int tolua_'..self.name..'_open (lua_State* tolua_S);') output('\n') end end -- Internal constructor function _Package (self) setmetatable(self,classPackage) return self end -- Parse C header file with tolua directives -- *** Thanks to Ariel Manzur for fixing bugs in nested directives *** function extract_code(fn,s) local code = '\n$#include "'..fn..'"\n' s= "\n" .. s .. "\n" -- add blank lines as sentinels local _,e,c,t = strfind(s, "\n([^\n]-)[Tt][Oo][Ll][Uu][Aa]_([^%s]*)[^\n]*\n") while e do t = strlower(t) if t == "begin" then _,e,c = strfind(s,"(.-)\n[^\n]*[Tt][Oo][Ll][Uu][Aa]_[Ee][Nn][Dd][^\n]*\n",e) if not e then tolua_error("Unbalanced 'tolua_begin' directive in header file") end end code = code .. c .. "\n" _,e,c,t = strfind(s, "\n([^\n]-)[Tt][Oo][Ll][Uu][Aa]_([^%s]*)[^\n]*\n",e) end return code end -- Constructor -- Expects the package name, the file extension, and the file text. function Package (name,fn) local ext = "pkg" -- open input file, if any local st,msg if fn then st, msg = readfrom(flags.f) if not st then error('#'..msg) end local _; _, _, ext = strfind(fn,".*%.(.*)$") end local code if ext == 'pkg' then code = prep(st) else code = "\n" .. read('*a') if ext == 'h' or ext == 'hpp' then code = extract_code(fn,code) end end -- close file if fn then readfrom() end -- deal with include directive local nsubst repeat code,nsubst = gsub(code,'\n%s*%$(.)file%s*"(.-)"([^\n]*)\n', function (kind,fn,extra) local _, _, ext = strfind(fn,".*%.(.*)$") local fp,msg = openfile(fn,'r') if not fp then error('#'..msg..': '..fn) end if kind == 'p' then local s = prep(fp) closefile(fp) return s end local s = read(fp,'*a') closefile(fp) if kind == 'c' or kind == 'h' then return extract_code(fn,s) elseif kind == 'l' then return "\n$[--##"..fn.."\n" .. s .. "\n$]\n" elseif kind == 'i' then local t = {code=s} extra = string.gsub(extra, "^%s*,%s*", "") local pars = split_c_tokens(extra, ",") include_file_hook(t, fn, unpack(pars)) return "\n\n" .. t.code else error('#Invalid include directive (use $cfile, $pfile, $lfile or $ifile)') end end) until nsubst==0 -- deal with renaming directive repeat -- I don't know why this is necesary code,nsubst = gsub(code,'\n%s*%$renaming%s*(.-)%s*\n', function (r) appendrenaming(r) return "\n" end) until nsubst == 0 local t = _Package(_Container{name=name, code=code}) push(t) preprocess_hook(t) t:preprocess() preparse_hook(t) t:parse(t.code) pop() return t end setmetatable(_extra_parameters, { __index = _G }) function prep(file) local chunk = {'local __ret = {"\\n"}\n'} for line in file:lines() do if string.find(line, "^##") then table.insert(chunk, string.sub(line, 3) .. "\n") else local last = 1 for text, expr, index in string.gfind(line, "(.-)$(%b())()") do last = index if text ~= "" then table.insert(chunk, string.format('table.insert(__ret, %q )', text)) end table.insert(chunk, string.format('table.insert(__ret, %s )', expr)) end table.insert(chunk, string.format('table.insert(__ret, %q)\n', string.sub(line, last).."\n")) end end table.insert(chunk, '\nreturn table.concat(__ret)\n') local f,e = loadstring(table.concat(chunk)) if e then error("#"..e) end setfenv(f, _extra_parameters) return f() end
apache-2.0
Ninjistix/darkstar
scripts/zones/Nashmau/npcs/Dnegan.lua
5
1843
----------------------------------- -- Area: Nashmau -- NPC: Dnegan -- Standard Info NPC -- Involved in quest: Wayward Automation -- !pos 29.89 -6 55.83 53 ----------------------------------- require("scripts/globals/quests"); function onTrade(player,npc,trade) end; function onTrigger(player,npc) local TheWaywardAutomation = player:getQuestStatus(AHT_URHGAN,THE_WAYWARD_AUTOMATION); local TheWaywardAutomationProgress = player:getVar("TheWaywardAutomationProgress"); local OperationTeatime = player:getQuestStatus(AHT_URHGAN,OPERATION_TEATIME); local OperationTeatimeProgress = player:getVar("OperationTeatimeProgress"); local OTT_DayWait = player:getVar("OTT_DayWait"); local Gameday = VanadielDayOfTheYear(); -- Quest: The WayWard Automation if (TheWaywardAutomation == QUEST_ACCEPTED and TheWaywardAutomationProgress == 1) then player:startEvent(289); -- he tells u to go Caedarva Mire elseif (TheWaywardAutomationProgress == 2) then player:startEvent(289); -- Hint to go to Caedarva Mire -- Quest: Operation Teatime elseif (OperationTeatimeProgress == 2 and OTT_DayWait ~= Gameday) then player:startEvent(290); -- CS for Chai else player:startEvent(288); end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 289) then player:setVar("TheWaywardAutomationProgress",2); elseif (csid == 290 and option == 0) then player:setVar("OTT_DayWait", VanadielDayOfTheYear()); elseif (csid == 290 and option == 1) then player:setVar("OperationTeatimeProgress",3) player:setVar("OTT_DayWait",0) end end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Beadeaux/npcs/qm2.lua
5
1119
-------------------------- -- Area: Beadeaux -- NPC: ??? (qm2) -- Type: Quest NPC -- !pos -79 1 -99 147 -------------------------- package.loaded["scripts/zones/Beadeaux/TextIDs"] = nil; -------------------------- require("scripts/zones/Beadeaux/TextIDs"); require("scripts/globals/keyitems"); require("scripts/globals/weather"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) -- TODO: The ??? should only spawn during rainy weather, temporary fix in place to prevent players from getting the keyitem unless the proper weather is present. if (player:getQuestStatus(BASTOK,BEADEAUX_SMOG) == QUEST_ACCEPTED and player:hasKeyItem(CORRUPTED_DIRT) == false and player:getWeather() == WEATHER_RAIN) then player:addKeyItem(CORRUPTED_DIRT); player:messageSpecial(KEYITEM_OBTAINED,CORRUPTED_DIRT); end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
Ninjistix/darkstar
scripts/zones/Inner_Horutoto_Ruins/npcs/_5ct.lua
5
2222
----------------------------------- -- Area: Inner Horutoto Ruins -- NPC: _5ct (Magical Gizmo) #5 -- Involved In Mission: The Horutoto Ruins Experiment ----------------------------------- package.loaded["scripts/zones/Inner_Horutoto_Ruins/TextIDs"] = nil; ----------------------------------- require("scripts/globals/missions"); require("scripts/zones/Inner_Horutoto_Ruins/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) -- The Magical Gizmo Number, this number will be compared to the random -- value created by the mission The Horutoto Ruins Experiment, when you -- reach the Gizmo Door and have the cutscene local magical_gizmo_no = 5; -- of the 6 -- Check if we are on Windurst Mission 1-1 if (player:getCurrentMission(WINDURST) == THE_HORUTOTO_RUINS_EXPERIMENT and player:getVar("MissionStatus") == 2) then -- Check if we found the correct Magical Gizmo or not if (player:getVar("MissionStatus_rv") == magical_gizmo_no) then player:startEvent(56); else if (player:getVar("MissionStatus_op5") == 2) then -- We've already examined this player:messageSpecial(EXAMINED_RECEPTACLE); else -- Opened the wrong one player:startEvent(57); end end end return 1; end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); -- If we just finished the cutscene for Windurst Mission 1-1 -- The cutscene that we opened the correct Magical Gizmo if (csid == 56) then player:setVar("MissionStatus",3); player:setVar("MissionStatus_rv", 0); player:addKeyItem(CRACKED_MANA_ORBS); player:messageSpecial(KEYITEM_OBTAINED,CRACKED_MANA_ORBS); elseif (csid == 57) then -- Opened the wrong one player:setVar("MissionStatus_op5", 2); -- Give the message that thsi orb is not broken player:messageSpecial(NOT_BROKEN_ORB); end end;
gpl-3.0
davidbuzz/ardupilot
libraries/AP_Scripting/examples/set-target-velocity.lua
18
3704
-- command a Copter to takeoff to 10m and fly a square pattern -- -- CAUTION: This script only works for Copter -- this script waits for the vehicle to be armed and RC6 input > 1800 and then: -- a) switches to Guided mode -- b) takeoff to 10m -- c) flies a 20m x 20m square pattern using the velocity controller -- d) switches to RTL mode local takeoff_alt_above_home = 10 local copter_guided_mode_num = 4 local copter_rtl_mode_num = 6 local stage = 0 local bottom_left_loc -- vehicle location when starting square local square_side_length = 20 -- length of each side of square -- the main update function that uses the takeoff and velocity controllers to fly a rough square pattern function update() if not arming:is_armed() then -- reset state when disarmed stage = 0 else pwm6 = rc:get_pwm(6) if pwm6 and pwm6 > 1800 then -- check if RC7 input has moved high if (stage == 0) then -- change to guided mode if (vehicle:set_mode(copter_guided_mode_num)) then -- change to Guided mode stage = stage + 1 end elseif (stage == 1) then -- Stage1: takeoff if (vehicle:start_takeoff(takeoff_alt_above_home)) then stage = stage + 1 end elseif (stage == 2) then -- Stage2: check if vehicle has reached target altitude local home = ahrs:get_home() local curr_loc = ahrs:get_location() if home and curr_loc then local vec_from_home = home:get_distance_NED(curr_loc) gcs:send_text(0, "alt above home: " .. tostring(math.floor(-vec_from_home:z()))) if (math.abs(takeoff_alt_above_home + vec_from_home:z()) < 1) then stage = stage + 1 bottom_left_loc = curr_loc -- record location when starting square end end elseif (stage >= 3 and stage <= 6) then -- fly a square using velocity controller local curr_loc = ahrs:get_location() local target_vel = Vector3f() -- create velocity vector if (bottom_left_loc and curr_loc) then local dist_NE = bottom_left_loc:get_distance_NE(curr_loc) -- Stage3 : fly North at 2m/s if (stage == 3) then target_vel:x(2) if (dist_NE:x() >= square_side_length) then stage = stage + 1 end end -- Stage4 : fly East at 2m/s if (stage == 4) then target_vel:y(2) if (dist_NE:y() >= square_side_length) then stage = stage + 1 end end -- Stage5 : fly South at 2m/s if (stage == 5) then target_vel:x(-2) if (dist_NE:x() <= 2) then stage = stage + 1 end end -- Stage6 : fly West at 2m/s if (stage == 6) then target_vel:y(-2) if (dist_NE:y() <= 2) then stage = stage + 1 end end -- send velocity request if (vehicle:set_target_velocity_NED(target_vel)) then -- send target velocity to vehicle gcs:send_text(0, "pos:" .. tostring(math.floor(dist_NE:x())) .. "," .. tostring(math.floor(dist_NE:y())) .. " sent vel x:" .. tostring(target_vel:x()) .. " y:" .. tostring(target_vel:y())) else gcs:send_text(0, "failed to execute velocity command") end end elseif (stage == 7) then -- Stage7: change to RTL mode vehicle:set_mode(copter_rtl_mode_num) stage = stage + 1 gcs:send_text(0, "finished square, switching to RTL") end end end return update, 1000 end return update()
gpl-3.0
Ninjistix/darkstar
scripts/zones/Caedarva_Mire/TextIDs.lua
5
1405
-- Variable TextID Description text -- General Texts ITEM_CANNOT_BE_OBTAINED = 6380; -- You cannot obtain the item <item>. Come back after sorting your inventory. ITEM_OBTAINED = 6386; -- Obtained: <item>. GIL_OBTAINED = 6387; -- Obtained <number> gil. KEYITEM_OBTAINED = 6389; -- Obtained key item: <keyitem>. FISHING_MESSAGE_OFFSET = 7047; -- You can't fish here. HOMEPOINT_SET = 8972; -- Home point set! -- Logging LOGGING_IS_POSSIBLE_HERE = 7341; -- Logging is possible here if you have -- Assault CANNOT_ENTER = 7461; -- You cannot enter at this time. Please wait a while before trying again. AREA_FULL = 7462; -- This area is fully occupied. You were unable to enter. MEMBER_NO_REQS = 7466; -- Not all of your party members meet the requirements for this objective. Unable to enter area. MEMBER_TOO_FAR = 7470; -- One or more party members are too far away from the entrance. Unable to enter area. -- Other Texts RESPONSE = 7327; -- There is no response... NOTHING_OUT_OF_ORDINARY = 7379; --There is nothing out of the ordinary here. NOTHING_HAPPENS = 7447; -- Nothing happens... JAZARAATS_HEADSTONE = 7522; -- The name "Sir Jazaraat" is engraved on the headstone... SEAPRINCES_TOMBSTONE = 8046; -- It appears to be the grave of a great soul to an age long past.
gpl-3.0
wounds1/zaza2
plugins/kickbot.lua
5
1372
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY OmarReal ▀▄ ▄▀ ▀▄ ▄▀ BY OmarReal (Omar_Real7) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY OmarReal ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀ --]] do -- Will kickbot the group if be added local function run(msg, matches) local bot_id = our_id local receiver = get_receiver(msg) if matches[1] == 'غادر' and is_admin1(msg) then chat_del_user("chat#id"..msg.to.id, 'user#id'..bot_id, ok_cb, false) leave_channel(receiver, ok_cb, false) elseif msg.service and msg.action.type == "chat_add_user" and msg.action.user.id == tonumber(bot_id) and not is_admin1(msg) then send_large_msg(receiver, 'This is not one of my groups.', ok_cb, false) chat_del_user(receiver, 'user#id'..bot_id, ok_cb, false) leave_channel(receiver, ok_cb, false) end end return { patterns = { "^(غادر)$", "^!!tgservice (.+)$", }, run = run } end
gpl-2.0
davidbuzz/ardupilot
libraries/AP_Scripting/examples/ahrs-source-gps-optflow.lua
11
11422
-- switches between AHRS/EKF sources based on the pilot's source selection switch or using an automatic source selection algorithm -- this script is intended to help vehicles automatically switch between GPS and optical flow -- -- configure a forward or downward facing lidar with a range of at least 5m -- setup RCx_OPTION = 90 (EKF Pos Source) to select the source (low=GPS, middle=opticalflow, high=Not Used) -- setup RCx_OPTION = 300 (Scripting1). When this switch is pulled high, the source will be automatically selected -- SRC_ENABLE = 1 (enable scripting) -- setup EK3_SRCn_ parameters so that GPS is the primary source, opticalflow is secondary. -- EK3_SRC1_POSXY = 3 (GPS) -- EK3_SRC1_VELXY = 3 (GPS) -- EK3_SRC1_VELZ = 3 (GPS) -- EK3_SRC1_POSZ = 1 (Baro) -- EK3_SRC1_YAW = 1 (Compass) -- EK3_SRC2_POSXY = 0 (None) -- EK3_SRC2_VELXY = 5 (OpticalFlow) -- EK3_SRC2_VELZ = 0 (None) -- EK3_SRC2_POSZ = 1 (Baro) -- EK3_SRC2_YAW = 1 (Compass) -- EK3_SRC_OPTIONS = 0 (Do not fuse all velocities) -- -- SCR_USER1 holds the threshold (in meters) for rangefinder altitude (around 15 is a good choice) -- if rangefinder distance >= SCR_USER1, source1 (GPS) will be used -- if rangefinder distance < SCR_USER1, source2 (optical flow) will be used if innovations are below SRC_USER3 value -- SCR_USER2 holds the threshold for GPS speed accuracy (around 0.3 is a good choice) -- SCR_USER3 holds the threshold for optical flow quality (about 50 is a good choice) -- SCR_USER4 holds the threshold for optical flow innovations (about 0.15 is a good choice) -- -- When the 2nd auxiliary switch (300/Scripting1) is pulled high automatic source selection uses these thresholds: local rangefinder_rotation = 25 -- check downward (25) facing lidar local source_prev = 0 -- previous source, defaults to primary source local sw_source_prev = -1 -- previous source switch position local sw_auto_pos_prev = -1 -- previous auto source switch position local auto_switch = false -- true when auto switching between sources is active local gps_usable_accuracy = 1.0 -- GPS is usable if speed accuracy is at or below this value local vote_counter_max = 20 -- when a vote counter reaches this number (i.e. 2sec) source may be switched local gps_vs_opticalflow_vote = 0 -- vote counter for GPS vs optical (-20 = GPS, +20 = optical flow) local scr_user1_param = Parameter() -- user1 param (rangefinder altitude threshold) local scr_user2_param = Parameter() -- user2 param (GPS speed accuracy threshold) local scr_user3_param = Parameter() -- user3 param (optical flow quality threshold) local scr_user4_param = Parameter() -- user4 param (optical flow innovation threshold) -- initialise parameters assert(scr_user1_param:init('SCR_USER1'), 'could not find SCR_USER1 parameter') assert(scr_user2_param:init('SCR_USER2'), 'could not find SCR_USER2 parameter') assert(scr_user3_param:init('SCR_USER3'), 'could not find SCR_USER3 parameter') assert(scr_user4_param:init('SCR_USER4'), 'could not find SCR_USER4 parameter') assert(optical_flow, 'could not access optical flow') -- play tune on buzzer to alert user to change in active source set function play_source_tune(source) if (source) then if (source == 0) then notify:play_tune("L8C") -- one long lower tone elseif (source == 1) then notify:play_tune("L12DD") -- two fast medium tones elseif (source == 2) then notify:play_tune("L16FFF") -- three very fast, high tones end end end -- the main update function function update() -- check switches are configured -- at least one switch must be set -- source selection from RCx_FUNCTION = 90 (EKF Source Select) -- auto source from RCx_FUNCTION = 300 (Scripting1) local rc_function_source = rc:find_channel_for_option(90) local rc_function_auto = rc:find_channel_for_option(300) if not rc_function_source and not rc_function_auto then gcs:send_text(0, "ahrs-source-gps-optflow.lua: RCx_FUNCTION=90 or 300 not set!") return update, 1000 end -- check rangefinder distance threshold has been set local rangefinder_thresh_dist = scr_user1_param:get() -- SCR_USER1 holds rangefinder threshold if (rangefinder_thresh_dist <= 0) then gcs:send_text(0, "ahrs-source-gps-optflow.lua: set SCR_USER1 to rangefinder threshold") return update, 1000 end -- check GPS speed accuracy threshold has been set local gps_speedaccuracy_thresh = scr_user2_param:get() -- SCR_USER2 holds GPS speed accuracy threshold if (gps_speedaccuracy_thresh <= 0) then gcs:send_text(0, "ahrs-source-gps-optflow.lua: set SCR_USER2 to GPS speed accuracy threshold") return update, 1000 end -- check optical flow quality threshold has been set local opticalflow_quality_thresh = scr_user3_param:get() -- SCR_USER3 holds opticalflow quality if (opticalflow_quality_thresh <= 0) then gcs:send_text(0, "ahrs-source-gps-optflow.lua: set SCR_USER3 to OpticalFlow quality threshold") return update, 1000 end -- check optical flow innovation threshold has been set local opticalflow_innov_thresh = scr_user4_param:get() -- SCR_USER4 holds opticalflow innovation if (opticalflow_innov_thresh <= 0) then gcs:send_text(0, "ahrs-source-gps-optflow.lua: set SCR_USER4 to OpticalFlow innovation threshold") return update, 1000 end -- check if GPS speed accuracy is over threshold local gps_speed_accuracy = gps:speed_accuracy(gps:primary_sensor()) local gps_over_threshold = (gps_speed_accuracy == nil) or (gps:speed_accuracy(gps:primary_sensor()) > gps_speedaccuracy_thresh) local gps_usable = (gps_speed_accuracy ~= nil) and (gps_speed_accuracy <= gps_usable_accuracy) -- check optical flow quality local opticalflow_quality_good = false if (optical_flow) then opticalflow_quality_good = (optical_flow:enabled() and optical_flow:healthy() and optical_flow:quality() >= opticalflow_quality_thresh) end -- get opticalflow innovations from ahrs (only x and y values are valid) local opticalflow_over_threshold = true local opticalflow_xy_innov = 0 local opticalflow_innov = Vector3f() local opticalflow_var = Vector3f() opticalflow_innov, opticalflow_var = ahrs:get_vel_innovations_and_variances_for_source(5) if (opticalflow_innov) then opticalflow_xy_innov = math.sqrt(opticalflow_innov:x() * opticalflow_innov:x() + opticalflow_innov:y() * opticalflow_innov:y()) opticalflow_over_threshold = (opticalflow_xy_innov == 0.0) or (opticalflow_xy_innov > opticalflow_innov_thresh) end -- get rangefinder distance local rngfnd_distance_m = 0 if rangefinder:has_data_orient(rangefinder_rotation) then rngfnd_distance_m = rangefinder:distance_cm_orient(rangefinder_rotation) * 0.01 end local rngfnd_over_threshold = (rngfnd_distance_m == 0) or (rngfnd_distance_m > rangefinder_thresh_dist) -- opticalflow is usable if quality and innovations are good and rangefinder is in range local opticalflow_usable = opticalflow_quality_good and (not opticalflow_over_threshold) and (not rngfnd_over_threshold) -- automatic selection logic -- -- GPS vs opticalflow vote. "-1" to move towards GPS, "+1" to move to Non-GPS if (not gps_over_threshold) or (gps_usable and not opticalflow_usable) then -- vote for GPS if GPS accuracy good OR GPS is usable and opticalflow is unusable gps_vs_opticalflow_vote = math.max(gps_vs_opticalflow_vote - 1, -vote_counter_max) elseif opticalflow_usable then -- vote for opticalflow if usable gps_vs_opticalflow_vote = math.min(gps_vs_opticalflow_vote + 1, vote_counter_max) end -- auto source vote collation local auto_source = -1 -- auto source undecided if -1 if gps_vs_opticalflow_vote <= -vote_counter_max then auto_source = 0 -- GPS elseif gps_vs_opticalflow_vote >= vote_counter_max then auto_source = 1 -- opticalflow end -- read source switch position from RCx_FUNCTION = 90 (EKF Source Select) local sw_source_pos = rc_function_source:get_aux_switch_pos() if sw_source_pos ~= sw_source_pos_prev then -- check for changes in source switch position sw_source_pos_prev = sw_source_pos -- record new switch position so we can detect changes auto_switch = false -- disable auto switching of source if source_prev ~= sw_source_pos then -- check if switch position does not match source (there is a one-to-one mapping of switch to source) source_prev = sw_source_pos -- record what source should now be (changed by ArduPilot vehicle code) gcs:send_text(0, "Pilot switched to Source " .. string.format("%d", source_prev+1)) else gcs:send_text(0, "Pilot switched but already Source " .. string.format("%d", source_prev+1)) end play_source_tune(source_prev) -- alert user of source whether changed or not end -- if auto switch exists then read auto source switch position from RCx_FUNCTION = 300 (Scripting1) if rc_function_auto then local sw_auto_pos = rc_function_auto:get_aux_switch_pos() if sw_auto_pos ~= sw_auto_pos_prev then -- check for changes in source auto switch position sw_auto_pos_prev = sw_auto_pos -- record new switch position so we can detect changes if sw_auto_pos == 0 then -- pilot has pulled switch low auto_switch = false -- disable auto switching of source if sw_source_pos ~= source_prev then -- check if source will change source_prev = sw_source_pos -- record pilot's selected source ahrs:set_posvelyaw_source_set(source_prev) -- switch to pilot's selected source gcs:send_text(0, "Auto source disabled, switched to Source " .. string.format("%d", source_prev+1)) else gcs:send_text(0, "Auto source disabled, already Source " .. string.format("%d", source_prev+1)) end elseif sw_auto_pos == 2 then -- pilot has pulled switch high auto_switch = true -- enable auto switching of source if auto_source < 0 then gcs:send_text(0, "Auto source enabled, undecided, Source " .. string.format("%d", source_prev+1)) elseif auto_source ~= source_prev then -- check if source will change source_prev = auto_source -- record pilot's selected source ahrs:set_posvelyaw_source_set(source_prev) -- switch to pilot's selected source gcs:send_text(0, "Auto source enabled, switched to Source " .. string.format("%d", source_prev+1)) else gcs:send_text(0, "Auto source enabled, already Source " .. string.format("%d", source_prev+1)) end end play_source_tune(source_prev) end end -- auto switching if auto_switch and (auto_source >= 0) and (auto_source ~= source_prev) then source_prev = auto_source -- record selected source ahrs:set_posvelyaw_source_set(source_prev) -- switch to pilot's selected source gcs:send_text(0, "Auto switched to Source " .. string.format("%d", source_prev+1)) play_source_tune(source_prev) end return update, 100 end return update()
gpl-3.0
Ninjistix/darkstar
scripts/globals/spells/bluemagic/claw_cyclone.lua
35
1772
----------------------------------------- -- Spell: Claw Cyclone -- Damages enemies within area of effect with a twofold attack. Damage varies with TP -- Spell cost: 24 MP -- Monster Type: Beasts -- Spell Type: Physical (Slashing) -- Blue Magic Points: 2 -- Stat Bonus: VIT+1 -- Level: 20 -- Casting Time: 1 seconds -- Recast Time: 19.75 seconds -- Skillchain Element(s): Earth (can open Liquefaction, Detonation, or Reverberation; can close Scission or Distortion) -- Combos: Lizard Killer ----------------------------------------- require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/bluemagic"); ----------------------------------------- -- OnMagicCastingCheck ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) local params = {}; -- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage params.tpmod = TPMOD_ATTACK; params.dmgtype = DMGTYPE_SLASH; params.scattr = SC_SCISSION; params.numhits = 2; params.multiplier = 1.4375; params.tp150 = 1.4375; params.tp300 = 1.4375; params.azuretp = 1.4375; params.duppercap = 9; params.str_wsc = 0.0; params.dex_wsc = 0.3; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; damage = BluePhysicalSpell(caster, target, spell, params); damage = BlueFinalAdjustments(caster, target, spell, damage, params); return damage; end;
gpl-3.0