waadidas1

Untitled

Aug 14th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- update
  2. -- Dieses Spiel befindet sich in noch in der Entwicklung
  3. -- Author :  waadidas1
  4.  
  5.  
  6.  
  7. --um das spiel zu speichern in fs.open speichern
  8. -- das Geld
  9. --file = fs.makeDir("motor")
  10. -- save = fs.open("motor","r")
  11. --geld = save.readLine()
  12. --save.close()
  13. --/ das Geld
  14.  
  15.  
  16. -- Hauptwelt
  17.  
  18. welt = window.create(term.current(),1,1,51,23)
  19. welt.setBackgroundColor(colors.blue)
  20. welt.clear()
  21. welt.setCursorPos(5,8)
  22. welt.write("x")
  23. welt.setCursorPos(2,10)
  24. welt.setTextColor(colors.black)
  25. welt.write("X")
  26. --/Hauptwelt
  27.  
  28.  
  29.  
  30. --char
  31. ped = window.create(term.current(),22,7,10,6)
  32. ped.setBackgroundColor(colors.brown)
  33. ped.clear()
  34. ped.setCursorPos(2,2)
  35. ped.write("(O).(O)")
  36. ped.setCursorPos(3,4)
  37. ped.write("____/")
  38. ped.setCursorPos(4,3)
  39. ped.write("<")
  40.  
  41. --/char
  42.  
  43.  
  44.  
  45. --Dollar anzeige
  46. w = window.create(term.current(),1,16,30,4)
  47. w.setBackgroundColor(colors.green)
  48. w.clear()
  49. w.setCursorPos(1,1)
  50. w.write("Money: ")
  51. w.setCursorPos(7,3)
  52. w.write("$")
  53. w.setCursorPos(8,3)
  54. w.write("Shop")
  55. --/dollar anzeige
  56.  
  57.  
  58.  
  59.  
  60. --script
  61. sichtbar = true
  62.  repeat
  63.  
  64. if sichtbar == true then
  65. -- button eins
  66.  event,taste,x,y = os.pullEvent("mouse_click")
  67. if x>21 and x<33 and y>6 and y<14 then
  68. --/button eins
  69.  
  70.  
  71. rdm = math.random(1,7)
  72. geld = geld+rdm
  73. sv = fs.open("geld","w")
  74. sv.writeLine(geld)
  75. sv.close()
  76. -- dollar anzeige aktualisieren
  77. w.setCursorPos(1,3)
  78. w.write(geld)
  79. end
  80. if x>7 and x<12 and y == 18
  81. then term.scroll(30)
  82. sichtbar = false
  83. end
  84. end
  85. until sichtbar == false
  86. if sichtbar == false
  87. then
  88. --shop seite
  89. shop = window.create(term.current(),1,1,51,20)
  90. shop.setBackgroundColor(colors.yellow)
  91. shop.clear()
  92. shop.setCursorPos(10,1)
  93. shop.setTextColor(colors.black)
  94. shop.write("@X@X@X@X@X@X@ SHOP @X@X@X@X@X@X@")
  95. shop.setCursorPos(10,18)
  96. shop.write("@X@X@X@X@X@X@<Back>@X@X@X@X@X@X@")
  97. repeat
  98. event,taste,x1,y1 = os.pullEvent("mouse_click")
  99. if
  100. x1>23 and x1<30 and y1 == 18 then
  101. sichtbar = true
  102. end
  103.  
  104. --/shop seite
  105. until sichtbar == true
  106. end
  107. if sichtbar == true then shell.run("startup")
  108. end
Add Comment
Please, Sign In to add comment