Advertisement
Guest User

Vinesauce BRB source code

a guest
Jan 31st, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.30 KB | None | 0 0
  1. #I wrote this in literally two hours, please don't judge me on the fucked up style
  2.  
  3. import itertools
  4.  
  5. import copy
  6. import random
  7.  
  8. import math
  9.  
  10. import pyconsolegraphics as pc
  11. import pyconsolegraphics.ezmode as ez
  12.  
  13. def vinesauce():
  14.     framenum = 0
  15.  
  16.     term = pc.Terminal((119,40),font = "Fixedsys Excelsior 3.01")
  17.     gfx = ez.EZMode(term)
  18.  
  19.     brbcursor = pc.Cursor(term, autoscroll=False)
  20.     brbendpos = term.bottomright
  21.  
  22.     loadingbartotal = 2 * (term.width // 3)
  23.     loadingbarloaded = 0
  24.  
  25.     brbcursor.fgcolor = (64, 64, 64)
  26.  
  27.     statusprintstatus = 0
  28.     statustimer = 300
  29.  
  30.     starglyphs= itertools.cycle(["|", "/", "-", "\\"])
  31.  
  32.     redscreen = False
  33.     redscreenprinted = False
  34.  
  35.     statuses = [
  36.         "Downloading memes off Twitter...",
  37.         "Unboxing Cpt. Picard's ballsack...",
  38.         "Admonishing chat...",
  39.         "Fucking with XSplit...",
  40.         "PROTIP: Upload art _DURING_ the stream!",
  41.         "Salty cunts...",
  42.         "Queueing up quack.wav...",
  43.         "Whipping enslaved former villagers...",
  44.         "Hiding Cherry r34...",
  45.         "Cyclops edging... ... ... ... ... ... ... ... ... ... ... ... ... ...",
  46.         "PROTIP: Vinny takes like a week to respond to emails. Dude's busy.",
  47.         "Choosing new emotes...",
  48.         "Retrieving more seltzer...",
  49.         "Reticulating splines...",
  50.         "Putting head on Bono's biddy...",
  51.         "PROTIP: Kappa",
  52.         "Disposing of Oreos...",
  53.         "Practicing MAHINAPEAAAAAAAA...",
  54.         "Convincing Reggie and Iwata to leave the house...",
  55.         "Searching for the Buvvins...",
  56.         "Watching Red Letter Media...",
  57.         "Queueing up new meme videos...",
  58.         "PROTIP: Don't fuck with Mr. Dink's grill. He'll fucking kill you.",
  59.         "Deleting game request emails...",
  60.         "Indulging apiophillia..."
  61.     ]
  62.     origstatuses = copy.copy(statuses)
  63.     currentstatus = statuses.pop(0)
  64.  
  65.     for idx, thecell in enumerate(term):
  66.         if idx % 2:
  67.             thecell.character = "r"
  68.         else:
  69.             thecell.character = "b"
  70.  
  71.     fgcolors = [ [(0,0,0) for y in range(-1, term.height+1)]
  72.                     for x in range(-1, term.width+1) ]
  73.  
  74.     gol = [[False for y in range(term.height)]
  75.                       for x in range(term.width)]
  76.  
  77.     redscreencounter = 0
  78.  
  79.     while True:
  80.         if not redscreen:
  81.             for t in range(150 + random.randint(50,150)):
  82.                 brbcursor.fgcolor = fgcolors[brbcursor.x+1][brbcursor.y+1]
  83.                 try:
  84.                     if brbcursor.x % 2:
  85.                         brbcursor.smart_writechar("r")
  86.                     else:
  87.                         brbcursor.smart_writechar("b")
  88.                 except pc.VerticalCursorOverflowError:
  89.                     brbcursor.pos=(0,0)
  90.  
  91.                     oldfgcolors = copy.deepcopy(fgcolors)
  92.                     amp = 13
  93.                     for x in range(1, term.width+1):
  94.                         for y in range(1, term.height+1):
  95.                             rtotal = btotal = gtotal = 0
  96.                             for dx in (-1, 0, 1):
  97.                                 for dy in (-1, 0, 1):
  98.                                     r, g, b = oldfgcolors[x+dx][y+dy]
  99.                                     rtotal += r ** amp
  100.                                     gtotal += g ** amp
  101.                                     btotal += b ** amp
  102.                             if random.randint(1,2000) == 1:
  103.                                 fgcolors[x][y]=random.randint(0,255),random.randint(0,255),random.randint(0,255)
  104.                             else:
  105.                                 newr = math.floor(math.pow(rtotal / 9, 1 / amp) * 0.94)
  106.                                 newg = math.floor(math.pow(gtotal / 9, 1 / amp) * 0.94)
  107.                                 newb = math.floor(math.pow(btotal / 9, 1 / amp) * 0.94)
  108.                                 fgcolors[x][y] = newr, newg, newb
  109.  
  110.             if random.randint(1, 5) != 1:
  111.                 loadingbarloaded += random.randint(1, 2)
  112.             if loadingbarloaded > loadingbartotal:
  113.                 loadingbarloaded = -loadingbartotal
  114.             if loadingbarloaded >= 0:
  115.                 loadingbar = ("█" * loadingbarloaded) + ("░" * (loadingbartotal - loadingbarloaded))
  116.             else:
  117.                 loadingbar = ("░" * (loadingbartotal - abs(loadingbarloaded)) + ("█" * (abs(loadingbarloaded))))
  118.             gfx.center_line_at(loadingbar, "center", fgcolor = (167, 167, 167))
  119.  
  120.  
  121.             if statusprintstatus < len(currentstatus):
  122.                 statusprintstatus += 1
  123.             elif statustimer:
  124.                 statustimer -= 1
  125.             else:
  126.                 statustimer = 300
  127.                 statusprintstatus = 0
  128.                 try:
  129.                     currentstatus = statuses.pop(0)
  130.                 except IndexError:
  131.                     redscreen=True
  132.                     redscreenprinted=False
  133.                     redscreencounter = 0
  134.                     brbcursor.pos=(0,0)
  135.                     statuses = copy.copy(origstatuses)
  136.                     currentstatus = statuses.pop(0)
  137.             gfx.put_line_at(" " * (term.width // 3 * 2), "centerleft", (term.width // 6, 0),
  138.                             fgcolor=(0, 0, 0), bgcolor=(220, 220, 220))
  139.             gfx.put_line_at(currentstatus[:statusprintstatus], "centerleft", (term.width // 6, 0),
  140.                             fgcolor = (0, 0, 0), bgcolor = (220, 220, 220))
  141.             gfx.put_line_at("Vinesauce is loading..."+next(starglyphs), "centerleft", (term.width // 6, -2),
  142.                             fgcolor=(44, 255, 44), bgcolor=(0, 0, 0))
  143.         else:
  144.             redscreencounter += 1
  145.             if not redscreenprinted:
  146.                 brbcursor.fgcolor = (64, 0, 0)
  147.                 brbcursor.bgcolor = (0, 0, 0)
  148.                 try:
  149.                     for t in range(100):
  150.                         brbcursor.smart_writechar("@")
  151.                 except pc.VerticalCursorOverflowError:
  152.                     redscreenprinted=True
  153.             else:
  154.                 if redscreencounter % 30 < 15:
  155.                     scrotbg = (255, 0, 0)
  156.                 else:
  157.                     scrotbg = (127, 0, 0)
  158.                 if redscreencounter < (30 * 8):
  159.                     gfx.center_line_at("!!! SCROTAL EMERGENCY !!!", "center", fgcolor=(0, 0, 0), bgcolor = scrotbg)
  160.                 if (30 * 4) < redscreencounter < (30 * 8) :
  161.                     gfx.center_line_at("System restarting..."+next(starglyphs), "center", (0, 1), fgcolor=(200, 0, 0), bgcolor=(0,0,0))
  162.  
  163.                 if redscreencounter == (30 * 8):
  164.                     brbcursor.pos=(0,0)
  165.                     brbcursor.fgcolor=(255,255,255)
  166.                     brbcursor.bgcolor=(0,0,0)
  167.  
  168.                 if redscreencounter > (30 * 8):
  169.                     for t in range(100):
  170.                         try:
  171.                             if t % 2:
  172.                                 brbcursor.smart_writechar("r")
  173.                             else:
  174.                                 brbcursor.smart_writechar("b")
  175.                         except pc.VerticalCursorOverflowError:
  176.                             break
  177.  
  178.                 if redscreencounter > (30 * 10):
  179.                     brbcursor.pos=(0,0)
  180.                     redscreen=False
  181.  
  182.         term.draw()
  183.  
  184. if __name__ == "__main__":
  185.     vinesauce()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement