SHARE
TWEET

Epoch SQL Events

Buly Jul 22nd, 2014 242 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DROP EVENT IF EXISTS updateStockDaily;
  2. CREATE EVENT updateStockDaily
  3. ON SCHEDULE EVERY 1 DAY
  4. COMMENT 'Updates out of stock vendors'
  5. DO
  6. UPDATE `traders_data` SET qty=250 WHERE qty<50 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat';;
  7.  
  8. DROP EVENT IF EXISTS removeDamagedVehicles;
  9. CREATE EVENT removeDamagedVehicles
  10. ON SCHEDULE EVERY 1 DAY
  11. COMMENT 'Removes destroyed vehicles from the database'
  12. DO
  13. DELETE FROM `object_data` WHERE Damage = 1;;
  14.  
  15. DROP EVENT IF EXISTS removeObjectOld;
  16. CREATE EVENT removeObjectOld
  17. ON SCHEDULE EVERY 1 DAY
  18. COMMENT 'Removes old objects and vehicles'
  19. DO
  20. DELETE FROM `object_data` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY);
  21.  
  22. DROP EVENT IF EXISTS setDamageOnAge;
  23. CREATE EVENT setDamageOnAge
  24. ON SCHEDULE EVERY 1 DAY
  25. COMMENT 'This sets damage on a wall so that it can be maintained'
  26. DO
  27. UPDATE `object_data` SET `Damage`=0.1 WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );
  28.  
  29. DROP EVENT IF EXISTS removeDamagedBikes;
  30. CREATE EVENT removeDamagedBikes
  31. ON SCHEDULE EVERY 1 DAY
  32. COMMENT 'Removes bikes with damaged tires'
  33. DO
  34. DELETE FROM object_data WHERE (classname = "Old_bike_TK_INS_EP1" OR classname = "MMT_CIV") AND (hitpoints LIKE "%[\"wheel_1_damper\",1]%" AND hitpoints LIKE "%[\"wheel_2_damper\",1]%");
  35.  
  36. DROP EVENT IF EXISTS unlockAbandonedVehicles;
  37. CREATE EVENT unlockAbandonedVehicles
  38. ON SCHEDULE EVERY 1 DAY
  39. COMMENT 'Unlocks vehicles that have been abandoned'
  40. DO
  41. UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 4 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 4 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage','LockboxStorage','VaultStorageLocked','LockboxStorageLocked','WoodShack_DZ','StorageShed_DZ','TentStorageDomed','TentStorageDomed2','TentStorage')  AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL;
  42.  
  43. DROP EVENT IF EXISTS removeAbandonedVehicles;
  44. CREATE EVENT removeAbandonedVehicles
  45. ON SCHEDULE EVERY 1 DAY
  46. COMMENT 'Removes vehicles that have been abandoned'
  47. DO
  48. DELETE FROM object_data WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 8 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND ((classname = "Old_bike_TK_INS_EP1" OR classname = "MMT_CIV") OR (fuel <> 0.0000));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top