Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. local fileroot = ".\\modules\\ScoreboardServer"
  2.  
  3. function make_key(ctx, filename)
  4. tid = ctx.tournament_id
  5. home = ctx.home_team
  6. away = ctx.away_team
  7.  
  8. if tid == 2 or tid == 3 or tid == 4 or tid == 400 or tid == 401 or tid == 402 or tid == 403 or tid == 404 or tid == 405 or tid == 406 or tid == 600 or tid == 601 or tid == 602 or tid == 603 or tid == 604 or tid == 605 or tid == 606 or tid == 607 then
  9. ScoreboardServer = "UCL"
  10. elseif tid == 5 or tid == 1000 or tid == 1001 or tid == 1002 or tid == 1003 or tid == 1004 or tid == 1005 or tid == 1006 or tid == 1007 or tid == 1008 or tid == 1009 or tid == 1010 or tid == 1011 or tid == 6 then
  11. ScoreboardServer = "UEL"
  12. elseif tid == 17 then
  13. ScoreboardServer = "PremierLeague"
  14. elseif tid == 19 then
  15. ScoreboardServer = "LaLiga"
  16. elseif tid == 18 then
  17. ScoreboardServer = "SerieA"
  18. elseif tid == 20 then
  19. ScoreboardServer = "Ligue1"
  20. elseif tid == 118 then
  21. ScoreboardServer = "STSL"
  22. else
  23. ScoreboardServer = "None"
  24. end
  25. if tid then
  26. return string.format("%s:%s", ScoreboardServer, filename)
  27. end
  28. end
  29.  
  30. local function get_filepath(ctx, filename, key)
  31. if key then
  32. return string.format("%s\\%s\\%s", fileroot, ScoreboardServer, filename)
  33. end
  34. end
  35.  
  36. local function trophy_rewrite(ctx, tournament_id)
  37. log("----- " .. ScoreboardServer)
  38. end
  39.  
  40. local function init(ctx)
  41. if fileroot:sub(1,1)=='.' then
  42. fileroot = ctx.sider_dir .. fileroot
  43. end
  44. ctx.register("livecpk_make_key", make_key)
  45. ctx.register("livecpk_get_filepath", get_filepath)
  46. ctx.register("trophy_rewrite", trophy_rewrite)
  47. end
  48.  
  49. return { init = init }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement