Dogboys Posted May 21, 2006 Share Posted May 21, 2006 Ok so i want the $manamin to increase its minium by 10 every single hour.So(If $manamin >= is lower than $manamax increase $manamin by 10 Quote Link to comment https://forums.phpfreaks.com/topic/10134-every-hour-increase-by-10-min/ Share on other sites More sharing options...
AndyB Posted May 21, 2006 Share Posted May 21, 2006 Sounds reasonable. Care to share any code you have? Where/how are these variables stored? Where/how are these variables used? Quote Link to comment https://forums.phpfreaks.com/topic/10134-every-hour-increase-by-10-min/#findComment-37747 Share on other sites More sharing options...
Dogboys Posted May 21, 2006 Author Share Posted May 21, 2006 [!--quoteo(post=375831:date=May 21 2006, 01:14 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 21 2006, 01:14 PM) [snapback]375831[/snapback][/div][div class=\'quotemain\'][!--quotec--]Sounds reasonable. Care to share any code you have? Where/how are these variables stored? Where/how are these variables used?[/quote]Well i was wondering if you could just convert it to a proper php code instead of my phony version of it.Well variables are stored into a database.Well my part of a script for the part the variable is used...if ($usepoints==true) { if ($userrow["$manamin"] < $townrow["$manacost"]) { display("You dont have enough mana..", "Travel To"); die(); Im sorry if they script is wrong im no good at php. Quote Link to comment https://forums.phpfreaks.com/topic/10134-every-hour-increase-by-10-min/#findComment-37773 Share on other sites More sharing options...
Dogboys Posted May 22, 2006 Author Share Posted May 22, 2006 bump Quote Link to comment https://forums.phpfreaks.com/topic/10134-every-hour-increase-by-10-min/#findComment-37866 Share on other sites More sharing options...
eves Posted May 22, 2006 Share Posted May 22, 2006 too general, but here's some algo you can use:1. keep track of starting time, store it on DB2. convert to timestamp and check difference of current time and starting time3. if less than 1 hour, skip update4. if more than or equal to 1 hour, increase value by 10, set starting time to current time, then update the fields on the database Quote Link to comment https://forums.phpfreaks.com/topic/10134-every-hour-increase-by-10-min/#findComment-37927 Share on other sites More sharing options...
Barand Posted May 24, 2006 Share Posted May 24, 2006 As you can see, it's exactly the same problem and solution as the previous one that you posted.[a href=\"http://www.phpfreaks.com/forums/index.php?s=&showtopic=93883&view=findpost&p=375705\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=375705[/a] Quote Link to comment https://forums.phpfreaks.com/topic/10134-every-hour-increase-by-10-min/#findComment-38488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.