repo_name stringlengths 6 69 | path stringlengths 6 178 | copies stringclasses 278
values | size stringlengths 4 7 | content stringlengths 671 917k | license stringclasses 15
values |
|---|---|---|---|---|---|
Percona-QA/toku-qa | tokudb/software/fast-updates/sysbench-0.5/sysbench/tests/db/select_random_points.lua | 10 | 3964 | -- This test is designed for testing MariaDB's key_cache_segments for MyISAM,
-- and should work with other storage engines as well.
--
-- For details about key_cache_segments please refer to:
-- http://kb.askmonty.org/v/segmented-key-cache
--
function prepare()
local query
local i
set_vars()
db_connect()
print("Creating table 'sbtest'...")
if (db_driver == "mysql") then
query = [[
CREATE TABLE sbtest (
id INTEGER UNSIGNED NOT NULL ]] .. ((oltp_auto_inc and "AUTO_INCREMENT") or "") .. [[,
k INTEGER UNSIGNED DEFAULT '0' NOT NULL,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
) /*! ENGINE = ]] .. mysql_table_engine .. " MAX_ROWS = " .. myisam_max_rows .. " */"
elseif (db_driver == "oracle") then
query = [[
CREATE TABLE sbtest (
id INTEGER NOT NULL,
k INTEGER,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60 DEFAULT '' NOT NULL,
PRIMARY KEY (id)
) ]]
elseif (db_driver == "pgsql") then
query = [[
CREATE TABLE sbtest (
id ]] .. (sb.oltp_auto_inc and "SERIAL") or "" .. [[,
k INTEGER DEFAULT '0' NOT NULL,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
) ]]
elseif (db_driver == "drizzle") then
query = [[
CREATE TABLE sbtest (
id INTEGER NOT NULL ]] .. ((oltp_auto_inc and "AUTO_INCREMENT") or "") .. [[,
k INTEGER DEFAULT '0' NOT NULL,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
) ]]
else
print("Unknown database driver: " .. db_driver)
return 1
end
db_query(query)
if (db_driver == "oracle") then
db_query("CREATE SEQUENCE sbtest_seq")
db_query([[CREATE TRIGGER sbtest_trig BEFORE INSERT ON sbtest
FOR EACH ROW BEGIN SELECT sbtest_seq.nextval INTO :new.id FROM DUAL; END;]])
end
db_query("CREATE INDEX k on sbtest(k)")
print("Inserting " .. oltp_table_size .. " records into 'sbtest'")
if (oltp_auto_inc) then
db_bulk_insert_init("INSERT INTO sbtest(k, c, pad) VALUES")
else
db_bulk_insert_init("INSERT INTO sbtest(id, k, c, pad) VALUES")
end
for i = 1,oltp_table_size do
if (oltp_auto_inc) then
db_bulk_insert_next("("..i..", ' ', 'qqqqqqqqqqwwwwwwwwwweeeeeeeeeerrrrrrrrrrtttttttttt')")
else
db_bulk_insert_next("("..i..", "..i..", ' ', 'qqqqqqqqqqwwwwwwwwwweeeeeeeeeerrrrrrrrrrtttttttttt')")
end
end
db_bulk_insert_done()
return 0
end
function cleanup()
print("Dropping table 'sbtest'...")
db_query("DROP TABLE sbtest")
end
function thread_init(thread_id)
set_vars()
points = ""
for i = 1,random_points do
points = points .. "?, "
end
-- Get rid of last comma and space.
points = string.sub(points, 1, string.len(points) - 2)
stmt = db_prepare([[
SELECT id, k, c, pad
FROM sbtest
WHERE k IN (]] .. points .. [[)
]])
params = {}
for j = 1,random_points do
params[j] = 1
end
db_bind_param(stmt, params)
end
function event(thread_id)
local rs
-- To prevent overlapping of our range queries we need to partition the whole table
-- into num_threads segments and then make each thread work with its own segment.
for i = 1,random_points do
params[i] = sb_rand(oltp_table_size / num_threads * thread_id, oltp_table_size / num_threads * (thread_id + 1))
end
rs = db_execute(stmt)
db_store_results(rs)
db_free_results(rs)
end
function set_vars()
oltp_table_size = oltp_table_size or 10000
random_points = random_points or 10
if (oltp_auto_inc == 'off') then
oltp_auto_inc = false
else
oltp_auto_inc = true
end
end
| gpl-2.0 |
wingo/snabb | lib/ljsyscall/syscall/openbsd/fcntl.lua | 24 | 1202 | -- OpenBSD fcntl
-- TODO incomplete, lots missing
local require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string =
require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string
local function init(types)
local c = require "syscall.openbsd.constants"
local ffi = require "ffi"
local t, pt, s = types.t, types.pt, types.s
local h = require "syscall.helpers"
local ctobool, booltoc = h.ctobool, h.booltoc
local fcntl = { -- TODO some functionality missing
commands = {
[c.F.SETFL] = function(arg) return c.O[arg] end,
[c.F.SETFD] = function(arg) return c.FD[arg] end,
[c.F.GETLK] = t.flock,
[c.F.SETLK] = t.flock,
[c.F.SETLKW] = t.flock,
},
ret = {
[c.F.DUPFD] = function(ret) return t.fd(ret) end,
[c.F.DUPFD_CLOEXEC] = function(ret) return t.fd(ret) end,
[c.F.GETFD] = function(ret) return tonumber(ret) end,
[c.F.GETFL] = function(ret) return tonumber(ret) end,
[c.F.GETOWN] = function(ret) return tonumber(ret) end,
[c.F.GETLK] = function(ret, arg) return arg end,
}
}
return fcntl
end
return {init = init}
| apache-2.0 |
bmscoordinators/FFXI-Server | scripts/globals/weaponskills/glory_slash.lua | 19 | 1581 | -----------------------------------
-- Glory Slash
-- Sword weapon skill
-- Skill Level: NA
-- Only avaliable during Campaign Battle while weilding Lex Talionis.
-- Delivers and area attack that deals triple damage. Damage varies with TP. Additional effect Stun.
-- Will stack with Sneak Attack.
-- Aligned with the Flame Gorget & Light Gorget.
-- Aligned with the Flame Belt & Light Belt.
-- Element: Light
-- Modifiers: STR:30%
-- 100%TP 200%TP 300%TP
-- 3.00 3.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 = 3; params.ftp200 = 3.5; params.ftp300 = 4;
params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
if (damage > 0) then
local duration = (tp/500);
if (target:hasStatusEffect(EFFECT_STUN) == false) then
target:addStatusEffect(EFFECT_STUN, 1, 0, duration);
end
end
local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
return tpHits, extraHits, damage;
end
| gpl-3.0 |
MRAHS/SBSS_Plus | plugins/dic.lua | 31 | 1662 | --[[
-- Translate text using Google Translate.
-- http://translate.google.com/translate_a/single?client=t&ie=UTF-8&oe=UTF-8&hl=en&dt=t&tl=en&sl=auto&text=hello
--]]
do
function translate(source_lang, target_lang, text)
local path = "http://translate.google.com/translate_a/single"
-- URL query parameters
local params = {
client = "t",
ie = "UTF-8",
oe = "UTF-8",
hl = "en",
dt = "t",
tl = target_lang or "fa",
sl = source_lang or "auto",
text = URL.escape(text)
}
local query = format_http_params(params, true)
local url = path..query
local res, code = https.request(url)
-- Return nil if error
if code > 200 then return nil end
local trans = res:gmatch("%[%[%[\"(.*)\"")():gsub("\"(.*)", "")
return trans
end
function run(msg, matches)
-- Third pattern
if #matches == 1 then
print("First")
local text = matches[1]
return translate(nil, nil, text)
end
-- Second pattern
if #matches == 2 then
print("Second")
local target = matches[1]
local text = matches[2]
return translate(nil, target, text)
end
-- First pattern
if #matches == 3 then
print("Third")
local source = matches[1]
local target = matches[2]
local text = matches[3]
return translate(source, target, text)
end
end
return {
description = "Translate Text, Default Persian",
usage = {
"/dic (txt) : translate txt en to fa",
"/dic (lang) (txt) : translate en to other",
"/dic (lang1,lang2) (txt) : translate lang1 to lang2",
},
patterns = {
"^[!/]dic ([%w]+),([%a]+) (.+)",
"^[!/]dic ([%w]+) (.+)",
"^[!/]dic (.+)",
},
run = run
}
end
| gpl-2.0 |
colesbury/nn | Linear.lua | 3 | 3693 | local Linear, parent = torch.class('nn.Linear', 'nn.Module')
function Linear:__init(inputSize, outputSize, bias)
parent.__init(self)
local bias = ((bias == nil) and true) or bias
self.weight = torch.Tensor(outputSize, inputSize)
self.gradWeight = torch.Tensor(outputSize, inputSize)
if bias then
self.bias = torch.Tensor(outputSize)
self.gradBias = torch.Tensor(outputSize)
end
self:reset()
end
function Linear:noBias()
self.bias = nil
self.gradBias = nil
return self
end
function Linear:reset(stdv)
if stdv then
stdv = stdv * math.sqrt(3)
else
stdv = 1./math.sqrt(self.weight:size(2))
end
if nn.oldSeed then
for i=1,self.weight:size(1) do
self.weight:select(1, i):apply(function()
return torch.uniform(-stdv, stdv)
end)
end
if self.bias then
for i=1,self.bias:nElement() do
self.bias[i] = torch.uniform(-stdv, stdv)
end
end
else
self.weight:uniform(-stdv, stdv)
if self.bias then self.bias:uniform(-stdv, stdv) end
end
return self
end
local function updateAddBuffer(self, input)
local nframe = input:size(1)
self.addBuffer = self.addBuffer or input.new()
if self.addBuffer:nElement() ~= nframe then
self.addBuffer:resize(nframe):fill(1)
end
end
function Linear:updateOutput(input)
if input:dim() == 1 then
self.output:resize(self.weight:size(1))
if self.bias then self.output:copy(self.bias) else self.output:zero() end
self.output:addmv(1, self.weight, input)
elseif input:dim() == 2 then
local nframe = input:size(1)
local nElement = self.output:nElement()
self.output:resize(nframe, self.weight:size(1))
if self.output:nElement() ~= nElement then
self.output:zero()
end
updateAddBuffer(self, input)
self.output:addmm(0, self.output, 1, input, self.weight:t())
if self.bias then self.output:addr(1, self.addBuffer, self.bias) end
else
error('input must be vector or matrix')
end
return self.output
end
function Linear:updateGradInput(input, gradOutput)
if self.gradInput then
local nElement = self.gradInput:nElement()
self.gradInput:resizeAs(input)
if self.gradInput:nElement() ~= nElement then
self.gradInput:zero()
end
if input:dim() == 1 then
self.gradInput:addmv(0, 1, self.weight:t(), gradOutput)
elseif input:dim() == 2 then
self.gradInput:addmm(0, 1, gradOutput, self.weight)
end
return self.gradInput
end
end
function Linear:accGradParameters(input, gradOutput, scale)
scale = scale or 1
if input:dim() == 1 then
self.gradWeight:addr(scale, gradOutput, input)
if self.bias then self.gradBias:add(scale, gradOutput) end
elseif input:dim() == 2 then
self.gradWeight:addmm(scale, gradOutput:t(), input)
if self.bias then
-- update the size of addBuffer if the input is not the same size as the one we had in last updateGradInput
updateAddBuffer(self, input)
self.gradBias:addmv(scale, gradOutput:t(), self.addBuffer)
end
end
end
function Linear:sharedAccUpdateGradParameters(input, gradOutput, lr)
-- we do not need to accumulate parameters when sharing:
self:defaultAccUpdateGradParameters(input, gradOutput, lr)
end
function Linear:clearState()
if self.addBuffer then self.addBuffer:set() end
return parent.clearState(self)
end
function Linear:__tostring__()
return torch.type(self) ..
string.format('(%d -> %d)', self.weight:size(2), self.weight:size(1)) ..
(self.bias == nil and ' without bias' or '')
end
| bsd-3-clause |
rbazaud/vlc | share/lua/playlist/mpora.lua | 97 | 2565 | --[[
$Id$
Copyright © 2009 the VideoLAN team
Authors: Konstantin Pavlov (thresh@videolan.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.
--]]
-- Probe function.
function probe()
return vlc.access == "http"
and string.match( vlc.path, "video%.mpora%.com/watch/" )
end
-- Parse function.
function parse()
p = {}
while true do
-- Try to find the video's title
line = vlc.readline()
if not line then break end
if string.match( line, "meta name=\"title\"" ) then
_,_,name = string.find( line, "content=\"(.*)\" />" )
end
if string.match( line, "image_src" ) then
_,_,arturl = string.find( line, "image_src\" href=\"(.*)\" />" )
end
if string.match( line, "video_src" ) then
_,_,video = string.find( line, 'href="http://video%.mpora%.com/ep/(.*)%.swf" />' )
end
end
if not name or not arturl or not video then return nil end
-- Try and get URL for SD video.
sd = vlc.stream("http://api.mpora.com/tv/player/playlist/vid/"..video.."/")
if not sd then return nil end
page = sd:read( 65653 )
sdurl = string.match( page, "url=\"(.*)\" />")
page = nil
table.insert( p, { path = sdurl; name = name; arturl = arturl; } )
-- Try and check if HD video is available.
checkhd = vlc.stream("http://api.mpora.com/tv/player/load/vid/"..video.."/platform/video/domain/video.mpora.com/" )
if not checkhd then return nil end
page = checkhd:read( 65653 )
hashd = tonumber( string.match( page, "<has_hd>(%d)</has_hd>" ) )
page = nil
if hashd then
hd = vlc.stream("http://api.mpora.com/tv/player/playlist/vid/"..video.."/hd/true/")
page = hd:read( 65653 )
hdurl = string.match( page, "url=\"(.*)\" />")
table.insert( p, { path = hdurl; name = name.." (HD)"; arturl = arturl; } )
end
return p
end
| gpl-2.0 |
pakozm/april-ann | packages/autodiff/ann/package.lua | 3 | 1212 | package{ name = "autodiff.ann",
version = "1.0",
depends = { "util", "matrix", "autodiff", "ann", "ann.loss" },
keywords = { },
description = "",
-- targets como en ant
target{
name = "init",
mkdir{ dir = "build" },
mkdir{ dir = "include" },
},
target{
name = "clean",
delete{ dir = "build" },
delete{ dir = "include" },
},
target{
name = "provide",
depends = "init",
-- copy{ file= "c_src/*.h", dest_dir = "include" },
-- provide_bind{ file = "binding/bind_util.lua.cc" , dest_dir = "include" },
},
-- target{
-- name = "test",
-- lua_unit_test{
-- file={
-- "test/test-functional-programming.lua",
-- },
-- },
-- },
target{
name = "build",
depends = "provide",
use_timestamp = true,
-- object{
-- file = "c_src/*.cc",
-- dest_dir = "build",
-- -- flags = "-std=c99",
-- },
luac{
orig_dir = "lua_src",
dest_dir = "build",
},
-- build_bind{ file = "binding/bind_util.lua.cc", dest_dir = "build" },
},
target{
name = "document",
document_src{
},
document_bind{
},
},
}
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Southern_San_dOria/npcs/Ullasa.lua | 17 | 1699 | -----------------------------------
-- Area: Southern San d'Oria
-- NPC: Ullasa
-- General Info NPC
-------------------------------------
package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Southern_San_dOria/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/quests");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
local FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
local count = trade:getItemCount();
local MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if player:getVar("UnderOathCS") == 2 then -- Quest: Under Oath - PLD AF3
player:startEvent(0x028);
else
player:startEvent(0x027);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x028) then
player:setVar("UnderOathCS", 3) -- Quest: Under Oath - PLD AF3
end
end;
| gpl-3.0 |
emoon/wrui | bin/win32/scripts/tundra/syntax/glob.lua | 22 | 3353 | -- glob.lua - Glob syntax elements for declarative tundra.lua usage
module(..., package.seeall)
local util = require "tundra.util"
local path = require "tundra.path"
local decl = require "tundra.decl"
local dirwalk = require "tundra.dirwalk"
local ignored_dirs = util.make_lookup_table { ".git", ".svn", "CVS" }
local function glob(directory, recursive, filter_fn)
local result = {}
local function dir_filter(dir_name)
if not recursive or ignored_dirs[dir_name] then
return false
end
return true
end
for _, path in ipairs(dirwalk.walk(directory, dir_filter)) do
if filter_fn(path) then
result[#result + 1] = string.gsub(path, "\\", "/")
end
end
return result
end
-- Glob syntax - Search for source files matching extension list
--
-- Synopsis:
-- Glob {
-- Dir = "...",
-- Extensions = { ".ext", ... },
-- [Recursive = false,]
-- }
--
-- Options:
-- Dir = "directory" (required)
-- - Base directory to search in
--
-- Extensions = { ".ext1", ".ext2" } (required)
-- - List of file extensions to include
--
-- Recursive = boolean (optional, default: true)
-- - Specified whether to recurse into subdirectories
function Glob(args)
local recursive = args.Recursive
if type(recursive) == "nil" then
recursive = true
end
if not args.Extensions then
croak("no 'Extensions' specified in Glob (Dir is '%s')", args.Dir)
end
local extensions = assert(args.Extensions)
local ext_lookup = util.make_lookup_table(extensions)
return glob(args.Dir, recursive, function (fn)
local ext = path.get_extension(fn)
return ext_lookup[ext]
end)
end
-- FGlob syntax - Search for source files matching extension list with
-- configuration filtering
--
-- Usage:
-- FGlob {
-- Dir = "...",
-- Extensions = { ".ext", .... },
-- Filters = {
-- { Pattern = "/[Ww]in32/", Config = "win32-*-*" },
-- { Pattern = "/[Dd]ebug/", Config = "*-*-debug" },
-- ...
-- },
-- [Recursive = false],
-- }
local function FGlob(args)
-- Use the regular glob to fetch the file list.
local files = Glob(args)
local pats = {}
local result = {}
-- Construct a mapping from { Pattern = ..., Config = ... }
-- to { Pattern = { Config = ... } } with new arrays per config that can be
-- embedded in the source result.
for _, fitem in ipairs(args.Filters) do
if not fitem.Config then
croak("no 'Config' specified in FGlob (Pattern is '%s')", fitem.Pattern)
end
local tab = { Config = assert(fitem.Config) }
pats[assert(fitem.Pattern)] = tab
result[#result + 1] = tab
end
-- Traverse all files and see if they match any configuration filters. If
-- they do, stick them in matching list. Otherwise, just keep them in the
-- main list. This has the effect of returning an array such as this:
-- {
-- { "foo.c"; Config = "abc-*-*" },
-- { "bar.c"; Config = "*-*-def" },
-- "baz.c", "qux.m"
-- }
for _, f in ipairs(files) do
local filtered = false
for filter, list in pairs(pats) do
if f:match(filter) then
filtered = true
list[#list + 1] = f
break
end
end
if not filtered then
result[#result + 1] = f
end
end
return result
end
decl.add_function("Glob", Glob)
decl.add_function("FGlob", FGlob)
| mit |
bmscoordinators/FFXI-Server | scripts/zones/Cloister_of_Tides/bcnms/trial-size_trial_by_water.lua | 29 | 2207 | -----------------------------------
-- Area: Cloister of Tides
-- BCNM: Trial by Water
-----------------------------------
package.loaded["scripts/zones/Cloister_of_Tides/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/shop");
require("scripts/globals/quests");
require("scripts/zones/Cloister_of_Tides/TextIDs");
-----------------------------------
-- After registering the BCNM via bcnmRegister(bcnmid)
function onBcnmRegister(player,instance)
end;
-- Physically entering the BCNM via bcnmEnter(bcnmid)
function onBcnmEnter(player,instance)
end;
-- Leaving the BCNM by every mean possible, given by the LeaveCode
-- 1=Select Exit on circle
-- 2=Winning the BC
-- 3=Disconnected or warped out
-- 4=Losing the BC
-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called
-- from the core when a player disconnects or the time limit is up, etc
function onBcnmLeave(player,instance,leavecode)
-- print("leave code "..leavecode);
trialLightning = player:getQuestStatus(OUTLANDS,TRIAL_SIZE_TRIAL_BY_WATER)
if (leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage
player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,0,0);
elseif (leavecode == 4) then
player:setVar("TrialSizeWater_date",tonumber(os.date("%j"))); -- If you loose, you need to wait 1 real day
player:startEvent(0x7d02);
end
end;
function onEventUpdate(player,csid,option)
-- print("bc update csid "..csid.." and option "..option);
end;
function onEventFinish(player,csid,option)
-- print("bc finish csid "..csid.." and option "..option);
if (csid == 0x7d01) then
if (player:hasSpell(300) == false) then
player:addSpell(300); -- Leviathan
player:messageSpecial(LEVIATHAN_UNLOCKED,0,0,2);
end
if (player:hasItem(4181) == false) then
player:addItem(4181);
player:messageSpecial(ITEM_OBTAINED,4181); -- Scroll of instant warp
end
player:setVar("TrialSizeWater_date", 0);
player:addFame(NORG,30);
player:completeQuest(OUTLANDS,TRIAL_SIZE_TRIAL_BY_WATER);
end
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/weaponskills/kings_justice.lua | 19 | 1810 | -----------------------------------
-- Kings Justice
-- Great Axe weapon skill
-- Skill Level: N/A
-- Delivers a threefold attack. Damage varies with TP. Conqueror: Aftermath effect varies with TP.
-- Available only after completing the Unlocking a Myth (Warrior) quest.
-- Aligned with the Breeze Gorget, Thunder Gorget & Soil Gorget.
-- Aligned with the Breeze Belt, Thunder Belt & Soil Belt.
-- Element: None
-- Staff weapon skill Skill level: 10 Delivers a single-hit attack. Damage varies with TP. Element: Non
-- Modifiers: STR:50%
-- 100%TP 200%TP 300%TP
-- 1.00 1.25 1.50
-----------------------------------
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 = 3;
params.ftp100 = 1; params.ftp200 = 1.25; params.ftp300 = 1.5;
params.str_wsc = 0.5; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0;
params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.ftp200 = 3; params.ftp300 = 5;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
if ((player:getEquipID(SLOT_MAIN) == 18991) and (player:getMainJob() == JOBS.WAR)) then
if (damage > 0) then
applyAftermathEffect(player, tp)
end
end
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
amrit110/deepLearThesis | torch/mnist_loc.lua | 1 | 4238 | require 'nn'
require 'optim'
--require 'dataset-mnist'
-- Parameters
n_training = 1000
--n_testing = 1000
batch_size = 50
--classes = {'1','2','3','4','5','6','7','8','9','10'}
geometry = {26,26}
--mask_geo = {12,12}
epochs = 1
-- Define model (convnet)
net = nn.Sequential()
net:add(nn.SpatialConvolutionMM(1,32,3,3,1,1,0,0))
net:add(nn.ReLU())
net:add(nn.SpatialMaxPooling(2,2,2,2))
net:add(nn.SpatialConvolutionMM(32,64,3,3,1,1,0,0))
net:add(nn.ReLU())
net:add(nn.SpatialMaxPooling(2,2,2,2))
net:add(nn.SpatialConvolutionMM(64,124,5,5,1,1,0,0))
net:add(nn.ReLU())
net_class = nn.Sequential()
net_class:add(net)
net_class:add(nn.SpatialConvolutionMM(124,11,1,1))
net_bb = nn.Sequential()
net_bb:add(net)
net_bb:add(nn.SpatialConvolutionMM(124,4,1,1))
net_bb:add(nn.ReLU())
net_bb:add(nn.View(4))
print('<mnist> using network:')
print(net_class)
-- Loss function
--net:add(nn.LogSoftMax())
--net:add(nn.SpatialSoftMax())
criterion_class = nn.CrossEntropyCriterion()
criterion_bb = nn.MSECriterion()
-- Data normalization
trainset = torch.load('mnist_train_26.t7')
trainset.data = trainset.data[{{1,n_training}}]
trainset.label = trainset.label[{{1,n_training}}]
trainset_bb = torch.load('mnist_26bb.t7')
trainset_bb.data = trainset_bb.data[{{1,n_training}}]
trainset_bb.label = trainset_bb.label[{{1,n_training}}]
-- Give data set some properties
function createdataset(trainset)
setmetatable(trainset,
{__index = function(t,i)
return {t.data[i], t.label[i]}
end}
);
trainset.data = trainset.data:double()
trainset.label = trainset.label:double()
function trainset:size()
return self.data:size(1)
end
mean = trainset.data:mean()
trainset.data:add(-mean)
stdv = trainset.data:std()
trainset.data:div(stdv)
return trainset
end
trainset = createdataset(trainset)
trainset_bb = createdataset(trainset_bb)
-- Training function
function train(dataset, mode)
local mode = mode or 'classifier'
if mode == 'classifier' then
network = net_class
criterion = criterion_class
parameters, gradParameters = net_class:getParameters()
else
network = net_bb
criterion = criterion_bb
parameters, gradParameters = net_bb:listModules()[11]:getParameters()
end
epoch = epoch or 1
local time = sys.clock()
n_labels = dataset.label[1]:size(1)
print('<trainer> on training set:')
print('<trainer> online epoch # ' .. epoch .. '[batch_size = ' .. batch_size .. ']')
for t = 1,dataset:size(),batch_size do
local inputs = torch.Tensor(batch_size,1,geometry[1],geometry[2])
local targets = torch.Tensor(batch_size, n_labels)
local k = 1
for i = t,math.min(t+batch_size-1,dataset:size()) do
local sample = dataset[i]
local input = sample[1]:clone()
local target = sample[2]:clone()
target = target:squeeze()
inputs[k] = input
targets[k] = target
k = k + 1
end
-- Evaluate cost and gradients
local feval = function(x)
collectgarbage()
if x ~= parameters then
parameters:copy(x)
end
gradParameters:zero()
local outputs = network:forward(inputs)
--print(outputs:size())
--print(targets:size())
local f = criterion:forward(outputs, targets)
local df_do = criterion:backward(outputs, targets)
network:backward(inputs, df_do)
return f,gradParameters
end
-- Perform SGD
sgdState = sgdState or {
learningRate = 0.01
--momentum = 0.001
--learningRateDecay = 5e-7
}
optim.sgd(feval, parameters, sgdState)
-- display progress
xlua.progress(t, dataset:size())
end
-- Time taken
time = sys.clock() - time
time = time / dataset:size()
print('<trainer> time to learn 1 sample = ' .. (time*1000) .. 'ms')
-- Print cost
--print(confusion)
--confusion:zero()
print('<trainer> output cost: ' .. criterion.output)
epoch = epoch + 1
end
for i=1,epochs do
train(trainset)
end
| mit |
bmscoordinators/FFXI-Server | scripts/zones/Port_Jeuno/npcs/Horst.lua | 29 | 3441 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Horst
-- Type: Abyssea Warp NPC
-- @pos -54.379 0.001 -10.061 246
-----------------------------------
package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Port_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local CRUOR = player:getCurrency("cruor");
if (player:getQuestStatus(ABYSSEA, THE_TRUTH_BECKONS) == QUEST_ACCEPTED) then
player:startEvent(0x0153,1,CRUOR,7,7,7); -- Temp activated all locations till param handling sorted out.
elseif (player:getQuestStatus(ABYSSEA, THE_TRUTH_BECKONS) == QUEST_COMPLETED) then
player:startEvent(0x0153,2,CRUOR,7,7,7); -- Temp activated all locations till param handling sorted out.
else
player:startEvent(0x0153, 0);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
local CRUOR = player:getCurrency("cruor");
if (csid == 0x0153) then
if (option == 260) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(-562,0.001,640,26,102); -- La Theine Plateau
end
elseif (option == 264) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(91,-68,-582,237,108); -- Konshtat Highlands
end
elseif (option == 268) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(-28,46,-680,76,117); -- Tahrongi Canyon
end
elseif (option == 272) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(241,0.001,11,42,104); -- Jugner Forest
end
elseif (option == 276) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(362,0.001,-119,4,103); -- Valkrum
end
elseif (option == 280) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(-338,-23,47,167,118); -- Buburimu Peninsula
end
elseif (option == 288) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(269,-7,-75,192,112); -- Xarcabard
end
elseif (option == 284) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(337,0.001,-675,52,107); -- South Gustaberg
end
elseif (option == 292) then
if (CRUOR >= 200) then
player:delCurrency("cruor", 200);
player:setPos(-71,0.001,601,126,106); -- North Gustaberg
end
end
end
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Giddeus/npcs/Laa_Mozi.lua | 14 | 2157 | -----------------------------------
-- Area: Giddeus
-- NPC: Laa Mozi
-- Involved in Mission 1-3
-- @pos -22 0 148 145
-----------------------------------
package.loaded["scripts/zones/Giddeus/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/missions");
require("scripts/globals/keyitems");
require("scripts/zones/Giddeus/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getCurrentMission(WINDURST) == THE_PRICE_OF_PEACE) then
if (player:hasKeyItem(FOOD_OFFERINGS)) then
-- We have the offerings
player:startEvent(0x002d);
else
if (player:getVar("laa_talk") == 1) then
-- npc: You want your offering back?
player:startEvent(0x002e);
elseif (player:getVar("laa_talk") == 2) then
-- npc: You'll have to crawl back to treasure chamber, etc
player:startEvent(0x002f);
else
-- We don't have the offerings yet or anymore
player:startEvent(0x0030);
end
end
else
player:startEvent(0x0030);
end
end
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x002d) then
player:delKeyItem(FOOD_OFFERINGS);
player:setVar("laa_talk",1);
if (player:hasKeyItem(DRINK_OFFERINGS) == false) then
player:setVar("MissionStatus",2);
end
elseif (csid == 0x002e) then
player:setVar("laa_talk",2);
end
end; | gpl-3.0 |
wingo/snabb | src/core/app.lua | 4 | 18237 | -- Use of this source code is governed by the Apache 2.0 license; see COPYING.
module(...,package.seeall)
local packet = require("core.packet")
local lib = require("core.lib")
local link = require("core.link")
local config = require("core.config")
local timer = require("core.timer")
local shm = require("core.shm")
local histogram = require('core.histogram')
local counter = require("core.counter")
local zone = require("jit.zone")
local jit = require("jit")
local ffi = require("ffi")
local C = ffi.C
require("core.packet_h")
-- Packet per pull
pull_npackets = math.floor(link.max / 10)
-- Set to true to enable logging
log = false
local use_restart = false
test_skipped_code = 43
-- The set of all active apps and links in the system.
-- Indexed both by name (in a table) and by number (in an array).
app_table, app_array = {}, {}
link_table, link_array = {}, {}
configuration = config.new()
-- Counters for statistics.
breaths = counter.create("engine/breaths.counter") -- Total breaths taken
frees = counter.create("engine/frees.counter") -- Total packets freed
freebits = counter.create("engine/freebits.counter") -- Total packet bits freed (for 10GbE)
freebytes = counter.create("engine/freebytes.counter") -- Total packet bytes freed
configs = counter.create("engine/configs.counter") -- Total configurations loaded
-- Breathing regluation to reduce CPU usage when idle by calling usleep(3).
--
-- There are two modes available:
--
-- Hz = <n> means to aim for an exact <n> breaths per second rhythm
-- Hz = false means dynamic adjustment of the breathing interval
--
-- Dynamic adjustment automatically scales the time to sleep between
-- breaths from nothing up to maxsleep (default: 100us). If packets
-- are processed during a breath then the sleep period is halved, and
-- if no packets are processed during a breath then the sleep interval
-- is increased by one microsecond.
--
-- The default is dynamic adjustment which should work well for the
-- majority of cases.
Hz = false
sleep = 0
maxsleep = 100
-- busywait: If true then the engine will poll for new data in a tight
-- loop (100% CPU) instead of sleeping according to the Hz setting.
busywait = false
-- Return current monotonic time in seconds.
-- Can be used to drive timers in apps.
monotonic_now = false
function now ()
return monotonic_now or C.get_monotonic_time()
end
-- Run app:methodname() in protected mode (pcall). If it throws an
-- error app will be marked as dead and restarted eventually.
function with_restart (app, method)
local status, result
if use_restart then
-- Run fn in protected mode using pcall.
status, result = pcall(method, app)
-- If pcall caught an error mark app as "dead" (record time and cause
-- of death).
if not status then
app.dead = { error = result, time = now() }
end
else
status, result = true, method(app)
end
return status, result
end
-- Restart dead apps.
function restart_dead_apps ()
if not use_restart then return end
local restart_delay = 2 -- seconds
local actions = { start={}, restart={}, reconfig={}, keep={}, stop={} }
local restart = false
-- Collect 'restart' actions for dead apps and log their errors.
for i = 1, #app_array do
local app = app_array[i]
if app.dead and (now() - app.dead.time) >= restart_delay then
restart = true
io.stderr:write(("Restarting %s (died at %f: %s)\n")
:format(app.appname, app.dead.time, app.dead.error))
table.insert(actions.restart, app.appname)
else
table.insert(actions.keep, app.appname)
end
end
-- Restart dead apps if necessary.
if restart then apply_config_actions(actions, configuration) end
end
-- Configure the running app network to match new_configuration.
--
-- Successive calls to configure() will migrate from the old to the
-- new app network by making the changes needed.
function configure (new_config)
local actions = compute_config_actions(configuration, new_config)
apply_config_actions(actions, new_config)
configuration = new_config
counter.add(configs)
end
-- Return the configuration actions needed to migrate from old config to new.
--
-- Here is an example return value for a case where two apps must
-- start, one must stop, and one is kept as it is:
-- { start = {'newapp1', 'newapp2'},
-- stop = {'deadapp1'},
-- keep = {'oldapp1'},
-- restart = {},
-- reconfig = {}
-- }
function compute_config_actions (old, new)
local actions = { start={}, restart={}, reconfig={}, keep={}, stop={} }
for appname, info in pairs(new.apps) do
local class, arg = info.class, info.arg
local action = nil
if not old.apps[appname] then action = 'start'
elseif old.apps[appname].class ~= class then action = 'restart'
elseif not lib.equal(old.apps[appname].arg, arg)
then action = 'reconfig'
else action = 'keep' end
table.insert(actions[action], appname)
end
for appname in pairs(old.apps) do
if not new.apps[appname] then
table.insert(actions['stop'], appname)
end
end
return actions
end
-- Update the active app network by applying the necessary actions.
function apply_config_actions (actions, conf)
-- The purpose of this function is to populate these tables:
local new_app_table, new_app_array = {}, {}
local new_link_table, new_link_array = {}, {}
-- Temporary name->index table for use in link renumbering
local app_name_to_index = {}
-- Table of functions that execute config actions
local ops = {}
function ops.stop (name)
if app_table[name].stop then
app_table[name]:stop()
end
if app_table[name].shm then
shm.delete_frame(app_table[name].shm)
end
end
function ops.keep (name)
new_app_table[name] = app_table[name]
table.insert(new_app_array, app_table[name])
app_name_to_index[name] = #new_app_array
end
function ops.start (name)
local class = conf.apps[name].class
local arg = conf.apps[name].arg
local app = class:new(arg)
if type(app) ~= 'table' then
error(("bad return value from app '%s' start() method: %s"):format(
name, tostring(app)))
end
local zone = app.zone or getfenv(class.new)._NAME or name
app.appname = name
app.output = {}
app.input = {}
new_app_table[name] = app
table.insert(new_app_array, app)
app_name_to_index[name] = #new_app_array
app.zone = zone
if app.shm then
app.shm.dtime = {counter, C.get_unix_time()}
app.shm = shm.create_frame("apps/"..name, app.shm)
end
end
function ops.restart (name)
ops.stop(name)
ops.start(name)
end
function ops.reconfig (name)
if app_table[name].reconfig then
local arg = conf.apps[name].arg
local app = app_table[name]
app:reconfig(arg)
new_app_table[name] = app
table.insert(new_app_array, app)
app_name_to_index[name] = #new_app_array
else
ops.restart(name)
end
end
-- Dispatch actions in a suitable sequence.
for _, action in ipairs({'stop', 'restart', 'keep', 'reconfig', 'start'}) do
for _, name in ipairs(actions[action]) do
if log and action ~= 'keep' then
io.write("engine: ", action, " app ", name, "\n")
end
ops[action](name)
end
end
-- Setup links: create (or reuse) and renumber.
for linkspec in pairs(conf.links) do
local fa, fl, ta, tl = config.parse_link(linkspec)
if not new_app_table[fa] then error("no such app: " .. fa) end
if not new_app_table[ta] then error("no such app: " .. ta) end
-- Create or reuse a link and assign/update receiving app index
local link = link_table[linkspec] or link.new(linkspec)
link.receiving_app = app_name_to_index[ta]
-- Add link to apps
new_app_table[fa].output[fl] = link
table.insert(new_app_table[fa].output, link)
new_app_table[ta].input[tl] = link
table.insert(new_app_table[ta].input, link)
-- Remember link
new_link_table[linkspec] = link
table.insert(new_link_array, link)
end
-- Free obsolete links.
for linkspec, r in pairs(link_table) do
if not new_link_table[linkspec] then link.free(r, linkspec) end
end
-- Commit changes.
app_table, link_table = new_app_table, new_link_table
app_array, link_array = new_app_array, new_link_array
-- Trigger link event for each app.
for _, app in ipairs(app_array) do
if app.link then app:link() end
end
end
-- Call this to "run snabb switch".
function main (options)
options = options or {}
local done = options.done
local no_timers = options.no_timers
if options.duration then
assert(not done, "You can not have both 'duration' and 'done'")
done = lib.timer(options.duration * 1e9)
end
local breathe = breathe
if options.measure_latency or options.measure_latency == nil then
local latency = histogram.create('engine/latency.histogram', 1e-6, 1e0)
breathe = latency:wrap_thunk(breathe, now)
end
monotonic_now = C.get_monotonic_time()
repeat
breathe()
if not no_timers then timer.run() end
if not busywait then pace_breathing() end
until done and done()
counter.commit()
if not options.no_report then report(options.report) end
end
local nextbreath
local lastfrees = 0
local lastfreebits = 0
local lastfreebytes = 0
-- Wait between breaths to keep frequency with Hz.
function pace_breathing ()
if Hz then
nextbreath = nextbreath or monotonic_now
local sleep = tonumber(nextbreath - monotonic_now)
if sleep > 1e-6 then
C.usleep(sleep * 1e6)
monotonic_now = C.get_monotonic_time()
end
nextbreath = math.max(nextbreath + 1/Hz, monotonic_now)
else
if lastfrees == counter.read(frees) then
sleep = math.min(sleep + 1, maxsleep)
C.usleep(sleep)
else
sleep = math.floor(sleep/2)
end
lastfrees = counter.read(frees)
lastfreebytes = counter.read(freebytes)
lastfreebits = counter.read(freebits)
end
end
function breathe ()
monotonic_now = C.get_monotonic_time()
-- Restart: restart dead apps
restart_dead_apps()
-- Inhale: pull work into the app network
for i = 1, #app_array do
local app = app_array[i]
-- if app.pull then
-- zone(app.zone) app:pull() zone()
if app.pull and not app.dead then
zone(app.zone)
with_restart(app, app.pull)
zone()
end
end
-- Exhale: push work out through the app network
local firstloop = true
repeat
local progress = false
-- For each link that has new data, run the receiving app
for i = 1, #link_array do
local link = link_array[i]
if firstloop or link.has_new_data then
link.has_new_data = false
local receiver = app_array[link.receiving_app]
if receiver.push and not receiver.dead then
zone(receiver.zone)
with_restart(receiver, receiver.push)
zone()
progress = true
end
end
end
firstloop = false
until not progress -- Stop after no link had new data
counter.add(breaths)
-- Commit counters at a reasonable frequency
if counter.read(breaths) % 100 == 0 then counter.commit() end
end
function report (options)
if not options or options.showload then
report_load()
end
if options and options.showlinks then
report_links()
end
if options and options.showapps then
report_apps()
end
end
-- Load reporting prints several metrics:
-- time - period of time that the metrics were collected over
-- fps - frees per second (how many calls to packet.free())
-- fpb - frees per breath
-- bpp - bytes per packet (average packet size)
local lastloadreport = nil
local reportedfrees = nil
local reportedfreebits = nil
local reportedfreebytes = nil
local reportedbreaths = nil
function report_load ()
local frees = counter.read(frees)
local freebits = counter.read(freebits)
local freebytes = counter.read(freebytes)
local breaths = counter.read(breaths)
if lastloadreport then
local interval = now() - lastloadreport
local newfrees = tonumber(frees - reportedfrees)
local newbytes = tonumber(freebytes - reportedfreebytes)
local newbits = tonumber(freebits - reportedfreebits)
local newbreaths = tonumber(breaths - reportedbreaths)
local fps = math.floor(newfrees/interval)
local fbps = math.floor(newbits/interval)
local fpb = math.floor(newfrees/newbreaths)
local bpp = math.floor(newbytes/newfrees)
print(("load: time: %-2.2fs fps: %-9s fpGbps: %-3.3f fpb: %-3s bpp: %-4s sleep: %-4dus"):format(
interval,
lib.comma_value(fps),
fbps / 1e9,
lib.comma_value(fpb),
(bpp ~= bpp) and "-" or tostring(bpp), -- handle NaN
sleep))
end
lastloadreport = now()
reportedfrees = frees
reportedfreebits = freebits
reportedfreebytes = freebytes
reportedbreaths = breaths
end
function report_links ()
print("link report:")
local function loss_rate(drop, sent)
sent = tonumber(sent)
if not sent or sent == 0 then return 0 end
return tonumber(drop) * 100 / (tonumber(drop)+sent)
end
local names = {}
for name in pairs(link_table) do table.insert(names, name) end
table.sort(names)
for i, name in ipairs(names) do
l = link_table[name]
local txpackets = counter.read(l.stats.txpackets)
local txdrop = counter.read(l.stats.txdrop)
print(("%20s sent on %s (loss rate: %d%%)"):format(
lib.comma_value(txpackets), name, loss_rate(txdrop, txpackets)))
end
end
function report_apps ()
print ("apps report:")
for name, app in pairs(app_table) do
if app.dead then
print(name, ("[dead: %s]"):format(app.dead.error))
elseif app.report then
print(name)
if use_restart then
with_restart(app, app.report)
else
-- Restarts are disabled, still we want to not die on
-- errors during app reports, thus this workaround:
local status, err = pcall(app.report, app)
if not status then
print("Warning: "..name.." threw an error during report: "..err)
end
end
end
end
end
function selftest ()
print("selftest: app")
local App = {}
function App:new () return setmetatable({}, {__index = App}) end
local c1 = config.new()
config.app(c1, "app1", App)
config.app(c1, "app2", App)
config.link(c1, "app1.x -> app2.x")
print("empty -> c1")
configure(c1)
assert(#app_array == 2)
assert(#link_array == 1)
assert(app_table.app1 and app_table.app2)
local orig_app1 = app_table.app1
local orig_app2 = app_table.app2
local orig_link = link_array[1]
print("c1 -> c1")
configure(c1)
assert(app_table.app1 == orig_app1)
assert(app_table.app2 == orig_app2)
local c2 = config.new()
config.app(c2, "app1", App, "config")
config.app(c2, "app2", App)
config.link(c2, "app1.x -> app2.x")
config.link(c2, "app2.x -> app1.x")
print("c1 -> c2")
configure(c2)
assert(#app_array == 2)
assert(#link_array == 2)
assert(app_table.app1 ~= orig_app1) -- should be restarted
assert(app_table.app2 == orig_app2) -- should be the same
-- tostring() because == does not work on FFI structs?
assert(tostring(orig_link) == tostring(link_table['app1.x -> app2.x']))
print("c2 -> c1")
configure(c1) -- c2 -> c1
assert(app_table.app1 ~= orig_app1) -- should be restarted
assert(app_table.app2 == orig_app2) -- should be the same
assert(#app_array == 2)
assert(#link_array == 1)
print("c1 -> empty")
configure(config.new())
assert(#app_array == 0)
assert(#link_array == 0)
-- Test app arg validation
local AppC = {
config = {
a = {required=true}, b = {default="foo"}
}
}
local c3 = config.new()
config.app(c3, "app_valid", AppC, {a="bar"})
assert(not pcall(config.app, c3, "app_invalid", AppC))
assert(not pcall(config.app, c3, "app_invalid", AppC, {b="bar"}))
assert(not pcall(config.app, c3, "app_invalid", AppC, {a="bar", c="foo"}))
-- Test app restarts on failure.
use_restart = true
print("c_fail")
local App1 = {zone="test"}
function App1:new () return setmetatable({}, {__index = App1}) end
function App1:pull () error("Pull error.") end
function App1:push () return true end
function App1:report () return true end
local App2 = {zone="test"}
function App2:new () return setmetatable({}, {__index = App2}) end
function App2:pull () return true end
function App2:push () error("Push error.") end
function App2:report () return true end
local App3 = {zone="test"}
function App3:new () return setmetatable({}, {__index = App3}) end
function App3:pull () return true end
function App3:push () return true end
function App3:report () error("Report error.") end
local c_fail = config.new()
config.app(c_fail, "app1", App1)
config.app(c_fail, "app2", App2)
config.app(c_fail, "app3", App3)
config.link(c_fail, "app1.x -> app2.x")
configure(c_fail)
local orig_app1 = app_table.app1
local orig_app2 = app_table.app2
local orig_app3 = app_table.app3
local orig_link1 = link_array[1]
local orig_link2 = link_array[2]
main({duration = 4, report = {showapps = true}})
assert(app_table.app1 ~= orig_app1) -- should be restarted
assert(app_table.app2 ~= orig_app2) -- should be restarted
assert(app_table.app3 == orig_app3) -- should be the same
main({duration = 4, report = {showapps = true}})
assert(app_table.app3 ~= orig_app3) -- should be restarted
end
| apache-2.0 |
5620g/38196040 | plugins/anti_flood.lua | 281 | 2422 | local NUM_MSG_MAX = 5 -- Max number of messages per TIME_CHECK seconds
local TIME_CHECK = 5
local function kick_user(user_id, chat_id)
local chat = 'chat#id'..chat_id
local user = 'user#id'..user_id
chat_del_user(chat, user, function (data, success, result)
if success ~= 1 then
local text = 'I can\'t kick '..data.user..' but should be kicked'
send_msg(data.chat, '', ok_cb, nil)
end
end, {chat=chat, user=user})
end
local function run (msg, matches)
if msg.to.type ~= 'chat' then
return 'Anti-flood works only on channels'
else
local chat = msg.to.id
local hash = 'anti-flood:enabled:'..chat
if matches[1] == 'enable' then
redis:set(hash, true)
return 'Anti-flood enabled on chat'
end
if matches[1] == 'disable' then
redis:del(hash)
return 'Anti-flood disabled on chat'
end
end
end
local function pre_process (msg)
-- Ignore service msg
if msg.service then
print('Service message')
return msg
end
local hash_enable = 'anti-flood:enabled:'..msg.to.id
local enabled = redis:get(hash_enable)
if enabled then
print('anti-flood enabled')
-- Check flood
if msg.from.type == 'user' then
-- Increase the number of messages from the user on the chat
local hash = 'anti-flood:'..msg.from.id..':'..msg.to.id..':msg-num'
local msgs = tonumber(redis:get(hash) or 0)
if msgs > NUM_MSG_MAX then
local receiver = get_receiver(msg)
local user = msg.from.id
local text = 'User '..user..' is flooding'
local chat = msg.to.id
send_msg(receiver, text, ok_cb, nil)
if msg.to.type ~= 'chat' then
print("Flood in not a chat group!")
elseif user == tostring(our_id) then
print('I won\'t kick myself')
elseif is_sudo(msg) then
print('I won\'t kick an admin!')
else
-- Ban user
-- TODO: Check on this plugin bans
local bhash = 'banned:'..msg.to.id..':'..msg.from.id
redis:set(bhash, true)
kick_user(user, chat)
end
msg = nil
end
redis:setex(hash, TIME_CHECK, msgs+1)
end
end
return msg
end
return {
description = 'Plugin to kick flooders from group.',
usage = {},
patterns = {
'^!antiflood (enable)$',
'^!antiflood (disable)$'
},
run = run,
privileged = true,
pre_process = pre_process
}
| gpl-2.0 |
5620g/38196040 | plugins/anti-flood2.lua | 281 | 2422 | local NUM_MSG_MAX = 5 -- Max number of messages per TIME_CHECK seconds
local TIME_CHECK = 5
local function kick_user(user_id, chat_id)
local chat = 'chat#id'..chat_id
local user = 'user#id'..user_id
chat_del_user(chat, user, function (data, success, result)
if success ~= 1 then
local text = 'I can\'t kick '..data.user..' but should be kicked'
send_msg(data.chat, '', ok_cb, nil)
end
end, {chat=chat, user=user})
end
local function run (msg, matches)
if msg.to.type ~= 'chat' then
return 'Anti-flood works only on channels'
else
local chat = msg.to.id
local hash = 'anti-flood:enabled:'..chat
if matches[1] == 'enable' then
redis:set(hash, true)
return 'Anti-flood enabled on chat'
end
if matches[1] == 'disable' then
redis:del(hash)
return 'Anti-flood disabled on chat'
end
end
end
local function pre_process (msg)
-- Ignore service msg
if msg.service then
print('Service message')
return msg
end
local hash_enable = 'anti-flood:enabled:'..msg.to.id
local enabled = redis:get(hash_enable)
if enabled then
print('anti-flood enabled')
-- Check flood
if msg.from.type == 'user' then
-- Increase the number of messages from the user on the chat
local hash = 'anti-flood:'..msg.from.id..':'..msg.to.id..':msg-num'
local msgs = tonumber(redis:get(hash) or 0)
if msgs > NUM_MSG_MAX then
local receiver = get_receiver(msg)
local user = msg.from.id
local text = 'User '..user..' is flooding'
local chat = msg.to.id
send_msg(receiver, text, ok_cb, nil)
if msg.to.type ~= 'chat' then
print("Flood in not a chat group!")
elseif user == tostring(our_id) then
print('I won\'t kick myself')
elseif is_sudo(msg) then
print('I won\'t kick an admin!')
else
-- Ban user
-- TODO: Check on this plugin bans
local bhash = 'banned:'..msg.to.id..':'..msg.from.id
redis:set(bhash, true)
kick_user(user, chat)
end
msg = nil
end
redis:setex(hash, TIME_CHECK, msgs+1)
end
end
return msg
end
return {
description = 'Plugin to kick flooders from group.',
usage = {},
patterns = {
'^!antiflood (enable)$',
'^!antiflood (disable)$'
},
run = run,
privileged = true,
pre_process = pre_process
}
| gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/globals/abilities/evokers_roll.lua | 19 | 2756 | -----------------------------------
-- Ability: Evoker's Roll
-- Gradually restores MP for party members within area of effect
-- Optimal Job: Summoner
-- Lucky Number: 5
-- Unlucky Number: 9
-- Level: 40
--
-- Die Roll |No SMN |With SMN
-- -------- ------- -----------
-- 1 |+1 |+2
-- 2 |+1 |+2
-- 3 |+1 |+2
-- 4 |+1 |+2
-- 5 |+3 |+4
-- 6 |+2 |+3
-- 7 |+2 |+3
-- 8 |+2 |+3
-- 9 |+1 |+2
-- 10 |+3 |+4
-- 11 |+4 |+5
-- Bust |-1 |-1
--
-- Busting on Evoker's Roll will give you -1MP/tick less on your own total MP refreshed; i.e. you do not actually lose MP
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/ability");
require("scripts/globals/status");
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
local effectID = EFFECT_EVOKERS_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;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(caster,target,ability,action)
if (caster:getID() == target:getID()) then
corsairSetup(caster, ability, action, EFFECT_EVOKERS_ROLL, JOBS.SMN);
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 = {1, 1, 1, 1, 3, 2, 2, 2, 1, 3, 4, 1}
local effectpower = effectpowers[total];
if (caster:getLocalVar("corsairRollBonus") == 1 and total < 12) then
effectpower = effectpower + 1
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_EVOKERS_ROLL, effectpower, 0, duration, caster:getID(), total, MOD_REFRESH) == false) then
ability:setMsg(422);
elseif total > 11 then
ability:setMsg(426);
end
return total;
end
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Sacrificial_Chamber/npcs/_4j4.lua | 14 | 1440 | -----------------------------------
-- Area: Sacrificial Chamber
-- NPC: Mahogany Door
-- @pos 300 30 -324 163
-------------------------------------
package.loaded["scripts/zones/Sacrificial_Chamber/TextIDs"] = nil;
-------------------------------------
require("scripts/globals/bcnm");
require("scripts/globals/missions");
require("scripts/zones/Sacrificial_Chamber/TextIDs");
-----------------------------------
-- 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 1;
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 |
bmscoordinators/FFXI-Server | scripts/globals/items/serving_of_bavarois_+1.lua | 12 | 1282 | -----------------------------------------
-- ID: 5730
-- Item: Serving of Bavarois +1
-- Food Effect: 4 Hrs, All Races
-----------------------------------------
-- HP 25
-- Intelligence 4
-- hHP +4
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5730);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 25);
target:addMod(MOD_INT, 4);
target:addMod(MOD_HPHEAL, 4);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 25);
target:delMod(MOD_INT, 4);
target:delMod(MOD_HPHEAL, 4);
end;
| gpl-3.0 |
deepak78/luci | libs/lucid-rpc/luasrc/lucid/rpc.lua | 52 | 1197 | --[[
LuCI - Lua Development Framework
Copyright 2009 Steven Barth <steven@midlink.org>
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$
]]
local require, ipairs, pcall = require, ipairs, pcall
local srv = require "luci.lucid.rpc.server"
module "luci.lucid.rpc"
--- Prepare the RPC-daemon and its associated publishers.
-- @param publisher Table of publishers
-- @return factory callback or nil, error message
function factory(publisher)
local root = srv.Module()
local server = srv.Server(root)
for _, r in ipairs(publisher) do
for _, m in ipairs(r.export) do
local s, mod = pcall(require, r.namespace .. "." .. m)
if s and mod then
local module = mod._factory()
if r.exec then
for _, x in ipairs(r.exec) do
if x:sub(1,1) == ":" then
module:restrict({interface = x:sub(2)})
else
module:restrict({user = x})
end
end
end
root:add(m, module)
else
return nil, mod
end
end
end
return function(...) return server:process(...) end
end | apache-2.0 |
bmscoordinators/FFXI-Server | scripts/globals/items/crepe_forestiere.lua | 12 | 1467 | -----------------------------------------
-- ID: 5774
-- Item: crepe_forestiere
-- Food Effect: 30Min, All Races
-----------------------------------------
-- Mind 2
-- MP % 10 (cap 35)
-- Magic Accuracy +15
-- Magic Def. Bonus +6
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,1800,5774);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MND, 2);
target:addMod(MOD_FOOD_MPP, 10);
target:addMod(MOD_FOOD_MP_CAP, 35);
target:addMod(MOD_MACC, 15);
target:addMod(MOD_MDEF, 6);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MND, 2);
target:delMod(MOD_FOOD_MPP, 10);
target:delMod(MOD_FOOD_MP_CAP, 35);
target:delMod(MOD_MACC, 15);
target:delMod(MOD_MDEF, 6);
end;
| gpl-3.0 |
alivilteram/mustafa1p | plugins/help.lua | 1 | 1632 | do
function run(msg, matches)
return [[
⚪️/Open | Close file :- منع ملفات
⚪️/Open | Close image :- منع صور
⚪️/Open | Close audio :- منع صوت
⚪️/Open | Close sticker :- منع ملصق
⚪️/Open | Close link :- منع روابط
⚪️/Open | Close chat :- قفل الدردشة
➖➖➖➖➖➖➖➖
⚪️/Promote :- رفع ادمن
⚪️/demote :- انزل ادمن
💭/spromote : up leader by <reply|id|username>
💭/sdemote : in promote by <reply|id|username>
⚪️/modlist :- اظهار الادمنية
⚪️/kickme :- للخروج من المجموعة
️️⚪️/kick :- طرد عضو
⚪️/ban :- حضر العضو من المجموعة
⚪️/block (word) :- حضر كلمه
⚪️/unblock (word) :- الغاء حضر كلمه
⚪️/group settings :- اعدادات متقدمة
➖➖➖➖➖➖➖➖
⚪️/setabout (txt) :- وضع وصف سوبر
⚪️/setrules :- وضع قوانين
⚪️/rules :- اظهار قوانين
⚪️/about :- اظهار وصف السوبر
⚪️/delete :- حذف رساله سوبر
⚪️/getlink :- جلب رابط القروب خاص
⚪️/relink :- تغير رابط المجموعة
⚪️/setname (text) :- وضع اسم
⚪️/setphoto :- وضع صورة
➖➖➖➖➖➖🆕
⚪️/sillent :- منع العضو من التكلم
⚪️/unsillent :- الغاء منع التكلم من عضو
➖➖➖➖➖➖
channel: @Rabintgch
@ali_vilter
]]
end
return {
description = "Shows bot help",
usage = "!help me: Shows bot help",
patterns = {
"^help me$",
"^[^$#>/!](help me)$"
},
run = run
}
end
| gpl-3.0 |
diamondo25/Vana | scripts/npcs/gachapon18.lua | 2 | 7204 | --[[
Copyright (C) 2008-2016 Vana Development Team
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; version 2
of the License.
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.
--]]
-- Gachapon - The Nautilus : Mid Floor - Hallway
dofile("scripts/utils/gachaponHelper.lua");
-- General rules:
-- Global item chance is significantly reduced
-- All gear for town class; weight derived at 20 / itemLevel
-- 10 random gears between levels 10 and 40 from other town classes; weight derived at 10 / itemLevel
-- All skills for the town class
-- All weapon scrolls for the town class' weapons
commonEquips = {};
warriorEquips = {
{1060017, ["weight"] = 0.33}, {1072047, ["weight"] = 0.50},
{1302008, ["weight"] = 0.33}, {1072002, ["weight"] = 0.29},
{1002055, ["weight"] = 0.50}, {1040028, ["weight"] = 0.31},
{1041064, ["weight"] = 1.00}, {1072041, ["weight"] = 0.33},
{1072127, ["weight"] = 0.25}, {1092000, ["weight"] = 0.67},
};
magicianEquips = {
{1050010, ["weight"] = 0.77}, {1050008, ["weight"] = 0.77},
{1072006, ["weight"] = 1.00}, {1082053, ["weight"] = 0.33},
{1061022, ["weight"] = 0.77}, {1051026, ["weight"] = 0.26},
{1051003, ["weight"] = 0.43}, {1382015, ["weight"] = 0.33},
{1072074, ["weight"] = 0.40}, {1002013, ["weight"] = 0.33},
};
bowmanEquips = {
{1082048, ["weight"] = 0.33}, {1061061, ["weight"] = 0.29},
{1041056, ["weight"] = 0.33}, {1002161, ["weight"] = 0.33},
{1002157, ["weight"] = 0.40}, {1002162, ["weight"] = 0.33},
{1462048, ["weight"] = 0.25}, {1002158, ["weight"] = 0.40},
{1041054, ["weight"] = 0.33}, {1002120, ["weight"] = 0.50},
};
thiefEquips = {
{1040061, ["weight"] = 0.29}, {1060073, ["weight"] = 0.25},
{1072031, ["weight"] = 0.67}, {1472013, ["weight"] = 0.29},
{1051009, ["weight"] = 0.29}, {1472009, ["weight"] = 0.33},
{1072036, ["weight"] = 0.33}, {1002184, ["weight"] = 0.25},
{1002182, ["weight"] = 0.25}, {1061055, ["weight"] = 0.40},
};
pirateEquips = {
{1002610, ["weight"] = 2.00}, {1002613, ["weight"] = 1.33},
{1002616, ["weight"] = 1.00}, {1002619, ["weight"] = 0.80},
{1002622, ["weight"] = 0.67}, {1002625, ["weight"] = 0.57},
{1002628, ["weight"] = 0.50}, {1002631, ["weight"] = 0.40},
{1002634, ["weight"] = 0.33}, {1002637, ["weight"] = 0.29},
{1002640, ["weight"] = 0.25}, {1002643, ["weight"] = 0.22},
{1002646, ["weight"] = 0.20}, {1002649, ["weight"] = 0.18},
{1002780, ["weight"] = 0.17}, {1002794, ["weight"] = 0.17},
{1052095, ["weight"] = 2.00}, {1052098, ["weight"] = 1.33},
{1052101, ["weight"] = 1.00}, {1052104, ["weight"] = 0.80},
{1052107, ["weight"] = 0.67}, {1052110, ["weight"] = 0.57},
{1052113, ["weight"] = 0.50}, {1052116, ["weight"] = 0.40},
{1052119, ["weight"] = 0.33}, {1052122, ["weight"] = 0.29},
{1052125, ["weight"] = 0.25}, {1052128, ["weight"] = 0.22},
{1052131, ["weight"] = 0.20}, {1052134, ["weight"] = 0.18},
{1052159, ["weight"] = 0.17}, {1052164, ["weight"] = 0.17},
{1072285, ["weight"] = 1.33}, {1072288, ["weight"] = 1.00},
{1072291, ["weight"] = 0.80}, {1072294, ["weight"] = 0.67},
{1072297, ["weight"] = 0.57}, {1072300, ["weight"] = 0.50},
{1072303, ["weight"] = 0.40}, {1072306, ["weight"] = 0.33},
{1072309, ["weight"] = 0.29}, {1072312, ["weight"] = 0.25},
{1072315, ["weight"] = 0.22}, {1072318, ["weight"] = 0.20},
{1072321, ["weight"] = 0.18}, {1072338, ["weight"] = 0.67},
{1072359, ["weight"] = 0.17}, {1072365, ["weight"] = 0.17},
{1082180, ["weight"] = 1.33}, {1082183, ["weight"] = 1.00},
{1082186, ["weight"] = 0.80}, {1082189, ["weight"] = 0.67},
{1082192, ["weight"] = 0.57}, {1082195, ["weight"] = 0.50},
{1082198, ["weight"] = 0.40}, {1082201, ["weight"] = 0.33},
{1082204, ["weight"] = 0.29}, {1082207, ["weight"] = 0.25},
{1082210, ["weight"] = 0.22}, {1082213, ["weight"] = 0.20},
{1082216, ["weight"] = 0.18}, {1082238, ["weight"] = 0.17},
{1082243, ["weight"] = 0.17}, {1482000, ["weight"] = 2.00},
{1482001, ["weight"] = 1.33}, {1482002, ["weight"] = 1.00},
{1482003, ["weight"] = 0.80}, {1482004, ["weight"] = 0.67},
{1482005, ["weight"] = 0.57}, {1482006, ["weight"] = 0.50},
{1482007, ["weight"] = 0.40}, {1482008, ["weight"] = 0.33},
{1482009, ["weight"] = 0.29}, {1482010, ["weight"] = 0.25},
{1482011, ["weight"] = 0.22}, {1482012, ["weight"] = 0.20},
{1482013, ["weight"] = 0.18}, {1482023, ["weight"] = 0.17},
{1482024, ["weight"] = 0.17}, {1482034, ["weight"] = 0.17},
{1492000, ["weight"] = 2.00}, {1492001, ["weight"] = 1.33},
{1492002, ["weight"] = 1.00}, {1492003, ["weight"] = 0.80},
{1492004, ["weight"] = 0.67}, {1492005, ["weight"] = 0.57},
{1492006, ["weight"] = 0.50}, {1492007, ["weight"] = 0.40},
{1492008, ["weight"] = 0.33}, {1492009, ["weight"] = 0.29},
{1492010, ["weight"] = 0.25}, {1492011, ["weight"] = 0.22},
{1492012, ["weight"] = 0.20}, {1492013, ["weight"] = 0.18},
{1492023, ["weight"] = 0.17}, {1492025, ["weight"] = 0.17},
};
scrolls = {
2044800, 2044801, 2044802, 2044803, 2044804, 2044805, 2044807, 2044809, 2044900, 2044901,
2044902, 2044903, 2044904,
};
bullets = {
-- TODO FIXME gachapon
};
skills = {
-- 2290096 (which should be the start of these books given the other classes) is Maple Warrior 20, so obviously not a part of here
{2290097, ["weight"] = mastery_book_20}, {2290098, ["weight"] = mastery_book_30},
{2290099, ["weight"] = mastery_book_20}, {2290100, ["weight"] = mastery_book_30},
{2290101, ["weight"] = mastery_book_20},
{2290102, ["weight"] = mastery_book_20}, {2290103, ["weight"] = mastery_book_30},
{2290104, ["weight"] = mastery_book_20}, {2290105, ["weight"] = mastery_book_30},
{2290106, ["weight"] = mastery_book_20}, {2290107, ["weight"] = mastery_book_30},
{2290108, ["weight"] = mastery_book_20}, --{2290109, ["weight"] = mastery_book_30}, -- Technically this book exists, but it's not used, it's Speed Infusion 30
{2290110, ["weight"] = mastery_book_20}, {2290111, ["weight"] = mastery_book_30},
{2290112, ["weight"] = mastery_book_20}, {2290113, ["weight"] = mastery_book_30},
{2290114, ["weight"] = mastery_book_20},
{2290115, ["weight"] = mastery_book_20}, {2290116, ["weight"] = mastery_book_30},
{2290117, ["weight"] = mastery_book_20}, {2290118, ["weight"] = mastery_book_30},
{2290119, ["weight"] = mastery_book_20}, {2290120, ["weight"] = mastery_book_30},
{2290121, ["weight"] = mastery_book_20}, {2290122, ["weight"] = mastery_book_30},
{2290123, ["weight"] = mastery_book_20},
{2290124, ["weight"] = mastery_book_20},
};
items = merge(commonEquips, warriorEquips, magicianEquips, bowmanEquips, thiefEquips, pirateEquips, scrolls, bullets, skills);
gachapon({
["items"] = items,
-- Decrease the chance of getting things from the global item list
["globalItemWeightModifier"] = .5,
}); | gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/zones/Bastok_Mines/npcs/Rodellieux.lua | 17 | 1433 | -----------------------------------
-- Area: Bastok_Mines
-- NPC: Rodellieux
-- Only sells when Bastok controlls Fauregandi Region
-----------------------------------
require("scripts/globals/shop");
require("scripts/globals/conquest");
package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil;
require("scripts/zones/Bastok_Mines/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
RegionOwner = GetRegionOwner(FAUREGANDI);
if (RegionOwner ~= NATION_BASTOK) then
player:showText(npc,RODELLIEUX_CLOSED_DIALOG);
else
player:showText(npc,RODELLIEUX_OPEN_DIALOG);
stock = {
0x11db, 90, --Beaugreens
0x110b, 39, --Faerie Apple
0x02b3, 54 --Maple Log
}
showShop(player,BASTOK,stock);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
wingo/snabb | lib/ljsyscall/examples/epoll.lua | 23 | 3206 | -- simple epoll-based socket example. Serves up http responses, but is of course not a proper server
-- you can test performance with ab -n 100000 -c 100 http://localhost:8000/ although ab may be the limiting factor
local S
if arg[1] == "rump" then
S = require "syscall.rump.init".init{"net", "net.net", "net.local", "net.netinet"}
else
S = require "syscall"
end
local t, c = S.t, S.c
local function assert(cond, s, ...)
if cond == nil then error(tostring(s)) end -- annoyingly, assert does not call tostring!
return cond, s, ...
end
local maxevents = 1024
local poll
local function nilf() return nil end
-- this is somewhat working toward a common API but needs a lot more work, but has resulted in some improvements
if S.epoll_create then
poll = {
init = function(this)
return setmetatable({fd = assert(S.epoll_create())}, {__index = this})
end,
event = t.epoll_event(),
add = function(this, s)
local event = this.event
event.events = c.EPOLL.IN
event.data.fd = s:getfd()
assert(this.fd:epoll_ctl("add", s, event))
end,
events = t.epoll_events(maxevents),
get = function(this)
local f, a, r = this.fd:epoll_wait(this.events)
if not f then
print("error on fd", a)
return nilf
else
return f, a, r
end
end,
eof = function(ev) return ev.HUP or ev.ERR or ev.RDHUP end,
}
elseif S.kqueue then
poll = {
init = function(this)
return setmetatable({fd = assert(S.kqueue())}, {__index = this})
end,
event = t.kevents(1),
add = function(this, s)
local event = this.event[1]
event.fd = s
event.setfilter = "read"
event.setflags = "add"
assert(this.fd:kevent(this.event, nil, 0))
end,
events = t.kevents(maxevents),
get = function(this)
local f, a, r = this.fd:kevent(nil, this.events)
if not f then
print("error on fd", a)
return nilf
else
return f, a, r
end
end,
eof = function(ev) return ev.EOF or ev.ERROR end,
}
else
error("no epoll or kqueue support")
end
local s = assert(S.socket("inet", "stream, nonblock"))
s:setsockopt("socket", "reuseaddr", true)
local sa = assert(t.sockaddr_in(8000, "127.0.0.1"))
assert(s:bind(sa))
assert(s:listen(128))
local ep = poll:init()
ep:add(s)
local w = {}
local msg = [[
<html>
<head>
<title>performance test</title>
</head>
<body>
test
</body>
</html>
]]
local reply = table.concat({
"HTTP/1.0 200 OK",
"Content-type: text/html",
"Connection: close",
"Content-Length: " .. #msg,
"",
"",
}, "\r\n") .. msg
local bufsize = 4096
local buffer = t.buffer(bufsize)
local ss = t.sockaddr_storage()
local function loop()
for i, ev in ep:get() do
if ep.eof(ev) then
ev.fd:close()
w[ev.fd] = nil
end
if ev.fd == s:getfd() then -- server socket, accept
repeat
local a, err = s:accept(ss, nil, "nonblock")
if a then
ep:add(a)
w[a:getfd()] = a
end
until not a
else
local fd = w[ev.fd]
fd:read(buffer, bufsize)
local n = fd:write(reply)
assert(n == #reply)
assert(fd:close())
w[ev.fd] = nil
end
end
return loop()
end
loop()
| apache-2.0 |
raedwulf/awesome | luadoc/screen.lua | 3 | 1198 | --- awesome screen API
-- @author Julien Danjou <julien@danjou.info>
-- @copyright 2008-2009 Julien Danjou
module("screen")
--- Screen is a table where indexes are screen number. You can use screen[1]
-- to get access to the first screen, etc. Each screen has a set of properties.
-- @field geometry The screen coordinates. Immutable.
-- @field workarea The screen workarea.
-- @field index The screen number.
-- @class table
-- @name screen
--- Get the number of screen.
-- @param -
-- @return The screen count, at least 1.
-- @name count
-- @class function
--- Add a signal to a screen.
-- @param name A signal name.
-- @param func A function to call when the signal is emitted.
-- @name connect_signal
-- @class function
--- Remove a signal to a screen.
-- @param name A signal name.
-- @param func A function to remove
-- @name disconnect_signal
-- @class function
--- Emit a signal to a screen.
-- @param name A signal name.
-- @param ... Various arguments, optional.
-- @name emit_signal
-- @class function
--- Get or set screen tags.
-- @param tags_table None or a table of tags to set to the screen.
-- The table must contains at least one tag.
-- @name tags
-- @class function
| gpl-2.0 |
diamondo25/Vana | scripts/npcs/subway_out.lua | 2 | 1030 | --[[
Copyright (C) 2008-2016 Vana Development Team
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; version 2
of the License.
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.
--]]
-- Exit Signs in Shumi's jump quests
dofile("scripts/utils/npcHelper.lua");
addText("This device is connected to outside. ");
addText("Are you going to give up and leave this place? ");
addText("You'll have to start from scratch the next time you come in...");
answer = askYesNo();
if answer == answer_yes then
setMap(103000100);
end | gpl-2.0 |
draexx/config | conky/clock_rings_maia.lua | 1 | 4513 | settings_table = {
{
name='time',
arg='%I',
max=12,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.2,
x=160, y=155,
radius=50,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%M',
max=59,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0x336699,
fg_alpha=0.8,
x=160, y=155,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=160, y=155,
radius=62,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='cpu',
arg='cpu0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=160, y=155,
radius=78.5,
thickness=10,
start_angle=93,
end_angle=208
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=160, y=155,
radius=78.5,
thickness=10,
start_angle=212,
end_angle=329
},
{
name='wireless_link_qual_perc',
arg='wlan0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=160, y=155,
radius=78.5,
thickness=10,
start_angle=-27,
end_angle=85
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=160, y=155,
radius=105,
thickness=3,
start_angle=-120,
end_angle=-13
},
{
name='fs_used_perc',
arg='/home',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=160, y=155,
radius=105,
thickness=3,
start_angle=-10,
end_angle=120
},
{
name='fs_used_perc',
arg='/home/draexx/Data',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=160, y=155,
radius=105,
thickness=3,
start_angle=123,
end_angle=237
},
}
clock_r=58
clock_x=160
clock_y=155
clock_colour=0xffffff
clock_alpha=0.5
show_seconds=true
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function draw_ring(cr,t,pt)
local w,h=conky_window.width,conky_window.height
local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
local angle_0=sa*(2*math.pi/360)-math.pi/2
local angle_f=ea*(2*math.pi/360)-math.pi/2
local t_arc=t*(angle_f-angle_0)
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end
function draw_clock_hands(cr,xc,yc)
local secs,mins,hours,secs_arc,mins_arc,hours_arc
local xh,yh,xm,ym,xs,ys
secs=os.date("%S")
mins=os.date("%M")
hours=os.date("%I")
secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins+secs_arc/60
hours_arc=(2*math.pi/12)*hours+mins_arc/12
xh=xc+0.7*clock_r*math.sin(hours_arc)
yh=yc-0.7*clock_r*math.cos(hours_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xh,yh)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,5)
cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
cairo_stroke(cr)
xm=xc+clock_r*math.sin(mins_arc)
ym=yc-clock_r*math.cos(mins_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xm,ym)
cairo_set_line_width(cr,3)
cairo_stroke(cr)
if show_seconds then
xs=xc+clock_r*math.sin(secs_arc)
ys=yc-clock_r*math.cos(secs_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xs,ys)
cairo_set_line_width(cr,1)
cairo_stroke(cr)
end
end
function conky_clock_rings()
local function setup_rings(cr,pt)
local str=''
local value=0
str=string.format('${%s %s}',pt['name'],pt['arg'])
str=conky_parse(str)
value=tonumber(str)
if value == nil then value = 0 end
pct=value/pt['max']
draw_ring(cr,pct,pt)
end
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table[i])
end
end
draw_clock_hands(cr,clock_x,clock_y)
end
| gpl-3.0 |
rbazaud/vlc | share/lua/modules/simplexml.lua | 103 | 3732 | --[==========================================================================[
simplexml.lua: Lua simple xml parser wrapper
--[==========================================================================[
Copyright (C) 2010 Antoine Cellerier
$Id$
Authors: Antoine Cellerier <dionoea 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.
--]==========================================================================]
module("simplexml",package.seeall)
--[[ Returns the xml tree structure
-- Each node is of one of the following types:
-- { name (string), attributes (key->value map), children (node array) }
-- text content (string)
--]]
local function parsexml(stream, errormsg)
if not stream then return nil, errormsg end
local xml = vlc.xml()
local reader = xml:create_reader(stream)
local tree
local parents = {}
local nodetype, nodename = reader:next_node()
while nodetype > 0 do
if nodetype == 1 then
local node = { name= nodename, attributes= {}, children= {} }
local attr, value = reader:next_attr()
while attr ~= nil do
node.attributes[attr] = value
attr, value = reader:next_attr()
end
if tree then
table.insert(tree.children, node)
table.insert(parents, tree)
end
tree = node
elseif nodetype == 2 then
if #parents > 0 then
local tmp = {}
while nodename ~= tree.name do
if #parents == 0 then
error("XML parser error/faulty logic")
end
local child = tree
tree = parents[#parents]
table.remove(parents)
table.remove(tree.children)
table.insert(tmp, 1, child)
for i, node in pairs(child.children) do
table.insert(tmp, i+1, node)
end
child.children = {}
end
for _, node in pairs(tmp) do
table.insert(tree.children, node)
end
tree = parents[#parents]
table.remove(parents)
end
elseif nodetype == 3 then
table.insert(tree.children, nodename)
end
nodetype, nodename = reader:next_node()
end
if #parents > 0 then
error("XML parser error/Missing closing tags")
end
return tree
end
function parse_url(url)
return parsexml(vlc.stream(url))
end
function parse_string(str)
return parsexml(vlc.memory_stream(str))
end
function add_name_maps(tree)
tree.children_map = {}
for _, node in pairs(tree.children) do
if type(node) == "table" then
if not tree.children_map[node.name] then
tree.children_map[node.name] = {}
end
table.insert(tree.children_map[node.name], node)
add_name_maps(node)
end
end
end
| gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/zones/Selbina/npcs/Vuntar.lua | 14 | 3323 | -----------------------------------
-- Area: Selbina
-- NPC: Vuntar
-- Starts and Finishes Quest: Cargo (R)
-- @pos 7 -2 -15 248
-----------------------------------
package.loaded["scripts/zones/Selbina/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Selbina/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/quests");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(OTHER_AREAS,CARGO) ~= QUEST_AVAILABLE) then
realday = tonumber(os.date("%j")); -- %M for next minute, %j for next real day
starttime = player:getVar("VuntarCanBuyItem_date");
if (realday ~= starttime) then
if (trade:hasItemQty(4529,1) == true and trade:getGil() == 0 and trade:getItemCount() == 1) then
player:startEvent(0x0034,1); -- Can Buy rolanberry (881 ce)
elseif (trade:hasItemQty(4530,1) == true and trade:getGil() == 0 and trade:getItemCount() == 1) then
player:startEvent(0x0034,2); -- Can Buy rolanberry (874 ce)
elseif (trade:hasItemQty(4531,1) == true and trade:getGil() == 0 and trade:getItemCount() == 1) then
player:startEvent(0x0034,3); -- Can Buy rolanberry (864 ce)
end
else
player:startEvent(0x046e,4365); -- Can't buy rolanberrys
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getMainLvl() >= 20 and player:getQuestStatus(OTHER_AREAS,CARGO) == QUEST_AVAILABLE) then
player:startEvent(0x0032,4365); -- Start quest "Cargo"
elseif (player:getMainLvl() < 20) then
player:startEvent(0x0035); -- Dialog for low level or low fame
else
player:startEvent(0x0033,4365); -- During & after completed quest "Cargo"
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0032) then
player:addQuest(OTHER_AREAS,CARGO);
elseif (csid == 0x0034) then
player:setVar("VuntarCanBuyItem_date", os.date("%j")); -- %M for next minute, %j for next real day
if (player:getQuestStatus(OTHER_AREAS,CARGO) == QUEST_ACCEPTED) then
player:completeQuest(OTHER_AREAS,CARGO);
player:addFame(OTHER_AREAS,30);
end
if (option == 1) then
player:addGil(800);
player:messageSpecial(GIL_OBTAINED,800);
player:tradeComplete();
elseif (option == 2) then
player:addGil(2000);
player:messageSpecial(GIL_OBTAINED,2000);
player:tradeComplete();
elseif (option == 3) then
player:addGil(3000);
player:messageSpecial(GIL_OBTAINED,3000);
player:tradeComplete();
end
end
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Port_Bastok/npcs/Numa.lua | 17 | 1786 | -----------------------------------
-- Area: Port Bastok
-- NPC: Numa
-- Standard Merchant NPC
-- Confirmed shop stock, August 2013
-----------------------------------
require("scripts/globals/shop");
package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil;
require("scripts/zones/Port_Bastok/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,NUMA_SHOP_DIALOG);
stock = {
0x30A9, 5079,1, --Cotton Hachimaki
0x3129, 7654,1, --Cotton Dogi
0x31A9, 4212,1, --Cotton Tekko
0x3229, 6133,1, --Cotton Sitabaki
0x32A9, 3924,1, --Cotton Kyahan
0x3395, 3825,1, --Silver Obi
0x30A8, 759,2, --Hachimaki
0x3128, 1145,2, --Kenpogi
0x31A8, 630,2, --Tekko
0x3228, 915,2, --Sitabaki
0x32A8, 584,2, --Kyahan
0x02C0, 132,2, --Bamboo Stick
0x025D, 180,3, --Pickaxe
0x16EB, 13500,3, --Toolbag (Ino)
0x16EC, 18000,3, --Toolbag (Shika)
0x16ED, 18000,3 --Toolbag (Cho)
}
showNationShop(player, NATION_BASTOK, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
kerb9729/ESOPublicAddons | Alchemist/localization/fr.lua | 3 | 2539 | local mkstr = ZO_CreateStringId
local SI = Alchemist.SI
-- output texts
mkstr(SI.NO_DISCOVERIES_AVAILABLE, "Aucune découverte disponible.")
mkstr(SI.COMBINATIONS_AVAILABLE, "%d combinaisons disponibles")
mkstr(SI.COMBINE_THE_FOLLOWING, "Combinez ceci:")
mkstr(SI.TO_GET_THE_FOLLOWING_DISCOVERIES, ".. pour découvrir les propriétés suivantes:")
-- reagents
mkstr(SI.BLESSED_THISTLE, "Chardon Béni")
mkstr(SI.BLUE_ENTOLOMA, "Entoloma")
mkstr(SI.BUGLOSS, "Noctuelle")
mkstr(SI.COLUMBINE, "Ancolie")
mkstr(SI.CORN_FLOWER, "Bleuet")
mkstr(SI.DRAGONTHORN, "Épine-de-Dragon")
mkstr(SI.EMETIC_RUSSULA, "Russule Émétique")
mkstr(SI.IMP_STOOL, "Pied-de-Lutin")
mkstr(SI.LADYS_SMOCK, "Cardamine des Prés")
mkstr(SI.LUMINOUS_RUSSULA, "Russule Phosphorescente")
mkstr(SI.MOUNTAIN_FLOWER, "Lys des Cimes")
mkstr(SI.NAMIRAS_ROT, "Truffe de Namira")
mkstr(SI.NIRNROOT, "Nirnrave")
mkstr(SI.STINKHORN, "Mutinus Elegans")
mkstr(SI.VIOLET_COPRINUS, "Coprin Violet")
mkstr(SI.WATER_HYACINTH, "Jacinthe D'eau")
mkstr(SI.WHITE_CAP, "Chapeau Blanc")
mkstr(SI.WORMWOOD, "Absinthe")
-- traits
mkstr(SI.DETECTION, "de détection^z")
mkstr(SI.INCREASE_ARMOR, "Augmente l'armure")
mkstr(SI.INCREASE_SPELL_POWER, "Augmente la puissance des sorts")
mkstr(SI.INCREASE_SPELL_RESIST, "Augmente la résistance aux sorts")
mkstr(SI.INCREASE_WEAPON_POWER, "Augmente la puissance de l'arme")
mkstr(SI.INVISIBLE, "invisible^z")
mkstr(SI.LOWER_ARMOR, "Diminue l'armure")
mkstr(SI.LOWER_SPELL_CRIT, "Diminue le sort critique")
mkstr(SI.LOWER_SPELL_POWER, "Diminue la puissance des sorts")
mkstr(SI.LOWER_SPELL_RESIST, "Diminue la résistance aux sorts")
mkstr(SI.LOWER_WEAPON_CRIT, "Diminue l'arme critique")
mkstr(SI.LOWER_WEAPON_POWER, "Diminue la puissance de l'arme")
mkstr(SI.RAVAGE_HEALTH, "Réduit la Santé")
mkstr(SI.RAVAGE_MAGICKA, "Réduit la Magie")
mkstr(SI.RAVAGE_STAMINA, "Réduit la Vigueur")
mkstr(SI.REDUCE_SPEED, "Réduit la vitesse")
mkstr(SI.RESTORE_HEALTH, "Rend de la Santé")
mkstr(SI.RESTORE_MAGICKA, "Rend de la Magie")
mkstr(SI.RESTORE_STAMINA, "Rend de la Vigueur")
mkstr(SI.SPEED, "Vitesse")
mkstr(SI.SPELL_CRIT, "Sort critique")
mkstr(SI.STUN, "Sonne")
mkstr(SI.UNSTOPPABLE, "Implacable")
mkstr(SI.WEAPON_CRIT, "Arme critique")
| bsd-3-clause |
bmscoordinators/FFXI-Server | scripts/commands/animatenpc.lua | 1 | 1040 | ---------------------------------------------------------------------------------------------------
-- func: animatenpc
-- desc: Changes the animation of the given npc. (For testing purposes.)
---------------------------------------------------------------------------------------------------
require("scripts/globals/status");
cmdprops =
{
permission = 1,
parameters = "ss"
};
function onTrigger(player, npcId, animationId)
npcId = tonumber(npcId) or npcId;
animationId = tonumber(animationId) or _G[string.upper(animationId)];
if (npcId ~= nil and animationId ~= nil) then
local npc = GetNPCByID( npcId, player );
if (npc == nil) then return; end
local oldAnimiation = npc:getAnimation();
npc:setAnimation( animationId );
player:PrintToPlayer(string.format("NPC ID: %i - %s | Old animation: %i | New animation: %i\n", npcId, npc:getName(), oldAnimiation, animationId));
else
player:PrintToPlayer("You must enter a valid NPC ID and animation ID.");
end
end | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/weaponskills/double_thrust.lua | 26 | 1348 | -----------------------------------
-- Double Thrust
-- Polearm weapon skill
-- Skill Level: 5
-- Delivers a two-hit attack. Damage varies with TP.
-- Will stack with Sneak Attack.
-- Aligned with the Light Gorget.
-- Aligned with the Light Belt.
-- Element: None
-- Modifiers: STR:30%
-- 100%TP 200%TP 300%TP
-- 1.00 1.50 2.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.5; params.ftp300 = 2;
params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.dex_wsc = 0.3;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Jugner_Forest/mobs/Sappy_Sycamore.lua | 14 | 1383 | ----------------------------------
-- Area: Jugner_Forest
-- NM: Sappy Sycamore
-----------------------------------
-----------------------------------
-- onMobInitialize
-----------------------------------
function onMobInitialize(mob)
mob:setMobMod(MOBMOD_ADD_EFFECT,mob:getShortID());
mob:addMod(MOD_SLEEPRES,20);
mob:addMod(MOD_BINDRES,20);
end;
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onAdditionalEffect Action
-----------------------------------
function onAdditionalEffect(mob,target,damage)
-- Guesstimating 1 in 4 chance to slow on melee.
if ((math.random(1,100) >= 25) or (target:hasStatusEffect(EFFECT_SLOW) == true)) then
return 0,0,0;
else
local duration = math.random(15,25);
target:addStatusEffect(EFFECT_SLOW,15,0,duration); -- sproud smack like
return SUBEFFECT_SLOW,MSGBASIC_ADD_EFFECT_STATUS,EFFECT_SLOW;
end
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob, player, isKiller)
end;
-----------------------------------
-- onMobDespawn
-----------------------------------
function onMobDespawn(mob)
UpdateNMSpawnPoint(mob:getID());
mob:setRespawnTime(math.random(3600,4200)); -- repop 60-70min
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/items/chunk_of_orobon_meat.lua | 12 | 1600 | -----------------------------------------
-- ID: 5563
-- Item: Chunk of Orobon Meat
-- Effect: 5 Minutes, food effect, Galka Only
-----------------------------------------
-- HP 10
-- MP -10
-- Strength +6
-- Intelligence -8
-- Demon Killer 10
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:getRace() ~= 8) then
result = 247;
end
if (target:getMod(MOD_EAT_RAW_MEAT) == 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;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,5563);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 10);
target:addMod(MOD_MP, -10);
target:addMod(MOD_STR, 6);
target:addMod(MOD_INT, -8);
target:addMod(MOD_DEMON_KILLER, 10);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 10);
target:delMod(MOD_MP, -10);
target:delMod(MOD_STR, 6);
target:delMod(MOD_INT, -8);
target:delMod(MOD_DEMON_KILLER, 10);
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Southern_San_dOria_[S]/npcs/Thierride.lua | 14 | 3302 | -----------------------------------
-- Area: Southern SandOria [S]
-- NPC: Thierride
-- @zone 80
-- @pos -124 -2 14
-----------------------------------
require("scripts/zones/Southern_San_dOria_[S]/TextIDs");
require("scripts/globals/quests");
-----------------------------------
-- Item 1019 = Lufet Salt
-- Had to use setVar because you have to trade Salts one at a time according to the wiki.
-- Lufet Salt can be obtained by killing Crabs in normal West Ronfaure.
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local lufetSalt = trade:hasItemQty(1019,1);
local cnt = trade:getItemCount();
local beansAhoy = player:getQuestStatus(CRYSTAL_WAR,BEANS_AHOY);
if (lufetSalt and cnt == 1 and beansAhoy == QUEST_ACCEPTED) then
if (player:getVar("BeansAhoy") == 0 == true) then
player:startEvent(0x0151); -- Traded the Correct Item Dialogue (NOTE: You have to trade the Salts one at according to wiki)
elseif (player:needsToZone() == false) then
player:startEvent(0x0154); -- Quest Complete Dialogue
end
else
player:startEvent(0x0153); -- Wrong Item Traded
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local beansAhoy = player:getQuestStatus(CRYSTAL_WAR,BEANS_AHOY);
if (beansAhoy == QUEST_AVAILABLE) then
player:startEvent(0x014E); -- Quest Start
elseif (beansAhoy == QUEST_ACCEPTED) then
player:startEvent(0x014F); -- Quest Active, NPC Repeats what he says but as normal 'text' instead of cutscene.
elseif (beansAhoy == QUEST_COMPLETED and getConquestTally() ~= player:getVar("BeansAhoy_ConquestWeek")) then
player:startEvent(0x0156);
elseif (beansAhoy == QUEST_COMPLETED) then
player:startEvent(0x0155);
else
player:startEvent(0x014D); -- Default Dialogue
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x014E) then
player:addQuest(CRYSTAL_WAR,BEANS_AHOY);
elseif (csid == 0x0151) then
player:tradeComplete();
player:setVar("BeansAhoy",1);
player:needsToZone(true);
elseif (csid == 0x0154 or csid == 0x0156) then
if (player:hasItem(5704,1) or player:getFreeSlotsCount() < 1) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,5704)
else
player:addItem(5704,1);
player:messageSpecial(ITEM_OBTAINED,5704);
player:setVar("BeansAhoy_ConquestWeek",getConquestTally());
if (csid == 0x0154) then
player:completeQuest(CRYSTAL_WAR,BEANS_AHOY);
player:setVar("BeansAhoy",0);
player:tradeComplete();
end
end
end
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Mhaura/npcs/Tya_Padolih.lua | 14 | 1479 | -----------------------------------
-- Area: Mhaura
-- NPC: Tya Padolih
-- Standard Merchant NPC
-- @pos -48 -4 30 249
-----------------------------------
package.loaded["scripts/zones/Mhaura/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/shop");
require("scripts/zones/Mhaura/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,TYAPADOLIH_SHOP_DIALOG);
stock = {0x126c,4147, --Scroll of Regen
0x126e,7516, --Scroll of Regen II
0x1311,10752, --Scroll of Sleepga
0x1252,29030, --Scroll of Baramnesia
0x1253,29030, --Scroll of Baramnesra
0x1288,5523, --Scroll of Invisible
0x1289,2400, --Scroll of Sneak
0x128a,1243, --Scroll of Deodorize
0x1330,18032} --Scroll of Distract
showShop(player, STATIC, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/spells/sacrifice.lua | 33 | 1201 | -----------------------------------------
-- Spell: Sacrifice
--
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local count = 1;
local removables = {EFFECT_FLASH, EFFECT_BLINDNESS, EFFECT_PARALYSIS, EFFECT_POISON, EFFECT_CURSE_I, EFFECT_CURSE_II, EFFECT_DISEASE, EFFECT_PLAGUE};
-- remove one effect and add it to me
for i, effect in ipairs(removables) do
if (target:hasStatusEffect(effect)) then
spell:setMsg(572);
local statusEffect = target:getStatusEffect(effect);
-- only add it to me if I don't have it
if (caster:hasStatusEffect(effect) == false) then
caster:addStatusEffect(effect, statusEffect:getPower(), statusEffect:getTickCount(), statusEffect:getDuration());
end
target:delStatusEffect(effect);
return 1;
end
end
spell:setMsg(75); -- no effect
return 0;
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Port_Windurst/npcs/Kumama.lua | 17 | 1712 | -----------------------------------
-- Area: Port Windurst
-- NPC: Kumama
-- Standard Merchant NPC
-- Confirmed shop stock, August 2013
-----------------------------------
require("scripts/globals/shop");
package.loaded["scripts/zones/Port_Windurst/TextIDs"] = nil;
require("scripts/zones/Port_Windurst/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,KUMAMA_SHOP_DIALOG);
stock = {
0x3239, 2268,1, --Linen Slops
0x32b9, 1462,1, --Holly Clogs
0x3004, 4482,1, --Mahogany Shield
0x3218, 482,2, --Leather Trousers
0x3231, 9936,2, --Cotton Brais
0x3298, 309,2, --Leather Highboots
0x32c0, 544,2, --Solea
0x32b1, 6633,2, --Cotton Gaiters
0x3002, 556,2, --Maple Shield
0x3230, 1899,3, --Brais
0x3238, 172,3, --Slops
0x32b0, 1269,3, --Gaiters
0x32b8, 111,3, --Ash Clogs
0x3001, 110,3 --Lauan Shield
}
showNationShop(player, NATION_WINDURST, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Port_Bastok/npcs/Grin.lua | 14 | 1039 | -----------------------------------
-- Area: Port Bastok
-- NPC: Grin
-- Type: Quest Giver
-- @zone 236
-- @pos -56.533 1.392 -29.432
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0127);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
blackops97/KING_TELE | plugins/hello.lua | 1 | 2550 | --[[
▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀
▀▄ ▄▀ ▀▄ ▄▀
▀▄ ▄▀ BY SAJJAD HUSSIEN ▀▄ ▄▀
▀▄ ▄▀ BY SAJJADHUSSIEN (@TH3_Evil) ▀▄ ▄▀
▀▄ ▄ JUST WRITED BY SAJJAD HUSSIEN ▀▄ ▄▀
▀▄ ▄▀ wolcom : ترحيب ▀▄ ▄▀
▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀
--]]
do
local function axis(msg,matches)
if matches[1] == "chat_add_user" then
local text = ' اهلا بك في المجموعه كبد حياتي 🙈💋'..'\n'..'\n'
..'🔸 اسمك : '..msg.action.user.print_name..'\n'
..'🔸 معرفك : @'..(msg.action.user.username or "لا يوجد")..'\n'
..'🆔 الايدي : '..msg.action.user.id..'\n'
..'📱رقم هاتفك : '..(msg.action.user.phone or "لا يوجد")..'\n'
..'🔸الي ضافك : '..msg.from.print_name..'\n'
..'🔸 معرف الي ضافك : @'..(msg.from.username or "لا يوجد")..'\n'
..'📅 التاريخ : '..os.date('!%A, %B %d, %Y*\n', timestamp)
..'🕚 الوقت : '..os.date(' %T*', os.time())..'\n'
return reply_msg(msg.id, text, ok_cb, false)
end
if matches[1] == "chat_add_user_link" then
local text = ' اهلا بك في المجموعه كبد حياتي 🙈💋'..'\n'..'\n'
..'🔸 اسمك : '..msg.from.print_name..'\n'
..'🔸 معرفك : @'..(msg.from.username or "لا يوجد")..'\n'
..'🆔 الايدي : '..msg.from.id..'\n'
..'📱رقم هاتفك : '..(msg.from.phone or "لا يوجد")..'\n'
..'🔸 اسم المجموعة : '..msg.to.title..'\n'
..'🆔 ايدي المجموعة : '..msg.to.id..'\n'
..'📅 التاريخ : '..os.date('!%A, %B %d, %Y*\n', timestamp)
..'🕚 الوقت : '..os.date(' %T*', os.time())..'\n'
return reply_msg(msg.id, text, ok_cb, false)
end
if matches[1] == "chat_del_user" then
return " 🔸 الله وياك/ج كبد عمري 😍🙈 لتنسه الباب مفتوح 🌚"..msg.action.user.first_name
end
end
return {
patterns = {
"^!!tgservice (chat_add_user)$",
"^!!tgservice (chat_add_user_link)$",
"^!!tgservice (chat_del_user)$"
},
run = axis
}
end
| gpl-2.0 |
pastukhov/fishy-wifi | wegrow/talk.lua | 1 | 1121 | -- talk.lua: exchange data with server over MQTT
talk={}
local function prtbl(t) for k, v in pairs(t) do print(k, v) end end -- DEBUG
local function recall()
if not file.open(w.datafile, "r") then return nil end
_, t = pcall(loadstring("return {" .. (file.read() or "") .. "}"))
file.close()
return t
end
local function forget()
file.open(w.datafile, "w")
file.close()
end
local function pub(k, v)
if not k then
return w.done({}, false) -- no data left so go to next step
end
m:publish(k,v,0,0, function() -- wait for pub to finish before pub next - otherwise complains
print("published ", k, v)
pub(next(t, k))
end)
end
function talk.run()
print("talk.run...") -- DEBUG
t = recall() -- load all persisted key/value pairs from file
print("talk: t=") -- DEBUG
prtbl(t) -- DEBUG
forget() -- this step sequence is over; clear the key/value file
m = mqtt.Client()
m:connect("iot.eclipse.org", 1883, 0, function(con)
print ("connected")
pub(next(t, nil))
end)
end
return talk
| agpl-3.0 |
wingo/snabb | lib/ljsyscall/syscall/openbsd/ffi.lua | 18 | 6838 | -- This are the types for OpenBSD
local require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string =
require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string
local abi = require "syscall.abi"
local ffi = require "ffi"
require "syscall.ffitypes"
local version = require "syscall.openbsd.version".version
local defs = {}
local function append(str) defs[#defs + 1] = str end
append [[
typedef int32_t clockid_t;
typedef uint32_t fflags_t;
typedef uint64_t fsblkcnt_t;
typedef uint64_t fsfilcnt_t;
typedef int32_t id_t;
typedef long key_t;
typedef int32_t lwpid_t;
typedef uint32_t mode_t;
typedef int accmode_t;
typedef int nl_item;
typedef uint32_t nlink_t;
typedef int64_t rlim_t;
typedef uint8_t sa_family_t;
typedef long suseconds_t;
typedef unsigned int useconds_t;
typedef int cpuwhich_t;
typedef int cpulevel_t;
typedef int cpusetid_t;
typedef uint32_t dev_t;
typedef uint32_t fixpt_t;
typedef unsigned int nfds_t;
typedef int64_t daddr_t;
typedef int32_t timer_t;
]]
if version <= 201311 then append [[
typedef uint32_t ino_t;
typedef int32_t time_t;
typedef int32_t clock_t;
]] else append [[
typedef uint64_t ino_t;
typedef int64_t time_t;
typedef int64_t clock_t;
]] end
append [[
typedef unsigned int tcflag_t;
typedef unsigned int speed_t;
typedef char * caddr_t;
/* can be changed, TODO also should be long */
typedef uint32_t __fd_mask;
typedef struct fd_set {
__fd_mask fds_bits[32];
} fd_set;
typedef struct __sigset {
uint32_t sig[1]; // note renamed to match Linux
} sigset_t;
// typedef unsigned int sigset_t; /* this is correct TODO fix */
struct cmsghdr {
socklen_t cmsg_len;
int cmsg_level;
int cmsg_type;
char cmsg_data[?];
};
struct msghdr {
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
int msg_iovlen;
void *msg_control;
socklen_t msg_controllen;
int msg_flags;
};
struct timespec {
time_t tv_sec;
long tv_nsec;
};
struct timeval {
time_t tv_sec;
suseconds_t tv_usec;
};
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
struct sockaddr {
uint8_t sa_len;
sa_family_t sa_family;
char sa_data[14];
};
struct sockaddr_storage {
uint8_t ss_len;
sa_family_t ss_family;
unsigned char __ss_pad1[6];
uint64_t __ss_pad2;
unsigned char __ss_pad3[240];
};
struct sockaddr_in {
uint8_t sin_len;
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
int8_t sin_zero[8];
};
struct sockaddr_in6 {
uint8_t sin6_len;
sa_family_t sin6_family;
in_port_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;
uint32_t sin6_scope_id;
};
struct sockaddr_un {
uint8_t sun_len;
sa_family_t sun_family;
char sun_path[104];
};
struct pollfd {
int fd;
short events;
short revents;
};
]]
if version <= 201311 then append [[
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
int32_t st_lspare0;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
off_t st_size;
int64_t st_blocks;
uint32_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
int32_t st_lspare1;
struct timespec __st_birthtim;
int64_t st_qspare[2];
};
]] else append [[
struct stat {
mode_t st_mode;
dev_t st_dev;
ino_t st_ino;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
off_t st_size;
int64_t st_blocks;
uint32_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
struct timespec __st_birthtim;
};
]] end append [[
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
struct flock {
off_t l_start;
off_t l_len;
pid_t l_pid;
short l_type;
short l_whence;
};
struct termios {
tcflag_t c_iflag;
tcflag_t c_oflag;
tcflag_t c_cflag;
tcflag_t c_lflag;
cc_t c_cc[20];
speed_t c_ispeed;
speed_t c_ospeed;
};
]]
if version <= 201311 then append [[
struct dirent {
uint32_t d_fileno;
uint16_t d_reclen;
uint8_t d_type;
uint8_t d_namlen;
char d_name[255 + 1];
};
struct kevent {
unsigned int ident;
short filter;
unsigned short flags;
unsigned int fflags;
int data;
void *udata;
};
]] else append [[
struct dirent {
uint64_t d_fileno;
int64_t d_off;
uint16_t d_reclen;
uint8_t d_type;
uint8_t d_namlen;
char __d_padding[4];
char d_name[255 + 1];
};
struct kevent {
intptr_t ident;
short filter;
unsigned short flags;
unsigned int fflags;
int64_t data;
void *udata;
};
]] end
append [[
union sigval {
int sival_int;
void *sival_ptr;
};
static const int SI_MAXSZ = 128;
static const int SI_PAD = ((SI_MAXSZ / sizeof (int)) - 3);
typedef struct {
int si_signo;
int si_code;
int si_errno;
union {
int _pad[SI_PAD];
struct {
pid_t _pid;
union {
struct {
uid_t _uid;
union sigval _value;
} _kill;
struct {
clock_t _utime;
int _status;
clock_t _stime;
} _cld;
} _pdata;
} _proc;
struct {
caddr_t _addr;
int _trapno;
} _fault;
} _data;
} siginfo_t;
struct sigaction {
union {
void (*__sa_handler)(int);
void (*__sa_sigaction)(int, siginfo_t *, void *);
} __sigaction_u;
sigset_t sa_mask;
int sa_flags;
};
]]
-- functions
append [[
int reboot(int howto);
int ioctl(int d, unsigned long request, void *arg);
/* not syscalls, but using for now */
int grantpt(int fildes);
int unlockpt(int fildes);
char *ptsname(int fildes);
]]
if version >= 201405 then
append [[
int getdents(int fd, void *buf, size_t nbytes);
]]
end
local s = table.concat(defs, "")
ffi.cdef(s)
require "syscall.bsd.ffi"
| apache-2.0 |
bmscoordinators/FFXI-Server | scripts/zones/Yuhtunga_Jungle/npcs/Harvesting_Point.lua | 17 | 1103 | -----------------------------------
-- Area: Yuhtunga Jungle
-- NPC: Harvesting Point
-----------------------------------
package.loaded["scripts/zones/Yuhtunga_Jungle/TextIDs"] = nil;
-------------------------------------
require("scripts/globals/harvesting");
require("scripts/zones/Yuhtunga_Jungle/TextIDs");
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
startHarvesting(player,player:getZoneID(),npc,trade,0x00CE);
end;
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(HARVESTING_IS_POSSIBLE_HERE,1020);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Metalworks/npcs/Lorena.lua | 3 | 2680 | -----------------------------------
-- Area: Metalworks
-- NPC: Lorena
-- Type: Blacksmithing Guildworker's Union Representative
-- @zone 237
-- @pos -104.990 1 30.995
-----------------------------------
package.loaded["scripts/zones/Metalworks/TextIDs"] = nil;
require("scripts/zones/Metalworks/TextIDs");
require("scripts/globals/keyitems");
require("scripts/globals/crafting");
local keyitems = {
[0] = {
id = METAL_PURIFICATION,
rank = 3,
cost = 40000
},
[1] = {
id = METAL_ENSORCELLMENT,
rank = 3,
cost = 40000
},
[2] = {
id = CHAINWORK,
rank = 3,
cost = 10000
},
[3] = {
id = SHEETING,
rank = 3,
cost = 10000
},
[4] = {
id = WAY_OF_THE_BLACKSMITH,
rank = 9,
cost = 20000
}
};
local items = {
[0] = {
id = 15445,
rank = 3,
cost = 10000
},
[1] = {
id = 14831,
rank = 5,
cost = 70000
},
[2] = {
id = 14393,
rank = 7,
cost = 100000
},
[3] = {
id = 153,
rank = 9,
cost = 150000
},
[4] = {
id = 334,
rank = 9,
cost = 200000
},
[5] = {
id = 15820,
rank = 6,
cost = 80000
},
[6] = {
id = 3661,
rank = 7,
cost = 50000
},
[7] = {
id = 3324,
rank = 9,
cost = 15000
}
};
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
unionRepresentativeTrade(player, npc, trade, 0x321, 2);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
unionRepresentativeTrigger(player, 2, 0x320, "guild_smithing", keyitems);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option,target)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x320) then
unionRepresentativeTriggerFinish(player, option, target, 2, "guild_smithing", keyitems, items);
end
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option,target)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x320) then
unionRepresentativeTriggerFinish(player, option, target, 2, "guild_smithing", keyitems, items);
elseif (csid == 0x321) then
player:messageSpecial(GP_OBTAINED, option);
end
end;
| gpl-3.0 |
cheney247689848/Cloud-edge | Assets/ToLua/Lua/cjson/util.lua | 170 | 6837 | local json = require "cjson"
-- Various common routines used by the Lua CJSON package
--
-- Mark Pulford <mark@kyne.com.au>
-- Determine with a Lua table can be treated as an array.
-- Explicitly returns "not an array" for very sparse arrays.
-- Returns:
-- -1 Not an array
-- 0 Empty table
-- >0 Highest index in the array
local function is_array(table)
local max = 0
local count = 0
for k, v in pairs(table) do
if type(k) == "number" then
if k > max then max = k end
count = count + 1
else
return -1
end
end
if max > count * 2 then
return -1
end
return max
end
local serialise_value
local function serialise_table(value, indent, depth)
local spacing, spacing2, indent2
if indent then
spacing = "\n" .. indent
spacing2 = spacing .. " "
indent2 = indent .. " "
else
spacing, spacing2, indent2 = " ", " ", false
end
depth = depth + 1
if depth > 50 then
return "Cannot serialise any further: too many nested tables"
end
local max = is_array(value)
local comma = false
local fragment = { "{" .. spacing2 }
if max > 0 then
-- Serialise array
for i = 1, max do
if comma then
table.insert(fragment, "," .. spacing2)
end
table.insert(fragment, serialise_value(value[i], indent2, depth))
comma = true
end
elseif max < 0 then
-- Serialise table
for k, v in pairs(value) do
if comma then
table.insert(fragment, "," .. spacing2)
end
table.insert(fragment,
("[%s] = %s"):format(serialise_value(k, indent2, depth),
serialise_value(v, indent2, depth)))
comma = true
end
end
table.insert(fragment, spacing .. "}")
return table.concat(fragment)
end
function serialise_value(value, indent, depth)
if indent == nil then indent = "" end
if depth == nil then depth = 0 end
if value == json.null then
return "json.null"
elseif type(value) == "string" then
return ("%q"):format(value)
elseif type(value) == "nil" or type(value) == "number" or
type(value) == "boolean" then
return tostring(value)
elseif type(value) == "table" then
return serialise_table(value, indent, depth)
else
return "\"<" .. type(value) .. ">\""
end
end
local function file_load(filename)
local file
if filename == nil then
file = io.stdin
else
local err
file, err = io.open(filename, "rb")
if file == nil then
error(("Unable to read '%s': %s"):format(filename, err))
end
end
local data = file:read("*a")
if filename ~= nil then
file:close()
end
if data == nil then
error("Failed to read " .. filename)
end
return data
end
local function file_save(filename, data)
local file
if filename == nil then
file = io.stdout
else
local err
file, err = io.open(filename, "wb")
if file == nil then
error(("Unable to write '%s': %s"):format(filename, err))
end
end
file:write(data)
if filename ~= nil then
file:close()
end
end
local function compare_values(val1, val2)
local type1 = type(val1)
local type2 = type(val2)
if type1 ~= type2 then
return false
end
-- Check for NaN
if type1 == "number" and val1 ~= val1 and val2 ~= val2 then
return true
end
if type1 ~= "table" then
return val1 == val2
end
-- check_keys stores all the keys that must be checked in val2
local check_keys = {}
for k, _ in pairs(val1) do
check_keys[k] = true
end
for k, v in pairs(val2) do
if not check_keys[k] then
return false
end
if not compare_values(val1[k], val2[k]) then
return false
end
check_keys[k] = nil
end
for k, _ in pairs(check_keys) do
-- Not the same if any keys from val1 were not found in val2
return false
end
return true
end
local test_count_pass = 0
local test_count_total = 0
local function run_test_summary()
return test_count_pass, test_count_total
end
local function run_test(testname, func, input, should_work, output)
local function status_line(name, status, value)
local statusmap = { [true] = ":success", [false] = ":error" }
if status ~= nil then
name = name .. statusmap[status]
end
print(("[%s] %s"):format(name, serialise_value(value, false)))
end
local result = { pcall(func, unpack(input)) }
local success = table.remove(result, 1)
local correct = false
if success == should_work and compare_values(result, output) then
correct = true
test_count_pass = test_count_pass + 1
end
test_count_total = test_count_total + 1
local teststatus = { [true] = "PASS", [false] = "FAIL" }
print(("==> Test [%d] %s: %s"):format(test_count_total, testname,
teststatus[correct]))
status_line("Input", nil, input)
if not correct then
status_line("Expected", should_work, output)
end
status_line("Received", success, result)
print()
return correct, result
end
local function run_test_group(tests)
local function run_helper(name, func, input)
if type(name) == "string" and #name > 0 then
print("==> " .. name)
end
-- Not a protected call, these functions should never generate errors.
func(unpack(input or {}))
print()
end
for _, v in ipairs(tests) do
-- Run the helper if "should_work" is missing
if v[4] == nil then
run_helper(unpack(v))
else
run_test(unpack(v))
end
end
end
-- Run a Lua script in a separate environment
local function run_script(script, env)
local env = env or {}
local func
-- Use setfenv() if it exists, otherwise assume Lua 5.2 load() exists
if _G.setfenv then
func = loadstring(script)
if func then
setfenv(func, env)
end
else
func = load(script, nil, nil, env)
end
if func == nil then
error("Invalid syntax.")
end
func()
return env
end
-- Export functions
return {
serialise_value = serialise_value,
file_load = file_load,
file_save = file_save,
compare_values = compare_values,
run_test_summary = run_test_summary,
run_test = run_test,
run_test_group = run_test_group,
run_script = run_script
}
-- vi:ai et sw=4 ts=4:
| mit |
bmscoordinators/FFXI-Server | scripts/globals/items/nopales_salad.lua | 12 | 1358 | -----------------------------------------
-- ID: 5701
-- Item: nopales_salad
-- Food Effect: 3Hrs, All Races
-----------------------------------------
-- Strength 1
-- Agility 6
-- Ranged Accuracy +20
-- Ranged Attack +10
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,10800,5701);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, 1);
target:addMod(MOD_AGI, 6);
target:addMod(MOD_RACC, 20);
target:addMod(MOD_RATT, 10);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, 1);
target:delMod(MOD_AGI, 6);
target:delMod(MOD_RACC, 20);
target:delMod(MOD_RATT, 10);
end;
| gpl-3.0 |
TannerRogalsky/GGJ2017 | map/symmetricalize.lua | 2 | 2503 | local CONSTANTS = require('map.constants')
local N, S, E, W = unpack(CONSTANTS.DIRECTIONS)
local DX = CONSTANTS.DX
local DY = CONSTANTS.DY
local OPPOSITE = CONSTANTS.OPPOSITE
local possible_orientations = {
horizontal = true,
vertical = true,
both = true
}
local swaps = {
horizontal = {
[E] = W,
[E + N] = W + N,
[E + S] = W + S,
[E + N + S] = W + N + S,
[W] = E,
[W + N] = E + N,
[W + S] = E + S,
[W + N + S] = E + N + S,
},
vertical = {
[N] = S,
[N + E] = S + E,
[N + W] = S + W,
[N + E + W] = S + E + W,
[S] = N,
[S + E] = N + E,
[S + W] = N + W,
[S + E + W] = N + E + W,
}
}
function toBits(num,bits)
-- returns a table of bits, most significant first.
bits = bits or select(2,math.frexp(num))
local t={} -- will contain the bits
for b=bits,1,-1 do
t[b]=math.fmod(num,2)
num=(num-t[b])/2
end
return table.concat(t, '')
end
local function symmetricalize(grid, orientation)
assert(possible_orientations[orientation])
local ow, oh = #grid[1], #grid
local w, h = ow, oh
if orientation == 'horizontal' then
w = w * 2
elseif orientation == 'vertical' then
h = h * 2
elseif orientation == 'both' then
w = w * 2
h = h * 2
end
local new_grid = {}
for y=1,h do
new_grid[y] = {}
for x=1,w do
if x <= ow and y <= oh then
new_grid[y][x] = grid[y][x]
else
if x > ow and y <= oh then
local mirrored_cell = grid[y][w - x + 1]
new_grid[y][x] = swaps.horizontal[mirrored_cell] or mirrored_cell
elseif y > oh and x <= ow then
local mirrored_cell = grid[h - y + 1][x]
new_grid[y][x] = swaps.vertical[mirrored_cell] or mirrored_cell
else
local mirrored_cell = grid[h - y + 1][w - x + 1]
local intermediate = swaps.vertical[mirrored_cell] or mirrored_cell
new_grid[y][x] = swaps.horizontal[intermediate] or intermediate
end
end
end
end
if orientation == 'horizontal' or orientation == 'both' then
local x = ow
for y=1,h do
new_grid[y][x] = bit.bor(new_grid[y][x], E)
new_grid[y][x + 1] = bit.bor(new_grid[y][x + 1], W)
end
end
if orientation == 'vertical' or orientation == 'both' then
local y = oh
for x=1,w do
new_grid[y][x] = bit.bor(new_grid[y][x], S)
new_grid[y+ 1][x] = bit.bor(new_grid[y+ 1][x], N)
end
end
return new_grid
end
return symmetricalize
| mit |
jsenellart/OpenNMT | onmt/modules/SentenceNLLCriterion.lua | 4 | 21578 | --[[
Define SentenceNLLCriterion.
Implements Sentence-level log-likelihood as described in
Collobert et al., Natural Language Processing (almost) from Scratch, JMLR 12(2011).
This class tries to be both nn.Criterion and nn.Module at the same time.
(Criterion with learnable parameters that are required for run-time.)
This module requires double-precision calculations so internally, input/model parameters/output are cloned as double
then converted back to moddel default types after the calculations.
--]]
local SentenceNLLCriterion, parent = torch.class('onmt.SentenceNLLCriterion', 'nn.Criterion')
function SentenceNLLCriterion:__init(args, outputSize)
parent.__init(self)
if torch.type(outputSize) == 'table' then
outputSize = outputSize[1]
end
local N = outputSize
self.outputSize = N
self.A0 = torch.zeros(N) -- TagSize (N)
self.A = torch.zeros(N, N) -- TagSize (N) x TagSize (N)
self.dA0 = torch.zeros(N)
self.dA = torch.zeros(N,N)
if args.max_grad_norm then
self.max_grad_norm = args.max_grad_norm
else
self.max_grad_norm = 5
end
end
--[[ Return a new SentenceNLLCriterion using the serialized data `pretrained`. ]]
function SentenceNLLCriterion.load(pretrained)
local self = torch.factory('onmt.SentenceNLLCriterion')()
parent.__init(self)
self.A0 = pretrained.A0
self.A = pretrained.A
self.outputSize = pretrained.outputSize
self.max_grad_norm = pretrained.max_grad_norm
return self
end
--[[ Return data to serialize. ]]
function SentenceNLLCriterion:serialize()
return {
A0 = self.A0,
A = self.A,
outputSize = self.outputSize,
max_grad_norm = self.max_grad_norm,
float = self.float,
clearState = self.clearState,
apply = self.apply
}
end
function SentenceNLLCriterion:training()
self:_initTrainCache()
end
function SentenceNLLCriterion:evaluate()
self:renormalizeParams()
end
function SentenceNLLCriterion:release()
self:_freeTrainCache()
self:_freeViterbiCache()
self.dA0 = nil
self.dA = nil
end
function SentenceNLLCriterion:float()
if self.A0 then self.A0 = self.A0:float() end
if self.A then self.A = self.A:float() end
if self.dA0 then self.dA0 = self.dA0:float() end
if self.dA then self.dA = self.dA:float() end
end
function SentenceNLLCriterion:clearState()
end
function SentenceNLLCriterion:normalizeParams()
local N = self.outputSize
self.A0:add(-self.A0:min() + 0.000001)
self.A0:div(self.A0:sum())
self.A0:log()
self.A:add(-torch.min(self.A,2):expand(N, N) + 0.000001)
self.A:cdiv(self.A:sum(2):expand(N, N))
self.A:log()
end
function SentenceNLLCriterion:renormalizeParams()
self.A0:exp()
self.A:exp()
self:normalizeParams()
end
function SentenceNLLCriterion:postParametersInitialization()
self:normalizeParams()
end
function SentenceNLLCriterion:parameters()
return {self.A0, self.A}, {self.dA0, self.dA}
end
--[[
Viterbi search
--]]
function SentenceNLLCriterion:viterbiSearch(input, sourceSizes)
-- Input
-- input: BatchSize (B) x TagSize (N) x SeqLen (T): log-scale emission probabilities
-- sourceSizes: BatchSize (B) of data type Long
-- Output
-- preds: BatchSize (B) x SeqLen (T) of data type Long (index)
local F = input
local B = input:size(1)
local N = input:size(2) -- should equal self.outputSize
local T = input:size(3)
local _
if not self.cache_viterbi_preds then
self:_initViterbiCache()
end
local preds = self.cache_viterbi_preds:resize(B,T+1):zero() -- extra dimension in T for EOS handling
function SentenceNLLCriterion:_viterbiSearch_batch()
-- OpenNMT mini batches are padded to the left of source sequences
local isOnMask = self.cache_viterbi_isOnMask:resize(B,T+1):fill(1)
local isA0Mask = self.cache_viterbi_isA0Mask:resize(B,T+1):zero()
for b = 1, B do
for t = 1, (T - sourceSizes[b]) do
isOnMask[{b,t}] = 0
end
isA0Mask[{b, T+1-sourceSizes[b]}] = 1
end
local isAMask = self.cache_viterbi_isAMask:add(isOnMask, -isA0Mask)
local isMaxMask = isAMask
local isFMask = isOnMask[{{}, {1,T}}]
local maxScore = self.cache_viterbi_maxScore:resize(B, N, T+1)
local backPointer = self.cache_viterbi_backPointer:resize(B, N, T+1)
-- A0
local A0Score = nn.utils.addSingletonDimension(nn.utils.addSingletonDimension(self.A0, 1):expand(N, N), 1):expand(B, N, N)
-- A
local AScore = nn.utils.addSingletonDimension(self.A:t(), 1):expand(B, N, N)
for t = 1, T + 1 do
local scores = self.cache_viterbi_scores:resize(B,N,N):zero()
local A0ScoreMasked = self.cache_viterbi_XScoreMasked:resize(B,N,N)
A0ScoreMasked:cmul(A0Score, nn.utils.addSingletonDimension(nn.utils.addSingletonDimension(isA0Mask[{{},t}],2),3):expand(B, N, N))
scores:add(A0ScoreMasked)
if t > 1 then
local AScoreMasked = self.cache_viterbi_XScoreMasked:resize(B,N,N)
AScoreMasked:cmul(AScore, nn.utils.addSingletonDimension(nn.utils.addSingletonDimension(isAMask[{{},t}],2),3):expand(B, N, N))
scores:add(AScoreMasked)
-- maxScore
local MaxScore = nn.utils.addSingletonDimension(maxScore[{{},{},t-1}],2):expand(B, N, N)
local MaxScoreMasked = self.cache_viterbi_XScoreMasked:resize(B,N,N)
MaxScoreMasked:cmul(MaxScore, nn.utils.addSingletonDimension(nn.utils.addSingletonDimension(isMaxMask[{{},t}],2),3):expand(B, N, N))
scores:add(MaxScoreMasked)
end
if t < T + 1 then
-- F
local FScore = nn.utils.addSingletonDimension(F[{{},{},t}],3):expand(B, N, N)
local FScoreMasked = self.cache_viterbi_XScoreMasked:resize(B,N,N)
FScoreMasked:cmul(FScore, nn.utils.addSingletonDimension(nn.utils.addSingletonDimension(isFMask[{{},t}],2),3):expand(B, N, N))
scores:add(FScoreMasked)
end
maxScore[{{},{},t}], backPointer[{{},{},t}] = scores:max(3)
end
for b=1,B do
local pred = preds[b]
_, pred[T+1] = maxScore[{b,{},T+1}]:max(1)
for t=T+1,2+(T-sourceSizes[b]),-1 do
pred[t-1] = backPointer[{b,pred[t],t}]
end
end
end
function SentenceNLLCriterion:_viterbiSearch_loop()
local maxScore = onmt.utils.Cuda.convert(torch.Tensor(N, T+1))
local backPointer = onmt.utils.Cuda.convert(torch.LongTensor(N, T+1))
for b = 1, B do
maxScore:zero()
backPointer:zero()
-- OpenNMT mini batches are padded to the left of source sequences
local tOffset = T - sourceSizes[b]
maxScore[{{},1+tOffset}], backPointer[{{},1+tOffset}] = nn.utils.addSingletonDimension(torch.add(self.A0, F[{b,{},1+tOffset}]),2):max(2)
for t = 2+tOffset, T+1 do
local scores = torch.add(nn.utils.addSingletonDimension(maxScore[{{},t-1}],1):expand(N, N), self.A:t())
if t <= T then
scores:add(nn.utils.addSingletonDimension(F[{b,{},t}],2):expand(N,N))
end
maxScore[{{},t}], backPointer[{{},t}] = scores:max(2)
end
local pred = preds[b]
_, pred[T+1] = maxScore[{{},T+1}]:max(1)
for t=T+1,2+tOffset,-1 do
pred[t-1] = backPointer[{pred[t], t}]
end
end
end
self:_viterbiSearch_batch()
-- self:_viterbiSearch_loop()
return preds[{{},{1,T}}]:clone()
end
function SentenceNLLCriterion:logsumexp(x)
-- Input
-- x: TagSize (N) or TagSize (N) x TagSize (N)
local N = x:size(1) -- should equal self.outputSize
local max, _ = x:max(1) -- 1 or 1 x N
local log_sum_exp
if x:nDimension() == 1 then
log_sum_exp = (x - max:expand(N)):exp():sum(1):log() -- 1
else
log_sum_exp = (x - max:expand(N,N)):exp():sum(1):log() -- 1 x N
end
-- find NaN values and assign a valid value
local NaN_mask = log_sum_exp:ne(log_sum_exp)
log_sum_exp[NaN_mask] = max:max()
return log_sum_exp:add(max):squeeze(1) -- 1 or N
end
function SentenceNLLCriterion:logsumexp_batch(x)
-- Input
-- x: B x N or B x N x N
local B = x:size(1)
local N = x:size(2) -- should equal self.outputSize
local max, _ = x:max(2) -- B x 1 or B x 1 x N
local log_sum_exp
if x:nDimension() == 2 then
log_sum_exp = (x - max:expand(B,N)):exp():sum(2):log() -- B x 1
else
log_sum_exp = (x - max:expand(B,N,N)):exp():sum(2):log() -- B x 1 x N
end
-- find NaN values and assign a valid value
local NaN_mask = log_sum_exp:ne(log_sum_exp)
log_sum_exp[NaN_mask] = max:max()
return log_sum_exp:add(max):squeeze(2) -- B x 1 or B x N
end
function SentenceNLLCriterion:updateOutput(input, target)
-- Input variables
-- input: BatchSize (B) x TagSize (N) x SeqLen (T)
-- target: BatchSize (B) x SeqLen (T)
-- Output variable
-- loss
local Y = target
local B = input:size(1)
local N = input:size(2) -- should equal self.outputSize
local T = input:size(3) + 1 -- extra T dimension for EOS
if not self.cache_F then -- Initialize cache when updateOutput() is called at inference time (e.g. to compute loss)
self:_initTrainCache()
end
local F = self.cache_F:resize(B, N, T)
F[{{},{},{1,input:size(3)}}]:copy(input)
F[{{}, {}, -1}] = 0.000001
F[{{}, onmt.Constants.EOS, -1}] = 1
F[{{}, {}, -1}]:log()
self.cache_delta:resize(F:size()):zero() -- B,N,T
self.cache_A0_dtype = self.A0:type(self.dtype)
self.cache_A_dtype = self.A:type(self.dtype)
local loss = 0.0
function SentenceNLLCriterion:_updateOutput_batch()
-- OpenNMT mini batches are padded to the left of source sequences
local isOnMask = self.cache_isOnMask:resize(B,T):fill(1)
local isA0Mask = self.cache_isA0Mask:resize(B,T):zero()
local yLookupTensor = self.cache_dF:resize(B,N,T):zero()
for b = 1, B do
for t = 1, T do
if Y[b][t] == onmt.Constants.PAD then
isOnMask[b][t] = 0
else
if t == 1 or (t > 1 and Y[b][t-1] == onmt.Constants.PAD) then
isA0Mask[b][t] = 1
end
yLookupTensor[b][ Y[b][t] ][t] = 1
end
end
end
local isAMask = self.cache_isAMask:add(isOnMask, -isA0Mask)
local isFMask = isOnMask
local delta = self.cache_delta
local delta_tmp = self.cache_delta_tmp:resize(B,N,N)
local refScores = torch.Tensor(B):type(self.dtype):zero()
local logLiks = torch.Tensor(B):type(self.dtype):zero()
-- A0
self.cache_A0_dtype_batch = nn.utils.addSingletonDimension(self.cache_A0_dtype, 1):expand(B,N)
local A0_dtype_batch = self.cache_A0_dtype_batch
-- A
self.cache_A_dtype_batch = nn.utils.addSingletonDimension(self.cache_A_dtype, 1):expand(B,N,N)
local A_dtype_batch = self.cache_A_dtype_batch
for t = 1, T do
-- refScore
refScores:add(torch.cmul(A0_dtype_batch,
yLookupTensor[{{},{},t}])
:cmul(nn.utils.addSingletonDimension(isA0Mask[{{},t}],2):expand(B,N))
:sum(2):squeeze(2) -- B
)
refScores:add(torch.cmul(F[{{},{},t}], yLookupTensor[{{},{},t}]):sum(2):squeeze(2)) -- B; yLookupTensor is already masked
if t > 1 then
refScores:add(torch.cmul(A_dtype_batch,
nn.utils.addSingletonDimension(yLookupTensor[{{},{},t-1}],3):expand(B,N,N)):sum(2) -- select t-1
:cmul(yLookupTensor[{{},{},t}]):sum(3):squeeze(3):squeeze(2) -- select t
) -- B; yLookupTensor is already masked
end
--loglik
delta[{{},{},t}]:add(torch.cmul(A0_dtype_batch, nn.utils.addSingletonDimension(isA0Mask[{{},t}],2):expand(B,N))) -- B x N
delta[{{},{},t}]:add(torch.cmul(F[{{},{},t}], nn.utils.addSingletonDimension(isFMask[{{},t}],2):expand(B,N)))
if t > 1 then
delta_tmp:add( A_dtype_batch,
nn.utils.addSingletonDimension(delta[{{},{},t-1}],3):expand(B,N,N)
):cmul(nn.utils.addSingletonDimension(nn.utils.addSingletonDimension(isAMask[{{},t}],2),3):expand(B,N,N)) -- B x N x N
delta[{{},{},t}]:add(self:logsumexp_batch(delta_tmp)) -- B x N
end
end
logLiks:add(refScores, -self:logsumexp_batch(delta[{{},{},T}]))
loss = -logLiks:sum()
end
function SentenceNLLCriterion:_updateOutput_loop()
for b = 1, B do
local delta = self.cache_delta[b]
-- OpenNMT mini batches are currently padded to the left of source sequences
local tOffset = 0
while Y[{b,1+tOffset}] == onmt.Constants.PAD do
tOffset = tOffset + 1
end
-- init state
local t_1 = 1 + tOffset
local referenceScore = self.A0[Y[b][t_1]] + F[b][Y[b][t_1]][t_1]
delta[{{},t_1}]:add(self.cache_A0_dtype, F[{b,{},t_1}])
-- fwd transition recursion
for t = 2 + tOffset, T do
local Y_t = Y[b][t]
local Y_t_1 = Y[b][t-1]
referenceScore = referenceScore + self.A[Y_t_1][Y_t] + F[b][Y_t][t]
self.cache_delta_tmp:add(self.cache_A_dtype, nn.utils.addSingletonDimension(delta[{{},t-1}],2):expand(N,N))
delta[{{},t}]:add(F[{b,{},t}], self:logsumexp(self.cache_delta_tmp))
end
local loglik = referenceScore - self:logsumexp(delta[{{},T}])
loss = loss - loglik
end
end
self:_updateOutput_batch()
-- self:_updateOutput_loop()
return loss
end
function SentenceNLLCriterion:updateGradInput(input, target)
-- Input: F, A0, A
-- Output: dF, dA0, dA w.r.t Loss in target
local dF = self.cache_dF:resize(input:size()):zero()
local Y = target
local B = input:size(1)
local N = input:size(2) -- should equal self.outputSize
local T = input:size(3)+1
local dA_sum = self.cache_dA_sum:zero()
local dA0_sum = self.cache_dA0_sum:zero()
function SentenceNLLCriterion:_updateGradInput_batch()
local delta = self.cache_delta -- B x N x T; cached calculations from fwd path
-- Assume cached masks and batched A0, A are still valid
local isA0Mask = self.cache_isA0Mask
local isFMask = self.cache_isOnMask
local A_dtype_batch = self.cache_A_dtype_batch
local path_transition_probs = self.cache_path_transition_probs:resize(B,N,N)
local dA = self.cache_dA_tmp:resize(B,N,N):zero() -- B x N x N
local dA0 = self.cache_dA0_tmp:resize(B,N):zero() -- B x N
for b = 1, B do
for t = 1, T do
if Y[b][t] ~= onmt.Constants.PAD then
if t == 1 or (t > 1 and Y[b][t-1] == onmt.Constants.PAD) then
dA0[{b,Y[b][t]}] = dA0[{b,Y[b][t]}] - 1 -- A0
end
if t > 1 then
dA[{b,Y[b][t-1],Y[b][t]}] = dA[{b,Y[b][t-1],Y[b][t]}] - 1 -- A
end
if t < T then -- dF for the last EOS token does not exist
dF[{b,Y[b][t],t}] = dF[{b,Y[b][t],t}] - 1 -- F
end
end
end
end
local deriv_Clogadd = delta[{{},{},T}]:exp()
deriv_Clogadd:cdiv(deriv_Clogadd:sum(2):expand(B,N))
deriv_Clogadd[deriv_Clogadd:ne(deriv_Clogadd)] = 0
for t = T,1,-1 do
if t < T then
-- F
dF[{{},{},t}]:add(torch.cmul(deriv_Clogadd, nn.utils.addSingletonDimension(isFMask[{{},t}],2):expand(B,N)))
-- A0
dA0:add(torch.cmul(deriv_Clogadd, nn.utils.addSingletonDimension(isA0Mask[{{},t}],2):expand(B,N)))
end
-- A
if t > 1 then
path_transition_probs:add(A_dtype_batch,
nn.utils.addSingletonDimension(
delta[{{},{},t-1}] -- delta is calculated from masked
,3):expand(B,N,N))
path_transition_probs:exp()
path_transition_probs:cdiv(path_transition_probs:sum(2):expand(B,N,N))
path_transition_probs[path_transition_probs:ne(path_transition_probs)] = 0
path_transition_probs:cmul(nn.utils.addSingletonDimension(deriv_Clogadd, 2):expand(B,N,N))
local dAt = path_transition_probs
dA:add(dAt)
deriv_Clogadd = dAt:sum(3):squeeze(3)
for b = 1, B do
onmt.train.Optim.clipGradByNorm({deriv_Clogadd[b]}, self.max_grad_norm)
end
end
end
dA_sum:add(dA:sum(1):squeeze(1))
dA0_sum:add(dA0:sum(1):squeeze(1))
end
function SentenceNLLCriterion:_updateGradInput_loop()
local A_dtype = self.cache_A_dtype
for b = 1, B do
-- OpenNMT mini batches are padded to the left of source sequences
local tOffset = 0
while Y[{b,1+tOffset}] == onmt.Constants.PAD do
tOffset = tOffset + 1
end
local delta = self.cache_delta[b] -- N x T
local dA = self.cache_dA_tmp:zero()
local dA0 = self.cache_dA0_tmp:zero()
local deriv_Clogadd = delta[{{},T}]:exp()
deriv_Clogadd:div(deriv_Clogadd:sum())
deriv_Clogadd[deriv_Clogadd:ne(deriv_Clogadd)] = 0
for t= T, (2+tOffset), -1 do
local Y_t = Y[b][t]
local Y_t_1 = Y[b][t-1]
if t < T then -- dF for the last EOS token does not exist
dF[{b,Y_t,t}] = dF[{b,Y_t,t}] - 1
end
dA[{Y_t_1,Y_t}] = dA[{Y_t_1,Y_t}] - 1
-- compute and add partial derivatives w.r.t transition scores
local path_transition_probs = self.cache_path_transition_probs
path_transition_probs:add(A_dtype, nn.utils.addSingletonDimension(delta[{{},t-1}],2):expand(N,N))
path_transition_probs:exp()
path_transition_probs:cdiv(path_transition_probs:sum(1):expand(N,N))
path_transition_probs[path_transition_probs:ne(path_transition_probs)] = 0
if t < T then
dF[{b,{},t}]:add(deriv_Clogadd)
end
path_transition_probs:cmul(nn.utils.addSingletonDimension(deriv_Clogadd, 1):expand(N,N))
local dAt = path_transition_probs
dA:add(dAt)
deriv_Clogadd = dAt:sum(2):squeeze(2)
onmt.train.Optim.clipGradByNorm({deriv_Clogadd}, self.max_grad_norm)
end
local t = 1 + tOffset
local Y_t = Y[b][t]
dF[{b,Y_t,t}] = dF[{b,Y_t,t}] - 1
dA0[Y_t] = dA0[Y_t] - 1
dF[{b,{},t}]:add(deriv_Clogadd)
dA0:add(deriv_Clogadd)
dA_sum:add(dA)
dA0_sum:add(dA0)
end
end
-- self:_updateGradInput_loop()
self:_updateGradInput_batch()
self.dA:add(onmt.utils.Cuda.convert(dA_sum/B))
self.dA0:add(onmt.utils.Cuda.convert(dA0_sum/B))
if not self.gradInput then
self.gradInput = onmt.utils.Cuda.convert(torch.Tensor())
end
self.gradInput:resize(input:size())
self.gradInput:copy(dF)
return self.gradInput
end
function SentenceNLLCriterion:_initViterbiCache()
local N = self.outputSize
self.cache_viterbi_preds = onmt.utils.Cuda.convert(torch.LongTensor(1,1))
self.cache_viterbi_maxScore = onmt.utils.Cuda.convert(torch.Tensor(1, N, 1))
self.cache_viterbi_backPointer = onmt.utils.Cuda.convert(torch.LongTensor(1, N, 1))
self.cache_viterbi_isOnMask = onmt.utils.Cuda.convert(torch.Tensor(1, 1))
self.cache_viterbi_isA0Mask = onmt.utils.Cuda.convert(torch.Tensor(1, 1))
self.cache_viterbi_isAMask = onmt.utils.Cuda.convert(torch.Tensor(1, 1))
self.cache_viterbi_scores = onmt.utils.Cuda.convert(torch.Tensor(1, N, N))
self.cache_viterbi_XScoreMasked = onmt.utils.Cuda.convert(torch.Tensor(1, N, N))
end
function SentenceNLLCriterion:_freeViterbiCache()
self.cache_viterbi_preds = nil
self.cache_viterbi_maxScore = nil
self.cache_viterbi_backPointer = nil
self.cache_viterbi_isOnMask = nil
self.cache_viterbi_isA0Mask = nil
self.cache_viterbi_isAMask = nil
self.cache_viterbi_scores = nil
self.cache_viterbi_XScoreMasked = nil
end
function SentenceNLLCriterion:_initTrainCache()
local N = self.outputSize
self.dtype = onmt.utils.Cuda.activated and 'torch.CudaDoubleTensor' or 'torch.DoubleTensor'
self.cache_dA_sum = torch.Tensor():type(self.dtype):resize(N,N)
self.cache_dA0_sum = torch.Tensor():type(self.dtype):resize(N)
self.cache_dA_tmp = torch.Tensor():type(self.dtype):resize(N,N)
self.cache_dA0_tmp = torch.Tensor():type(self.dtype):resize(N)
self.cache_path_transition_probs = torch.Tensor():type(self.dtype):resize(N,N)
self.cache_F = torch.Tensor():type(self.dtype):resize(1,N,1)
self.cache_dF = torch.Tensor():type(self.dtype):resize(1,N,1)
self.cache_delta = torch.Tensor():type(self.dtype):resize(1,N,1)
self.cache_delta_tmp = torch.Tensor():type(self.dtype):resize(N,N)
self.cache_isOnMask = torch.Tensor(1, 1):type(self.dtype)
self.cache_isA0Mask = torch.Tensor(1, 1):type(self.dtype)
self.cache_isAMask = torch.Tensor(1, 1):type(self.dtype)
end
function SentenceNLLCriterion:_freeTrainCache()
self.dtype = nil
self.cache_dA_sum = nil
self.cache_dA0_sum = nil
self.cache_dA_tmp = nil
self.cache_dA0_tmp = nil
self.cache_path_transition_probs = nil
self.cache_F = nil
self.cache_dF = nil
self.cache_delta = nil
self.cache_delta_tmp = nil
self.cache_isOnMask = nil
self.cache_isA0Mask = nil
self.cache_isAMask = nil
end
--[[
Copied from nn.Module
--]]
function SentenceNLLCriterion:getParameters()
-- get parameters
local parameters,gradParameters = self:parameters()
local p, g = nn.Module.flatten(parameters), nn.Module.flatten(gradParameters)
assert(p:nElement() == g:nElement(),
'check that you are sharing parameters and gradParameters')
if parameters then
for i=1,#parameters do
assert(parameters[i]:storageOffset() == gradParameters[i]:storageOffset(),
'misaligned parameter at ' .. tostring(i))
end
end
return p, g
end
--[[
Copied from nn.Module
--]]
function SentenceNLLCriterion:apply(callback)
callback(self)
if self.modules then
for _, module in ipairs(self.modules) do
module:apply(callback)
end
end
end
| mit |
bmscoordinators/FFXI-Server | scripts/globals/items/crayfish.lua | 12 | 1445 | -----------------------------------------
-- ID: 4472
-- Item: crayfish
-- Food Effect: 5Min, Mithra only
-----------------------------------------
-- Dexterity -3
-- Vitality 1
-- defense +10% (unknown cap)
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
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;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,4472);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, -3);
target:addMod(MOD_VIT, 1);
target:addMod(MOD_FOOD_DEFP, 10);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, -3);
target:delMod(MOD_VIT, 1);
target:delMod(MOD_FOOD_DEFP, 10);
end;
| gpl-3.0 |
nsimplex/wicker | kernel_extensions/dst_abstraction/replicas.lua | 6 | 1601 | local Lambda = wickerrequire "paradigms.functional"
if IsWorldgen() then
init = Lambda.Nil
return _M
end
---
local AddReplicatableComponent
local get_replica
if IsDST() then
local get_repcmps_table = memoize_0ary(function()
local Reflection = wickerrequire "game.reflection"
require "entityscript"
require "entityreplica"
return Reflection.RequireUpvalue(_G.EntityScript.ReplicateComponent, "REPLICATABLE_COMPONENTS")
end)
AddReplicatableComponent = function(name)
get_repcmps_table()[name] = true
end
get_replica = function(inst)
return inst.replica
end
else
local REPLICA_KEY = {}
---
local replicatable_set = {}
AddReplicatableComponent = function(name)
if replicatable_set[name] then return end
replicatable_set[name] = true
local cmp_pkgname = "components/"..name
local replica_cmp = require(cmp_pkgname.."_replica")
TheMod:AddClassPostConstruct(cmp_pkgname, function(self)
self[REPLICA_KEY] = replica_cmp(self.inst)
end)
end
---
local new_virtual_replica = (function()
local meta = {
__index = function(t, k)
local inst = t[t]
local cmp = inst.components[k]
return cmp ~= nil and cmp[REPLICA_KEY] or cmp
end,
}
return function(inst)
local t = {}
t[t] = inst
return setmetatable(t, meta)
end
end)()
get_replica = function(inst)
local ret = inst[REPLICA_KEY]
if ret == nil then
ret = new_virtual_replica(inst)
inst[REPLICA_KEY] = ret
end
return ret
end
end
TheMod:EmbedAdder("ReplicatableComponent", AddReplicatableComponent)
function init(kernel)
kernel.replica = get_replica
end
| gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/zones/Northern_San_dOria/npcs/Cauzeriste.lua | 14 | 1241 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Cauzeriste
-- Guild Merchant NPC: Woodworking Guild
-- @pos -175.946 3.999 280.301 231
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/shop");
require("scripts/globals/quests");
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:sendGuild(513,6,21,0)) then
player:showText(npc,CAUZERISTE_SHOP_DIALOG);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
BooM-amour/FUCKER | bot/seedbot.lua | 1 | 10224 | package.path = package.path .. ';.luarocks/share/lua/5.2/?.lua'
..';.luarocks/share/lua/5.2/?/init.lua'
package.cpath = package.cpath .. ';.luarocks/lib/lua/5.2/?.so'
require("./bot/utils")
VERSION = '2'
-- This function is called when tg receive a msg
function on_msg_receive (msg)
if not started then
return
end
local receiver = get_receiver(msg)
print (receiver)
--vardump(msg)
msg = pre_process_service_msg(msg)
if msg_valid(msg) then
msg = pre_process_msg(msg)
if msg then
match_plugins(msg)
if redis:get("bot:markread") then
if redis:get("bot:markread") == "on" then
mark_read(receiver, ok_cb, false)
end
end
end
end
end
function ok_cb(extra, success, result)
end
function on_binlog_replay_end()
started = true
postpone (cron_plugins, false, 60*5.0)
_config = load_config()
-- load plugins
plugins = {}
load_plugins()
end
function msg_valid(msg)
-- Don't process outgoing messages
if msg.out then
print('\27[36mNot valid: msg from us\27[39m')
return false
end
-- Before bot was started
if msg.date < now then
print('\27[36mNot valid: old msg\27[39m')
return false
end
if msg.unread == 0 then
print('\27[36mNot valid: readed\27[39m')
return false
end
if not msg.to.id then
print('\27[36mNot valid: To id not provided\27[39m')
return false
end
if not msg.from.id then
print('\27[36mNot valid: From id not provided\27[39m')
return false
end
if msg.from.id == our_id then
print('\27[36mNot valid: Msg from our id\27[39m')
return false
end
if msg.to.type == 'encr_chat' then
print('\27[36mNot valid: Encrypted chat\27[39m')
return false
end
if msg.from.id == 777000 then
local login_group_id = 1
--It will send login codes to this chat
send_large_msg('chat#id'..login_group_id, msg.text)
end
return true
end
--
function pre_process_service_msg(msg)
if msg.service then
local action = msg.action or {type=""}
-- Double ! to discriminate of normal actions
msg.text = "!!tgservice " .. action.type
-- wipe the data to allow the bot to read service messages
if msg.out then
msg.out = false
end
if msg.from.id == our_id then
msg.from.id = 0
end
end
return msg
end
-- Apply plugin.pre_process function
function pre_process_msg(msg)
for name,plugin in pairs(plugins) do
if plugin.pre_process and msg then
print('Preprocess', name)
msg = plugin.pre_process(msg)
end
end
return msg
end
-- Go over enabled plugins patterns.
function match_plugins(msg)
for name, plugin in pairs(plugins) do
match_plugin(plugin, name, msg)
end
end
-- Check if plugin is on _config.disabled_plugin_on_chat table
local function is_plugin_disabled_on_chat(plugin_name, receiver)
local disabled_chats = _config.disabled_plugin_on_chat
-- Table exists and chat has disabled plugins
if disabled_chats and disabled_chats[receiver] then
-- Checks if plugin is disabled on this chat
for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do
if disabled_plugin == plugin_name and disabled then
local warning = 'Plugin '..disabled_plugin..' is disabled on this chat'
print(warning)
send_msg(receiver, warning, ok_cb, false)
return true
end
end
end
return false
end
function match_plugin(plugin, plugin_name, msg)
local receiver = get_receiver(msg)
-- Go over patterns. If one matches it's enough.
for k, pattern in pairs(plugin.patterns) do
local matches = match_pattern(pattern, msg.text)
if matches then
print("msg matches: ", pattern)
if is_plugin_disabled_on_chat(plugin_name, receiver) then
return nil
end
-- Function exists
if plugin.run then
-- If plugin is for privileged users only
if not warns_user_not_allowed(plugin, msg) then
local result = plugin.run(msg, matches)
if result then
send_large_msg(receiver, result)
end
end
end
-- One patterns matches
return
end
end
end
-- DEPRECATED, use send_large_msg(destination, text)
function _send_msg(destination, text)
send_large_msg(destination, text)
end
-- Save the content of _config to config.lua
function save_config( )
serialize_to_file(_config, './data/config.lua')
print ('saved config into ./data/config.lua')
end
-- Returns the config from config.lua file.
-- If file doesn't exist, create it.
function load_config( )
local f = io.open('./data/config.lua', "r")
-- If config.lua doesn't exist
if not f then
print ("Created new config file: data/config.lua")
create_config()
else
f:close()
end
local config = loadfile ("./data/config.lua")()
for v,user in pairs(config.sudo_users) do
print("Allowed user: " .. user)
end
return config
end
-- Create a basic config.json file and saves it.
function create_config( )
-- A simple config with basic plugins and ourselves as privileged user
config = {
enabled_plugins = {
"onservice",
"inrealm",
"ingroup",
"inpm",
"banhammer",
"stats",
"anti_spam",
"owners",
"arabic_lock",
"set",
"get",
"broadcast",
"download_media",
"invite",
"all",
"leave_ban",
"admin"
},
sudo_users = {145266153,134618808,0,tonumber(our_id)},--Sudo users
disabled_channels = {},
moderation = {data = 'data/moderation.json'},
about_text = [[Teleseed v2 - Open Source
An advance Administration bot based on yagop/telegram-bot
https://github.com/SEEDTEAM/TeleSeed
Admins
@iwals [Founder]
@imandaneshi [Developer]
@Rondoozle [Developer]
@seyedan25 [Manager]
Special thanks to
awkward_potato
Siyanew
topkecleon
Vamptacus
Our channels
@teleseedch [English]
@iranseed [persian]
]],
help_text_realm = [[
Realm Commands:
!creategroup [Name]
Create a group
!createrealm [Name]
Create a realm
!setname [Name]
Set realm name
!setabout [GroupID] [Text]
Set a group's about text
!setrules [GroupID] [Text]
Set a group's rules
!lock [GroupID] [setting]
Lock a group's setting
!unlock [GroupID] [setting]
Unock a group's setting
!wholist
Get a list of members in group/realm
!who
Get a file of members in group/realm
!type
Get group type
!kill chat [GroupID]
Kick all memebers and delete group
!kill realm [RealmID]
Kick all members and delete realm
!addadmin [id|username]
Promote an admin by id OR username *Sudo only
!removeadmin [id|username]
Demote an admin by id OR username *Sudo only
!list groups
Get a list of all groups
!list realms
Get a list of all realms
!log
Grt a logfile of current group or realm
!broadcast [text]
!broadcast Hello !
Send text to all groups
Only sudo users can run this command
!bc [group_id] [text]
!bc 123456789 Hello !
This command will send text to [group_id]
**U can use both "/" and "!"
*Only admins and sudo can add bots in group
*Only admins and sudo can use kick,ban,unban,newlink,setphoto,setname,lock,unlock,set rules,set about and settings commands
*Only admins and sudo can use res, setowner, commands
]],
help_text = [[
Commands list :
!kick [username|id]
You can also do it by reply
!ban [ username|id]
You can also do it by reply
!unban [id]
You can also do it by reply
!who
Members list
!modlist
Moderators list
!promote [username]
Promote someone
!demote [username]
Demote someone
!kickme
Will kick user
!about
Group description
!setphoto
Set and locks group photo
!setname [name]
Set group name
!rules
Group rules
!id
return group id or user id
!help
!lock [member|name|bots|leave]
Locks [member|name|bots|leaveing]
!unlock [member|name|bots|leave]
Unlocks [member|name|bots|leaving]
!set rules <text>
Set <text> as rules
!set about <text>
Set <text> as about
!settings
Returns group settings
!newlink
create/revoke your group link
!link
returns group link
!owner
returns group owner id
!setowner [id]
Will set id as owner
!setflood [value]
Set [value] as flood sensitivity
!stats
Simple message statistics
!save [value] <text>
Save <text> as [value]
!get [value]
Returns text of [value]
!clean [modlist|rules|about]
Will clear [modlist|rules|about] and set it to nil
!res [username]
returns user id
"!res @username"
!log
will return group logs
!banlist
will return group ban list
**U can use both "/" and "!"
*Only owner and mods can add bots in group
*Only moderators and owner can use kick,ban,unban,newlink,link,setphoto,setname,lock,unlock,set rules,set about and settings commands
*Only owner can use res,setowner,promote,demote and log commands
]]
}
serialize_to_file(config, './data/config.lua')
print('saved config into ./data/config.lua')
end
function on_our_id (id)
our_id = id
end
function on_user_update (user, what)
--vardump (user)
end
function on_chat_update (chat, what)
end
function on_secret_chat_update (schat, what)
--vardump (schat)
end
function on_get_difference_end ()
end
-- Enable plugins in config.json
function load_plugins()
for k, v in pairs(_config.enabled_plugins) do
print("Loading plugin", v)
local ok, err = pcall(function()
local t = loadfile("plugins/"..v..'.lua')()
plugins[v] = t
end)
if not ok then
print('\27[31mError loading plugin '..v..'\27[39m')
print(tostring(io.popen("lua plugins/"..v..".lua"):read('*all')))
print('\27[31m'..err..'\27[39m')
end
end
end
-- custom add
function load_data(filename)
local f = io.open(filename)
if not f then
return {}
end
local s = f:read('*all')
f:close()
local data = JSON.decode(s)
return data
end
function save_data(filename, data)
local s = JSON.encode(data)
local f = io.open(filename, 'w')
f:write(s)
f:close()
end
-- Call and postpone execution for cron plugins
function cron_plugins()
for name, plugin in pairs(plugins) do
-- Only plugins with cron function
if plugin.cron ~= nil then
plugin.cron()
end
end
-- Called again in 2 mins
postpone (cron_plugins, false, 120)
end
-- Start and load values
our_id = 0
now = os.time()
math.randomseed(now)
started = false
| gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/globals/weaponskills/dark_harvest.lua | 23 | 1248 | -----------------------------------
-- Dark Harvest
-- Scythe weapon skill
-- Skill Level: 30
-- Delivers a dark elemental attack. Damage varies with TP.
-- Aligned with the Aqua Gorget.
-- Aligned with the Aqua Belt.
-- Element: Dark
-- Modifiers: STR:20% ; INT:20%
-- 100%TP 200%TP 300%TP
-- 1.00 2.00 2.50
-----------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {};
params.ftp100 = 1; params.ftp200 = 2; params.ftp300 = 2.5;
params.str_wsc = 0.2; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.2; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.ele = ELE_DARK;
params.skill = SKILL_SYH;
params.includemab = true;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.4; params.int_wsc = 0.4;
end
local damage, criticalHit, tpHits, extraHits = doMagicWeaponskill(player, target, wsID, tp, primary, action, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
orocos/rFSM | rfsm_proto.lua | 2 | 6171 | -- rfsm remote control interaction protocol
--
-- (C) 2010-2013 Markus Klotzbuecher <markus.klotzbuecher@mech.kuleuven.be>
-- (C) 2014-2020 Markus Klotzbuecher <mk@mkio.de>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
local socket = require("socket")
local json = require("json")
local rfsm = require("rfsm")
local rfsm_marsh = require("rfsm_marsh")
local utils = require("utils")
local os = os
local pairs = pairs
local print = print
local assert = assert
local type = type
local ts = tostring
module("rfsm_proto")
--- Default configuration
local def_host = "localhost" -- use '*' for host to bind to all local interfaces.
local def_port = 44044
local def_read_timeout = 0 -- block in read for this time
local heartbeat_timeout = 3 -- drop a subscriber after not receiving a heartbeat for this time
local idle_update = 1 -- send a state update after this time if no changes take place.
local VERSION=2
-- messages: All messages have a type and a version field plus
-- additional fields depending on the type.
-- Incoming:
-- type: 'subscribe'
-- type: 'unsubscribe'
-- type: 'heartbeat'
-- type: 'event' { event="string_event"|number_event }
-- Outgoing
-- type: 'rfsm_model': sent initially or when the model changes
-- 'model'=rfsm2json output
-- type: 'rfsm_active_state': sent when a state change occurs
-- 'act_leaf': new active leaf
-- 'path': path taken to reach this state
--- Update heartbeat timestamp.
local function update_timestamp(key, subs)
-- print("received heartbeat from " .. key)
if subs[key] then subs[key].last_heartbeat = os.time() end
end
-- Send updated state information to all subscribers
-- TODO: Extend this to only send state if it changed or once every X seconds.
local function send_state(inf)
local subs, sock = inf.subscribers, inf.socket
local act_leaf, state, path = inf.getactleaf()
inf.cnt_state_update = inf.cnt_state_update + 1
for key, sub in pairs(subs) do
sock:sendto(json.encode{type='rfsm_active_state',
act_leaf=act_leaf,
act_leaf_state=state,
path=path,
cnt=inf.cnt_state_update,
version=VERSION },
sub.ip, sub.port)
end
end
-- Process timeouts and drop zombies.
local function process_timeouts(inf)
local subs, sock = inf.subscribers, inf.socket
local cur_time = os.time()
utils.foreach(
function(sub, id)
if cur_time - sub.last_heartbeat > heartbeat_timeout then
subs[id] = nil -- drop it
print("No heartbeat from " .. id .. " since " .. heartbeat_timeout .. "s - dropping")
inf.cnt_subs_timeout = inf.cnt_subs_timeout + 1
end
end, inf.subscribers)
end
--- Add a new subscriber
-- @param subs list of subscribers
-- @param ip ip address
-- @param port port
local function add_subscriber(ip, port, inf)
local key = ip..':'..port
local subs, sock = inf.subscribers, inf.socket
if subs[key] then print("Resubscribing " .. key )
else print("Subscribing " .. key) end
local model = inf.getmodel()
subs[key] = { last_heartbeat=os.time(), ip=ip, port=port }
sock:sendto( json.encode{ type='rfsm_model',
graph=model,
cnt=inf.cnt_model_update,
version=VERSION }, ip, port)
end
--- Remove a subscriber
local function rm_subscriber(ip, port, subs)
local key = ip..':'..port
subs[key] = nil
end
-- subscribers = {
-- ['ip:port']={ last_heartbeat=sec, ip=IP, port=PORT },
-- ['ip:port']={ last_heartbeat=sec, ip=IP, port=PORT },
-- ...
-- }
local function dispatch(msg, ip, port, inf)
local msg_type = msg.type
local key = ip..':'..port
local subs = inf.subscribers
-- dispatch
if msg_type == 'subscribe' then add_subscriber(ip, port, inf)
elseif msg_type == 'event' then inf.send_event(msg.event)
elseif msg_type == 'unsubscribe' then rm_subscriber(ip, port, subs)
elseif msg_type == 'heartbeat' then update_timestamp(key, subs) end
end
local function process(inf)
local sock, subs = inf.socket, inf.subscribers
local data, ip, port = sock:receivefrom() -- data is max 8k
if data then
local msg = json.decode(data)
dispatch(msg, ip, port, inf)
-- else
-- print("Timeout " .. ip)
end
-- if os.time() - last_update > idle_update then send_state(sock, subscribers) end
send_state(inf)
process_timeouts(inf)
end
--- generate a function that processes an update
-- @param conf table with the following fields:
-- read_timeout
-- host
-- port
--
local function gen_updater(conf)
-- initalize
local sock = assert(socket.udp())
local read_timeout = conf.read_timeout
local host = conf.host
local port = conf.port
assert(type(conf.getmodel)=='function')
assert(type(conf.getactleaf)=='function')
assert(sock:setsockname(host, port))
assert(sock:settimeout(read_timeout))
-- the main information structure
local proto_inf = {
socket = sock,
subscribers = {},
last_update=0,
getmodel = conf.getmodel,
getactleaf = conf.getactleaf,
send_event = conf.send_event,
-- counters/statistics
cnt_state_update = 0,
cnt_model_update = 0,
cnt_subs_timeout = 0,
}
return function () process(proto_inf) end
end
local function __install(fsm, t)
host = t.host or def_host
port = t.port or def_port
read_timeout = t.read_timeout or def_read_timeout
allow_send = t.allow_send or false
fsm.info("rfsm_proto: rfsm introspection protocol loaded ("
..host..":"..ts(port).."/"..ts(read_timeout)..")")
local send_event = nil
if allow_send then
print("received event "..ts(e))
send_event = function (e) rfsm.send_events(fsm, e) end
end
local getmodel = function () return rfsm_marsh.model2tab(fsm) end
local getactleaf = function () return rfsm_marsh.actinfo2tab(fsm) end
local updater = gen_updater({read_timeout=read_timeout,
host=host, port=port,
getmodel=getmodel,
send_event=send_event,
getactleaf=getactleaf })
rfsm.post_step_hook_add(fsm, updater)
end
--- Install the
function install(t)
rfsm.preproc[#rfsm.preproc+1] =
function(fsm)
__install(fsm, t or {})
end
end
| lgpl-3.0 |
TannerRogalsky/GGJ2017 | powerups/powerup.lua | 1 | 2445 | local Powerup = class('Powerup', Base)
local DefenseCharacter = require('player.defense_character')
local powerup_shader = g.newShader('shaders/powerup.glsl')
Powerup.static.powerup_shader = powerup_shader
function Powerup:initialize(x, y, time_to_trigger)
Base.initialize(self)
assert(is_num(x))
assert(is_num(y))
assert(is_num(time_to_trigger) and time_to_trigger >= 0)
self.x, self.y = x, y
self.time_to_trigger = time_to_trigger
local w, h = push:getWidth() / game.map.width * 0.5, push:getHeight() / game.map.height * 0.5
self.body = love.physics.newBody(game.world, self.x, self.y, 'dynamic')
local shape = love.physics.newRectangleShape(w, h)
self.fixture = love.physics.newFixture(self.body, shape, 1)
self.fixture:setSensor(true)
self.fixture:setUserData(self)
self.mesh = g.newMesh({
{-w, -h, 0, 0},
{-w, h, 0, 1},
{w, h, 1, 1},
{w, -h, 1, 0},
}, 'fan', 'static')
self.timer = nil
end
function Powerup:update(dt)
if self.timer then
self.timer:update(dt)
end
end
function Powerup:draw()
g.push('all')
g.setColor(217, 17, 197)
g.setShader(powerup_shader)
if self.timer then
powerup_shader:send('gradient_colors',
self.timer.args[2].owner.color, {1.0, 1.0, 1.0}, nil)
else
local c1, c2 = unpack(self.colors)
powerup_shader:send('gradient_colors', c1, c2, nil)
end
g.translate(self.x, self.y)
g.draw(self.mesh)
if self.timer then
g.setShader()
g.setColor(0, 0, 0)
g.setFont(game.preloaded_fonts['04b03_32'])
local w, h = push:getWidth() / game.map.width * 0.5, push:getHeight() / game.map.height * 0.5
g.printf(math.round(self.timer.time - self.timer.running, 1), -w / 2, -32 / 2, w, 'center')
end
g.pop()
end
function Powerup:trigger(triggerer)
for i,powerup in ipairs(game.powerups) do
if powerup == self then
table.remove(game.powerups, i)
self.body:destroy()
break
end
end
end
function Powerup:begin_contact(other)
if other and other:isInstanceOf(DefenseCharacter) then
if self.time_to_trigger == 0 then
self:trigger(other)
elseif self.time_to_trigger > 0 then
self.timer = cron.after(self.time_to_trigger, self.trigger, self, other)
end
end
end
function Powerup:end_contact(other)
if other and other:isInstanceOf(DefenseCharacter) then
if self.timer and self.timer.args[2] == other then
self.timer = nil
end
end
end
return Powerup
| mit |
bmscoordinators/FFXI-Server | scripts/globals/abilities/elemental_siphon.lua | 26 | 2807 | -----------------------------------
-- Ability: Elemental Siphon
-- Drains MP from your summoned spirit.
-- Obtained: Summoner level 50
-- Recast Time: 5:00
-- Duration: Instant
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/pets");
require("scripts/globals/magic")
require("scripts/globals/utils")
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
local pet = player:getPetID();
if (pet >= 0 and pet <= 7) then -- spirits
return 0,0;
else
return MSGBASIC_UNABLE_TO_USE_JA,0;
end
end;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(player,target,ability)
local spiritEle = player:getPetID() + 1; -- get the spirit's ID, then make it line up with element value for the day order.
-- pet order: fire, ice, air, earth, thunder, water, light, dark
-- day order: fire, earth, water, wind, ice, thunder, light, dark
if (spiritEle == 2) then
spiritEle = 5
elseif (spiritEle == 3) then
spiritEle = 4
elseif (spiritEle == 4) then
spiritEle = 2
elseif (spiritEle == 5) then
spiritEle = 6
elseif (spiritEle == 6) then
spiritEle = 3
end;
local pEquipMods = player:getMod(MOD_ENHANCES_ELEMENTAL_SIPHON);
local basePower = player:getSkillLevel(SKILL_SUM) + pEquipMods - 50;
if (basePower < 0) then -- skill your summoning magic you lazy bastard !
basePower = 0;
end;
local weatherDayBonus = 1;
local dayElement = VanadielDayElement();
local weather = player:getWeather();
-- Day bonus/penalty
if (dayElement == dayStrong[spiritEle]) then
weatherDayBonus = weatherDayBonus + 0.1;
elseif (dayElement == dayWeak[spiritEle]) then
weatherDayBonus = weatherDayBonus - 0.1;
end
-- Weather bonus/penalty
if (weather == singleWeatherStrong[spiritEle]) then
weatherDayBonus = weatherDayBonus + 0.1;
elseif (weather == singleWeatherWeak[spiritEle]) then
weatherDayBonus = weatherDayBonus - 0.1;
elseif (weather == doubleWeatherStrong[spiritEle]) then
weatherDayBonus = weatherDayBonus + 0.25;
elseif (weather == doubleWeatherWeak[spiritEle]) then
weatherDayBonus = weatherDayBonus - 0.25;
end
local power = math.floor(basePower * weatherDayBonus);
local spirit = player:getPet();
power = utils.clamp(power, 0, spirit:getMP()); -- cap MP drained at spirit's MP
power = utils.clamp(power, 0, player:getMaxMP() - player:getMP()); -- cap MP drained at the max MP - current MP
spirit:delMP(power);
return player:addMP(power);
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/abilities/curing_waltz_v.lua | 6 | 2528 | -----------------------------------
-- Ability: Curing Waltz V
-- Restores target's HP
-- Obtained: Dancer Level 87
-- TP Required: 80%
-- Recast Time: 00:23
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
if (target:getHP() == 0) then
return MSGBASIC_CANNOT_ON_THAT_TARG,0;
elseif (player:hasStatusEffect(EFFECT_SABER_DANCE)) then
return MSGBASIC_UNABLE_TO_USE_JA2, 0;
elseif (player:hasStatusEffect(EFFECT_TRANCE)) then
return 0,0;
elseif (player:getTP() < 800) then
return MSGBASIC_NOT_ENOUGH_TP,0;
else
--[[ Apply "Waltz Ability Delay" reduction
1 modifier = 1 second]]
local recastMod = player:getMod(MOD_WALTZ_DELAY);
if (recastMod ~= 0) then
local newRecast = ability:getRecast() +recastMod;
ability:setRecast(utils.clamp(newRecast,0,newRecast));
end
-- Apply "Fan Dance" Waltz recast reduction
if (player:hasStatusEffect(EFFECT_FAN_DANCE)) then
local fanDanceMerits = target:getMerit(MERIT_FAN_DANCE);
-- Every tier beyond the 1st is -5% recast time
if (fanDanceMerits > 5) then
ability:setRecast(ability:getRecast() * ((fanDanceMerits -5)/100));
end
end
return 0,0;
end
end;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(player,target,ability)
-- Only remove TP if the player doesn't have Trance.
if not player:hasStatusEffect(EFFECT_TRANCE) then
player:delTP(800);
end;
--Grabbing variables.
local vit = target:getStat(MOD_VIT);
local chr = player:getStat(MOD_CHR);
local mjob = player:getMainJob(); --19 for DNC main.
local cure = 0;
--Performing mj check.
if (mjob == 19) then
cure = (vit+chr)*1.25+600;
end
-- apply waltz modifiers
cure = math.floor(cure * (1.0 + (player:getMod(MOD_WALTZ_POTENTCY)/100)));
--Reducing TP.
--Applying server mods....
cure = cure * CURE_POWER;
--Cap the final amount to max HP.
if ((target:getMaxHP() - target:getHP()) < cure) then
cure = (target:getMaxHP() - target:getHP());
end
--Do it
target:restoreHP(cure);
player:updateEnmityFromCure(target,cure);
return cure;
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Bastok_Mines/npcs/Davyad.lua | 14 | 1191 | -----------------------------------
-- Area: Bastok Mines
-- NPC: Davyad
-- Involved in Mission: Bastok 3-2
-- @zone 234
-- @pos 83 0 30
-----------------------------------
package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/zones/Bastok_Mines/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getCurrentMission(BASTOK) == TO_THE_FORSAKEN_MINES) then
player:startEvent(0x0036);
else
player:startEvent(0x0035);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/items/kohlrouladen_+1.lua | 12 | 1822 | -----------------------------------------
-- ID: 5761
-- Item: kohlrouladen
-- Food Effect: 4hr, All Races
-----------------------------------------
-- Strength 4
-- Agility 4
-- Intelligence -4
-- RACC +10% (cap 65)
-- RATT +16% (cap 70)
-- Enmity -5
-- Subtle Blow +6
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5761);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, 4);
target:addMod(MOD_AGI, 4);
target:addMod(MOD_INT, -4);
target:addMod(MOD_FOOD_RACCP, 10);
target:addMod(MOD_FOOD_RACC_CAP, 65);
target:addMod(MOD_FOOD_RATTP, 16);
target:addMod(MOD_FOOD_RATT_CAP, 70);
target:addMod(MOD_ENMITY, -5);
target:addMod(MOD_SUBTLE_BLOW, 6);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, 4);
target:delMod(MOD_AGI, 4);
target:delMod(MOD_INT, -4);
target:delMod(MOD_FOOD_RACCP, 10);
target:delMod(MOD_FOOD_RACC_CAP, 65);
target:delMod(MOD_FOOD_RATTP, 16);
target:delMod(MOD_FOOD_RATT_CAP, 70);
target:delMod(MOD_ENMITY, -5);
target:delMod(MOD_SUBTLE_BLOW, 6);
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/East_Sarutabaruta/npcs/Sama_Gohjima.lua | 14 | 1498 | -----------------------------------
-- Area: East Sarutabaruta
-- NPC: Sama Gohjima
-- Involved in Mission: The Horutoto Ruins Experiment (optional)
-- @pos 377 -13 98 116
-----------------------------------
package.loaded["scripts/zones/East_Sarutabaruta/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/zones/East_Sarutabaruta/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getCurrentMission(WINDURST) == THE_HORUTOTO_RUINS_EXPERIMENT and player:getVar("MissionStatus") == 1) then
player:showText(npc,SAMA_GOHJIMA_PREDIALOG);
elseif (player:getCurrentMission(WINDURST) == THE_HORUTOTO_RUINS_EXPERIMENT and player:getVar("MissionStatus") ~= 1) then
player:messageSpecial(SAMA_GOHJIMA_POSTDIALOG);
else
player:startEvent(0x002b);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
suxinde2009/wesnoth | data/ai/micro_ais/cas/ca_swarm_move.lua | 4 | 2496 | local H = wesnoth.require "lua/helper.lua"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_swarm_move = {}
function ca_swarm_move:evaluation(cfg)
local units = wesnoth.get_units { side = wesnoth.current.side }
for _,unit in ipairs(units) do
if (unit.moves > 0) then return cfg.ca_score end
end
return 0
end
function ca_swarm_move:execution(cfg)
local enemy_distance = cfg.enemy_distance or 5
local vision_distance = cfg.vision_distance or 12
-- If no close enemies, swarm will move semi-randomly, staying close together, but away from enemies
local all_units = wesnoth.get_units { side = wesnoth.current.side }
local units, units_no_moves = {}, {}
for _,unit in ipairs(all_units) do
if (unit.moves > 0) then
table.insert(units, unit)
else
table.insert(units_no_moves, unit)
end
end
local enemies = wesnoth.get_units {
{ "filter_side", { { "enemy_of", {side = wesnoth.current.side } } } }
}
-- Pick one unit at random, swarm does not move systematically
local unit = units[math.random(#units)]
-- Find best place for that unit to move to
local best_hex = AH.find_best_move(unit, function(x, y)
local rating = 0
-- Only units within 'vision_distance' count for rejoining
local close_units_no_moves = {}
for _,unit_noMP in ipairs(units_no_moves) do
if (H.distance_between(unit.x, unit.y, unit_noMP.x, unit_noMP.y) <= vision_distance) then
table.insert(close_units_no_moves, unit_noMP)
end
end
-- If all units on the side have moves left, simply go to a hex far away
if (not close_units_no_moves[1]) then
rating = rating + H.distance_between(x, y, unit.x, unit.y)
else -- Otherwise, minimize distance from units that have already moved
for _,close_unit in ipairs(close_units_no_moves) do
rating = rating - H.distance_between(x, y, close_unit.x, close_unit.y)
end
end
-- We also try to stay out of attack range of any enemy
for _,enemy in ipairs(enemies) do
local dist = H.distance_between(x, y, enemy.x, enemy.y)
if (dist < enemy_distance) then
rating = rating - (enemy_distance - dist) * 10.
end
end
return rating
end)
AH.movefull_stopunit(ai, unit, best_hex)
end
return ca_swarm_move
| gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/globals/items/fulm-long_salmon_sub.lua | 12 | 1486 | -----------------------------------------
-- ID: 4266
-- Item: fulm-long_salmon_sub
-- Food Effect: 60Min, All Races
-----------------------------------------
-- DEX +2
-- VIT +1
-- AGI +1
-- INT +2
-- MND -2
-- Ranged Accuracy +3
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,3600,4266);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, 2);
target:addMod(MOD_VIT, 1);
target:addMod(MOD_AGI, 1);
target:addMod(MOD_INT, 2);
target:addMod(MOD_MND, -2);
target:addMod(MOD_RACC, 3);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, 2);
target:delMod(MOD_VIT, 1);
target:delMod(MOD_AGI, 1);
target:delMod(MOD_INT, 2);
target:delMod(MOD_MND, -2);
target:delMod(MOD_RACC, 3);
end;
| gpl-3.0 |
gmorishere/plzplzplz | plugins/stats.lua | 236 | 3989 | do
-- Returns a table with `name` and `msgs`
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print_name(user)..' ['..user_id..']'
return user_info
end
local function chat_stats(chat_id)
-- Users on chat
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
local users_info = {}
-- Get user info
for i = 1, #users do
local user_id = users[i]
local user_info = get_msgs_user_chat(user_id, chat_id)
table.insert(users_info, user_info)
end
-- Sort users by msgs number
table.sort(users_info, function(a, b)
if a.msgs and b.msgs then
return a.msgs > b.msgs
end
end)
local text = 'users in this chat \n'
for k,user in pairs(users_info) do
text = text..user.name..' = '..user.msgs..'\n'
end
local file = io.open("./groups/"..chat_id.."stats.txt", "w")
file:write(text)
file:flush()
file:close()
send_document("chat#id"..chat_id,"./groups/"..chat_id.."stats.txt", ok_cb, false)
return --text
end
local function chat_stats2(chat_id)
-- Users on chat
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
local users_info = {}
-- Get user info
for i = 1, #users do
local user_id = users[i]
local user_info = get_msgs_user_chat(user_id, chat_id)
table.insert(users_info, user_info)
end
-- Sort users by msgs number
table.sort(users_info, function(a, b)
if a.msgs and b.msgs then
return a.msgs > b.msgs
end
end)
local text = 'users in this chat \n'
for k,user in pairs(users_info) do
text = text..user.name..' = '..user.msgs..'\n'
end
return text
end
-- Save stats, ban user
local function bot_stats()
local redis_scan = [[
local cursor = '0'
local count = 0
repeat
local r = redis.call("SCAN", cursor, "MATCH", KEYS[1])
cursor = r[1]
count = count + #r[2]
until cursor == '0'
return count]]
-- Users
local hash = 'msgs:*:'..our_id
local r = redis:eval(redis_scan, 1, hash)
local text = 'Users: '..r
hash = 'chat:*:users'
r = redis:eval(redis_scan, 1, hash)
text = text..'\nGroups: '..r
return text
end
local function run(msg, matches)
if matches[1]:lower() == 'teleseed' then -- Put everything you like :)
local about = _config.about_text
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] used /teleseed ")
return about
end
if matches[1]:lower() == "statslist" then
if not is_momod(msg) then
return "For mods only !"
end
local chat_id = msg.to.id
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] requested group stats ")
return chat_stats2(chat_id)
end
if matches[1]:lower() == "stats" then
if not matches[2] then
if not is_momod(msg) then
return "For mods only !"
end
if msg.to.type == 'chat' then
local chat_id = msg.to.id
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] requested group stats ")
return chat_stats(chat_id)
else
return
end
end
if matches[2] == "teleseed" then -- Put everything you like :)
if not is_admin(msg) then
return "For admins only !"
else
return bot_stats()
end
end
if matches[2] == "group" then
if not is_admin(msg) then
return "For admins only !"
else
return chat_stats(matches[3])
end
end
end
end
return {
patterns = {
"^[!/]([Ss]tats)$",
"^[!/]([Ss]tatslist)$",
"^[!/]([Ss]tats) (group) (%d+)",
"^[!/]([Ss]tats) (teleseed)",-- Put everything you like :)
"^[!/]([Tt]eleseed)"-- Put everything you like :)
},
run = run
}
end
| gpl-2.0 |
Samanj5/creed-SPAM | plugins/stats.lua | 236 | 3989 | do
-- Returns a table with `name` and `msgs`
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print_name(user)..' ['..user_id..']'
return user_info
end
local function chat_stats(chat_id)
-- Users on chat
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
local users_info = {}
-- Get user info
for i = 1, #users do
local user_id = users[i]
local user_info = get_msgs_user_chat(user_id, chat_id)
table.insert(users_info, user_info)
end
-- Sort users by msgs number
table.sort(users_info, function(a, b)
if a.msgs and b.msgs then
return a.msgs > b.msgs
end
end)
local text = 'users in this chat \n'
for k,user in pairs(users_info) do
text = text..user.name..' = '..user.msgs..'\n'
end
local file = io.open("./groups/"..chat_id.."stats.txt", "w")
file:write(text)
file:flush()
file:close()
send_document("chat#id"..chat_id,"./groups/"..chat_id.."stats.txt", ok_cb, false)
return --text
end
local function chat_stats2(chat_id)
-- Users on chat
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
local users_info = {}
-- Get user info
for i = 1, #users do
local user_id = users[i]
local user_info = get_msgs_user_chat(user_id, chat_id)
table.insert(users_info, user_info)
end
-- Sort users by msgs number
table.sort(users_info, function(a, b)
if a.msgs and b.msgs then
return a.msgs > b.msgs
end
end)
local text = 'users in this chat \n'
for k,user in pairs(users_info) do
text = text..user.name..' = '..user.msgs..'\n'
end
return text
end
-- Save stats, ban user
local function bot_stats()
local redis_scan = [[
local cursor = '0'
local count = 0
repeat
local r = redis.call("SCAN", cursor, "MATCH", KEYS[1])
cursor = r[1]
count = count + #r[2]
until cursor == '0'
return count]]
-- Users
local hash = 'msgs:*:'..our_id
local r = redis:eval(redis_scan, 1, hash)
local text = 'Users: '..r
hash = 'chat:*:users'
r = redis:eval(redis_scan, 1, hash)
text = text..'\nGroups: '..r
return text
end
local function run(msg, matches)
if matches[1]:lower() == 'teleseed' then -- Put everything you like :)
local about = _config.about_text
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] used /teleseed ")
return about
end
if matches[1]:lower() == "statslist" then
if not is_momod(msg) then
return "For mods only !"
end
local chat_id = msg.to.id
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] requested group stats ")
return chat_stats2(chat_id)
end
if matches[1]:lower() == "stats" then
if not matches[2] then
if not is_momod(msg) then
return "For mods only !"
end
if msg.to.type == 'chat' then
local chat_id = msg.to.id
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] requested group stats ")
return chat_stats(chat_id)
else
return
end
end
if matches[2] == "teleseed" then -- Put everything you like :)
if not is_admin(msg) then
return "For admins only !"
else
return bot_stats()
end
end
if matches[2] == "group" then
if not is_admin(msg) then
return "For admins only !"
else
return chat_stats(matches[3])
end
end
end
end
return {
patterns = {
"^[!/]([Ss]tats)$",
"^[!/]([Ss]tatslist)$",
"^[!/]([Ss]tats) (group) (%d+)",
"^[!/]([Ss]tats) (teleseed)",-- Put everything you like :)
"^[!/]([Tt]eleseed)"-- Put everything you like :)
},
run = run
}
end
| gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/zones/Dangruf_Wadi/Zone.lua | 12 | 2892 | -----------------------------------
--
-- Zone: Dangruf_Wadi (191)
--
-----------------------------------
package.loaded["scripts/zones/Dangruf_Wadi/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
require("scripts/globals/zone");
require("scripts/zones/Dangruf_Wadi/TextIDs");
-----------------------------------
-- onInitialize
-----------------------------------
function onInitialize(zone)
zone:registerRegion(1, -133.5, 2, 132.6, -132.7, 4, 133.8); -- I-8 Geyser
zone:registerRegion(2, -213.5, 2, 92.6, -212.7, 4, 94.0); -- H-8 Geyser
zone:registerRegion(3, -67.3, 2, 532.8, -66.3, 4, 534.0); -- J-3 Geyser
UpdateTreasureSpawnPoint(17559924);
end;
-----------------------------------
-- onConquestUpdate
-----------------------------------
function onConquestUpdate(zone, updatetype)
local players = zone:getPlayers();
for name, player in pairs(players) do
conquestUpdate(zone, player, updatetype, CONQUEST_BASE);
end
end;
-----------------------------------
-- onZoneIn
-----------------------------------
function onZoneIn(player,prevZone)
local cs = -1;
if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then
player:setPos(-4.025,-4.449,0.016,112);
end
return cs;
end;
-----------------------------------
-- onRegionEnter
-----------------------------------
function onRegionEnter(player,region)
switch (region:GetRegionID()): caseof
{
[1] = function (x)
player:startEvent(0x000A);
SendEntityVisualPacket(17559897, "kkj2");
end,
[2] = function (x)
player:startEvent(0x000B);
SendEntityVisualPacket(17559898, "kkj1");
end,
[3] = function (x)
player:startEvent(0x000C);
SendEntityVisualPacket(17559899, "kkj3");
end,
}
if (player:hasKeyItem(BLUE_ACIDITY_TESTER)) then
player:delKeyItem(BLUE_ACIDITY_TESTER);
player:addKeyItem(RED_ACIDITY_TESTER);
end
end;
-----------------------------------
-- onRegionLeave
-----------------------------------
function onRegionLeave(player,region)
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
function onZoneWeatherChange(weather)
local qm2 = GetNPCByID(17559911); -- Quest: An Empty Vessel
if (weather == WEATHER_NONE or weather == WEATHER_SUNSHINE) then
qm2:setStatus(STATUS_NORMAL);
else
qm2:setStatus(STATUS_DISAPPEAR);
end
end; | gpl-3.0 |
yarrrthegame/publicconfig | missions/drone_1.lua | 1 | 4225 | t = {}
local yc = require( "yarrrconfig" )
function attack( drone, mission_id )
local ship_data = yc.ship_of_mission_by_id( mission_id )
local drone_data = objects[ drone:id() ]
local diff = yc.coordinate_difference( ship_data.coordinate, drone_data.coordinate )
drone:set_velocity( yc.coordinate_from( yc.coordinate_sum( diff, yc.random_velocity( 30 ) ) ) )
local distance = yc.distance_between( drone_data.coordinate, ship_data.coordinate )
local aim_to = math.deg( math.atan2( diff.y / distance, diff.x / distance ) )
drone:fire( degrees( aim_to ) )
end
function close_in( drone, mission_id )
local ship_data = yc.ship_of_mission_by_id( mission_id )
local drone_data = objects[ drone:id() ]
local diff = yc.coordinate_difference( ship_data.coordinate, drone_data.coordinate )
diff.x = diff.x / 10
diff.y = diff.y / 10
drone:set_velocity( yc.coordinate_from( diff ) )
end
function wander_around( object, mission_id )
object:set_velocity( yc.coordinate_from( yc.random_velocity( 50 ) ) )
end
function add_drone_ai( object, mission_id )
local once_in_a_second = 1000000
object:add_behavior( LuaAgent.new( LuaFunction.new( function( drone )
local mission = mission_contexts[ mission_id ]
if mission == nil then
return
end
if mission.drone_ai == nil then
wander_around( object, mission_id )
return
end
mission.drone_ai( drone, mission_id )
end ), once_in_a_second ) )
end
function add_mining_drone( mission, around )
local context = yc.context_of( mission )
local mission_id = mission:id()
object_factory.create_object( "drone", function( drone )
drone:move_to( yc.coordinate_from( yc.random_location_around( around, 100 ) ) )
yc.bind_to_mission( drone, mission_id )
add_drone_ai( drone, mission_id )
drone:add_behavior( ObjectIdentity.new( "Imperial Miner Drone" ) )
end )
end
function stay_in_position_for( message, mission, coordinate, seconds, done )
local till = universe_time() + seconds
yc.add_objective_to( mission, {
description = message,
updater = function( mission )
local ship = yc.ship_of( mission )
local diff = yc.coordinate_difference( ship.coordinate, coordinate )
if yc.length_of( diff ) > 2000 then
return failed
end
if universe_time() > till then
return succeeded
end
return ongoing
end,
teardown = done
} )
end
function add_mining_drones( mission )
local center_of_drones = yc.random_location_around( { x=0, y=0 }, 10000 )
yc.add_instruction( mission, "Go to the last reported location of a pack of mining drones." )
for i=1, 10 do
add_mining_drone( mission, center_of_drones )
end
yc.go_to( mission, center_of_drones, function( mission )
yc.add_instruction( mission, "Interesting. It seems they completely went haywire. Collect as much data as you can." )
stay_in_position_for( "Stay in position for 45 seconds, while the instruments record enough data.", mission, center_of_drones, 15, function( mission )
yc.context_of( mission ).drone_ai = close_in
yc.add_instruction( mission, "Hm... They seem to notice your presence. Theres definitely something wrong here." )
stay_in_position_for( "30 more seconds and you are good to go.", mission, center_of_drones, 30, function( mission )
yc.context_of( mission ).drone_ai = attack
yc.add_instruction( mission, "Wow! It seems the mining laser had been modified on the drones. You better run." )
yc.run( mission, 1000, function( mission )
yc.context_of( mission ).drone_ai = wander_around
yc.add_instruction( mission, "That was close. It seems they stopped chasing you. Bring back the collected data for analysis." )
yc.go_home( mission );
end)
end)
end )
end )
end
function t.create( mission )
yc.add_instruction( mission, "Welcome pilot. Lately many mining companies complained that their drones stopped responding. It is your duty to fly out and have a look at them." )
add_mining_drones( mission )
end
mission_factory.register_factory( MissionInfo.new( "drone_1", "What happened to the mining drones?" ), t.create )
return t
| mit |
wingo/snabb | src/apps/lwaftr/generator.lua | 2 | 12022 | module(..., package.seeall)
-- This module implements two clases: `from_inet` and `from_b4`.
--
-- `from_inet` class emulates IPv4 traffic coming from the internet to then
-- lwAFTR. It requires at least a starting IPv4 address and a PSID length
-- value. On each iteration, destination port is incremented, so packets can
-- match a different softwire belonging to a different PSID. Once all the port
-- sets have been iterated, IPv4 address is increased by one unit and
-- destination port comes -- back to its original value.
--
-- `from_b4` class emulates IPv4-in-IPv6 traffic coming from the b4 to the
-- lwAFTR. It requires several parameters: starting IPv4 address, starting B4
-- address, IPv6 lwAFTR address and PSID length value. It works similarly to
-- `from_inet`.
local ipsum = require("lib.checksum").ipsum
local ipv4 = require("lib.protocol.ipv4")
local ipv6 = require("lib.protocol.ipv6")
local lib = require("core.lib")
local link = require("core.link")
local lwtypes = require("apps.lwaftr.lwtypes")
local packet = require("core.packet")
local ffi = require("ffi")
local C = ffi.C
local cast = ffi.cast
local bitfield = lib.bitfield
local DEFAULT_TTL = 255
local VLAN_TPID = C.htons(0x8100)
local ethernet_header_ptr_type = lwtypes.ethernet_header_ptr_type
local ethernet_vlan_header_ptr_type = lwtypes.ethernet_vlan_header_ptr_type
local ipv4_header_ptr_type = lwtypes.ipv4_header_ptr_type
local ipv6_header_ptr_type = lwtypes.ipv6_header_ptr_type
local udp_header_ptr_type = lwtypes.udp_header_ptr_type
local ipv4_header_size = lwtypes.ipv4_header_size
local ipv6_header_size = lwtypes.ipv6_header_size
local udp_header_size = lwtypes.udp_header_size
local IPV4_DSCP_AND_ECN_OFFSET = 1
local PROTO_IPV4 = C.htons(0x0800)
local PROTO_IPV4_ENCAPSULATION = 0x4
local PROTO_IPV6 = C.htons(0x86DD)
local PROTO_UDP = 17
from_inet = {}
function from_inet:new(conf)
if not conf.shift then conf.shift = 16 - conf.psid_len end
assert(conf.psid_len + conf.shift == 16)
local psid_len, shift = conf.psid_len, conf.shift
local start_inet = ipv4:pton(conf.start_inet)
local start_port = 2^shift
if conf.max_packets then
conf.max_packets_per_iter = conf.max_packets
end
local o = {
dst_ip = start_inet,
dst_port = start_port,
inc_port = 2^shift,
max_packets_per_iter = conf.max_packets_per_iter or 10,
iter_count = 1, -- Iteration counter. Reset when overpasses max_packet_per_iter.
num_ips = conf.num_ips or 10,
ip_count = 1, -- IPv4 counter. Reset when overpasses num_ips.
max_packets = conf.max_packets,
packet_size = conf.packet_size or 550,
psid_count = 1,
psid_max = 2^psid_len,
start_inet = start_inet,
start_port = start_port,
tx_packets = 0,
src_mac = conf.src_mac,
dst_mac = conf.dst_mac,
vlan_tag = conf.vlan_tag and C.htons(conf.vlan_tag),
}
o = setmetatable(o, { __index = from_inet })
o.master_pkt = o:master_packet()
return o
end
function from_inet:master_packet()
return ipv4_packet({
src_mac = self.src_mac,
dst_mac = self.dst_mac,
src_ip = ipv4:pton("10.10.10.1"),
dst_ip = self.dst_ip,
src_port = C.htons(12345),
dst_port = C.htons(self.dst_port),
packet_size = self.packet_size,
vlan_tag = self.vlan_tag,
})
end
function ipv4_packet(params)
local p = packet.allocate()
local ether_hdr = cast(ethernet_header_ptr_type, p.data)
local ethernet_header_size
if params.vlan_tag then
ether_hdr = cast(ethernet_vlan_header_ptr_type, p.data)
ether_hdr.vlan.tpid = VLAN_TPID
ether_hdr.vlan.tag = params.vlan_tag
ethernet_header_size = lwtypes.ethernet_vlan_header_size
else
ether_hdr = cast(ethernet_header_ptr_type, p.data)
ethernet_header_size = lwtypes.ethernet_header_size
end
ether_hdr.ether_dhost = params.dst_mac
ether_hdr.ether_shost = params.src_mac
ether_hdr.ether_type = PROTO_IPV4
local ipv4_hdr = cast(ipv4_header_ptr_type, p.data + ethernet_header_size)
ipv4_hdr.src_ip = params.src_ip
ipv4_hdr.ttl = 15
ipv4_hdr.ihl_v_tos = C.htons(0x4500)
ipv4_hdr.id = 0
ipv4_hdr.frag_off = 0
ipv4_hdr.total_length = C.htons(params.packet_size - ethernet_header_size)
ipv4_hdr.dst_ip = params.dst_ip
ipv4_hdr.protocol = PROTO_UDP
local udp_hdr = cast(udp_header_ptr_type, p.data + (ethernet_header_size +
ipv4_header_size))
udp_hdr.src_port = params.src_port
udp_hdr.dst_port = params.dst_port
udp_hdr.len = C.htons(params.packet_size - (ethernet_header_size + ipv4_header_size))
udp_hdr.checksum = 0
p.length = params.packet_size
return p
end
function from_inet:pull()
local o = assert(self.output.output)
for i=1,engine.pull_npackets do
if self.max_packets then
if self.tx_packets == self.max_packets then break end
self.tx_packets = self.tx_packets + 1
end
link.transmit(o, self:new_packet())
end
end
function from_inet:new_packet()
local p = self.master_pkt
local ethernet_header_size
if self.vlan_tag then
ethernet_header_size = lwtypes.ethernet_vlan_header_size
else
ethernet_header_size = lwtypes.ethernet_header_size
end
-- Change destination IPv4
local ipv4_hdr = cast(ipv4_header_ptr_type, p.data + ethernet_header_size)
ipv4_hdr.dst_ip = self.dst_ip
ipv4_hdr.checksum = 0
ipv4_hdr.checksum = C.htons(ipsum(p.data + ethernet_header_size,
ipv4_header_size, 0))
-- Change destination port
local udp_hdr = cast(udp_header_ptr_type, p.data + (ethernet_header_size + ipv4_header_size))
udp_hdr.dst_port = C.htons(self.dst_port)
self:next_softwire()
return packet.clone(p)
end
function from_inet:next_softwire()
self.dst_port = self.dst_port + self.inc_port
self.psid_count = self.psid_count + 1
-- Next IPv4 public address.
if self.psid_count == self.psid_max then
self.psid_count = 1
self.dst_port = self.start_port
self.dst_ip = inc_ipv4(self.dst_ip)
end
self.iter_count = self.iter_count + 1
-- Iteration completed. Full restart.
if self.iter_count > self.max_packets_per_iter
or self.ip_count > self.num_ips then
self.psid_count = 1
self.dst_port = self.start_port
self.dst_ip = self.start_inet
end
end
function inc_ipv4(ipv4)
for i=3,0,-1 do
if ipv4[i] == 255 then
ipv4[i] = 0
else
ipv4[i] = ipv4[i] + 1
break
end
end
return ipv4
end
from_b4 = {}
function from_b4:new(conf)
if not conf.shift then conf.shift = 16 - conf.psid_len end
assert(conf.psid_len + conf.shift == 16)
local psid_len, shift = conf.psid_len, conf.shift
local start_inet = ipv4:pton(conf.start_inet)
local start_b4 = ipv6:pton(conf.start_b4)
local start_port = 2^shift
local packet_size = conf.packet_size or 550
packet_size = packet_size - ipv6_header_size
if conf.max_packets then
conf.max_packets_per_iter = conf.max_packets
end
local o = {
br = ipv6:pton(conf.br),
inc_port = 2^shift,
ip_count = 1,
iter_count = 1,
max_packets_per_iter = conf.max_packets_per_iter or 10,
max_packets = conf.max_packets,
num_ips = conf.num_ips or 10,
packet_size = packet_size,
psid_count = 1,
psid_max = 2^psid_len,
src_ipv4 = start_inet,
src_ipv6 = start_b4,
src_portv4 = start_port,
start_b4 = start_b4,
start_inet = start_inet,
start_port = start_port,
tx_packets = 0,
src_mac = conf.src_mac,
dst_mac = conf.dst_mac,
vlan_tag = conf.vlan_tag and C.htons(conf.vlan_tag),
}
o = setmetatable(o, { __index = from_b4 })
o.master_pkt = o:master_packet()
return o
end
function from_b4:master_packet()
local ipv4_pkt = ipv4_packet({
src_mac = self.src_mac,
dst_mac = self.dst_mac,
src_ip = self.src_ipv4,
dst_ip = ipv4:pton("10.10.10.1"),
src_port = C.htons(self.src_portv4),
dst_port = C.htons(12345),
packet_size = self.packet_size,
vlan_tag = self.vlan_tag,
})
return ipv6_encapsulate(ipv4_pkt, {
src_mac = self.src_mac,
dst_mac = self.dst_mac,
src_ip = self.start_b4,
dst_ip = self.br,
vlan_tag = self.vlan_tag,
})
end
function ipv6_encapsulate(ipv4_pkt, params)
local p = assert(ipv4_pkt)
-- IPv4 packet is tagged
local ethernet_header_size
if params.vlan_tag then
ethernet_header_size = lwtypes.ethernet_vlan_header_size
else
ethernet_header_size = lwtypes.ethernet_header_size
end
local payload_length = p.length - ethernet_header_size
local dscp_and_ecn = p.data[ethernet_header_size + IPV4_DSCP_AND_ECN_OFFSET]
p = packet.shiftright(p, ipv6_header_size)
-- IPv6 packet is tagged
if params.vlan_tag then
eth_hdr = cast(ethernet_vlan_header_ptr_type, p.data)
eth_hdr.vlan.tag = params.vlan_tag
ethernet_header_size = lwtypes.ethernet_vlan_header_size
else
eth_hdr = cast(ethernet_header_ptr_type, p.data)
ethernet_header_size = lwtypes.ethernet_header_size
end
eth_hdr.ether_dhost = params.dst_mac
eth_hdr.ether_shost = params.src_mac
eth_hdr.ether_type = PROTO_IPV6
local ipv6_hdr = cast(ipv6_header_ptr_type, p.data + ethernet_header_size)
bitfield(32, ipv6_hdr, 'v_tc_fl', 0, 4, 6) -- IPv6 Version
bitfield(32, ipv6_hdr, 'v_tc_fl', 4, 8, dscp_and_ecn) -- Traffic class
ipv6_hdr.payload_length = C.htons(payload_length)
ipv6_hdr.next_header = PROTO_IPV4_ENCAPSULATION
ipv6_hdr.hop_limit = DEFAULT_TTL
ipv6_hdr.src_ip = params.src_ip
ipv6_hdr.dst_ip = params.dst_ip
local total_length = p.length -- + (ethernet_header_size + ipv6_header_size)
p.length = total_length
return p, total_length
end
function from_b4:pull()
local o = assert(self.output.output)
for i=1,engine.pull_npackets do
if self.max_packets then
if self.tx_packets == self.max_packets then break end
self.tx_packets = self.tx_packets + 1
end
link.transmit(o, self:new_packet())
end
end
function from_b4:new_packet()
local ipv6 = self.master_pkt
-- IPv6 packet is tagged
local ethernet_header_size
if self.vlan_tag then
ethernet_header_size = lwtypes.ethernet_vlan_header_size
else
ethernet_header_size = lwtypes.ethernet_header_size
end
-- Set IPv6 source address
local ipv6_hdr = cast(ipv6_header_ptr_type, ipv6.data + ethernet_header_size)
ipv6_hdr.src_ip = self.src_ipv6
-- Set tunneled IPv4 source address
local ipv6_payload = ethernet_header_size + ipv6_header_size
ipv4_hdr = cast(ipv4_header_ptr_type, ipv6.data + ipv6_payload)
ipv4_hdr.src_ip = self.src_ipv4
ipv4_hdr.checksum = 0
ipv4_hdr.checksum = C.htons(ipsum(ipv6.data + ipv6_payload,
ipv4_header_size, 0))
-- Set tunneled IPv4 source port
udp_hdr = cast(udp_header_ptr_type, ipv6.data + (ipv6_payload + ipv4_header_size))
udp_hdr.src_port = C.htons(self.src_portv4)
self:next_softwire()
return packet.clone(ipv6)
end
function from_b4:next_softwire()
self.src_portv4 = self.src_portv4 + self.inc_port
self.src_ipv6 = inc_ipv6(self.src_ipv6)
self.psid_count = self.psid_count + 1
-- Next public IPv4 adress.
if self.psid_count == self.psid_max then
self.psid_count = 1
self.src_portv4 = self.start_port
self.src_ipv4 = inc_ipv4(self.src_ipv4)
end
self.iter_count = self.iter_count + 1
-- Iteration completed. Full restart.
if self.iter_count > self.max_packets_per_iter
or self.ip_count > self.num_ips then
self.psid_count = 1
self.src_portv4 = self.start_port
self.src_ipv4 = self.start_inet
self.src_ipv6 = self.start_b4
end
end
function inc_ipv6(ipv6)
for i=15,0,-1 do
if ipv6[i] == 255 then
ipv6[i] = 0
else
ipv6[i] = ipv6[i] + 1
break
end
end
return ipv6
end
| apache-2.0 |
bmscoordinators/FFXI-Server | scripts/zones/Bastok_Markets/npcs/Biggorf.lua | 17 | 1180 | -----------------------------------
-- Area: Bastok Markets
-- NPC: Biggorf
-- Standard Info NPC
-- Involved in Quest: The Bare Bones
-----------------------------------
require("scripts/globals/quests");
package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil;
require("scripts/zones/Bastok_Markets/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
BareBones = player:getQuestStatus(BASTOK,THE_BARE_BONES);
if (BareBones == QUEST_ACCEPTED) then
player:startEvent(0x0101);
else
player:startEvent(0x007e);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Nyzul_Isle/mobs/Alexander.lua | 12 | 3126 | -----------------------------------
-- Area: Nyzul Isle (Nashmeira's Plea)
-- MOB: Alexander
-----------------------------------
require("scripts/zones/Nyzul_Isle/IDs");
require("scripts/globals/status");
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
mob:setMobMod(MOBMOD_NO_MOVE, 1);
-- "Draw in" should only trigger when target is beyond 20' (out of Radiant_Sacrament range)
mob:setMobMod(MOBMOD_DRAW_IN, 1);
mob:addListener("WEAPONSKILL_STATE_ENTER", "WS_START_MSG", function(mob, skillID)
-- Radiant Sacrament
if (skillID == 2141) then
mob:showText(mob,NyzulIsle.text.OFFER_THY_WORSHIP);
-- Mega Holy
elseif (skillID == 2142) then
mob:showText(mob,NyzulIsle.text.OPEN_THINE_EYES);
-- Perfect Defense
elseif (skillID == 2143) then
mob:showText(mob,NyzulIsle.text.CEASE_THY_STRUGGLES);
-- Divine Spear
elseif (skillID == 2144) then
mob:showText(mob,NyzulIsle.text.RELEASE_THY_SELF);
-- Gospel of the Lost
elseif (skillID == 2145) then
mob:showText(mob,NyzulIsle.text.BASK_IN_MY_GLORY);
-- Void of Repentance
elseif (skillID == 2146) then
mob:showText(mob,NyzulIsle.text.REPENT_THY_IRREVERENCE);
-- Divine Judgement
elseif (skillID == 2147) then
mob:showText(mob,NyzulIsle.text.ACCEPT_THY_DESTRUCTION);
mob:showText(mob,NyzulIsle.text.OMEGA_SPAM);
end
end);
end;
-----------------------------------
-- onMobEngaged Action
-----------------------------------
function onMobEngaged(mob,target)
mob:showText(mob,NyzulIsle.text.SHALL_BE_JUDGED);
end;
-----------------------------------
-- onMobFight Action
-----------------------------------
function onMobFight(mob,target)
-- BG Wiki: "He will use this ability at 50% of his HP and several times again as his health decreases."
-- ffxiclopedia: "Alexander will use this ability as his next TP move once its HP falls below 50%."
if (mob:getHPP() <= 50 and mob:getTP() >= 1000 and mob:getLocalVar("DivineJudgement") == 0) then
mob:setLocalVar("DivineJudgement", 1)
mob:useMobAbility(2147);
end
-- ffxiclopedia: "In addition to this, it's possible he'll use it several times again at low (5%?) HP."
-- Per same wiki, may use Perfect Defense as a regular skill at 10%..Assuming same % for both skills.
local skill_list = mob:getMobMod(MOBMOD_SKILL_LIST);
if (mob:getHPP() <= 10 and skill_list == 784) then
mob:setMobMod(MOBMOD_SKILL_LIST, 785);
end
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob, player, isKiller)
if (isKiller) then
mob:showText(mob,NyzulIsle.text.SHALL_KNOW_OBLIVION);
end
end;
-----------------------------------
-- onMobDespawn
-----------------------------------
function onMobDespawn(mob)
local instance = mob:getInstance();
instance:setProgress(instance:getProgress() + 1);
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/abilities/eagle_eye_shot.lua | 26 | 2067 | -----------------------------------
-- Ability: Eagle Eye Shot
-- Delivers a powerful and accurate ranged attack.
-- Obtained: Ranger Level 1
-- Recast Time: 1:00:00
-- Duration: Instant
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/weaponskills");
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
local ranged = player:getStorageItem(0, 0, SLOT_RANGED);
local ammo = player:getStorageItem(0, 0, SLOT_AMMO);
if ranged and ranged:isType(ITEM_WEAPON) then
local skilltype = ranged:getSkillType();
if skilltype == SKILL_ARC or skilltype == SKILL_MRK or skilltype == SKILL_THR then
if ammo and (ammo:isType(ITEM_WEAPON) or skilltype == SKILL_THR) then
return 0, 0;
end;
end;
end;
return MSGBASIC_NO_RANGED_WEAPON, 0;
end;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(player,target,ability,action)
if (player:getWeaponSkillType(SLOT_RANGED) == SKILL_MRK) then
action:animation(target:getID(), action:animation(target:getID()) + 1);
end
local params = {};
params.numHits = 1;
local ftp = 5
params.ftp100 = ftp; params.ftp200 = ftp; params.ftp300 = ftp;
params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = true;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1
params.enmityMult = 0.5
local damage, criticalHit, tpHits, extraHits = doRangedWeaponskill(player, target, 0, params, 0, true)
if not (tpHits + extraHits > 0) then
ability:setMsg(MSGBASIC_USES_BUT_MISSES)
action:speceffect(target:getID(), 0)
end
return damage;
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Norg/npcs/Washu.lua | 9 | 3754 | -----------------------------------
-- Area: Norg
-- NPC: Washu
-- Involved in Quest: Yomi Okuri
-- Starts and finishes Quest: Stop Your Whining
-- @pos 49 -6 15 252
-----------------------------------
package.loaded["scripts/zones/Norg/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/globals/titles");
require("scripts/zones/Norg/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(OUTLANDS,YOMI_OKURI) == QUEST_ACCEPTED and player:getVar("yomiOkuriCS") == 2) then
-- Trade Giant Sheep Meat, Frost Turnip, Bastore Sardine, Hecteyes Eye
if (trade:hasItemQty(4372,1) and trade:hasItemQty(4382,1) and (trade:hasItemQty(4360,1) or trade:hasItemQty(5792,1)) and trade:hasItemQty(939,1) and trade:getItemCount() == 4) then
player:startEvent(0x0096);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
Whining = player:getQuestStatus(OUTLANDS,STOP_YOUR_WHINING);
mLvl = player:getMainLvl();
if (player:getQuestStatus(OUTLANDS,YOMI_OKURI) == QUEST_ACCEPTED) then
if (player:getVar("yomiOkuriCS") == 1) then
player:startEvent(0x0094);
elseif (player:getVar("yomiOkuriCS") == 2) then
player:startEvent(0x0095);
elseif (player:getVar("yomiOkuriCS") >= 3) then
player:startEvent(0x0097);
end
elseif (Whining == QUEST_AVAILABLE and player:getFameLevel(NORG) >= 4 and mLvl >= 10) then
player:startEvent(0x0015); --Start Quest
elseif (Whining == QUEST_ACCEPTED and player:hasKeyItem(EMPTY_BARREL) == true) then
player:startEvent(0x0016); --Reminder Dialogue
elseif (Whining == QUEST_ACCEPTED and player:hasKeyItem(BARREL_OF_OPOOPO_BREW) == true) then
player:startEvent(0x0017); --Finish Quest
elseif (Whining == QUEST_COMPLETED) then
player:startEvent(0x0018);
else
player:startEvent(0x0050);
end
end;
-- 0x0050 0x0015 0x0016 0x0017 0x0018 0x0094 0x0095 0x0096 0x0097 0x00d1 0x00d2 0x00dd 0x00de 0x00df
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0094) then
player:setVar("yomiOkuriCS",2);
elseif (csid == 0x0096) then
player:tradeComplete();
player:addKeyItem(WASHUS_TASTY_WURST);
player:messageSpecial(KEYITEM_OBTAINED,WASHUS_TASTY_WURST);
player:setVar("yomiOkuriCS",3);
elseif (csid == 0x0015 and option == 1) then
player:addKeyItem(EMPTY_BARREL); --Empty Barrel
player:addQuest(OUTLANDS,STOP_YOUR_WHINING);
player:messageSpecial(KEYITEM_OBTAINED,EMPTY_BARREL);
elseif (csid == 0x0017) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4952);
else
player:delKeyItem(BARREL_OF_OPOOPO_BREW); --Filled Barrel
player:addItem(4952); -- Scroll of Hojo: Ichi
player:messageSpecial(ITEM_OBTAINED,4952); -- Scroll of Hojo: Ichi
player:addFame(NORG,75);
player:addTitle(APPRENTICE_SOMMELIER);
player:completeQuest(OUTLANDS,STOP_YOUR_WHINING);
end
end
end; | gpl-3.0 |
EvandroLG/pegasus.lua | src/pegasus/handler.lua | 1 | 3481 | local Request = require 'pegasus.request'
local Response = require 'pegasus.response'
local mimetypes = require 'mimetypes'
local lfs = require 'lfs'
local function ternary(condition, t, f)
if condition then return t else return f end
end
local Handler = {}
Handler.__index = Handler
function Handler:new(callback, location, plugins)
local handler = {}
handler.callback = callback
handler.location = location or ''
handler.plugins = plugins or {}
local result = setmetatable(handler, self)
result:pluginsAlterRequestResponseMetatable()
return result
end
function Handler:pluginsAlterRequestResponseMetatable()
for _, plugin in ipairs(self.plugins) do
if plugin.alterRequestResponseMetaTable then
local stop = plugin:alterRequestResponseMetaTable(Request, Response)
if stop then
return stop
end
end
end
end
function Handler:pluginsNewRequestResponse(request, response)
for _, plugin in ipairs(self.plugins) do
if plugin.newRequestResponse then
local stop = plugin:newRequestResponse(request, response)
if stop then
return stop
end
end
end
end
function Handler:pluginsBeforeProcess(request, response)
for _, plugin in ipairs(self.plugins) do
if plugin.beforeProcess then
local stop = plugin:beforeProcess(request, response)
if stop then
return stop
end
end
end
end
function Handler:pluginsAfterProcess(request, response)
for _, plugin in ipairs(self.plugins) do
if plugin.afterProcess then
local stop = plugin:afterProcess(request, response)
if stop then
return stop
end
end
end
end
function Handler:pluginsProcessFile(request, response, filename)
for _, plugin in ipairs(self.plugins) do
if plugin.processFile then
local stop = plugin:processFile(request, response, filename)
if stop then
return stop
end
end
end
end
function Handler:processBodyData(data, stayOpen, response)
local localData = data
for _, plugin in ipairs(self.plugins or {}) do
if plugin.processBodyData then
localData = plugin:processBodyData(
localData,
stayOpen,
response.request,
response
)
end
end
return localData
end
function Handler:processRequest(port, client, server)
local request = Request:new(port, client, server)
if not request:method() then
client:close()
return
end
local response = Response:new(client, self)
response.request = request
local stop = self:pluginsNewRequestResponse(request, response)
if stop then
return
end
if request:path() and self.location ~= '' then
local path = ternary(request:path() == '/' or request:path() == '', 'index.html', request:path())
local filename = '.' .. self.location .. path
if not lfs.attributes(filename) then
response:statusCode(404)
end
stop = self:pluginsProcessFile(request, response, filename)
if stop then
return
end
local file = io.open(filename, 'rb')
if file then
response:writeFile(file, mimetypes.guess(filename or '') or 'text/html')
else
response:statusCode(404)
end
end
if self.callback then
response:statusCode(200)
response.headers = {}
response:addHeader('Content-Type', 'text/html')
self.callback(request, response)
end
if response.status == 404 then
response:writeDefaultErrorMessage(404)
end
end
return Handler
| mit |
bmscoordinators/FFXI-Server | scripts/zones/Windurst_Woods/npcs/Lih_Pituu.lua | 53 | 1893 | -----------------------------------
-- Area: Windurst Woods
-- NPC: Lih Pituu
-- Type: Bonecraft Adv. Image Support
-- @pos -5.471 -6.25 -141.211 241
-----------------------------------
package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Windurst_Woods/TextIDs");
require("scripts/globals/status");
require("scripts/globals/crafting");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local guildMember = isGuildMember(player,2);
local SkillLevel = player:getSkillLevel(SKILL_BONECRAFT);
local Cost = getAdvImageSupportCost(player,SKILL_BONECRAFT);
if (guildMember == 1) then
if (player:hasStatusEffect(EFFECT_BONECRAFT_IMAGERY) == false) then
player:startEvent(0x2722,Cost,SkillLevel,0,511,player:getGil(),0,7028,0);
else
player:startEvent(0x2722,Cost,SkillLevel,0,511,player:getGil(),28753,3967,0);
end
else
player:startEvent(0x2722); -- Standard Dialogue
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
local Cost = getAdvImageSupportCost(player,4);
if (csid == 0x2722 and option == 1) then
player:delGil(Cost);
player:messageSpecial(IMAGE_SUPPORT,0,6,0);
player:addStatusEffect(EFFECT_BONECRAFT_IMAGERY,3,0,480);
end
end; | gpl-3.0 |
wingo/snabb | src/program/packetblaster/replay/replay.lua | 14 | 1568 | -- Use of this source code is governed by the Apache 2.0 license; see COPYING.
module(..., package.seeall)
local config = require("core.config")
local basic_apps = require("apps.basic.basic_apps")
local main = require("core.main")
local PcapReader = require("apps.pcap.pcap").PcapReader
local lib = require("core.lib")
local packetblaster = require("program.packetblaster.packetblaster")
local long_opts = {
duration = "D",
help = "h",
["no-loop"] = 0,
}
local function show_usage (code)
print(require("program.packetblaster.replay.README_inc"))
main.exit(code)
end
function run (args)
local c = config.new()
local handlers = {}
local opts = { loop = true }
function handlers.D (arg)
opts.duration = assert(tonumber(arg), "duration is not a number!")
end
function handlers.h ()
show_usage(0)
end
handlers["no-loop"] = function ()
opts.loop = false
end
args = lib.dogetopt(args, handlers, "hD:", long_opts)
if #args < 2 then show_usage(1) end
local filename = table.remove(args, 1)
print (string.format("filename=%s", filename))
config.app(c, "pcap", PcapReader, filename)
config.app(c, "source", basic_apps.Tee)
if opts.loop then
config.app(c, "loop", basic_apps.Repeater)
config.link(c, "pcap.output -> loop.input")
config.link(c, "loop.output -> source.input")
else
config.link(c, "pcap.output -> source.input")
if not opts.duration then opts.duration = 1 end
end
packetblaster.run_loadgen(c, args, opts)
end
| apache-2.0 |
XtBot/xt | plugins/Bye.lua | 9 | 2319 | do
local function run(msg, matches, callback, extra)
local data = load_data(_config.moderation.data)
local rules = data[tostring(msg.to.id)]['rules']
local about = data[tostring(msg.to.id)]['description']
local hash = 'group:'..msg.to.id
local group_bye = redis:hget(hash,'bye')
if matches[1] == 'delbye' and not matches[2] and is_owner(msg) then
redis:hdel(hash,'welcome')
return 'متن خداحافظی پاک شد'
end
local url , res = http.request('http://api.gpmod.ir/time/')
if res ~= 200 then return "No connection" end
local jdat = json:decode(url)
if matches[1] == 'setbye' and is_owner(msg) then
redis:hset(hash,'bye',matches[2])
return 'متن خداحافظی تغییر یافت به : \n'..matches[2]
end
if matches[1] == 'chat_del_user' and msg.service then
group_bye = string.gsub(group_bye, '{gpname}', msg.to.title)
group_bye = string.gsub(group_bye, '{firstname}', ""..(msg.action.user.first_name or '').."")
group_bye = string.gsub(group_bye, '{lastname}', ""..(msg.action.user.last_name or '').."")
group_bye = string.gsub(group_bye, '{username}', "@"..(msg.action.user.username or '').."")
group_bye = string.gsub(group_bye, '{fatime}', ""..(jdat.FAtime).."")
group_bye = string.gsub(group_bye, '{entime}', ""..(jdat.ENtime).."")
group_bye = string.gsub(group_bye, '{fadate}', ""..(jdat.FAdate).."")
group_bye = string.gsub(group_bye, '{endate}', ""..(jdat.ENdate).."")
group_bye = string.gsub(group_bye, '{نام گروه}', msg.to.title)
group_bye = string.gsub(group_bye, '{نام اول}', ""..(msg.action.user.first_name or '').."")
group_bye = string.gsub(group_bye, '{نام آخر}', ""..(msg.action.user.last_name or '').."")
group_bye = string.gsub(group_bye, '{نام کاربری}', "@"..(msg.action.user.username or '').."")
group_bye = string.gsub(group_bye, '{ساعت فارسی}', ""..(jdat.FAtime).."")
group_bye = string.gsub(group_bye, '{ساعت انگلیسی}', ""..(jdat.ENtime).."")
group_bye = string.gsub(group_bye, '{تاریخ فارسی}', ""..(jdat.FAdate).."")
group_bye = string.gsub(group_bye, '{تاریخ انگلیسی}', ""..(jdat.ENdate).."")
end
return group_bye
end
return {
patterns = {
"^[!#/](setbye) +(.*)$",
"^[!#/](delbye)$",
"^!!tgservice (chat_del_user)$",
},
run = run
}
end
| gpl-2.0 |
Xeio/KuralakRefiled | KuralakRefiled.lua | 1 | 15821 | require "Window"
-----------------------------------------------------------------------------------------------
-- KuralakRefiled Module Definition
-----------------------------------------------------------------------------------------------
local KuralakRefiled = {}
-----------------------------------------------------------------------------------------------
-- Constants
-----------------------------------------------------------------------------------------------
local CONST_DISTANCE = 7
local SIZE = 5
local DEBUG = true
local DISABLED = false
local TIMER_EGG = .2
local EGG_DEBUFF = "Chromosome Corruption"
local KURALAK = "Kuralak the Defiler"
local GAZone = false
local kuralakFight = false
local playerList = {}
local STR_KURALAK_HEADER = "Kuralak Order List:"
-----------------------------------------------------------------------------------------------
-- Initialization
-----------------------------------------------------------------------------------------------
function KuralakRefiled:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function KuralakRefiled:Init()
Apollo.RegisterAddon(self, false, "", {"Gemini:Logging-1.2"})
end
-----------------------------------------------------------------------------------------------
-- KuralakRefiled OnLoad
-----------------------------------------------------------------------------------------------
function KuralakRefiled:OnLoad()
if DISABLED then return end
self.xmlDoc = XmlDoc.CreateFromFile("KuralakRefiled.xml")
self.xmlDoc:RegisterCallback("OnDocLoaded", self)
self.playerList = PlayerList:new()
self.combatList = {}
local GeminiLogging = Apollo.GetPackage("Gemini:Logging-1.2").tPackage
self.log = GeminiLogging:GetLogger({
--level = GeminiLogging.INFO,
level = GeminiLogging.ERROR,
appender = "GeminiConsole"
})
end
-----------------------------------------------------------------------------------------------
-- KuralakRefiled OnDocLoaded
-----------------------------------------------------------------------------------------------
function KuralakRefiled:OnDocLoaded()
if self.xmlDoc ~= nil and self.xmlDoc:IsLoaded() then
self.optionsPanel = Apollo.LoadForm(self.xmlDoc, "KuralakRefiledForm", nil, self)
if self.optionsPanel == nil then
Apollo.AddAddonErrorText(self, "Could not load the main window.")
return
end
self.optionsPanel:Show(false, true)
self.renderTarget = Apollo.LoadForm(self.xmlDoc, "RenderTarget", nil, self)
if self.optionsPanel == nil then
Apollo.AddAddonErrorText(self, "Could not load the render target window.")
return
end
self.renderTarget:Show(true, true)
Apollo.RegisterSlashCommand("kuralak", "LoadForm", self)
self.zoneCheckTimer = ApolloTimer.Create(5, true, "ZoneCheckTimer", self)
-- Apollo.RegisterHandler("NextFrame", "FrameTick", self)
Apollo.RegisterEventHandler("UnitEnteredCombat", "OnUnitEnteredCombat", self)
Apollo.RegisterEventHandler("Group_Updated", "GroupUpdate", self)
Apollo.RegisterEventHandler("Group_Join", "GroupUpdate", self)
Apollo.RegisterEventHandler("Group_Left", "GroupUpdate", self)
Apollo.RegisterEventHandler("Group_Add","GroupUpdate", self)
Apollo.RegisterEventHandler("Group_Remove", "GroupUpdate", self)
Apollo.RegisterEventHandler("Group_MemberFlagsChanged", "GroupUpdate", self)
Apollo.RegisterEventHandler("ChatMessage", "OnChatMessage", self)
end
end
function KuralakRefiled:OnSave(level)
if level ~= GameLib.CodeEnumAddonSaveLevel.Realm then
return nil
end
local save = {
savedPlayers = self.playerList.savedMasterList
}
return save
end
function KuralakRefiled:OnRestore(level, data)
if level ~= GameLib.CodeEnumAddonSaveLevel.Realm then
return
end
self.playerList.savedMasterList = data.savedPlayers or {}
end
-----------------------------------------------------------------------------------------------
-- KuralakRefiled Functions
-----------------------------------------------------------------------------------------------
-- Define general functions here
function KuralakRefiled:FrameTick()
self.renderTarget:DestroyAllPixies()
--draw/update thingsssss
-- playerUnit = GameLib.GetPlayerUnit()
-- self:DrawPoint(self:GetQuadrant(playerUnit, 1))
end
function KuralakRefiled:DrawPoint(position)
screenPos = GameLib.WorldLocToScreenPoint(position)
self.renderTarget:AddPixie({
strSprite = "BasicSprites:WhiteCircle",
loc = {fPoints = {0, 0, 0, 0}, nOffsets = {screenPos.x - SIZE, screenPos.y - SIZE, screenPos.x + SIZE, screenPos.y + SIZE}}
})
end
function KuralakRefiled:DrawLine(position, target)
screenPos1 = GameLib.WorldLocToScreenPoint(position)
screenPos2 = GameLib.WorldLocToScreenPoint(target)
self.renderTarget:AddPixie({
bLine = true,
loc = {fPoints = {0, 0, 0, 0}, nOffsets = {screenPos1.x, screenPos1.y, screenPos2.x, screenPos2.y}}
})
end
function KuralakRefiled:GetQuadrant(unit, direction)
p = Vector3.New(unit:GetPosition())
v = Vector3.New(unit:GetFacing()) * CONST_DISTANCE
forward = v
left = Vector3.New(v.z, v.y, -v.x) --Y is vertical pos
if direction == 1 then --Front
return p + forward
elseif direction == 2 then --Back
return p - forward
elseif direction == 3 then --Left
return p + left
elseif direction == 4 then --Right
return p - left
elseif direction == 5 then --Front Left
return p + forward + left
elseif direction == 6 then --Front Right
return p + forward - left
elseif direction == 7 then --Back Left
return p - forward + left
elseif direction == 8 then --Back Right
return p - forward - left
end
end
function KuralakRefiled:OnUnitEnteredCombat(unit, inCombat)
if self.GAZone then
if inCombat then
if unit:GetName() == KURALAK then
self:BeginFight()
end
else
player = GameLib.GetPlayerUnit()
if player == nil or player:GetName() == unit:GetName() then
self:EndFight()
end
end
end
end
function KuralakRefiled:BeginFight()
self:BuildFightInfo()
if not self.eggTimer then
self.eggTimer = ApolloTimer.Create(TIMER_EGG, true, "EggTimer", self)
end
self.log:info("Kuralak fight begin")
self.kuralakFight = true
self.eggTimer:Start()
end
function KuralakRefiled:BuildFightInfo()
self.mysteryEggIndex = 0
self.combatList = {}
self.newDeaths = {}
self.newEggs = {}
for p=1,#self.playerList.players do
playerGroupIndex = self:GetGroupIndex(self.playerList.players[p])
tankFlag = GroupLib.GetGroupMember(playerGroupIndex).bTank
combatItem = {
groupIndex = playerGroupIndex,
name = self.playerList.players[p],
isEgged = false,
mysteryEgg = false,
alive = true,
isTank = tankFlag,
interruptIndex = 0
}
table.insert(self.combatList, combatItem)
end
end
function KuralakRefiled:EggCount()
count = 0
for i=1,#self.combatList do
if self.combatList[i].isEgged and self.combatList[i].alive then
count = count + 1
end
end
return count
end
function KuralakRefiled:GetGroupIndex(name)
memberCount = GroupLib.GetMemberCount()
for i=1,memberCount do
if GroupLib.GetGroupMember(i).strCharacterName == name then
return i
end
end
end
function KuralakRefiled:EndFight()
if self.eggTimer then
self.eggTimer:Stop()
end
if self.kuralakFight then
self.log:info("Kuralak fight ended")
end
self.kuralakFight = false
end
function KuralakRefiled:EggTimer()
if not GameLib.GetPlayerUnit():IsInCombat() then
self:EndFight()
return
end
self:CheckGroupStatus()
if #self.newEggs > 0 or self.newDeaths > 0 then
self:UpdateMysterEggIndex()
end
end
function KuralakRefiled:CheckGroupStatus()
for i=1,#self.combatList do
combatPlayer = self.combatList[i]
if combatPlayer.alive then
unit = GroupLib.GetUnitForGroupMember(combatPlayer.groupIndex)
if unit ~= nil then
if unit:IsDead() then
self.log:info("New dead player: " .. combatPlayer.name)
combatPlayer.alive = false
newDeaths = true
table.insert(self.newDeaths, i)
elseif not combatPlayer.isEgged then
if self:IsEgged(unit) then
self.log:info("New egg found: " .. combatPlayer.name)
newEggs = true
combatPlayer.isEgged = true
table.insert(self.newEggs, i)
end
end
end
end
end
end
function KuralakRefiled:UpdateMysterEggIndex()
if self.mysteryEggIndex == 0 then
for i=#self.combatList,1,-1 do
if self.combatList[i].isEgged then
self.mysteryEggIndex = i
self.combatList[i].mysteryEgg = true
self.log:info("Mystery egg: " .. self.combatList[i].name)
end
end
end
end
function KuralakRefiled:AssignPlayer(index)
end
function KuralakRefiled:IsEgged(unit)
--unit = GroupLib.GetUnitForGroupMember(groupIndex)
if unit then
badBuffs = unit:GetBuffs().arHarmful
for i=1,#badBuffs do
if badBuffs[i].splEffect:GetName() == EGG_DEBUFF then
return true
end
end
end
return false
end
function KuralakRefiled:ZoneCheckTimer()
zone = GameLib.GetCurrentZoneMap()
if zone and zone.strName == "Genetic Archives - Act 1" then
if not self.GAZone then
self.log:info("GA Floor 1 detected, addon active")
end
self.GAZone = true
else
self.GAZone = false
self:EndFight()
end
end
function KuralakRefiled:GroupUpdate()
if #self.playerList ~= GroupLib.GetMemberCount() then
--Dirty player list
--self.playerList:UpdateGroupMembers()
end
end
function KuralakRefiled:OnChatMessage(channel, message)
if self.recievedStrings == nil then
self.recievedStrings = {}
end
if channel:GetType() ~= ChatSystemLib.ChatChannel_Party then
return
end
local player = GameLib.GetPlayerUnit()
if player and player:GetName() == message.strSender then
return
end
if #message.arMessageSegments > 1 then
--Drop these, all the add-on messages should be one segment
return
end
if message.arMessageSegments[1].strText == STR_KURALAK_HEADER then
--Hey look, we see the start of an add-on message
self.recievingPlayerName = message.strSender
self.recievedStrings = {}
self.log:info("Found message start: " .. self.recievingPlayerName)
return
end
if not self.recievingPlayerName then
--Haven't found any kurlak message to parse yet
return
end
if message.strSender == self.recievingPlayerName then
local strMessage = message.arMessageSegments[1].strText
if string.match(strMessage, " %-> ") or
string.match(strMessage, "Spare:") then
table.insert(self.recievedStrings, strMessage)
elseif string.match(strMessage, "Egg") then
--Do nothing, we don't care about the egg lines, but they're still part of the chat spam
else
--The message appears to have ended, cancel trying to parse
self.recievingPlayerName = nil
end
end
if #self.recievedStrings == GroupLib.GetMemberCount() then
self.log:info("Enough messages detected, parsing")
self:ParseMessages()
self.recievingPlayerName = nil
self.recievedStrings = {}
end
end
function KuralakRefiled:ParseMessages()
local newPlayerList = {}
for i=1,#self.recievedStrings do
local newPlayer = ""
local line = self.recievedStrings[i]
local splitIndex = string.find(line, " %-> ")
if splitIndex then
newPlayer = string.sub(line, 1, splitIndex - 1)
elseif string.match(line, "Spare:") then
newPlayer = string.sub(line, 8)
end
if newPlayer ~= "" then
self.log:info("Parsed line, player: [" .. newPlayer .. "]")
table.insert(newPlayerList, string.sub(line, 7))
else
self.log:error("Bad line: " .. line)
return
end
end
self.playerList.players = newPlayerList
self.playerList:UpdateSavedListFromPlayers()
end
-----------------------------------------------------------------------------------------------
-- KuralakRefiledForm Functions
-----------------------------------------------------------------------------------------------
function KuralakRefiled:OnOK()
self.playerList:UpdateSavedListFromPlayers()
self:RefreshPlayerList()
end
function KuralakRefiled:OnCancel()
self.playerList:UpdateGroupMembers()
self.optionsPanel:Close() -- hide the window
end
function KuralakRefiled:LoadForm()
self.playerList:UpdateGroupMembers()
self:RefreshPlayerList()
self.optionsPanel:Invoke() -- show the window
end
function KuralakRefiled:RefreshPlayerList()
self.optionsPanel:FindChild("PlayersList"):DestroyChildren()
self:BuildGroupMembers()
end
function KuralakRefiled:BuildGroupMembers()
for i=1,#self.playerList.players do
if i == 1 then
self:AddTextRow(1 .. "Egg")
elseif i == 2 then
self:AddTextRow(2 .. "Eggs")
elseif i == 4 then
self:AddTextRow(4 .. "Eggs")
elseif i == 8 then
self:AddTextRow(8 .. "Eggs")
elseif i == 16 then
self:AddTextRow("Spares")
end
self:AddPlayerToForm(self.playerList.players[i])
end
window = self.optionsPanel:FindChild("PlayersList")
window:ArrangeChildrenVert(0)
end
function KuralakRefiled:AddPlayerToForm(playerName)
window = self.optionsPanel:FindChild("PlayersList")
playerItem = Apollo.LoadForm(self.xmlDoc, "PlayerItem", window, self)
playerItem:FindChild("PlayerName"):SetText(playerName)
playerItem:SetData(playerName)
end
function KuralakRefiled:AddTextRow(text)
window = self.optionsPanel:FindChild("PlayersList")
playerItem = Apollo.LoadForm(self.xmlDoc, "EggItem", window, self)
playerItem:FindChild("EggText"):SetText(text)
end
function KuralakRefiled:OnMovePlayerUpClicked(someWindow, button)
--What exactly is that first parameter...?
playerName = button:GetParent():GetData()
self.playerList:MovePlayerUp(playerName)
self:RefreshPlayerList()
end
function KuralakRefiled:OnMovePlayerDownClicked(someWindow, button)
--What exactly is that first parameter...?
playerName = button:GetParent():GetData()
self.playerList:MovePlayerDown(playerName)
self:RefreshPlayerList()
end
function KuralakRefiled:OnSendToPartyClick(wndHandler, wndControl, eMouseButton)
self.playerList:UpdateSavedListFromPlayers()
self:RefreshPlayerList()
self:SendChatMessage(STR_KURALAK_HEADER)
self:SendChatMessage("1 Egg")
self:SendEggInterrupt(1, 0)
self:SendChatMessage("2 Egg")
self:SendEggInterrupt(2, 0)
self:SendEggInterrupt(3, 1)
self:SendChatMessage("4 Egg")
self:SendEggInterrupt(4, 0)
self:SendEggInterrupt(5, 1)
self:SendEggInterrupt(6, 2)
self:SendEggInterrupt(7, 3)
self:SendChatMessage("8 Egg")
self:SendEggInterrupt(8, 0)
self:SendEggInterrupt(9, 1)
self:SendEggInterrupt(10, 2)
self:SendEggInterrupt(11, 3)
self:SendEggInterrupt(12, 4)
self:SendEggInterrupt(13, 5)
self:SendEggInterrupt(14, 6)
self:SendEggInterrupt(15, 7)
for i=16,#self.playerList.players do
self:SendChatMessage("Spare: " .. self.playerList.players[i])
end
end
function KuralakRefiled:SendEggInterrupt(player1, player2, prepend)
if player1 > #self.playerList.players then
return
end
playerName = ""
if player2 == 0 then
if self.kuralakFight and self.mysteryEggIndex > 0 then
playerName = self.playerList.players[self.mysteryEggIndex] .. " [Random Egg]"
else
playerName = "[Mystery Egg]"
end
else
playerName = self.playerList.players[player2]
end
prepend = prepend or ""
self:SendChatMessage(prepend .. self.playerList.players[player1] .. " -> " .. playerName)
end
function KuralakRefiled:SendChatMessage(message)
ChatSystemLib.Command("/p " .. message)
end
function KuralakRefiled:PrintCombatReplacementsChecked(wndHandler, wndControl, eMouseButton)
self.printCombatReplacements = true
end
function KuralakRefiled:PrintCombatReplacementsUnchecked( wndHandler, wndControl, eMouseButton )
self.printCombatReplacements = false
end
-----------------------------------------------------------------------------------------------
-- KuralakRefiled Instance
-----------------------------------------------------------------------------------------------
local KuralakRefiledInst = KuralakRefiled:new()
KuralakRefiledInst:Init()
| bsd-2-clause |
accorp/lua-5.1-stuff | prosody/mod_plain.lua | 1 | 1105 | --[[
plain_from = <jid>
plain_listen = {
[<port>] = <jid>,
[<port>] = {<jid>, <jid>},
}
]]
module:set_global()
local from = module:get_option("plain_from", "plain")
local listen = module:get_option("plain_listen", {})
local function send(msg, to, ...)
if not to then
return
end
prosody.core_post_stanza(
module.host,
stanza.message({type = "chat", from = from, to = to}, msg)
)
return send(msg, ...)
end
local listener =
{
default_mode = "*a",
default_interface = "*",
onconnect = function (conn)
conn.plain_session =
{
("FROM: %s:%s\n"):format(conn:ip(), conn:clientport()),
}
end,
onincoming = function (conn, data)
return table.insert(conn.plain_session, data)
end,
ondisconnect = function (conn)
local data = table.concat(conn.plain_session):match("^(.-)%s*$")
conn.plain_session = nil
return send(data, unpack(listen[conn:serverport()]))
end,
}
for port, jid in pairs(listen) do
if type(jid) ~= "table" then
listen[port] = {jid}
end
module:provides("net", {
name = "plain_" .. port,
listener = listener,
default_port = port,
})
end
| unlicense |
NetEase/openlua | src/analyse.lua | 2 | 15047 | --[[±¾³ÌÐò·ÖÎöLua5.0ËùÓеIJúÉúʽ£¬ÕÒ³öÒýÆðÖ±½ÓÓë¼ä½Ó×óµÝ¹éµÄ·ÇÖÕ½á·û--]]
require("common.lua")
require("set.lua")
require("list.lua")
require("prototype.lua")
--[[----------------------------------------------------------
-- helper functions
----------------------------------------------------------]]--
-- str: ´ýËÑË÷µÄ×Ö·û´®
-- start: ËÑË÷µÄÆðʼλÖÃ(´Ó1¿ªÊ¼¼ÆËã)
-- ²»¶¨²ÎÊý: ËÑË÷ʱÓõ½µÄÆ¥Åäģʽ
-- º¯ÊýÒÀ´Î¸ù¾Ýÿ¸öģʽ´ÓstartλÖÿªÊ¼ËÑË÷str£¬·µ»Ø×îÏÈÆ¥ÅäµÄģʽÐòºÅÒÔ¼°
-- Æ¥ÅäµÄ×Ó×Ö·û´®µÄÆðʼÓëÖÕ½áλÖã¬Èç¹ûÖ¸¶¨ÁËcapture»á·µ»ØÏàÓ¦µÄsubstring
local function SearchByOr(str,start,...)
local result
for i = 1,arg.n do
result = pack(string.find(str,arg[i],start))
if nil ~= result[1] then
--¸ù¾ÝµÚn¸öpatternÕÒµ½ÁËÆ¥ÅäµÄ×Ó×Ö·û´®
return i,unpack(result)
end
end
--ËùÓеÄpattern¶¼ÎÞ·¨³É¹¦Æ¥Åä
return nil
end
--[[----------------------------------------------------------
-- helper functions end
--]]----------------------------------------------------------
--[[----------------------------------------------------------
internal functions
--]]----------------------------------------------------------
local function CreateRightside(rsStr)
if 0 == string.len(rsStr) then
error("Production's rightside string can't be empty!")
end
local rs = Rightside{}
local nextPos = 1,symbol,patIndex
local rsStrLen = string.len(rsStr)
local allSymbols = Set{}
while nextPos <= rsStrLen do
patIndex, _,nextPos,symbol =
SearchByOr(
rsStr,nextPos,
"^%s*([_%a][_%w]*)",
"^%s*(%b'')")
if 1 == patIndex then
rs:Append(symbol)
allSymbols:Add(symbol)
elseif 2 == patIndex then
symbol = string.sub(symbol,2,-2)
rs:Append(symbol)
allSymbols:Add(symbol)
else
-- error : invalid format
return nil
end
nextPos = nextPos + 1
end
return rs,allSymbols
end
-- ¸ù¾Ýµ±Ç°ÒѾ¼ÆËãºÃµÄFirstº¯Êý¼¯ºÏ:firstset
-- À´¼ÆËãÓï·¨·ûºÅsymbolеÄFirst;
-- ½á¹û±£´æÔÚfirstsetÖС£
-- Èç¹ûÔÚ¼ÆËã¹ý³ÌÖÐfirstset¸Ä±äÁË£¬
-- Ôò·µ»Øtrue£¬·ñÔò·µ»Øfalse
local function EvaluateFirstOfSymbol(symbol,productions,firstset)
if nil == firstset[symbol] then
firstset[symbol] = Set{}
end
local rightsides = productions[symbol]
if nil == rightsides then
--symbolÊÇÖÕ½á·û
if firstset[symbol]:Empty() then
return firstset[symbol]:Add(symbol)
end
return false
end
local bChanged = false
for rightside in rightsides:Traverse() do
local bCanBeEmpty = true
for _,leftmost in rightside:Traverse() do
if nil ~= firstset[leftmost] then
bChanged = firstset[symbol]:Union(firstset[leftmost]
- Set{"empty"})
or bChanged
if not firstset[leftmost]:Contains("empty") then
bCanBeEmpty = false
break
end
else
bCanBeEmpty = false
break
end
end
if bCanBeEmpty then
-- righsideÖÐËùÓзûºÅµÄfirst¼¯ºÏÖж¼ÓÐ "empty"£¬
-- ÄÇôÔÚsymbolµÄfirst¼¯ºÏÖÐÒ²Òª¼ÓÈë"empty"
bChanged = firstset[symbol]:Add("empty")
or bChanged
end
end
return bChanged
end
local function EvaluateFirst(syntax)
local firstset = syntax.firstset or {}
local allsymbols = syntax.nonterminals + syntax.terminals
local productions = syntax.productions
local bChanged = true
while bChanged do
bChanged = false
for symbol in allsymbols:Traverse() do
bChanged =
EvaluateFirstOfSymbol(symbol,productions,firstset)
or bChanged
end
end
return firstset
end
local function EvaluateFollowOnePass(syntax,followset)
local productions = syntax.productions
local firstset = syntax.firstset
local bChanged = false
for nonterminal,rightsides in pairs(productions) do
followset[nonterminal] =
followset[nonterminal] or Set{}
if nonterminal == syntax.start then
--nonterminalÊÇÆðʼ·û
bChanged = followset[nonterminal]:Add("eof")
or bChanged
end
for rightside in rightsides:Traverse() do
for i,symbol in rightside:Traverse() do
if nil ~= productions[symbol] then
--symbolÊÇ·ÇÖÕ½á·û
followset[symbol] =
followset[symbol] or Set{}
local tailset =
GetLeadingsOfRightside(rightside:Sub(i + 1),firstset)
bChanged = followset[symbol]:Union(tailset - Set{"empty"})
or bChanged
if tailset:Contains("empty") then
bChanged = followset[symbol]:Union(followset[nonterminal])
or bChanged
end
end
end
end
end
return bChanged
end
local function EvaluateFollow(syntax)
local firstset = syntax.firstset
local followset = syntax.followset or {}
local bChanged = true
while bChanged do
bChanged = false
bChanged = EvaluateFollowOnePass(syntax,followset)
or bChanged
end
return followset
end
local function GetSelect(nonterminal,rs,firstset,followset)
local select = GetLeadingsOfRightside(rs,firstset)
if select:Contains("empty") then
select:Union(followset[nonterminal])
end
return select
end
local function AnalyseProductions(stream)
local all_symbols = Set{}
local all_nts = Set{}
local productions = {}
local syntax = {}
syntax.productions = productions
syntax.nonterminals = all_nts
local nonterminal
for line in stream:lines() do
local _,ls_end,ls_str = string.find(line,"^%s*([_%a][_%w]*)%s*:")
if nil ~= ls_str then
-- Óöµ½Ò»¸öеķÇÖÕ½á·û
nonterminal = ls_str
syntax.start = syntax.start or nonterminal
all_nts:Add(nonterminal)
productions[nonterminal] =
productions[nonterminal] or Set{}
end
local rs_beg,rs_end,rs_str
if nil ~= ls_end then
rs_beg = ls_end + 1
else
rs_beg = 1
end
rs_beg,rs_end,rs_str = string.find(line,"%s*([^|]*[^|%s])",rs_beg + 1)
while rs_beg ~= nil do
if not IsSpaceStr(rs_str) then
--ÕÒµ½Ò»¸öеÄÓÒ²¿
local rs,symbols = CreateRightside (rs_str)
if nil == rs then
-- ²»·ûºÏ¸ñʽҪÇóµÄÓï·¨¶¨Òå
return nil
end
all_symbols:Union(symbols)
productions[nonterminal]:Add(rs)
end
rs_beg,rs_end,rs_str = string.find(line,"%s*([^|]*[^|%s])",rs_end + 1)
end
end
syntax.terminals = all_symbols - all_nts
return syntax
end
-- ¼ÆËãÒ»¸öitem¼¯ºÏµÄ±Õ°ü
local function Closure(syntax,items)
local res = Set{}
local productions = syntax.productions
res:Union(items)
local newitems = res
local bChanged = true
while bChanged do
bChanged = false
local temp = Set{}
for item in newitems:Traverse() do
local symbol = item:NextSymbol()
if symbol and productions[symbol] then
--symbolÊÇÒ»¸ö·ÇÖÕ½á·û
local rightsides = productions[symbol]
for rs in rightsides:Traverse() do
temp:Add(Item.New(symbol,rs))
end
end
end
newitems = temp
bChanged = res:Union(newitems) or bChanged
end
return res
end
local function Goto(syntax,items,symbol)
local temp = Set{}
for item in items:Traverse() do
local newitem = item:Goto(symbol)
if newitem then
temp:Add(newitem)
end
end
return Closure(syntax,temp)
end
-- ¼ÆËãsyntaxµÄ×ʼµÄitem¼¯ºÏ±Õ°ü
local function InitialItems(syntax)
local start = syntax.start
local rightsides = syntax.productions[start]
local items = Set{}
for rs in rightsides:Traverse() do
items:Add(Item.New(start,rs))
end
return Closure(syntax,items)
end
-- ·µ»ØÒ»¸öitem¼¯ºÏµÄËùÓеÄnext·ûºÅ
local function NextSymbols(items)
local res = Set{}
for item in items:Traverse() do
res:Add(item:NextSymbol())
end
return res
end
--[[----------------------------------------------------------
-- internal functions end
--]]----------------------------------------------------------
function GetLeadingsOfRightside(rs,firstset)
local res = Set{"empty"}
for _,symbol in rs:Traverse() do
res:Union(firstset[symbol])
if not firstset[symbol]:Contains("empty") then
res:Remove("empty")
break
end
end
return res
end
function AnalyseSyntax(stream,basicFirstset,basicFollowset)
local syntax = AnalyseProductions(stream)
if nil == syntax then
return nil
end
syntax.firstset = basicFirstset
syntax.followset = basicFollowset
syntax.firstset = EvaluateFirst(syntax)
syntax.followset = EvaluateFollow(syntax)
return syntax
end
-- ·µ»ØËùÓÐselect¼¯ºÏÓгåÍ»µÄ²úÉúʽ;
-- Èç¹ûsyntaxÊÇLL1Óï·¨£¬Ôò²»»áÓгåÍ»
function get_ll_conflict(syntax)
local productions = syntax.productions
local firstset = syntax.firstset
local followset = syntax.followset
local conflict = List{}
for nonterminal,rightsides in pairs(productions) do
for rs1 in rightsides:Traverse() do
local select1 = GetSelect(nonterminal,
rs1,
firstset,
followset)
for rs2 in rightsides:Traverse() do
if rs1 ~= rs2 then
local select2 = GetSelect(nonterminal,
rs2,
firstset,
followset)
local intersect = (select1 * select2)
if not intersect:Empty() then
conflict:Append(List{nonterminal,rs1,rs2,intersect})
end
end
end
end
end
if conflict:Empty() then
return nil
end
return conflict
end
-- ¸Ãº¯Êý¼ÆËãsyntaxµÄSLR½âÎö±í, ÿ¸öentryÓü¯ºÏÀ´±£´æ£¬
-- Òò´Ë¼´Ê¹ÓгåͻҲ»á°ÑÕû¸ö±í¼ÆËãÍê¡£
-- ·µ»ØÖµ1±êÃ÷syntaxÊÇ·ñΪSLRÓï·¨
-- ·µ»ØÖµ2ÔòÊǸÃsyntaxµÄSLR½âÎö±í
function EvaluateSlr(syntax)
local collection = List{}
collection:Append(InitialItems(syntax))
local bChanged = true
local res = true --
local old_count = 0
local newcollection = collection
local pt = ParseTable.New()
local followset = syntax.followset
-- ¿ªÊ¼½âÎöij¸ösymbolʱһ¸öºÏ·¨µÄ³ö·¢(³õʼ)״̬
local initialStates = {}
while bChanged do
bChanged = false
local temp = List{}
for i,items in newcollection:Traverse() do
-- µ±Ç°ÕýÔÚ´¦ÀíµÄitemsÔÚcollectionÖеÄÈ·ÇÐλÖÃÊÇi + old_count
local items_pos = i + old_count
for item in items:Traverse() do
local next_symbol = item:NextSymbol()
if next_symbol then
local goto_items = Goto(syntax,items,next_symbol)
--¼ÆËãgoto_itemsÔÚcollectionÖеÄλÖÃ
local goto_pos =
collection:Find(goto_items)
if nil == goto_pos then
-- Èç¹ûgoto_itemsÔÚcollectionÖв»´æÔÚ,
-- Ôò¼ÌÐøÔÚtempÖÐѰÕÒ
local temp_pos = temp:Find(goto_items)
if nil == temp_pos then
-- goto_itemsÔÚtempÖÐÒ²²»´æÔÚ
-- Ôò½«ÆäÌí¼Ó½øtemp
temp:Append(goto_items)
temp_pos = temp:Count()
end
-- ¼ÆËãgoto_itemsÔÚcollectionÖеÄÈ·ÇÐλÖÃ
goto_pos = temp_pos + collection:Count()
end
pt:Add(items_pos,next_symbol,goto_pos)
--
initialStates[next_symbol] =
initialStates[next_symbol] or items_pos
if 1 < pt:Get(items_pos,next_symbol):Count() then
res = false
end
else -- if next_symbol then
local ls = item:GetLeftside()
if ls == syntax.start then
-- slr±íÖÐ(start·ûºÅ,"eof")¶ÔÓ¦µÄÏîÓëÁúÊéÃèÊöµÄ
-- ²»Ì«Ò»Ñù£¬ÕâÊÇÒòΪopneluaµÄ±àÒëÐÐΪÓÐÒ»µãÌØÊâ¡£
pt:Add(items_pos,"eof",item:GetProduction())
initialStates["eof"] =
initialStates["eof"] or items_pos
if 1 < pt:Get(items_pos,"eof"):Count() then
res = false
end
else
local follow = followset[ls]
for terminal in follow:Traverse() do
pt:Add(items_pos,terminal,item:GetProduction())
initialStates[terminal] =
initialStates[terminal] or items_pos
if 1 < pt:Get(items_pos,terminal):Count() then
res = false
end
end
end
end -- if next_symbol then
end
end
if not temp:Empty() then
bChanged = true
newcollection = temp
old_count = collection:Count()
collection = collection..newcollection
end
end
-- Õë¶Ôstart·ûºÅµÄÒ»¸öÌØÊâµÄÏî
pt:Add(1,syntax.start,0)
initialStates[syntax.start] =
initialStates[syntax.start] or 1
return res,pt,initialStates
end
-- ¸Ãº¯Êý¼ÆËãsyntaxµÄÑϸñSLR½âÎö±í, ÿ¸öentry²»ÔÊÐíÓгåÍ»¡£
-- ·µ»ØÖµ1±êÃ÷syntaxÊÇ·ñΪSLRÓï·¨£¬Èç¹û·µ»ØÖµÎªtrueʱ½«»áÓеڶþ¸ö·µ»ØÖµ
-- ·µ»ØÖµ2ÔòÊǸÃsyntaxµÄSLR½âÎö±í
function EvaluateStrictSlr(syntax)
local collection = List{}
collection:Append(InitialItems(syntax))
local bChanged = true
local old_count = 0
local newcollection = collection
local slr = {}
local followset = syntax.followset
while bChanged do
bChanged = false
local temp = List{}
for i,items in newcollection:Traverse() do
-- µ±Ç°ÕýÔÚ´¦ÀíµÄitemsÔÚcollectionÖеÄÈ·ÇÐλÖÃÊÇi + old_count
local items_pos = i + old_count
for item in items:Traverse() do
local next_symbol = item:NextSymbol()
if next_symbol then
local goto_items = Goto(syntax,items,next_symbol)
--¼ÆËãgoto_itemsÔÚcollectionÖеÄλÖÃ
local goto_pos =
collection:Find(goto_items)
if nil == goto_pos then
-- Èç¹ûgoto_itemsÔÚcollectionÖв»´æÔÚ,
-- Ôò¼ÌÐøÔÚtempÖÐѰÕÒ
local temp_pos = temp:Find(goto_items)
if nil == temp_pos then
-- goto_itemsÔÚtempÖÐÒ²²»´æÔÚ
-- Ôò½«ÆäÌí¼Ó½øtemp
temp:Append(goto_items)
temp_pos = temp:Count()
end
-- ¼ÆËãgoto_itemsÔÚcollectionÖеÄÈ·ÇÐλÖÃ
goto_pos = temp_pos + collection:Count()
end
--slr:Add(items_pos,next_symbol,goto_pos)
slr[items_pos] = slr[items_pos] or {}
if nil ~= slr[items_pos][next_symbol] then
-- ÓгåÍ»£¬±ØÈ»²»ÊÇSLRÓï·¨
return false
end
slr[items_pos][next_symbol] = goto_pos;
else -- if next_symbol then
local ls = item:GetLeftside()
if ls == syntax.start then
slr[items_pos] = slr[items_pos] or {}
if nil ~= slr[items_pos]["eof"] then
-- ÓгåÍ»£¬±ØÈ»²»ÊÇSLRÓï·¨
return false
end
-- slr±íÖÐ(start·ûºÅ,"eof")¶ÔÓ¦µÄÏîÓëÁúÊéÃèÊöµÄ
-- ²»Ì«Ò»Ñù£¬ÕâÊÇÒòΪopneluaµÄ±àÒëÐÐΪÓÐÒ»µãÌØÊâ¡£
slr[items_pos]["eof"] = item:GetProduction()
else
local follow = followset[ls]
for terminal in follow:Traverse() do
slr[items_pos] = slr[items_pos] or {}
if nil ~= slr[items_pos][terminal] then
return false
end
slr[items_pos][terminal] = item:GetProduction()
end
end
end
end
end
if not temp:Empty() then
bChanged = true
newcollection = temp
old_count = collection:Count()
collection = collection..newcollection
end
end
-- Õë¶Ôstart·ûºÅµÄÒ»¸öÌØÊâµÄÏî
slr[1][syntax.start] = 0
return true,slr
end
-- º¯Êý·µ»Ø¸ù¾Ý×Ö·û´®str¼ÆËã³öµÄslr½âÎö±í£¬Èç¹ûstrÖ¸¶¨µÄÓï·¨²»ÊÇSLRÓï·¨£¬
-- Ôò·µ»Ønil¡£´Ëº¯ÊýÖ÷ÒªÌṩ¸øºêµÄ׫дÕßʹÓá£
function ToStrictRule(input)
if "string" == type(input) then
input = IStream.New(input)
end
local syntax = AnalyseSyntax(input)
local bSlr, slr = EvaluateStrictSlr(syntax)
if bSlr then
return slr
end
return nil
end | mit |
bmscoordinators/FFXI-Server | scripts/zones/Port_Windurst/npcs/Tokaka.lua | 17 | 3001 | -----------------------------------
-- Area: Port Windurst
-- NPC: Tokaka
-- Starts & Finishes Repeatable Quest: Something Fishy
-----------------------------------
package.loaded["scripts/zones/Port_Windurst/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/globals/settings");
require("scripts/zones/Port_Windurst/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
TokakaSpokenTo = player:getVar("TokakaSpokenTo");
NeedToZone = player:needToZone();
if (TokakaSpokenTo == 1 and NeedToZone == false) then
count = trade:getItemCount();
BastoreSardine = trade:hasItemQty(4360,1);
if (BastoreSardine == true and count == 1) then
player:startEvent(0x00d2,GIL_RATE*70,4360);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
SomethingFishy = player:getQuestStatus(WINDURST,SOMETHING_FISHY);
if (player:getQuestStatus(WINDURST,BLAST_FROM_THE_PAST) == QUEST_ACCEPTED and player:getVar("BlastFromThePast_Prog") == 0) then
player:startEvent(0x013e);
player:setVar("BlastFromThePast_Prog",1);
elseif (SomethingFishy >= QUEST_ACCEPTED) then
if (player:needToZone()) then
player:startEvent(0x00d3);
else
player:startEvent(0x00d1,0,4360);
end
elseif (SomethingFishy == QUEST_AVAILABLE) then
player:startEvent(0x00d0,0,4360);
elseif (player:getQuestStatus(WINDURST,BLAST_FROM_THE_PAST) == QUEST_ACCEPTED and player:getVar("BlastFromThePast_Prog") == 0) then
player:startEvent(0x013e);
player:setVar("BlastFromThePast_Prog",1);
else
player:startEvent(0x00cf);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID2: %u",csid);
-- printf("RESULT2: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x00d0) then
player:addQuest(WINDURST,SOMETHING_FISHY);
player:setVar("TokakaSpokenTo",1);
elseif (csid == 0x00d2) then
SomethingFishy = player:getQuestStatus(WINDURST,SOMETHING_FISHY);
if (SomethingFishy == QUEST_ACCEPTED) then
player:completeQuest(WINDURST,SOMETHING_FISHY);
player:addFame(WINDURST,60);
else
player:addFame(WINDURST,10);
end
player:tradeComplete();
player:addGil(GIL_RATE*70);
player:setVar("TokakaSpokenTo",0);
player:needToZone(true);
elseif (csid == 0x00d1) then
player:setVar("TokakaSpokenTo",1);
end
end;
| gpl-3.0 |
deepak78/luci | applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua | 11 | 1310 | --[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 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$
]]--
m = Map("ntpclient", translate("Time Synchronisation"), translate("Synchronizes the system time"))
s = m:section(TypedSection, "ntpclient", translate("General"))
s.anonymous = true
s.addremove = false
s:option(DummyValue, "_time", translate("Current system time")).value = os.date("%c")
s:option(Value, "interval", translate("Update interval (in seconds)")).rmempty = true
s:option(Value, "count", translate("Count of time measurements"), translate("empty = infinite")).rmempty = true
s2 = m:section(TypedSection, "ntpdrift", translate("Clock Adjustment"))
s2.anonymous = true
s2.addremove = false
s2:option(Value, "freq", translate("Offset frequency")).rmempty = true
s3 = m:section(TypedSection, "ntpserver", translate("Time Servers"))
s3.anonymous = true
s3.addremove = true
s3.template = "cbi/tblsection"
s3:option(Value, "hostname", translate("Hostname"))
s3:option(Value, "port", translate("Port")).rmempty = true
return m
| apache-2.0 |
NetEase/openlua | src/slr.lua | 2 | 221625 | require("common.lua")
require("set.lua")
require("list.lua")
require("prototype.lua")
-- ÔËËã·ûÓÅÏȼ¶±í
local precedence = {}
precedence["or"] = 1
precedence["and"] = 2
precedence["<"] = 3
precedence[">"] = 3
precedence["<="] = 3
precedence[">="] = 3
precedence["~="] = 3
precedence["=="] = 3
precedence[".."] = 4
precedence["+"] = 5
precedence["-"] = 5
precedence["*"] = 6
precedence["/"] = 6
precedence["not"] = 7
precedence["-(unary)"] = 7
precedence["^"] = 8
local function GetSelectorByBinopPrecedence(state)
local function select(leftop,rightop)
local bEqual = precedence[leftop] == precedence[rightop]
if ".." == leftop or "^" == leftop then
-- ..ÔËËã·ûºÍ^ÔËËã·ûÊÇÓÒ½áºÏµÄ
bEqual = false
end
if precedence[leftop] > precedence[rightop]
or bEqual then
return Production{"exp", Rightside{"exp", "binop", "exp"}}
else
return state
end
end
return select
end
local function GetSelectorByLineNum(prod)
local function select(lead_linenum,follow_linenum)
if lead_linenum == follow_linenum then
return prod
else
return nil
end
end
return select
end
gOpenluaSyntax = {}
gOpenluaSyntax.start = 'program'
local firstset = {}
local followset = {}
local initialStates = {}
local parseTable = {}
gOpenluaSyntax.firstset = firstset
gOpenluaSyntax.followset = followset
gOpenluaSyntax.initialStates = initialStates
gOpenluaSyntax.parseTable = parseTable
-- ÖÕ½á·û¼¯ºÏ
gOpenluaSyntax.terminals =
Set{"Number", "~=", "==", "<=", "while", ")", "nil", "+", "*", "-", ",", "/", ".", "true", "return", "import", "{", "then", "}", "<", ">", "else", ";", "[", "break", "..", "(", ":", "function", "...", "Literal", "or", "local", "transformer", "end", "syntax", "not", "in", "repeat", "elseif", "false", "if", "and", "for", "until", "Name", "=", "]", ">=", "do", "^"}
-- ·ÇÖÕ½á·û¼¯ºÏ
gOpenluaSyntax.nonterminals =
Set{"functiondef", "unop", "transformerdef", "optional_compound_stat", "prefixexp", "result_part", "block", "stat", "optional_elseif_part", "colone_name", "init", "explist", "localvar_list", "syntaxdef", "init_part", "binop", "exp", "fieldsep", "optional_fieldlist", "field", "optional_parlist", "parlist", "keyname", "tableconstructor", "var", "optional_stat_list", "parname_list", "fieldlist", "funcbody", "elseif_part", "one_stat", "program", "namelist", "funcname", "optional_else_part", "metastat", "compound_stat", "varlist", "stat_sep", "stat_list", "args", "chunk", "import_module", "dotname_list", "functioncall"}
-- followset
followset['functiondef'] = Set{"~=", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", "return", "import", ";", "local", "}", "repeat", ">", "else", "eof", "..", "function", "end", "transformer", "syntax", "<", "do", "elseif", "or", "if", "break", "for", "until", "Name", ">=", "]", "and", "then", "^"}
followset['unop'] = Set{"Number", "not", "Literal", "false", "function", "(", "Name", "-", "nil", "true", "{"}
followset['transformerdef'] = Set{"do", "eof", "while", "function", "(", "transformer", "syntax", "return", "if", "import", "for", ";", "local", "repeat", "break", "Name"}
followset['optional_compound_stat'] = Set{"eof"}
followset['prefixexp'] = Set{"(", "[", ":", "Literal", "{", "."}
followset['result_part'] = Set{"else", "do", "eof", "while", "function", "(", "end", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", ";", "local", "repeat", "import", "Name"}
followset['block'] = Set{"else", "end", "elseif", "until"}
followset['stat'] = Set{"else", "do", "eof", "while", "function", "(", "end", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", "Name", "local", "repeat", "import", ";"}
followset['optional_elseif_part'] = Set{"else", "end"}
followset['colone_name'] = Set{"("}
followset['init'] = Set{"else", "do", "eof", "while", "function", "(", "end", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", "Name", "local", "repeat", "import", ";"}
followset['explist'] = Set{"else", "do", "eof", "while", ")", "(", "end", ",", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", "Name", "local", "import", "repeat", "function", ";"}
followset['localvar_list'] = Set{"else", "do", "eof", "while", "function", "(", "end", ",", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", "Name", "local", "=", "repeat", "import", ";"}
followset['syntaxdef'] = Set{"do", "eof", "while", "function", "(", "transformer", "syntax", "return", "if", "import", "for", ";", "local", "repeat", "break", "Name"}
followset['init_part'] = Set{"else", "do", "eof", "while", "function", "(", "end", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", ";", "local", "repeat", "import", "Name"}
followset['binop'] = Set{"Number", "not", "Literal", "false", "function", "(", "Name", "-", "nil", "true", "{"}
followset['compound_stat'] = Set{"syntax", "do", "return", "eof", "while", "if", "break", "function", "(", "Name", "local", "for", "repeat", "transformer", "import"}
followset['varlist'] = Set{"=", ","}
followset['dotname_list'] = Set{"(", ".", ":"}
followset['funcbody'] = Set{">=", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", "return", "import", ";", "then", "}", "repeat", ">", "else", "eof", "..", "function", "or", "transformer", "syntax", "end", "local", "elseif", "do", "if", "break", "for", "until", "Name", "~=", "]", "and", "<", "^"}
followset['optional_parlist'] = Set{")"}
followset['parname_list'] = Set{")", ","}
followset['keyname'] = Set{"="}
followset['field'] = Set{"}", ",", ";"}
followset['var'] = Set{"~=", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", ".", "return", "import", "{", "then", "=", "repeat", ">", "else", "eof", "..", "function", "}", "end", "and", ">=", "transformer", "<", "syntax", "Literal", ";", "[", "elseif", "do", "if", "break", "for", "until", "Name", "or", "]", "local", ":", "^"}
followset['optional_stat_list'] = Set{"until", "end", "elseif", "else"}
followset['one_stat'] = Set{"syntax", "do", "return", "eof", "import", "while", "break", "function", "(", "Name", "local", "for", "repeat", "transformer", "if"}
followset['fieldlist'] = Set{"}", ",", ";"}
followset['fieldsep'] = Set{"Number", "not", "Literal", "false", "}", "function", "nil", "{", "true", "-", "(", "Name", "["}
followset['elseif_part'] = Set{"elseif", "else", "end"}
followset['tableconstructor'] = Set{"do", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", ".", "return", "import", ";", "then", "}", "<", ">", "else", "eof", "..", "function", "end", "Literal", ":", "transformer", "[", "syntax", "{", "or", ">=", "elseif", "~=", "if", "and", "for", "until", "Name", "local", "]", "repeat", "break", "^"}
followset['program'] = Set{"eof"}
followset['namelist'] = Set{"in", ","}
followset['funcname'] = Set{"("}
followset['optional_else_part'] = Set{"end"}
followset['metastat'] = Set{"syntax", "do", "return", "eof", "if", "while", "import", "function", "(", "Name", "local", "for", "repeat", "transformer", "break"}
followset['exp'] = Set{"~=", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", "return", "import", ";", "then", "}", "<", ">", "else", "eof", "..", "function", "end", "transformer", "syntax", "local", ">=", "elseif", "do", "if", "and", "for", "until", "Name", "or", "]", "repeat", "break", "^"}
followset['optional_fieldlist'] = Set{"}"}
followset['stat_sep'] = Set{"else", "do", "eof", "while", "function", "(", "end", "transformer", "syntax", "return", "elseif", "if", "break", "for", "until", "Name", "local", "repeat", "import"}
followset['stat_list'] = Set{"else", "do", "while", "function", "(", "end", "return", "elseif", "if", "break", "for", "until", "Name", "local", "repeat", ";"}
followset['args'] = Set{">=", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", ".", "return", "import", "{", "then", "}", "repeat", ">", "else", "eof", "..", "function", "or", "do", ";", "transformer", "~=", "syntax", "local", "Name", "break", "elseif", "end", "if", "and", "for", "until", "[", "<", "]", ":", "Literal", "^"}
followset['chunk'] = Set{"eof"}
followset['import_module'] = Set{"do", "eof", "while", "function", "(", "transformer", "syntax", "return", "if", "import", "for", ";", "local", "repeat", "break", "Name"}
followset['parlist'] = Set{")"}
followset['functioncall'] = Set{">=", "==", "<=", "while", ")", "(", "+", "*", "-", ",", "/", ".", "Literal", "import", "{", "then", "}", "repeat", ">", "else", "eof", "..", "function", "or", "end", "do", "transformer", "<", "syntax", "return", ":", "and", "elseif", "~=", "if", "break", "for", "until", "[", ";", "]", "Name", "local", "^"}
-- firstset
firstset['Number'] = Set{"Number"}
firstset['functiondef'] = Set{"function"}
firstset['do'] = Set{"do"}
firstset['unop'] = Set{"-", "not"}
firstset['transformerdef'] = Set{"transformer"}
firstset['while'] = Set{"while"}
firstset['optional_compound_stat'] = Set{"syntax", "do", "return", "for", "import", "while", "break", "function", "(", "Name", "local", "if", "empty", "transformer", "repeat"}
firstset['prefixexp'] = Set{"(", "Name"}
firstset['block'] = Set{"do", "return", "while", "break", "function", "(", "Name", "local", "if", "empty", "for", "repeat"}
firstset['stat'] = Set{"do", "return", "while", "break", "function", "(", "Name", "local", "repeat", "if", "for"}
firstset['optional_elseif_part'] = Set{"elseif", "empty"}
firstset['colone_name'] = Set{"empty", ":"}
firstset['parname_list'] = Set{"Name"}
firstset['tableconstructor'] = Set{"{"}
firstset['{'] = Set{"{"}
firstset['}'] = Set{"}"}
firstset['one_stat'] = Set{"syntax", "do", "return", "import", "while", "break", "function", "(", "Name", "local", "if", "repeat", "transformer", "for"}
firstset['compound_stat'] = Set{"syntax", "do", "return", "if", "while", "break", "function", "(", "Name", "local", "import", "repeat", "transformer", "for"}
firstset['..'] = Set{".."}
firstset['keyname'] = Set{"Name"}
firstset['or'] = Set{"or"}
firstset['empty'] = Set{"empty"}
firstset['fieldlist'] = Set{"true", "not", "Literal", "false", "function", "nil", "[", "Name", "-", "(", "{", "Number"}
firstset['elseif_part'] = Set{"elseif"}
firstset['program'] = Set{"syntax", "do", "return", "for", "import", "while", "break", "function", "(", "Name", "local", "if", "empty", "transformer", "repeat"}
firstset['funcname'] = Set{"Name"}
firstset['optional_else_part'] = Set{"empty", "else"}
firstset['if'] = Set{"if"}
firstset['in'] = Set{"in"}
firstset['until'] = Set{"until"}
firstset['stat_list'] = Set{"do", "return", "while", "break", "function", "(", "Name", "local", "repeat", "if", "for"}
firstset['args'] = Set{"(", "{", "Literal"}
firstset['chunk'] = Set{"syntax", "do", "return", "for", "import", "while", "break", "function", "(", "Name", "local", "if", "empty", "transformer", "repeat"}
firstset['dotname_list'] = Set{"empty", "."}
firstset['field'] = Set{"true", "not", "Literal", "false", "function", "nil", "[", "{", "-", "Name", "(", "Number"}
firstset['>='] = Set{">="}
firstset['=='] = Set{"=="}
firstset['<='] = Set{"<="}
firstset['Name'] = Set{"Name"}
firstset['for'] = Set{"for"}
firstset['false'] = Set{"false"}
firstset[')'] = Set{")"}
firstset['nil'] = Set{"nil"}
firstset['+'] = Set{"+"}
firstset['*'] = Set{"*"}
firstset['-'] = Set{"-"}
firstset[','] = Set{","}
firstset['/'] = Set{"/"}
firstset['.'] = Set{"."}
firstset['true'] = Set{"true"}
firstset['optional_stat_list'] = Set{"do", "return", "while", "break", "function", "(", "Name", "local", "if", "empty", "for", "repeat"}
firstset['<'] = Set{"<"}
firstset['syntax'] = Set{"syntax"}
firstset['explist'] = Set{"Number", "not", "Literal", "false", "function", "(", "Name", "-", "{", "true", "nil"}
firstset['syntaxdef'] = Set{"syntax"}
firstset['break'] = Set{"break"}
firstset['import'] = Set{"import"}
firstset['~='] = Set{"~="}
firstset['namelist'] = Set{"Name"}
firstset[';'] = Set{";"}
firstset['then'] = Set{"then"}
firstset['='] = Set{"="}
firstset['repeat'] = Set{"repeat"}
firstset['return'] = Set{"return"}
firstset['init_part'] = Set{"=", "empty"}
firstset['local'] = Set{"local"}
firstset['else'] = Set{"else"}
firstset['init'] = Set{"="}
firstset['exp'] = Set{"Number", "not", "Literal", "false", "function", "(", "Name", "-", "{", "true", "nil"}
firstset['optional_fieldlist'] = Set{"true", "not", "Literal", "false", "(", "function", "nil", "[", "{", "-", "empty", "Name", "Number"}
firstset['...'] = Set{"..."}
firstset['result_part'] = Set{"true", "not", "Literal", "false", "function", "nil", "Name", "{", "-", "empty", "(", "Number"}
firstset['optional_parlist'] = Set{"empty", "Name", "..."}
firstset['function'] = Set{"function"}
firstset['>'] = Set{">"}
firstset['var'] = Set{"(", "Name"}
firstset['end'] = Set{"end"}
firstset['binop'] = Set{">=", "==", "<=", "..", ">", "and", "~=", "or", "+", "*", "-", "<", "/", "^"}
firstset['localvar_list'] = Set{"Name"}
firstset['transformer'] = Set{"transformer"}
firstset['('] = Set{"("}
firstset[':'] = Set{":"}
firstset['not'] = Set{"not"}
firstset['fieldsep'] = Set{",", ";"}
firstset['Literal'] = Set{"Literal"}
firstset['varlist'] = Set{"(", "Name"}
firstset['functioncall'] = Set{"(", "Name"}
firstset['metastat'] = Set{"syntax", "transformer", "import"}
firstset['and'] = Set{"and"}
firstset['funcbody'] = Set{"("}
firstset['stat_sep'] = Set{"empty", ";"}
firstset['['] = Set{"["}
firstset['elseif'] = Set{"elseif"}
firstset[']'] = Set{"]"}
firstset['import_module'] = Set{"import"}
firstset['parlist'] = Set{"...", "Name"}
firstset['^'] = Set{"^"}
-- initialStates
initialStates['Number'] = 12
initialStates['functiondef'] = 12
initialStates['~='] = 23
initialStates['unop'] = 12
initialStates['transformerdef'] = 1
initialStates['while'] = 1
initialStates['optional_compound_stat'] = 1
initialStates['prefixexp'] = 1
initialStates['block'] = 24
initialStates['stat'] = 1
initialStates['optional_fieldlist'] = 39
initialStates['colone_name'] = 81
initialStates['Literal'] = 3
initialStates['tableconstructor'] = 10
initialStates['{'] = 3
initialStates['}'] = 23
initialStates['syntaxdef'] = 1
initialStates['compound_stat'] = 1
initialStates['..'] = 23
initialStates['keyname'] = 39
initialStates['or'] = 23
initialStates['fieldlist'] = 39
initialStates['syntax'] = 1
initialStates['program'] = 1
initialStates['elseif'] = 3
initialStates['false'] = 12
initialStates['if'] = 1
initialStates['for'] = 1
initialStates['until'] = 3
initialStates['Name'] = 1
initialStates['args'] = 10
initialStates['chunk'] = 1
initialStates['dotname_list'] = 30
initialStates['optional_else_part'] = 177
initialStates['optional_elseif_part'] = 162
initialStates['>='] = 23
initialStates['=='] = 23
initialStates['<='] = 23
initialStates['elseif_part'] = 162
initialStates['fieldsep'] = 85
initialStates['var'] = 1
initialStates[')'] = 23
initialStates['nil'] = 12
initialStates['+'] = 23
initialStates['*'] = 23
initialStates['result_part'] = 12
initialStates[','] = 14
initialStates['/'] = 23
initialStates['.'] = 3
initialStates['true'] = 12
initialStates['...'] = 82
initialStates['funcname'] = 5
initialStates['parname_list'] = 82
initialStates['explist'] = 12
initialStates['in'] = 68
initialStates['binop'] = 51
initialStates['import'] = 1
initialStates['init_part'] = 44
initialStates['localvar_list'] = 11
initialStates[';'] = 3
initialStates[':'] = 3
initialStates['='] = 14
initialStates['repeat'] = 1
initialStates['init'] = 44
initialStates['>'] = 23
initialStates['field'] = 39
initialStates['else'] = 3
initialStates['funcbody'] = 31
initialStates['exp'] = 12
initialStates['then'] = 23
initialStates['stat_list'] = 24
initialStates['^'] = 23
initialStates['optional_parlist'] = 82
initialStates['function'] = 1
initialStates['<'] = 23
initialStates['and'] = 23
initialStates['end'] = 3
initialStates['optional_stat_list'] = 24
initialStates['do'] = 1
initialStates['transformer'] = 1
initialStates['('] = 1
initialStates['-'] = 12
initialStates['not'] = 12
initialStates['return'] = 1
initialStates['namelist'] = 18
initialStates['varlist'] = 1
initialStates['one_stat'] = 1
initialStates['metastat'] = 1
initialStates['break'] = 1
initialStates['local'] = 1
initialStates['stat_sep'] = 9
initialStates['['] = 3
initialStates['eof'] = 1
initialStates[']'] = 23
initialStates['import_module'] = 1
initialStates['parlist'] = 82
initialStates['functioncall'] = 1
-- SLRÓï·¨½âÎö±í
parseTable[1] = {}
parseTable[1]["do"] = 26
parseTable[1]["eof"] = Production{"optional_compound_stat", Rightside{"empty"}}
parseTable[1]["transformerdef"] = 27
parseTable[1]["while"] = 19
parseTable[1]["optional_compound_stat"] = 16
parseTable[1]["function"] = 5
parseTable[1]["prefixexp"] = 10
parseTable[1]["stat"] = 20
parseTable[1]["var"] = 14
parseTable[1]["syntaxdef"] = 28
parseTable[1]["metastat"] = 25
parseTable[1]["transformer"] = 13
parseTable[1]["repeat"] = 24
parseTable[1]["syntax"] = 2
parseTable[1]["compound_stat"] = 6
parseTable[1]["program"] = 0
parseTable[1]["return"] = 12
parseTable[1]["varlist"] = 15
parseTable[1]["break"] = 7
parseTable[1]["if"] = 22
parseTable[1]["import"] = 8
parseTable[1]["for"] = 18
parseTable[1]["("] = 17
parseTable[1]["Name"] = 23
parseTable[1]["local"] = 11
parseTable[1]["chunk"] = 21
parseTable[1]["one_stat"] = 4
parseTable[1]["import_module"] = 9
parseTable[1]["functioncall"] = 3
parseTable[2] = {}
parseTable[2]["Name"] = 29
parseTable[3] = {}
parseTable[3]["else"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["do"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["eof"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["while"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["function"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["("] = GetSelectorByLineNum(Production{"prefixexp", Rightside{"functioncall"}})
--Set{Production{"stat", Rightside{"functioncall"}}, Production{"prefixexp", Rightside{"functioncall"}}}
parseTable[3]["end"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["transformer"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["."] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[3]["syntax"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3][";"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["import"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["return"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["elseif"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["Name"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["if"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["break"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["for"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["until"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["{"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[3][":"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[3]["local"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["repeat"] = Production{"stat", Rightside{"functioncall"}}
parseTable[3]["Literal"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[3]["["] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[4] = {}
parseTable[4]["syntax"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["do"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["eof"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["import"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["return"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["while"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["break"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["function"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["("] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["Name"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["local"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["for"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["repeat"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["transformer"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[4]["if"] = Production{"compound_stat", Rightside{"one_stat"}}
parseTable[5] = {}
parseTable[5]["funcname"] = 31
parseTable[5]["Name"] = 30
parseTable[6] = {}
parseTable[6]["do"] = 26
parseTable[6]["eof"] = Production{"optional_compound_stat", Rightside{"compound_stat"}}
parseTable[6]["transformerdef"] = 27
parseTable[6]["while"] = 19
parseTable[6]["function"] = 5
parseTable[6]["prefixexp"] = 10
parseTable[6]["var"] = 14
parseTable[6]["stat"] = 20
parseTable[6]["syntaxdef"] = 28
parseTable[6]["syntax"] = 2
parseTable[6]["one_stat"] = 32
parseTable[6]["import_module"] = 9
parseTable[6]["return"] = 12
parseTable[6]["varlist"] = 15
parseTable[6]["("] = 17
parseTable[6]["if"] = 22
parseTable[6]["break"] = 7
parseTable[6]["for"] = 18
parseTable[6]["transformer"] = 13
parseTable[6]["Name"] = 23
parseTable[6]["local"] = 11
parseTable[6]["metastat"] = 25
parseTable[6]["repeat"] = 24
parseTable[6]["import"] = 8
parseTable[6]["functioncall"] = 3
parseTable[7] = {}
parseTable[7]["else"] = Production{"stat", Rightside{"break"}}
parseTable[7]["do"] = Production{"stat", Rightside{"break"}}
parseTable[7]["eof"] = Production{"stat", Rightside{"break"}}
parseTable[7]["while"] = Production{"stat", Rightside{"break"}}
parseTable[7]["function"] = Production{"stat", Rightside{"break"}}
parseTable[7]["("] = Production{"stat", Rightside{"break"}}
parseTable[7]["end"] = Production{"stat", Rightside{"break"}}
parseTable[7]["transformer"] = Production{"stat", Rightside{"break"}}
parseTable[7]["syntax"] = Production{"stat", Rightside{"break"}}
parseTable[7]["return"] = Production{"stat", Rightside{"break"}}
parseTable[7]["elseif"] = Production{"stat", Rightside{"break"}}
parseTable[7]["if"] = Production{"stat", Rightside{"break"}}
parseTable[7]["break"] = Production{"stat", Rightside{"break"}}
parseTable[7]["for"] = Production{"stat", Rightside{"break"}}
parseTable[7]["until"] = Production{"stat", Rightside{"break"}}
parseTable[7]["Name"] = Production{"stat", Rightside{"break"}}
parseTable[7]["local"] = Production{"stat", Rightside{"break"}}
parseTable[7]["repeat"] = Production{"stat", Rightside{"break"}}
parseTable[7][";"] = Production{"stat", Rightside{"break"}}
parseTable[7]["import"] = Production{"stat", Rightside{"break"}}
parseTable[8] = {}
parseTable[8]["Literal"] = 33
parseTable[9] = {}
parseTable[9]["else"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["do"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["eof"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["while"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["function"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["("] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["end"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["transformer"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["syntax"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["return"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["elseif"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["if"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["break"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["for"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["stat_sep"] = 35
parseTable[9][";"] = 34
parseTable[9]["local"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["import"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["repeat"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["Name"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[9]["until"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[10] = {}
parseTable[10]["Literal"] = 38
parseTable[10]["tableconstructor"] = 41
parseTable[10]["{"] = 39
parseTable[10]["args"] = 37
parseTable[10]["["] = 43
parseTable[10]["("] = 40
parseTable[10][":"] = 36
parseTable[10]["."] = 42
parseTable[11] = {}
parseTable[11]["function"] = 46
parseTable[11]["localvar_list"] = 44
parseTable[11]["Name"] = 45
parseTable[12] = {}
parseTable[12]["Number"] = 61
parseTable[12]["functiondef"] = 59
parseTable[12]["do"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["unop"] = 55
parseTable[12]["while"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["prefixexp"] = 10
parseTable[12]["-"] = 54
parseTable[12]["true"] = 50
parseTable[12]["Literal"] = 48
parseTable[12]["explist"] = 47
parseTable[12]["import"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["tableconstructor"] = 56
parseTable[12][";"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["local"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["repeat"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["else"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["exp"] = 51
parseTable[12]["function"] = 58
--Set{Production{"result_part", Rightside{"empty"}}, 58}
parseTable[12]["end"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["transformer"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["{"] = 39
parseTable[12]["syntax"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["not"] = 57
parseTable[12]["result_part"] = 62
parseTable[12]["nil"] = 60
parseTable[12]["elseif"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["false"] = 63
parseTable[12]["if"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["break"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["for"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["until"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["Name"] = 23
--Set{23, Production{"result_part", Rightside{"empty"}}}
parseTable[12]["eof"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["("] = 53
--Set{53, Production{"result_part", Rightside{"empty"}}}
parseTable[12]["var"] = 52
parseTable[12]["return"] = Production{"result_part", Rightside{"empty"}}
parseTable[12]["functioncall"] = 49
parseTable[13] = {}
parseTable[13]["Name"] = 64
parseTable[14] = {}
parseTable[14]["Literal"] = Production{"prefixexp", Rightside{"var"}}
parseTable[14]["("] = Production{"prefixexp", Rightside{"var"}}
parseTable[14]["{"] = Production{"prefixexp", Rightside{"var"}}
parseTable[14][":"] = Production{"prefixexp", Rightside{"var"}}
parseTable[14]["="] = Production{"varlist", Rightside{"var"}}
parseTable[14][","] = Production{"varlist", Rightside{"var"}}
parseTable[14]["["] = Production{"prefixexp", Rightside{"var"}}
parseTable[14]["."] = Production{"prefixexp", Rightside{"var"}}
parseTable[15] = {}
parseTable[15]["="] = 65
parseTable[15][","] = 66
parseTable[16] = {}
parseTable[16]["eof"] = Production{"chunk", Rightside{"optional_compound_stat"}}
parseTable[17] = {}
parseTable[17]["Number"] = 61
parseTable[17]["functiondef"] = 59
parseTable[17]["exp"] = 67
parseTable[17]["function"] = 58
parseTable[17]["("] = 53
parseTable[17]["var"] = 52
parseTable[17]["-"] = 54
parseTable[17]["true"] = 50
parseTable[17]["not"] = 57
parseTable[17]["Literal"] = 48
parseTable[17]["false"] = 63
parseTable[17]["tableconstructor"] = 56
parseTable[17]["{"] = 39
parseTable[17]["unop"] = 55
parseTable[17]["nil"] = 60
parseTable[17]["Name"] = 23
parseTable[17]["prefixexp"] = 10
parseTable[17]["functioncall"] = 49
parseTable[18] = {}
parseTable[18]["namelist"] = 68
parseTable[18]["Name"] = 69
parseTable[19] = {}
parseTable[19]["Number"] = 61
parseTable[19]["functiondef"] = 59
parseTable[19]["exp"] = 70
parseTable[19]["function"] = 58
parseTable[19]["("] = 53
parseTable[19]["var"] = 52
parseTable[19]["-"] = 54
parseTable[19]["true"] = 50
parseTable[19]["not"] = 57
parseTable[19]["Literal"] = 48
parseTable[19]["false"] = 63
parseTable[19]["tableconstructor"] = 56
parseTable[19]["Name"] = 23
parseTable[19]["nil"] = 60
parseTable[19]["unop"] = 55
parseTable[19]["prefixexp"] = 10
parseTable[19]["{"] = 39
parseTable[19]["functioncall"] = 49
parseTable[20] = {}
parseTable[20]["else"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["do"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["eof"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["while"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["function"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["("] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["end"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["transformer"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["syntax"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["return"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["elseif"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["if"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["break"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["for"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["until"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["Name"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["local"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20][";"] = 34
parseTable[20]["repeat"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[20]["stat_sep"] = 71
parseTable[20]["import"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[21] = {}
parseTable[21]["eof"] = Production{"program", Rightside{"chunk"}}
parseTable[22] = {}
parseTable[22]["Number"] = 61
parseTable[22]["functiondef"] = 59
parseTable[22]["exp"] = 72
parseTable[22]["function"] = 58
parseTable[22]["nil"] = 60
parseTable[22]["var"] = 52
parseTable[22]["-"] = 54
parseTable[22]["true"] = 50
parseTable[22]["not"] = 57
parseTable[22]["Literal"] = 48
parseTable[22]["false"] = 63
parseTable[22]["tableconstructor"] = 56
parseTable[22]["{"] = 39
parseTable[22]["("] = 53
parseTable[22]["unop"] = 55
parseTable[22]["prefixexp"] = 10
parseTable[22]["Name"] = 23
parseTable[22]["functioncall"] = 49
parseTable[23] = {}
parseTable[23][">="] = Production{"var", Rightside{"Name"}}
parseTable[23]["=="] = Production{"var", Rightside{"Name"}}
parseTable[23]["<="] = Production{"var", Rightside{"Name"}}
parseTable[23]["while"] = Production{"var", Rightside{"Name"}}
parseTable[23][")"] = Production{"var", Rightside{"Name"}}
parseTable[23]["("] = Production{"var", Rightside{"Name"}}
parseTable[23]["+"] = Production{"var", Rightside{"Name"}}
parseTable[23]["*"] = Production{"var", Rightside{"Name"}}
parseTable[23]["-"] = Production{"var", Rightside{"Name"}}
parseTable[23][","] = Production{"var", Rightside{"Name"}}
parseTable[23]["/"] = Production{"var", Rightside{"Name"}}
parseTable[23]["."] = Production{"var", Rightside{"Name"}}
parseTable[23]["return"] = Production{"var", Rightside{"Name"}}
parseTable[23]["import"] = Production{"var", Rightside{"Name"}}
parseTable[23]["{"] = Production{"var", Rightside{"Name"}}
parseTable[23]["then"] = Production{"var", Rightside{"Name"}}
parseTable[23]["="] = Production{"var", Rightside{"Name"}}
parseTable[23]["repeat"] = Production{"var", Rightside{"Name"}}
parseTable[23][">"] = Production{"var", Rightside{"Name"}}
parseTable[23]["else"] = Production{"var", Rightside{"Name"}}
parseTable[23]["eof"] = Production{"var", Rightside{"Name"}}
parseTable[23][".."] = Production{"var", Rightside{"Name"}}
parseTable[23]["function"] = Production{"var", Rightside{"Name"}}
parseTable[23]["}"] = Production{"var", Rightside{"Name"}}
parseTable[23]["end"] = Production{"var", Rightside{"Name"}}
parseTable[23][":"] = Production{"var", Rightside{"Name"}}
parseTable[23]["local"] = Production{"var", Rightside{"Name"}}
parseTable[23]["transformer"] = Production{"var", Rightside{"Name"}}
parseTable[23]["~="] = Production{"var", Rightside{"Name"}}
parseTable[23]["syntax"] = Production{"var", Rightside{"Name"}}
parseTable[23]["or"] = Production{"var", Rightside{"Name"}}
parseTable[23]["Name"] = Production{"var", Rightside{"Name"}}
parseTable[23]["do"] = Production{"var", Rightside{"Name"}}
parseTable[23]["elseif"] = Production{"var", Rightside{"Name"}}
parseTable[23]["break"] = Production{"var", Rightside{"Name"}}
parseTable[23]["if"] = Production{"var", Rightside{"Name"}}
parseTable[23]["and"] = Production{"var", Rightside{"Name"}}
parseTable[23]["for"] = Production{"var", Rightside{"Name"}}
parseTable[23]["until"] = Production{"var", Rightside{"Name"}}
parseTable[23]["["] = Production{"var", Rightside{"Name"}}
parseTable[23][";"] = Production{"var", Rightside{"Name"}}
parseTable[23]["]"] = Production{"var", Rightside{"Name"}}
parseTable[23]["Literal"] = Production{"var", Rightside{"Name"}}
parseTable[23]["<"] = Production{"var", Rightside{"Name"}}
parseTable[23]["^"] = Production{"var", Rightside{"Name"}}
parseTable[24] = {}
parseTable[24]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[24]["do"] = 26
parseTable[24]["while"] = 19
parseTable[24]["function"] = 5
parseTable[24]["prefixexp"] = 10
parseTable[24]["var"] = 14
parseTable[24]["optional_stat_list"] = 75
parseTable[24]["block"] = 74
parseTable[24]["stat"] = 76
parseTable[24]["("] = 17
parseTable[24]["return"] = 12
parseTable[24]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[24]["varlist"] = 15
parseTable[24]["if"] = 22
parseTable[24]["break"] = 7
parseTable[24]["for"] = 18
parseTable[24]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[24]["stat_list"] = 73
parseTable[24]["local"] = 11
parseTable[24]["Name"] = 23
parseTable[24]["repeat"] = 24
parseTable[24]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[24]["functioncall"] = 3
parseTable[25] = {}
parseTable[25]["syntax"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["do"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["eof"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["if"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["return"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["while"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["import"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["function"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["("] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["Name"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["local"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["for"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["repeat"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["transformer"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[25]["break"] = Production{"one_stat", Rightside{"metastat"}}
parseTable[26] = {}
parseTable[26]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[26]["do"] = 26
parseTable[26]["while"] = 19
parseTable[26]["function"] = 5
parseTable[26]["prefixexp"] = 10
parseTable[26]["var"] = 14
parseTable[26]["optional_stat_list"] = 75
parseTable[26]["block"] = 77
parseTable[26]["stat"] = 76
parseTable[26]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[26]["return"] = 12
parseTable[26]["varlist"] = 15
parseTable[26]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[26]["if"] = 22
parseTable[26]["break"] = 7
parseTable[26]["for"] = 18
parseTable[26]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[26]["Name"] = 23
parseTable[26]["local"] = 11
parseTable[26]["("] = 17
parseTable[26]["repeat"] = 24
parseTable[26]["stat_list"] = 73
parseTable[26]["functioncall"] = 3
parseTable[27] = {}
parseTable[27]["else"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["do"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["eof"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["while"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["function"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["("] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["end"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["transformer"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["syntax"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["return"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["elseif"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["if"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["break"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["for"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["until"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["Name"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["local"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27][";"] = 34
parseTable[27]["repeat"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[27]["stat_sep"] = 78
parseTable[27]["import"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28] = {}
parseTable[28]["else"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["do"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["eof"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["while"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["function"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["("] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["end"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["transformer"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["syntax"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["return"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["elseif"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["if"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["break"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["for"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["until"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28][";"] = 34
parseTable[28]["local"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["stat_sep"] = 79
parseTable[28]["repeat"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["import"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[28]["Name"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[29] = {}
parseTable[29][":"] = 80
parseTable[30] = {}
parseTable[30]["("] = Production{"dotname_list", Rightside{"empty"}}
parseTable[30][":"] = Production{"dotname_list", Rightside{"empty"}}
parseTable[30]["dotname_list"] = 81
parseTable[30]["."] = Production{"dotname_list", Rightside{"empty"}}
parseTable[31] = {}
parseTable[31]["("] = 82
parseTable[31]["funcbody"] = 83
parseTable[32] = {}
parseTable[32]["syntax"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["do"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["eof"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["import"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["return"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["while"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["break"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["function"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["("] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["Name"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["local"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["for"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["repeat"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["transformer"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[32]["if"] = Production{"compound_stat", Rightside{"compound_stat", "one_stat"}}
parseTable[33] = {}
parseTable[33]["do"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["eof"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["while"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["function"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["("] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["transformer"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["syntax"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["return"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["if"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["import"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["for"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33][";"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["local"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["repeat"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["Name"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[33]["break"] = Production{"import_module", Rightside{"import", "Literal"}}
parseTable[34] = {}
parseTable[34]["else"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["do"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["eof"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["while"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["function"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["("] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["end"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["transformer"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["syntax"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["return"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["elseif"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["if"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["break"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["for"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["until"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["Name"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["local"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["repeat"] = Production{"stat_sep", Rightside{";"}}
parseTable[34]["import"] = Production{"stat_sep", Rightside{";"}}
parseTable[35] = {}
parseTable[35]["syntax"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["do"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["eof"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["break"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["return"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["if"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["import"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["function"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["("] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["Name"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["local"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["for"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["repeat"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["transformer"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[35]["while"] = Production{"metastat", Rightside{"import_module", "stat_sep"}}
parseTable[36] = {}
parseTable[36]["Name"] = 84
parseTable[37] = {}
parseTable[37]["do"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["=="] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["<="] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["while"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][")"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["("] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["+"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["*"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["-"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][","] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["/"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["."] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["Literal"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["import"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["{"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["then"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["}"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["repeat"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][">"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["else"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["eof"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][".."] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["function"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["or"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["end"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["local"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["transformer"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["Name"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["syntax"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][":"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][";"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["~="] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["elseif"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["break"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["if"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["and"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["for"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["until"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["["] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37][">="] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["]"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["return"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["<"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[37]["^"] = Production{"functioncall", Rightside{"prefixexp", "args"}}
parseTable[38] = {}
parseTable[38]["do"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["=="] = Production{"args", Rightside{"Literal"}}
parseTable[38]["<="] = Production{"args", Rightside{"Literal"}}
parseTable[38]["while"] = Production{"args", Rightside{"Literal"}}
parseTable[38][")"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["("] = Production{"args", Rightside{"Literal"}}
parseTable[38]["+"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["*"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["-"] = Production{"args", Rightside{"Literal"}}
parseTable[38][","] = Production{"args", Rightside{"Literal"}}
parseTable[38]["/"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["."] = Production{"args", Rightside{"Literal"}}
parseTable[38]["return"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["import"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["{"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["then"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["}"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["repeat"] = Production{"args", Rightside{"Literal"}}
parseTable[38][">"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["else"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["eof"] = Production{"args", Rightside{"Literal"}}
parseTable[38][".."] = Production{"args", Rightside{"Literal"}}
parseTable[38]["function"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["or"] = Production{"args", Rightside{"Literal"}}
parseTable[38][";"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["Literal"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["transformer"] = Production{"args", Rightside{"Literal"}}
parseTable[38][":"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["syntax"] = Production{"args", Rightside{"Literal"}}
parseTable[38][">="] = Production{"args", Rightside{"Literal"}}
parseTable[38]["<"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["["] = Production{"args", Rightside{"Literal"}}
parseTable[38]["elseif"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["and"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["if"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["break"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["for"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["until"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["Name"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["end"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["]"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["local"] = Production{"args", Rightside{"Literal"}}
parseTable[38]["~="] = Production{"args", Rightside{"Literal"}}
parseTable[38]["^"] = Production{"args", Rightside{"Literal"}}
parseTable[39] = {}
parseTable[39]["Number"] = 61
parseTable[39]["functiondef"] = 59
parseTable[39]["exp"] = 87
parseTable[39]["function"] = 58
parseTable[39]["prefixexp"] = 10
parseTable[39]["var"] = 52
parseTable[39]["-"] = 54
parseTable[39]["fieldlist"] = 85
parseTable[39]["true"] = 50
parseTable[39]["not"] = 57
parseTable[39]["["] = 91
parseTable[39]["Literal"] = 48
parseTable[39]["Name"] = 90
parseTable[39]["false"] = 63
parseTable[39]["unop"] = 55
parseTable[39]["field"] = 89
parseTable[39]["optional_fieldlist"] = 86
parseTable[39]["tableconstructor"] = 56
parseTable[39]["{"] = 39
parseTable[39]["keyname"] = 88
parseTable[39]["}"] = Production{"optional_fieldlist", Rightside{"empty"}}
parseTable[39]["nil"] = 60
parseTable[39]["("] = 53
parseTable[39]["functioncall"] = 49
parseTable[40] = {}
parseTable[40]["Number"] = 61
parseTable[40]["functiondef"] = 59
parseTable[40]["unop"] = 55
parseTable[40]["function"] = 58
parseTable[40]["nil"] = 60
parseTable[40]["var"] = 52
parseTable[40]["-"] = 54
parseTable[40]["true"] = 50
parseTable[40]["not"] = 57
parseTable[40]["Literal"] = 48
parseTable[40]["explist"] = 92
parseTable[40]["false"] = 63
parseTable[40]["{"] = 39
parseTable[40]["tableconstructor"] = 56
parseTable[40]["Name"] = 23
parseTable[40][")"] = 93
parseTable[40]["prefixexp"] = 10
parseTable[40]["("] = 53
parseTable[40]["exp"] = 51
parseTable[40]["functioncall"] = 49
parseTable[41] = {}
parseTable[41]["do"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["=="] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["<="] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["while"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][")"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["("] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["+"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["*"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["-"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][","] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["/"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["."] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["return"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["import"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["{"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["then"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["}"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["repeat"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][">"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["else"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["eof"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][".."] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["function"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["or"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][";"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["Literal"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["transformer"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][":"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["syntax"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41][">="] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["<"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["["] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["elseif"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["and"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["if"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["break"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["for"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["until"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["Name"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["end"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["]"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["local"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["~="] = Production{"args", Rightside{"tableconstructor"}}
parseTable[41]["^"] = Production{"args", Rightside{"tableconstructor"}}
parseTable[42] = {}
parseTable[42]["Name"] = 94
parseTable[43] = {}
parseTable[43]["Number"] = 61
parseTable[43]["functiondef"] = 59
parseTable[43]["exp"] = 95
parseTable[43]["function"] = 58
parseTable[43]["("] = 53
parseTable[43]["var"] = 52
parseTable[43]["-"] = 54
parseTable[43]["true"] = 50
parseTable[43]["not"] = 57
parseTable[43]["Literal"] = 48
parseTable[43]["false"] = 63
parseTable[43]["tableconstructor"] = 56
parseTable[43]["{"] = 39
parseTable[43]["Name"] = 23
parseTable[43]["nil"] = 60
parseTable[43]["unop"] = 55
parseTable[43]["prefixexp"] = 10
parseTable[43]["functioncall"] = 49
parseTable[44] = {}
parseTable[44]["else"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["do"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["eof"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["while"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["function"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["("] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["end"] = Production{"init_part", Rightside{"empty"}}
parseTable[44][","] = 96
parseTable[44]["transformer"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["syntax"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["Name"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["return"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["elseif"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["import"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["if"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["break"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["for"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["until"] = Production{"init_part", Rightside{"empty"}}
parseTable[44][";"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["local"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["="] = 98
parseTable[44]["repeat"] = Production{"init_part", Rightside{"empty"}}
parseTable[44]["init"] = 97
parseTable[44]["init_part"] = 99
parseTable[45] = {}
parseTable[45]["else"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["do"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["eof"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["while"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["function"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["("] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["end"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45][","] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["transformer"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["syntax"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["return"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["elseif"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["if"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["break"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["for"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["until"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["Name"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["local"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["="] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["repeat"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45][";"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[45]["import"] = Production{"localvar_list", Rightside{"Name"}}
parseTable[46] = {}
parseTable[46]["Name"] = 100
parseTable[47] = {}
parseTable[47]["else"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["do"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["eof"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["while"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["function"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["("] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["end"] = Production{"result_part", Rightside{"explist"}}
parseTable[47][","] = 101
parseTable[47]["transformer"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["syntax"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["return"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["elseif"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["if"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["break"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["for"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["until"] = Production{"result_part", Rightside{"explist"}}
parseTable[47][";"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["local"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["repeat"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["Name"] = Production{"result_part", Rightside{"explist"}}
parseTable[47]["import"] = Production{"result_part", Rightside{"explist"}}
parseTable[48] = {}
parseTable[48][">="] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["=="] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["<="] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["while"] = Production{"exp", Rightside{"Literal"}}
parseTable[48][")"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["("] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["+"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["*"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["-"] = Production{"exp", Rightside{"Literal"}}
parseTable[48][","] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["/"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["return"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["import"] = Production{"exp", Rightside{"Literal"}}
parseTable[48][";"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["then"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["}"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["<"] = Production{"exp", Rightside{"Literal"}}
parseTable[48][">"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["else"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["eof"] = Production{"exp", Rightside{"Literal"}}
parseTable[48][".."] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["function"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["end"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["transformer"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["syntax"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["local"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["break"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["elseif"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["repeat"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["if"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["and"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["for"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["until"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["Name"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["or"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["]"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["~="] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["do"] = Production{"exp", Rightside{"Literal"}}
parseTable[48]["^"] = Production{"exp", Rightside{"Literal"}}
parseTable[49] = {}
parseTable[49]["~="] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["=="] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["<="] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["while"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49][")"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["("] = GetSelectorByLineNum(Production{"prefixexp", Rightside{"functioncall"}})
--Set{Production{"exp", Rightside{"functioncall"}}, Production{"prefixexp", Rightside{"functioncall"}}}
parseTable[49]["+"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["*"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["-"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49][","] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["/"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["."] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[49]["return"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["import"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["{"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[49][":"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[49]["}"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["<"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49][">"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["else"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["eof"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49][".."] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["function"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["end"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["then"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["break"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["transformer"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["repeat"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["syntax"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["local"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["or"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["Name"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["elseif"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["do"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["if"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["and"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["for"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["until"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["["] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[49][">="] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["]"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["Literal"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[49][";"] = Production{"exp", Rightside{"functioncall"}}
parseTable[49]["^"] = Production{"exp", Rightside{"functioncall"}}
parseTable[50] = {}
parseTable[50][">="] = Production{"exp", Rightside{"true"}}
parseTable[50]["=="] = Production{"exp", Rightside{"true"}}
parseTable[50]["<="] = Production{"exp", Rightside{"true"}}
parseTable[50]["while"] = Production{"exp", Rightside{"true"}}
parseTable[50][")"] = Production{"exp", Rightside{"true"}}
parseTable[50]["("] = Production{"exp", Rightside{"true"}}
parseTable[50]["+"] = Production{"exp", Rightside{"true"}}
parseTable[50]["*"] = Production{"exp", Rightside{"true"}}
parseTable[50]["-"] = Production{"exp", Rightside{"true"}}
parseTable[50][","] = Production{"exp", Rightside{"true"}}
parseTable[50]["/"] = Production{"exp", Rightside{"true"}}
parseTable[50]["return"] = Production{"exp", Rightside{"true"}}
parseTable[50]["import"] = Production{"exp", Rightside{"true"}}
parseTable[50][";"] = Production{"exp", Rightside{"true"}}
parseTable[50]["then"] = Production{"exp", Rightside{"true"}}
parseTable[50]["}"] = Production{"exp", Rightside{"true"}}
parseTable[50]["<"] = Production{"exp", Rightside{"true"}}
parseTable[50][">"] = Production{"exp", Rightside{"true"}}
parseTable[50]["else"] = Production{"exp", Rightside{"true"}}
parseTable[50]["eof"] = Production{"exp", Rightside{"true"}}
parseTable[50][".."] = Production{"exp", Rightside{"true"}}
parseTable[50]["function"] = Production{"exp", Rightside{"true"}}
parseTable[50]["end"] = Production{"exp", Rightside{"true"}}
parseTable[50]["transformer"] = Production{"exp", Rightside{"true"}}
parseTable[50]["syntax"] = Production{"exp", Rightside{"true"}}
parseTable[50]["local"] = Production{"exp", Rightside{"true"}}
parseTable[50]["break"] = Production{"exp", Rightside{"true"}}
parseTable[50]["elseif"] = Production{"exp", Rightside{"true"}}
parseTable[50]["repeat"] = Production{"exp", Rightside{"true"}}
parseTable[50]["if"] = Production{"exp", Rightside{"true"}}
parseTable[50]["and"] = Production{"exp", Rightside{"true"}}
parseTable[50]["for"] = Production{"exp", Rightside{"true"}}
parseTable[50]["until"] = Production{"exp", Rightside{"true"}}
parseTable[50]["Name"] = Production{"exp", Rightside{"true"}}
parseTable[50]["or"] = Production{"exp", Rightside{"true"}}
parseTable[50]["]"] = Production{"exp", Rightside{"true"}}
parseTable[50]["~="] = Production{"exp", Rightside{"true"}}
parseTable[50]["do"] = Production{"exp", Rightside{"true"}}
parseTable[50]["^"] = Production{"exp", Rightside{"true"}}
parseTable[51] = {}
parseTable[51][">="] = 109
parseTable[51]["=="] = 102
parseTable[51]["<="] = 105
parseTable[51]["while"] = Production{"explist", Rightside{"exp"}}
parseTable[51][")"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["("] = Production{"explist", Rightside{"exp"}}
parseTable[51]["+"] = 110
parseTable[51]["*"] = 113
parseTable[51]["-"] = 114
parseTable[51][","] = Production{"explist", Rightside{"exp"}}
parseTable[51]["/"] = 108
parseTable[51]["return"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["import"] = Production{"explist", Rightside{"exp"}}
parseTable[51][";"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["local"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["repeat"] = Production{"explist", Rightside{"exp"}}
parseTable[51][">"] = 111
parseTable[51]["else"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["eof"] = Production{"explist", Rightside{"exp"}}
parseTable[51][".."] = 103
parseTable[51]["function"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["end"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["binop"] = 106
parseTable[51]["transformer"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["syntax"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["elseif"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["~="] = 116
parseTable[51]["if"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["break"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["for"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["until"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["Name"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["or"] = 115
parseTable[51]["and"] = 104
parseTable[51]["do"] = Production{"explist", Rightside{"exp"}}
parseTable[51]["<"] = 107
parseTable[51]["^"] = 112
parseTable[52] = {}
parseTable[52]["~="] = Production{"exp", Rightside{"var"}}
parseTable[52]["=="] = Production{"exp", Rightside{"var"}}
parseTable[52]["<="] = Production{"exp", Rightside{"var"}}
parseTable[52]["while"] = Production{"exp", Rightside{"var"}}
parseTable[52][")"] = Production{"exp", Rightside{"var"}}
parseTable[52]["("] = GetSelectorByLineNum(Production{"prefixexp", Rightside{"var"}})
--Set{Production{"exp", Rightside{"var"}}, Production{"prefixexp", Rightside{"var"}}}
parseTable[52]["+"] = Production{"exp", Rightside{"var"}}
parseTable[52]["*"] = Production{"exp", Rightside{"var"}}
parseTable[52]["-"] = Production{"exp", Rightside{"var"}}
parseTable[52][","] = Production{"exp", Rightside{"var"}}
parseTable[52]["/"] = Production{"exp", Rightside{"var"}}
parseTable[52]["."] = Production{"prefixexp", Rightside{"var"}}
parseTable[52]["return"] = Production{"exp", Rightside{"var"}}
parseTable[52]["import"] = Production{"exp", Rightside{"var"}}
parseTable[52]["{"] = Production{"prefixexp", Rightside{"var"}}
parseTable[52][":"] = Production{"prefixexp", Rightside{"var"}}
parseTable[52]["}"] = Production{"exp", Rightside{"var"}}
parseTable[52]["<"] = Production{"exp", Rightside{"var"}}
parseTable[52][">"] = Production{"exp", Rightside{"var"}}
parseTable[52]["else"] = Production{"exp", Rightside{"var"}}
parseTable[52]["eof"] = Production{"exp", Rightside{"var"}}
parseTable[52][".."] = Production{"exp", Rightside{"var"}}
parseTable[52]["function"] = Production{"exp", Rightside{"var"}}
parseTable[52]["end"] = Production{"exp", Rightside{"var"}}
parseTable[52]["then"] = Production{"exp", Rightside{"var"}}
parseTable[52]["break"] = Production{"exp", Rightside{"var"}}
parseTable[52]["transformer"] = Production{"exp", Rightside{"var"}}
parseTable[52]["repeat"] = Production{"exp", Rightside{"var"}}
parseTable[52]["syntax"] = Production{"exp", Rightside{"var"}}
parseTable[52]["local"] = Production{"exp", Rightside{"var"}}
parseTable[52]["or"] = Production{"exp", Rightside{"var"}}
parseTable[52]["Name"] = Production{"exp", Rightside{"var"}}
parseTable[52]["elseif"] = Production{"exp", Rightside{"var"}}
parseTable[52]["do"] = Production{"exp", Rightside{"var"}}
parseTable[52]["if"] = Production{"exp", Rightside{"var"}}
parseTable[52]["and"] = Production{"exp", Rightside{"var"}}
parseTable[52]["for"] = Production{"exp", Rightside{"var"}}
parseTable[52]["until"] = Production{"exp", Rightside{"var"}}
parseTable[52]["["] = Production{"prefixexp", Rightside{"var"}}
parseTable[52][">="] = Production{"exp", Rightside{"var"}}
parseTable[52]["]"] = Production{"exp", Rightside{"var"}}
parseTable[52]["Literal"] = Production{"prefixexp", Rightside{"var"}}
parseTable[52][";"] = Production{"exp", Rightside{"var"}}
parseTable[52]["^"] = Production{"exp", Rightside{"var"}}
parseTable[53] = {}
parseTable[53]["Number"] = 61
parseTable[53]["functiondef"] = 59
parseTable[53]["exp"] = 117
parseTable[53]["function"] = 58
parseTable[53]["prefixexp"] = 10
parseTable[53]["var"] = 52
parseTable[53]["-"] = 54
parseTable[53]["true"] = 50
parseTable[53]["not"] = 57
parseTable[53]["Literal"] = 48
parseTable[53]["false"] = 63
parseTable[53]["tableconstructor"] = 56
parseTable[53]["Name"] = 23
parseTable[53]["{"] = 39
parseTable[53]["nil"] = 60
parseTable[53]["unop"] = 55
parseTable[53]["("] = 53
parseTable[53]["functioncall"] = 49
parseTable[54] = {}
parseTable[54]["Number"] = Production{"unop", Rightside{"-"}}
parseTable[54]["not"] = Production{"unop", Rightside{"-"}}
parseTable[54]["Literal"] = Production{"unop", Rightside{"-"}}
parseTable[54]["false"] = Production{"unop", Rightside{"-"}}
parseTable[54]["function"] = Production{"unop", Rightside{"-"}}
parseTable[54]["("] = Production{"unop", Rightside{"-"}}
parseTable[54]["Name"] = Production{"unop", Rightside{"-"}}
parseTable[54]["-"] = Production{"unop", Rightside{"-"}}
parseTable[54]["{"] = Production{"unop", Rightside{"-"}}
parseTable[54]["true"] = Production{"unop", Rightside{"-"}}
parseTable[54]["nil"] = Production{"unop", Rightside{"-"}}
parseTable[55] = {}
parseTable[55]["Number"] = 61
parseTable[55]["functiondef"] = 59
parseTable[55]["exp"] = 118
parseTable[55]["function"] = 58
parseTable[55]["prefixexp"] = 10
parseTable[55]["var"] = 52
parseTable[55]["-"] = 54
parseTable[55]["true"] = 50
parseTable[55]["not"] = 57
parseTable[55]["Literal"] = 48
parseTable[55]["false"] = 63
parseTable[55]["tableconstructor"] = 56
parseTable[55]["Name"] = 23
parseTable[55]["unop"] = 55
parseTable[55]["("] = 53
parseTable[55]["{"] = 39
parseTable[55]["nil"] = 60
parseTable[55]["functioncall"] = 49
parseTable[56] = {}
parseTable[56][">="] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["=="] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["<="] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["while"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56][")"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["("] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["+"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["*"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["-"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56][","] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["/"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["return"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["import"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56][";"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["then"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["}"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["<"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56][">"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["else"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["eof"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56][".."] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["function"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["end"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["transformer"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["syntax"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["local"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["break"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["elseif"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["repeat"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["if"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["and"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["for"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["until"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["Name"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["or"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["]"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["~="] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["do"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[56]["^"] = Production{"exp", Rightside{"tableconstructor"}}
parseTable[57] = {}
parseTable[57]["Number"] = Production{"unop", Rightside{"not"}}
parseTable[57]["not"] = Production{"unop", Rightside{"not"}}
parseTable[57]["Literal"] = Production{"unop", Rightside{"not"}}
parseTable[57]["false"] = Production{"unop", Rightside{"not"}}
parseTable[57]["function"] = Production{"unop", Rightside{"not"}}
parseTable[57]["("] = Production{"unop", Rightside{"not"}}
parseTable[57]["Name"] = Production{"unop", Rightside{"not"}}
parseTable[57]["-"] = Production{"unop", Rightside{"not"}}
parseTable[57]["{"] = Production{"unop", Rightside{"not"}}
parseTable[57]["true"] = Production{"unop", Rightside{"not"}}
parseTable[57]["nil"] = Production{"unop", Rightside{"not"}}
parseTable[58] = {}
parseTable[58]["("] = 82
parseTable[58]["funcbody"] = 119
parseTable[59] = {}
parseTable[59][">="] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["=="] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["<="] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["while"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59][")"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["("] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["+"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["*"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["-"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59][","] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["/"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["return"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["import"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59][";"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["then"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["}"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["<"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59][">"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["else"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["eof"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59][".."] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["function"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["end"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["transformer"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["syntax"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["local"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["break"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["elseif"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["repeat"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["if"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["and"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["for"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["until"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["Name"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["or"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["]"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["~="] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["do"] = Production{"exp", Rightside{"functiondef"}}
parseTable[59]["^"] = Production{"exp", Rightside{"functiondef"}}
parseTable[60] = {}
parseTable[60][">="] = Production{"exp", Rightside{"nil"}}
parseTable[60]["=="] = Production{"exp", Rightside{"nil"}}
parseTable[60]["<="] = Production{"exp", Rightside{"nil"}}
parseTable[60]["while"] = Production{"exp", Rightside{"nil"}}
parseTable[60][")"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["("] = Production{"exp", Rightside{"nil"}}
parseTable[60]["+"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["*"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["-"] = Production{"exp", Rightside{"nil"}}
parseTable[60][","] = Production{"exp", Rightside{"nil"}}
parseTable[60]["/"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["return"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["import"] = Production{"exp", Rightside{"nil"}}
parseTable[60][";"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["then"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["}"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["<"] = Production{"exp", Rightside{"nil"}}
parseTable[60][">"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["else"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["eof"] = Production{"exp", Rightside{"nil"}}
parseTable[60][".."] = Production{"exp", Rightside{"nil"}}
parseTable[60]["function"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["end"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["transformer"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["syntax"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["local"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["break"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["elseif"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["repeat"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["if"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["and"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["for"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["until"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["Name"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["or"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["]"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["~="] = Production{"exp", Rightside{"nil"}}
parseTable[60]["do"] = Production{"exp", Rightside{"nil"}}
parseTable[60]["^"] = Production{"exp", Rightside{"nil"}}
parseTable[61] = {}
parseTable[61][">="] = Production{"exp", Rightside{"Number"}}
parseTable[61]["=="] = Production{"exp", Rightside{"Number"}}
parseTable[61]["<="] = Production{"exp", Rightside{"Number"}}
parseTable[61]["while"] = Production{"exp", Rightside{"Number"}}
parseTable[61][")"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["("] = Production{"exp", Rightside{"Number"}}
parseTable[61]["+"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["*"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["-"] = Production{"exp", Rightside{"Number"}}
parseTable[61][","] = Production{"exp", Rightside{"Number"}}
parseTable[61]["/"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["return"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["import"] = Production{"exp", Rightside{"Number"}}
parseTable[61][";"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["then"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["}"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["<"] = Production{"exp", Rightside{"Number"}}
parseTable[61][">"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["else"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["eof"] = Production{"exp", Rightside{"Number"}}
parseTable[61][".."] = Production{"exp", Rightside{"Number"}}
parseTable[61]["function"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["end"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["transformer"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["syntax"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["local"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["break"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["elseif"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["repeat"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["if"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["and"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["for"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["until"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["Name"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["or"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["]"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["~="] = Production{"exp", Rightside{"Number"}}
parseTable[61]["do"] = Production{"exp", Rightside{"Number"}}
parseTable[61]["^"] = Production{"exp", Rightside{"Number"}}
parseTable[62] = {}
parseTable[62]["else"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["do"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["eof"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["while"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["function"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["("] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["end"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["transformer"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["syntax"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["return"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["elseif"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["if"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["break"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["for"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["until"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["Name"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["local"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["repeat"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62][";"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[62]["import"] = Production{"stat", Rightside{"return", "result_part"}}
parseTable[63] = {}
parseTable[63][">="] = Production{"exp", Rightside{"false"}}
parseTable[63]["=="] = Production{"exp", Rightside{"false"}}
parseTable[63]["<="] = Production{"exp", Rightside{"false"}}
parseTable[63]["while"] = Production{"exp", Rightside{"false"}}
parseTable[63][")"] = Production{"exp", Rightside{"false"}}
parseTable[63]["("] = Production{"exp", Rightside{"false"}}
parseTable[63]["+"] = Production{"exp", Rightside{"false"}}
parseTable[63]["*"] = Production{"exp", Rightside{"false"}}
parseTable[63]["-"] = Production{"exp", Rightside{"false"}}
parseTable[63][","] = Production{"exp", Rightside{"false"}}
parseTable[63]["/"] = Production{"exp", Rightside{"false"}}
parseTable[63]["return"] = Production{"exp", Rightside{"false"}}
parseTable[63]["import"] = Production{"exp", Rightside{"false"}}
parseTable[63][";"] = Production{"exp", Rightside{"false"}}
parseTable[63]["then"] = Production{"exp", Rightside{"false"}}
parseTable[63]["}"] = Production{"exp", Rightside{"false"}}
parseTable[63]["<"] = Production{"exp", Rightside{"false"}}
parseTable[63][">"] = Production{"exp", Rightside{"false"}}
parseTable[63]["else"] = Production{"exp", Rightside{"false"}}
parseTable[63]["eof"] = Production{"exp", Rightside{"false"}}
parseTable[63][".."] = Production{"exp", Rightside{"false"}}
parseTable[63]["function"] = Production{"exp", Rightside{"false"}}
parseTable[63]["end"] = Production{"exp", Rightside{"false"}}
parseTable[63]["transformer"] = Production{"exp", Rightside{"false"}}
parseTable[63]["syntax"] = Production{"exp", Rightside{"false"}}
parseTable[63]["local"] = Production{"exp", Rightside{"false"}}
parseTable[63]["break"] = Production{"exp", Rightside{"false"}}
parseTable[63]["elseif"] = Production{"exp", Rightside{"false"}}
parseTable[63]["repeat"] = Production{"exp", Rightside{"false"}}
parseTable[63]["if"] = Production{"exp", Rightside{"false"}}
parseTable[63]["and"] = Production{"exp", Rightside{"false"}}
parseTable[63]["for"] = Production{"exp", Rightside{"false"}}
parseTable[63]["until"] = Production{"exp", Rightside{"false"}}
parseTable[63]["Name"] = Production{"exp", Rightside{"false"}}
parseTable[63]["or"] = Production{"exp", Rightside{"false"}}
parseTable[63]["]"] = Production{"exp", Rightside{"false"}}
parseTable[63]["~="] = Production{"exp", Rightside{"false"}}
parseTable[63]["do"] = Production{"exp", Rightside{"false"}}
parseTable[63]["^"] = Production{"exp", Rightside{"false"}}
parseTable[64] = {}
parseTable[64]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[64]["do"] = 26
parseTable[64]["while"] = 19
parseTable[64]["function"] = 5
parseTable[64]["prefixexp"] = 10
parseTable[64]["var"] = 14
parseTable[64]["optional_stat_list"] = 75
parseTable[64]["block"] = 120
parseTable[64]["stat"] = 76
parseTable[64]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[64]["return"] = 12
parseTable[64]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[64]["stat_list"] = 73
parseTable[64]["if"] = 22
parseTable[64]["break"] = 7
parseTable[64]["for"] = 18
parseTable[64]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[64]["Name"] = 23
parseTable[64]["local"] = 11
parseTable[64]["varlist"] = 15
parseTable[64]["repeat"] = 24
parseTable[64]["("] = 17
parseTable[64]["functioncall"] = 3
parseTable[65] = {}
parseTable[65]["Number"] = 61
parseTable[65]["functiondef"] = 59
parseTable[65]["unop"] = 55
parseTable[65]["function"] = 58
parseTable[65]["("] = 53
parseTable[65]["var"] = 52
parseTable[65]["-"] = 54
parseTable[65]["true"] = 50
parseTable[65]["not"] = 57
parseTable[65]["Literal"] = 48
parseTable[65]["explist"] = 121
parseTable[65]["false"] = 63
parseTable[65]["tableconstructor"] = 56
parseTable[65]["Name"] = 23
parseTable[65]["{"] = 39
parseTable[65]["exp"] = 51
parseTable[65]["prefixexp"] = 10
parseTable[65]["nil"] = 60
parseTable[65]["functioncall"] = 49
parseTable[66] = {}
parseTable[66]["("] = 17
parseTable[66]["Name"] = 23
parseTable[66]["var"] = 123
parseTable[66]["prefixexp"] = 10
parseTable[66]["functioncall"] = 122
parseTable[67] = {}
parseTable[67]["~="] = 116
parseTable[67]["=="] = 102
parseTable[67]["<="] = 105
parseTable[67][".."] = 103
parseTable[67][")"] = 124
parseTable[67]["+"] = 110
parseTable[67]["or"] = 115
parseTable[67]["-"] = 114
parseTable[67]["/"] = 108
parseTable[67]["and"] = 104
parseTable[67]["*"] = 113
parseTable[67][">="] = 109
parseTable[67]["binop"] = 106
parseTable[67]["<"] = 107
parseTable[67][">"] = 111
parseTable[67]["^"] = 112
parseTable[68] = {}
parseTable[68]["in"] = 125
parseTable[68][","] = 126
parseTable[69] = {}
parseTable[69]["in"] = Production{"namelist", Rightside{"Name"}}
parseTable[69][","] = Production{"namelist", Rightside{"Name"}}
parseTable[69]["="] = 127
parseTable[70] = {}
parseTable[70]["do"] = 128
parseTable[70]["=="] = 102
parseTable[70]["<="] = 105
parseTable[70][".."] = 103
parseTable[70]["+"] = 110
parseTable[70]["*"] = 113
parseTable[70]["binop"] = 106
parseTable[70]["/"] = 108
parseTable[70]["and"] = 104
parseTable[70]["-"] = 114
parseTable[70]["~="] = 116
parseTable[70][">="] = 109
parseTable[70]["or"] = 115
parseTable[70]["<"] = 107
parseTable[70][">"] = 111
parseTable[70]["^"] = 112
parseTable[71] = {}
parseTable[71]["syntax"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["do"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["eof"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["if"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["return"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["while"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["import"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["function"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["("] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["Name"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["local"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["for"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["repeat"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["transformer"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[71]["break"] = Production{"one_stat", Rightside{"stat", "stat_sep"}}
parseTable[72] = {}
parseTable[72][">="] = 109
parseTable[72]["=="] = 102
parseTable[72]["<="] = 105
parseTable[72][".."] = 103
parseTable[72]["+"] = 110
parseTable[72]["*"] = 113
parseTable[72]["-"] = 114
parseTable[72]["/"] = 108
parseTable[72]["and"] = 104
parseTable[72]["binop"] = 106
parseTable[72]["~="] = 116
parseTable[72]["then"] = 129
parseTable[72]["or"] = 115
parseTable[72]["<"] = 107
parseTable[72][">"] = 111
parseTable[72]["^"] = 112
parseTable[73] = {}
parseTable[73]["else"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["do"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["eof"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["while"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["function"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["("] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["end"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["transformer"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["syntax"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["return"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["elseif"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["if"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["break"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["for"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["until"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["Name"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["local"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73]["stat_sep"] = 130
parseTable[73]["repeat"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[73][";"] = 34
parseTable[73]["import"] = Production{"stat_sep", Rightside{"empty"}}
parseTable[74] = {}
parseTable[74]["until"] = 131
parseTable[75] = {}
parseTable[75]["until"] = Production{"block", Rightside{"optional_stat_list"}}
parseTable[75]["end"] = Production{"block", Rightside{"optional_stat_list"}}
parseTable[75]["elseif"] = Production{"block", Rightside{"optional_stat_list"}}
parseTable[75]["else"] = Production{"block", Rightside{"optional_stat_list"}}
parseTable[76] = {}
parseTable[76]["else"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["do"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["while"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["function"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["("] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["end"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["return"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["elseif"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["if"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["break"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["for"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["until"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["Name"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["local"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76]["repeat"] = Production{"stat_list", Rightside{"stat"}}
parseTable[76][";"] = Production{"stat_list", Rightside{"stat"}}
parseTable[77] = {}
parseTable[77]["end"] = 132
parseTable[78] = {}
parseTable[78]["syntax"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["do"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["eof"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["break"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["return"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["if"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["import"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["function"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["("] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["Name"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["local"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["for"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["repeat"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["transformer"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[78]["while"] = Production{"metastat", Rightside{"transformerdef", "stat_sep"}}
parseTable[79] = {}
parseTable[79]["syntax"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["do"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["eof"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["break"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["return"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["if"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["import"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["function"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["("] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["Name"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["local"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["for"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["repeat"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["transformer"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[79]["while"] = Production{"metastat", Rightside{"syntaxdef", "stat_sep"}}
parseTable[80] = {}
parseTable[80]["Literal"] = 133
parseTable[81] = {}
parseTable[81]["("] = Production{"colone_name", Rightside{"empty"}}
parseTable[81]["colone_name"] = 135
parseTable[81][":"] = 136
parseTable[81]["."] = 134
parseTable[82] = {}
parseTable[82][")"] = Production{"optional_parlist", Rightside{"empty"}}
parseTable[82]["..."] = 139
parseTable[82]["Name"] = 140
parseTable[82]["parname_list"] = 137
parseTable[82]["parlist"] = 141
parseTable[82]["optional_parlist"] = 138
parseTable[83] = {}
parseTable[83]["else"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["do"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["eof"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["while"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["function"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["("] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["end"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["transformer"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["syntax"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["return"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["elseif"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["if"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["break"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["for"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["until"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["Name"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["local"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["repeat"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83][";"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[83]["import"] = Production{"stat", Rightside{"function", "funcname", "funcbody"}}
parseTable[84] = {}
parseTable[84]["tableconstructor"] = 41
parseTable[84]["{"] = 39
parseTable[84]["args"] = 142
parseTable[84]["Literal"] = 38
parseTable[84]["("] = 40
parseTable[85] = {}
parseTable[85][";"] = 144
parseTable[85]["}"] = Production{"optional_fieldlist", Rightside{"fieldlist"}}
parseTable[85][","] = 145
parseTable[85]["fieldsep"] = 143
parseTable[86] = {}
parseTable[86]["}"] = 146
parseTable[87] = {}
parseTable[87]["~="] = 116
parseTable[87]["=="] = 102
parseTable[87]["<="] = 105
parseTable[87][".."] = 103
parseTable[87]["+"] = 110
parseTable[87]["or"] = 115
parseTable[87]["-"] = 114
parseTable[87][","] = Production{"field", Rightside{"exp"}}
parseTable[87]["/"] = 108
parseTable[87]["and"] = 104
parseTable[87]["*"] = 113
parseTable[87]["^"] = 112
parseTable[87][";"] = Production{"field", Rightside{"exp"}}
parseTable[87][">="] = 109
parseTable[87]["}"] = Production{"field", Rightside{"exp"}}
parseTable[87]["<"] = 107
parseTable[87]["binop"] = 106
parseTable[87][">"] = 111
parseTable[88] = {}
parseTable[88]["="] = 147
parseTable[89] = {}
parseTable[89]["}"] = Production{"fieldlist", Rightside{"field"}}
parseTable[89][","] = Production{"fieldlist", Rightside{"field"}}
parseTable[89][";"] = Production{"fieldlist", Rightside{"field"}}
parseTable[90] = {}
parseTable[90][">="] = Production{"var", Rightside{"Name"}}
parseTable[90]["=="] = Production{"var", Rightside{"Name"}}
parseTable[90]["<="] = Production{"var", Rightside{"Name"}}
parseTable[90]["while"] = Production{"var", Rightside{"Name"}}
parseTable[90][")"] = Production{"var", Rightside{"Name"}}
parseTable[90]["("] = Production{"var", Rightside{"Name"}}
parseTable[90]["+"] = Production{"var", Rightside{"Name"}}
parseTable[90]["*"] = Production{"var", Rightside{"Name"}}
parseTable[90]["-"] = Production{"var", Rightside{"Name"}}
parseTable[90][","] = Production{"var", Rightside{"Name"}}
parseTable[90]["/"] = Production{"var", Rightside{"Name"}}
parseTable[90]["."] = Production{"var", Rightside{"Name"}}
parseTable[90]["return"] = Production{"var", Rightside{"Name"}}
parseTable[90]["import"] = Production{"var", Rightside{"Name"}}
parseTable[90]["{"] = Production{"var", Rightside{"Name"}}
parseTable[90]["then"] = Production{"var", Rightside{"Name"}}
parseTable[90]["="] = Production{"keyname", Rightside{"Name"}}
--Set{Production{"var", Rightside{"Name"}}, Production{"keyname", Rightside{"Name"}}}
parseTable[90]["repeat"] = Production{"var", Rightside{"Name"}}
parseTable[90][">"] = Production{"var", Rightside{"Name"}}
parseTable[90]["else"] = Production{"var", Rightside{"Name"}}
parseTable[90]["eof"] = Production{"var", Rightside{"Name"}}
parseTable[90][".."] = Production{"var", Rightside{"Name"}}
parseTable[90]["function"] = Production{"var", Rightside{"Name"}}
parseTable[90]["}"] = Production{"var", Rightside{"Name"}}
parseTable[90]["end"] = Production{"var", Rightside{"Name"}}
parseTable[90][":"] = Production{"var", Rightside{"Name"}}
parseTable[90]["local"] = Production{"var", Rightside{"Name"}}
parseTable[90]["transformer"] = Production{"var", Rightside{"Name"}}
parseTable[90]["~="] = Production{"var", Rightside{"Name"}}
parseTable[90]["syntax"] = Production{"var", Rightside{"Name"}}
parseTable[90]["or"] = Production{"var", Rightside{"Name"}}
parseTable[90]["Name"] = Production{"var", Rightside{"Name"}}
parseTable[90]["do"] = Production{"var", Rightside{"Name"}}
parseTable[90]["elseif"] = Production{"var", Rightside{"Name"}}
parseTable[90]["break"] = Production{"var", Rightside{"Name"}}
parseTable[90]["if"] = Production{"var", Rightside{"Name"}}
parseTable[90]["and"] = Production{"var", Rightside{"Name"}}
parseTable[90]["for"] = Production{"var", Rightside{"Name"}}
parseTable[90]["until"] = Production{"var", Rightside{"Name"}}
parseTable[90]["["] = Production{"var", Rightside{"Name"}}
parseTable[90][";"] = Production{"var", Rightside{"Name"}}
parseTable[90]["]"] = Production{"var", Rightside{"Name"}}
parseTable[90]["Literal"] = Production{"var", Rightside{"Name"}}
parseTable[90]["<"] = Production{"var", Rightside{"Name"}}
parseTable[90]["^"] = Production{"var", Rightside{"Name"}}
parseTable[91] = {}
parseTable[91]["Number"] = 61
parseTable[91]["functiondef"] = 59
parseTable[91]["exp"] = 148
parseTable[91]["function"] = 58
parseTable[91]["prefixexp"] = 10
parseTable[91]["var"] = 52
parseTable[91]["-"] = 54
parseTable[91]["true"] = 50
parseTable[91]["not"] = 57
parseTable[91]["Literal"] = 48
parseTable[91]["false"] = 63
parseTable[91]["tableconstructor"] = 56
parseTable[91]["{"] = 39
parseTable[91]["Name"] = 23
parseTable[91]["unop"] = 55
parseTable[91]["nil"] = 60
parseTable[91]["("] = 53
parseTable[91]["functioncall"] = 49
parseTable[92] = {}
parseTable[92][")"] = 149
parseTable[92][","] = 101
parseTable[93] = {}
parseTable[93]["do"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["=="] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["<="] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["while"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][")"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["("] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["+"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["*"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["-"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][","] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["/"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["."] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["return"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["import"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["{"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["then"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["}"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["repeat"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][">"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["else"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["eof"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][".."] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["function"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["or"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][";"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["Literal"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["transformer"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][":"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["syntax"] = Production{"args", Rightside{"(", ")"}}
parseTable[93][">="] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["<"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["["] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["elseif"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["and"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["if"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["break"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["for"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["until"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["Name"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["end"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["]"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["local"] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["~="] = Production{"args", Rightside{"(", ")"}}
parseTable[93]["^"] = Production{"args", Rightside{"(", ")"}}
parseTable[94] = {}
parseTable[94][">="] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["=="] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["<="] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["while"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94][")"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["("] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["+"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["*"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["-"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94][","] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["/"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["."] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["return"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["import"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["{"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["then"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["="] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["repeat"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94][">"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["else"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["eof"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94][".."] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["function"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["}"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["end"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94][":"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["local"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["transformer"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["~="] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["syntax"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["or"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["Name"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["do"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["elseif"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["break"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["if"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["and"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["for"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["until"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["["] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94][";"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["]"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["Literal"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["<"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[94]["^"] = Production{"var", Rightside{"prefixexp", ".", "Name"}}
parseTable[95] = {}
parseTable[95]["~="] = 116
parseTable[95]["=="] = 102
parseTable[95]["<="] = 105
parseTable[95][".."] = 103
parseTable[95]["+"] = 110
parseTable[95]["or"] = 115
parseTable[95]["binop"] = 106
parseTable[95]["/"] = 108
parseTable[95]["and"] = 104
parseTable[95]["-"] = 114
parseTable[95][">"] = 111
parseTable[95][">="] = 109
parseTable[95]["]"] = 150
parseTable[95]["<"] = 107
parseTable[95]["*"] = 113
parseTable[95]["^"] = 112
parseTable[96] = {}
parseTable[96]["Name"] = 151
parseTable[97] = {}
parseTable[97]["else"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["do"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["eof"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["while"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["function"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["("] = Production{"init_part", Rightside{"init"}}
parseTable[97]["end"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["transformer"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["syntax"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["return"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["elseif"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["if"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["break"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["for"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["until"] = Production{"init_part", Rightside{"init"}}
parseTable[97][";"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["local"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["repeat"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["Name"] = Production{"init_part", Rightside{"init"}}
parseTable[97]["import"] = Production{"init_part", Rightside{"init"}}
parseTable[98] = {}
parseTable[98]["Number"] = 61
parseTable[98]["functiondef"] = 59
parseTable[98]["exp"] = 51
parseTable[98]["function"] = 58
parseTable[98]["prefixexp"] = 10
parseTable[98]["var"] = 52
parseTable[98]["-"] = 54
parseTable[98]["true"] = 50
parseTable[98]["not"] = 57
parseTable[98]["Literal"] = 48
parseTable[98]["explist"] = 152
parseTable[98]["false"] = 63
parseTable[98]["tableconstructor"] = 56
parseTable[98]["Name"] = 23
parseTable[98]["{"] = 39
parseTable[98]["unop"] = 55
parseTable[98]["nil"] = 60
parseTable[98]["("] = 53
parseTable[98]["functioncall"] = 49
parseTable[99] = {}
parseTable[99]["else"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["do"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["eof"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["while"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["function"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["("] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["end"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["transformer"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["syntax"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["return"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["elseif"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["if"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["break"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["for"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["until"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["Name"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["local"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["repeat"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99][";"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[99]["import"] = Production{"stat", Rightside{"local", "localvar_list", "init_part"}}
parseTable[100] = {}
parseTable[100]["("] = 82
parseTable[100]["funcbody"] = 153
parseTable[101] = {}
parseTable[101]["Number"] = 61
parseTable[101]["functiondef"] = 59
parseTable[101]["unop"] = 55
parseTable[101]["function"] = 58
parseTable[101]["prefixexp"] = 10
parseTable[101]["var"] = 52
parseTable[101]["-"] = 54
parseTable[101]["true"] = 50
parseTable[101]["not"] = 57
parseTable[101]["Literal"] = 48
parseTable[101]["false"] = 63
parseTable[101]["tableconstructor"] = 56
parseTable[101]["{"] = 39
parseTable[101]["Name"] = 23
parseTable[101]["exp"] = 154
parseTable[101]["("] = 53
parseTable[101]["nil"] = 60
parseTable[101]["functioncall"] = 49
parseTable[102] = {}
parseTable[102]["Number"] = Production{"binop", Rightside{"=="}}
parseTable[102]["not"] = Production{"binop", Rightside{"=="}}
parseTable[102]["Literal"] = Production{"binop", Rightside{"=="}}
parseTable[102]["false"] = Production{"binop", Rightside{"=="}}
parseTable[102]["function"] = Production{"binop", Rightside{"=="}}
parseTable[102]["("] = Production{"binop", Rightside{"=="}}
parseTable[102]["Name"] = Production{"binop", Rightside{"=="}}
parseTable[102]["-"] = Production{"binop", Rightside{"=="}}
parseTable[102]["{"] = Production{"binop", Rightside{"=="}}
parseTable[102]["true"] = Production{"binop", Rightside{"=="}}
parseTable[102]["nil"] = Production{"binop", Rightside{"=="}}
parseTable[103] = {}
parseTable[103]["Number"] = Production{"binop", Rightside{".."}}
parseTable[103]["not"] = Production{"binop", Rightside{".."}}
parseTable[103]["Literal"] = Production{"binop", Rightside{".."}}
parseTable[103]["false"] = Production{"binop", Rightside{".."}}
parseTable[103]["function"] = Production{"binop", Rightside{".."}}
parseTable[103]["("] = Production{"binop", Rightside{".."}}
parseTable[103]["Name"] = Production{"binop", Rightside{".."}}
parseTable[103]["-"] = Production{"binop", Rightside{".."}}
parseTable[103]["{"] = Production{"binop", Rightside{".."}}
parseTable[103]["true"] = Production{"binop", Rightside{".."}}
parseTable[103]["nil"] = Production{"binop", Rightside{".."}}
parseTable[104] = {}
parseTable[104]["Number"] = Production{"binop", Rightside{"and"}}
parseTable[104]["not"] = Production{"binop", Rightside{"and"}}
parseTable[104]["Literal"] = Production{"binop", Rightside{"and"}}
parseTable[104]["false"] = Production{"binop", Rightside{"and"}}
parseTable[104]["function"] = Production{"binop", Rightside{"and"}}
parseTable[104]["("] = Production{"binop", Rightside{"and"}}
parseTable[104]["Name"] = Production{"binop", Rightside{"and"}}
parseTable[104]["-"] = Production{"binop", Rightside{"and"}}
parseTable[104]["{"] = Production{"binop", Rightside{"and"}}
parseTable[104]["true"] = Production{"binop", Rightside{"and"}}
parseTable[104]["nil"] = Production{"binop", Rightside{"and"}}
parseTable[105] = {}
parseTable[105]["Number"] = Production{"binop", Rightside{"<="}}
parseTable[105]["not"] = Production{"binop", Rightside{"<="}}
parseTable[105]["Literal"] = Production{"binop", Rightside{"<="}}
parseTable[105]["false"] = Production{"binop", Rightside{"<="}}
parseTable[105]["function"] = Production{"binop", Rightside{"<="}}
parseTable[105]["("] = Production{"binop", Rightside{"<="}}
parseTable[105]["Name"] = Production{"binop", Rightside{"<="}}
parseTable[105]["-"] = Production{"binop", Rightside{"<="}}
parseTable[105]["{"] = Production{"binop", Rightside{"<="}}
parseTable[105]["true"] = Production{"binop", Rightside{"<="}}
parseTable[105]["nil"] = Production{"binop", Rightside{"<="}}
parseTable[106] = {}
parseTable[106]["Number"] = 61
parseTable[106]["functiondef"] = 59
parseTable[106]["exp"] = 155
parseTable[106]["function"] = 58
parseTable[106]["("] = 53
parseTable[106]["var"] = 52
parseTable[106]["-"] = 54
parseTable[106]["true"] = 50
parseTable[106]["not"] = 57
parseTable[106]["Literal"] = 48
parseTable[106]["false"] = 63
parseTable[106]["tableconstructor"] = 56
parseTable[106]["Name"] = 23
parseTable[106]["unop"] = 55
parseTable[106]["{"] = 39
parseTable[106]["nil"] = 60
parseTable[106]["prefixexp"] = 10
parseTable[106]["functioncall"] = 49
parseTable[107] = {}
parseTable[107]["Number"] = Production{"binop", Rightside{"<"}}
parseTable[107]["not"] = Production{"binop", Rightside{"<"}}
parseTable[107]["Literal"] = Production{"binop", Rightside{"<"}}
parseTable[107]["false"] = Production{"binop", Rightside{"<"}}
parseTable[107]["function"] = Production{"binop", Rightside{"<"}}
parseTable[107]["("] = Production{"binop", Rightside{"<"}}
parseTable[107]["Name"] = Production{"binop", Rightside{"<"}}
parseTable[107]["-"] = Production{"binop", Rightside{"<"}}
parseTable[107]["{"] = Production{"binop", Rightside{"<"}}
parseTable[107]["true"] = Production{"binop", Rightside{"<"}}
parseTable[107]["nil"] = Production{"binop", Rightside{"<"}}
parseTable[108] = {}
parseTable[108]["Number"] = Production{"binop", Rightside{"/"}}
parseTable[108]["not"] = Production{"binop", Rightside{"/"}}
parseTable[108]["Literal"] = Production{"binop", Rightside{"/"}}
parseTable[108]["false"] = Production{"binop", Rightside{"/"}}
parseTable[108]["function"] = Production{"binop", Rightside{"/"}}
parseTable[108]["("] = Production{"binop", Rightside{"/"}}
parseTable[108]["Name"] = Production{"binop", Rightside{"/"}}
parseTable[108]["-"] = Production{"binop", Rightside{"/"}}
parseTable[108]["{"] = Production{"binop", Rightside{"/"}}
parseTable[108]["true"] = Production{"binop", Rightside{"/"}}
parseTable[108]["nil"] = Production{"binop", Rightside{"/"}}
parseTable[109] = {}
parseTable[109]["Number"] = Production{"binop", Rightside{">="}}
parseTable[109]["not"] = Production{"binop", Rightside{">="}}
parseTable[109]["Literal"] = Production{"binop", Rightside{">="}}
parseTable[109]["false"] = Production{"binop", Rightside{">="}}
parseTable[109]["function"] = Production{"binop", Rightside{">="}}
parseTable[109]["("] = Production{"binop", Rightside{">="}}
parseTable[109]["Name"] = Production{"binop", Rightside{">="}}
parseTable[109]["-"] = Production{"binop", Rightside{">="}}
parseTable[109]["{"] = Production{"binop", Rightside{">="}}
parseTable[109]["true"] = Production{"binop", Rightside{">="}}
parseTable[109]["nil"] = Production{"binop", Rightside{">="}}
parseTable[110] = {}
parseTable[110]["Number"] = Production{"binop", Rightside{"+"}}
parseTable[110]["not"] = Production{"binop", Rightside{"+"}}
parseTable[110]["Literal"] = Production{"binop", Rightside{"+"}}
parseTable[110]["false"] = Production{"binop", Rightside{"+"}}
parseTable[110]["function"] = Production{"binop", Rightside{"+"}}
parseTable[110]["("] = Production{"binop", Rightside{"+"}}
parseTable[110]["Name"] = Production{"binop", Rightside{"+"}}
parseTable[110]["-"] = Production{"binop", Rightside{"+"}}
parseTable[110]["{"] = Production{"binop", Rightside{"+"}}
parseTable[110]["true"] = Production{"binop", Rightside{"+"}}
parseTable[110]["nil"] = Production{"binop", Rightside{"+"}}
parseTable[111] = {}
parseTable[111]["Number"] = Production{"binop", Rightside{">"}}
parseTable[111]["not"] = Production{"binop", Rightside{">"}}
parseTable[111]["Literal"] = Production{"binop", Rightside{">"}}
parseTable[111]["false"] = Production{"binop", Rightside{">"}}
parseTable[111]["function"] = Production{"binop", Rightside{">"}}
parseTable[111]["("] = Production{"binop", Rightside{">"}}
parseTable[111]["Name"] = Production{"binop", Rightside{">"}}
parseTable[111]["-"] = Production{"binop", Rightside{">"}}
parseTable[111]["{"] = Production{"binop", Rightside{">"}}
parseTable[111]["true"] = Production{"binop", Rightside{">"}}
parseTable[111]["nil"] = Production{"binop", Rightside{">"}}
parseTable[112] = {}
parseTable[112]["Number"] = Production{"binop", Rightside{"^"}}
parseTable[112]["not"] = Production{"binop", Rightside{"^"}}
parseTable[112]["Literal"] = Production{"binop", Rightside{"^"}}
parseTable[112]["false"] = Production{"binop", Rightside{"^"}}
parseTable[112]["function"] = Production{"binop", Rightside{"^"}}
parseTable[112]["("] = Production{"binop", Rightside{"^"}}
parseTable[112]["Name"] = Production{"binop", Rightside{"^"}}
parseTable[112]["-"] = Production{"binop", Rightside{"^"}}
parseTable[112]["{"] = Production{"binop", Rightside{"^"}}
parseTable[112]["true"] = Production{"binop", Rightside{"^"}}
parseTable[112]["nil"] = Production{"binop", Rightside{"^"}}
parseTable[113] = {}
parseTable[113]["Number"] = Production{"binop", Rightside{"*"}}
parseTable[113]["not"] = Production{"binop", Rightside{"*"}}
parseTable[113]["Literal"] = Production{"binop", Rightside{"*"}}
parseTable[113]["false"] = Production{"binop", Rightside{"*"}}
parseTable[113]["function"] = Production{"binop", Rightside{"*"}}
parseTable[113]["("] = Production{"binop", Rightside{"*"}}
parseTable[113]["Name"] = Production{"binop", Rightside{"*"}}
parseTable[113]["-"] = Production{"binop", Rightside{"*"}}
parseTable[113]["{"] = Production{"binop", Rightside{"*"}}
parseTable[113]["true"] = Production{"binop", Rightside{"*"}}
parseTable[113]["nil"] = Production{"binop", Rightside{"*"}}
parseTable[114] = {}
parseTable[114]["Number"] = Production{"binop", Rightside{"-"}}
parseTable[114]["not"] = Production{"binop", Rightside{"-"}}
parseTable[114]["Literal"] = Production{"binop", Rightside{"-"}}
parseTable[114]["false"] = Production{"binop", Rightside{"-"}}
parseTable[114]["function"] = Production{"binop", Rightside{"-"}}
parseTable[114]["("] = Production{"binop", Rightside{"-"}}
parseTable[114]["Name"] = Production{"binop", Rightside{"-"}}
parseTable[114]["-"] = Production{"binop", Rightside{"-"}}
parseTable[114]["{"] = Production{"binop", Rightside{"-"}}
parseTable[114]["true"] = Production{"binop", Rightside{"-"}}
parseTable[114]["nil"] = Production{"binop", Rightside{"-"}}
parseTable[115] = {}
parseTable[115]["Number"] = Production{"binop", Rightside{"or"}}
parseTable[115]["not"] = Production{"binop", Rightside{"or"}}
parseTable[115]["Literal"] = Production{"binop", Rightside{"or"}}
parseTable[115]["false"] = Production{"binop", Rightside{"or"}}
parseTable[115]["function"] = Production{"binop", Rightside{"or"}}
parseTable[115]["("] = Production{"binop", Rightside{"or"}}
parseTable[115]["Name"] = Production{"binop", Rightside{"or"}}
parseTable[115]["-"] = Production{"binop", Rightside{"or"}}
parseTable[115]["{"] = Production{"binop", Rightside{"or"}}
parseTable[115]["true"] = Production{"binop", Rightside{"or"}}
parseTable[115]["nil"] = Production{"binop", Rightside{"or"}}
parseTable[116] = {}
parseTable[116]["Number"] = Production{"binop", Rightside{"~="}}
parseTable[116]["not"] = Production{"binop", Rightside{"~="}}
parseTable[116]["Literal"] = Production{"binop", Rightside{"~="}}
parseTable[116]["false"] = Production{"binop", Rightside{"~="}}
parseTable[116]["function"] = Production{"binop", Rightside{"~="}}
parseTable[116]["("] = Production{"binop", Rightside{"~="}}
parseTable[116]["Name"] = Production{"binop", Rightside{"~="}}
parseTable[116]["-"] = Production{"binop", Rightside{"~="}}
parseTable[116]["{"] = Production{"binop", Rightside{"~="}}
parseTable[116]["true"] = Production{"binop", Rightside{"~="}}
parseTable[116]["nil"] = Production{"binop", Rightside{"~="}}
parseTable[117] = {}
parseTable[117][">="] = 109
parseTable[117]["=="] = 102
parseTable[117]["<="] = 105
parseTable[117][".."] = 103
parseTable[117][")"] = 156
parseTable[117]["+"] = 110
parseTable[117]["*"] = 113
parseTable[117]["-"] = 114
parseTable[117]["/"] = 108
parseTable[117]["and"] = 104
parseTable[117]["~="] = 116
parseTable[117]["^"] = 112
parseTable[117]["binop"] = 106
parseTable[117]["<"] = 107
parseTable[117]["or"] = 115
parseTable[117][">"] = 111
parseTable[118] = {}
parseTable[118]["~="] = Production{"exp", Rightside{"unop", "exp"}}
--Set{116, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["=="] = Production{"exp", Rightside{"unop", "exp"}}
--Set{102, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["<="] = Production{"exp", Rightside{"unop", "exp"}}
--Set{105, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["while"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118][")"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["("] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["+"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{110, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["*"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{Production{"exp", Rightside{"unop", "exp"}}, 113}
parseTable[118]["-"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{114, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118][","] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["/"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{108, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["return"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["import"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118][";"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["then"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["}"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["<"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{Production{"exp", Rightside{"unop", "exp"}}, 107}
parseTable[118][">"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{111, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["else"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["eof"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118][".."] = Production{"exp", Rightside{"unop", "exp"}}
--Set{103, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["function"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["end"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["binop"] = 106
parseTable[118]["transformer"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["syntax"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["break"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["repeat"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["elseif"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["do"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["if"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["and"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{Production{"exp", Rightside{"unop", "exp"}}, 104}
parseTable[118]["for"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["until"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["Name"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["or"] = Production{"exp", Rightside{"unop", "exp"}}
--Set{115, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["]"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118][">="] = Production{"exp", Rightside{"unop", "exp"}}
--Set{109, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[118]["local"] = Production{"exp", Rightside{"unop", "exp"}}
parseTable[118]["^"] = 112
--Set{112, Production{"exp", Rightside{"unop", "exp"}}}
parseTable[119] = {}
parseTable[119]["do"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["=="] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["<="] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["while"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119][")"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["("] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["+"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["*"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["-"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119][","] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["/"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["return"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["import"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119][";"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["local"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["}"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["repeat"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119][">"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["else"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["eof"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119][".."] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["function"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["or"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["transformer"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["syntax"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["<"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["then"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["elseif"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["and"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["if"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["break"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["for"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["until"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["Name"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119][">="] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["]"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["end"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["~="] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[119]["^"] = Production{"functiondef", Rightside{"function", "funcbody"}}
parseTable[120] = {}
parseTable[120]["end"] = 157
parseTable[121] = {}
parseTable[121]["else"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["do"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["eof"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["while"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["function"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["("] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["end"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121][","] = 101
parseTable[121]["transformer"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["syntax"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["return"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["elseif"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["if"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["break"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["for"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["until"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["Name"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["local"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["repeat"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121][";"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[121]["import"] = Production{"stat", Rightside{"varlist", "=", "explist"}}
parseTable[122] = {}
parseTable[122]["("] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[122]["["] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[122][":"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[122]["Literal"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[122]["{"] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[122]["."] = Production{"prefixexp", Rightside{"functioncall"}}
parseTable[123] = {}
parseTable[123]["Literal"] = Production{"prefixexp", Rightside{"var"}}
parseTable[123]["("] = Production{"prefixexp", Rightside{"var"}}
parseTable[123]["{"] = Production{"prefixexp", Rightside{"var"}}
parseTable[123][":"] = Production{"prefixexp", Rightside{"var"}}
parseTable[123]["="] = Production{"varlist", Rightside{"varlist", ",", "var"}}
parseTable[123][","] = Production{"varlist", Rightside{"varlist", ",", "var"}}
parseTable[123]["["] = Production{"prefixexp", Rightside{"var"}}
parseTable[123]["."] = Production{"prefixexp", Rightside{"var"}}
parseTable[124] = {}
parseTable[124]["("] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[124]["["] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[124][":"] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[124]["Literal"] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[124]["{"] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[124]["."] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[125] = {}
parseTable[125]["Number"] = 61
parseTable[125]["functiondef"] = 59
parseTable[125]["exp"] = 51
parseTable[125]["function"] = 58
parseTable[125]["prefixexp"] = 10
parseTable[125]["var"] = 52
parseTable[125]["-"] = 54
parseTable[125]["true"] = 50
parseTable[125]["not"] = 57
parseTable[125]["Literal"] = 48
parseTable[125]["explist"] = 158
parseTable[125]["false"] = 63
parseTable[125]["tableconstructor"] = 56
parseTable[125]["{"] = 39
parseTable[125]["unop"] = 55
parseTable[125]["Name"] = 23
parseTable[125]["("] = 53
parseTable[125]["nil"] = 60
parseTable[125]["functioncall"] = 49
parseTable[126] = {}
parseTable[126]["Name"] = 159
parseTable[127] = {}
parseTable[127]["Number"] = 61
parseTable[127]["functiondef"] = 59
parseTable[127]["unop"] = 55
parseTable[127]["function"] = 58
parseTable[127]["prefixexp"] = 10
parseTable[127]["var"] = 52
parseTable[127]["-"] = 54
parseTable[127]["true"] = 50
parseTable[127]["not"] = 57
parseTable[127]["Literal"] = 48
parseTable[127]["false"] = 63
parseTable[127]["tableconstructor"] = 56
parseTable[127]["Name"] = 23
parseTable[127]["exp"] = 160
parseTable[127]["("] = 53
parseTable[127]["{"] = 39
parseTable[127]["nil"] = 60
parseTable[127]["functioncall"] = 49
parseTable[128] = {}
parseTable[128]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[128]["do"] = 26
parseTable[128]["while"] = 19
parseTable[128]["function"] = 5
parseTable[128]["prefixexp"] = 10
parseTable[128]["var"] = 14
parseTable[128]["optional_stat_list"] = 75
parseTable[128]["block"] = 161
parseTable[128]["stat"] = 76
parseTable[128]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[128]["return"] = 12
parseTable[128]["varlist"] = 15
parseTable[128]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[128]["if"] = 22
parseTable[128]["break"] = 7
parseTable[128]["for"] = 18
parseTable[128]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[128]["Name"] = 23
parseTable[128]["local"] = 11
parseTable[128]["("] = 17
parseTable[128]["repeat"] = 24
parseTable[128]["stat_list"] = 73
parseTable[128]["functioncall"] = 3
parseTable[129] = {}
parseTable[129]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[129]["do"] = 26
parseTable[129]["while"] = 19
parseTable[129]["function"] = 5
parseTable[129]["("] = 17
parseTable[129]["var"] = 14
parseTable[129]["optional_stat_list"] = 75
parseTable[129]["block"] = 162
parseTable[129]["stat"] = 76
parseTable[129]["stat_list"] = 73
parseTable[129]["return"] = 12
parseTable[129]["varlist"] = 15
parseTable[129]["prefixexp"] = 10
parseTable[129]["if"] = 22
parseTable[129]["break"] = 7
parseTable[129]["for"] = 18
parseTable[129]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[129]["Name"] = 23
parseTable[129]["local"] = 11
parseTable[129]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[129]["repeat"] = 24
parseTable[129]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[129]["functioncall"] = 3
parseTable[130] = {}
parseTable[130]["else"] = Production{"optional_stat_list", Rightside{"stat_list", "stat_sep"}}
parseTable[130]["do"] = 26
parseTable[130]["while"] = 19
parseTable[130]["function"] = 5
parseTable[130]["prefixexp"] = 10
parseTable[130]["end"] = Production{"optional_stat_list", Rightside{"stat_list", "stat_sep"}}
parseTable[130]["stat"] = 163
parseTable[130]["return"] = 12
parseTable[130]["elseif"] = Production{"optional_stat_list", Rightside{"stat_list", "stat_sep"}}
parseTable[130]["varlist"] = 15
parseTable[130]["if"] = 22
parseTable[130]["break"] = 7
parseTable[130]["for"] = 18
parseTable[130]["until"] = Production{"optional_stat_list", Rightside{"stat_list", "stat_sep"}}
parseTable[130]["Name"] = 23
parseTable[130]["local"] = 11
parseTable[130]["var"] = 14
parseTable[130]["repeat"] = 24
parseTable[130]["("] = 17
parseTable[130]["functioncall"] = 3
parseTable[131] = {}
parseTable[131]["Number"] = 61
parseTable[131]["functiondef"] = 59
parseTable[131]["exp"] = 164
parseTable[131]["function"] = 58
parseTable[131]["prefixexp"] = 10
parseTable[131]["var"] = 52
parseTable[131]["-"] = 54
parseTable[131]["true"] = 50
parseTable[131]["not"] = 57
parseTable[131]["Literal"] = 48
parseTable[131]["false"] = 63
parseTable[131]["tableconstructor"] = 56
parseTable[131]["{"] = 39
parseTable[131]["unop"] = 55
parseTable[131]["nil"] = 60
parseTable[131]["("] = 53
parseTable[131]["Name"] = 23
parseTable[131]["functioncall"] = 49
parseTable[132] = {}
parseTable[132]["else"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["do"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["eof"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["while"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["function"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["("] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["end"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["transformer"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["syntax"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["return"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["elseif"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["if"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["break"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["for"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["until"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["Name"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["local"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["repeat"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132][";"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[132]["import"] = Production{"stat", Rightside{"do", "block", "end"}}
parseTable[133] = {}
parseTable[133]["do"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["eof"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["while"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["function"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["("] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["transformer"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["syntax"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["return"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["if"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["import"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["for"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133][";"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["local"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["repeat"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["Name"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[133]["break"] = Production{"syntaxdef", Rightside{"syntax", "Name", ":", "Literal"}}
parseTable[134] = {}
parseTable[134]["Name"] = 165
parseTable[135] = {}
parseTable[135]["("] = Production{"funcname", Rightside{"Name", "dotname_list", "colone_name"}}
parseTable[136] = {}
parseTable[136]["Name"] = 166
parseTable[137] = {}
parseTable[137][")"] = Production{"parlist", Rightside{"parname_list"}}
parseTable[137][","] = 167
parseTable[138] = {}
parseTable[138][")"] = 168
parseTable[139] = {}
parseTable[139][")"] = Production{"parlist", Rightside{"..."}}
parseTable[140] = {}
parseTable[140][")"] = Production{"parname_list", Rightside{"Name"}}
parseTable[140][","] = Production{"parname_list", Rightside{"Name"}}
parseTable[141] = {}
parseTable[141][")"] = Production{"optional_parlist", Rightside{"parlist"}}
parseTable[142] = {}
parseTable[142]["do"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["=="] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["<="] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["while"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][")"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["("] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["+"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["*"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["-"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][","] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["/"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["."] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["Literal"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["import"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["{"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["then"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["}"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["repeat"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][">"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["else"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["eof"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][".."] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["function"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["or"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["end"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["local"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["transformer"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["Name"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["syntax"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][":"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][";"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["~="] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["elseif"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["break"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["if"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["and"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["for"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["until"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["["] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142][">="] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["]"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["return"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["<"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[142]["^"] = Production{"functioncall", Rightside{"prefixexp", ":", "Name", "args"}}
parseTable[143] = {}
parseTable[143]["Number"] = 61
parseTable[143]["functiondef"] = 59
parseTable[143]["exp"] = 87
parseTable[143]["function"] = 58
parseTable[143]["prefixexp"] = 10
parseTable[143]["var"] = 52
parseTable[143]["-"] = 54
parseTable[143]["true"] = 50
parseTable[143]["not"] = 57
parseTable[143]["Literal"] = 48
parseTable[143]["nil"] = 60
parseTable[143]["false"] = 63
parseTable[143]["Name"] = 90
parseTable[143]["unop"] = 55
parseTable[143]["field"] = 169
parseTable[143]["tableconstructor"] = 56
parseTable[143]["{"] = 39
parseTable[143]["keyname"] = 88
parseTable[143]["}"] = Production{"optional_fieldlist", Rightside{"fieldlist", "fieldsep"}}
parseTable[143]["["] = 91
parseTable[143]["("] = 53
parseTable[143]["functioncall"] = 49
parseTable[144] = {}
parseTable[144]["Number"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["not"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["Literal"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["false"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["["] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["function"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["nil"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["{"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["Name"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["}"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["("] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["-"] = Production{"fieldsep", Rightside{";"}}
parseTable[144]["true"] = Production{"fieldsep", Rightside{";"}}
parseTable[145] = {}
parseTable[145]["Number"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["not"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["Literal"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["false"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["["] = Production{"fieldsep", Rightside{","}}
parseTable[145]["function"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["nil"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["{"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["Name"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["}"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["("] = Production{"fieldsep", Rightside{","}}
parseTable[145]["-"] = Production{"fieldsep", Rightside{","}}
parseTable[145]["true"] = Production{"fieldsep", Rightside{","}}
parseTable[146] = {}
parseTable[146]["do"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["=="] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["<="] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["while"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][")"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["("] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["+"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["*"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["-"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][","] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["/"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["."] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["Literal"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["import"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][";"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["then"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["}"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["<"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][">"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["else"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["eof"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][".."] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["function"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["end"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][":"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["break"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["transformer"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["repeat"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["syntax"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["or"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["local"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["Name"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["elseif"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["~="] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["if"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["and"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["for"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["until"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["["] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146][">="] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["]"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["{"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["return"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[146]["^"] = Production{"tableconstructor", Rightside{"{", "optional_fieldlist", "}"}}
parseTable[147] = {}
parseTable[147]["Number"] = 61
parseTable[147]["functiondef"] = 59
parseTable[147]["exp"] = 170
parseTable[147]["function"] = 58
parseTable[147]["nil"] = 60
parseTable[147]["var"] = 52
parseTable[147]["-"] = 54
parseTable[147]["true"] = 50
parseTable[147]["not"] = 57
parseTable[147]["Literal"] = 48
parseTable[147]["false"] = 63
parseTable[147]["tableconstructor"] = 56
parseTable[147]["Name"] = 23
parseTable[147]["{"] = 39
parseTable[147]["unop"] = 55
parseTable[147]["("] = 53
parseTable[147]["prefixexp"] = 10
parseTable[147]["functioncall"] = 49
parseTable[148] = {}
parseTable[148][">="] = 109
parseTable[148]["=="] = 102
parseTable[148]["<="] = 105
parseTable[148][".."] = 103
parseTable[148]["+"] = 110
parseTable[148]["or"] = 115
parseTable[148]["binop"] = 106
parseTable[148]["/"] = 108
parseTable[148]["and"] = 104
parseTable[148]["-"] = 114
parseTable[148]["~="] = 116
parseTable[148]["*"] = 113
parseTable[148]["]"] = 171
parseTable[148]["<"] = 107
parseTable[148][">"] = 111
parseTable[148]["^"] = 112
parseTable[149] = {}
parseTable[149]["do"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["=="] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["<="] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["while"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][")"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["("] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["+"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["*"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["-"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][","] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["/"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["."] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["return"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["import"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["{"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["then"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["}"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["repeat"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][">"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["else"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["eof"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][".."] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["function"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["or"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][";"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["Literal"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["transformer"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][":"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["syntax"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149][">="] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["<"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["["] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["elseif"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["and"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["if"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["break"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["for"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["until"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["Name"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["end"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["]"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["local"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["~="] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[149]["^"] = Production{"args", Rightside{"(", "explist", ")"}}
parseTable[150] = {}
parseTable[150][">="] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["=="] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["<="] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["while"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150][")"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["("] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["+"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["*"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["-"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150][","] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["/"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["."] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["return"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["import"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["{"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["then"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["="] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["repeat"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150][">"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["else"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["eof"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150][".."] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["function"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["}"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["end"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150][":"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["local"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["transformer"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["~="] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["syntax"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["or"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["Name"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["do"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["elseif"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["break"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["if"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["and"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["for"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["until"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["["] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150][";"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["]"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["Literal"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["<"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[150]["^"] = Production{"var", Rightside{"prefixexp", "[", "exp", "]"}}
parseTable[151] = {}
parseTable[151]["else"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["do"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["eof"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["while"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["function"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["("] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["end"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151][","] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["transformer"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["syntax"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["return"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["elseif"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["if"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["break"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["for"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["until"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["Name"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["local"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["="] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["repeat"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151][";"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[151]["import"] = Production{"localvar_list", Rightside{"localvar_list", ",", "Name"}}
parseTable[152] = {}
parseTable[152]["else"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["do"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["eof"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["while"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["function"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["("] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["end"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152][","] = 101
parseTable[152]["transformer"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["syntax"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["return"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["elseif"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["if"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["break"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["for"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["until"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["Name"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["local"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["repeat"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152][";"] = Production{"init", Rightside{"=", "explist"}}
parseTable[152]["import"] = Production{"init", Rightside{"=", "explist"}}
parseTable[153] = {}
parseTable[153]["else"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["do"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["eof"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["while"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["function"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["("] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["end"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["transformer"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["syntax"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["return"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["elseif"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["if"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["break"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["for"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["until"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["Name"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["local"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["repeat"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153][";"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[153]["import"] = Production{"stat", Rightside{"local", "function", "Name", "funcbody"}}
parseTable[154] = {}
parseTable[154]["do"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["=="] = 102
parseTable[154]["<="] = 105
parseTable[154]["while"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154][")"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["("] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["+"] = 110
parseTable[154]["*"] = 113
parseTable[154]["-"] = 114
parseTable[154][","] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["/"] = 108
parseTable[154]["return"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["import"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154][";"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["local"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["<"] = 107
parseTable[154][">"] = 111
parseTable[154]["else"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["eof"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154][".."] = 103
parseTable[154]["function"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["end"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["binop"] = 106
parseTable[154]["transformer"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["syntax"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["elseif"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["or"] = 115
parseTable[154]["if"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["and"] = 104
parseTable[154]["for"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["until"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["Name"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["repeat"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["~="] = 116
parseTable[154][">="] = 109
parseTable[154]["break"] = Production{"explist", Rightside{"explist", ",", "exp"}}
parseTable[154]["^"] = 112
parseTable[155] = {}
parseTable[155]["~="] = GetSelectorByBinopPrecedence(116)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 116}
parseTable[155]["=="] = GetSelectorByBinopPrecedence(102)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 102}
parseTable[155]["<="] = GetSelectorByBinopPrecedence(105)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 105}
parseTable[155]["while"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155][")"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["("] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["+"] = GetSelectorByBinopPrecedence(110)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 110}
parseTable[155]["*"] = GetSelectorByBinopPrecedence(113)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 113}
parseTable[155]["-"] = GetSelectorByBinopPrecedence(114)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 114}
parseTable[155][","] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["/"] = GetSelectorByBinopPrecedence(108)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 108}
parseTable[155]["return"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["import"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155][";"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["then"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["}"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["<"] = GetSelectorByBinopPrecedence(107)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 107}
parseTable[155][">"] = GetSelectorByBinopPrecedence(111)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 111}
parseTable[155]["else"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["eof"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155][".."] = GetSelectorByBinopPrecedence(103)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 103}
parseTable[155]["function"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["end"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["binop"] = 106
parseTable[155]["transformer"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["syntax"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["break"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["repeat"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["elseif"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155][">="] = GetSelectorByBinopPrecedence(109)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 109}
parseTable[155]["if"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["and"] = GetSelectorByBinopPrecedence(104)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 104}
parseTable[155]["for"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["until"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["Name"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["do"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["]"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["local"] = Production{"exp", Rightside{"exp", "binop", "exp"}}
parseTable[155]["or"] = GetSelectorByBinopPrecedence(115)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 115}
parseTable[155]["^"] = GetSelectorByBinopPrecedence(112)
--Set{Production{"exp", Rightside{"exp", "binop", "exp"}}, 112}
parseTable[156] = {}
parseTable[156][">="] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["=="] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["<="] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["while"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156][")"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["("] = GetSelectorByLineNum(Production{"prefixexp", Rightside{"(", "exp", ")"}})
--Set{Production{"exp", Rightside{"(", "exp", ")"}}, Production{"prefixexp", Rightside{"(", "exp", ")"}}}
parseTable[156]["+"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["*"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["-"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156][","] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["/"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["."] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[156]["return"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["import"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156][";"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["then"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["}"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["<"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156][">"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["else"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["eof"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156][".."] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["function"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["end"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["{"] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[156]["Literal"] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[156]["transformer"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156][":"] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[156]["syntax"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["["] = Production{"prefixexp", Rightside{"(", "exp", ")"}}
parseTable[156]["local"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["break"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["elseif"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["repeat"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["if"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["and"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["for"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["until"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["Name"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["or"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["]"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["~="] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["do"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[156]["^"] = Production{"exp", Rightside{"(", "exp", ")"}}
parseTable[157] = {}
parseTable[157]["do"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["eof"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["while"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["function"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["("] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["transformer"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["syntax"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["return"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["if"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["import"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["for"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157][";"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["local"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["repeat"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["Name"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[157]["break"] = Production{"transformerdef", Rightside{"transformer", "Name", "block", "end"}}
parseTable[158] = {}
parseTable[158][","] = 101
parseTable[158]["do"] = 172
parseTable[159] = {}
parseTable[159]["in"] = Production{"namelist", Rightside{"namelist", ",", "Name"}}
parseTable[159][","] = Production{"namelist", Rightside{"namelist", ",", "Name"}}
parseTable[160] = {}
parseTable[160]["~="] = 116
parseTable[160]["=="] = 102
parseTable[160]["<="] = 105
parseTable[160][".."] = 103
parseTable[160]["+"] = 110
parseTable[160]["*"] = 113
parseTable[160]["-"] = 114
parseTable[160][","] = 173
parseTable[160]["/"] = 108
parseTable[160]["and"] = 104
parseTable[160]["^"] = 112
parseTable[160]["or"] = 115
parseTable[160][">="] = 109
parseTable[160]["<"] = 107
parseTable[160]["binop"] = 106
parseTable[160][">"] = 111
parseTable[161] = {}
parseTable[161]["end"] = 174
parseTable[162] = {}
parseTable[162]["elseif_part"] = 176
parseTable[162]["else"] = Production{"optional_elseif_part", Rightside{"empty"}}
parseTable[162]["end"] = Production{"optional_elseif_part", Rightside{"empty"}}
parseTable[162]["elseif"] = 175
parseTable[162]["optional_elseif_part"] = 177
parseTable[163] = {}
parseTable[163]["else"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["do"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["while"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["function"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["("] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["end"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["return"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["elseif"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["if"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["break"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["for"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["until"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["Name"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["local"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163]["repeat"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[163][";"] = Production{"stat_list", Rightside{"stat_list", "stat_sep", "stat"}}
parseTable[164] = {}
parseTable[164]["~="] = 116
parseTable[164]["=="] = 102
parseTable[164]["<="] = 105
parseTable[164]["while"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["("] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["+"] = 110
parseTable[164]["*"] = 113
parseTable[164]["-"] = 114
parseTable[164]["/"] = 108
parseTable[164]["return"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["import"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164][";"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["local"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["<"] = 107
parseTable[164][">"] = 111
parseTable[164]["else"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["eof"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164][".."] = 103
parseTable[164]["function"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["end"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["binop"] = 106
parseTable[164]["transformer"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["syntax"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["elseif"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["or"] = 115
parseTable[164]["if"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["and"] = 104
parseTable[164]["for"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["until"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["Name"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["do"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164][">="] = 109
parseTable[164]["repeat"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["break"] = Production{"stat", Rightside{"repeat", "block", "until", "exp"}}
parseTable[164]["^"] = 112
parseTable[165] = {}
parseTable[165]["("] = Production{"dotname_list", Rightside{"dotname_list", ".", "Name"}}
parseTable[165][":"] = Production{"dotname_list", Rightside{"dotname_list", ".", "Name"}}
parseTable[165]["."] = Production{"dotname_list", Rightside{"dotname_list", ".", "Name"}}
parseTable[166] = {}
parseTable[166]["("] = Production{"colone_name", Rightside{":", "Name"}}
parseTable[167] = {}
parseTable[167]["..."] = 179
parseTable[167]["Name"] = 178
parseTable[168] = {}
parseTable[168]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[168]["do"] = 26
parseTable[168]["while"] = 19
parseTable[168]["function"] = 5
parseTable[168]["prefixexp"] = 10
parseTable[168]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[168]["optional_stat_list"] = 75
parseTable[168]["block"] = 180
parseTable[168]["stat"] = 76
parseTable[168]["var"] = 14
parseTable[168]["return"] = 12
parseTable[168]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[168]["varlist"] = 15
parseTable[168]["if"] = 22
parseTable[168]["break"] = 7
parseTable[168]["for"] = 18
parseTable[168]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[168]["stat_list"] = 73
parseTable[168]["local"] = 11
parseTable[168]["Name"] = 23
parseTable[168]["repeat"] = 24
parseTable[168]["("] = 17
parseTable[168]["functioncall"] = 3
parseTable[169] = {}
parseTable[169]["}"] = Production{"fieldlist", Rightside{"fieldlist", "fieldsep", "field"}}
parseTable[169][","] = Production{"fieldlist", Rightside{"fieldlist", "fieldsep", "field"}}
parseTable[169][";"] = Production{"fieldlist", Rightside{"fieldlist", "fieldsep", "field"}}
parseTable[170] = {}
parseTable[170]["~="] = 116
parseTable[170]["=="] = 102
parseTable[170]["<="] = 105
parseTable[170][".."] = 103
parseTable[170]["+"] = 110
parseTable[170]["or"] = 115
parseTable[170]["-"] = 114
parseTable[170][","] = Production{"field", Rightside{"keyname", "=", "exp"}}
parseTable[170]["/"] = 108
parseTable[170]["and"] = 104
parseTable[170][">"] = 111
parseTable[170][">="] = 109
parseTable[170][";"] = Production{"field", Rightside{"keyname", "=", "exp"}}
parseTable[170]["binop"] = 106
parseTable[170]["}"] = Production{"field", Rightside{"keyname", "=", "exp"}}
parseTable[170]["<"] = 107
parseTable[170]["*"] = 113
parseTable[170]["^"] = 112
parseTable[171] = {}
parseTable[171]["="] = 181
parseTable[172] = {}
parseTable[172]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[172]["do"] = 26
parseTable[172]["while"] = 19
parseTable[172]["function"] = 5
parseTable[172]["prefixexp"] = 10
parseTable[172]["var"] = 14
parseTable[172]["optional_stat_list"] = 75
parseTable[172]["block"] = 182
parseTable[172]["stat"] = 76
parseTable[172]["("] = 17
parseTable[172]["return"] = 12
parseTable[172]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[172]["stat_list"] = 73
parseTable[172]["if"] = 22
parseTable[172]["break"] = 7
parseTable[172]["for"] = 18
parseTable[172]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[172]["Name"] = 23
parseTable[172]["local"] = 11
parseTable[172]["varlist"] = 15
parseTable[172]["repeat"] = 24
parseTable[172]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[172]["functioncall"] = 3
parseTable[173] = {}
parseTable[173]["Number"] = 61
parseTable[173]["functiondef"] = 59
parseTable[173]["unop"] = 55
parseTable[173]["function"] = 58
parseTable[173]["("] = 53
parseTable[173]["var"] = 52
parseTable[173]["-"] = 54
parseTable[173]["true"] = 50
parseTable[173]["not"] = 57
parseTable[173]["Literal"] = 48
parseTable[173]["false"] = 63
parseTable[173]["tableconstructor"] = 56
parseTable[173]["Name"] = 23
parseTable[173]["nil"] = 60
parseTable[173]["{"] = 39
parseTable[173]["exp"] = 183
parseTable[173]["prefixexp"] = 10
parseTable[173]["functioncall"] = 49
parseTable[174] = {}
parseTable[174]["else"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["do"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["eof"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["while"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["function"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["("] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["end"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["transformer"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["syntax"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["return"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["elseif"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["if"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["break"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["for"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["until"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["Name"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["local"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["repeat"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174][";"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[174]["import"] = Production{"stat", Rightside{"while", "exp", "do", "block", "end"}}
parseTable[175] = {}
parseTable[175]["Number"] = 61
parseTable[175]["functiondef"] = 59
parseTable[175]["unop"] = 55
parseTable[175]["function"] = 58
parseTable[175]["nil"] = 60
parseTable[175]["var"] = 52
parseTable[175]["-"] = 54
parseTable[175]["true"] = 50
parseTable[175]["not"] = 57
parseTable[175]["Literal"] = 48
parseTable[175]["false"] = 63
parseTable[175]["tableconstructor"] = 56
parseTable[175]["{"] = 39
parseTable[175]["Name"] = 23
parseTable[175]["("] = 53
parseTable[175]["exp"] = 184
parseTable[175]["prefixexp"] = 10
parseTable[175]["functioncall"] = 49
parseTable[176] = {}
parseTable[176]["elseif"] = 185
parseTable[176]["else"] = Production{"optional_elseif_part", Rightside{"elseif_part"}}
parseTable[176]["end"] = Production{"optional_elseif_part", Rightside{"elseif_part"}}
parseTable[177] = {}
parseTable[177]["optional_else_part"] = 186
parseTable[177]["else"] = 187
parseTable[177]["end"] = Production{"optional_else_part", Rightside{"empty"}}
parseTable[178] = {}
parseTable[178][")"] = Production{"parname_list", Rightside{"parname_list", ",", "Name"}}
parseTable[178][","] = Production{"parname_list", Rightside{"parname_list", ",", "Name"}}
parseTable[179] = {}
parseTable[179][")"] = Production{"parlist", Rightside{"parname_list", ",", "..."}}
parseTable[180] = {}
parseTable[180]["end"] = 188
parseTable[181] = {}
parseTable[181]["Number"] = 61
parseTable[181]["functiondef"] = 59
parseTable[181]["unop"] = 55
parseTable[181]["function"] = 58
parseTable[181]["prefixexp"] = 10
parseTable[181]["var"] = 52
parseTable[181]["-"] = 54
parseTable[181]["true"] = 50
parseTable[181]["not"] = 57
parseTable[181]["Literal"] = 48
parseTable[181]["false"] = 63
parseTable[181]["tableconstructor"] = 56
parseTable[181]["{"] = 39
parseTable[181]["Name"] = 23
parseTable[181]["exp"] = 189
parseTable[181]["nil"] = 60
parseTable[181]["("] = 53
parseTable[181]["functioncall"] = 49
parseTable[182] = {}
parseTable[182]["end"] = 190
parseTable[183] = {}
parseTable[183]["~="] = 116
parseTable[183]["=="] = 102
parseTable[183]["<="] = 105
parseTable[183][".."] = 103
parseTable[183]["+"] = 110
parseTable[183]["or"] = 115
parseTable[183]["-"] = 114
parseTable[183][","] = 192
parseTable[183]["/"] = 108
parseTable[183]["and"] = 104
parseTable[183]["^"] = 112
parseTable[183]["*"] = 113
parseTable[183][">="] = 109
parseTable[183]["binop"] = 106
parseTable[183]["<"] = 107
parseTable[183]["do"] = 191
parseTable[183][">"] = 111
parseTable[184] = {}
parseTable[184]["~="] = 116
parseTable[184]["=="] = 102
parseTable[184]["<="] = 105
parseTable[184][".."] = 103
parseTable[184]["+"] = 110
parseTable[184]["or"] = 115
parseTable[184]["-"] = 114
parseTable[184]["/"] = 108
parseTable[184]["and"] = 104
parseTable[184][">="] = 109
parseTable[184][">"] = 111
parseTable[184]["then"] = 193
parseTable[184]["*"] = 113
parseTable[184]["<"] = 107
parseTable[184]["binop"] = 106
parseTable[184]["^"] = 112
parseTable[185] = {}
parseTable[185]["Number"] = 61
parseTable[185]["functiondef"] = 59
parseTable[185]["unop"] = 55
parseTable[185]["function"] = 58
parseTable[185]["nil"] = 60
parseTable[185]["var"] = 52
parseTable[185]["-"] = 54
parseTable[185]["true"] = 50
parseTable[185]["not"] = 57
parseTable[185]["Literal"] = 48
parseTable[185]["false"] = 63
parseTable[185]["tableconstructor"] = 56
parseTable[185]["{"] = 39
parseTable[185]["exp"] = 194
parseTable[185]["Name"] = 23
parseTable[185]["prefixexp"] = 10
parseTable[185]["("] = 53
parseTable[185]["functioncall"] = 49
parseTable[186] = {}
parseTable[186]["end"] = 195
parseTable[187] = {}
parseTable[187]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[187]["do"] = 26
parseTable[187]["while"] = 19
parseTable[187]["function"] = 5
parseTable[187]["prefixexp"] = 10
parseTable[187]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[187]["optional_stat_list"] = 75
parseTable[187]["block"] = 196
parseTable[187]["stat"] = 76
parseTable[187]["var"] = 14
parseTable[187]["return"] = 12
parseTable[187]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[187]["Name"] = 23
parseTable[187]["if"] = 22
parseTable[187]["break"] = 7
parseTable[187]["for"] = 18
parseTable[187]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[187]["stat_list"] = 73
parseTable[187]["local"] = 11
parseTable[187]["varlist"] = 15
parseTable[187]["repeat"] = 24
parseTable[187]["("] = 17
parseTable[187]["functioncall"] = 3
parseTable[188] = {}
parseTable[188]["do"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["=="] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["<="] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["while"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188][")"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["("] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["+"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["*"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["-"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188][","] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["/"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["return"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["import"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188][";"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["then"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["}"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["repeat"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188][">"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["else"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["eof"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188][".."] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["function"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["end"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["transformer"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["syntax"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["local"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["<"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["elseif"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["and"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["if"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["break"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["for"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["until"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["Name"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["~="] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["]"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["or"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188][">="] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[188]["^"] = Production{"funcbody", Rightside{"(", "optional_parlist", ")", "block", "end"}}
parseTable[189] = {}
parseTable[189][">="] = 109
parseTable[189]["=="] = 102
parseTable[189]["<="] = 105
parseTable[189][".."] = 103
parseTable[189]["+"] = 110
parseTable[189]["or"] = 115
parseTable[189]["binop"] = 106
parseTable[189][","] = Production{"field", Rightside{"[", "exp", "]", "=", "exp"}}
parseTable[189]["/"] = 108
parseTable[189]["and"] = 104
parseTable[189]["-"] = 114
parseTable[189]["*"] = 113
parseTable[189][";"] = Production{"field", Rightside{"[", "exp", "]", "=", "exp"}}
parseTable[189]["~="] = 116
parseTable[189]["}"] = Production{"field", Rightside{"[", "exp", "]", "=", "exp"}}
parseTable[189]["<"] = 107
parseTable[189][">"] = 111
parseTable[189]["^"] = 112
parseTable[190] = {}
parseTable[190]["else"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["do"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["eof"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["while"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["function"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["("] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["end"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["transformer"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["syntax"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["return"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["elseif"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["if"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["break"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["for"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["until"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["Name"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["local"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["repeat"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190][";"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[190]["import"] = Production{"stat", Rightside{"for", "namelist", "in", "explist", "do", "block", "end"}}
parseTable[191] = {}
parseTable[191]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[191]["do"] = 26
parseTable[191]["while"] = 19
parseTable[191]["function"] = 5
parseTable[191]["("] = 17
parseTable[191]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[191]["optional_stat_list"] = 75
parseTable[191]["block"] = 197
parseTable[191]["stat"] = 76
parseTable[191]["Name"] = 23
parseTable[191]["return"] = 12
parseTable[191]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[191]["var"] = 14
parseTable[191]["if"] = 22
parseTable[191]["break"] = 7
parseTable[191]["for"] = 18
parseTable[191]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[191]["stat_list"] = 73
parseTable[191]["local"] = 11
parseTable[191]["varlist"] = 15
parseTable[191]["repeat"] = 24
parseTable[191]["prefixexp"] = 10
parseTable[191]["functioncall"] = 3
parseTable[192] = {}
parseTable[192]["Number"] = 61
parseTable[192]["functiondef"] = 59
parseTable[192]["exp"] = 198
parseTable[192]["function"] = 58
parseTable[192]["("] = 53
parseTable[192]["var"] = 52
parseTable[192]["-"] = 54
parseTable[192]["true"] = 50
parseTable[192]["not"] = 57
parseTable[192]["Literal"] = 48
parseTable[192]["false"] = 63
parseTable[192]["tableconstructor"] = 56
parseTable[192]["{"] = 39
parseTable[192]["nil"] = 60
parseTable[192]["Name"] = 23
parseTable[192]["unop"] = 55
parseTable[192]["prefixexp"] = 10
parseTable[192]["functioncall"] = 49
parseTable[193] = {}
parseTable[193]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[193]["do"] = 26
parseTable[193]["while"] = 19
parseTable[193]["function"] = 5
parseTable[193]["("] = 17
parseTable[193]["var"] = 14
parseTable[193]["optional_stat_list"] = 75
parseTable[193]["block"] = 199
parseTable[193]["stat"] = 76
parseTable[193]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[193]["return"] = 12
parseTable[193]["varlist"] = 15
parseTable[193]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[193]["if"] = 22
parseTable[193]["break"] = 7
parseTable[193]["for"] = 18
parseTable[193]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[193]["stat_list"] = 73
parseTable[193]["local"] = 11
parseTable[193]["Name"] = 23
parseTable[193]["repeat"] = 24
parseTable[193]["prefixexp"] = 10
parseTable[193]["functioncall"] = 3
parseTable[194] = {}
parseTable[194][">="] = 109
parseTable[194]["=="] = 102
parseTable[194]["<="] = 105
parseTable[194][".."] = 103
parseTable[194]["+"] = 110
parseTable[194]["*"] = 113
parseTable[194]["binop"] = 106
parseTable[194]["/"] = 108
parseTable[194]["and"] = 104
parseTable[194]["or"] = 115
parseTable[194]["~="] = 116
parseTable[194]["then"] = 200
parseTable[194]["-"] = 114
parseTable[194]["<"] = 107
parseTable[194][">"] = 111
parseTable[194]["^"] = 112
parseTable[195] = {}
parseTable[195]["else"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["do"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["eof"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["while"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["function"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["("] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["end"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["transformer"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["syntax"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["return"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["elseif"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["if"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["break"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["for"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["until"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["Name"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["local"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["repeat"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195][";"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[195]["import"] = Production{"stat", Rightside{"if", "exp", "then", "block", "optional_elseif_part", "optional_else_part", "end"}}
parseTable[196] = {}
parseTable[196]["end"] = Production{"optional_else_part", Rightside{"else", "block"}}
parseTable[197] = {}
parseTable[197]["end"] = 201
parseTable[198] = {}
parseTable[198]["~="] = 116
parseTable[198]["=="] = 102
parseTable[198]["<="] = 105
parseTable[198][".."] = 103
parseTable[198]["+"] = 110
parseTable[198]["*"] = 113
parseTable[198]["binop"] = 106
parseTable[198]["/"] = 108
parseTable[198]["and"] = 104
parseTable[198][">"] = 111
parseTable[198][">="] = 109
parseTable[198]["do"] = 202
parseTable[198]["-"] = 114
parseTable[198]["<"] = 107
parseTable[198]["or"] = 115
parseTable[198]["^"] = 112
parseTable[199] = {}
parseTable[199]["elseif"] = Production{"elseif_part", Rightside{"elseif", "exp", "then", "block"}}
parseTable[199]["else"] = Production{"elseif_part", Rightside{"elseif", "exp", "then", "block"}}
parseTable[199]["end"] = Production{"elseif_part", Rightside{"elseif", "exp", "then", "block"}}
parseTable[200] = {}
parseTable[200]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[200]["do"] = 26
parseTable[200]["while"] = 19
parseTable[200]["function"] = 5
parseTable[200]["prefixexp"] = 10
parseTable[200]["var"] = 14
parseTable[200]["optional_stat_list"] = 75
parseTable[200]["block"] = 203
parseTable[200]["stat"] = 76
parseTable[200]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[200]["return"] = 12
parseTable[200]["varlist"] = 15
parseTable[200]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[200]["if"] = 22
parseTable[200]["break"] = 7
parseTable[200]["for"] = 18
parseTable[200]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[200]["stat_list"] = 73
parseTable[200]["local"] = 11
parseTable[200]["("] = 17
parseTable[200]["repeat"] = 24
parseTable[200]["Name"] = 23
parseTable[200]["functioncall"] = 3
parseTable[201] = {}
parseTable[201]["else"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["do"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["eof"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["while"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["function"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["("] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["end"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["transformer"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["syntax"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["return"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["elseif"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["if"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["break"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["for"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["until"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["Name"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["local"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["repeat"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201][";"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[201]["import"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", "do", "block", "end"}}
parseTable[202] = {}
parseTable[202]["else"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[202]["do"] = 26
parseTable[202]["while"] = 19
parseTable[202]["function"] = 5
parseTable[202]["("] = 17
parseTable[202]["var"] = 14
parseTable[202]["optional_stat_list"] = 75
parseTable[202]["block"] = 204
parseTable[202]["stat"] = 76
parseTable[202]["varlist"] = 15
parseTable[202]["return"] = 12
parseTable[202]["elseif"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[202]["stat_list"] = 73
parseTable[202]["if"] = 22
parseTable[202]["break"] = 7
parseTable[202]["for"] = 18
parseTable[202]["until"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[202]["Name"] = 23
parseTable[202]["local"] = 11
parseTable[202]["prefixexp"] = 10
parseTable[202]["repeat"] = 24
parseTable[202]["end"] = Production{"optional_stat_list", Rightside{"empty"}}
parseTable[202]["functioncall"] = 3
parseTable[203] = {}
parseTable[203]["elseif"] = Production{"elseif_part", Rightside{"elseif_part", "elseif", "exp", "then", "block"}}
parseTable[203]["else"] = Production{"elseif_part", Rightside{"elseif_part", "elseif", "exp", "then", "block"}}
parseTable[203]["end"] = Production{"elseif_part", Rightside{"elseif_part", "elseif", "exp", "then", "block"}}
parseTable[204] = {}
parseTable[204]["end"] = 205
parseTable[205] = {}
parseTable[205]["else"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["do"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["eof"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["while"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["function"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["("] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["end"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["transformer"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["syntax"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["return"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["elseif"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["if"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["break"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["for"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["until"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["Name"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["local"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["repeat"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205][";"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
parseTable[205]["import"] = Production{"stat", Rightside{"for", "Name", "=", "exp", ",", "exp", ",", "exp", "do", "block", "end"}}
| mit |
bmscoordinators/FFXI-Server | scripts/zones/Outer_Horutoto_Ruins/npcs/_5eg.lua | 17 | 3739 | -----------------------------------
-- Area: Inner Horutoto Ruins
-- NPC: Ancient Magical Gizmo #3 (G out of E, F, G, H, I, J)
-- Involved In Mission: The Heart of the Matter
-----------------------------------
package.loaded["scripts/zones/Outer_Horutoto_Ruins/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/zones/Outer_Horutoto_Ruins/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
-- Check if we are on Windurst Mission 1-2
if (player:getCurrentMission(WINDURST) == THE_HEART_OF_THE_MATTER) then
MissionStatus = player:getVar("MissionStatus");
if (MissionStatus == 2) then
-- Entered a Dark Orb
if (player:getVar("MissionStatus_orb3") == 1) then
player:startEvent(0x0030);
else
player:messageSpecial(ORB_ALREADY_PLACED);
end
elseif (MissionStatus == 4) then
-- Took out a Glowing Orb
if (player:getVar("MissionStatus_orb3") == 2) then
player:startEvent(0x0030);
else
player:messageSpecial(G_ORB_ALREADY_GOTTEN);
end
else
player:messageSpecial(DARK_MANA_ORB_RECHARGER);
end
else
player:messageSpecial(DARK_MANA_ORB_RECHARGER);
end
return 1;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0030) then
orb_value = player:getVar("MissionStatus_orb3");
if (orb_value == 1) then
player:setVar("MissionStatus_orb3",2);
-- Push the text that the player has placed the orb
player:messageSpecial(THIRD_DARK_ORB_IN_PLACE);
--Delete the key item
player:delKeyItem(THIRD_DARK_MANA_ORB);
-- Check if all orbs have been placed or not
if (player:getVar("MissionStatus_orb1") == 2 and
player:getVar("MissionStatus_orb2") == 2 and
player:getVar("MissionStatus_orb4") == 2 and
player:getVar("MissionStatus_orb5") == 2 and
player:getVar("MissionStatus_orb6") == 2) then
player:messageSpecial(ALL_DARK_MANA_ORBS_SET);
player:setVar("MissionStatus",3);
end
elseif (orb_value == 2) then
player:setVar("MissionStatus_orb3",3);
-- Time to get the glowing orb out
player:addKeyItem(THIRD_GLOWING_MANA_ORB);
player:messageSpecial(KEYITEM_OBTAINED,THIRD_GLOWING_MANA_ORB);
-- Check if all orbs have been placed or not
if (player:getVar("MissionStatus_orb1") == 3 and
player:getVar("MissionStatus_orb2") == 3 and
player:getVar("MissionStatus_orb4") == 3 and
player:getVar("MissionStatus_orb5") == 3 and
player:getVar("MissionStatus_orb6") == 3) then
player:messageSpecial(RETRIEVED_ALL_G_ORBS);
player:setVar("MissionStatus",5);
end
end
end
end; | gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Windurst_Waters/npcs/Ness_Rugetomal.lua | 17 | 1713 | -----------------------------------
-- Area: Windurst Waters
-- NPC: Ness Rugetomal
-- Standard Merchant NPC
-- Confirmed shop stock, August 2013
-----------------------------------
require("scripts/globals/events/harvest_festivals")
require("scripts/globals/shop");
package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil;
require("scripts/zones/Windurst_Waters/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
onHalloweenTrade(player,trade,npc);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,NESSRUGETOMALL_SHOP_DIALOG);
stock = {
0x112A, 10,1, --Ginger Cookie
0x1137, 727,1, --Carp Sushi
0x1149, 323,1, --Tomato Juice
0x116B, 1656,1, --Nebimonite Bake
0x112D, 14,2, --Cinna-cookie
0x1146, 184,2, --Orange Juice
0x1168, 2070,2, --Boiled Crab
0x119E, 21,3, --Acorn Cookie
0x1118, 108,3, --Meat Jerky
0x119D, 10,3, --Distilled Water
0x11BA, 846,3 --Roast Pipira
}
showNationShop(player, NATION_WINDURST, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Port_Jeuno/npcs/Leyla.lua | 17 | 1514 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Leyla
-- Standard Merchant NPC
-----------------------------------
require("scripts/globals/shop");
package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil;
require("scripts/zones/Port_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,LEYLA_SHOP_DIALOG);
stock = {0x439c,55, -- Hawkeye
0x43a8,7, -- Iron Arrow
0x43b8,5, -- Crossbow Bolt
0x119d,10, -- Distilled Water
0x13ae,1000, -- Enchanting Etude
0x13ad,1265, -- Spirited Etude
0x13ac,1567, -- Learned Etude
0x13ab,1913, -- Quick Etude
0x13aa,2208, -- Vivacious Etude
0x13a9,2815, -- Dextrous Etude
0x13a8,3146} -- Sinewy Etude
showShop(player, STATIC, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/globals/weaponskills/one_inch_punch.lua | 25 | 1590 | -----------------------------------
-- One Inch Punch
-- Hand-to-Hand weapon skill
-- Skill level: 75
-- Delivers an attack that ignores target's defense. Amount ignored varies with TP.
-- Will stack with Sneak Attack.
-- Aligned with the Shadow Gorget.
-- Aligned with the Shadow Belt.
-- Element: None
-- Modifiers: VIT:100%
-- 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 = 1;
params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1;
params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.4; 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;
-- Defense ignored is 0%, 25%, 50% as per http://www.bg-wiki.com/bg/One_Inch_Punch
params.ignoresDef = true;
params.ignored100 = 0;
params.ignored200 = 0.25;
params.ignored300 = 0.5;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.vit_wsc = 1.0;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
abaez/awesome-common | pomodoro.lua | 1 | 2867 | --- a pomodoro for awesome.
-- @author [Alejandro Baez](https://twitter.com/a_baez)
-- @copyright 2015
-- @license MIT (see LICENSE)
-- @module pomodoro
local wibox = require("wibox")
local awful = require("awful")
local naughty = require("naughty")
--local timer = require("timer")
local pomodoro = {}
p = pomodoro
--- quick convert to seconds
-- @param min the amounts you want to be converted to seconds.
local tosec = function(min) return min * 60 end
--- in minutes settings for pomodoro. use tosec to convert to seconds
local conf = {
pause = tosec(5),
work = tosec(35),
limit = tosec(60) -- limit for call
}
--- the status of the widget
local status = {
true, -- running pomodoro
false, -- paused
missing = conf.work
}
--- dialog to be shown
local dialog = {
pause = {
title = "The break has finished.",
text = "Let's get that coding rolling!"
},
work = {
title = "Pomodoro has finished.",
text = "Time to take a break human!"
},
}
function p:new()
self.conf = conf
self.status = {true, missing = self.conf.work}
self.dialog = dialog
self.widget = wibox.widget.textbox()
self.timer = timer{}
end
function p:set_time(t)
t = t >= self.conf.limit and os.date("%X", t - self.conf.limit) or
os.date("%M:%S", t)
self.widget:set_text(string.format(" Pomodoro: %s", t))
end
function p:notify(dialog, duration, status)
naughty.notify {
bg = "#ff0000",
fg = "#aaaaaa",
title = dialog.title,
text = dialog.text,
timeout = 10, --in seconds
height = 720, -- make it annoying
width = 1280
}
self.status.missing = duration
self.status[1] = status
self.set_time(self, duration)
end
function p:set()
self:new()
self:set_time(self.conf.work)
-- sets buttons
self.widget:buttons(
awful.util.table.join(
awful.button({}, 1, function()
self.last = os.time()
if not self.status[2] then
self.status[2] = true
self.timer:start()
else
self.status[2] = false
self.timer:stop()
end
end),
awful.button({}, 2, function()
self.timer:stop()
end),
awful.button({}, 3, function()
self.timer:stop()
self.status.missing = self.conf.work
self:set_time(self.conf.work)
end)
)
)
-- sets notification
self.timer:connect_signal("timeout", function()
local now = os.time()
self.status.missing = self.status.missing - (now - self.last)
self.last = now
if self.status.missing > 0 then
self:set_time(self.status.missing)
else
if self.status[1] then
self:notify(self.dialog.work, self.conf.pause, false)
else
self:notify(self.dialog.pause, self.conf.work, true)
end
self.timer:stop()
end
end)
end
setmetatable(p, {__call = p:set()})
return pomodoro
| mit |
psn240/Text2Image | data/donkey_folder_txt_coco.lua | 2 | 3989 | require 'image'
dir = require 'pl.dir'
trainLoader = {}
local alphabet = "abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\"/\\|_@#$%^&*~`+-=<>()[]{} "
local dict = {}
for i = 1,#alphabet do
dict[alphabet:sub(i,i)] = i
end
ivocab = {}
for k,v in pairs(dict) do
ivocab[v] = k
end
alphabet_size = #alphabet
function decode(txt)
local str = ''
for w_ix = 1,txt:size(1) do
local ch_ix = txt[w_ix]
local ch = ivocab[ch_ix]
if (ch ~= nil) then
str = str .. ch
end
end
return str
end
function trainLoader:decode2(txt)
local str = ''
_, ch_ixs = txt:max(2)
for w_ix = 1,txt:size(1) do
local ch_ix = ch_ixs[{w_ix,1}]
local ch = ivocab[ch_ix]
if (ch ~= nil) then
str = str .. ch
end
end
return str
end
trainLoader.alphabet = alphabet
trainLoader.alphabet_size = alphabet_size
trainLoader.dict = dict
trainLoader.ivocab = ivocab
trainLoader.decode = decoder
local files = {}
local size = 0
cur_files = dir.getfiles(opt.data_root)
size = size + #cur_files
--------------------------------------------------------------------------------------------
local loadSize = {3, opt.loadSize}
local sampleSize = {3, opt.fineSize}
local function loadImage(path)
local input = image.load(path, 3, 'float')
input = image.scale(input, loadSize[2], loadSize[2])
return input
end
-- function to load the image, jitter it appropriately (random crops etc.)
local trainHook = function(path)
collectgarbage()
local input = loadImage(path)
if opt.no_aug == 1 then
return image.scale(input, sampleSize[2], sampleSize[2])
end
local iW = input:size(3)
local iH = input:size(2)
-- do random crop
local oW = sampleSize[2];
local oH = sampleSize[2]
local h1 = math.ceil(torch.uniform(1e-2, iH-oH))
local w1 = math.ceil(torch.uniform(1e-2, iW-oW))
local out = image.crop(input, w1, h1, w1 + oW, h1 + oH)
assert(out:size(2) == oW)
assert(out:size(3) == oH)
-- do hflip with probability 0.5
if torch.uniform() > 0.5 then out = image.hflip(out); end
-- rotation
if opt.rot_aug then
local randRot = torch.rand(1)*0.16-0.08
out = image.rotate(out, randRot:float()[1], 'bilinear')
end
out:mul(2):add(-1) -- make it [0, 1] -> [-1, 1]
return out
end
function trainLoader:sample(quantity)
local ix_file1 = torch.Tensor(quantity)
local ix_file2 = torch.Tensor(quantity)
for n = 1, quantity do
local samples = torch.randperm(#cur_files):narrow(1,1,2)
local file_ix1 = samples[1]
local file_ix2 = samples[2]
ix_file1[n] = file_ix1
ix_file2[n] = file_ix2
end
local data_img1 = torch.Tensor(quantity, sampleSize[1], sampleSize[2], sampleSize[2]) -- real
local data_img2 = torch.Tensor(quantity, sampleSize[1], sampleSize[2], sampleSize[2]) -- mismatch
local data_txt1 = torch.zeros(quantity, opt.doc_length, alphabet_size) -- real
local data_txt2 = torch.zeros(quantity, opt.doc_length, alphabet_size) -- match
for n = 1, quantity do
local t7file1 = cur_files[ix_file1[n]]
local info1 = torch.load(t7file1)
local t7file2 = cur_files[ix_file2[n]]
local info2 = torch.load(t7file2)
local img_file1 = opt.img_dir .. '/' .. info1.img
local img1 = trainHook(img_file1)
local img_file2 = opt.img_dir .. '/' .. info2.img
local img2 = trainHook(img_file2)
local txt_sample = torch.randperm(info1.char:size(2))
local ix_txt1 = txt_sample[1]
local ix_txt2 = txt_sample[2]
for t = 1,opt.doc_length do
-- real text
local on_ix = info1.char[{t,ix_txt1}]
if on_ix ~= 0 then
data_txt1[{n,t,on_ix}] = 1
end
-- matching text
local on_ix = info1.char[{t,ix_txt2}]
if on_ix ~= 0 then
data_txt2[{n,t,on_ix}] = 1
end
end
-- real image
data_img1[n]:copy(img1)
-- mis-match image
data_img2[n]:copy(img2)
end
collectgarbage(); collectgarbage()
return data_img1, data_img2, data_txt1, data_txt2
end
function trainLoader:size()
return size
end
| mit |
deepak78/luci | applications/luci-statistics/luasrc/model/cbi/luci_statistics/email.lua | 78 | 1934 | --[[
Luci configuration model for statistics - collectd email plugin configuration
(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$
]]--
m = Map("luci_statistics",
translate("E-Mail Plugin Configuration"),
translate(
"The email plugin creates a unix socket which can be used " ..
"to transmit email-statistics to a running collectd daemon. " ..
"This plugin is primarily intended to be used in conjunction " ..
"with Mail::SpamAssasin::Plugin::Collectd but can be used in " ..
"other ways as well."
))
-- collectd_email config section
s = m:section( NamedSection, "collectd_email", "luci_statistics" )
-- collectd_email.enable
enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0
-- collectd_email.socketfile (SocketFile)
socketfile = s:option( Value, "SocketFile", translate("Socket file") )
socketfile.default = "/var/run/collect-email.sock"
socketfile:depends( "enable", 1 )
-- collectd_email.socketgroup (SocketGroup)
socketgroup = s:option( Value, "SocketGroup", translate("Socket group") )
socketgroup.default = "nobody"
socketgroup.rmempty = true
socketgroup.optional = true
socketgroup:depends( "enable", 1 )
-- collectd_email.socketperms (SocketPerms)
socketperms = s:option( Value, "SocketPerms", translate("Socket permissions") )
socketperms.default = "0770"
socketperms.rmempty = true
socketperms.optional = true
socketperms:depends( "enable", 1 )
-- collectd_email.maxconns (MaxConns)
maxconns = s:option( Value, "MaxConns", translate("Maximum allowed connections") )
maxconns.default = 5
maxconns.isinteger = true
maxconns.rmempty = true
maxconns.optional = true
maxconns:depends( "enable", 1 )
return m
| apache-2.0 |
firedtoad/skynet | lualib/snax/hotfix.lua | 20 | 2420 | local si = require "snax.interface"
local function envid(f)
local i = 1
while true do
local name, value = debug.getupvalue(f, i)
if name == nil then
return
end
if name == "_ENV" then
return debug.upvalueid(f, i)
end
i = i + 1
end
end
local function collect_uv(f , uv, env)
local i = 1
while true do
local name, value = debug.getupvalue(f, i)
if name == nil then
break
end
local id = debug.upvalueid(f, i)
if uv[name] then
assert(uv[name].id == id, string.format("ambiguity local value %s", name))
else
uv[name] = { func = f, index = i, id = id }
if type(value) == "function" then
if envid(value) == env then
collect_uv(value, uv, env)
end
end
end
i = i + 1
end
end
local function collect_all_uv(funcs)
local global = {}
for _, v in pairs(funcs) do
if v[4] then
collect_uv(v[4], global, envid(v[4]))
end
end
if not global["_ENV"] then
global["_ENV"] = {func = collect_uv, index = 1}
end
return global
end
local function loader(source)
return function (path, name, G)
return load(source, "=patch", "bt", G)
end
end
local function find_func(funcs, group , name)
for _, desc in pairs(funcs) do
local _, g, n = table.unpack(desc)
if group == g and name == n then
return desc
end
end
end
local dummy_env = {}
for k,v in pairs(_ENV) do dummy_env[k] = v end
local function _patch(global, f)
local i = 1
while true do
local name, value = debug.getupvalue(f, i)
if name == nil then
break
elseif value == nil or value == dummy_env then
local old_uv = global[name]
if old_uv then
debug.upvaluejoin(f, i, old_uv.func, old_uv.index)
end
else
if type(value) == "function" then
_patch(global, value)
end
end
i = i + 1
end
end
local function patch_func(funcs, global, group, name, f)
local desc = assert(find_func(funcs, group, name) , string.format("Patch mismatch %s.%s", group, name))
_patch(global, f)
desc[4] = f
end
local function inject(funcs, source, ...)
local patch = si("patch", dummy_env, loader(source))
local global = collect_all_uv(funcs)
for _, v in pairs(patch) do
local _, group, name, f = table.unpack(v)
if f then
patch_func(funcs, global, group, name, f)
end
end
local hf = find_func(patch, "system", "hotfix")
if hf and hf[4] then
return hf[4](...)
end
end
return function (funcs, source, ...)
return pcall(inject, funcs, source, ...)
end
| mit |
diamondo25/Vana | scripts/instances/kftToLudiTrip.lua | 2 | 1142 | --[[
Copyright (C) 2008-2016 Vana Development Team
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; version 2
of the License.
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.
--]]
function beginInstance()
addInstanceMap(222020111);
end
function timerEnd(name, fromTimer)
if name == instance_timer then
if getInstancePlayerCount() > 0 then
moveAllPlayers(222020200);
removeAllInstancePlayers();
end
end
end
function changeMap(playerId, newMap, oldMap, isPartyLeader)
if not isInstanceMap(newMap) then
removeInstancePlayer(playerId);
elseif not isInstanceMap(oldMap) then
addInstancePlayer(playerId);
end
end | gpl-2.0 |
cypherkey/AvorionMission | sector/factionwar/temporarydefender.lua | 1 | 3682 |
package.path = package.path .. ";data/scripts/lib/?.lua"
package.path = package.path .. ";data/scripts/sector/factionwar/?.lua"
require ("stringutility")
require ("randomext")
require("factionwarutility")
local hitsReceived = {}
local enemiesHaveBeenPresent = false
function initialize()
Entity():registerCallback("onShotHit", "onShotHit")
end
function getUpdateInterval()
return random():getFloat(5, 10)
end
function updateServer()
-- check if there are still any enemies around
-- if not, jump away
local ships = {Sector():getEntitiesByComponents(ComponentType.Owner, ComponentType.Plan)}
local self = Entity()
local enemiesPresent = false
for _, ship in pairs(ships) do
if self.factionIndex ~= ship.factionIndex then
local faction = Faction(ship.factionIndex)
if faction and faction:getRelations(self.factionIndex) < -75000 then
enemiesPresent = true
enemiesHaveBeenPresent = true
break
end
end
end
if not enemiesPresent and enemiesHaveBeenPresent then
deferredCallback(random():getFloat(1, 5), "jumpAway")
end
end
function jumpAway()
Sector():deleteEntityJumped(Entity())
end
function onShotHit(obj, shooterIndex, location)
local shooter = Entity(shooterIndex)
if not shooter then return end
local hits = hitsReceived[shooter.factionIndex] or 0
hits = hits + 1
hitsReceived[shooter.factionIndex] = hits
if hits == 10 then
declareWar(shooter.factionIndex)
end
end
function declareWar(playerIndex)
local others = Faction(playerIndex)
if not others.isPlayer then return end
local player = Player(playerIndex)
local key, enemy = getFactionWarSideVariableName()
local side = player:getValue(key)
if side and side ~= 0 then return end
-- if the player hasn't yet sided with someone, declare war
local faction = Faction()
local relations = faction:getRelations(playerIndex)
Galaxy():setFactionRelations(faction, player, -100000)
invokeClientFunction(player, "notifyPlayerOfWarDeclaration")
-- save that the player sided with the other faction
player:setValue(key, enemy)
-- notify ships of the other faction so they can declare peace
-- we notify them all, just in case that the one we notify might get destroyed
local others = {Sector():getEntitiesByScript("factionwar/temporarydefender")}
local self = Entity()
for _, other in pairs(others) do
if other.factionIndex ~= self.factionIndex then
other:invokeFunction("factionwar/temporarydefender", "deferredDeclarePeace", playerIndex)
otherFactionIndex = other.factionIndex
end
end
end
function deferredDeclarePeace(playerIndex)
deferredCallback(8.0, "declarePeace", playerIndex)
end
function declarePeace(playerIndex)
local faction = Faction()
local player = Player(playerIndex)
local relations = faction:getRelations(playerIndex)
Galaxy():setFactionRelations(faction, player, 85000)
invokeClientFunction(player, "notifyPlayerOfPeaceDeclaration")
end
function notifyPlayerOfPeaceDeclaration()
local dialog = {
text = "We thank you for your help! Such heroism will not be forgotten. You can consider us your allies from now on."%_t
}
ScriptUI():interactShowDialog(dialog, true)
end
function notifyPlayerOfWarDeclaration()
local dialog = {
text = "To the entire fleet: ${name} is attacking us!\n\nClassify these ships as hostile and destroy them along with the others!"%_t % Player()
}
ScriptUI():interactShowDialog(dialog, true)
end
| gpl-3.0 |
tuxun/smw-funwiki | extensions/Scribunto/engines/LuaCommon/lualib/ustring/lower.lua | 14 | 16535 | -- This file is automatically generated by make-tables.php
return {
["A"] = "a",
["B"] = "b",
["C"] = "c",
["D"] = "d",
["E"] = "e",
["F"] = "f",
["G"] = "g",
["H"] = "h",
["I"] = "i",
["J"] = "j",
["K"] = "k",
["L"] = "l",
["M"] = "m",
["N"] = "n",
["O"] = "o",
["P"] = "p",
["Q"] = "q",
["R"] = "r",
["S"] = "s",
["T"] = "t",
["U"] = "u",
["V"] = "v",
["W"] = "w",
["X"] = "x",
["Y"] = "y",
["Z"] = "z",
["À"] = "à",
["Á"] = "á",
["Â"] = "â",
["Ã"] = "ã",
["Ä"] = "ä",
["Å"] = "å",
["Æ"] = "æ",
["Ç"] = "ç",
["È"] = "è",
["É"] = "é",
["Ê"] = "ê",
["Ë"] = "ë",
["Ì"] = "ì",
["Í"] = "í",
["Î"] = "î",
["Ï"] = "ï",
["Ð"] = "ð",
["Ñ"] = "ñ",
["Ò"] = "ò",
["Ó"] = "ó",
["Ô"] = "ô",
["Õ"] = "õ",
["Ö"] = "ö",
["Ø"] = "ø",
["Ù"] = "ù",
["Ú"] = "ú",
["Û"] = "û",
["Ü"] = "ü",
["Ý"] = "ý",
["Þ"] = "þ",
["Ā"] = "ā",
["Ă"] = "ă",
["Ą"] = "ą",
["Ć"] = "ć",
["Ĉ"] = "ĉ",
["Ċ"] = "ċ",
["Č"] = "č",
["Ď"] = "ď",
["Đ"] = "đ",
["Ē"] = "ē",
["Ĕ"] = "ĕ",
["Ė"] = "ė",
["Ę"] = "ę",
["Ě"] = "ě",
["Ĝ"] = "ĝ",
["Ğ"] = "ğ",
["Ġ"] = "ġ",
["Ģ"] = "ģ",
["Ĥ"] = "ĥ",
["Ħ"] = "ħ",
["Ĩ"] = "ĩ",
["Ī"] = "ī",
["Ĭ"] = "ĭ",
["Į"] = "į",
["İ"] = "i",
["IJ"] = "ij",
["Ĵ"] = "ĵ",
["Ķ"] = "ķ",
["Ĺ"] = "ĺ",
["Ļ"] = "ļ",
["Ľ"] = "ľ",
["Ŀ"] = "ŀ",
["Ł"] = "ł",
["Ń"] = "ń",
["Ņ"] = "ņ",
["Ň"] = "ň",
["Ŋ"] = "ŋ",
["Ō"] = "ō",
["Ŏ"] = "ŏ",
["Ő"] = "ő",
["Œ"] = "œ",
["Ŕ"] = "ŕ",
["Ŗ"] = "ŗ",
["Ř"] = "ř",
["Ś"] = "ś",
["Ŝ"] = "ŝ",
["Ş"] = "ş",
["Š"] = "š",
["Ţ"] = "ţ",
["Ť"] = "ť",
["Ŧ"] = "ŧ",
["Ũ"] = "ũ",
["Ū"] = "ū",
["Ŭ"] = "ŭ",
["Ů"] = "ů",
["Ű"] = "ű",
["Ų"] = "ų",
["Ŵ"] = "ŵ",
["Ŷ"] = "ŷ",
["Ÿ"] = "ÿ",
["Ź"] = "ź",
["Ż"] = "ż",
["Ž"] = "ž",
["Ɓ"] = "ɓ",
["Ƃ"] = "ƃ",
["Ƅ"] = "ƅ",
["Ɔ"] = "ɔ",
["Ƈ"] = "ƈ",
["Ɖ"] = "ɖ",
["Ɗ"] = "ɗ",
["Ƌ"] = "ƌ",
["Ǝ"] = "ǝ",
["Ə"] = "ə",
["Ɛ"] = "ɛ",
["Ƒ"] = "ƒ",
["Ɠ"] = "ɠ",
["Ɣ"] = "ɣ",
["Ɩ"] = "ɩ",
["Ɨ"] = "ɨ",
["Ƙ"] = "ƙ",
["Ɯ"] = "ɯ",
["Ɲ"] = "ɲ",
["Ɵ"] = "ɵ",
["Ơ"] = "ơ",
["Ƣ"] = "ƣ",
["Ƥ"] = "ƥ",
["Ʀ"] = "ʀ",
["Ƨ"] = "ƨ",
["Ʃ"] = "ʃ",
["Ƭ"] = "ƭ",
["Ʈ"] = "ʈ",
["Ư"] = "ư",
["Ʊ"] = "ʊ",
["Ʋ"] = "ʋ",
["Ƴ"] = "ƴ",
["Ƶ"] = "ƶ",
["Ʒ"] = "ʒ",
["Ƹ"] = "ƹ",
["Ƽ"] = "ƽ",
["DŽ"] = "dž",
["LJ"] = "lj",
["NJ"] = "nj",
["Ǎ"] = "ǎ",
["Ǐ"] = "ǐ",
["Ǒ"] = "ǒ",
["Ǔ"] = "ǔ",
["Ǖ"] = "ǖ",
["Ǘ"] = "ǘ",
["Ǚ"] = "ǚ",
["Ǜ"] = "ǜ",
["Ǟ"] = "ǟ",
["Ǡ"] = "ǡ",
["Ǣ"] = "ǣ",
["Ǥ"] = "ǥ",
["Ǧ"] = "ǧ",
["Ǩ"] = "ǩ",
["Ǫ"] = "ǫ",
["Ǭ"] = "ǭ",
["Ǯ"] = "ǯ",
["DZ"] = "dz",
["Ǵ"] = "ǵ",
["Ƕ"] = "ƕ",
["Ƿ"] = "ƿ",
["Ǹ"] = "ǹ",
["Ǻ"] = "ǻ",
["Ǽ"] = "ǽ",
["Ǿ"] = "ǿ",
["Ȁ"] = "ȁ",
["Ȃ"] = "ȃ",
["Ȅ"] = "ȅ",
["Ȇ"] = "ȇ",
["Ȉ"] = "ȉ",
["Ȋ"] = "ȋ",
["Ȍ"] = "ȍ",
["Ȏ"] = "ȏ",
["Ȑ"] = "ȑ",
["Ȓ"] = "ȓ",
["Ȕ"] = "ȕ",
["Ȗ"] = "ȗ",
["Ș"] = "ș",
["Ț"] = "ț",
["Ȝ"] = "ȝ",
["Ȟ"] = "ȟ",
["Ƞ"] = "ƞ",
["Ȣ"] = "ȣ",
["Ȥ"] = "ȥ",
["Ȧ"] = "ȧ",
["Ȩ"] = "ȩ",
["Ȫ"] = "ȫ",
["Ȭ"] = "ȭ",
["Ȯ"] = "ȯ",
["Ȱ"] = "ȱ",
["Ȳ"] = "ȳ",
["Ⱥ"] = "ⱥ",
["Ȼ"] = "ȼ",
["Ƚ"] = "ƚ",
["Ⱦ"] = "ⱦ",
["Ɂ"] = "ɂ",
["Ƀ"] = "ƀ",
["Ʉ"] = "ʉ",
["Ʌ"] = "ʌ",
["Ɇ"] = "ɇ",
["Ɉ"] = "ɉ",
["Ɋ"] = "ɋ",
["Ɍ"] = "ɍ",
["Ɏ"] = "ɏ",
["Ͱ"] = "ͱ",
["Ͳ"] = "ͳ",
["Ͷ"] = "ͷ",
["Ά"] = "ά",
["Έ"] = "έ",
["Ή"] = "ή",
["Ί"] = "ί",
["Ό"] = "ό",
["Ύ"] = "ύ",
["Ώ"] = "ώ",
["Α"] = "α",
["Β"] = "β",
["Γ"] = "γ",
["Δ"] = "δ",
["Ε"] = "ε",
["Ζ"] = "ζ",
["Η"] = "η",
["Θ"] = "θ",
["Ι"] = "ι",
["Κ"] = "κ",
["Λ"] = "λ",
["Μ"] = "μ",
["Ν"] = "ν",
["Ξ"] = "ξ",
["Ο"] = "ο",
["Π"] = "π",
["Ρ"] = "ρ",
["Σ"] = "σ",
["Τ"] = "τ",
["Υ"] = "υ",
["Φ"] = "φ",
["Χ"] = "χ",
["Ψ"] = "ψ",
["Ω"] = "ω",
["Ϊ"] = "ϊ",
["Ϋ"] = "ϋ",
["Ϗ"] = "ϗ",
["Ϙ"] = "ϙ",
["Ϛ"] = "ϛ",
["Ϝ"] = "ϝ",
["Ϟ"] = "ϟ",
["Ϡ"] = "ϡ",
["Ϣ"] = "ϣ",
["Ϥ"] = "ϥ",
["Ϧ"] = "ϧ",
["Ϩ"] = "ϩ",
["Ϫ"] = "ϫ",
["Ϭ"] = "ϭ",
["Ϯ"] = "ϯ",
["ϴ"] = "θ",
["Ϸ"] = "ϸ",
["Ϲ"] = "ϲ",
["Ϻ"] = "ϻ",
["Ͻ"] = "ͻ",
["Ͼ"] = "ͼ",
["Ͽ"] = "ͽ",
["Ѐ"] = "ѐ",
["Ё"] = "ё",
["Ђ"] = "ђ",
["Ѓ"] = "ѓ",
["Є"] = "є",
["Ѕ"] = "ѕ",
["І"] = "і",
["Ї"] = "ї",
["Ј"] = "ј",
["Љ"] = "љ",
["Њ"] = "њ",
["Ћ"] = "ћ",
["Ќ"] = "ќ",
["Ѝ"] = "ѝ",
["Ў"] = "ў",
["Џ"] = "џ",
["А"] = "а",
["Б"] = "б",
["В"] = "в",
["Г"] = "г",
["Д"] = "д",
["Е"] = "е",
["Ж"] = "ж",
["З"] = "з",
["И"] = "и",
["Й"] = "й",
["К"] = "к",
["Л"] = "л",
["М"] = "м",
["Н"] = "н",
["О"] = "о",
["П"] = "п",
["Р"] = "р",
["С"] = "с",
["Т"] = "т",
["У"] = "у",
["Ф"] = "ф",
["Х"] = "х",
["Ц"] = "ц",
["Ч"] = "ч",
["Ш"] = "ш",
["Щ"] = "щ",
["Ъ"] = "ъ",
["Ы"] = "ы",
["Ь"] = "ь",
["Э"] = "э",
["Ю"] = "ю",
["Я"] = "я",
["Ѡ"] = "ѡ",
["Ѣ"] = "ѣ",
["Ѥ"] = "ѥ",
["Ѧ"] = "ѧ",
["Ѩ"] = "ѩ",
["Ѫ"] = "ѫ",
["Ѭ"] = "ѭ",
["Ѯ"] = "ѯ",
["Ѱ"] = "ѱ",
["Ѳ"] = "ѳ",
["Ѵ"] = "ѵ",
["Ѷ"] = "ѷ",
["Ѹ"] = "ѹ",
["Ѻ"] = "ѻ",
["Ѽ"] = "ѽ",
["Ѿ"] = "ѿ",
["Ҁ"] = "ҁ",
["Ҋ"] = "ҋ",
["Ҍ"] = "ҍ",
["Ҏ"] = "ҏ",
["Ґ"] = "ґ",
["Ғ"] = "ғ",
["Ҕ"] = "ҕ",
["Җ"] = "җ",
["Ҙ"] = "ҙ",
["Қ"] = "қ",
["Ҝ"] = "ҝ",
["Ҟ"] = "ҟ",
["Ҡ"] = "ҡ",
["Ң"] = "ң",
["Ҥ"] = "ҥ",
["Ҧ"] = "ҧ",
["Ҩ"] = "ҩ",
["Ҫ"] = "ҫ",
["Ҭ"] = "ҭ",
["Ү"] = "ү",
["Ұ"] = "ұ",
["Ҳ"] = "ҳ",
["Ҵ"] = "ҵ",
["Ҷ"] = "ҷ",
["Ҹ"] = "ҹ",
["Һ"] = "һ",
["Ҽ"] = "ҽ",
["Ҿ"] = "ҿ",
["Ӏ"] = "ӏ",
["Ӂ"] = "ӂ",
["Ӄ"] = "ӄ",
["Ӆ"] = "ӆ",
["Ӈ"] = "ӈ",
["Ӊ"] = "ӊ",
["Ӌ"] = "ӌ",
["Ӎ"] = "ӎ",
["Ӑ"] = "ӑ",
["Ӓ"] = "ӓ",
["Ӕ"] = "ӕ",
["Ӗ"] = "ӗ",
["Ә"] = "ә",
["Ӛ"] = "ӛ",
["Ӝ"] = "ӝ",
["Ӟ"] = "ӟ",
["Ӡ"] = "ӡ",
["Ӣ"] = "ӣ",
["Ӥ"] = "ӥ",
["Ӧ"] = "ӧ",
["Ө"] = "ө",
["Ӫ"] = "ӫ",
["Ӭ"] = "ӭ",
["Ӯ"] = "ӯ",
["Ӱ"] = "ӱ",
["Ӳ"] = "ӳ",
["Ӵ"] = "ӵ",
["Ӷ"] = "ӷ",
["Ӹ"] = "ӹ",
["Ӻ"] = "ӻ",
["Ӽ"] = "ӽ",
["Ӿ"] = "ӿ",
["Ԁ"] = "ԁ",
["Ԃ"] = "ԃ",
["Ԅ"] = "ԅ",
["Ԇ"] = "ԇ",
["Ԉ"] = "ԉ",
["Ԋ"] = "ԋ",
["Ԍ"] = "ԍ",
["Ԏ"] = "ԏ",
["Ԑ"] = "ԑ",
["Ԓ"] = "ԓ",
["Ԕ"] = "ԕ",
["Ԗ"] = "ԗ",
["Ԙ"] = "ԙ",
["Ԛ"] = "ԛ",
["Ԝ"] = "ԝ",
["Ԟ"] = "ԟ",
["Ԡ"] = "ԡ",
["Ԣ"] = "ԣ",
["Ԥ"] = "ԥ",
["Ԧ"] = "ԧ",
["Ա"] = "ա",
["Բ"] = "բ",
["Գ"] = "գ",
["Դ"] = "դ",
["Ե"] = "ե",
["Զ"] = "զ",
["Է"] = "է",
["Ը"] = "ը",
["Թ"] = "թ",
["Ժ"] = "ժ",
["Ի"] = "ի",
["Լ"] = "լ",
["Խ"] = "խ",
["Ծ"] = "ծ",
["Կ"] = "կ",
["Հ"] = "հ",
["Ձ"] = "ձ",
["Ղ"] = "ղ",
["Ճ"] = "ճ",
["Մ"] = "մ",
["Յ"] = "յ",
["Ն"] = "ն",
["Շ"] = "շ",
["Ո"] = "ո",
["Չ"] = "չ",
["Պ"] = "պ",
["Ջ"] = "ջ",
["Ռ"] = "ռ",
["Ս"] = "ս",
["Վ"] = "վ",
["Տ"] = "տ",
["Ր"] = "ր",
["Ց"] = "ց",
["Ւ"] = "ւ",
["Փ"] = "փ",
["Ք"] = "ք",
["Օ"] = "օ",
["Ֆ"] = "ֆ",
["Ⴀ"] = "ⴀ",
["Ⴁ"] = "ⴁ",
["Ⴂ"] = "ⴂ",
["Ⴃ"] = "ⴃ",
["Ⴄ"] = "ⴄ",
["Ⴅ"] = "ⴅ",
["Ⴆ"] = "ⴆ",
["Ⴇ"] = "ⴇ",
["Ⴈ"] = "ⴈ",
["Ⴉ"] = "ⴉ",
["Ⴊ"] = "ⴊ",
["Ⴋ"] = "ⴋ",
["Ⴌ"] = "ⴌ",
["Ⴍ"] = "ⴍ",
["Ⴎ"] = "ⴎ",
["Ⴏ"] = "ⴏ",
["Ⴐ"] = "ⴐ",
["Ⴑ"] = "ⴑ",
["Ⴒ"] = "ⴒ",
["Ⴓ"] = "ⴓ",
["Ⴔ"] = "ⴔ",
["Ⴕ"] = "ⴕ",
["Ⴖ"] = "ⴖ",
["Ⴗ"] = "ⴗ",
["Ⴘ"] = "ⴘ",
["Ⴙ"] = "ⴙ",
["Ⴚ"] = "ⴚ",
["Ⴛ"] = "ⴛ",
["Ⴜ"] = "ⴜ",
["Ⴝ"] = "ⴝ",
["Ⴞ"] = "ⴞ",
["Ⴟ"] = "ⴟ",
["Ⴠ"] = "ⴠ",
["Ⴡ"] = "ⴡ",
["Ⴢ"] = "ⴢ",
["Ⴣ"] = "ⴣ",
["Ⴤ"] = "ⴤ",
["Ⴥ"] = "ⴥ",
["Ḁ"] = "ḁ",
["Ḃ"] = "ḃ",
["Ḅ"] = "ḅ",
["Ḇ"] = "ḇ",
["Ḉ"] = "ḉ",
["Ḋ"] = "ḋ",
["Ḍ"] = "ḍ",
["Ḏ"] = "ḏ",
["Ḑ"] = "ḑ",
["Ḓ"] = "ḓ",
["Ḕ"] = "ḕ",
["Ḗ"] = "ḗ",
["Ḙ"] = "ḙ",
["Ḛ"] = "ḛ",
["Ḝ"] = "ḝ",
["Ḟ"] = "ḟ",
["Ḡ"] = "ḡ",
["Ḣ"] = "ḣ",
["Ḥ"] = "ḥ",
["Ḧ"] = "ḧ",
["Ḩ"] = "ḩ",
["Ḫ"] = "ḫ",
["Ḭ"] = "ḭ",
["Ḯ"] = "ḯ",
["Ḱ"] = "ḱ",
["Ḳ"] = "ḳ",
["Ḵ"] = "ḵ",
["Ḷ"] = "ḷ",
["Ḹ"] = "ḹ",
["Ḻ"] = "ḻ",
["Ḽ"] = "ḽ",
["Ḿ"] = "ḿ",
["Ṁ"] = "ṁ",
["Ṃ"] = "ṃ",
["Ṅ"] = "ṅ",
["Ṇ"] = "ṇ",
["Ṉ"] = "ṉ",
["Ṋ"] = "ṋ",
["Ṍ"] = "ṍ",
["Ṏ"] = "ṏ",
["Ṑ"] = "ṑ",
["Ṓ"] = "ṓ",
["Ṕ"] = "ṕ",
["Ṗ"] = "ṗ",
["Ṙ"] = "ṙ",
["Ṛ"] = "ṛ",
["Ṝ"] = "ṝ",
["Ṟ"] = "ṟ",
["Ṡ"] = "ṡ",
["Ṣ"] = "ṣ",
["Ṥ"] = "ṥ",
["Ṧ"] = "ṧ",
["Ṩ"] = "ṩ",
["Ṫ"] = "ṫ",
["Ṭ"] = "ṭ",
["Ṯ"] = "ṯ",
["Ṱ"] = "ṱ",
["Ṳ"] = "ṳ",
["Ṵ"] = "ṵ",
["Ṷ"] = "ṷ",
["Ṹ"] = "ṹ",
["Ṻ"] = "ṻ",
["Ṽ"] = "ṽ",
["Ṿ"] = "ṿ",
["Ẁ"] = "ẁ",
["Ẃ"] = "ẃ",
["Ẅ"] = "ẅ",
["Ẇ"] = "ẇ",
["Ẉ"] = "ẉ",
["Ẋ"] = "ẋ",
["Ẍ"] = "ẍ",
["Ẏ"] = "ẏ",
["Ẑ"] = "ẑ",
["Ẓ"] = "ẓ",
["Ẕ"] = "ẕ",
["ẞ"] = "ß",
["Ạ"] = "ạ",
["Ả"] = "ả",
["Ấ"] = "ấ",
["Ầ"] = "ầ",
["Ẩ"] = "ẩ",
["Ẫ"] = "ẫ",
["Ậ"] = "ậ",
["Ắ"] = "ắ",
["Ằ"] = "ằ",
["Ẳ"] = "ẳ",
["Ẵ"] = "ẵ",
["Ặ"] = "ặ",
["Ẹ"] = "ẹ",
["Ẻ"] = "ẻ",
["Ẽ"] = "ẽ",
["Ế"] = "ế",
["Ề"] = "ề",
["Ể"] = "ể",
["Ễ"] = "ễ",
["Ệ"] = "ệ",
["Ỉ"] = "ỉ",
["Ị"] = "ị",
["Ọ"] = "ọ",
["Ỏ"] = "ỏ",
["Ố"] = "ố",
["Ồ"] = "ồ",
["Ổ"] = "ổ",
["Ỗ"] = "ỗ",
["Ộ"] = "ộ",
["Ớ"] = "ớ",
["Ờ"] = "ờ",
["Ở"] = "ở",
["Ỡ"] = "ỡ",
["Ợ"] = "ợ",
["Ụ"] = "ụ",
["Ủ"] = "ủ",
["Ứ"] = "ứ",
["Ừ"] = "ừ",
["Ử"] = "ử",
["Ữ"] = "ữ",
["Ự"] = "ự",
["Ỳ"] = "ỳ",
["Ỵ"] = "ỵ",
["Ỷ"] = "ỷ",
["Ỹ"] = "ỹ",
["Ỻ"] = "ỻ",
["Ỽ"] = "ỽ",
["Ỿ"] = "ỿ",
["Ἀ"] = "ἀ",
["Ἁ"] = "ἁ",
["Ἂ"] = "ἂ",
["Ἃ"] = "ἃ",
["Ἄ"] = "ἄ",
["Ἅ"] = "ἅ",
["Ἆ"] = "ἆ",
["Ἇ"] = "ἇ",
["Ἐ"] = "ἐ",
["Ἑ"] = "ἑ",
["Ἒ"] = "ἒ",
["Ἓ"] = "ἓ",
["Ἔ"] = "ἔ",
["Ἕ"] = "ἕ",
["Ἠ"] = "ἠ",
["Ἡ"] = "ἡ",
["Ἢ"] = "ἢ",
["Ἣ"] = "ἣ",
["Ἤ"] = "ἤ",
["Ἥ"] = "ἥ",
["Ἦ"] = "ἦ",
["Ἧ"] = "ἧ",
["Ἰ"] = "ἰ",
["Ἱ"] = "ἱ",
["Ἲ"] = "ἲ",
["Ἳ"] = "ἳ",
["Ἴ"] = "ἴ",
["Ἵ"] = "ἵ",
["Ἶ"] = "ἶ",
["Ἷ"] = "ἷ",
["Ὀ"] = "ὀ",
["Ὁ"] = "ὁ",
["Ὂ"] = "ὂ",
["Ὃ"] = "ὃ",
["Ὄ"] = "ὄ",
["Ὅ"] = "ὅ",
["Ὑ"] = "ὑ",
["Ὓ"] = "ὓ",
["Ὕ"] = "ὕ",
["Ὗ"] = "ὗ",
["Ὠ"] = "ὠ",
["Ὡ"] = "ὡ",
["Ὢ"] = "ὢ",
["Ὣ"] = "ὣ",
["Ὤ"] = "ὤ",
["Ὥ"] = "ὥ",
["Ὦ"] = "ὦ",
["Ὧ"] = "ὧ",
["Ᾰ"] = "ᾰ",
["Ᾱ"] = "ᾱ",
["Ὰ"] = "ὰ",
["Ά"] = "ά",
["Ὲ"] = "ὲ",
["Έ"] = "έ",
["Ὴ"] = "ὴ",
["Ή"] = "ή",
["Ῐ"] = "ῐ",
["Ῑ"] = "ῑ",
["Ὶ"] = "ὶ",
["Ί"] = "ί",
["Ῠ"] = "ῠ",
["Ῡ"] = "ῡ",
["Ὺ"] = "ὺ",
["Ύ"] = "ύ",
["Ῥ"] = "ῥ",
["Ὸ"] = "ὸ",
["Ό"] = "ό",
["Ὼ"] = "ὼ",
["Ώ"] = "ώ",
["Ω"] = "ω",
["K"] = "k",
["Å"] = "å",
["Ⅎ"] = "ⅎ",
["Ↄ"] = "ↄ",
["Ⰰ"] = "ⰰ",
["Ⰱ"] = "ⰱ",
["Ⰲ"] = "ⰲ",
["Ⰳ"] = "ⰳ",
["Ⰴ"] = "ⰴ",
["Ⰵ"] = "ⰵ",
["Ⰶ"] = "ⰶ",
["Ⰷ"] = "ⰷ",
["Ⰸ"] = "ⰸ",
["Ⰹ"] = "ⰹ",
["Ⰺ"] = "ⰺ",
["Ⰻ"] = "ⰻ",
["Ⰼ"] = "ⰼ",
["Ⰽ"] = "ⰽ",
["Ⰾ"] = "ⰾ",
["Ⰿ"] = "ⰿ",
["Ⱀ"] = "ⱀ",
["Ⱁ"] = "ⱁ",
["Ⱂ"] = "ⱂ",
["Ⱃ"] = "ⱃ",
["Ⱄ"] = "ⱄ",
["Ⱅ"] = "ⱅ",
["Ⱆ"] = "ⱆ",
["Ⱇ"] = "ⱇ",
["Ⱈ"] = "ⱈ",
["Ⱉ"] = "ⱉ",
["Ⱊ"] = "ⱊ",
["Ⱋ"] = "ⱋ",
["Ⱌ"] = "ⱌ",
["Ⱍ"] = "ⱍ",
["Ⱎ"] = "ⱎ",
["Ⱏ"] = "ⱏ",
["Ⱐ"] = "ⱐ",
["Ⱑ"] = "ⱑ",
["Ⱒ"] = "ⱒ",
["Ⱓ"] = "ⱓ",
["Ⱔ"] = "ⱔ",
["Ⱕ"] = "ⱕ",
["Ⱖ"] = "ⱖ",
["Ⱗ"] = "ⱗ",
["Ⱘ"] = "ⱘ",
["Ⱙ"] = "ⱙ",
["Ⱚ"] = "ⱚ",
["Ⱛ"] = "ⱛ",
["Ⱜ"] = "ⱜ",
["Ⱝ"] = "ⱝ",
["Ⱞ"] = "ⱞ",
["Ⱡ"] = "ⱡ",
["Ɫ"] = "ɫ",
["Ᵽ"] = "ᵽ",
["Ɽ"] = "ɽ",
["Ⱨ"] = "ⱨ",
["Ⱪ"] = "ⱪ",
["Ⱬ"] = "ⱬ",
["Ɑ"] = "ɑ",
["Ɱ"] = "ɱ",
["Ɐ"] = "ɐ",
["Ɒ"] = "ɒ",
["Ⱳ"] = "ⱳ",
["Ⱶ"] = "ⱶ",
["Ȿ"] = "ȿ",
["Ɀ"] = "ɀ",
["Ⲁ"] = "ⲁ",
["Ⲃ"] = "ⲃ",
["Ⲅ"] = "ⲅ",
["Ⲇ"] = "ⲇ",
["Ⲉ"] = "ⲉ",
["Ⲋ"] = "ⲋ",
["Ⲍ"] = "ⲍ",
["Ⲏ"] = "ⲏ",
["Ⲑ"] = "ⲑ",
["Ⲓ"] = "ⲓ",
["Ⲕ"] = "ⲕ",
["Ⲗ"] = "ⲗ",
["Ⲙ"] = "ⲙ",
["Ⲛ"] = "ⲛ",
["Ⲝ"] = "ⲝ",
["Ⲟ"] = "ⲟ",
["Ⲡ"] = "ⲡ",
["Ⲣ"] = "ⲣ",
["Ⲥ"] = "ⲥ",
["Ⲧ"] = "ⲧ",
["Ⲩ"] = "ⲩ",
["Ⲫ"] = "ⲫ",
["Ⲭ"] = "ⲭ",
["Ⲯ"] = "ⲯ",
["Ⲱ"] = "ⲱ",
["Ⲳ"] = "ⲳ",
["Ⲵ"] = "ⲵ",
["Ⲷ"] = "ⲷ",
["Ⲹ"] = "ⲹ",
["Ⲻ"] = "ⲻ",
["Ⲽ"] = "ⲽ",
["Ⲿ"] = "ⲿ",
["Ⳁ"] = "ⳁ",
["Ⳃ"] = "ⳃ",
["Ⳅ"] = "ⳅ",
["Ⳇ"] = "ⳇ",
["Ⳉ"] = "ⳉ",
["Ⳋ"] = "ⳋ",
["Ⳍ"] = "ⳍ",
["Ⳏ"] = "ⳏ",
["Ⳑ"] = "ⳑ",
["Ⳓ"] = "ⳓ",
["Ⳕ"] = "ⳕ",
["Ⳗ"] = "ⳗ",
["Ⳙ"] = "ⳙ",
["Ⳛ"] = "ⳛ",
["Ⳝ"] = "ⳝ",
["Ⳟ"] = "ⳟ",
["Ⳡ"] = "ⳡ",
["Ⳣ"] = "ⳣ",
["Ⳬ"] = "ⳬ",
["Ⳮ"] = "ⳮ",
["Ꙁ"] = "ꙁ",
["Ꙃ"] = "ꙃ",
["Ꙅ"] = "ꙅ",
["Ꙇ"] = "ꙇ",
["Ꙉ"] = "ꙉ",
["Ꙋ"] = "ꙋ",
["Ꙍ"] = "ꙍ",
["Ꙏ"] = "ꙏ",
["Ꙑ"] = "ꙑ",
["Ꙓ"] = "ꙓ",
["Ꙕ"] = "ꙕ",
["Ꙗ"] = "ꙗ",
["Ꙙ"] = "ꙙ",
["Ꙛ"] = "ꙛ",
["Ꙝ"] = "ꙝ",
["Ꙟ"] = "ꙟ",
["Ꙡ"] = "ꙡ",
["Ꙣ"] = "ꙣ",
["Ꙥ"] = "ꙥ",
["Ꙧ"] = "ꙧ",
["Ꙩ"] = "ꙩ",
["Ꙫ"] = "ꙫ",
["Ꙭ"] = "ꙭ",
["Ꚁ"] = "ꚁ",
["Ꚃ"] = "ꚃ",
["Ꚅ"] = "ꚅ",
["Ꚇ"] = "ꚇ",
["Ꚉ"] = "ꚉ",
["Ꚋ"] = "ꚋ",
["Ꚍ"] = "ꚍ",
["Ꚏ"] = "ꚏ",
["Ꚑ"] = "ꚑ",
["Ꚓ"] = "ꚓ",
["Ꚕ"] = "ꚕ",
["Ꚗ"] = "ꚗ",
["Ꜣ"] = "ꜣ",
["Ꜥ"] = "ꜥ",
["Ꜧ"] = "ꜧ",
["Ꜩ"] = "ꜩ",
["Ꜫ"] = "ꜫ",
["Ꜭ"] = "ꜭ",
["Ꜯ"] = "ꜯ",
["Ꜳ"] = "ꜳ",
["Ꜵ"] = "ꜵ",
["Ꜷ"] = "ꜷ",
["Ꜹ"] = "ꜹ",
["Ꜻ"] = "ꜻ",
["Ꜽ"] = "ꜽ",
["Ꜿ"] = "ꜿ",
["Ꝁ"] = "ꝁ",
["Ꝃ"] = "ꝃ",
["Ꝅ"] = "ꝅ",
["Ꝇ"] = "ꝇ",
["Ꝉ"] = "ꝉ",
["Ꝋ"] = "ꝋ",
["Ꝍ"] = "ꝍ",
["Ꝏ"] = "ꝏ",
["Ꝑ"] = "ꝑ",
["Ꝓ"] = "ꝓ",
["Ꝕ"] = "ꝕ",
["Ꝗ"] = "ꝗ",
["Ꝙ"] = "ꝙ",
["Ꝛ"] = "ꝛ",
["Ꝝ"] = "ꝝ",
["Ꝟ"] = "ꝟ",
["Ꝡ"] = "ꝡ",
["Ꝣ"] = "ꝣ",
["Ꝥ"] = "ꝥ",
["Ꝧ"] = "ꝧ",
["Ꝩ"] = "ꝩ",
["Ꝫ"] = "ꝫ",
["Ꝭ"] = "ꝭ",
["Ꝯ"] = "ꝯ",
["Ꝺ"] = "ꝺ",
["Ꝼ"] = "ꝼ",
["Ᵹ"] = "ᵹ",
["Ꝿ"] = "ꝿ",
["Ꞁ"] = "ꞁ",
["Ꞃ"] = "ꞃ",
["Ꞅ"] = "ꞅ",
["Ꞇ"] = "ꞇ",
["Ꞌ"] = "ꞌ",
["Ɥ"] = "ɥ",
["Ꞑ"] = "ꞑ",
["Ꞡ"] = "ꞡ",
["Ꞣ"] = "ꞣ",
["Ꞥ"] = "ꞥ",
["Ꞧ"] = "ꞧ",
["Ꞩ"] = "ꞩ",
["A"] = "a",
["B"] = "b",
["C"] = "c",
["D"] = "d",
["E"] = "e",
["F"] = "f",
["G"] = "g",
["H"] = "h",
["I"] = "i",
["J"] = "j",
["K"] = "k",
["L"] = "l",
["M"] = "m",
["N"] = "n",
["O"] = "o",
["P"] = "p",
["Q"] = "q",
["R"] = "r",
["S"] = "s",
["T"] = "t",
["U"] = "u",
["V"] = "v",
["W"] = "w",
["X"] = "x",
["Y"] = "y",
["Z"] = "z",
["𐐀"] = "𐐨",
["𐐁"] = "𐐩",
["𐐂"] = "𐐪",
["𐐃"] = "𐐫",
["𐐄"] = "𐐬",
["𐐅"] = "𐐭",
["𐐆"] = "𐐮",
["𐐇"] = "𐐯",
["𐐈"] = "𐐰",
["𐐉"] = "𐐱",
["𐐊"] = "𐐲",
["𐐋"] = "𐐳",
["𐐌"] = "𐐴",
["𐐍"] = "𐐵",
["𐐎"] = "𐐶",
["𐐏"] = "𐐷",
["𐐐"] = "𐐸",
["𐐑"] = "𐐹",
["𐐒"] = "𐐺",
["𐐓"] = "𐐻",
["𐐔"] = "𐐼",
["𐐕"] = "𐐽",
["𐐖"] = "𐐾",
["𐐗"] = "𐐿",
["𐐘"] = "𐑀",
["𐐙"] = "𐑁",
["𐐚"] = "𐑂",
["𐐛"] = "𐑃",
["𐐜"] = "𐑄",
["𐐝"] = "𐑅",
["𐐞"] = "𐑆",
["𐐟"] = "𐑇",
["𐐠"] = "𐑈",
["𐐡"] = "𐑉",
["𐐢"] = "𐑊",
["𐐣"] = "𐑋",
["𐐤"] = "𐑌",
["𐐥"] = "𐑍",
["𐐦"] = "𐑎",
["𐐧"] = "𐑏",
}
| gpl-2.0 |
colesbury/nn | BCECriterion.lua | 10 | 1737 | local THNN = require 'nn.THNN'
local BCECriterion, parent = torch.class('nn.BCECriterion', 'nn.Criterion')
function BCECriterion:__init(weights, sizeAverage)
parent.__init(self)
if sizeAverage ~= nil then
self.sizeAverage = sizeAverage
else
self.sizeAverage = true
end
if weights ~= nil then
assert(weights:dim() == 1, "weights input should be 1-D Tensor")
self.weights = weights
end
end
function BCECriterion:__len()
return self.weights and #self.weights or 0
end
function BCECriterion:updateOutput(input, target)
-- - log(input) * target - log(1 - input) * (1 - target)
assert( input:nElement() == target:nElement(),
"input and target size mismatch")
self.output_tensor = self.output_tensor or input.new(1)
local weights = self.weights
if weights ~= nil and target:dim() ~= 1 then
weights = self.weights:view(1, target:size(2)):expandAs(target)
end
input.THNN.BCECriterion_updateOutput(
input:cdata(),
target:cdata(),
self.output_tensor:cdata(),
self.sizeAverage,
THNN.optionalTensor(weights)
)
self.output = self.output_tensor[1]
return self.output
end
function BCECriterion:updateGradInput(input, target)
-- - (target - input) / ( input (1 - input) )
assert( input:nElement() == target:nElement(),
"input and target size mismatch")
local weights = self.weights
if weights ~= nil and target:dim() ~= 1 then
weights = self.weights:view(1, target:size(2)):expandAs(target)
end
input.THNN.BCECriterion_updateGradInput(
input:cdata(),
target:cdata(),
self.gradInput:cdata(),
self.sizeAverage,
THNN.optionalTensor(weights)
)
return self.gradInput
end
| bsd-3-clause |
cheney247689848/Cloud-edge | Luajit64/jit/p.lua | 55 | 9135 | ----------------------------------------------------------------------------
-- LuaJIT profiler.
--
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
-- Released under the MIT license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------
--
-- This module is a simple command line interface to the built-in
-- low-overhead profiler of LuaJIT.
--
-- The lower-level API of the profiler is accessible via the "jit.profile"
-- module or the luaJIT_profile_* C API.
--
-- Example usage:
--
-- luajit -jp myapp.lua
-- luajit -jp=s myapp.lua
-- luajit -jp=-s myapp.lua
-- luajit -jp=vl myapp.lua
-- luajit -jp=G,profile.txt myapp.lua
--
-- The following dump features are available:
--
-- f Stack dump: function name, otherwise module:line. Default mode.
-- F Stack dump: ditto, but always prepend module.
-- l Stack dump: module:line.
-- <number> stack dump depth (callee < caller). Default: 1.
-- -<number> Inverse stack dump depth (caller > callee).
-- s Split stack dump after first stack level. Implies abs(depth) >= 2.
-- p Show full path for module names.
-- v Show VM states. Can be combined with stack dumps, e.g. vf or fv.
-- z Show zones. Can be combined with stack dumps, e.g. zf or fz.
-- r Show raw sample counts. Default: show percentages.
-- a Annotate excerpts from source code files.
-- A Annotate complete source code files.
-- G Produce raw output suitable for graphical tools (e.g. flame graphs).
-- m<number> Minimum sample percentage to be shown. Default: 3.
-- i<number> Sampling interval in milliseconds. Default: 10.
--
----------------------------------------------------------------------------
-- Cache some library functions and objects.
local jit = require("jit")
assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
local profile = require("jit.profile")
local vmdef = require("jit.vmdef")
local math = math
local pairs, ipairs, tonumber, floor = pairs, ipairs, tonumber, math.floor
local sort, format = table.sort, string.format
local stdout = io.stdout
local zone -- Load jit.zone module on demand.
-- Output file handle.
local out
------------------------------------------------------------------------------
local prof_ud
local prof_states, prof_split, prof_min, prof_raw, prof_fmt, prof_depth
local prof_ann, prof_count1, prof_count2, prof_samples
local map_vmmode = {
N = "Compiled",
I = "Interpreted",
C = "C code",
G = "Garbage Collector",
J = "JIT Compiler",
}
-- Profiler callback.
local function prof_cb(th, samples, vmmode)
prof_samples = prof_samples + samples
local key_stack, key_stack2, key_state
-- Collect keys for sample.
if prof_states then
if prof_states == "v" then
key_state = map_vmmode[vmmode] or vmmode
else
key_state = zone:get() or "(none)"
end
end
if prof_fmt then
key_stack = profile.dumpstack(th, prof_fmt, prof_depth)
key_stack = key_stack:gsub("%[builtin#(%d+)%]", function(x)
return vmdef.ffnames[tonumber(x)]
end)
if prof_split == 2 then
local k1, k2 = key_stack:match("(.-) [<>] (.*)")
if k2 then key_stack, key_stack2 = k1, k2 end
elseif prof_split == 3 then
key_stack2 = profile.dumpstack(th, "l", 1)
end
end
-- Order keys.
local k1, k2
if prof_split == 1 then
if key_state then
k1 = key_state
if key_stack then k2 = key_stack end
end
elseif key_stack then
k1 = key_stack
if key_stack2 then k2 = key_stack2 elseif key_state then k2 = key_state end
end
-- Coalesce samples in one or two levels.
if k1 then
local t1 = prof_count1
t1[k1] = (t1[k1] or 0) + samples
if k2 then
local t2 = prof_count2
local t3 = t2[k1]
if not t3 then t3 = {}; t2[k1] = t3 end
t3[k2] = (t3[k2] or 0) + samples
end
end
end
------------------------------------------------------------------------------
-- Show top N list.
local function prof_top(count1, count2, samples, indent)
local t, n = {}, 0
for k in pairs(count1) do
n = n + 1
t[n] = k
end
sort(t, function(a, b) return count1[a] > count1[b] end)
for i=1,n do
local k = t[i]
local v = count1[k]
local pct = floor(v*100/samples + 0.5)
if pct < prof_min then break end
if not prof_raw then
out:write(format("%s%2d%% %s\n", indent, pct, k))
elseif prof_raw == "r" then
out:write(format("%s%5d %s\n", indent, v, k))
else
out:write(format("%s %d\n", k, v))
end
if count2 then
local r = count2[k]
if r then
prof_top(r, nil, v, (prof_split == 3 or prof_split == 1) and " -- " or
(prof_depth < 0 and " -> " or " <- "))
end
end
end
end
-- Annotate source code
local function prof_annotate(count1, samples)
local files = {}
local ms = 0
for k, v in pairs(count1) do
local pct = floor(v*100/samples + 0.5)
ms = math.max(ms, v)
if pct >= prof_min then
local file, line = k:match("^(.*):(%d+)$")
if not file then file = k; line = 0 end
local fl = files[file]
if not fl then fl = {}; files[file] = fl; files[#files+1] = file end
line = tonumber(line)
fl[line] = prof_raw and v or pct
end
end
sort(files)
local fmtv, fmtn = " %3d%% | %s\n", " | %s\n"
if prof_raw then
local n = math.max(5, math.ceil(math.log10(ms)))
fmtv = "%"..n.."d | %s\n"
fmtn = (" "):rep(n).." | %s\n"
end
local ann = prof_ann
for _, file in ipairs(files) do
local f0 = file:byte()
if f0 == 40 or f0 == 91 then
out:write(format("\n====== %s ======\n[Cannot annotate non-file]\n", file))
break
end
local fp, err = io.open(file)
if not fp then
out:write(format("====== ERROR: %s: %s\n", file, err))
break
end
out:write(format("\n====== %s ======\n", file))
local fl = files[file]
local n, show = 1, false
if ann ~= 0 then
for i=1,ann do
if fl[i] then show = true; out:write("@@ 1 @@\n"); break end
end
end
for line in fp:lines() do
if line:byte() == 27 then
out:write("[Cannot annotate bytecode file]\n")
break
end
local v = fl[n]
if ann ~= 0 then
local v2 = fl[n+ann]
if show then
if v2 then show = n+ann elseif v then show = n
elseif show+ann < n then show = false end
elseif v2 then
show = n+ann
out:write(format("@@ %d @@\n", n))
end
if not show then goto next end
end
if v then
out:write(format(fmtv, v, line))
else
out:write(format(fmtn, line))
end
::next::
n = n + 1
end
fp:close()
end
end
------------------------------------------------------------------------------
-- Finish profiling and dump result.
local function prof_finish()
if prof_ud then
profile.stop()
local samples = prof_samples
if samples == 0 then
if prof_raw ~= true then out:write("[No samples collected]\n") end
return
end
if prof_ann then
prof_annotate(prof_count1, samples)
else
prof_top(prof_count1, prof_count2, samples, "")
end
prof_count1 = nil
prof_count2 = nil
prof_ud = nil
end
end
-- Start profiling.
local function prof_start(mode)
local interval = ""
mode = mode:gsub("i%d*", function(s) interval = s; return "" end)
prof_min = 3
mode = mode:gsub("m(%d+)", function(s) prof_min = tonumber(s); return "" end)
prof_depth = 1
mode = mode:gsub("%-?%d+", function(s) prof_depth = tonumber(s); return "" end)
local m = {}
for c in mode:gmatch(".") do m[c] = c end
prof_states = m.z or m.v
if prof_states == "z" then zone = require("jit.zone") end
local scope = m.l or m.f or m.F or (prof_states and "" or "f")
local flags = (m.p or "")
prof_raw = m.r
if m.s then
prof_split = 2
if prof_depth == -1 or m["-"] then prof_depth = -2
elseif prof_depth == 1 then prof_depth = 2 end
elseif mode:find("[fF].*l") then
scope = "l"
prof_split = 3
else
prof_split = (scope == "" or mode:find("[zv].*[lfF]")) and 1 or 0
end
prof_ann = m.A and 0 or (m.a and 3)
if prof_ann then
scope = "l"
prof_fmt = "pl"
prof_split = 0
prof_depth = 1
elseif m.G and scope ~= "" then
prof_fmt = flags..scope.."Z;"
prof_depth = -100
prof_raw = true
prof_min = 0
elseif scope == "" then
prof_fmt = false
else
local sc = prof_split == 3 and m.f or m.F or scope
prof_fmt = flags..sc..(prof_depth >= 0 and "Z < " or "Z > ")
end
prof_count1 = {}
prof_count2 = {}
prof_samples = 0
profile.start(scope:lower()..interval, prof_cb)
prof_ud = newproxy(true)
getmetatable(prof_ud).__gc = prof_finish
end
------------------------------------------------------------------------------
local function start(mode, outfile)
if not outfile then outfile = os.getenv("LUAJIT_PROFILEFILE") end
if outfile then
out = outfile == "-" and stdout or assert(io.open(outfile, "w"))
else
out = stdout
end
prof_start(mode or "f")
end
-- Public module functions.
return {
start = start, -- For -j command line option.
stop = prof_finish
}
| mit |
diamondo25/Vana | scripts/npcs/mike.lua | 2 | 2338 | --[[
Copyright (C) 2008-2016 Vana Development Team
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; version 2
of the License.
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.
--]]
-- Mike at the dungeon entrance from Perion (1040001)
dofile("scripts/utils/npcHelper.lua");
addText("Go through here and you will find the Dungeon of Victoria. ");
addText("Take care...");
sendNext();
if isQuestActive(2048) then
addText("Hmmm... so you want to know how to get " .. blue(itemRef(4021009)) .. ", " .. blue(itemRef(4003002)) .. ", " .. blue(itemRef(4001005)) .. " and " .. blue(itemRef(4001006)) .. "? ");
addText("What you plan to do with these precious materials? ");
addText("I've heard... ");
addText("I've studied a little about the island before working as a guard...");
sendNext();
addText(blue(itemRef(4021009)) .. " and " .. blue(itemRef(4003002)) .. " um... ");
addText("I think the fairies of " .. mapRef(101000000) .. " should know something about them. ");
addText("The story about " .. itemRef(4003002) .. " is that it never melts. ");
addText("They probably have " .. itemRef(4003002) .. " too.");
sendNext();
addText(blue(itemRef(4001005)) .. " and " .. blue(itemRef(4001006)) .. " are the problem. ");
addText("The monsters probably have them, they've been around here for a long time... ");
addText("Regarding " .. itemRef(4001005) .. "... ");
addText("Oh, yes! ");
addText("The Golem should have it, since it was created by wizards long ago...");
sendNext();
addText(blue(itemRef(4001006)) .. " ... I've heard of it, a flame that looks like a pen... ");
addText("It has something to do with a dragon blowing fire or something like that. ");
addText("Anyway, if it's cruel, it will be difficult for you to take the " .. itemRef(4001006) .. ". ");
addText("Good luck!");
sendNext();
end | gpl-2.0 |
bmscoordinators/FFXI-Server | scripts/globals/items/icefish.lua | 12 | 1322 | -----------------------------------------
-- ID: 4470
-- Item: icefish
-- Food Effect: 5Min, Mithra only
-----------------------------------------
-- Dexterity 3
-- Mind -5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
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;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,4470);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, 3);
target:addMod(MOD_MND, -5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, 3);
target:delMod(MOD_MND, -5);
end;
| gpl-3.0 |
bmscoordinators/FFXI-Server | scripts/zones/Bastok_Markets/npcs/Balthilda.lua | 14 | 1716 | -----------------------------------
-- Area: Bastok Markets
-- NPC: Balthilda
-- Type: Merchant
-- @zone 235
-- @pos -300 -10 -161
--
-- NPC not found in 'npc_list'
--
-- Auto-Script: Requires Verification. Verified standard dialog - thrydwolf 12/18/2011
--
-- Updated Aug-09-2013 by Zerahn, based on bgwiki and gamerescape
-----------------------------------
require("scripts/globals/shop");
package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil;
require("scripts/zones/Bastok_Markets/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, BALTHILDA_SHOP_DIALOG);
stock = {
0x30B9, 1904,3, --Poet's Circlet
0x3140, 1288,3, --Tunic
0x3139, 2838,3, --Linen Robe
0x31C0, 602,3, --Mitts
0x31B9, 1605,3, --Linen Cuffs
0x3240, 860,3, --Slacks
0x3239, 2318,3, --Linen Slops
0x32C0, 556,3, --Solea
0x32B9, 1495,3, --Holly Clogs
0x349D, 1150,3 --Leather Ring
}
showNationShop(player, NATION_BASTOK, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.