Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setbatchlines, -1
  2. #Include CLR.ahk
  3. c# =
  4. (
  5.   using System;
  6. using System.IO;
  7.  
  8. namespace lod
  9. {
  10.     public class parse
  11.     {
  12.         public string mobname(string path)
  13.         {
  14.             byte[] bytes = File.ReadAllBytes(path);
  15.             long len = bytes.Length;
  16.             long i = 0;
  17.             int i2 = 0;
  18.             int id;
  19.             int namelen;
  20.             string mobname;
  21.             string output = "";
  22.             do
  23.             {
  24.                 id = (bytes[i + 4] + (bytes[i + 5] * 256) + (bytes[i + 6] * 256) + (bytes[i + 7] * 256));
  25.                 namelen = (bytes[i + 8] + bytes[i + 9] + bytes[i + 10] + bytes[i + 11]);
  26.                 mobname = "";
  27.                 i2 = 1;
  28.                 while (i2 < namelen + 1)
  29.                 {
  30.                     i2++;
  31.                     mobname = mobname + (char)(bytes[i + 10 + i2]);
  32.                 }
  33.                 output = output + id + ";" + mobname + "|";
  34.                 i = i + 8 + namelen;
  35.             } while (i < len - 4);
  36.             return output;
  37.         }
  38.     }
  39. }
  40. )
  41.  
  42. fileselectfile, path, o
  43. CLR_Start()
  44. asm := CLR_CompileC#(c#, "system.dll")
  45. get := CLR_CreateObject(asm, "lod.parse")
  46. allmobs := get.mobname(path)
  47. if FileExist(path)
  48. {
  49. Gui, Add, ListView, x12 y10 w240 h350 vlb, ID|Name
  50. loop, parse, allmobs, |
  51. LV_Add(0, substr(a_loopfield, 1, instr(a_loopfield, ";")-1), substr(a_loopfield, instr(a_loopfield, ";")+1))
  52. Gui, Show, h377 w267, Mobname Parse ~ILAN
  53. }
  54. else
  55. exitapp
  56. return
  57. GuiClose:
  58. ExitApp
  59. msgbox,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement