Advertisement
Guest User

Zhedan's QSC Dragon Tracker

a guest
Mar 1st, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. After implementing the following trigger and script, check QSC and you should be good to go!
  2.  
  3. Trigger
  4. --------
  5. PERL REGEX: ^You are level (\d+) ((.*)) and (.*)% of the way to the next level.$
  6.  
  7. BIG BOX:
  8. percenttodragon = levelcalc.dragonpercent()
  9. cecho("\n<gold>[<white>Zhe<gold>]:<OrangeRed> You are "..percenttodragon.."% of the way to dragon!")
  10.  
  11. Script
  12. ------
  13. levelcalc = {
  14. xpto = {
  15. 0, 5000, 10500, 20550, 35205,
  16. 50525, 70577, 95043, 122000, 152000,
  17. 185000, 225000, 267000, 312000, 359000,
  18. 407000, 456000, 506000, 561000, 621000,
  19. 691000, 761000, 836000, 916000, 1001000,
  20. 1091000, 1186000, 1286000, 1391000, 1501000,
  21. 1616000, 1736000, 1861000, 1986000, 2116000,
  22. 2251000, 2391000, 2536000, 2686000, 2941000,
  23. 3096000, 3256000, 3416000, 3581000, 3746000,
  24. 3916000, 4150000, 4353395, 4794382, 5279468,
  25. 5813062, 6400016, 7045665, 7755879, 8537115,
  26. 9396474, 10341769, 11381594, 12525401, 13783589,
  27. 15167596, 16690004, 18364653, 20206766, 22233091,
  28. 24462048, 26913901, 29610939, 32576939, 35840356,
  29. 39430114, 43378848, 47722456, 52500425, 60000000,
  30. 70000000, 83000000, 100000000, 120000000, 150000000,
  31. 185000000, 225000000, 270000000, 320000000, 375000000,
  32. 435000000, 500000000, 570000000, 645000000, 725000000,
  33. 810000000, 900000000, 995000000, 1095000000, 1200000000,
  34. 1310000000, 1425000000, 1545000000, 1670000000, 2000000000,
  35. 2346500000, 2710325000, 3092341200, 3493458200, 3914631000,
  36. 4356862400, 4821205300, 5308765300, 5820703300, 6358238200,
  37. 6922649800, 7515281900, 8137545600, 8790922400, 9476968000,
  38. 10197315800, 10953680900, 11747864200, 12581756600, 13457343600,
  39. 14376709900, 15342044500, 16355645800, 17419927100, 18537422400,
  40. 19710792400, 20942830900, 22236471300, 23594793700, 25021032200,
  41. 26518582600, 28091010500, 29742059700, 31475661300, 33295942900,
  42. 35207238500, 37214098800, 39321302100, 41533865500, 43857057000,
  43. 46296408000, 48857726500, 51547110900, 54370964500, 57336010700,
  44. 60449309200, 63718272600, 67150684100, 70754716100, 74538949700,
  45. 78512394900, 82684512300, 87065235500, 91664994800, 96494742000,
  46. 101565976500, 106890772700, 112481808700, 118352396500, 124516513600,
  47. 130988836500, 137784775500, 144920511400, 152413034000, 160280182700,
  48. 168540688800, 177214220200, 186321428100, 195883996300, 205924692900,
  49. 216467424000, 227537292000, 239160653000, 251365182000, 264179938000,
  50. 277635431000, 291763699000, 306598380000, 322174795000, 338530031000,
  51. 355703029000, 373734676000, 392667906000, 412547797000, 433421683000,
  52. 455339262000, 478352721000, 502516853000, 527889191000, 554530146000,
  53. 582503149000, 611874801000, 642715037000, 675097284000, 709098643000,
  54. 744800071000, 782286569000, 821647393000, 862976257000, 906371565000,
  55. },
  56.  
  57. getxp = function (level, percent)
  58. local tonextlevel = (levelcalc.xpto[level+1] - levelcalc.xpto[level])
  59. return levelcalc.xpto[level] + (tonextlevel*percent/100)
  60. end, -- func
  61.  
  62. percentto = function (level2, percent2, level, percent)
  63. local level = level or tonumber (string.match (gmcp.Char.Status.level, "(%d+) %(.+%%%)"))
  64. local percent = percent or tonumber (string.match (gmcp.Char.Status.level, "%d+ %((.+)%%%)"))
  65. local x = levelcalc.getxp (level, percent) / levelcalc.getxp (level2, (percent2 or 0)) * 100
  66. x = math.floor (x * 100 + 0.5) / 100
  67. return x
  68. end, -- func
  69.  
  70. logosianpercent = function (level, percent)
  71. return levelcalc.percentto (80, 0, level, percent)
  72. end, -- func
  73.  
  74. dragonpercent = function (level, percent)
  75. return levelcalc.percentto (99, 0, level, percent)
  76. end, -- func
  77.  
  78. dragonlordpercent = function (level, percent)
  79. return levelcalc.percentto (100, 0, level, percent)
  80. end, -- func
  81. }
  82.  
  83.  
  84. function percentToBar(perc)
  85.  
  86. local percent = perc
  87.  
  88. echo(string.rep(" ", 36 - #getCurrentLine()))
  89.  
  90. local width = math.floor((percent * 30) / 100)
  91. fg("gui_consoles.bashing.console","a_green")
  92. gui_consoles.bashing.console:echo(string.rep([[|]], width))
  93. fg("gui_consoles.bashing.console","dim_grey")
  94. gui_consoles.bashing.console:echo(string.rep("-", 30 - width))
  95.  
  96. fg("a_darkgrey") echo("gui_consoles.bashing.console"," " .. percent .. "%")
  97. resetFormat("gui_consoles.bashing.console")
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement