[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]  Tips and tricks
. . -> [Subject]  Timer/Trigger
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Timer/Trigger
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
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  (19,607 posts)  [Biography] bio   Forum Administrator
Date Sat 01 Mar 2008 04:46 AM (UTC)  quote  ]
Message
Also see this for tips about making triggers:

http://www.gammon.com.au/forum/?id=8086


- Nick Gammon

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

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Sat 01 Mar 2008 04:18 AM (UTC)  quote  ]
Message
Well, you make a trigger run a script, then it runs every time the trigger fires (use "send to script" in the trigger configuration). There are many examples here on the forum. Same for an alias.

Basically to make something happen only in combat, you need to know (the client needs to know) if you are in combat or not.

What I would do is use a trigger to detect going into combat (or being in combat), eg. a message like "The kobold hits you for 20 damage" could be turned into a trigger matching "The * hits you for * damage" and in that trigger you do "send to script", and in the send field put something like "in_combat = true".

Then you need to know when you have left combat, for example "The kobold is dead! You get 100 experience" could be matched by a trigger "The * is dead! You get * experience", and then you set in_combat to be false.

Some MUDs, like SMAUG, have a different "combat" prompt, so you could simply detect which sort of prompt you have got with triggers, and react accordingly.

See http://www.mushclient.com/scripting for some general guidance on doing scripting.

- Nick Gammon

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

Posted by Racerzx3   (2 posts)  [Biography] bio
Date Fri 29 Feb 2008 10:55 PM (UTC)  quote  ]
Message
I have tried using scripts, but i can only get them to run once. I play muds alot, i just usually use telnet, so MUSHClient is really confusing. i can't figure out how to make it cast a spell while only in combat.
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Thu 28 Feb 2008 08:17 PM (UTC)  quote  ]
Message
A word of caution here. A lot of muds have rules against botting. Make sure that a script like this is legal on the mud you are playing. This type of script is very easy to test for, and we would hate to see you get in trouble for something so trivial.

As for multiple attacks occuring in one round, there is usually a prompt display between each round on most muds I have played. Simply have the type of trigger Nick suggested turn back on after the prompt is displayed if you need this consitantly on a per round basis.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Thu 28 Feb 2008 07:41 PM (UTC)  quote  ]
Message
If the casting spells and attacking come from the same trigger, you could make it conditional, something like this (in scripting):


if not cast_spell_yet then
  Send ("cast something")
  cast_spell_yet = true
end -- if


That way you only cast it the first time. Obviously, as StuDraKi says, you need to clear this flag when the round (or fight) is over, so you probably need a second trigger that is activated when that happens, and does this:


  cast_spell_yet = false

- Nick Gammon

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

Posted by StuDraKi   Germany  (17 posts)  [Biography] bio
Date Thu 28 Feb 2008 03:58 PM (UTC)  quote  ]
Message
How do you define a round?

From your post I have multiple ideas:
within the execution of the "cast spell" trigger you have a at least one line script to disable this trigger.
Either you have another trigger (spell points over a certain minimum) or a timer to enable the cast spell trigger again. In case of a timer, you can configure and start the timer in the script of the cast spell trigger.

Before someone posts a ready to use script solution, is that what you need?
[Go to top] top

Posted by Racerzx3   (2 posts)  [Biography] bio
Date Thu 28 Feb 2008 02:17 AM (UTC)  quote  ]
Message
I have made triggers to automatically attack when enemies enter my square, but i also want to cast spells. how can i automatically cast spells only when they are attacking me. sometimes they attack twice in one round, and i only want to cast 1 time.
[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.


4,552 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.

[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]    [Web site powered by FutureQuest.Net]