Learning Mudlet?

edited June 2015 in Tech Support
Hello everyone, I am new to Achaea and am a Serpent. I want to code my own scripts so that I can begin to learn Mudlet. I literally have very minimal knowledge of it already except for making basic triggers, and aliases. My first goals are to:

1.) Code my own bashing script to utilize my rage abilities on top of my garroting. 
2.) Code my own PvP combat 
3.) Code my own curing system based off the use of server-side

I'm not a computer science major or anything, but am decent at math and thinking.. But I just don't know where to begin in learning Mudlet/Lua. Everyone just says they taught themselves. Is it really possible to teach myself? Where do I even begin? Sure I could learn how to code a "table" but I wouldn't know how to even utilize it. 

Is there anybody that would be willing to help teach me as well? Thank you, it would be much appreciated.

- Aeacus

@Cesarina: I took your advice and began to look at some of the scripts I have downloaded but.. they made no sense. Do you mean look at the XML or what it puts in my Mudlet?

Comments

  • JonathinJonathin Retired in a hole.
    edited June 2015
    I taught myself. It's not really that difficult once you finally manage to climb your way over the initial hurdle.

    The mudlet manual is a good place to start.
    The Mudlet Lua wiki is another good reference.

    The Lua Wiki is another good resource.
    and this also helped me quite a bit.

    There are several youtube videos out there as well. 
    My videos are the only ones I happen to have the links readily available for.
    Also, my website has a couple tutorials that might help.

    edit: muldet ~= mudlet
    I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.
  • Jonathin said:
    I taught myself. It's not really that difficult once you finally manage to climb your way over the initial hurdle.

    The mudlet manual is a good place to start.
    The Muldet Lua wiki is another good reference.

    The Lua Wiki is another good resource.
    and this also helped me quite a bit.

    There are several youtube videos out there as well. 
    My videos are the only ones I happen to have the links readily available for.
    Also, my website has a couple tutorials that might help.


    And you can code some pretty complex things? How long to get over the initial hurdle roughly? 
  • JonathinJonathin Retired in a hole.
    edited June 2015
    Well, I've been doing it for a few years now. It didn't take long to hop over the hurdle because I read through the manuals and then asked a shit ton of questions on the forums and in the mudlet clan when I finished. Then I just scripted and scripted and scripted things until I hit a plateau with if statements.

    When I got sick of writing 8 billion if statements in a script, I learned how to use tables. Since then, writing has been rather easy because of the sheer power of tables.

    oh, also, I used Trevize's old RegEx tutorial and that helped a ton too. It's since disappeared, but I tried to make one as simple as his was to understand.
    I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.
  • Klendathu said:
    Start small, makes something simple. Expand on it. Make something else. Repeat. Once you get more confident and advanced, you can always go back and rewrite parts, that's what I do every now and again.

    For building triggers: https://regex101.com/

    Also, get into the habit of writing re-usable code. What do I mean by that? If you're constantly putting the same sections of code into your functions, separate it out into its own function and call that. A good example is a custom echo, instead of writing:

    cecho("<blue>[<white>OMG<blue>]<white>:<reset> Here is my echo.")
    cecho("<blue>[<white>OMG<blue>]<white>:<reset> Here is my second echo.")

    you could build a separate function:

    function myEcho(line)
    
    cecho("<blue>[<white>OMG<blue>]<white>:<reset> "..line)

    end

    then call it using

    myEcho("Here is my echo.")
    myEcho("Here is my second echo.")

    It'll save you time in the long-run.
    I'll have to use that, since I already began using my own echo "prefix" or whatever

    https://ada-young.appspot.com/pastebin/d6b8ae2c

    @Klendathu Thank you!
  • edited June 2015
    How do you get the echo to appear on the new line? @Aeacus

    image
  • KlendathuKlendathu Eye of the Storm
    function myEcho(line)
    moveCursorEnd("main")
    if getCurrentLine() ~= "" then echo("\n") end
    cecho("<blue>[<white>Rage<blue>]:<reset> "..line.."<reset>\n")
    end

    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."
  • @Klendathu thank you... what does the moveCursorEnd("main") do?
    Just trying to understand so I can use it myself :) 
    image
  • edited June 2015

    @Andregor: http://wiki.mudlet.org/w/Manual:UI_Functions#moveCursorEnd

    Essentially it makes sure that the cursor is pointed at the very end of your main window's output before it echoes new text, so you don't end up putting it in the wrong place if another script has moved the cursor to a different line.

    Out of curiosity, did you look up what the moveCursorEnd function does before asking? If not, that's a really good habit to get in to: if you see something and you don't know how it works, look up the documentation for it. If that still doesn't make sense then ask for an explanation of those parts.

  • MorkadoMorkado Seattle, WA
    http://www.amazon.com/gp/aw/d/B00C7F45IY/ref=mp_s_a_1_9?qid=1433543202&sr=8-9&pi=AC_SX110_SY165_FMwebp_QL70&keywords=programming+in+lua

    Buy this book. It is literally one of the best written programming books ever, by the creators of the Lua programming language. I have nothing against the myriad of free resources available to the aspiring Lua coder, but trust me - you will get more out of everything else available to you if you read this book first. It is easy to read, easy to follow, and not long. Pick it up, and the vast majority of your questions will be answered in the first 80 pages. These guys know how to get the most out of the language, and you should too!!

    Best regards, and feel free to PM me with any Lua or Mudlet related questions you have.
  • @Aeacus
    You can also scroll down a few topics in this forum (go here: http://forums.achaea.com/discussion/3677/free-full-gui/p1) and get a pre-built GUI, by Zulah, that you can modify and experiment with rather than starting from scratch. That's what I intend to try.

    Fetch water,
    Carry the Moon
    -Cogitations and Ponderations of Disciple Vanceroth, Student of the Trine
Sign In or Register to comment.