Advertisement
Guest User

Hybrid.js

a guest
Aug 22nd, 2015
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function main() {
  2.  
  3.     this.block = false;
  4.     var lock_id=false;
  5.     print("Welcome to Hybrid.js");
  6.     var NPC_ID=[0x00, 0x00, 0x00, 0x00];
  7.     var item_ID=[0x00, 0x00, 0x00, 0x00];
  8.    
  9.     //receiving
  10.     addEventListener("gamepacket", function(bytes) {
  11.         var i=0;
  12.         switch(bytes[0]) {
  13.             case 0x9c:
  14.                 if (bytes.length>7 && lock_id===false) {
  15.                     print("item ID: " + bytes[0].toString(16)+" "+bytes[1].toString(16)+" "+bytes[2].toString(16)+" "+bytes[3].toString(16)+" "+bytes[4].toString(16)+" "+bytes[5].toString(16)+" "+bytes[6].toString(16)+" "+bytes[7].toString(16));
  16.                     for (i=0; i<4; i++) {
  17.                         item_ID[i]=bytes[i+4];
  18.                     }  
  19.                 }
  20.                 break; 
  21.             case 0x77:
  22.                 print("Received 77 0D");
  23.                 break; 
  24.         }
  25.     });
  26.    
  27.     //sending
  28.     addEventListener("gamepacketsent", function(bytes) {
  29.         var i=0;
  30.         if (bytes[0] == 0x13 && bytes.length > 8) {    
  31.             print("NPC ID: " + bytes[0].toString(16)+" "+bytes[1].toString(16)+" "+bytes[2].toString(16)+" "+bytes[3].toString(16)+" "+bytes[4].toString(16)+" "+bytes[5].toString(16)+" "+bytes[6].toString(16)+" "+bytes[7].toString(16)+" " + bytes[8].toString(16));   
  32.             for (i=0; i<4; i++) {
  33.                 NPC_ID[i]=bytes[i+5];
  34.             }
  35.         }
  36.        
  37.         if (bytes[0] == 0x30 && this.block == true) {
  38.             print("0x30 blocked");
  39.             return true;
  40.         }
  41.        
  42.         return false;
  43.  
  44.     });
  45.    
  46.     addEventListener("keyup", function(key) {
  47.  
  48.         switch (key) {
  49.            
  50.             case 0x61:
  51.  
  52.                 print("Talk to Nihlathak then press NUMPAD2");
  53.                 this.block = true;
  54.  
  55.                 break;
  56.  
  57.  
  58.             case 0x62:
  59.  
  60.                 if(!me.itemoncursor) {
  61.                     print("Pick an item to cursor then press NUMPAD2 again");
  62.                     return;
  63.                 }
  64.  
  65.                 var gate = getUnit(2, 449);
  66.                 if (gate) {
  67.                     sendPacket(1, 0x44, 4, 2, 4, gate.gid, 4, getUnit(100).gid, 4, 0x03);
  68.                     print("Go into trade then press NUMPAD3");
  69.                 } else {
  70.                     print("go near the gate");
  71.                 }
  72.  
  73.                 break;
  74.  
  75.             case 0x63:
  76.  
  77.                 sendPacket(1, 0x31, 1, 0xFF, 1, 0xFF, 1, 0xFF, 1, 0xFF, 1, 0xA3, 1, 0x4E, 2, 0x00);
  78.                 getPacket(1, 0x77, 1, 0x0c);
  79.  
  80.                 print("Lock the item ID by pressing NUMPAD4");
  81.                 this.block = false;
  82.  
  83.                 break;
  84.                
  85.             case 0x64:
  86.                 print("locking the ID");
  87.                 print("Sell the ITH by pressing NUMPAD6 after opening a trade screen to NPC");
  88.                 print("item ID: " + item_ID[0].toString(16) + " "+ item_ID[1].toString(16) + " "+ item_ID[2].toString(16) + " "+ item_ID[3].toString(16));
  89.                 lock_id=true;
  90.                 break;
  91.             case 0x66:
  92.                 print("Selling base runeword...");
  93.                 print("NPC ID: " + NPC_ID[0].toString(16) + " "+ NPC_ID[1].toString(16) + " "+ NPC_ID[2].toString(16) + " "+ NPC_ID[3].toString(16));
  94.                
  95.                 sendPacket(1, 0x33, 1, NPC_ID[0], 1, NPC_ID[1], 1, NPC_ID[2], 1, NPC_ID[3], 1, item_ID[0], 1, item_ID[1], 1, item_ID[2], 1, item_ID[3], 8, 0x00);
  96.                 print("buy back the runeword and make hybrid");    
  97.                 print("don't forget to trash the original runeword!");     
  98.                
  99.                 break;
  100.         }
  101.     });
  102.    
  103.    
  104.    
  105.     while (1)
  106.         delay(1000);
  107.        
  108.     return true;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement