Advertisement
Belzebub

r.lua

Mar 9th, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.05 KB | None | 0 0
  1. -----Librares-------pastebin run ryhyXUKZ--Download Librares
  2. local component = require("component")
  3. local event = require("event")
  4. local shell = require("shell")
  5. local term = require("term")
  6. local fs = require("filesystem")
  7. local api = require("api")
  8. local matrix = require("matrix")
  9. -----Constants-----
  10. local likedplayer = "utevaugu36"
  11. local chat = component.chat_box
  12. local gpu = component.gpu
  13. local say = chat.say
  14. local name = chat.setName
  15. name("§4Маша Hima§7")
  16. -----Variables-----
  17. local prefixes = 3
  18. local orders = {} local customers = {}
  19. local power, powerlisten = false, false
  20. local ignoreList = {"Штопковольт", "Мира", "Старик Райз", "Лория"}
  21. local colors = {}
  22. local winners = {}
  23. local prefixList = {"§4Довн", "§7Шахтер", "§6Маша §5Хима"}
  24. local clearPrefixList = {"GiperDrakon", "MaJlblwEnot", "MrE741"}
  25. local adminList = {"utevaugu36", "MrE741", "MaJlblwEnot", "GiperDrakon"}
  26. -----Images-----
  27. local house = {" *__Π___*。* ", "*/______/~\\ *", "*|田田 . .|門| |"}
  28. local foot = {"§7....§8oooO§7..............", "§7.....§8(....)§7...§8Oooo§7...", "§7......§8)../§7.....§8(....)§7...", "§7.....§8(_/§7.......§8)../§7.....", "§7...............§8(_/§7......"}
  29. local cat = {" />  フ", "     |  _  _|", "     /`ミ _x 彡", "     /      |", "    /  ヽ   ノ", " / ̄|   | | |", " | ( ̄ヽ__ヽ_)_)", " \二つ"}
  30. -----Functions-----
  31. function ask(ask, answer1, answer2)
  32. say(ask)
  33. while true do
  34. _,_,plr,msg = event.pull("chat_message")
  35. if msg == answer1 or msg == answer2 then break end
  36. end
  37. say("§c"..plr.."§2 ответил верно")
  38. winners[#winners+1] = plr
  39. end
  40. local urls = {}
  41. function getModels() say("§2Получение списка моделей") os.sleep(0.5) say("§5Инициализация") for i = 1, #models do urls[i] = "http://d620.win/models/"..models[i] end os.sleep(0.5) say("§6Скачивание...") for i = 1, #models do loadfile("/bin/wget.lua")(urls[i], "/home/"..models[i], "-fq") end say("§2Скачивание §4"..#models.." §2файлов завершено! Печать...") for i = 1, #models do shell.execute("3d "..models[i].." 2 5") end say("§2Печать завершена! Выставляйте на продажу ^.^") end
  42. gpu.setResolution(150, 51)
  43. local o = 1
  44. local iter = 1
  45. function show(l, l, plr, msg)
  46. local messageType = "default"
  47. for i = 1, #ignoreList do if plr == ignoreList[i] then messageType = "ignore" end end
  48. if messageType ~= "ignore" then
  49. for i = 1, prefixes do
  50. if clearPrefixList[i] == plr then
  51. local temp = api.breakText(msg)
  52. while temp[1] == " " do table.remove(temp, 1) end
  53. if string.find(msg, "!") == 1 then
  54. while true do if temp[1] == " " or temp[1] == "!" then table.remove(temp, 1) else break end end
  55. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end msg = table.concat(temp)
  56. messageType = "!prefix"
  57. pref = i
  58. else
  59. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end msg = table.concat(temp)
  60. messageType = "prefix"
  61. pref = i
  62. end
  63. end
  64. end
  65. end
  66. if messageType == "ns" then
  67. local temp = api.breakText(msg)
  68. while temp[1] == " " do table.remove(temp, 1) end
  69. if string.find(msg, "!") == 1 then
  70. while true do if temp[1] == " " or temp[1] == "!" then table.remove(temp, 1) else break end end
  71. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end msg = table.concat(temp)
  72. messageType = "!default"
  73. else
  74. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end msg = table.concat(temp)
  75. messageType = "default"
  76. end
  77. end
  78. if messageType ~= "ignore" then
  79. if messageType == "!default" then
  80. local temp = api.breakText(msg)
  81. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  82. msg = table.concat(temp)
  83. api.smartText(1, o, "§8[§6G§8] §7"..plr..": §7"..msg)
  84. elseif messageType == "default" then
  85. local temp = api.breakText(msg)
  86. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  87. msg = table.concat(temp)
  88. api.smartText(1, o, "§8[§2§fL§8] §7"..plr..": §7"..msg)
  89. elseif messageType == "!prefix" then
  90. local temp = api.breakText(msg)
  91. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  92. msg = table.concat(temp)
  93. api.smartText(1, o, "§8[§6G§8] §8[§r"..prefixList[pref].."§8] §7"..plr..": §7"..msg)
  94. elseif messageType == "prefix" then
  95. local temp = api.breakText(msg)
  96. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  97. msg = table.concat(temp)
  98. api.smartText(1, o, "§8[§2§fL§8] §8[§r"..prefixList[pref].."§8] §7"..plr..": §7"..msg)
  99. end
  100. if iter >= 51 then
  101. o = 1
  102. iter = 0
  103. gpu.fill(1, 1, 150, 51, " ")
  104. end
  105. o = o + 1
  106. iter = iter + 1
  107. end
  108. end
  109. function chat(_, _, plr, msg)
  110. date = os.date("!*t", seconds_since_epoch)
  111. local time = date.hour..":"..date.min
  112. tmp = false
  113. temp = {}
  114. for i = 1, #ignoreList do if plr == ignoreList[i] then tmp = true end end
  115. for i = 1, prefixes do if plr == clearPrefixList[i] then tmp = true
  116. if msg:find("!") ~= 1 then
  117. name("§fL§7")
  118. local temp = api.breakText(msg)
  119. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  120. msg = table.concat(temp)
  121. if plr == "utevaugu36" then
  122. tmp = false
  123. for i = 1, prefixes do if likedplayer == clearPrefixList[i] then tmp = true
  124. if msg:find("!") ~= 1 then
  125. name("§fL§7")
  126. local temp = api.breakText(msg)
  127. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  128. msg = table.concat(temp)
  129. say("§8["..prefixList[i].."§8] §7"..likedplayer..": §f"..msg)
  130. end end end
  131. if tmp == false then say("§7"..likedplayer..": §f"..msg) end
  132. else
  133. say("§8["..prefixList[i].."§8] §7"..plr..": §f"..msg) end
  134. end end end
  135. if tmp == false then
  136. if msg:find("!") ~= 1 then
  137. local temp = api.breakText(msg)
  138. for i = 1, #temp do if temp[i] == "&" then temp[i] = "§" end end
  139. msg = table.concat(temp)
  140. name("§3"..time.."§7")
  141. say(plr..": §f"..msg)
  142. end
  143. end
  144. end
  145. function separator() say("§4=§6=§2=§3=§1=§5=§4=§6=§2=§3=§1=§5=§4=§6=§2=§3=§1=§5=§4=§6=§2=§3=§1=§5=") end
  146. function checker(_,_,plr,cmd1)
  147. if clearPrefixList == nil then clearPrefixList = {} end
  148. if prefixList == nil then prefixList = {} end
  149. local ran = math.random(1, 5)
  150. if cmd1 == "-привет" then if ran == 1 then say("§2Хаюшки ^.^") elseif ran == 2 then say("§2Здравствуйте") elseif ran == 3 then say("§2Привет") elseif ran == 4 then say("§2Дарова") elseif ran == 5 then say("§2Пребывай в добром здравии, путник.") end
  151. elseif cmd1 == "-яндекс" then name("§4Я§0ндекс§r") if ran == 1 then say("§rА?Что?Где?Когда?") elseif ran == 2 then say("§rЯ здесь!") elseif ran == 3 then say("§rЯ здеся") elseif ran == 4 then say("§rХотите что-то спросить?") elseif ran == 5 then say("§rConsole.WriteLine(\"Привет\")") end
  152. elseif cmd1 == "-гугл" then name("§1G§4o§6o§1g§2l§4e§7") if ran == 1 then say("§rА?Что?Где?Когда?") elseif ran == 2 then say("§rЯ здесь!") elseif ran == 3 then say("§rЯ здеся") elseif ran == 4 then say("§rХотите что-то спросить?") elseif ran == 5 then say("§rConsole.WriteLine(\"Привет\")") end
  153. elseif cmd1 == "==money" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then say("§2[̲̅$̲̅(̲̅ιοο̲̅)̲̅$̲̅]") admin = true end end if admin == false then say("§4Ошибка 404") end
  154. elseif cmd1 == "==foot" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then for i = 1, #foot do say(foot[i]) end admin = true end end if admin == false then say("§4Ошибка 404") end
  155. elseif cmd1 == "==love" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then say("§4♥") admin = true end end if admin == false then say("§4Ошибка 404") end
  156. elseif cmd1:find("-prefix del") == 1 then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true local temp = api.breakText(cmd1) for i = 1, 12 do table.remove(temp, 1) end local del = table.concat(temp) table.remove(prefixList, tonumber(del)) table.remove(clearPrefixList, tonumber(del)) say("§2Successfully") end end if admin == false then say("§4Ошибка 404d") end
  157. elseif cmd1 == "-bl clear" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true ignoreList = {} say("§2§nSuccessfully!") end end if admin == false then say("§4Ошибка 404") end
  158. elseif cmd1 == "-colors" then for i = 0, 9 do say("§"..i.."&"..i) end say("§a&a") say("§b&b") say("§c&c") say("§d&d") say("§e&e") say("§f&f") say("§m&m") say("§n&n") say("§l&l")
  159. elseif cmd1 == "-chat on" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true say("§2Слушаюсь, моя Маша Hima §4♥") event.ignore("chat_message", show) event.ignore("chat_message", chat) event.listen("chat_message", chat) matrix.start() end end if admin == false then say("§4Ошибка 404") end
  160. elseif cmd1 == "-chat off" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true say("§2Слушаюсь, моя Маша Hima §4♥") event.ignore("chat_message", chat) event.ignore("chat_message", show) event.listen("chat_message", show) matrix.stop() end end if admin == false then say("§4Ошибка 404") end
  161. elseif cmd1 == "-price list" then separator() say("§2§l 1 звезда ада §4§l- §d§l64 материи") say("§6§l 1 ихор §4§l- §d§l4 материи") separator()
  162. elseif cmd1 == "-?" then separator() say("§c-заказ [заказ] - Заказать §13§4D§c модель") say("§9-price list - Список цен") say("§a-colors - Числовые коды цветов чата") separator()
  163. elseif cmd1 == "-п" then admin = false for i = 1, #adminList do
  164. if plr == adminList[i] or plr == "utevaugu36" then admin = true
  165. if powerlisten == false then event.listen("chat_message", show)
  166. say("§3Прослушка §aвключена!") powerlisten = true matrix.stop()
  167. else say("§3Прослушка §cвыключена!") powerlisten = false
  168. event.ignore("chat_message", show) event.ignore("chat_message", chat)
  169. matrix.start() end end end if admin == false then say("§4Ошибка 404") end
  170. elseif cmd1 == "-exit" then admin = false for i = 1, #adminList do
  171. if plr == adminList[i] or plr == "utevaugu36" then admin = true close() end
  172. end if admin == false then say("§4Ошибка 404") end
  173. elseif cmd1 == "-prefix list" then admin = false for i = 1, #adminList do
  174. if plr == adminList[i] or plr == "utevaugu36" then admin = true separator() for i = 1, prefixes do say("§f"..i..". §8[§f"..prefixList[i].."§8] §r"..clearPrefixList[i]) end separator() end end if admin == false then say("§4Ошибка 404") end
  175. elseif cmd1 == "-bl list" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true separator() for i = 1, #ignoreList do say("§"..math.random(1, 9)..ignoreList[i]) end separator() end end if admin == false then say("§4Ошибка 404") end
  176. elseif cmd1 == "-order list" then admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true separator() for i = 1, #customers do say("§4"..customers[i].."§2: §5"..orders[i]) end separator() end end if admin == false then say("§4Ошибка 404") end
  177. elseif cmd1:find("-morph") == 1 then
  178. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true
  179. tmp = api.breakText(cmd1)
  180. for i = 1, 7 do table.remove(tmp, 1) end
  181. likedplayer = table.concat(tmp)
  182. end end if admin == false then say("§4Ошибка 404") end
  183. elseif cmd1 == "-getModels" then
  184. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true getModels() end end if admin == false then say("§4Ошибка 404") end
  185. elseif string.find(cmd1, "-bl add") == 1 then
  186. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true temp = {} for result in string.gmatch(cmd1, ".") do temp[#temp+1] = result end for i = 1, 8 do table.remove(temp, 1) end result = table.concat(temp) ignoreList[#ignoreList+1] = result say("§4"..result.."§2 успешно добавлен") end end if admin == false then say("§4Ошибка 404") end
  187. elseif string.find(cmd1, "-bl remove") == 1 then
  188. admin = false for i = 1, #adminList do
  189. if plr == adminList[i] or plr == "utevaugu36" then
  190. admin = true temp = {} for result in string.gmatch(cmd1, ".") do
  191. temp[#temp+1] = result end for i = 1, 11 do table.remove(temp, 1) end
  192. result = table.concat(temp) tmp1 = false for i = 1, #ignoreList do
  193. if ignoreList[i] == result then table.remove(ignoreList, i) tmp1 = true
  194. say("§4"..result.."§2 успешно удален") end end if tmp1 == false then say("§4Данного игрока нету в чс!")
  195. end end end if admin == false then say("§4Permission denied") end
  196. elseif string.find(cmd1, "-prefix set") == 1 then
  197. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true
  198. temp = api.breakText(cmd1) temp2 = api.breakText(cmd1)
  199. for i = 1, 12 do table.remove(temp, 1) end
  200. for i = 1, 12 do table.remove(temp2, 1) end
  201. while temp2[1] ~= " " do table.remove(temp2, 1) end table.remove(temp2, 1)
  202. while temp[#temp] ~= " " do table.remove(temp, #temp) end table.remove(temp, #temp)
  203. for i = 1, #temp2 do if temp2[i] == "&" then temp2[i] = "§" end end for i = 1, #temp2 do if temp2[i] == "_" then temp2[i] = " " end end
  204. prefix = table.concat(temp2)
  205. nick = table.concat(temp)
  206. local tmp5 = false
  207. for i = 1, prefixes do if clearPrefixList[i] == nick then say("§4"..nick.." §2§n§lуже §f§2имеет префикс! Будет произведена замена.") table.remove(clearPrefixList, i) clearPrefixList[prefixes] = nick table.remove(prefixList, i) prefixList[prefixes] = prefix tmp5 = true end end
  208. if tmp5 == false then
  209. prefixList[#prefixList+1] = prefix
  210. clearPrefixList[prefixes+1] = nick
  211. say("§2Теперь у игрока §4"..nick.." §2будет префикс §8[§f"..prefix.."§8]")
  212. prefixes = prefixes + 1
  213. end
  214. end end if admin == false then say("§4Permission denied") end
  215. elseif string.find(cmd1, "-pex give") == 1 then
  216. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true
  217. local temp = api.breakText(cmd1)
  218. for i = 1, 10 do table.remove(temp, 1) end
  219. tmp = false
  220. for i = 1, #adminList do if adminList[i] == table.concat(temp) then tmp = true say("§2"..table.concat(temp).." §cуже администратор") end end
  221. if tmp == false then adminList[#adminList+1] = table.concat(temp) say("§2"..table.concat(temp).." §cназначен администратором") end
  222. end end if admin == false then say("§4Permission denied") end
  223. elseif string.find(cmd1, "-pex take") == 1 then
  224. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true
  225. local temp = api.breakText(cmd1)
  226. for i = 1, 10 do table.remove(temp, 1) end
  227. tmp = false
  228. for i = 1, #adminList do if adminList[i] == table.concat(temp) then tmp = true
  229. say("§2"..adminList[i].." §cснят с администрации") table.remove(adminList, i)
  230. end end
  231. if tmp == false then say("§2"..table.concat(temp).." §cне является администратором") end
  232. end end if admin == false then say("§4Ошибка 404") end
  233. elseif string.find(cmd1, "-заказ") == 1 and cmd1 ~= "-заказ" then temp = {} temp2 = {}
  234. for result in string.gmatch(cmd1, ".") do temp[#temp+1] = result end
  235. for i = 1, 12 do table.remove(temp, 1) end result = table.concat(temp) orders[#orders+1] = result customers[#customers+1] = plr
  236. say("§2Ваш идиотский заказ принят и скоро будет рассмотрен §cадминистраторами §2варпа.")
  237. elseif cmd1:find("-shell execute") == 1 then
  238. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true
  239. local tmp = api.breakText(cmd1)
  240. for i = 1, 15 do table.remove(tmp, 1) end
  241. local result = table.concat(tmp)
  242. say("§c-----Вывод программы-----")
  243. shell.execute(result)
  244. say("§c-----Конец вывода программы-----")
  245. end end if admin == false then say("§4Ошибка 404") end
  246. elseif cmd1 == "-admin list" then
  247. admin = false for i = 1, #adminList do if plr == adminList[i] or plr == "utevaugu36" then admin = true
  248. separator()
  249. for i = 1, #adminList do say("§f"..i..". §"..math.random(1, 9)..adminList[i]) end
  250. separator()
  251. end end if admin == false then say("§4Ошибка 404") end
  252. end
  253. end
  254. local width, height = gpu.getResolution()
  255. gpu.fill(1, 1, width, height, " ")
  256. function close(_,_,_,key)
  257. if key == 28 then
  258. event.ignore("chat_message", show)
  259. event.ignore("chat_message", chat)
  260. event.ignore("key_down", close)
  261. event.ignore("chat_message", checker)
  262. gpu.fill(1, 1, width, height, " ")
  263. term.setCursor(1, 1)
  264. gpu.setBackground(0x333333)
  265. os.reboot()
  266. end
  267. end
  268. event.listen("key_down", close)
  269. event.listen("chat_message", checker)
  270. -----Code-----
  271. api.license()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement