So I am attempting to convert the prompt list of svo affs (from the @affs tag) into a table or something that I can instead echo into a miniConsole within my gui instead of in my prompt.
I can get things working via cecho to display in the MiniConsole, but I can't populate a table/variable with the relevant data needed to have it echo in the miniConsole.
Help?
They're already in a table, they have to be for the prompt tag to echo them. Can't remember precisely what the table's called, something like svo.affl
Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
I am attempting to make a target affliction tracker, because AK works terribly with a lot of my premade scripts. Anyone have any tips to make this easier? If the answer's too long, feel free to shoot me a message on here.
So I am attempting to convert the prompt list of svo affs (from the @affs tag) into a table or something that I can instead echo into a miniConsole within my gui instead of in my prompt.
I can get things working via cecho to display in the MiniConsole, but I can't populate a table/variable with the relevant data needed to have it echo in the miniConsole.
Help?
They're already in a table, they have to be for the prompt tag to echo them. Can't remember precisely what the table's called, something like svo.affl
So far, I've been lazy and just copied the function that makes the table that echoes to the prompt table, and changed the return portion to a cecho to the miniconsole. Has been working beautifully so far, although I'm trying to work out how to take out the [] that shows up in the console from bleeding. Also works for limb/aff tracking prompt tags in the same manner. I'll keep people updated if I totally break something by doing it that way. :P
I'm trying to figure out how to remove a variable key from a table.
For example if I had the trigger --^(\w+) had a little lamb\.$
I could use: --table.insert(protaganist.names, matches[2]) to add the name to the table.
But I am having trouble removing the name from the table. If I had a similar trigger. --Everywhere that (\w+) went\.$ --table.remove(protaganist.names, matches[2]) does nothing.
I could remove it by table.remove(protaganist.names, 1) but that doesn't help me if I had a long list of names from an enemy list, as I would not be able to determine whose name was in what position in the table.
If I use protaganist.names= nil then it kills the whole table.
Yeah it works if you are inserting the protagonist as the key in the table. It's what I use to display target and personal afflictions, and remove them when cured. Though granted the index of function is not something I knew existed
I have a function in a script I want to call on Variables 'mayaHit' and 'mayaMiss'. I added these two variables to the variables tab but each time I start mudlet they are gone. How do I make them stay?
mayaHit = mayaHit or 0<br> mayaMiss = mayaMiss or 0
at the start of the function. Change 0 to whatever you want it to initialise as. That'll keep their value as whatever they are, when you do the function, or set it to 0 if the variable isn't initialised. Eg.
function functionName()<br> mayaHit = mayaHit or 0<br> mayaMiss = mayaMiss or 0<br> <actual function stuff><br><br> end
I have a function in a script I want to call on Variables 'mayaHit' and 'mayaMiss'. I added these two variables to the variables tab but each time I start mudlet they are gone. How do I make them stay?
If you are adding it to a crit counter or something you need to save the variables outside of Mudlet, the rest of what you are using should do that somewhere so you want to add to that.
mayaHit = mayaHit or 0<br> mayaMiss = mayaMiss or 0
at the start of the function. Change 0 to whatever you want it to initialise as. That'll keep their value as whatever they are, when you do the function, or set it to 0 if the variable isn't initialised. Eg.
function functionName()<br> mayaHit = mayaHit or 0<br> mayaMiss = mayaMiss or 0<br> <actual function stuff><br><br> end
This might come in useful. I have a variable for my 2H Focus which I need to set manually everytime I log in...
I have a problem where the variables don't initialize until I go into the script editor, I don't have to change anything, just the process of deselecting and selecting it again does the trick
For example
function wsys.prompttags.sobfocus()<br> if focus == "speed" then<br> return "SPD"<br> else<br> return "PRC"<br> end<br>end
Your script is presumably before the wundersys scripts, so the wsys namespace doesn't exist yet and your script throws an error. There's an event for wundersys loading, so you would need to bind an event handler to that to set up your prompt tags. I could be more help if I wasn't on mobile.
Are you using svo or wundersys? If svo and you have a custom prompt, use svo.deleteLineP() -- If no custom prompt, or you're using wundersys, use deleteFull()
Comments
Use that as an example.
got gud
For example if I had the trigger --^(\w+) had a little lamb\.$
I could use: --table.insert(protaganist.names, matches[2]) to add the name to the table.
But I am having trouble removing the name from the table. If I had a similar trigger.
--Everywhere that (\w+) went\.$
--table.remove(protaganist.names, matches[2]) does nothing.
I could remove it by table.remove(protaganist.names, 1) but that doesn't help me if I had a long list of names from an enemy list, as I would not be able to determine whose name was in what position in the table.
If I use protaganist.names= nil then it kills the whole table.
How can I do this properly?
table[protagonist.names]=nil
table.remove(protagonist.names, table.index_of(matches[2]))
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
table.remove takes two arguments, a table and a number, not a table and a value.
Also, it's P R O T A G O N I S T oh my god.
@Camroth
EDIT: Double-ninja'd.
Also, don't do what Torinn said. That just doesn't do nothin.
This is... what now?
I have a function in a script I want to call on Variables 'mayaHit' and 'mayaMiss'. I added these two variables to the variables tab but each time I start mudlet they are gone. How do I make them stay?
Penwize has cowardly forfeited the challenge to mortal combat issued by Atalkez.
at the start of the function. Change 0 to whatever you want it to initialise as. That'll keep their value as whatever they are, when you do the function, or set it to 0 if the variable isn't initialised. Eg.
For example
focus = "speed"
but I get this until I go into the scripts.
5847h 4921m 100%e100%w @sobfocus|XX|EEC M 20:59:48.969|
It's the same for my weapon variable, and oddly my hunting alias.
ALSO, once that is configured, I then Dragonform and lose my prompt completely...
Any ideas?
Results of disembowel testing | Knight limb counter | GMCP AB files
Is there a way I can make
Only show seconds/miliseconds? Or is there another function I can make do this?
Anyway around that with gagging?
Are you using svo or wundersys? If svo and you have a custom prompt, use svo.deleteLineP() -- If no custom prompt, or you're using wundersys, use deleteFull()
local s = getTimestamp(getLineCount())
local myTime = s:sub(#s - 5)
@Sobriquet: Use deleteFull() instead, which will delete the current line and the line immediately following it if it's a prompt.
Results of disembowel testing | Knight limb counter | GMCP AB files
How do you write your trigger off these two lines:
So that "abc de f6" and "AB CDEF6" are captured, and the reflex command "msg krypton @1"
gives you:
String ends before first parenthesis:
^\[FW message\] (.+) \(A message\)$
^\[FW message\] (.+) \(B message\)$
That would capture the two you're talking about.