Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Quick Coding Questions

14567810»

Comments

  • AhmetAhmet Wherever I wanna beMember Posts: 2,719 @ - Epic Achaean
    @Israyhl Open your scripts window: Class svo -> svo -> svo Utilities -> Custom prompt tags -> @affs

    Use that as an example.
    Huh. Neat.
  • IsrayhlIsrayhl Member Posts: 121 ✭✭✭ - Distinguished
    Well then. That worked oddly easily. Thank you @Ahmet!
  • KlendathuKlendathu Eye of the StormMember Posts: 2,145 @@ - Legendary Achaean
    Israyhl said:
    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."

  • OmorOmor Member Posts: 706 ✭✭✭✭ - Eminent
    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.
    Omor Ceberek - Targossas

    got gud
    Bade
  • IsrayhlIsrayhl Member Posts: 121 ✭✭✭ - Distinguished
    Klendathu said:
    Israyhl said:
    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
  • CamrothCamroth Member Posts: 78 ✭✭✭ - Distinguished
    edited March 4
    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.

    How can I do this properly?

  • TorinnTorinn Member Posts: 124 ✭✭✭ - Distinguished
    You want to set the table entry, at index key, to nil

    table[protagonist.names]=nil
  • KeneanungKeneanung Member Posts: 497 ✭✭✭✭ - Eminent
    You'll need to find the index of the value you want to remove. There is http://wiki.mudlet.org/w/Manual:Lua_Functions#table.index_of for that. So you'd need to table.remove(protagonist.names, table.index_of(matches[2]))
    CamrothCaelan
  • AhmetAhmet Wherever I wanna beMember Posts: 2,719 @ - Epic Achaean
    edited March 4
    table.remove(protaganist.names, table.index_of(protaganist.names, matches[2]))

    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.

    <3 @Camroth

    EDIT: Double-ninja'd.

    Also, don't do what Torinn said. That just doesn't do nothin.
    Huh. Neat.
    Camroth
  • CamrothCamroth Member Posts: 78 ✭✭✭ - Distinguished
    Ahmet said:


    Also, it's P R O T A G O N I S T oh my god.


    I'll have you know I even googled protagonist before I went back to the forums tab and still misspelled that shit.  smh
  • TorinnTorinn Member Posts: 124 ✭✭✭ - Distinguished
    edited March 4
    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
  • AhmetAhmet Wherever I wanna beMember Posts: 2,719 @ - Epic Achaean
    The figure of Soandso blurs, and you notice a puzzled expression forming on his face before he vanishes from sight.

    This is... what now?
    Huh. Neat.
  • AhmetAhmet Wherever I wanna beMember Posts: 2,719 @ - Epic Achaean
    Ahmet said:
    The figure of Soandso blurs, and you notice a puzzled expression forming on his face before he vanishes from sight.

    This is... what now?
    Whoops, wrong thread.
    Huh. Neat.
14567810»
Sign In to Comment.