Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.39 KB | None | 0 0
  1. @name CPU
  2. @inputs Ping_in CPU_CAN_WRITE Screen:wirelink Key TZ_in Power
  3. @outputs Ping_out T1:array
  4. @persist Time S ST Clr Col Userfound S_X Select AryPosU AryPosP
  5. @persist AryPos [User Pass User_db Pass_db Buffer]:array BufferPos
  6. @persist StartMenu Select2 [Hour Minute]:string Real_Time TempTime
  7. @trigger
  8. ###################
  9. # TIMER #
  10. ###################
  11. interval(500)
  12. if(clk())
  13. {
  14. if(ST == 1)
  15. {
  16. Time+=1
  17. if(Time<9)
  18. {
  19. Col++
  20. }
  21. S_X+=3
  22. }
  23. }
  24. T = Time
  25. ###################
  26. if(Ping_in == 1) #
  27. { #
  28. Ping_out = 1 #
  29. } #
  30. else #
  31. { #
  32. Ping_out = 0 #
  33. } #
  34. ###################
  35. if(~CPU_CAN_WRITE)
  36. {
  37. Screen:writeCell(2041,1)
  38. ST = 0
  39. Time = 0
  40. S = 0
  41. Col = 0
  42. S_X = 0
  43. Select = 0
  44. AryPosU = 1
  45. AryPosP = 1
  46. Clr = 0
  47. AryPos = 1
  48. Userfound = 0
  49. StartScreen = 0
  50. Select2 = 0
  51. StartMenu = 0
  52. BufferPos = 1
  53. while(User[AryPos,string] != "")
  54. {
  55. User:remove(1)
  56. }
  57. AryPos = 1
  58. while(Pass[AryPos,string] != "")
  59. {
  60. Pass:remove(1)
  61. }
  62. while(Buffer[AryPos,string] != "")
  63. {
  64. Pass:remove(1)
  65. }
  66. AryPos = 1
  67.  
  68. ##########################
  69. # User / Pass db #
  70. ##########################
  71. User_db[1,string] = "assassin"
  72. Pass_db[1,string] = "root"
  73. ##############################
  74. }
  75. if(CPU_CAN_WRITE & Power == 1)
  76. {
  77. ########################
  78. # Start Screen #
  79. ########################
  80. if(S == 0)
  81. {
  82. ST = 1
  83. if(Time < 10)
  84. {
  85. Screen:writeString("Assassin",11,7,Col+(Col*10)+(Col*100),0,0)
  86. Screen:writeString(" ",S_X,17,555,555,0)
  87. }
  88. if(Time > 10)
  89. {
  90. Screen:writeString(" Press Any Key To Continue! ",0,17,6,666,0)
  91. if(Key)
  92. {
  93. ST = 0
  94. Time = 0
  95. Clr = 1
  96. S = 1
  97. }
  98. }
  99.  
  100.  
  101. }
  102.  
  103. #####################
  104. # Main Menu #
  105. #####################
  106. if(S == 1)
  107. {
  108. if(!clk())
  109. {
  110. if(Clr)
  111. {
  112. Screen:writeCell(2041,1)
  113. Clr = 0
  114. }
  115. else
  116. {
  117. Screen:writeString("LOGIN:",12,5,999,0,0)
  118. if(Key == 17)
  119. {
  120. Select = 0
  121. }
  122. if(Key == 18)
  123. {
  124. Select = 1
  125. }
  126. if(Select == 0)
  127. {
  128. Screen:writeString("User:",3,8,999,0,0)
  129. Screen:writeString("Pass:",3,9,559,0,0)
  130. }
  131. if(Select == 1)
  132. {
  133. Screen:writeString("User:",3,8,559,0,0)
  134. Screen:writeString("Pass:",3,9,999,0,0)
  135. }
  136.  
  137. if(Key & Key != 154 & Key != 19 & Key != 20 & Key != 17 & Key != 18 & Key != 127 & Key != 9 & Key != 13 & Select == 0)
  138. {
  139. User[AryPosU,string] = toChar(Key)
  140. Screen:writeString(User[AryPosU,string],AryPosU+9,8,999,0,0)
  141. AryPosU++
  142. }
  143. if(Key & Key != 154 & Key != 19 & Key != 20 & Key != 17 & Key != 18 & Key != 127 & Key != 9 & Key != 13& Select == 1)
  144. {
  145. Pass[AryPosP,string] = toChar(Key)
  146. Screen:writeString("*",AryPosP+9,9,999,0,0)
  147. AryPosP++
  148. }
  149. if(Key == 127)
  150. {
  151. if(Select == 0)
  152. {
  153. User:remove(AryPosU-1)
  154. Screen:writeString(" ",AryPosU+8,8,999,0,0)
  155. if(AryPosU != 1)
  156. {
  157. AryPosU--
  158. }
  159. }
  160. if(Select == 1)
  161. {
  162. Pass:remove(AryPosP-1)
  163. Screen:writeString(" ",AryPosP+8,9,999,0,0)
  164. if(AryPosP != 1)
  165. {
  166. AryPosP--
  167. }
  168. }
  169. }
  170.  
  171.  
  172. if(Key == 13)
  173. {
  174. AryPos = 1
  175. while(User_db[AryPos,string] != "" & Userfound == 0)
  176. {
  177. if(User_db[AryPos,string] == User:concat())
  178. {
  179. Userfound = AryPos
  180. break
  181. }
  182. AryPos++
  183. }
  184. if(User_db[AryPos,string] == "")
  185. {
  186. Screen:writeString("USERNAME NOT FOUND",6,11,900,0,0)
  187. }
  188. }
  189. if(Userfound)
  190. {
  191. if(Pass_db[Userfound,string] == Pass:concat())
  192. {
  193. S = 2
  194. }
  195. if(Pass_db[Userfound,string] != Pass:concat())
  196. {
  197. Screen:writeString("INCORRECT PASSWORD",6,11,900,0,0)
  198. }
  199. }
  200.  
  201. }
  202. }
  203.  
  204. }
  205. if(S == 2)
  206. {
  207. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  208. if(!clk())
  209. {
  210. Screen:writeCell(2041,1)
  211. Screen:writeString(" ",0,17,9,9,0)
  212. Screen:writeString("CTRL",0,17,999,60,0)
  213. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  214.  
  215.  
  216. if(Key == 158 & StartMenu == 0)
  217. {
  218. StartMenu = 1
  219. ST = 1
  220. }
  221. if(Time > 1 & Key == 158 & StartMenu == 1)
  222. {
  223. StartMenu = 0
  224. ST = 0
  225. Time = 0
  226. }
  227.  
  228. if(StartMenu == 1)
  229. {
  230. for(Y=12,16)
  231. {
  232. for(X=1,8)
  233. {
  234. Screen:writeString(" ",X,Y,777,777,0)
  235. }
  236. }
  237. for(Y=8,16)
  238. {
  239. Screen:writeString(" ",0,Y,555,555,0)
  240. Screen:writeString(" ",9,Y,555,555,0)
  241. }
  242. Screen:writeString(" ",0,8,555,555,0)
  243. Screen:writeString("My Files",1,9,222,777,0)
  244. Screen:writeString("My Music",1,10,222,777,0)
  245. Screen:writeString("Word Pad",1,11,222,777,0)
  246. Screen:writeString("CMD Line",1,12,222,777,0)
  247. Screen:writeString("Run Prog",1,13,222,777,0)
  248. }
  249. if(StartMenu == 0)
  250. {
  251. for(Y=9,16)
  252. {
  253. for(X=1,8)
  254. {
  255. Screen:writeString(" ",X,Y,0,0,0)
  256. }
  257. }
  258. for(Y=8,16)
  259. {
  260. Screen:writeString(" ",0,Y,0,0,0)
  261. Screen:writeString(" ",9,Y,0,0,0)
  262. }
  263. Screen:writeString(" ",0,8,0,0,0)
  264. }
  265.  
  266. if(StartMenu == 1)
  267. {
  268. if(Key == 18)
  269. {
  270. if(Select2 != 0)
  271. {
  272. Select2--
  273. }
  274. }
  275. if(Key == 17)
  276. {
  277. if(Select2 != 4)
  278. {
  279. Select2++
  280. }
  281. }
  282. }
  283. if(StartMenu == 1)
  284. {
  285. if(Select2 == 4)
  286. {
  287. Screen:writeString("My Files",1,9,222,557,0)
  288. }
  289. if(Select2 == 3)
  290. {
  291. Screen:writeString("My Music",1,10,222,557,0)
  292. }
  293. if(Select2 == 2)
  294. {
  295. Screen:writeString("Word Pad",1,11,222,557,0)
  296. }
  297. if(Select2 == 1)
  298. {
  299. Screen:writeString("CMD Line",1,12,222,557,0)
  300. }
  301. if(Select2 == 0)
  302. {
  303. Screen:writeString("Run Prog",1,13,222,557,0)
  304. }
  305. }
  306.  
  307. if(StartMenu == 1 & Select2 == 0 & Key == 13)
  308. {
  309. ST = 0
  310. Time = 0
  311. Clr = 1
  312. S = 3
  313. }
  314. if(StartMenu == 1 & Select2 == 1 & Key == 13)
  315. {
  316. ST = 0
  317. Time = 0
  318. Clr = 1
  319. S = 4
  320. }
  321. if(StartMenu == 1 & Select2 == 2 & Key == 13)
  322. {
  323. ST = 0
  324. Time = 0
  325. Clr = 1
  326. S = 5
  327. }
  328. if(StartMenu == 1 & Select2 == 3 & Key == 13)
  329. {
  330. ST = 0
  331. Time = 0
  332. Clr = 1
  333. S = 6
  334. }
  335. if(StartMenu == 1 & Select2 == 4 & Key == 13)
  336. {
  337. ST = 0
  338. Time = 0
  339. Clr = 1
  340. S = 7
  341. }
  342. }
  343. }
  344. ####################
  345. # Run Prog #
  346. ####################
  347. if(S == 3)
  348. {
  349. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  350. if(!clk())
  351. {
  352. Screen:writeCell(2041,1)
  353. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  354. Screen:writeString(" ",0,17,9,9,0)
  355. Screen:writeString("CTRL",0,17,999,444,0)
  356. }
  357. }
  358. ####################
  359. # CMD Line #
  360. ####################
  361. if(S == 4)
  362. {
  363. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  364. if(!clk())
  365. {
  366. Screen:writeCell(2041,1)
  367. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  368. Screen:writeString(" ",0,17,9,9,0)
  369. Screen:writeString("CTRL",0,17,999,444,0)
  370. }
  371. }
  372. ####################
  373. # Word Pad #
  374. ####################
  375. if(S == 5)
  376. {
  377. if(!clk())
  378. {
  379. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  380. Screen:writeCell(2041,1)
  381. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  382. Screen:writeString(" ",0,17,9,9,0)
  383. Screen:writeString("CTRL",0,17,999,444,0)
  384. }
  385. }
  386. ####################
  387. # My Music #
  388. ####################
  389. if(S == 6)
  390. {
  391. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  392. if(!clk())
  393. {
  394. if(Clr)
  395. {
  396. Screen:writeCell(2041,1)
  397. Clr = 0
  398. }
  399. ST = 1
  400. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  401. Screen:writeString(" ",0,17,9,9,0)
  402. Screen:writeString("CTRL",0,17,999,444,0)
  403. if(Time == 0)
  404. {
  405. for(X=2,27)
  406. {
  407. Screen:writeString(" ",X,2,999,999,0)
  408. Screen:writeString(" ",X,15,999,999,0)
  409. }
  410. Screen:writeString(" My Music [TAB] ",2,1,999,357,0)
  411. for(Y=2,15)
  412. {
  413. Screen:writeString(" ",2,Y,999,999,0)
  414. Screen:writeString(" ",27,Y,999,999,0)
  415. }
  416. for(Y=3,14)
  417. {
  418. for(X=3,26)
  419. {
  420. Screen:writeString(" ",X,Y,555,555,0)
  421. }
  422. }
  423. Screen:writeString(" ",10,5,9,333,0)
  424. Screen:writeString("SONG:",5,5,9,555,0)
  425. }
  426.  
  427. if(Key & Key != 154 & Key != 19 & Key != 20 & Key != 17 & Key != 18 & Key != 127 & Key != 9 & Key != 13)
  428. {
  429. Buffer[BufferPos,string] = toChar(Key)
  430. if(BufferPos < 14)
  431. {
  432. Screen:writeString(toChar(Key),BufferPos+9,5,999,333,0)
  433. }
  434. BufferPos++
  435. }
  436. if(Key & Key == 127)
  437. {
  438. if(BufferPos != 1)
  439. {
  440. BufferPos--
  441. Buffer[BufferPos,string] = ""
  442. Screen:writeString(" ",BufferPos+9,5,999,333,0)
  443. }
  444. }
  445. if(Key & Key == 13)
  446. {
  447. soundPlay(0,10000,Buffer:concat())
  448. }
  449.  
  450. if(Key == 9)
  451. {
  452. StartMenu = 0
  453. ST = 0
  454. Time = 0
  455. S = 2
  456. }
  457. }
  458. }
  459. ####################
  460. # My Files #
  461. ####################
  462. if(S == 7)
  463. {
  464. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  465. if(!clk())
  466. {
  467. Screen:writeCell(2041,1)
  468. Screen:writeString(Hour+":"+Minute,25,17,999,9,0)
  469. Screen:writeString(" ",0,17,9,9,0)
  470. Screen:writeString("CTRL",0,17,999,444,0)
  471. }
  472. }
  473. }
  474.  
  475.  
  476. if(0)
  477. {
  478. print(Buffer)
  479. }
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488. ##################################################
  489. Real_Time = (time("hour")+TZ_in)
  490.  
  491. if(Real_Time <= 9)
  492. {
  493. Hour = "0"+toString(Real_Time)
  494. }
  495. if(Real_Time >= 10 & Real_Time < 12)
  496. {
  497. Hour = toString(Real_Time)
  498. }
  499. if(Real_Time > 12)
  500. {
  501. if(Real_Time-12 <= 9)
  502. {
  503. Hour = "0"+toString((Real_Time-12))
  504. }
  505. if(Real_Time-12 >= 10)
  506. {
  507. Hour = toString((Real_Time-12))
  508. }
  509. }
  510.  
  511. if(Real_Time-12 < 0)
  512. {
  513. TempTime = (time("hour")-12)
  514. Hour = toString(((12-TempTime)-12))
  515.  
  516. }
  517.  
  518. if(time("min") < 10)
  519. {
  520. Minute = "0"+toString(time("min"))
  521. }
  522. if(time("min") > 10)
  523. {
  524. Minute = toString(time("min"))
  525. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement