【发布时间】:2016-02-11 01:37:16
【问题描述】:
您好,我是 lua 新手,我不断收到脚本错误 错误是
67: 'end' 预期在 eof 附近(在第 38 行关闭函数)
这里是代码,Agian,我是 lau 的新手,如有任何帮助,将不胜感激
function c123456708.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(123456708,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCost(c123456708.spcost)
e1:SetTarget(c123456708.sptg)
e1:SetOperation(c123456708.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(123456708,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c123456708.thcon)
e2:SetTarget(c123456708.thtg)
e2:SetOperation(c123456708.thop)
c:RegisterEffect(e2)
end
function c123456708.cfilter(c)
return c:IsFaceup() and c:GetCode()==123456709
end
function c123456708.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c123456708.cfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c123456708.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c123456708.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c123456708.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c123456708.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c123456708.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c123456708.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c123456708.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_MONSTER) and c:IsAbleToHand(11)
end
function c123456708.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c123456708.thfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c123456708.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c123456708.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
如果筛选起来很麻烦,我很抱歉
加上一个姐妹代码,我正在尝试索引全局 c50140163 nil 值 代码是
function c123456709.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c123456709.regop)
c:RegisterEffect(e1)
end
c123456709.lvupcount=1
c123456709.lvup={123456707}
c123456709.lvdncount=2
c123456709.lvdn={123456707,123456706}
function c123456709.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetSummonType()==SUMMON_TYPE_SPECIAL+1 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(123456709,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c123456709.eqcon)
e1:SetTarget(c123456709.eqtg)
e1:SetOperation(c123456709.eqop)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetLabelObject(e)
c:RegisterEffect(e1)
end
end
function c123456709.eqcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return ec==nil or ec:GetFlagEffect(123456709)==0
end
function c123456709.filter(c)
return c:IsAbleToChangeControler()
end
function c123456709.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1- tp) and c123456709.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c123456709.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c123456709.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c123456709.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function c123456709.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
local def=tc:GetTextDefence()
if atk<0 then atk=0 end
if def<0 then def=0 end
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(123456709,RESET_EVENT+0x1fe0000,0,0)
e:GetLabelObject():SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c123456709.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SE T_AVAILABLE)
e2:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(c123456709.repval)
tc:RegisterEffect(e2)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
end
end
function c123456709.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
【问题讨论】:
-
是否还会出现初始效果错误,无法调用错误函数?
-
我还得到了另一个与姐妹代码有关的错误代码,它试图索引全局 c50140163 ni 值,代码是
标签: lua