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 ➜ VBscript ➜ Need help writing a script

Need help writing a script

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


Pages: 1 2  

Posted by Pippysmurf   (11 posts)  Bio
Date Wed 09 Apr 2003 11:59 PM (UTC)

Amended on Thu 10 Apr 2003 12:54 AM (UTC) by Pippysmurf

Message
I am playing various Btech muxs and I have no clue how to make a script I have read the mushclient help files and they do not explain things clearly enough for me to use them.

I want 2 scripts one that allows me to do the same things but in 2 different ways.

1. Would allow my combat unit to move up lock the target id i would put in before i moved. ie target id is AA so i type something then the unit move speed 10 on sight of target AA locks it fires guns then backs speed run. Then i can reset it and repeat

2. This one would be the same except the instead of backing I input the id then on sight of the target I would lock it and fire my guns then prone command would go through. Thanks for help with this.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 10 Apr 2003 03:10 AM (UTC)
Message
It would help if you posted some example output (copy and paste) so we could see what sort of triggers are required.

- Nick Gammon

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

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #2 on Thu 10 Apr 2003 05:25 AM (UTC)
Message
I am not sure what you mean copy some output.

Bascily what I need is I type a command followed by the 2 leter case contact id which could for examle XY. when I do that, when the target XY comes in to view. I fire my guns the command would be .f then i want to enter the command speed back to be entered.

Triggers to base off..

You notice Aw Wolverine [CK] in your Forward arc.

This is the bad guy the id is CK in the brackets. so before i would see him I would want to be able to input ck so the the trigger/script would lock CK when i saw it.

Target set to Aw Wolverine [CK].

This is the emit you get after locking target CK

Then i want the trigger/script to sendout firetic 0

Firing weapons in tic #0!

That is the emit from firing then i want the trigger/script
to enter speed back

Then i want to be able to reset and repeat it with by entering the same or different target id.

The other thing I want to do is all the same except i want to the command to be PRONE after the firing weapons emit.


Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 20 Apr 2003 03:14 AM (UTC)
Message
It isn't totally clear what you want to do here, but this should get you started. The following trigger should do some of what you said:


<triggers>
  <trigger
   custom_colour="7"
   enabled="y"
   match="You notice * [*] in your * arc."
   send_to="12"
   sequence="100"
   variable="target"
  >
  <send>SetVariable &quot;target&quot;, &quot;%2&quot;
Send &quot;lock %2&quot;
Send &quot;firetic 0&quot;</send>
  </trigger>
</triggers>


This will detect "You notice * [*] in your * arc.", set a variable "target", and send two things to the MUD.

This should give you an idea of how to do the rest.

You need MUSHclient version 3.36 or up for this to work, as it relies on the "send to script" feature recently introduced.

- Nick Gammon

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

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #4 on Sun 20 Apr 2003 04:59 PM (UTC)
Message
I am confused on where and how i input this info I upgraded to 3.34 but i dont see the send to script feature. If someone could be me some details on how to enter this data that would be very helpful.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Sun 20 Apr 2003 07:28 PM (UTC)

Amended on Sun 20 Apr 2003 07:30 PM (UTC) by Flannel

Message
Sent to Script was only introduced in 3.36 and later, you'd need to upgrade to one of the later versions (As of this post, the latest is 3.38)

version 3.38 was released on wed, the 16th. You can scroll down and find the forum post to get the link to download it, or just go to the following URL:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2571&page=999999

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #6 on Mon 21 Apr 2003 04:16 AM (UTC)
Message
ok, I have upgraded to 3.38 but I am still confused as to where this trigger data goes. Could someone please enlighten me? Yes I am coding retarded:)
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 21 Apr 2003 06:02 AM (UTC)
Message
Copy from this web page between, and including, <triggers> and </triggers> to the clipboard.

Go into the trigger configuration window. The "paste" button will be active now. Click it. That will paste the trigger into it. Now edit it and inspect what it does.


- Nick Gammon

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

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #8 on Mon 21 Apr 2003 08:09 AM (UTC)
Message
Thanks for your help thus far:) I have done what you said and tested the trigger. The only promblem that I am currently working on with no success is as follows.


It keeps adding onto the number of id's to lock on fire on when the client sees the target. I need to be able to have it only have 1 target id for it to remimber ie: the last one entered or an option to clear the buffer.

Any assitance with this would be very helpful.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #9 on Mon 21 Apr 2003 08:13 AM (UTC)
Message
I am not sure why it is doing that - the SetVariable in the trigger only gets the last one. Do you need to do something in the MUD to unlock the previous one?

- Nick Gammon

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

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #10 on Mon 21 Apr 2003 09:03 AM (UTC)
Message
there are 2 ways to unlock a target breaking sight on the "target" (which i did when testing the script), or typing "lock -" to clear a lock with out breaking sight on the "target".
Top

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #11 on Mon 21 Apr 2003 09:05 AM (UTC)
Message
Also you can only have one "target" locked at a time. So their maybe mutiple possible "targets" but you can only lock and fire at one at any given time.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #12 on Mon 21 Apr 2003 08:40 PM (UTC)
Message
In the trigger send text, then add (at the start):

Send ("lock -")

... to clear any existing locks.

- Nick Gammon

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

Posted by Pippysmurf   (11 posts)  Bio
Date Reply #13 on Mon 21 Apr 2003 09:43 PM (UTC)
Message
Ok well I did as you instructed. However, the promblem continues the script continues to repeat each "target id" I have entered. Starting with the first one I have entered and going through to the last one.

For example, I have entered 3 id's so far "AA", "AB", and "BB". It starts with "AA" then does "AB" and ending with "BB". If I input another target id it would repeat the process and put the latest ID after "BB". I need some means to clear out that buffer.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #14 on Mon 21 Apr 2003 11:04 PM (UTC)
Message
What buffer are you referring to? Nothing I have done here will append to anything else.

- 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.


76,181 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.