def start_surface_app(): script1 = """send {Lwin} sleep 500 send surface sleep 500 send {enter} sleep 2000 send #{up}""" script2 = """WinActivate, Surface sleep 750 PixelGetColor, ESurface, 593, 298, RGB ; 0x0E0E0E PixelGetColor, EBar, 57, 631, RGB ; 0xF2F2F2 PixelGetColor, EBlue, 1472, 1504, RGB ; 0x0078D7 send #4 sleep 500 send %ESurface%%EBar%%EBlue%{enter}""" BetaScript(script1) # Launched in Windows store checks while True: time.sleep(3) if str(BetaScript(script2, True)) == str("0x0E0E0E0xF2F2F20x0078D7"): return True else: p("Waiting 3 seconds...")
def update_surface_app(click): script = """WinActivate, Store sleep 500 PixelGetColor, ESurfaceLogo, 186, 247, RGB ;0x0078D7 PixelGetColor, EBlueBlob, 937, 275, RGB ;0x054ABC PixelGetColor, EInstall, 267, 929, RGB ;0xFFFFFF PixelGetColor, EComments, 943, 1194, RGB ;0xFFFFFF Send, !{tab} sleep, 500 ; 0x00787D70x054ABC0xFFFFFF0xFFFFFF Send, %ESurfaceLogo%%EBlueBlob%%EInstall%%EComments%{enter}""" for x in range(5): time.sleep(3) if str(BetaScript(script, True)) == str("0x0078D70x054ABC0xF0xF"): # BetaScript("WinActivate Store\nsleep 500\nsend {enter}") if click: BetaScript("WinActivate Store\nclick, 267, 929") return True else: p("Trying again in 3 seconds...") else: launch_store() update_surface_app()
def launch_onenote(): BetaScript( "Run C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\ONENOTE.EXE" ) time.sleep(1.5) BetaScript("send {enter}") time.sleep(1) kill("onenote.exe")
def secondary__pen_settings(): BetaScript("send {Lwin}") time.sleep(.9) BetaScript("send surface") time.sleep(.5) BetaScript("send {enter}") time.sleep(.9) set_pen_settings()
def s_05(): # Don't call any other functions, it's called in the function below # I'm just a f*****g moron and coded it like a piece of shit score = install_office() # 1 test 1 operation for x in range(2): BetaScript("send {LWin}") time.sleep(.2) BetaScript("send {Lwin}") p("Ran 3 operations 3 tests {}% pass".format((score / 1) * 100))
def setup_onenote(): BetaScript("Run C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\ONENOTE.EXE") kill() time.sleep(2) BetaScript("send {right}\nsleep 200\nsend {enter}") time.sleep(1) BetaScript("send a") time.sleep(1) kill("onenote.exe") BetaScript("send {enter}")
def launch_store(): scripts = [""";0 send, #3""", """ ;1 WinActivate, Store send #{up} sleep 500 click 2308, 129 sleep 200 send Surface""", """ WinActivate, Store sleep 300 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter}""", """ WinActivate, Store sleep, 500 PixelGetColor, ESurfaceLogo, 2194, 342, RGB MouseMove, 2194, 342 sleep 200 send #4 sleep 200 send %ESurfaceLogo% send, {enter} """ ] # Launch surface app then kill BetaScript(scripts[0]) time.sleep(1.5) kill() # Test if surface icon appears, if not, kill everything and start again while True: time.sleep(1) BetaScript(scripts[0]) # just opens store time.sleep(0.5) BetaScript(scripts[1]) # time.sleep(1) if str(BetaScript(scripts[3], True)) == str('0x0078D7'): BetaScript(scripts[2]) return else: kill("ApplicationFrameHost.exe")
def test_edge(): script = """WinActivate, Start sleep, 500 send, #1 sleep, 1500 send, ^l sleep, 200 send, ^c sleep, 200 send !{f4} sleep, 500 send, ^v{enter}""" skip = True while True: BetaScript(script) # NEVER sleep after running tests. if skip: test_result = "Norton Pengra is cool" skip = False else: test_result = input("/!\: ") p("Processing data...") if test_result != "http://aka.ms/cioS16": p("Error Code: MA2") else: break return True
def setup_to_internet(): do("control.exe /name Microsoft.NetworkAndSharingCenter", "ignore") time.sleep(.75) script = """WinActivate, Network and Sharing Center sleep, 500 IfWinActive, Network and Sharing Center send, #{up} sleep, 750 click, 690, 380 sleep, 750 send, {down 2}{enter} sleep, 500 send, MSFTOPEN{tab} sleep, 500 send, n sleep, 500 send, {tab}{space}{enter} sleep, 750 send, {tab}{enter} sleep, 500 send, !{f4}""" p("Plug in ethernet cable now if you wish to!") for x in range(3): winsound.Beep(2000, 500) time.sleep(.5) BetaScript(script)
def pin_items(): script = """ send {Lwin} sleep 900 send %s sleep 500 send {AppsKey} sleep 300 send {down %s} sleep 200 send {enter} sleep 200 send {esc} """ order = [ ["outlook 2016", 4], ["skype for business 2016", 4], ["onenote 2016", 4], ["word 2016", 4], ["excel 2016", 4], ["powerpoint 2016", 4], ] for term, menu in order: time.sleep(.2) BetaScript(script % (term, menu))
def s_09(): pin_items() pin_cortana() BetaScript("send {Lwin}") time.sleep(.9) resize_cio() p("Ran 2 checks 2 operations 5 iterations 0 tests")
def clear_tiles(): script = """ send {Lwin} sleep 500 ; Get to Tiles send {tab} sleep 200 send {right} sleep 200 send {down} sleep 200 ;send {right} ;sleep 200 send {AppsKey} sleep 200 send {down} sleep 200 send {enter} ; DEBUG: send {esc} sleep 200 ;send {esc} sleep 200 """ # If run on first time, create a file called "S_08.LCK" # If file exists, then check with user to see if startmenu is empty for x in range(27): BetaScript(script)
def s_31(): if input("Would you like to configure the start menu again? (y/N)").lower().startswith('y'): s_08() pin_cortana() BetaScript('send {LWin}') time.sleep(.9) resize_cio() if input("Would you like to configure the taskbar again? (y/N)").lower().startswith('y'): pin_items()
def winup(): update = """ send {LWin} sleep 900 send winup sleep 500 send {enter} """ BetaScript(update)
def add_sixth_block(): Get_caught_up = [ "photos 1 medium".split(), "calendar 1 medium".split(), "mail 1 medium".split(), "flipboard 1 medium".split(), ["camera", "1", "medium"], ["skype video", "1", "medium"], # "DUOLINGO_SPECIAL 1 medium".split(), # "TWITTER_SPECIAL 1 medium".split() ] script = """ send {LWin} sleep 900 send {text} sleep 500 send {AppsKey} sleep 600 {down} send {enter} """ name_group = """ send {LWin} sleep 900 click 1887 557 sleep 400 send Get caught up{enter} sleep 200 send {esc} """ for search_term, menu_index, app_size in Get_caught_up: BetaScript( script.format( LWin="{LWin}", text=search_term, AppsKey="{AppsKey}", down=("send {down}\nsleep 200\n" * int(menu_index)), enter="{enter}", )) BetaScript(name_group)
def change_weather(): script = """send, {Lwin} sleep, 1500 send, Weather App sleep, 2000 send, {enter} sleep, 2000 send, {tab 2}98052{enter}""" BetaScript(script) time.sleep(2) kill()
def resize_cio(): script = """ send {LWin} sleep 900 click 723, 303 sleep 900 send #{up} """ BetaScript(script) time.sleep(1) kill()
def accept_onenote_terms(): full = "C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\ONENOTE.EXE" BetaScript(""" send {LWin} sleep 900 send onenote 2016 sleep 500 send {enter} """) p("Don't touch anything!") time.sleep(4.5) kill()
def add_fourth_block(): Get_productive = [ ["word 2016", "3", "medium"], "powerpoint 3 medium".split(), "excel 3 medium".split(), ["skype for business 2016", "3", "medium"], ["drawboard pdf", "1", "medium"], # "SPECIAL_CORTANA 1 medium".split(), ] script = """ send {LWin} sleep 900 send {text} sleep 400 send {AppsKey} sleep 400 {down} send {enter} """ name_group = """ send {LWin} sleep 900 click 644 588 sleep 400 send Get productive{enter} sleep 200 send {esc} """ for search_term, menu_index, app_size in Get_productive: BetaScript( script.format( LWin="{LWin}", text=search_term, AppsKey="{AppsKey}", down=("send {down}\nsleep 200\n" * int(menu_index)), enter="{enter}", )) BetaScript(name_group)
def change_edge(): script = """WinActivate, Start sleep, 750 Send, #{up} sleep, 500 send, {tab} sleep 200 send, {tab} sleep 200 send, {tab} sleep 200 send, {tab} sleep 200 send, {tab} sleep 200 send, {tab} sleep 200 send, {tab} sleep 200 send, {tab} sleep 200 send {enter} sleep, 500 Send, {up} sleep, 200 send, {enter} sleep, 750 send, {tab 5} sleep, 500 send, {space} sleep, 500 send, {tab}{space} sleep, 500 send, {down 2} sleep 200 send {enter} sleep, 500 send, {tab} sleep 200 send, {tab} sleep 200 send, {enter} sleep, 500 send, +{tab} sleep, 700 send, aka.ms/cioS16{enter}""" BetaScript(script) time.sleep(1.2) kill()
def office_login(): do("powershell start microsoft-edge:http://aka.ms/365") script1 = """WinActivate, Sign in to your account PixelGetColor, EOffice, 1894, 283, RGB PixelGetColor, ELock, 358, 125, RGB PixelGetColor, EBar, 1957, 572, RGB send, !{tab} sleep, 500 send, %EOffice%%ELock%%EBar%{enter}""" script2 = """WinActivate, Sign in to your account sleep, 500 Send, {fname}.{lname}@mssummit.net{tab} sleep, 500 Send, P@ssword1 sleep 200 send {tab} sleep 200 send {space} sleep, 500 send {enter}""" while True: time.sleep(5) if str(BetaScript(script1, True)) == str('0xEB3C000x107C100xF'): break else: p("Waiting 5 seconds...") time.sleep(.75) BetaScript( script2.format(fname=usernames()['fname'], lname=usernames()['lname'], tab="{tab}", space="{space}", enter="{enter}")) return True
def add_fifth_block(): Play_and_explore = [["new york crossword", "1", "medium"], "xbox 1 medium".split(), "solitaire 1 medium".split(), ["fresh paint", "1", "medium"], ["movies & tv", "1", "medium"], "groove 1 medium".split()] script = """ send {LWin} sleep 900 send {text} sleep 400 send {AppsKey} sleep 400 {down} send {enter} """ name_group = """ send {LWin} sleep 900 click 1274 585 sleep 400 send Play and explore{enter} sleep 200 send {esc} """ for search_term, menu_index, app_size in Play_and_explore: BetaScript( script.format( LWin="{LWin}", text=search_term, AppsKey="{AppsKey}", down=("send {down}\nsleep 200\n" * int(menu_index)), enter="{enter}", )) BetaScript(name_group)
def test_tile_positions(): p("Determining Tile positions...") snowman = """Send {LWin} Sleep 750 PixelGetColor, ECalendar, 550, 133, RGB PixelGetColor, EPhotos, 886, 357, RGB PixelGetColor, ENews, 1732, 595, RGB PixelGetColor, EOnenote, 1538, 795, RGB PixelGetColor, ESurface, 832, 1084, RGB PixelGetColor, EPaint, 1347, 1069, RGB send, !{tab} sleep, 750 send, %ECalendar%%Ephotos%%ENews%%EOnenote%%ESurface%%EPaint%{enter}""" if not str(BetaScript(snowman, True)) == str("0x0078D70x0078D70xD134380x80397B0x0078D70xFCD116"): p("Tiles incorrectly configured!") return False return True
def set_username(): script = """ send #{up} sleep 500 click 547 350 sleep 500 send {fname} {lname} sleep 500 send {enter} """ do("control userpasswords", "ignore") time.sleep(2) BetaScript( script.format(fname=usernames()['fname'], lname=usernames()['lname'], enter='{enter}', up='{up}')) time.sleep(1) kill()
def launch_native_apps(): launch_weather = """send, {Lwin} sleep, 1500 send, Weather sleep, 2000 send, {enter}""" launch_store = """send, #3 sleep, 500""" launch_surface = """send {Lwin} sleep 500 send surface sleep 500 send {enter}""" for script in [launch_weather, launch_store, launch_surface]: for x in range(2): BetaScript(script) time.sleep(2 - x) kill("ApplicationFrameHost.exe")
def pin_cortana(): script = """ send {LWin} sleep 900 click 84, 1111 sleep 500 click 443 50 sleep 200 send {LWin} sleep 800 send {LWin} sleep 900 click 84, 1111 sleep 500 click 443 50 sleep 500 click 195, 293 sleep 500 click down 60 371 sleep 500 click up 1004 915 """ BetaScript(script)
def add_third_block(): pin_weather_and_money = """ send {LWin} sleep 900 send weather sleep 400 send {AppsKey} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {esc} sleep 200 send {LWin} sleep 900 send money sleep 400 send {AppsKey} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {esc} """ pin_sports_and_news = """ send {LWin} sleep 900 send sports sleep 400 send {AppsKey} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {LWin} sleep 900 send news sleep 400 send {AppsKey} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {esc} """ resize_window = """ send {LWin} sleep 900 click down 1821 654 sleep 200 click up 2351 594 sleep 200 send {esc} """ resize_weather = """ send {LWin} sleep 900 click right 1976 228 sleep 400 send {down} sleep 200 send {down} sleep 200 send {right} sleep 300 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {esc} """ resize_news = """ send {LWin} sleep 900 click right 2086 375 sleep 400 send {down} sleep 200 send {down} sleep 200 send {right} sleep 300 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {esc} """ name_group = """ send {LWin} sleep 900 click 1883 69 sleep 400 send Life at a glance sleep 200 send {enter} sleep 200 send {esc} """ Life_at_a_glance = [ "weather 1 wide".split(), "money 1 medium".split(), "sports 1 medium".split(), "news 1 wide".split(), ] BetaScript(pin_weather_and_money) time.sleep(.2) BetaScript(resize_window) time.sleep(.2) BetaScript(resize_weather) time.sleep(.2) BetaScript(pin_sports_and_news) time.sleep(.2) BetaScript(resize_news) time.sleep(.2) BetaScript(name_group)
def add_second_block(): pin_outlook = """ send {LWin} sleep 900 send Outlook sleep 400 send {AppsKey} sleep 400 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter} """ resize_window = """ send {LWin} sleep 900 click left down 1166 712 sleep 500 click left up 1730 712 """ pin_surface = """ send {LWin} sleep 200 send {LWin} sleep 900 send surface sleep 400 send {AppsKey} sleep 400 send {down} sleep 200 send {enter} sleep 500 send {LWin} sleep 700 click right 1490 160 sleep 400 send {down} sleep 200 send {down} sleep 200 send {right} sleep 200 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {LWin} """ NameGroup = """ send {LWin} sleep 900 click 1367 78 sleep 300 send Customize your device sleep 200 send {enter} sleep 200 send {LWin} """ pin_store_and_settings = """ send {Lwin} sleep 900 send store sleep 400 send {AppsKey} sleep 400 send {down} ; Unlike every other native app, the option is 2 down sleep 200 send {down} ; I think it's because it's pinned to the taskbar sleep 200 send {enter} sleep 200 send {LWin} sleep 900 send settings sleep 400 send {AppsKey} sleep 400 send {down} sleep 200 send {enter} sleep 200 send {esc} """ resize_store = """ send {LWin} sleep 900 click right 1258 409 sleep 400 send {down} sleep 200 send {down} sleep 200 send {right} sleep 200 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter} sleep 200 send {esc} """ Customize_your_device = [ "outlook 3 medium".split(), "surface 1 wide".split(), "store 1 wide".split(), "settings 1 medium".split() ] BetaScript(pin_outlook) BetaScript(resize_window) BetaScript(pin_surface) time.sleep(0.2) BetaScript(pin_store_and_settings) BetaScript(resize_store) time.sleep(0.2) BetaScript(NameGroup)
def add_first_block(): script = """ send {LWin} sleep 900 send {text} sleep 400 send {AppsKey} sleep 400 {down} send {enter} """ resize_script = """ send {LWin} sleep 750 click, right, 672, 134 sleep 500 send {down} sleep 200 send {down} sleep 200 send {right} sleep 200 send {size_down} send {enter} """ name_group = """ ;send {Lwin} click 607 66 sleep 800 send Welcome to the CIO Summit{!}{enter} sleep 200 send {LWin} """ CIOApp = """ send {LWin} sleep 900 click 157, 1111 sleep 400 click 437 59 sleep 500 send {LWin} sleep 1000 send {LWin} sleep 900 click 157, 1111 sleep 400 click down 498 230 sleep 200 click up 498 624 sleep 200 click right 62 529 sleep 400 send {down} sleep 200 send {enter} sleep 200 send {esc} """ Welcome_to_the_CIO_Summit_BANG = [ ["north america cio summit apportal", "1", "4"], # ["onenote 2016", "3", "medium"], "edge 2 medium".split(), ] # BetaScript(CIOApp) for search_term, menu_index, app_size in Welcome_to_the_CIO_Summit_BANG: time.sleep(.2) BetaScript( script.format( LWin="{LWin}", text=search_term, AppsKey="{AppsKey}", down=("send {down}\nsleep 200\n" * int(menu_index)), enter="{enter}", )) # Resize CIO App BetaScript( resize_script.format(LWin="{LWin}", down="{down}", right="{right}", enter="{enter}", size_down=("send {down}\nsleep 200\n" * int(4)))) # Add onenote back up BetaScript( script.format( LWin="{LWin}\nsleep 200\nsend {LWin}", text="Onenote 2016", AppsKey="{AppsKey}", down=("send {down}\nsleep 200\n" * int(3)), enter="{enter}\nsleep 200\nsend {lwin}", )) time.sleep(.2) BetaScript(name_group) BetaScript("send {esc}")
def set_pen_settings(): test = """WinActivate, Surface sleep 500 send #{up} sleep 500 PixelGetColor, UError, 1630, 1568 sleep 200 send !{tab} sleep 500 send %UError%{enter} """ script = ["""WinActivate, Surface sleep, 500 send #{up} sleep 500 send {down} sleep 200 send {enter} """, """ WinActivate, Surface sleep 500 send #{up} sleep 500 send {tab} sleep 200 send {tab} sleep 200 send {enter} sleep 200 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {down} sleep 200 send {enter} sleep 400 send {tab} sleep 200 send {enter} sleep 1000 send C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\ONENOTE.EXE sleep 200 send {enter}"""] BetaScript(script[0]) time.sleep(2) while True: if str(BetaScript(test, True)) == str('0xF'): break else: input("PLEASE PAIR PEN! HIT {ENTER} WHEN YOU DO.") time.sleep(3) BetaScript(script[1]) time.sleep(2) kill("SurfaceApp.exe", True)