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
➜ VBscript
➜ A Noob in Need. Some Really Basic Scripting.
|
A Noob in Need. Some Really Basic Scripting.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Sun 29 Mar 2009 11:03 PM (UTC) |
| Message
| 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
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Mon 30 Mar 2009 08:15 AM (UTC) |
| Message
| Have you read the FAQ? http://mushclient.com/faq
That covers targetting variables, and attacking aliases.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #2 on Tue 31 Mar 2009 12:03 AM (UTC) |
| Message
| Thank you for the attention and help.
However, they were both written in Lua and not VB. | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #3 on Tue 31 Mar 2009 12:22 AM (UTC) |
| Message
| | Is there any reason you can't use Lua? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Tue 31 Mar 2009 02:29 AM (UTC) |
| Message
|
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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #5 on Tue 31 Mar 2009 10:55 AM (UTC) |
| Message
| 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. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #6 on Tue 31 Mar 2009 08:01 PM (UTC) |
| Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #7 on Tue 31 Mar 2009 11:38 PM (UTC) |
| Message
| 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 :[ | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #8 on Wed 01 Apr 2009 12:48 AM (UTC) |
| Message
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #9 on Wed 01 Apr 2009 05:08 AM (UTC) Amended on Wed 01 Apr 2009 05:09 AM (UTC) by Nick Gammon
|
| Message
|
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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #10 on Thu 02 Apr 2009 01:21 AM (UTC) |
| Message
| 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. | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #11 on Thu 02 Apr 2009 01:24 AM (UTC) |
| Message
| | My bad. I have to send it to Script. | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #12 on Thu 02 Apr 2009 01:28 AM (UTC) |
| Message
| 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? | | Top |
|
| Posted by
| Serph
(9 posts) Bio
|
| Date
| Reply #13 on Thu 02 Apr 2009 01:46 AM (UTC) |
| Message
| | Nevermind. I figured it out on my own. Thank you for your help and patience for an idiot. | | 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.
50,131 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top