It is currently 07 Nov 2025, 09:07
   
Text Size

Magic Album - Feature Requests

Enable os.clock function (implemented)

 

I am writing scryfall.com pricing script for MA (https://github.com/refaim/MagicAlbumScryfallPriceScript).

According to Scryfall API documentation (https://scryfall.com/docs/api/) an API client can safely perform no more than 10 requests per second, so I need to add delay between calls to ma.GetUrl function.

Unfortunately, I could not find any reliable way to implement sleep function in MA Lua interpreter.

So it would be great if the standard Lua os.clock function was added to pricing scripts environment.

Comments

Posted by Goblin Hero » 04 Oct 2018, 06:51

I do not want to enable os library because of potentially unsafe functions.
Please, test the attached exe. I've added a ma.GetTime() function, which returns current time as a number of seconds since the epoch. Should be enough for your needs.

Posted by Goblin Hero » 04 Oct 2018, 06:55

Hmm... May be It's better to just implement a sleep() function instead? What do you think?
Last edited by Goblin Hero on 04 Oct 2018, 06:56, edited 1 time in total.

Posted by Guest » 04 Oct 2018, 10:04

Please, test the attached exe.

Working perfectly.

May be It's better to just implement a sleep() function instead? What do you think?

I think that timer function is more universal. It's possible to measure time through such function, for example.

Posted by Goblin Hero » 04 Oct 2018, 11:15

Good, will be added with the next MA update.

Ticket details

  • Ticket ID: 1489
  • Project: Magic Album
  • Status: Implemented
  • Component: Pricing
  • Project version: (unknown)
  • Priority: Normal
  • Assigned to: Goblin Hero
  • Reported by:
  • Reporter's tickets: List all tickets
  • Reported on: 04 Oct 2018, 01:15
  • Last visited by Goblin Hero » 05 Dec 2018, 08:07.
 

Main Menu

User Menu

Our Partners


Login Form