Quick Coding Questions

1131416181924

Comments

  • I've shared bits and pieces of my system with a couple people and found things failing miserably when used on 3+ versions. It may be something to do with my coding style (which is 90% stolen code / 10% trial and error).

    I just don't wanna upgrade and find that some of my core functions no longer work because the only reason they worked in the first place was duct tape and good intentions.
         He is a coward who has to bring two friends as backup to jump people hunting.

  • edited October 2017
    Mudlet's ethos is that we don't break backwards compatibility and we go to great pains to ensure old stuff works - and we test it. If you're keen on missing out on about 4 years of improvements I can't stop you ¯\_(ツ)_/¯ but otherwise there's a super helpful Discord channel you can join to get help at.

    In my opinion sticking with 2.1 for reason X is unfounded superstition until I see an actual problem and I've yet to know of one.
  • So I am having some trouble with scripting my offense for known exits and target tracking. What I need is a recognition of which room I came from and being able to implement that with attack target roomicamefrom and if target attackstoomuch leave to roomicangoto. Am not a coder at all but I am familiar with mudlet and its functions. No idea about gmcp
  • Mathilda said:
    I thought everyone did their aliases/macros/etc. that way :(. That's how my 2H runie-dragon stuff is set up -- ALT+ W-ASD-ZX are the limbs, and I hew or rend depending on whether I'm dformed or not :D
    I do the same thing, but it's more the way that SVO managed defenses and use of class abilities (Rage, Fitness etc) which is screwing me over.

    (Party): Mezghar says, "Stop."
  • edited October 2017
    Alyxeri said:
    Dunn said:
    My setup for multiclass is all on the same profile, with a check function to execute code depending on my class.
    Just use master system Wsys, then multiclass won't need multiple profiles / special activate-deactivate aliases.

    Talking about offensive stuff. I have my own curing system. I do have the same isClass() checks in my lock breaking curing, though. 


  • I updated to the new Mudlet two weeks ago, haven't had any issues.

    I went from 2.1 -> 3-something-iota -> new one for largely the same reasons expressed here. Worried about losing stuff.

    I didn't lose anything on going to the new one though. Works for me!




    Penwize has cowardly forfeited the challenge to mortal combat issued by Atalkez.
  • I have no real reason to upgrade, so I'm not going to. Pretty simple!
  • edited October 2017
    Indeed.  Just like there is no real reason to update windows until you get hacked by one of the many security vulnerabilities that were patched years ago, right?  
    Deucalion says, "Torinn is quite nice."
  • I don't think not updating Mudlet is comparable to not updating your Operating System.
  • KryptonKrypton shi-Khurena

          
  • Alyxeri said:
    I don't think not updating Mudlet is comparable to not updating your Operating System.

    Yeah, they definitely aren't comparable. Maybe when people start creating viruses and exploits that specifically target Mudlet 2.1...

    My general approach to code - especially code for Achaea, since I'm not getting paid to do it and don't have a team of testers to check shit for me - is if it works, and you don't need to add functionality, leave it the fuck alone. I will probably upgrade to Mudlet 3.x eventually, but there's nothing I need from it right now.

  • Antonius said:

    but there's nothing I need from it right now.

    Exactly. I'm not sure why people get so uppity when you say you don't wanna upgrade. Backwards compatibility is a thing, so it's not like scripts I make aren't gonna work on future versions.
  • I just re-write / test so much shitty code of mine, that having copy/paste is amazeballs.  Will probably upgrade soon since I plan yet-another revamp to make more of the older scripts much more efficient.

  • The biggest thing to me is that clicking on a result in the search window actually brings you to the line that matched. Made me very happy. 


  • My only complaint is Ctrl+backspace eats the entire line instead of just the single word, but Ctrl+direction key only hops words. I obliterate my if statements regularly.
  • I was on 2.1 until the most recent that allowed copy/pasting whole scripts. Since then, commenting out large sections at once has made life easier, too. Other than one small issue with a who here trigger (which was minor and I just deleted), I had no issues with this upgrade.
  • I upgraded. However, without really thinking about what I was doing I installed Mudlet 3.5 in the same folder as Mudlet 2.1. May just keep both because I can't see trying to just uninstall 2.1 will work out well, and uninstalling both then reinstalling 3.5 seems like a lot of work.

    Also my play/pause media key no longer works when I have Mudlet 3.5 focused (most of the time if I'm actually at my desk/listening to music). Other media keys (notably volume up and volume down) work fine.

  • Your stuff is stored separately, so you can remove both and it'll still stay. Media keys - Mudlet never intercepted them, but pop by the forums or discord and we can have a look at your setup!
  • 3.5 is extremely sexified, just fyi.

    10/10 would upgrade
    "All we have to decide is what to do with the time that is given to us."

  • can someone tell me what's wrong with this statement? works up to var2 changing to 0 and var 3 never does...

    if var1 == 1 then var1 = 0 
    elseif var1 == 0 then var2 = 0
    elseif var2 == 0 then var3 = 0 end

  • KlendathuKlendathu Eye of the Storm
    I assume var1 can only either be 0 or 1, in which case, either your first or second if will always be true, so it never checks your third if.

    If var1 can be something other than 0 or 1, please move on :D

    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."
  • You're right, 1 and 0 are the only options, it's an on off sort of thing, how can I get the 3rd if checked? It's one and the same trigger and it changes the first var from 1 to 0, then the 2nd, then the 3rd
  • edited November 2017
    I'll assume you've called them var1, var2 and var3 because that's just an example, and not your actual code. If that's not the case, change that. Also, Lua has boolean (true and false) values. If you want something to be on or off, use true or false, not 1 or 0.

    Unfortunately it's not clear from your code what you're trying to make happen (partly because you've used meaningless variable names). What's the intent here (in English words, don't try to tell us how you think it should be coded)?
  • fair enough. just juggling items and have a bit of prompt showing me with a 1 or a 0 the objects I am juggling, 1 being juggling it, and 0 being not juggling it. works well, but when I throw the items off, I need them to turn to 0 one after the other, and right now the last item, when I throw it still shows up as a 1. is that understandable?
  • edited November 2017
    <div>if var1 == 1 then var1 = 0&nbsp;
      elseif var2 == 1 then var2 = 0
        else var3 = 0 
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "lucida grande", "Lucida Sans Unicode", tahoma, sans-serif;">end</span></div>



    Something like this, probably.

    If var1 is 1, set it to zero. You do not need to check it again, because it can only ever be 0 or 1, and if it is not 1 then it is zero. Then you hit var2. If it's 1, set it to 0. If it is not 1, you know it's already zero so there's no need to check it again so you can set var3 directly to zero without checking. 
  • What I did for jester was on juggle line I set a variable juggleCount to 3. Took the line for throwing and juggleCount = juggleCount - 1. If juggleCount = 0 then juggle dagger dagger dagger if Im trying to throw again. I had something decent set up for it. Had a green J: on prompt if juggling and was a white J: if not so Id notice myself juggling after testing before I went afk and came back to 0% endurance. With a green 3, yellow 2, orange 1, and red 0 depending on how many items were juggled.
  • thanks for both tips, very helpful, thank you!
  • Vadimuses said:
    Your stuff is stored separately, so you can remove both and it'll still stay. Media keys - Mudlet never intercepted them, but pop by the forums or discord and we can have a look at your setup!
    I forgot to follow up on this, but the media key issue resolved itself after a restart. Not sure what was going on after the initial install, but it seems absolutely fine.
Sign In or Register to comment.