Multi command alias (god wars 2)

Posted by Jesse P Bunker on Tue 13 Sep 2022 09:48 PM — 2 posts, 7,314 views.

#0
I am trying to make an alias that places an r before every letter, for example:

typing 'ra' returns
ra
typing 'rabc' returns
ra
rb
rc

I know very little about scripting, but could inputting this function into a script potentially help me? I am in way over my head. =)

Quote:

function string.insert(str1, str2, pos)
return str1:sub(1,pos)..str2..str1:sub(pos+1)
end
#1
Jesse P Bunker said:

I am trying to make an alias that places an r before every letter, for example:

typing 'ra' returns
ra
typing 'rabc' returns
ra
rb
rc

I know very little about scripting, but could inputting this function into a script potentially help me? I am in way over my head. =)

Quote:

function string.insert(str1, str2, pos)
return str1:sub(1,pos)..str2..str1:sub(pos+1)
end



Not sure what scripting language you are used to, but this is how I would go about it in Lua:


local str = "%1"

for letter in str:gmatch("%w") do
   Send("r" .. letter)
end


This is, of course, provided your alias is 'r*'. Be mindful, though, as this will fire on any command that starts with 'r'. You may consider using a different, unique alias, such as: sendr*.