A Noob in Need. Some Really Basic Scripting.

Posted by Serph on Sun 29 Mar 2009 11:03 PM — 14 posts, 52,764 views.

#0
I've recently gotten back into MUSHclient since I've started playing Imperian again. Basically, I'd had some experience at VB scripting from the help of a fellow player but it's been so long that I've forgotten most if not all of it. I tried my hand at Lua recently because I was told it was easier but I got lost, so I've decided to attempt VBscript again.

So ANY help about VBscripting would be much appreciated.

2 things I have been working at currently (and yes I know they are extremely easy) are 1) a targetting variable with an attacking alias to go with it and 2) a trigger that follows my stance and an alias that acts differently according to that stance (5 different IF statements)

Ex:

Alias: Att
Action: If in stance A do this...
If in stance B do that...
etc, etc...

Thank you
Australia Forum Administrator #1
Have you read the FAQ? http://mushclient.com/faq

That covers targetting variables, and attacking aliases.

#2
Thank you for the attention and help.

However, they were both written in Lua and not VB.
USA #3
Is there any reason you can't use Lua?
Australia Forum Administrator #4
Quote:

However, they were both written in Lua and not VB.


The FAQ point 21 describes a targetting alias. This does not use any scripting, and thus does not use Lua.

The FAQ point 22 describes an attacking alias. This does not use any scripting, and thus does not use Lua.

Quote:

I tried my hand at Lua recently because I was told it was easier but I got lost ...


When doing simple stuff, Lua and VBscript are very similar. I would encourage you to stick with Lua, and if you have problems post the problem here.
#5
I apologize, I misread.

I suppose I can attempt Lua. When I was reading some help files I was comprehending everything fine until the part when it told me to save my scripts in a script file and then use it as a function.
Australia Forum Administrator #6
Try reading http://mushclient.com/scripting

You don't have to use a script file, a lot of scripting can be done inline by doing "send to script" in a trigger or alias.
#7
Alright so this is my targetting alias that I got from the other link:

<aliases>
<alias
match="target *"
enabled="y"
variable="target"
send_to="9"
sequence="100"
>
<send>%1</send>
</alias>
</aliases>

I'm assuming because it's an alias, it goes in an alias, but when I put it in the script box and saved it, it didn't work.

And I'm sorry for my elementary knowledge of this subject :[
#8
And by the way, some of the VBscript I've forgotten is slowly coming back so I attempted to create a targetting alias using it, so if you could tell me whats wrong...

alias: t *

dim t
world.getvariable "t"
world.setvariable "t", %1
Australia Forum Administrator #9
Quote:

I'm assuming because it's an alias, it goes in an alias, but when I put it in the script box and saved it, it didn't work.


It doesn't go in an alias, it is an alias. For directions on how to use that XML code see this:

http://mushclient.com/pasting

Quote:

I attempted to create a targetting alias using it, so if you could tell me whats wrong ...


See the FAQ at http://mushclient.com/faq, point 32.

You need quotes around the %1.
Amended on Wed 01 Apr 2009 05:09 AM by Nick Gammon
#10
It still won't work.
I have it sending to World and I created a variable named t. I don't understand what I'm doing wrong.
#11
My bad. I have to send it to Script.
#12
So how can I put this variable into an alias.

Say t = MAN

dim t
world.send "attack (world.getvariable "t")"

Or something along those lines?
#13
Nevermind. I figured it out on my own. Thank you for your help and patience for an idiot.