Facebook
From 01kiko, 1 Month ago, written in Lua.
Embed
Download Paste or View Raw
Hits: 117
  1. -- War Planet Online Cheat Menu by Trongkim3
  2.  
  3. -- Array of resources to modify
  4. -- Order must be the same as in the game
  5. local resources = {
  6.     'Gold',
  7.     'Food',
  8.     'Ore',
  9.     'Crystal'
  10. }
  11.  
  12. -- Initialize cheat with the names of the resources
  13. local cheat = CheatManager:newCheat('War Planet Online Cheat', resources)
  14.  
  15. -- Function to modify the resources
  16. function cheat:modifyResources(amount)
  17.     for i, resource in ipairs(self.resources) do
  18.         local address = findAddress(resource)
  19.         if (address) then
  20.             self:log('Found ' .. resource .. ' at ' .. address)
  21.             writeMemory(address, amount)
  22.         else
  23.             self:log('Could not find ' .. resource)
  24.         end
  25.     end
  26. end
  27.  
  28. -- Menu to modify the resources
  29. function cheat:menu()
  30.     if (self.active) then
  31.         self:registerInt('Amount', 1, 999999, 99999)
  32.         local amount = self:getValue('Amount')
  33.         if (self:confirm('Set ' .. self.name .. ' to ' .. amount .. '?')) then
  34.             self:modifyResources(amount)
  35.             self:drawSuccessMessage('Successfully set ' .. self.name)
  36.         end
  37.         self.active = false
  38.     else
  39.         self:registerToggle('Active')
  40.         if (self:getValue('Active')) then
  41.             self:modifyResources(999999)
  42.             self:drawSuccessMessage('Resources set to maximum')
  43.         end
  44.     end
  45. end