Counting trigger

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Counting trigger

Post by Kwevin » 11 May 2017 22:14

WHat would need to be in a trigger to count stuff? With my limited coding experience, it would have to have a counter in it, right? x=x+1? And how would you get it to input that number after each count? How would you get it to not redefine with each pattern appearance?
Alea iacta est. Serius regredi est.

User avatar
Melarec
Rising Hero
Posts: 318
Joined: 29 Feb 2016 19:51
Location: Everywhere
Contact:

Re: Counting trigger

Post by Melarec » 11 May 2017 23:09

I was going to help, but as I began, I realized I haven't coded at all in 2 (more?) years and my pathetic attempt at a simple counter has left me ashamed.
If anyone can fix this..:

Code: Select all

<!DOCTYPE html>
<html>
  <body>
    <canvas id="counterCanvas" width="400" height="200"
     style="border:1px solid #c3c3c3; background-color: lightGrey;">
      Sadly, your browser does not support the canvas element.
    </canvas>
  <script>
    var canvas = document.getElementById("counterCanvas");
    var ctx = canvas.getContext("2d");
    var height = canvas.height*0.8;
    var wide = canvas.width*0.8;
    setInterval(tick,10000);
    var counter = 0;
     function tick(counter) {
       counter = counter + 1;
       if (counter == 6) {
         ctx.font = height*0.5 + "px Helvetica Neue";
         ctx.fillStyle="green";
         ctx.fillText("One minute has passed!",20,height/2);
         counter = 0;
       }
     }
  </script>
  </body>
</html>
It might help. But not inside Genesis.
Similar to what you're looking for, though?
This leaves me wondering how I ever managed to make a functional clock in JS..

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Counting trigger

Post by Tarax the Terrible » 12 May 2017 10:44

Don't think they want a timed counter. Instead an event counter.

Eowul posted the script for smiths counting items forged. In the client section. Everything u need to adapt that for whatever should be there
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Counting trigger

Post by Tarax the Terrible » 12 May 2017 10:49

Tarax the Terrible wrote:Don't think they want a timed counter. Instead an event counter.

Eowul posted the script for smiths counting items forged. In the client section. Everything u need to adapt that for whatever should be there
Here https://www.genesismud.org/forums/viewt ... =37&t=2257
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Re: Counting trigger

Post by Kwevin » 12 May 2017 15:19

Sweet mother of God, yes! Exactly what I wanted! Many thanks, Tarax!
Alea iacta est. Serius regredi est.

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Counting trigger

Post by Tarax the Terrible » 12 May 2017 22:03

Another satisfied customer lol *thumbup*
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

User avatar
Melarec
Rising Hero
Posts: 318
Joined: 29 Feb 2016 19:51
Location: Everywhere
Contact:

Re: Counting trigger

Post by Melarec » 12 May 2017 22:14

Tarax the Terrible wrote:
Tarax the Terrible wrote:Don't think they want a timed counter. Instead an event counter.
Eowul posted the script for smiths counting items forged. In the client section. Everything u need to adapt that for whatever should be there
Here https://www.genesismud.org/forums/viewt ... =37&t=2257
Oh my, this is lovely. Yes, I'm not sure what I was thinking before..

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Counting trigger

Post by Tarax the Terrible » 12 May 2017 22:17

Those guys really know their stuff. Would like to see some screenshots of heavily customised game clients to illustrate what is possible.
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/