search for errors on my lua card script code snippet: function s.filter(c) return…
- User
search for errors on my lua card script code snippet: function s.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and not c:IsFieldSpell() end function s.filter_campo(c) return c:IsSSetable() and c:IsFieldSpell() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>=1 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local campo_livre = Duel.GetLocationCount(tp,LOCATION_FZONE) if campo_livre > 0 then -- pergunta se quer por campo if Duel.SelectYesNo(tp,2) then local p=Duel.SelectMatchingCard(tp,s.filter_campo,tp,LOCATION_DECK,0,0,1,nil) if #p>0 then Duel.SSet(tp,p) end end end local tem = Duel.GetLocationCount(tp,LOCATION_SZONE) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,0,tem,nil) if #g>0 then Duel.SSet(tp,g) end end
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.