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 ➜ aliases/variables regarding stances

aliases/variables regarding stances

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


Posted by Deldro09   (1 post)  Bio
Date Fri 06 Nov 2009 11:54 PM (UTC)
Message
Hm... to start out, Lua looks quite demanding, but I want to know how can I do an attack where certain moves are based on stances, and if in one particular stance, you can do another set of moves that won't throw the proper stancing/attacks out of order. Here's an example:

Stances: Ein, Vae, Gya, Lya, Riz
Attacks: lateral, vertical.

The alias I want to use is like "bsh" for bash

Inside the alias, if in the Vae stance, I can only do "sitara lateral @target, sitara vertical @target
and if I am in the Ein stance, I have to do Sitara vertical @target, sitara lateral @target

How can that be placed correctly to bash with ease and flow properly between stances, when starting an attack with each denizen?
Top

Posted by Blainer   (191 posts)  Bio
Date Reply #1 on Sat 07 Nov 2009 03:37 AM (UTC)

Amended on Sat 07 Nov 2009 03:39 AM (UTC) by Blainer

Message
stances = {
            Ein = { "vertical", "lateral"},
            Vae = {"lateral", "vertical"}
            }
print(stances.Ein[2])
>>lateral
print(stances["Ein"][2])
>>lateral


So if I have a varaible set to my current stance called stance and one called target I can do this.
stances = {
            Ein = { "vertical", "lateral"},
            Vae = {"lateral", "vertical", "as many moves as I want"},
            Gya = {"vertiacal", "side ways", "etc"}
            }
--I use the stance variable to reference the table with the moves in it.
first_move = stances[@stance][1]
second_move = stances[@stance][2]

--I put it together and send it to the MUD
Send("Sitara "..first_move.." "..@target)
Send("Sitara "..second_move.." "..@target)


This is sent to the MUD
>>Sitara vertical goblin
>>Sitara lateral goblin

I didn't test this and I think it's what you where asking for.
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.


10,808 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.