init 999 python: config.label_overrides = {"login_patreon_label":"unlocked_login_patreon_label"} import urllib2 import json def RefreshPatronInfo(): persistent.uname = "" persistent.pledgecent = 0 # persistent.uimg = "" persistent.tier = "" persistent.follower = False persistent.patron_status = "" persistent.pledge_cadence = 0 _error = "" userList = json.loads('{"result": "Sucsess", "uname":"LustHunter", "curamount":500, "uimg":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOCES8B8ABQACLFzYbkkAAAAASUVORK5CYII=", "tier":"Hunter 3", "follower":true, "patron_status":"active_patron", "pledge_cadence":90001}') ret_status = userList["result"] if ret_status == "Sucsess": persistent.uname = userList["uname"] persistent.pledgecent = int(userList["curamount"])/100 persistent.tier = userList["tier"] persistent.follower = userList["follower"] persistent.patron_status = userList["patron_status"] persistent.pledge_cadence = userList["pledge_cadence"] #all time if persistent.uimg != userList["uimg"]: persistent.uimg = userList["uimg"] try: openurl = urllib2.build_opener() openurl.addheaders = [('User-agent', 'Mozilla/5.0')] page1 = openurl.open(persistent.uimg) pic = page1.read() filename = os.path.join("%s/images/"%config.gamedir, ("profile_image.png")) # Might as well just make sure you know the file extension. fout = open(filename, "wb") fout.write(pic) fout.close() # renpy.notify(["(Sucsess load image)"]) except: # renpy.notify(["(Failed load image)"]) renpy.notify(["(Failed load image)"]) renpy.notify(["(Sucsess)"])# Information from patreon has been Successfully updated!"]) else: persistent.uimg = "" renpy.notify(["(Failed)"])# Updating information from patreon Failed!"]) def RefreshPatronInfo1(): persistent.uname = "" persistent.pledgecent = 0 # persistent.uimg = "" persistent.tier = "" persistent.follower = False persistent.patron_status = "" persistent.pledge_cadence = 0 _error = "" userList = json.loads('{"result": "Sucsess", "uname":"LustHunter", "curamount":500, "uimg":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOCES8B8ABQACLFzYbkkAAAAASUVORK5CYII=", "tier":"Hunter 3", "follower":true, "patron_status":"active_patron", "pledge_cadence":90001}') ret_status = userList["result"] if ret_status == "Sucsess": persistent.uname = userList["uname"] persistent.pledgecent = int(userList["curamount"])/100 persistent.tier = userList["tier"] persistent.follower = userList["follower"] persistent.patron_status = userList["patron_status"] persistent.pledge_cadence = userList["pledge_cadence"] #all time if persistent.uimg != userList["uimg"]: persistent.uimg = userList["uimg"] try: openurl = urllib2.build_opener() openurl.addheaders = [('User-agent', 'Mozilla/5.0')] page1 = openurl.open(persistent.uimg) pic = page1.read() filename = os.path.join("%s/images/"%config.gamedir, ("profile_image.png")) # Might as well just make sure you know the file extension. fout = open(filename, "wb") fout.write(pic) fout.close() # renpy.notify(["(Sucsess load image)"]) except: # renpy.notify(["(Failed load image)"]) renpy.notify(["(Failed load image)"]) renpy.notify(["(Sucsess)"])# Information from patreon has been Successfully updated!"]) else: persistent.uimg = "" renpy.notify(["(Failed)"])# Updating information from patreon Failed!"]) label unlocked_login_patreon_label: $renpy.block_rollback() if persistent.auth_code == "": $persistent.auth_code = GenRandomAuthCode() scene allow_patreon menu: "Unlock Patreon Content": python: userList = json.loads('{"result": "Sucsess", "uname":"LustHunter", "curamount":500, "uimg":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOCES8B8ABQACLFzYbkkAAAAASUVORK5CYII=", "tier":"Hunter 3", "follower":true, "patron_status":"active_patron", "pledge_cadence":90001}') ret_status = userList["result"] renpy.notify([ret_status]) if ret_status == "Sucsess": $persistent.uname = userList["uname"] $persistent.pledgecent = int(userList["curamount"])/100 $persistent.uimg = userList["uimg"] $persistent.tier = userList["tier"] $persistent.follower = userList["follower"] $persistent.patron_status = userList["patron_status"] $persistent.pledge_cadence = userList["pledge_cadence"] python: try: openurl = urllib2.build_opener() openurl.addheaders = [('User-agent', 'Mozilla/5.0')] page1 = openurl.open(persistent.uimg) pic = page1.read() filename = os.path.join("%s/images/"%config.gamedir, ("profile_image.png")) # Might as well just make sure you know the file extension. fout = open(filename, "wb") fout.write(pic) fout.close() except: renpy.notify(["(Patreon Content Unlocked)"]) $age = "" $cur_gender = "" jump create_new_char else: "Authorization failed...are you sure you clicked Allow?" menu: "Try again": jump login_patreon_label "Skip and login to patreon later": jump create_new_char