Advertisement
hackedprofile

ChocolateFunction

Sep 13th, 2021 (edited)
767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.97 KB | None | 0 0
  1. import socket
  2. import time
  3. import requests
  4. from requests import get
  5. import os
  6.  
  7. # System call
  8. os.system("")
  9.  
  10. # Chocolate's hello world.
  11.  
  12.  
  13. def chocolate():
  14.     print("Hey! I'm chocolate!")
  15.  
  16.  
  17. # Display Commands, Displays to console
  18.  
  19. def display(type, string, style=0):
  20.   if type == "header":
  21.     if style == 0:
  22.       print("<----- " + string + " ----->")
  23.     else:
  24.       print(style + "<----- " + string + " ----->" + endstyle)
  25.  
  26.   if type == "error":
  27.     if style == 0:
  28.       print("ERROR [X]: " + string)
  29.     else:
  30.       print(style + "ERROR [X]: " + string + endstyle)
  31.  
  32.   if type == "warn":
  33.     if style == 0:
  34.       print("WARN [!]: " + string)
  35.     else:
  36.       print(style + "WARN [!]: " + string + endstyle)
  37.  
  38.   if type == "info":
  39.     if style == 0:
  40.       print("INFO [+]: " + string)
  41.     else:
  42.       print(style + "INFO [+]: " + string + endstyle)
  43.  
  44.   if type == "write":
  45.     if style == 0:
  46.       print(string)
  47.     else:
  48.       print(style + string + endstyle)
  49.  
  50.   if type == "capture":
  51.     if style == 0:
  52.       input(string)
  53.     else:
  54.       input(style + string + endstyle)
  55.  
  56.  
  57. # End of output
  58.  
  59. # Formatting Commands
  60.  
  61.  
  62. def linebreak():
  63.     print("")
  64.  
  65. def pause(string):
  66.     input(string)
  67.  
  68. def wait(num):
  69.     time.sleep(num)
  70.  
  71.  
  72. # End of formatting
  73.  
  74. # Data types
  75.  
  76. def getip(mode):
  77.     if mode == 1:
  78.         socket.gethostbyname(socket.gethostname())
  79.     if mode == 2:
  80.         IPAdress = get('https://api.ipify.org').text
  81.         format(IPAdress)
  82.  
  83.  
  84. def resolve(hostname):
  85.     print(socket.gethostbyname(hostname))
  86.  
  87. def http(type, website, response):
  88.     if type == "get":
  89.         x = requests.get(website)
  90.         print(x, response)
  91.  
  92.  
  93.  
  94. # Stylesheet
  95.  
  96. endstyle = '\033[0m'
  97.  
  98. class style():
  99.     BLACK = '\033[30m'
  100.     RED = '\033[31m'
  101.     GREEN = '\033[32m'
  102.     YELLOW = '\033[33m'
  103.     BLUE = '\033[34m'
  104.     MAGENTA = '\033[35m'
  105.     CYAN = '\033[36m'
  106.     WHITE = '\033[37m'
  107.     UNDERLINE = '\033[4m'
  108.     NONE = '\033[0m'
  109.  
  110.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement