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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  How to repeat lost concentration triggers?

How to repeat lost concentration triggers?

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


Posted by Valis   (1 post)  [Biography] bio
Date Mon 01 Oct 2012 10:17 PM (UTC)
Message
I need to know if it would be possible if someone could tell me how to automatically say if someone tells group HH with * as the wild card itll cast haste on them but if I lose concentration how do I get it to repeat till it hits? Thanks.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Tue 02 Oct 2012 02:03 AM (UTC)

Amended on Tue 02 Oct 2012 02:06 AM (UTC) by Fiendish

Message
Quote:
if I lose concentration how do I get it to repeat till it hits?

You have to show us what it looks like on your MUD when you lose concentration. Copy/paste starting from before you see HH on your group channel until after you lose concentration.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Avocado   (13 posts)  [Biography] bio
Date Reply #2 on Tue 05 Nov 2013 05:26 AM (UTC)
Message
Below is a short script I put together. This MUD replies with "You lose your concentration while casting..."
The spell number can be replaced to actual spell name. Add more spells if needed. Be sure to change 'nosp' count from 2 to whatever if array is changed to a different count.


-- castfight: cast before fighting


require "wait"
wait.make (function() -- start of coroutine


ca = "cast "

-- enter spell number in quotes to identify as strings

a= {[1]="100", [2]="101"}
nosp = 2 -- nosp = number of spells in array

-- run loop to call all spells in array
for b = 1, nosp do

-- concatenate "cast " and spell number or name
sum = (ca..a)

-- Try again if you lose your concentration
repeat

Send (sum)
local x = wait.match("You lost your concentration*", 1)

if not x then
Note (a.." done.")
c = 0
else
wait.time(1)
c = 1
end -- if

until c == 0
c = 1

end -- for b, outer loop


end) -- of Coroutine
[Go to top] top

Posted by Avocado   (13 posts)  [Biography] bio
Date Reply #3 on Tue 05 Nov 2013 05:29 AM (UTC)
Message
the line:

sum = (ca..a)

should be:

sum = (ca..a)



I don't know how to post codes in code format. Sorry.
[Go to top] top

Posted by Avocado   (13 posts)  [Biography] bio
Date Reply #4 on Tue 05 Nov 2013 05:30 AM (UTC)
Message
Hope quoting works..

Avocado said:

the line:

sum = (ca..a)

should be:

sum = (ca..a)



I don't know how to post codes in code format. Sorry.


[Go to top] top

Posted by Avocado   (13 posts)  [Biography] bio
Date Reply #5 on Tue 05 Nov 2013 05:32 AM (UTC)
Message
it isn't posting right.

sum = (ca..a[_b_])

it should be like that but remove the underscores.

I wish I could edit the posts here.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Tue 05 Nov 2013 10:53 AM (UTC)
Message
Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


It's all there.

- Nick Gammon

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

Posted by Avocado   (13 posts)  [Biography] bio
Date Reply #7 on Fri 08 Nov 2013 03:23 AM (UTC)
Message
Thank you Nick.
Here it is again. I changed the spell to be tried only 3 times. It isn't what exactly Valis had requested, but it could be a part of something he or many of us could use.


<aliases>
  <alias
   match="castfight"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>-- castfight:  cast before fighting


require "wait"
wait.make (function() -- start of coroutine


ca = "cast "

-- enter spell or spell number in quotes to identify as strings

a= {[1]="bless", [2]="haste"}
nosp = 2 -- nosp = number of spells in array

-- run loop to call all spells in array
for b = 1, nosp do

  -- concatenate "cast " and spell string in array
  sum = (ca..a[b]) 

  -- Try again up to three times if you lose your concentration
  repeat 

    Send (sum)
    local x = wait.match("You lost your concentration*", 1)

    if not x then
      Note (a[b].." done.")
      c = 3
    else
      wait.time(1)
      c = c + 1
    end -- if

  until c == 3  
  c = 0

end -- for b, outer loop


end) -- of Coroutine
</send>
  </alias>
</aliases>
[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.


18,752 views.

It is now over 60 days since the last post. This thread is closed.     [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.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]