Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main() {
- this.block = false;
- var lock_id=false;
- print("Welcome to Hybrid.js");
- var NPC_ID=[0x00, 0x00, 0x00, 0x00];
- var item_ID=[0x00, 0x00, 0x00, 0x00];
- //receiving
- addEventListener("gamepacket", function(bytes) {
- var i=0;
- switch(bytes[0]) {
- case 0x9c:
- if (bytes.length>7 && lock_id===false) {
- 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));
- for (i=0; i<4; i++) {
- item_ID[i]=bytes[i+4];
- }
- }
- break;
- case 0x77:
- print("Received 77 0D");
- break;
- }
- });
- //sending
- addEventListener("gamepacketsent", function(bytes) {
- var i=0;
- if (bytes[0] == 0x13 && bytes.length > 8) {
- 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));
- for (i=0; i<4; i++) {
- NPC_ID[i]=bytes[i+5];
- }
- }
- if (bytes[0] == 0x30 && this.block == true) {
- print("0x30 blocked");
- return true;
- }
- return false;
- });
- addEventListener("keyup", function(key) {
- switch (key) {
- case 0x61:
- print("Talk to Nihlathak then press NUMPAD2");
- this.block = true;
- break;
- case 0x62:
- if(!me.itemoncursor) {
- print("Pick an item to cursor then press NUMPAD2 again");
- return;
- }
- var gate = getUnit(2, 449);
- if (gate) {
- sendPacket(1, 0x44, 4, 2, 4, gate.gid, 4, getUnit(100).gid, 4, 0x03);
- print("Go into trade then press NUMPAD3");
- } else {
- print("go near the gate");
- }
- break;
- case 0x63:
- sendPacket(1, 0x31, 1, 0xFF, 1, 0xFF, 1, 0xFF, 1, 0xFF, 1, 0xA3, 1, 0x4E, 2, 0x00);
- getPacket(1, 0x77, 1, 0x0c);
- print("Lock the item ID by pressing NUMPAD4");
- this.block = false;
- break;
- case 0x64:
- print("locking the ID");
- print("Sell the ITH by pressing NUMPAD6 after opening a trade screen to NPC");
- print("item ID: " + item_ID[0].toString(16) + " "+ item_ID[1].toString(16) + " "+ item_ID[2].toString(16) + " "+ item_ID[3].toString(16));
- lock_id=true;
- break;
- case 0x66:
- print("Selling base runeword...");
- print("NPC ID: " + NPC_ID[0].toString(16) + " "+ NPC_ID[1].toString(16) + " "+ NPC_ID[2].toString(16) + " "+ NPC_ID[3].toString(16));
- 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);
- print("buy back the runeword and make hybrid");
- print("don't forget to trash the original runeword!");
- break;
- }
- });
- while (1)
- delay(1000);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement