Small Coding Questions

ArbreArbre Arbrelina JolieMember, Guildmaster Posts: 1,999 mod
This is mainly so Theosomething will quit making new threads.  >.>
And because we used to have one before.
Merelii
«13456

Comments

  • TheophorusTheophorus Member Posts: 4
    Sorry if I am posting a lot of questions regarding coding. It would appear that the new forums incorporate a question function, allowing people to seek individual consultation and indicate whether a given response actually resolved a query. This may be a more organized archival way to approach tech talk. It results in more topics, but it also has the secondary effect of making the forums appear more active than they actually may be at present. If that's not how the Gods, Mods and broader community want to run things, then I am fine posting here.
    image
  • ArbreArbre Arbrelina Jolie Member, Guildmaster Posts: 1,999 mod
    It's just more convenient like this - it's how we had it in oldforums anyways.  I was just teasing, btw, you weren't being an annoyance or anything.
  • AkimotoAkimoto Member Posts: 32 ✭✭
    That is Arbre's way of saying you are being spammy! I am kidding, I will start with asking some questions myself... I am stuck... as most of you know I am the co-creator of one of the most popular systems used in Aetolia and well... I am redoing the curing again (for the 235234th time) and I want to do hidden afflictions in a more efficient way... throw some ideas at me so I can figure this out? It is the only thing that is hindering my newest creation!
    imageimageimage
    Rammus
  • RammusRammus Member Posts: 48 ✭✭
    How's the current logic setup for it?
  • AkimotoAkimoto Member Posts: 32 ✭✭
    Currently it just counts the hiddens and relies on tree/recon/focus/class skills to remove one if the cure was not a member of the current aff table

    imageimageimage
  • WingerWinger Member Posts: 10
    Before I left, I had a different 'afflict' function for the actual affliction message (as in, the message for curare) and the symptom message ("You are paralysed and can't do that" or whatever), then if I got a symptom for an affliction I didn't have, and had an unknown aff, I'd remove one unknown aff from my affliction list and add the new affliction. If I didn't have an unknown aff, I'd wait for a second symptom before adding it to the affliction table. This is back when we didn't have You are afflicted with x and back when illusions were a huge deal though. You could do something like that if you're willing to hunt for all the symptom messages.
  • SiliahSiliah Member Posts: 4
    Winger said:
    Before I left, I had a different 'afflict' function for the actual affliction message (as in, the message for curare) and the symptom message ("You are paralysed and can't do that" or whatever), then if I got a symptom for an affliction I didn't have, and had an unknown aff, I'd remove one unknown aff from my affliction list and add the new affliction. If I didn't have an unknown aff, I'd wait for a second symptom before adding it to the affliction table. This is back when we didn't have You are afflicted with x and back when illusions were a huge deal though. You could do something like that if you're willing to hunt for all the symptom messages.
    I'd be willing to message some as I find them if this happens about.
  • TheophorusTheophorus Member Posts: 4
    There used to be several free Zmud systems floating around with all the symptom messages, but newer afflictions may not be included.  Most will have stayed the same.  Patterns obviously need to be revised for mudbot etc.   I'd be very interested in such a list of patterns, for any coding language.  If anybody happens to come across a freely available one, please share!  It's those damn patterns which are 90% of the legwork on making a system.
    image
  • DaskalosDaskalos Credit Whore Extraordinare Rolling amongst piles of credits.Member, Guildmaster Posts: 1,509 ✭✭✭✭✭
    With the affview system, it makes coding new systems a TON easier...

    image

    image


    Message #17059 Sent By: Oleis           Received On: 1/03/2014/17:24
    "If it makes you feel better, just checking your artifact list threatens to crash my mudlet."

    Edhain
  • WingerWinger Member Posts: 10
    Yeah Dask, but Aki was looking for specific suggestions regarding unknown afflictions.

    You're absolutely right though, it has taken me ~1 week of occasional dicking around (like.. maybe 2 hours total working on the core) with it and I feel like my system is coming along very well and could handle most things. Lately I've just been stylizing it.
  • MereliiMerelii Reno, NV DesertFTWMember Posts: 21 ✭✭
    So, I've been fighting with z mud to work with me. I think it's a simple question, but I might be mistaken. All I want is a button that will run AURA <target> and then register what rebounding type defenses a target has for FLAY. So like, if it was rebounding, clicking the button should make it FLAY REBOUNDING, right? But I am such a code n00b that I can't get the darn thing to do it. It keeps trying to send the entire #IF string as a command, and I'm not sure how to run it. I'm using an ANCIENT version of Arbre's system, so it's pretty simple, I thought...I was wrong. Can anyone please explain how to run these stupid If/then statements, in a form that my goldfish brain can understand and then maybe implement? Or hit me with a brick, that might work too.
    image
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    For buttons you need to use %if, not #if.


    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • MereliiMerelii Reno, NV DesertFTWMember Posts: 21 ✭✭
    Ahhhh...That would be my problem. See, this is what I mean by being a n00b. Thanks @Moirean. I Appreciate it. I'll try that instead.
    image
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    Buttons have some wonky code associated with them. I actually take back what I said, though. %if is for the button DISPLAY. You want the #if as the button's value, right?

    You can do this a few different ways, based on what you want the button to show, but the easiest would just be to have the button type PUSH selected, and then for the value put your #if expression - #if @enemyrebounding=1 {flay @target} or whatever it is. Then just name it whatever.
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • MereliiMerelii Reno, NV DesertFTWMember Posts: 21 ✭✭
    edited March 2013
    ahhhhh... Okay. I am thinking though, after looking at my actual window set up, that it would be better aliased, because then I could just keep going with possibly hypnosis and/or dstab. So for an alias, would it be the same? I was looking at some of the aliases from the rest of the system, and it looks really similar. It keeps kicking me back to a syntax error though...this is what I have:

    Aura @aim
     (#if @sileris=1) ; <--it says the syntax error is at the beginning of this line
    {flay sileris}

    it goes away if I add or subtract spaces, until I go to save the button. >:(



    Edit:  I think I got it. I fiddled around with it for awhile, and got it to color right and quit kicking back syntax problems. Now I just need to find some one to let me test it on them, heh.
    This is what it ended up looking like:

    Aura @aim ( %if @sileris=1) {flay sileris}
    flay rebounding


    Post edited by Merelii on
    image
  • MereliiMerelii Reno, NV DesertFTWMember Posts: 21 ✭✭
    So I was soooooooo wrong. I didn't have it.
    Note: Aura apparently uses balance and EQ. Or flay uses both....either way, you have to get eq back before flay after aura. Also, I learned to do variables! That took like...forever. ....I am so fail...
    BUT! I did it. I found the magic golden ticket or somesuch. Converted to an alias, takes to long to click button:
    Aura @aim
     #if (@tsileris and !@trebound and !@tcloak and !@tshield) {
      #wait 1775
      flay @aim sileris
      }

    ....now to do all the rest. :(
    image
  • TzaTza Member Posts: 126 ✭✭✭
    Not sure on zMud at all, but I think you need a lot more to get this to work. The #wait after the #if check doesn't look correct, unless you can gain information from the 'aura' checking instantly, but I doubt it..

    Something like:

    1) An alias with just "aura @aim" in it. This will make you use the aura skill on the person in the @aim variable. However, getting information from the mud is never instant, so you need to wait until you get the line telling you what aura they have. Which leads to..

    2) A trigger. It needs to catch the aura line (or lines. I don't know what the skill does in detail). It will record whatever aura they have into a variable. For example your 'tsileris' or 'trebound' etc variables.

    3) After setting those variables based on the trigger input, you can now run your #if sentence (as part of your trigger or once you regain balance) and flay whatever is appropriate.

    (Or maybe I'm just reading you wrong.. )

  • MereliiMerelii Reno, NV DesertFTWMember Posts: 21 ✭✭
    edited March 2013
    Aura kicks back info as soon as the server reads it. the #Wait will eventually get changed to @eqbal, but #wait was what I used there because I was trying to see if I could even make it work, in the limited time I had.  the #IF line is the trigger, based on the T/F value of the variable @tsileris, etc. It fact checks against the if then, and true false, and then selects the correct one. If there is more than one defense, it strips the first, then the next, etc, starting with sileris, which has a warm up period, and takes longer to kick in, which is handy, considering most people have auto cure anymore. :)

    EDIT: So now I'm looking for the lines that come from AURA for Rebounding, Cloak, and Shield. I'm still looking for them, but any help would be awesomesauce, if any of you happen to know what they are.
    Post edited by Merelii on
    image
  • AldricAldric Member Posts: 790 ✭✭✭✭✭
    I couldn't think of anywhere appropriate for this but this thread, but I just saw on the oldforums that the firework maker is dead. (http://www.aetolia.com/node/60596)

    @Hadoryu do you have any intentions of reactivating it? It was an extraordinarily useful tool considering how clunky pyrotechnics sometimes can be. Perhaps if it was given the okay by you, @Razmael could put it on the main website? 
    image
    Feelings, sensations that you thought were dead. No squealin' remember, that it's all in your head.
    Haydyn
  • HadoryuHadoryu Member Posts: 169 ✭✭✭

    Aldric said:
    I couldn't think of anywhere appropriate for this but this thread, but I just saw on the oldforums that the firework maker is dead. (http://www.aetolia.com/node/60596)

    @Hadoryu do you have any intentions of reactivating it? It was an extraordinarily useful tool considering how clunky pyrotechnics sometimes can be. Perhaps if it was given the okay by you, @Razmael could put it on the main website? 
    Didn't realize it was dead. I'll have to see where I've stashed it and reupload it.
    image
    AldricArbreHaydyn
  • ArekaAreka Drifting in a sea of wenches' bosomsMember, Guildmaster Posts: 1,693 ✭✭✭✭✭
    QUESTION. Because I'm a derp.

    Anyone know how to, on Mushclient, make something that'll redirect certain targetting? I've managed to kill my own entities a few times now while copying mob nums on the wrong line. I'm trying to work something out that'll yell at me when I try to target specific numbers and not set those as a target.
    image
  • HavenHaven World Burner Flight SchoolMember Posts: 2,226 ✭✭✭✭✭
    Areka said:
    QUESTION. Because I'm a derp.

    Anyone know how to, on Mushclient, make something that'll redirect certain targetting? I've managed to kill my own entities a few times now while copying mob nums on the wrong line. I'm trying to work something out that'll yell at me when I try to target specific numbers and not set those as a target.
    Depends on the language you're using but if I get what you're saying here's how it's done in lua:

    if (target == 123456) then Note ("Noob! That's not something you should be killing.") end

    Or alternatively you could just set up your target script to do this:

    if (target ~= 123456) or (target ~= 789098) then target = %1 end

    What this'll do is make it set/change the target so long as it does NOT match those numbers. I hope I answered your question. If not, I'll need you to clarify a bit more.
    ¤ Si vis pacem, para bellum. ¤
    Someone powerful says, "We're going to have to delete you."
    havenbanner2
    Riluo
  • RiluoRiluo The DoctorMember Posts: 821 ✭✭✭✭
    edited March 2013
    Nevermind, I just sorted it out.

    Abhorash says, "Ve'kahi has proved that even bastards can earn their place."

  • MastemaMastema Member Posts: 298 ✭✭✭
    edited April 2013
    Hey guys, I am stuck on how to make a smallcounter that fires after I get a message three times. For example:
    ^You see a frog jump on a log.$
    local frogjumped = +1
    if frogjumped > 2 then
    send("say stop jumping")
    frogjump = 0
    else
    end
     
    I want to use it for diagnose so it does a check on the third hidden afflction what I missed. ( mudlet related)
    Carnifex failing since 2011. Fixes coming Soon ™
  • TozToz Member Posts: 2,153 ✭✭✭✭✭
    local frogjumped = frogjumped + 1
    if frogjumped > 2 then
    send("say cut that unicorn out")
    frogjump = 0
    end
    is what I would do!
    (Oasis): Azzello says, "I'll still never forget the first time I saw Toz throwing hammers."
    (Oasis): Azzello says, "I freaked out and thought they had somehow managed to pull me into them."
    (Oasis): Azzello says, "So I tumbled away from my team and into theirs."


    Mastema
  • ZunZun Member Posts: 140 ✭✭✭
    For starters it'll have to be global to avoid out-of-scope reallocation, and secondly it'll need an init check to avoid an error.

    So:

    if not frogjumped then

      frogjumped = 1

    else

      frogjumped = frogjumped + 1

      if frogjumped > 2 then

        echo("say stop jumping!\n")

        frogjumped = 0

      end

    end

    image
    Mastema
  • MastemaMastema Member Posts: 298 ✭✭✭
    Thank you both very much, I really appreciative the help.
    Carnifex failing since 2011. Fixes coming Soon ™
  • HavenHaven World Burner Flight SchoolMember Posts: 2,226 ✭✭✭✭✭
    Can anyone help me with this code? I'm not sure why it won't work or what to do to fix it.

    Class = {Ascendril = {}, Bloodborn = {}, Cabalist = {}, Carnifex = {}, Druid = {}, Indorani = {}, Infernal = {}, Luminary = {}, Lycanthrope = {}, Monk = {}, Nightstalkers = {}, Paladin = {}, Praenomen = {}, Sciomancer = {}, Sentinel = {}, Shaman = {}, Syssin = {}, Templar = {}, Teradrim = {}, Zealot = {}}

    class = "Luminary"

    for k, v in pairs(Class) do
    if k ~= class then
    Class.k["status"] = "disabled"
    print (Class.k, Class.k["status"])
    end
    end

    Yields me this error:
    Run-time error
    World: Aetolia [Lilith]
    Immediate execution
    [string "Command line"]:1: attempt to index field 'k' (a nil value)
    stack traceback: [string "Command line"]:1: in main chunk

    But when I change the Class.k["status"] into just k["status"] the error that I get is this:

    Run-time error
    World: Aetolia [Lilith]
    Immediate execution
    [string "Command line"]:1: attempt to index local 'k' (a string value)
    stack traceback: [string "Command line"]:1: in main chunk

    Now if I change the code to this:

    for k, v in pairs(Class) do
    if k ~= class then
    print (k, v)
    end
    end

    I get this as a result:

    Cabalist table: 08F310B0
    Indorani table: 08F2E748
    Lycanthrope table: 08F2DD98
    Ascendril table: 08F2FF08
    Infernal table: 08F39850
    Praenomen table: 08F33568
    Zealot table: 08F2E108
    Syssin table: 08F2E450
    Paladin table: 08F30B38
    Carnifex table: 08F31718
    Monk table: 08F33388
    Nightstalkers table: 08F37D98
    Bloodborn table: 08F31060
    Druid table: 08F2F198
    Templar table: 08F36830
    Sentinel table: 08F3B3D0
    Teradrim table: 08F35DE0
    Shaman table: 08F37C58
    Sciomancer table: 08F38158

    So I know k isn't nil. And I don't understand why it being a string would be a problem.
    ¤ Si vis pacem, para bellum. ¤
    Someone powerful says, "We're going to have to delete you."
    havenbanner2
  • TozToz Member Posts: 2,153 ✭✭✭✭✭
    edited May 2013
    I know when I reference tables with a var I do class[var name]… not sure if you can do class[var]stuff or not.
    (Oasis): Azzello says, "I'll still never forget the first time I saw Toz throwing hammers."
    (Oasis): Azzello says, "I freaked out and thought they had somehow managed to pull me into them."
    (Oasis): Azzello says, "So I tumbled away from my team and into theirs."


  • HavenHaven World Burner Flight SchoolMember Posts: 2,226 ✭✭✭✭✭
    @Dasha helped me figure it out! Haha, it's supposed to be v["status"] not k["status"]. WHOOPS!
    ¤ Si vis pacem, para bellum. ¤
    Someone powerful says, "We're going to have to delete you."
    havenbanner2
«13456
Sign In or Register to comment.