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 ➜ Button Based on Spell Affects

Button Based on Spell Affects

You need to log onto the forum to reply or create new threads.

  Refresh page


Pages: 1  2 

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #15 on Tue 15 Apr 2025 01:44 AM (UTC)
Message
Quote:

total_seconds = cycles * 41


Based on that, there are 41 seconds to a cycle, not 1800.

Maybe the earlier message refers to game time, not real time.

Try changing 1800 to 41.

- Nick Gammon

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

Posted by Lilac   (34 posts)  Bio
Date Reply #16 on Wed 16 Apr 2025 01:17 PM (UTC)

Amended on Wed 16 Apr 2025 01:19 PM (UTC) by Lilac

Message
Fantastic, that change seems to be better reflective of the time frame. Thank you so much for your effort and patience on this one, I can't tell you how much I appreciate it.


So this script counts down on the hour? Is it possible to have it refresh on the half hour?

In a totally perfect would I'd like it to update in real time (with every tick that passes) but I don't know if that's unreasonable or not.

I want to be able to monitor it and catch the spell before it falls, but if the last real notification is one whole hour before, that's cumbersome.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #17 on Wed 16 Apr 2025 08:50 PM (UTC)

Amended on Wed 16 Apr 2025 08:56 PM (UTC) by Nick Gammon

Message

It updates internally every second, however the display is rounded.

For example, if your cooldown is in 4 hours you don’t really care if it is 4 hours and 15 seconds do you?

The display works like this:

Over a day

Displays: 3d, 2d, 1d, etc.

Less than a day but more than an hour

Displays: 23h, 22h, 21h etc.

Less than an hour but more than a minute

Displays: 59m, 58m, 57m etc.

Less than a minute

Displays: 59s, 58s, 57s etc.


You could conceivably make the display change colour when time is almost up, for example change:

-- add the text
    WindowText (win, font_id, contents, MARGIN / 2, MARGIN / 2, 0, 0, ColourNameToRGB ("black"))

to:

    color = "black"
    if details.cooldown and details.cooldown < 60 and details.cooldown > 0 then
      color = "darkred"
    end -- if soon
    -- add the text
    WindowText (win, font_id, contents, MARGIN / 2, MARGIN / 2, 0, 0, color)

- Nick Gammon

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

Posted by Lilac   (34 posts)  Bio
Date Reply #18 on Wed 16 Apr 2025 09:40 PM (UTC)

Amended on Wed 16 Apr 2025 09:41 PM (UTC) by Lilac

Message
Nick Gammon said:

It updates internally every second, however the display is rounded.

For example, if your cooldown is in 4 hours you don't really care if it is 4 hours and 15 seconds do you?



No, but I was thinking counting down the timer cycles in real time; so ticking down the cycles on the display, instead of the hour mark.

39 cycles, 38 cycles, so on.


I've also made note that it will ping other things (my MUD has random affects, which is fine to show), but the box doesn't disappear like it's supposed to when they're over, even if you type "affects" again and they're no longer in there.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #19 on Thu 17 Apr 2025 05:09 AM (UTC)
Message
As I mentioned on the page about the plugin you can delete the box.

https://www.gammon.com.au/forum/?id=15238&page=999


CallPlugin ("2f103c42b3356ee1bcac384b" , "RemoveWindow" , "quest")


You could amend that plugin to do the RemoveWindow function call whenever the time drops below zero.

As for the count-down, you could amend it to show cycles by dividing the number of seconds by 41, which would be the number of cycles.

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


1,641 views.

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

You need to log onto the forum to reply or create new threads.

  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.