Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. screenlink = {}
  2. screenlink.name = "screenlink"
  3. screenlink.b0 = zo_strformat("|t1:1:screenlink/textures/1x1b.dds|t")
  4. screenlink.b1 = zo_strformat("|t1:1:screenlink/textures/1x1.dds|t")
  5.  
  6. ZO_CreateStringId("SI_BINDING_NAME_CHOOSE_PLAYLIST_BATTLE", "Battle")
  7. ZO_CreateStringId("SI_BINDING_NAME_CHOOSE_PLAYLIST_EPIC", "MFK EPIC BOSS BATTLE")
  8.  
  9. screenlink.Playlist = 0
  10.  
  11. function intToBinString(k)
  12.     n = k
  13.     bin = {0,0,0,0,0,0,0,0}
  14.     String = screenlink.b1
  15.     for i = 0,8 do
  16.         j = 8-i
  17.         if n >= 2^j then
  18.             n = n - 2^j
  19.             bin[i] = 1
  20.             String = String..screenlink.b1
  21.         else
  22.             String = String..screenlink.b0
  23.         end
  24.     end
  25.     return String
  26. end
  27.  
  28. function SetPixel(eventCode, zoneName, subZoneName, newSubzone)
  29.     mapNum = GetCurrentMapZoneIndex()
  30.     if screenlink.Playlist == 1 then mapNum = 480
  31.     elseif screenlink.Playlist == 2 then mapNum = 481
  32.     end
  33.     s = intToBinString(mapNum)
  34.     screenlinkText:SetText(s)
  35. end
  36.  
  37. function screenlink.OnAddOnLoaded(event, addonName)
  38.     mapNum = GetCurrentMapZoneIndex()
  39.     if screenlink.Playlist == 1 then mapNum = 480
  40.     elseif screenlink.Playlist == 2 then mapNum = 481
  41.     end
  42.     d("Moved to "..GetPlayerLocationName().." | mapID :"..tostring(mapNum))
  43.     s = intToBinString(mapNum)
  44.     screenlinkText:SetText(s)
  45. end
  46.  
  47. function playlist_Battle()
  48.     if screenlink.Playlist ~= 1 then
  49.         screenlink.Playlist = 1
  50.     else
  51.         screenlink.Playlist = 0
  52.     end
  53.     SetPixel(0,0,0,0)
  54. end
  55.  
  56. function playlist_BossBattle()
  57.     if screenlink.Playlist ~= 2 then
  58.         screenlink.Playlist = 2
  59.     else
  60.         screenlink.Playlist = 0
  61.     end
  62.     SetPixel(0,0,0,0)
  63. end
  64.  
  65. EVENT_MANAGER:RegisterForEvent(screenlink.name,EVENT_ZONE_CHANGED,SetPixel)
  66. EVENT_MANAGER:RegisterForEvent(screenlink.name, EVENT_ADD_ON_LOADED, screenlink.OnAddOnLoaded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement