Help needed for basic scripting
Posted: Sat Dec 25, 2010 10:14 pm
So, I'm a complete newbie when it comes to pretty much any form of scripting including with Lua, so I apologize ahead of time for my ignorance. I used MUSHclient awhile back, though I used VBscript, and I could do the basics with that, although I'm not sure if I remember much of it. If any has an knowledge of both VB and Lua and could relate them some how, that would be cool.
Anyway, I started this topic because I read parts of the manual and the other resources posted in the announcement by Heiko, and it was sort of confusing. I just want to start off by making a variable tracker, and then a corresponding alias with 'if' statements, so my character will perform different actions depending on the value of the variable...
So:
"You quickly flow into the x stance" triggers the variable stance = x
Then the alias att performs a series of 'if' statements like:
If stance = x then
do a
If stance = y then
do b
....and so on.
If I remember right, I think with VBscript in MUSH I did something like this, if this helps anyone:
dim t
dim stance
t = world.getvariable ("t")
stance = world.getvariable ("stance")
if stance = Ein-Fasit then
world.send ("sitara vertical ") & t
world.send ("sitara lateral ") & t
world.send ("sitara vertical ") & t
end if
if stance = Vae-Sant then
world.send ("sitara lateral ") & t
world.send ("sitara vertical ") & t
world.send ("sitara lateral ") & t
end if
That's off the top of my head, but I think its right. Sorry again for my ignorance of scripting, and thanks a lot for your help.
Anyway, I started this topic because I read parts of the manual and the other resources posted in the announcement by Heiko, and it was sort of confusing. I just want to start off by making a variable tracker, and then a corresponding alias with 'if' statements, so my character will perform different actions depending on the value of the variable...
So:
"You quickly flow into the x stance" triggers the variable stance = x
Then the alias att performs a series of 'if' statements like:
If stance = x then
do a
If stance = y then
do b
....and so on.
If I remember right, I think with VBscript in MUSH I did something like this, if this helps anyone:
dim t
dim stance
t = world.getvariable ("t")
stance = world.getvariable ("stance")
if stance = Ein-Fasit then
world.send ("sitara vertical ") & t
world.send ("sitara lateral ") & t
world.send ("sitara vertical ") & t
end if
if stance = Vae-Sant then
world.send ("sitara lateral ") & t
world.send ("sitara vertical ") & t
world.send ("sitara lateral ") & t
end if
That's off the top of my head, but I think its right. Sorry again for my ignorance of scripting, and thanks a lot for your help.