I am currently using the code below to add a pause inbetween when an item is clicked and when it performs the main code, The code below works but gives a cpu spike while its being bounced between the (tryagain) waiting for the timer to let it through, So was wondering if there is any better way of handling this pause?
Item Use Code:
Timer Handle in Entity.cs
Item Use Code:
Code:
case 4000058:
{
client.Entity.LoadStamp = Time32.Now;
client.Entity.LoadTime = 3;
tryagain:
if (client.Entity.LoadTime == 0)
{
Game.Features.lock3.Open(client);
}
else
{
goto tryagain;
}
}
break;
Code:
if (Now >= client.Entity.LoadStamp.AddSeconds(client.Entity.LoadTime))
{
client.Entity.LoadTime = 0;
}