How to Script

Started by roobee, July 26, 2015, 11:48:08 AM

Trying to make some scripts in Atlantis in Lua. But the guides to Lua I find are for normal coding, not on how to script for games. For example, trying to make "get item pack" do "open pack", "get item pack", "close pack". Any links for learning or direct advice would be great.

Quote from: roobee on July 26, 2015, 11:48:08 AM
Trying to make some scripts in Atlantis in Lua. But the guides to Lua I find are for normal coding, not on how to script for games. For example, trying to make "get item pack" do "open pack", "get item pack", "close pack". Any links for learning or direct advice would be great.

I personally would say - just type it out, or make aliases for each command and use each command separately. Why? Two reasons: 1 - screen scroll. Nothing more annoying than having an "important" discussion or scene while someone sends three lines scrolling across the screen in rapid succession. 2 - give thieves a sporting chance in a playable manner. It shouldn't take less than a second to open your pack, rummage through over a dozen items in a pack, find exactly the right item, pull that item out without spilling half the rest of the contents in the process, and secure the flap on the pack.  There's a built-in delay on sheath/draw, and on 'pour all' because "believability" should trump "because I CAN."
Talia said: Notice to all: Do not mess with Lizzie's GDB. She will cut you.
Delirium said: Notice to all: do not mess with Lizzie's soap. She will cut you.

Unless you're trying to do something relatively complicated (prompt capture with per line change in HP or something), a simple trigger or alias should do the trick for you. Arm accepts command stacking, so you can input several commands at once and Arm will deal with them in the order of input without you needing to do anything too complicated like in certain types of other muds.

Mu* clients all have their own quirks with regard to language implementation in any case, so your best bet will be to browse the Atlantis forums and read the user guide.

Quote from: aeglaeca on July 27, 2015, 02:57:53 AM
you can input several commands at once and Arm will deal with them in the order of input without you needing to do anything too complicated like in certain types of other muds.

I'll be pedantic - this isn't necessarily true.  Some commands get put into a "delayed" queue, and other commands get executed immediately (but in order).  "Look" is an example of a command that goes through immediately, which enables us to look around while we're still suffering movement lag.

Unless something has changed recently, this:


open pack;;look in pack


will do this:


It's closed.
You open a pack.
The neat, clean-shaven man sends you a telepathic message:
     "I tried hairy...Im sorry"

Thanks, here's the syntax for multiple commands in Atlantis if anyone's interested
/sc followed by commands
ex: /sc 1n3e
Would make you go 1 North and 3 east

You can also use shift enter
ex: n (shift enter) e (shift enter) e
Would make you go north, east, east