localmRedirectHatnote=require('Module:Redirect hatnote')localmArguments=require('Module:Arguments')localmHatnote=require('Module:Hatnote')localp={}functionp.redirectMulti(frame)localargs=mArguments.getArgs(frame)--Get maxArg manually because getArgs and table.maxn aren't friendslocalmaxArg=0fork,vinpairs(args)doiftype(k)=='number'andk>maxArgthenmaxArg=kendend--Get number of redirects then remove it from the args tablelocalnumRedirects=tonumber(args[1])or1--Manual downshift of arguments; not using table.remove because getArgs is--gnarly and it's not a sequence anywayfori=2,maxArg+1doargs[i-1]=args[i]end--if no arguments past redirects exist, add in a default setifmaxArg-2<=numRedirectsthenfori=1,numRedirectsdoargs[numRedirects+(2*i)]=args[i]andmHatnote.disambiguate(args[i])--this does add in an "and" after the last item, but it's ignoredargs[numRedirects+(2*i)+1]='and'endendlocaloptions={selfref=args.selfref}returnmRedirectHatnote._redirect(args,numRedirects,options)endreturnp