Glad to see it fixed, and that was my fault. Hempa was just going off what I posted as an example. I used string.rep() in my code, but for some reason used string.repeat() here.naftali wrote:Aha! Finally, that works! Maybe eventually I'll figure out a way to control what order the elixers are listed in.
@hempa Thanks so much! Just fyi though the function is string.rep() not string.repeat() at least in the latest dev version of Mudlet.
elist in IRE muds
Re: elist in IRE muds
Re: elist in IRE muds
@kaeus: of course, it's string.rep. I was just copying directly from the uploaded script and missed it
Re: elist in IRE muds
Don't want to create a new topic, but I've run into a new problem. I've modified the code a bit, and it still works but I wanted to add something else and cannot figure out how.
What I have now takes the original table (as discussed above) and turns it into another table that comes out looking like this:
I then use the following to print it:
If sips >= 100 then color = green
elseif sips >=50 then color = yellow
else color = red
end
What I can't figure out is how to use either fg() or cecho() to make that happen. Every time I try the code stops after echoing the first element of the table. Any suggestions?
What I have now takes the original table (as discussed above) and turns it into another table that comes out looking like this:
Code: Select all
table {
'mana': 644
'caloric': '154'
'levitation': '47'
'mending': '61'
'mass': '197'
'health': 206
'frost': '164'
'speed': '199'
'immunity': '194'
'restoration': '197'
'venom': '162'
}
What I want to do is color it based on the number of sips left.
If sips >= 100 then color = green
elseif sips >=50 then color = yellow
else color = red
end
What I can't figure out is how to use either fg() or cecho() to make that happen. Every time I try the code stops after echoing the first element of the table. Any suggestions?
Re: elist in IRE muds
This snippet should do the trick for you:
Re: elist in IRE muds
Never mind found the problem. Your script had the same problem as mine, but it was caused by the fact that some of the numbers were strings and others were numbers. For some reason the problem wasn't showing up until I tried to color things.
Re: elist in IRE muds
Always, when adding the sips to the tables, make sure you put it in as a number if it is to be considered a number. tonumber(variable) will help you do that!
Re: elist in IRE muds
Has anyone compiled a package for an elixlist summary? I suck too much at Lua to make my own...
Re: elist in IRE muds
I do have a complete elixlist parser for achaea, however it stores data into my system in a way that prevents it from being a standalone solution (I have a full gear tracking system with database integration).
I could post the trigger when I get home tomorrow though.
I could post the trigger when I get home tomorrow though.
Re: elist in IRE muds
Ok, slight necro. Any update on this?? *hope*