Advertisement
Guest User

Untitled

a guest
Feb 15th, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(consoleAddr) {
  2.     function PtcHack(cmd, on, off, active) {
  3.         this.command = cmd;
  4.         this.on = on;
  5.         this.off = off;
  6.         this.active = (active === undefined ? false : active);
  7.     }
  8.    
  9.     PtcHack.prototype.toggle = function() {
  10.         this.active = !this.active;
  11.         var cmd = this.command + ' ' + (this.active ? this.on : this.off);
  12.         Console.push(cmd);
  13.     };
  14.    
  15.     function MemoryHack(address, on, off, size, active) {
  16.         this.address = address;
  17.         this.on = on;
  18.         this.off = off;
  19.         this.size = size;
  20.         this.active = (active === undefined ? false : active);
  21.     }
  22.    
  23.     MemoryHack.prototype.toggle = function() {
  24.         this.active = !this.active;
  25.         Memory.copy(this.address, (this.active ? this.on : this.off), this.size);
  26.     };
  27.    
  28.     var chams   = new PtcHack('SkelModelStencil', '1.0', '0.0');
  29.     var wireframe   = new PtcHack('WireFrame', '1.0', '0.0');
  30.     var nofog   = new PtcHack('FogEnable', '1.0', '0.0');
  31.     var showfps = new PtcHack('ShowFPS', '1.0', '0.0');
  32.     var superbullet = new MemoryHack(0x37511606, "\x33\xC0\x90", "\x0F\x94\xC0", 3);
  33.    
  34.     Console.init(consoleAddr);
  35.     Keyboard.onkeydown = function(keycode) {
  36.         switch(keycode) {
  37.             case 0x61: // VK_NUMPAD1
  38.                 chams.toggle(); break;
  39.             case 0x62: // VK_NUMPAD2
  40.                 wireframe.toggle(); break;
  41.             case 0x63: // VK_NUMPAD3
  42.                 nofog.toggle(); break;
  43.             case 0x64: // VK_NUMPAD4
  44.                 showfps.toggle(); break;
  45.             case 0x64: // VK_NUMPAD5
  46.                 superbullet.toggle(); break;
  47.             default: break;
  48.         }
  49.     };
  50. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement