Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜  How do I get started?

How do I get started?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Realedazed   (3 posts)  Bio
Date Sun 26 Oct 2008 08:50 AM (UTC)
Message
I'm a complete newbie to this. I'm actually teaching myself to program using Lua and making it even more enjoyable by using one of my favorite games.

Now, so far, all I have been using are a few aliases and triggers. But I would like to make use of tables and more advanced scripting. But, I'm not sure where to begin. I've searched this site, but I think my searching skills are not very good.

So, for the script. I'm pretty sure I break my script into chucks. Like curing, attacking, etc, and work on those separately? But, how exactly do you do that. Do I write the program, enter it into the script tab of the game configs, then enter the variables, alias and such in the other tabs.

I'm sorry, but I'm terrible at explaining myself and I guess being absolutely confused makes it worse.

Thanks in advance!
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Mon 27 Oct 2008 05:21 AM (UTC)
Message
There are several things going on at once here: you're trying to learn Lua, you're trying to learn how to apply Lua to your game, and you're trying to learn how to do all of this in MUSHclient. It might help to try to isolate these and work on one at a time. :-)

To learn Lua, I would suggest reading Programming in Lua: www.lua.org/pil. It's a great book in many respects.

To learn about Lua and MUSHclient, I would look at what some other people have done to get a feel for how things fit together. There are lots of Lua plugins lying around here, many of which are very advanced. I'd start with some simple ones and make sure you understand how they work. Then, try to make your own simple ones.

Lua is also the most supported language on these forums, so asking questions is a great way to get help as well. You are right, though, that having more specific questions makes it easier to get help. :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 27 Oct 2008 05:25 AM (UTC)
Message
First thing I would do is read this:

http://mushclient.com/scripting

Then browse some posts in this part of the forum, or the Plugins part, which in many cases have small examples of scripts, which should give you some ideas and examples.

Also, many of the plugins supplied with MUSHclient illustrate script ideas, some of which are written in Lua.

Quote:

Do I write the program, enter it into the script tab of the game configs, then enter the variables, alias and such in the other tabs.


Generally, break what you are trying to do into small chunks. You can use "send to script" in a trigger or alias to accomplish some small task, or call a function in the script file for more complex things.

Try to visualize what you would do manually, and then think of a way of automating it. For example, if you get the message "you are thirsty" and you normally "drink water" then that leads to an obvious trigger to automate it.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,169 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.