I´ve managed to get an Service record message tab wich notifies about live streaming Clan Members.
I would like to annouce live streaming with a little message wich is working by now.
Last thing is i would like this message not to show up if the selected streamer is offline wich should be handled witch the else function.
import BigWorld
import os
from debug_utils import *
import GUI
import ResMgr
import json
import urllib2
import urllib, socket
from xml.dom.minidom import parseString
from subprocess import check_output
import json
ap_cr_channel = '<a href="event:http://www.twitch.tv/jeff_ich_heisse_jeff_"><font color="#E2D2A2">Watch now</font></a>'
try:
url = 'http://cloud1.odemmortis.com/scripts/jeffapi.php'
file = urllib.urlopen('http://cloud1.odemmortis.com/scripts/jeffapi.php')
data = file.read()
file.close()
except:
LOG_ERROR('Unable to access Remote File')
from gui import SystemMessages
sys_msg = ''
def modpack():
try:
if len(sys_msg) != 0:
if SystemMessages.g_instance is None:
BigWorld.callback(4.0, modpack)
elif data == 'online':
SystemMessages.pushMessage(sys_msg, type=SystemMessages.SM_TYPE.Information)
else:
SystemMessages.pushMessage(sys_msg, type=SystemMessages.SM_TYPE.Warning)
except:
LOG_CURRENT_EXCEPTION()
return
if data == 'online':
sys_msg = '<font color="#7FCF00">Jeff ist live ON AIR ' + ap_cr_channel
else:
sys_msg = '<font color="#FF0000">Jeff ist OFFLINE!'
from Account import Account
def _First(msg):
SystemMessages.pushMessage(msg, SystemMessages.SM_TYPE.Warning)
def new_onBecomePlayer(self):
old_onBecomePlayer(self)
_First(sys_msg)
old_onBecomePlayer = Account.onBecomePlayer
Account.onBecomePlayer = new_onBecomePlayer
could anybody help me with this ?
I tried to simply remove the red marked else function but the result wasnt that great
else: sys_msg = '<font color="#FF0000">Jeff ist OFFLINE!'
Long story shor:
Would like to have an message when streamer is online and no message if he is not.
Thanks a lot guys