Achaea Runewarden runelore script + alias

Post Reply
Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Achaea Runewarden runelore script + alias

Post by Guilend »

I did not find this question on the forum, or an answer so i will post my question. I am working on a script for my runelore, i want it just like my charming spell script I had help making ealier for Avalon. I have some of the script made and i am sure the second part with the function isn't correct, but here it is.
Code: [show] | [select all] lua
runeGT = {ke = "kena", fe = "fehu", ig = "inguz", wu = "wunjo", so = "sowulu"}

runeMT = {je = "jera", al = "algiz"}

runeGTR = {pi = "pithakhan"}

runeR = {la = "lagul"}

runeG = {ur = "uruz"}


function doRune(inkcolor,typerune,lastdo)
 if typerune = runeGT then
  send(" " .. inkcolor .. ";sketch " .. typerune .. " on ground")
	 elseif typerune = runeGT and lastdo = "1,2,3,4,5,6")
	  send(" " .. inkcolor .. ";sketch " .. typerune .. " on totem on slot " .. lastdo)
		else
		 echo("No Rune Found!")
		  end
		end
	end
	
this is what each of those tables are suppose to do.

Kena---------Ground/Totem command: sketch kena on ground/<totem>
Ururz--------Ground command: sketch uruz on ground
Fehu---------Ground/Totem command: sketch Fehu on ground/<totem>
Pithakhan----Ground/Totem or runeblade command: sketch pithakhan on ground/<totem> or sketch pithakhan on weapon
Jera---------Me/Target command:sketch jera on me/target
Inguz--------Ground/Totem command:sketch inguz on ground/<totem>
Wunjo--------Ground/Totem command:sketch wunjo on ground/<totem>
Lagul--------Runeblade command:sketch lagul on runeblade ------- I can't remember if it's runeblade or weapon
Sowulu-------Ground/Totem command:sketch sowulu on ground/<totem>
Algiz--------Me/Target command:sketch algiz on me/target

the "<totem>" means that if i have more then one i have to use the item number, but right now i don't even have the totem ability so not really sure how it works yet, so I might just need a script to just handle totems alone.


I want to be able to hit like, "r je <someone's name> and outr the right inks, and then sketch jera on the person that i put. Or I can just do "r je" and outr the right inks then sketch the jera rune on myself. We can just not do the totem part, i can just make a separate script for that once i can use totems.

Thanks in advanced.

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Re: Achaea Runewarden runelore script + alias

Post by Guilend »

or if someone happens to have a really good script to handle this and totems, it will not hurt my feelings if it's different this what i want and they want to share it with me, i will be more then happy to use it instead. This is just the only way i could think of to manage runes. If there is a better way then by all means let me know.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Achaea Runewarden runelore script + alias

Post by Jor'Mox »

So, in your example of usage, you don't have anything with ink color, but you mention it, and have it in your script... is there some specific ink color for each rune, or do you have to choose the ink you want to use each time?

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Re: Achaea Runewarden runelore script + alias

Post by Guilend »

it's specific for the rune i am sketching, here is the current script i am using and it's alias.

Code: [show] | [select all] lua
function runed(inkcolor,typerune,whogets)
 if whogets == "o" then
  send(" " .. inkcolor .. ";sketch " .. typerune .. " on " .. matches[3])
	elseif whogets == "g" then
	 send(" " .. inkcolor .. ";sketch " .. typerune .. " on ground")
	  else
	 send(" " .. inkcolor .. ";sketch " .. typerune .. " on me")
	 end
	 end
Code: [show] | [select all] lua
^ralg(?: (\w+))?$

runed("outr greenink" ,"algiz" ,matches[2])
That way i can simply just add the color of ink in the alias, some even have several colors, which is why i did it this way, so i could add all the ink colors in the alias.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Achaea Runewarden runelore script + alias

Post by Jor'Mox »

Here is what I put together so far. Obviously the ink colors are wrong, and there is potential room for improvement. This would work with an alias using this pattern: ^r (\w+)(?: ([gtrmw]))?(?:| (\w+))$
And this code: writeRune(matches[2], matches[3], matches[4])
Code: [show] | [select all] lua
local runes = {ke = "kena", fe = "fehu", ig = "inguz", wu = "wunjo", so = "sowulu", je = "jera",
    al = "algiz", pi = "pithakhan", la = "lagul", ur = "uruz"}

local runeTypes = {kena = 'gt', fehu = 'gt', inguz = 'gt', wunjo = 'gt', sowulu = 'gt', jera = 'mr', algiz = 'mr',
    pithakhan = 'gtw', lagul = 'w', uruz = 'g'}

local runeInks = {kena = {'green'}, fehu = {'green'}, inguz = {'green'}, wunjo = {'green'}, sowulu = {'green'},
    jera = {'green'}, algiz = {'green'}, pithakhan = {'green'}, lagul = {'green'}, uruz = {'green'}}

local runeStyles = {g = "ground", t = "totem on slot ", m = "me", w = "runeblade", r = ""}

function writeRune(rune, style, target)
    rune = runes[rune]
    if not rune then
        echo("Rune Not Found!")
        return
    end
    local rtype = runeTypes[rune]
    if style == "" then style = nil end
    if target and not style then
        if tonumber(target) then
            style = "t"
        else
            style = "r"
        end
    end
    style = style or string.sub(rtype,1,1)
    local rink = runeInks[rune]
    for _,ink in ipairs(rink) do
        send("outr " .. ink .. "ink")
    end
    local cmd = "sketch " .. rune .. " on " .. runeStyles[style]
    if style == "r" or style == "t" then
        cmd = cmd .. target
    end
    send(cmd)
end
In theory, you could use this alias as follows:
  • With JUST the rune abbreviation: r je (in which case it defaults to the first "style" option in the runeTypes entry for that rune, in this case "m", for "me")
  • With the rune and a style argument: r pi w (in which case it uses the style you choose, g = ground, t = totem, w = weapon, m = me, r = target (note that totem and target need an extra argument to work))
  • With the rune and a target: r pi 6 OR r je jormox (which would apply the rune to slot six on your totem, or to jormox, respectively)
  • Or with all three: r pi t 6 OR r je r jormox

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Re: Achaea Runewarden runelore script + alias

Post by Guilend »

"uruz = {'green'}}" this part needs blue and yellow inks, how do i add that in there or is it possible?

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Achaea Runewarden runelore script + alias

Post by Jor'Mox »

Just replace ‘green’ with ‘blue’, ‘yellow’.
I intionally put all the ink colors in mini tables, so each one is it’s own list that can have any number of colors you want. Just separate the colors with commas, and you should be good.

Side note, don’t copy from this post, it was written on my phone and has smart quotes, which mess up lua.

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Re: Achaea Runewarden runelore script + alias

Post by Guilend »

thanks

Post Reply