Advertisement
Guest User

gago

a guest
Nov 8th, 2019
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.61 KB | None | 0 0
  1. import random
  2. import time
  3. import webbrowser
  4. from datetime import date
  5. import os
  6.  
  7.  
  8. botName = "NiBBot"
  9. botAge = "1 year old"
  10. botAdress = "Inside the internet"
  11. botBirthDate = "Today"
  12. yourName = "John Mark S. Payas"
  13. yourNickName = "John"
  14. yourAge = "16 years old"
  15. yourAdress = "Old Boso-Boso Brgy. San Jose Antipolo City"
  16. yourBirthDate = "September 30, 2000"
  17. userChat = ""
  18. chat = ""
  19. def RPS():
  20. computer = random.randint(1,3)
  21. pscore = 0
  22. cscore = 0
  23. print("Rock, Paper, Scissor")
  24. pname = input("Player name: ")
  25. cname = input("Computer name: ")
  26. rounds = int(input("Best of: "))
  27. print("Let the battle begin")
  28. print(pname, " vs ", cname)
  29. print("Player Score: ",pscore, "Computer Score: ",cscore)
  30. print("Choose:", "\n1. Rock ", "\n2. Paper" , "\n3. Scissor")
  31. iter = 0
  32. while (rounds >= iter):
  33. choice = int(input("Choose: "))
  34. if choice == 1:
  35. if computer == 2:
  36. print("Computer choose: Paper")
  37. print("Computer Wins!")
  38. cscore += 1
  39. print(pname, " score: ",pscore , cname, " score: ", cscore)
  40. iter += 1
  41. else:
  42. print("Computer choose: Scissor")
  43. print("Player Wins!")
  44. pscore += 1
  45. print(pname, " score: ",pscore , cname, " score: ", cscore)
  46. iter += 1
  47. elif choice == 2:
  48. if computer == 3:
  49. print("Computer choose: Scissor")
  50. print("Compute Wins")
  51. cscore += 1
  52. print(pname, " score: ",pscore , cname, " score: ", cscore)
  53. iter += 1
  54. else:
  55. print("Player Wins!")
  56. pscore += 1
  57. print(pname, " score: ",pscore , cname, " score: ", cscore)
  58. iter += 1
  59. elif choice == 3:
  60. if computer == 1:
  61. print("Computer choose: Rock")
  62. print("Player Wins!")
  63. pscore += 1
  64. print(pname, " score: ",pscore , cname, " score: ", cscore)
  65. iter += 1
  66. else:
  67. print("Computer Wins!")
  68. cscore += 1
  69. print(pname, " score: ",pscore , cname, " score: ", cscore)
  70. iter += 1
  71. else:
  72. print("Congratulations, ", "\nFinal Score : ", pname, " ", pscore, " ", cname, " ", cscore)
  73. again = input("Do you want to continue? [Y]yes [N]no:")
  74. round +=1
  75. if(again == "Y"):
  76. iter = 0
  77. else:
  78. print(botName, ": Exiting Game.....")
  79. time.sleep(2)
  80. userChat();
  81. def randomNumber(rangeNum, modeCount):
  82. randomNum = []
  83. randomNum.clear()
  84. for num in range(50):
  85. random1 = random.randint(1, modeCount)
  86. if randomNum.count(random1) > 0:
  87. randomNum.remove(random1)
  88. elif len(randomNum) == rangeNum:
  89. break
  90. else:
  91. randomNum.append(random1)
  92. return randomNum
  93. def game(gameModes, counts, price, prevWin, countMode):
  94. global priceAll
  95. lotto = []
  96. print("-------------------------------------Welcome to "+gameModes+" Lotto--------------------------------------", "\nLotto price money: " + str(price))
  97. for num in range(1000):
  98. count = len(lotto)
  99. if count < 1:
  100. number = int(input("Enter a number("+str(counts + 1)+"): \n"))
  101. else:
  102. number = int(input("Enter next number("+str(counts + 1 - count)+"): \n"))
  103. if lotto.count(number) > 0:
  104. print("ERROR! Cannot enter the same value")
  105. elif number > countMode:
  106. print("ERROR! Cannot enter number higher than "+str(countMode))
  107. elif number <= 0:
  108. print("ERROR! Cannot enter number less than 1")
  109. elif count >= counts:
  110. lotto.append(number)
  111. print("------------------------------------------------------------------------------------------------\n" + "Here are your entered number: " + str(lotto), "\nWinning balls are shuffling...")
  112. time.sleep(2)
  113. print("Here are winning numbers!!", str(prevWin), "\n------------------------------------------------------------------------------------------------", "\nYour numbers: " + str(lotto), "\nWinning numbers: " + str(prevWin))
  114. time.sleep(2)
  115. if str(prevWin) == str(lotto):
  116. print("YOU WIN!")
  117. if counts == 2:
  118. priceAll = 10000
  119. elif counts == 5:
  120. priceAll = 1000
  121. print("Curent price: " + str(priceAll))
  122. time.sleep(2)
  123. else:
  124. priceAll = price + 500
  125. print("------------------------------------------------------------------------------------------------\n" + "AW SNAP! TRY AGAIN NEXT TIME!!", "\nCurent price: " + str(priceAll))
  126. time.sleep(2)
  127. ask = input("------------------------------------------------------------------------------------------------\n" + "Try Again? (Y/N)\n")
  128. if ask == "Y" or ask == "y":
  129. return price
  130. elif ask == "N" or ask == "n":
  131. print(botName, ": Exiting Game.....")
  132. time.sleep(2)
  133. userChat()
  134. elif number <= countMode:
  135. lotto.append(number)
  136. elif "AYOKO NA" in number:
  137. print(botName, ": Exiting Game.....")
  138. time.sleep(2)
  139. userChat()
  140. print(lotto)
  141. def MainLotto():
  142. print("--------------------------------------Welcome to IT-Lotto!--------------------------------------")
  143. a = 1
  144. price642, price645, price649, price3 = 1000, 1000, 1000, 10000
  145. while True:
  146. print("------------------------------------------------------------------------------------------------"+"\nYesterday's Winning numbers:")
  147. if a == True:
  148. print("In 6/42: ",randomNumber(6,42)," Price: ",price642,"\nIn 6/45: ",randomNumber(6,45)," Price: ",price645, "\nIn 6/49: ",randomNumber(6,49)," Price: ",price649, "\nIn Lucky Three: ",randomNumber(3,9),"Price: ",price3)
  149. else:
  150. print("In 6/42: ", str(prevWin1), " Price: ", price642, "\nIn 6/45: ", str(prevWin2), " Price: ", price645, "\nIn 6/49: ", str(prevWin3), " Price: ", price649, "\nIn Lucky3: ", str(prevWin4), "Price: ", price3)
  151. today = date.today()
  152. prevWin1, prevWin2, prevWin3, prevWin4 = randomNumber(6, 42), randomNumber(6,45), randomNumber(6,49), randomNumber(3, 9)
  153. mode = int(input("----------------------------------- Today's date:"+ str(today)+ "-------------------------------------" +"\nSELECT PLAYING MODE:"+"\n(1) - 6/42 Lotto (2) - 6/45 Mega Lotto (3) - 6/49 Super Lotto (4) - Lucky Three Numbers :\n"))
  154. if mode == 1:
  155. game("6/42", 5, price642, prevWin1,42)
  156. price642 = priceAll
  157. elif mode == 2:
  158. game("6/45", 5, price645, prevWin2,45)
  159. price645 = priceAll
  160. elif mode == 3:
  161. game("6/49", 5, price649, prevWin3,49)
  162. price649 = priceAll
  163. elif mode == 4:
  164. game("Lky3", 2, price3, prevWin4,9)
  165. price3 = priceAll
  166. a = False
  167.  
  168. def botIntro():
  169. print(botName,": Hello Nibba!")
  170. time.sleep(2)
  171. print(botName, "is typing......")
  172. time.sleep(2)
  173. print(botName, ": What can i do for you?")
  174. userChat()
  175.  
  176. def botLibrary(chat):
  177. print(botName, "is typing......")
  178. time.sleep(1)
  179. if "MY NAME" in chat:
  180. print(botName, ": Your name is", yourName)
  181. elif "MY AGE" in chat:
  182. print(botName, ": You are", yourAge)
  183. elif "MY BIRTH" in chat:
  184. print(botName, ":", yourBirthDate, "is your bithday")
  185. elif "MY ADDRESS" in chat:
  186. print(botName, ": you live ", yourAdress)
  187. elif "YOUR BIRTH" in chat:
  188. print(botName, ":" , botBirthDate)
  189. elif "YOUR AGE" in chat or "OLD ARE YOU" in chat:
  190. print(botName,": I was born", botBirthDate)
  191. elif "YOUR ADDRESS" in chat:
  192. print(botName,": I live in", botAdress)
  193. elif "SEARCH" in chat:
  194. print(botName, ": What do you want to search master?")
  195. search = input(yourNickName +": ")
  196. webbrowser.open_new_tab("https://www.google.com/search?btrG=1&q=%s" % search)
  197. print(botName, ": Showing results for ", search)
  198. elif "PLAY GAME" in chat:
  199. print(botName, ": What Game you want to play?")
  200. print(botName, "is typing......")
  201. time.sleep(1)
  202. print(botName, ": You can play Rock Paper Scissor or Lotto")
  203. game = input(yourNickName + ": ").upper()
  204. if "LOTTO" in game:
  205. print(botName, ": Opening Lotto Game.....")
  206. time.sleep(2)
  207. MainLotto()
  208. elif "ROCK PAPER SCISSOR" in game or "RPS" in game:
  209. print(botName, ": Opening Rock Paper Scissor.....")
  210. time.sleep(2)
  211. RPS()
  212. elif "TRASH" in chat or "RECYCLE" in chat or "BASURA" in chat:
  213. print(botName, ": Cleaning Recycle Bin.....")
  214. time.sleep(1)
  215. os.system('cmd /c "rd /s c:\$Recycle.Bin"')
  216. print(botName, ": Done!")
  217. elif "WEBSITE" in chat:
  218. print(botName, ": What website you want to open master?")
  219. search = input(yourNickName + ": ")
  220. webbrowser.open_new_tab(search)
  221. print(botName, ": Showing results for ", search)
  222. else:
  223. print(botName, ": Sorry master, it's not on my database yet")
  224. def userChat():
  225. while True:
  226. userChat = input(yourNickName + ": ").upper()
  227. botLibrary(userChat)
  228. botIntro()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement