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 ➜ I need help Making A simple Script (Im just dumb and dont know what im doing)

I need help Making A simple Script (Im just dumb and dont know what im doing)

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


Posted by Tillany   (2 posts)  Bio
Date Sat 18 Jun 2005 03:49 AM (UTC)
Message
Im trying to create a script to trigger off a number recieved and then divide that number by 20 then resubmit it as an imput into the mud im playing on. Any help would be very appriciative.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Sat 18 Jun 2005 05:36 AM (UTC)
Message
What does the line recieved look like? And then what do you want to send (just a plain number? or something else infront of it)

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Tillany   (2 posts)  Bio
Date Reply #2 on Sat 18 Jun 2005 07:19 AM (UTC)
Message
The line is simaler to this trigger is
*# 4832652654262 74364*

I want the trigger to divide that second number by 20 then send it back into the mud as...

slice 4832652654262 <new number>

Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Sat 18 Jun 2005 10:37 AM (UTC)
Message
Assuming the asterisks are part of the line, and assuming that you want just the integer part of the quotient, this will work (for any pair of numbers).
It is in VBScript, but the only language sensitive part is the rounding and the syntax.
<triggers>
  <trigger
   enabled="y"
   match="^\*# (\d+) (\d+)\*$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>note "slice %1 " &amp; Int(%2/20)</send>
  </trigger>
</triggers>

Just copy and paste into the triggers page.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
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.


13,952 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.