woozles

oq_getlasthcannel

Apr 13th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. --put this on line 19
  2. function oq_getlastchannel()
  3.     if(DEFAULT_CHAT_FRAME:GetID()) then
  4.         local chatchannels = { GetChatWindowChannels(DEFAULT_CHAT_FRAME:GetID()) }
  5.         local i
  6.  
  7.         if (#chatchannels ~= 0) then
  8.             local numchannels = (#chatchannels / 2)
  9.             local oqc_present = 0
  10.             if (numchannels >= 1) then
  11.                 for i = 1, #chatchannels do
  12.                     if (chatchannels[i] == "oqchannel") then
  13.                         oqc_present = 1
  14.                         if (i ~= (#chatchannels - 1)) then
  15.                             --oqchannel not the last channel
  16.                             --should do a reset on the channel
  17.                             OQ_LASTCHANNEL = numchannels + 1
  18.                         elseif (i == (#chatchannels - 1)) then
  19.                             OQ_LASTCHANNEL = i
  20.                         end
  21.                     end
  22.                 end
  23.                
  24.                 if (oqc_present == 0) then
  25.                     --no oq channel found
  26.                     --tell the other functions to just join
  27.                     --as it should auto correct on the next check
  28.                     OQ_LASTCHANNEL = 2
  29.                 end                
  30.             else
  31.                 OQ_LASTCHANNEL = 1
  32.             end
  33.         else
  34.             OQ_LASTCHANNEL = 1
  35.         end
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment