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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Trying to set a timer time using a variable
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trying to set a timer time using a variable

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


Posted by Eikou   (2 posts)  [Biography] bio
Date Fri 24 Jun 2016 01:23 AM (UTC)
Message
I am trying to create a trigger that adds a timer with a duration that changes based on information in the trigger.
I am not a programmer and haven't been able to find a file anywhere that would explain how do to this.

Trigger: *HP:*/* SP:*/* EP:*/*

Send:
n = bc.sub (%7,%6)
m = bc.div (n,13)
l = bc.mul (m,15)
DoAfterNote (l, 'Endurance Full')

Send to: Script

I am trying to find a way to get 'DoAfterNote' or 'AddTimer' to use this variable 'l'.

Thank you for your time
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 24 Jun 2016 01:54 AM (UTC)
Message
You don't need to use "big numbers" for simple arithmetic.

How about:


n = %7 - %6
m = n / 13
time = m * 15
DoAfterNote (time, 'Endurance Full')


I don't like the variable name "l", it looks too much like 1.

So what was wrong with that? Did the note not appear, or what?

- Nick Gammon

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

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #2 on Fri 24 Jun 2016 02:43 AM (UTC)

Amended on Fri 24 Jun 2016 02:44 AM (UTC) by Fiendish

Message
Nick Gammon said:

You don't need to use "big numbers" for simple arithmetic.

But what if Eikou's HP is 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999? lol

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 24 Jun 2016 03:29 AM (UTC)
Message
He must be using a different server than the ones I am used to, in that case. :P

- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Fri 24 Jun 2016 03:33 AM (UTC)

Amended on Fri 24 Jun 2016 03:34 AM (UTC) by Nick Gammon

Message
What is his HP is:


18739277038847939886754019920358123424308469030992781557966909983211910963157763678726120154469030856807730587971859910379069087693119051085139566217370635083384943613868029545256897117998608156843699465093293765833141309526696357142600866935689483770877815014461194837692223879905132001



*Then* you use bc.

- Nick Gammon

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

Posted by Eikou   (2 posts)  [Biography] bio
Date Reply #5 on Fri 24 Jun 2016 04:12 AM (UTC)
Message
Huzzah! It works! Thanks for the lesson. May you all have infinite HP.
[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.


2,644 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 FutureQuest]