local CONFIG = require("Scripts\\WindowTitle\\Config") BridgeFunctionAttach('MainProcThread','WindowTitleMainProc') local TimeToUpdate = 0 -- Chama a funcao da API so se ela existir nesta versao do cliente. -- Evita que uma funcao ausente derrube o script inteiro. local function ApiValor(nome) local f = _G[nome] if type(f) ~= "function" then return nil end local ok, valor = pcall(f) if ok then return valor end return nil end function WindowTitleMainProc() TimeToUpdate = TimeToUpdate + 1 if TimeToUpdate > 60 and GetMainScene() == 5 then TimeToUpdate = 0 local StringWindowTitle = CONFIG.ServerName if(CONFIG.EnableName == 1) then StringWindowTitle = StringWindowTitle .. " | " .. tostring(UserGetName()) end if(CONFIG.EnableLevel == 1) then StringWindowTitle = StringWindowTitle .. " | Lvl: " .. tostring(UserGetLevel()) end if(CONFIG.EnableMasterLevel == 1) then local v = ApiValor("UserGetMasterLevel") if v ~= nil then StringWindowTitle = StringWindowTitle .. " | ML: " .. tostring(v) end end if(CONFIG.EnableReset == 1) then local v = ApiValor("GetViewReset") if v ~= nil then StringWindowTitle = StringWindowTitle .. " | RR: " .. tostring(v) end end if(CONFIG.EnableMasterReset == 1) then local v = ApiValor("GetViewMasterReset") if v ~= nil then StringWindowTitle = StringWindowTitle .. " | MR: " .. tostring(v) end end if(CONFIG.EnableVip == 1) then local v = ApiValor("GetViewAccountLevel") if v ~= nil and CONFIG.VIPTEXT[v] ~= nil then StringWindowTitle = StringWindowTitle .. " | " .. CONFIG.VIPTEXT[v] end end for i = 1, 3 do if(CONFIG["EnableCoin" .. i] == 1) then local v = ApiValor("GetCoin" .. i) if v ~= nil then StringWindowTitle = StringWindowTitle .. " | " .. tostring(v) end end end SetWindowTitle(StringWindowTitle) end end