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
➜ Is this possible?
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Parduz
Italy (8 posts) Bio
|
Date
| Sun 22 Jul 2012 09:04 AM (UTC) |
Message
| Hello.
I'm an italian VB / C++ programmer completly new to MUSH, and i'd like to underdand if what i'd need is something that can be done:
This is what i'd need (how i see it in my mind):
I run a macro (an "alias"?) called "look at the quality"
1) MUSH asks me the value of "%1" (a string)
2) Send "pick %1"
3) Send "look %1"
4) do this pseudocode by matching the example strings with the content of the received descripion of the object:
if "piece of crap" or "almost broken" or "well used" then
send "destroy %1"
else
if "good quality" or "excellent quality" then
send "put %1 on the table"
else
sent "put %1 in the bag"
end if
end if
5) "Deactivate" the trigger... i may look at my equipement and get the same quality/status descriptions, but i dont want to remove my equipement.
Thanks for any help :) | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sun 22 Jul 2012 11:26 AM (UTC) |
Message
| Yes you can send wildcards to aliases.
However you need to allow for the time for the MUD to respond. So you can't immediately process the reply. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Parduz
Italy (8 posts) Bio
|
Date
| Reply #2 on Thu 26 Jul 2012 09:03 PM (UTC) |
Message
| Thanks, Nick.
I tried a bit but i feel a bit lost. MUSH is not a "little" thing and i think i could make good use of a kick in the right direction.
Could you point me to a sample (or write it yourself)?
A simple thing... something like an alias that send the command "Look at %1" (askinf for the value of "%1") and a vbscript that then reads the description and send "Well done" if there's "it's well made" or "What a crap!" it there's "it's terribly made" in the description.
| Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #3 on Sun 29 Jul 2012 01:27 AM (UTC) |
Message
| Are you really welded to VBscript? I prefer to code in Lua these days.
Have you seen this video about making aliases?
http://www.gammon.com.au/forum/?id=9616 |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Parduz
Italy (8 posts) Bio
|
Date
| Reply #4 on Sun 29 Jul 2012 10:20 AM (UTC) |
Message
| Well, i was a VB6 / VBA programmer (i work with C++Builder from years, now) so i think i'd be more efficient with VBScript.
I don't have never seen LUA, so i can't say how it will be working with it.
What are the reasons i should use it instead of VB?
About the video, it's really helpful.
Following his sample, what about triggering something when you "mutilate" the target, but only if you're killing it? | 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.
20,119 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top