[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Is this possible?

Is this possible?

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


Posted by Parduz   Italy  (8 posts)  [Biography] 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 :)
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Parduz   Italy  (8 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Parduz   Italy  (8 posts)  [Biography] 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?
[Go to top] 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.


17,526 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]