Register forum user name Search FAQ

Gammon Forum

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 ➜ General ➜ Help With Scripting.. No idea how or what to do!

Help With Scripting.. No idea how or what to do!

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


Posted by Elric   USA  (51 posts)  Bio
Date Sun 25 Nov 2001 07:53 AM (UTC)
Message
This is a question I am sure alot of people have. I am working on a SmaugWiz MUD as you already know. And I am wondering if there is anyway to script it into MUSHClient to automatically catch fleeing Mobs.

I mean. I would like to follow them and continue fighting them when they flee.

This is what I see.

Your slash _butchers_ a mourner!
Your slash _butchers_ a mourner!
A mourner leaves east.
A mourner flees head over heels!

Now how would I go about making it automatically follow that mourner east!

I'd like to know how to script it in, erm, or if anyone out there can be really generous and just script it out so I can steal it!

Anywho, thanks ahead of time. And Nick! what about that SmaugWiz compliance issue? Anytime soon?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #1 on Mon 26 Nov 2001 05:04 AM (UTC)
Message
Anyone at all?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 26 Nov 2001 09:10 PM (UTC)
Message
This should be easy enough, which script language do you want to use? VBscript? JScript?


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #3 on Tue 27 Nov 2001 04:14 AM (UTC)
Message
Well to tell you the truth.. I have no idea what I am doing, so it doesn't matter very much.. Whichever language whoever is going to do it, does it in is perfectly fine by me..

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 28 Nov 2001 01:39 AM (UTC)
Message
I'll do it in VBscript, as I am used to it now. :)

The problem seems to me to be that you don't want to follow *anyone* that flees, or leaves, as that might be another player.

Hence I have devised three triggers, one to match on:


Your slash _butchers_ a mourner!


We use that to recognise that we are attacking "a mourner" (or whatever the mob is). We use that to know that we need to follow this mob, and remember its name.


Trigger: Your slash * *
Send: %2
Send to: Variable (label is name)
Label: mobname


The first wildcard (%1) is going to be the type of hit (eg. "tears", "rips", "gashes", "lacerates", "hacks", "mauls", "rends") and the second wildcard (%2) is the name of the monster.

Then we detect that the monster has left the room:


A mourner leaves east.



Trigger: * leaves *.
Label: SomeoneLeaves
Script: SomeoneLeaves


What this does is check that the person leaving is the mob we are interested in (in this example "a mourner") and if it is, remember the direction in the variable "mobdirection".

If it is someone else (eg. another player) then the variable will be unchanged.

Finally we need to detect that mob has fleed, and follow it.


Trigger: * flees head over heels!
Label: SomeoneFlees
Script: SomeoneFlees


This script function checks that the person fleeing is the mob, and if so, goes in the direction that the mob went.

The only potential problem with this arrangement is the case where the "attack" clause is two words, eg. "barely scratches". I'm not sure if that will work properly there. You might need to make extra triggers to cover the cases of the words with spaces in them.

The stuff below goes into your script file, make sure you enable scripting and set the language to VBscript.


sub SomeoneLeaves (strTriggerName, trig_line, arrWildCards)
  if LCase (arrWildCards (1)) = LCase (world.getvariable ("mobname")) then
     world.setvariable "mobdirection", arrWildCards (2)
  end if
end sub

sub SomeoneFlees (strTriggerName, trig_line, arrWildCards)
  if LCase (arrWildCards (1)) = LCase (world.getvariable ("mobname")) then
     if not isnull (world.getvariable ("mobdirection")) then
        world.send world.getvariable ("mobdirection")
     end if
  end if
end sub


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #5 on Wed 28 Nov 2001 07:06 AM (UTC)
Message
Lmao.. Tried that.. And this is what I got on my screen..

Your slash _butchers_ a mourner!
a mourner!
Your slash _butchers_ a mourner!
a mourner!
A mourner leaves southeast.
A mourner flees head over heels!

(32715/32715hp|29007m|30000mv)(512)<1849767337 coins>(#2121)
Affected: ( 995) stone skin
Affected: ( 216) bless
Affected: ( 216) bless

(32715/32715hp|29012m|30000mv)(512)<1849767337 coins>(#2121)
Affected: ( 995) stone skin
Affected: ( 216) bless
Affected: ( 216) bless

(32715/32715hp|29012m|30000mv)(512)<1849767337 coins>(#2121)

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 28 Nov 2001 07:09 AM (UTC)
Message
If you are seeing "a mourner" on the screen, you haven't set the trigger to send to a variable:

Send to: Variable (label is name)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #7 on Wed 28 Nov 2001 07:26 AM (UTC)
Message
How does one do that, when that choice is not in the dropdown menu?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #8 on Wed 28 Nov 2001 10:19 AM (UTC)
Message
It is, in the latest version, which is 3.17.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #9 on Thu 29 Nov 2001 12:20 AM (UTC)
Message
Oy.. I am using 3.04, Sorry.. Will my registration carry over if I install the new one?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #10 on Thu 29 Nov 2001 04:49 AM (UTC)
Message
Alright.. I upgraded and set the right stuff.. NOW when I do it.. Nothing happens..

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #11 on Thu 29 Nov 2001 08:19 AM (UTC)
Message
I mean.. When the mourner flees.. Nothing happens.. Nothing at all..

Also... I have a program for a ZMud bot. About how compatible are they?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #12 on Thu 29 Nov 2001 08:33 AM (UTC)
Message
Also.. Another stupid question.. Is there a way to pause in between triggers?

I mean.. If you set a trigger for * tells you 'Heal'

Can you allow it to pause for 2 seconds between each spell?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Elric   USA  (51 posts)  Bio
Date Reply #13 on Fri 30 Nov 2001 03:19 AM (UTC)
Message
Emm.. Erm.. Did I do something wrong?

Just wondering cause I haven't got a reply. Also, wanted to add a suggestion for MUSHClient.

A mapper like on zMUD. I have both and I quite enjoy the ease of the mapper for usage on my MUD and RoD.

Will there be one on MUSHClient? I know there is a thing that records your directions and allows a speedwalk string. But on zMUD there is an actual mapper that creates a visual map structure to help navigate and speedwalk about the MUD. Just a thought.

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #14 on Fri 30 Nov 2001 09:59 PM (UTC)
Message
Quote:

Emm.. Erm.. Did I do something wrong?


No, I was doing something else yesterday afternoon. :)

Quote:

Will my registration carry over if I install the new one?


Yes, the same registration code applies to all future versions.

Quote:

I mean.. When the mourner flees.. Nothing happens.. Nothing at all..


Set the triggers to colour the lines so you can see if the trigger is matching or not. If not, you might have an extra space or something in it. The trigger must match exactly what arrives.

If the trigger is matching make sure you have scripting enabled, and the "script file" as the file with the script functions in it.

Then check under the world configuration "variables" window, to see if, at least, the "mobname" and "mobdirection" variables have correct values in them.

Quote:

Also... I have a program for a ZMud bot. About how compatible are they?


They use different scripting languages. In fact MUSHclient supports three languages, VBscript, Jscript and PerlScript. ZMud has its own proprietary scripting language, that I think is like TinyFugue, but I'm not sure.

Quote:

Is there a way to pause in between triggers?


You can achieve that with timers. In the script that is handling the "heal", you can add as many "one-shot" timers as you want. One-shot timers fire once and then delete themselves. You could make them fire after an interval (eg. 2 seconds). To do them in sequence you would have one after 2 seconds, one after 4 seconds and so on.

Quote:

Also, wanted to add a suggestion for MUSHClient.

A mapper like on zMUD. I have both and I quite enjoy the ease of the mapper for usage on my MUD and RoD.


I've thought about that, but a mapper can be quite complex, especially on a MUD where directions are not necessarily logical. eg. if a going west takes you to a room which is actually to the east.

Maybe one day. :)






- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


32,808 views.

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

Go to topic:           Search the forum


[Go to top] top

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