Advertisement
Guest User

code

a guest
Nov 26th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.25 KB | None | 0 0
  1. GraphicsWindow.Show() 'Show graphics window
  2. GraphicsWindow.Title = "The Student Log" 'Sets title of graphics window
  3. GraphicsWindow.Height = 1080 'Sets height of graphics window
  4. GraphicsWindow.Width = 1920 'Sets width of graphics window
  5. GraphicsWindow.BackgroundColor = "Black" 'Sets background colour to black
  6. GraphicsWindow.BrushColor = "Yellow"
  7. GraphicsWindow.FontSize=25 'Sets font size
  8. GraphicsWindow.DrawText(50, 10, "CSGOLD") 'Draws title on graphics window
  9. GraphicsWindow.BrushColor = "Yellow" 'Sets brush colour to
  10. GraphicsWindow.FillRectangle(0, 100, 100, 800)
  11. rotateshape = "C:\Users\Charlie\Pictures\Saved Pictures\PC Jokes\wheel.png"
  12. image=Shapes.AddImage(rotateshape)
  13. Shapes.Move(image, 200, 100)
  14. GraphicsWindow.BrushColor = "Green"
  15. GraphicsWindow.DrawTriangle(400, 100, 390, 90, 410, 90)
  16. GraphicsWindow.FillTriangle(400, 100, 390, 90, 410, 90)
  17.  
  18. user[1] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username1.txt")
  19. user[2] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username2.txt")
  20. user[3] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username3.txt")
  21. user[4] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username4.txt")
  22. user[5] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username5.txt")
  23. user[6] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username6.txt")
  24. user[7] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username7.txt")
  25. user[8] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username8.txt")
  26.  
  27. password[1] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password1.txt")
  28. password[2] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password2.txt")
  29. password[3] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password3.txt")
  30. password[4] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password4.txt")
  31. password[5] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password5.txt")
  32. password[6] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password6.txt")
  33. password[7] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password7.txt")
  34. password[8] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password8.txt")
  35.  
  36. balance[1] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance1.txt")
  37. balance[2] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance2.txt")
  38. balance[3] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance3.txt")
  39. balance[4] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance4.txt")
  40. balance[5] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance5.txt")
  41. balance[6] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance6.txt")
  42. balance[7] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance7.txt")
  43. balance[8] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance8.txt")
  44.  
  45. bet[1] = 0
  46. bet[2] = 0
  47. bet[3] = 0
  48. bet[4] = 0
  49. bet[5] = 0
  50. bet[6] = 0
  51. bet[7] = 0
  52. bet[8] = 0
  53.  
  54. bettype[1] = "Nothing"
  55. bettype[2] = "Nothing"
  56. bettype[3] = "Nothing"
  57. bettype[4] = "Nothing"
  58. bettype[5] = "Nothing"
  59. bettype[6] = "Nothing"
  60. bettype[7] = "Nothing"
  61. bettype[8] = "Nothing"
  62.  
  63. GraphicsWindow.FontSize=15
  64. GraphicsWindow.BrushColor = "black"
  65. GraphicsWindow.FillRectangle(800, 300, 300, 470)
  66. GraphicsWindow.BrushColor="#ffd400"
  67.  
  68. GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
  69. GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
  70. GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
  71. GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
  72. GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
  73. GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
  74. GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
  75. GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
  76.  
  77.  
  78. GraphicsWindow.BrushColor = "Black"
  79. Controls.AddButton("Place Bet", 800, 200)
  80. Controls.ButtonClicked = OnButtonClicked
  81.  
  82.  
  83.  
  84.  
  85. Sub OnButtonClicked
  86. TextWindow.Show()
  87. TextWindow.Clear()
  88. TextWindow.WriteLine("Who are you?")
  89. For i = 1 To 8
  90. TextWindow.WriteLine(i + " = " + user[i])
  91. EndFor
  92. username = TextWindow.Read()
  93.  
  94. If username < 9 And username > 0 Then
  95. TextWindow.WriteLine("Ok, " + user[username] + " What is your password?")
  96. pass = TextWindow.Read()
  97. If pass = password[username] Then
  98. TextWindow.Clear()
  99. TextWindow.WriteLine("Which colour would you like to place a bet on, " + user[username] + "?")
  100. TextWindow.WriteLine("G = Grey, B = Blue, R = Red, X = Gold")
  101. colourplace = TextWindow.Read()
  102. If colourplace = "G" Then
  103. TextWindow.WriteLine("Grey has been chosen.")
  104. TextWindow.WriteLine("Your balance is: " + balance[username])
  105. TextWindow.WriteLine("How much do you want to bet?")
  106. bet[username] = TextWindow.Read()
  107. If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
  108. TextWindow.WriteLine("Bet Accepted")
  109. bettype[username] = "Grey"
  110. balance[username] = balance[username]-bet[username]
  111. TextWindow.Hide()
  112. GraphicsWindow.FontSize=15
  113. GraphicsWindow.BrushColor = "black"
  114. GraphicsWindow.FillRectangle(800, 300, 300, 470)
  115. GraphicsWindow.BrushColor="#ffd400"
  116. For i = 1 to 8
  117. GraphicsWindow.DrawBoundText(800, 240+i*60, 400, user[i] + " : " + bet[i] + " on " + bettype[i] + " " +" Remaining Balance: " + balance[i])
  118. EndFor
  119. Else
  120. bet[username] = 0
  121. TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
  122. TextWindow.Pause()
  123. TextWindow.Hide()
  124. EndIf
  125. Else
  126. If colourplace = "B" Then
  127. TextWindow.WriteLine("Blue has been chosen.")
  128. TextWindow.WriteLine("Your balance is: " + balance[username])
  129. TextWindow.WriteLine("How much do you want to bet?")
  130. bet[username] = TextWindow.Read()
  131. If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
  132. TextWindow.WriteLine("Bet Accepted")
  133. bettype[username] = "Blue"
  134. balance[username] = balance[username]-bet[username]
  135. TextWindow.Hide()
  136. GraphicsWindow.FontSize=15
  137. GraphicsWindow.BrushColor = "black"
  138. GraphicsWindow.FillRectangle(800, 300, 300, 470)
  139. GraphicsWindow.BrushColor="#ffd400"
  140. GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
  141. GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
  142. GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
  143. GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
  144. GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
  145. GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
  146. GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
  147. GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
  148. Else
  149. bet[username] = 0
  150. TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
  151. TextWindow.Pause()
  152. TextWindow.Hide()
  153. EndIf
  154. Else
  155. If colourplace = "R" Then
  156. TextWindow.WriteLine("Red has been chosen.")
  157. TextWindow.WriteLine("Your balance is: " + balance[username])
  158. TextWindow.WriteLine("How much do you want to bet?")
  159. bet[username] = TextWindow.Read()
  160. If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
  161. TextWindow.WriteLine("Bet Accepted")
  162. bettype[username] = "Red"
  163. balance[username] = balance[username]-bet[username]
  164. TextWindow.Hide()
  165. GraphicsWindow.FontSize=15
  166. GraphicsWindow.BrushColor = "black"
  167. GraphicsWindow.FillRectangle(800, 300, 300, 470)
  168. GraphicsWindow.BrushColor="#ffd400"
  169. GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
  170. GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
  171. GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
  172. GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
  173. GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
  174. GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
  175. GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
  176. GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
  177. Else
  178. bet[username] = 0
  179. TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
  180. TextWindow.Pause()
  181. TextWindow.Hide()
  182. EndIf
  183. Else
  184. If colourplace = "X" Then
  185. TextWindow.WriteLine("Gold has been chosen.")
  186. TextWindow.WriteLine("Your balance is: " + balance[username])
  187. TextWindow.WriteLine("How much do you want to bet?")
  188. bet[username] = TextWindow.Read()
  189. If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
  190. TextWindow.WriteLine("Bet Accepted")
  191. bettype[username] = "Gold"
  192. balance[username] = balance[username]-bet[username]
  193. TextWindow.Hide()
  194. GraphicsWindow.FontSize=15
  195. GraphicsWindow.BrushColor = "black"
  196. GraphicsWindow.FillRectangle(800, 300, 300, 470)
  197. GraphicsWindow.BrushColor="#ffd400"
  198. GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
  199. GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
  200. GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
  201. GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
  202. GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
  203. GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
  204. GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
  205. GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
  206. Else
  207. bet[username] = 0
  208. TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
  209. TextWindow.Pause()
  210. TextWindow.Hide()
  211. EndIf
  212. Else
  213. TextWindow.WriteLine("This is not a valid option")
  214. TextWindow.Pause()
  215. TextWindow.Hide()
  216. EndIf
  217. EndIf
  218. EndIf
  219. EndIf
  220. Else
  221. TextWindow.WriteLine("INCORRECT PASSWORD")
  222. TextWindow.Pause()
  223. TextWindow.Hide()
  224. EndIf
  225. Else
  226. TextWindow.WriteLine("This is not a valid option")
  227. TextWindow.Pause()
  228. TextWindow.Hide()
  229. EndIf
  230. EndSub
  231.  
  232.  
  233.  
  234.  
  235.  
  236. GraphicsWindow.MouseDown = OnMouseInput
  237. Sub OnMouseInput 'Starts a subroutine when the mouse is pressed
  238.  
  239. randomnumber = Math.GetRandomNumber(54)
  240.  
  241. If randomnumber>0 And randomnumber<27 Then
  242. spin = 2200
  243. For i = 1 To 8
  244. If bettype[i] = "Grey" Then
  245. balance[i] = balance[i] + bet[i]*2
  246. bet[i] = 0
  247. Else
  248. blank=0
  249. EndIf
  250. EndFor
  251. Else
  252. If randomnumber>26 And randomnumber<45 Then
  253. spin = 2050
  254. For i = 1 To 8
  255. If bettype[i] = "Blue" Then
  256. balance[i] = balance[i] + bet[i]*3
  257. bet[i] = 0
  258. Else
  259. blank=0
  260. EndIf
  261. EndFor
  262. Else
  263. If randomnumber>44 And randomnumber<54 Then
  264. spin = 2350
  265. For i = 1 To 8
  266. If bettype[i] = "Red" Then
  267. balance[i] = balance[i] + bet[i]*5
  268. bet[i] = 0
  269. Else
  270. blank=0
  271. EndIf
  272. EndFor
  273. Else
  274. If randomnumber=54 Then
  275. spin = 2155
  276. For i = 1 To 8
  277. If bettype[i] = "Gold" Then
  278. balance[i] = balance[i] + bet[i]*50
  279. bet[i] = 0
  280. Else
  281. blank=0
  282. EndIf
  283. EndFor
  284. Else
  285. GraphicsWindow.DrawBoundText(100, 100, 100, "Fail")
  286. EndIf
  287. EndIf
  288. EndIf
  289. EndIf
  290. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance1.txt", 1, balance[1])
  291. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance2.txt", 1, balance[2])
  292. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance3.txt", 1, balance[3])
  293. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance4.txt", 1, balance[4])
  294. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance5.txt", 1, balance[5])
  295. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance6.txt", 1, balance[6])
  296. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance7.txt", 1, balance[7])
  297. File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance8.txt", 1, balance[8])
  298. For i = 0 To spin
  299. Shapes.Rotate(image, 1 * i)
  300. Program.Delay(2)
  301. EndFor
  302. EndSub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement