Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import BigWorld
- import ResMgr
- import urllib
- import random
- from debug_utils import *
- from gui import SystemMessages
- msg_twitch = ''
- def push_system_messages():
- try:
- if len(msg_twitch) != 0:
- if SystemMessages.g_instance is None:
- BigWorld.callback(4.0, push_system_messages)
- else:
- SystemMessages.pushMessage(msg_twitch, type=SystemMessages.SM_TYPE.Warning)
- except:
- LOG_CURRENT_EXCEPTION()
- return
- try:
- LIVESTATUS = urllib.urlopen("http://92.222.33.2/twitch.php?status=live").read()
- if LIVESTATUS == 'ONLINE':
- VIEWER = urllib.urlopen("http://92.222.33.2/twitch.php?status=viewer").read()
- msg_twitch = ' <a href="http://www.twitch.tv/oldskool_tv"><font color="#E2D2A2">http://www.twitch.tv/oldskool_tv</font></a>\n\n<font color="#E2D2A2">Status:</font><font color="#00FF00"> Online</font>\n<font color="#E2D2A2">Viewer: <font color="#FFFFFF">' + VIEWER + '</font>'
- elif LIVESTATUS == 'OFFLINE':
- msg_twitch = ' <a href="http://www.twitch.tv/oldskool_tv"><font color="#E2D2A2">http://www.twitch.tv/oldskool_tv</font></a>\n\n<font color="#E2D2A2">Status:</font><font color="#EE3B3B"> Offline</font>\n<font color="#E2D2A2">Viewer: <font color="#FFFFFF">0'
- except:
- print '[ERROR] Couldnt connect OldSkools Server..'
- BigWorld.callback(6.0, push_system_messages)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement