![]() |
GS2 'cron jobs'
For the shop system on Valikorlia, I'm wanting to implement a cron job-like scenario for updating item stock in certain shops. I'm assuming that scheduleEvent() would be used here. I've never used scheduleEvent() a day in my life, though.
Is there a way to update item stock every 24 hours, indefinitely using scheduleEvent()? |
There is, but scheduled events are cancelled when the npcserver restarts, so it would be better to use a sleep or a timeout which is not interrupted by the npcserver.
|
This is retarded, just do nothing until a player actually enters the shop and then calculate how much restocking you have to do.
|
Quote:
Quote:
|
Quote:
Quote:
|
Quote:
|
Quote:
EDIT: To be honest, I'd probably use a database NPC. |
Quote:
But I'd use the database NPC for a variety of different shop functions like keeping inventory or whatever. Because if you just use it to time it's a waste of resources, and that makes Scripters want to beat you upside the head with a Pipe Wrench. |
Quote:
|
Why use a server flag... I'd go with Loriel and the timevar2
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 01:22 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.