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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  search/replace

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: search/replace
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 12 Sep 2001 01:27 AM (UTC)  quote  ]
Message
Yes, you could do something like this:



Trigger: You wield *.
Omit from output: checked
Label: Wield
Script: OnWield



And then put this subroutine in the script file (VBscript) - ensure scripting is enabled.


sub OnWield (strTriggerName, strTriggerLine, aryWildcards)
dim weapon, hit, dam

  ' weapon is in the first wildcard
  weapon = aryWildcards (1)

  ' work out spell duration based on chant
  Select Case weapon
      Case "the Globe of Protection"
           hit = 90
           dam = 100
      Case "a Silver Sword"
           hit = 80
           dam = 150

' --- and so on 

      Case Else
           hit = -1
           dam = -1
  End Select

  ' show HP and Dam if known
  if hit = -1 then
    world.note "You wield " & weapon & " (unknown HP)"
  else
    world.note "You wield " & weapon & ". (Hit: " _
               & hit & " Dam: " & dam & ")"
  end if

end sub


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Morten   (5 posts)  [Biography] bio
Date Tue 11 Sep 2001 09:28 AM (UTC)  quote  ]
Message
Greetings once again...

I would like to know if it is possible to search after
a certain words and then change them before they are
printed to the screen?

Like:

You wield the Globe of Protection.

Should then be replaced with:

You wield the Globe of Protection. (Hit: 90 Dam: 100)

I figured out that it must be possible via a trigger or something?

In advance, thanks.

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


1,380 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]