diff --git a/Applications.txt b/Applications.txt index 2f1ac4ef..994b94ee 100644 --- a/Applications.txt +++ b/Applications.txt @@ -358,6 +358,15 @@ ["version"]=1.0, }, ----------------------------------------------------- Приложения без ресурсов -------------------------------------------------------------------------- + { + ["name"]="MineOS/Applications/FuckTheRain", + ["url"]="IgorTimofeev/OpenComputers/master/Applications/FuckTheRain/FuckTheRain.lua", + ["about"]="IgorTimofeev/OpenComputers/master/Applications/FuckTheRain/About.txt", + ["type"]="Application", + ["icon"]="IgorTimofeev/OpenComputers/master/Applications/FuckTheRain/Icon.pic", + ["createShortcut"] = "desktop", + ["version"]=1.0, + }, { ["name"]="MineOS/Applications/GuessWord", ["url"]="IgorTimofeev/OpenComputers/master/Applications/GuessWord/GuessWord.lua", diff --git a/Applications/DroneGrief/Drone.lua b/Applications/DroneGrief/Drone.lua index 91148927..15465c29 100644 --- a/Applications/DroneGrief/Drone.lua +++ b/Applications/DroneGrief/Drone.lua @@ -7,6 +7,8 @@ local moveSpeed = 1.0 local suckSide = 0 local direction = 0 local acceleration = 0.5 +local autoDrop = true +local leashed = false modem.open(port) @@ -40,6 +42,15 @@ local function sendInfo() modem.broadcast(port, "ECSDrone", "DroneInfo", moveSpeed, acceleration, direction) end +local function dropAll() + for i = 1, drone.inventorySize() do + drone.select(i) + drone.drop(1) + end + drone.select(1) + drone.setStatusText("DROPPED") +end + drone.setStatusText("STARTED") while true do @@ -72,14 +83,17 @@ while true do for i = 1, (inventory.getInventorySize(0) or 1) do inventory.suckFromSlot(0, i) end - for i = 1, (inventory.getInventorySize(1) or 1) do - inventory.suckFromSlot(1, i) - end + drone.setStatusText("SUCKED") elseif e[7] == "swing" then - drone.swing() + drone.swing(0) + elseif e[7] == "dropAll" then + dropAll() + elseif e[7] == "changeAutoDrop" then + changeAutoDrop = not changeAutoDrop + drone.setStatusText("DROP: " .. tostring(changeAutoDrop)) elseif e[7] == "moveSpeedUp" then moveSpeed = moveSpeed + 0.1 - if moveSpeed >= 3 then moveSpeed = 3 end + if moveSpeed >= 8 then moveSpeed = 8 end printSpeed() sendInfo() elseif e[7] == "moveSpeedDown" then @@ -99,6 +113,14 @@ while true do drone.setAcceleration(acceleration) printAcceleration() sendInfo() + elseif e[7] == "toggleLeash" then + if leashed then + component.proxy(component.list("leash")()).unleash() + leashed = false + else + component.proxy(component.list("leash")()).leash(suckSide) + leashed = true + end end end end diff --git a/Applications/DroneGrief/Planshet.lua b/Applications/DroneGrief/Planshet.lua index 137c2c6a..29f5b16d 100644 --- a/Applications/DroneGrief/Planshet.lua +++ b/Applications/DroneGrief/Planshet.lua @@ -15,7 +15,8 @@ local keys = { [57] = "moveUp", [46] = "changeColor", [18] = "OTSOS", - [16] = "swing", + [16] = "dropAll", + [33] = "toggleLeash", } --------------------------------------------------------------------------------------------------------- diff --git a/Applications/FuckTheRain/About.txt b/Applications/FuckTheRain/About.txt new file mode 100644 index 00000000..f4b8ead9 --- /dev/null +++ b/Applications/FuckTheRain/About.txt @@ -0,0 +1 @@ +Простой мультипоточный скрипт, которую я написал по большей части для себя: дождь в одинойчной игре заебал меня настолько, насколько это вообще возможно. Для работы программе требуется дебаг-карта. \ No newline at end of file diff --git a/Applications/FuckTheRain/FuckTheRain.lua b/Applications/FuckTheRain/FuckTheRain.lua new file mode 100644 index 00000000..7cb2a3f7 --- /dev/null +++ b/Applications/FuckTheRain/FuckTheRain.lua @@ -0,0 +1,77 @@ + +local ecs = require("ECSAPI") +local event = require("event") +local component = require("component") +local computer = component.computer +local debug + +_G.fuckTheRainSound = true + +if not component.isAvailable("debug") then + ecs.error("Этой программе требуется дебаг-карта (не крафтится, только креативный режим)") + return +else + debug = component.debug +end + +local world = debug.getWorld() + +local function dro4er() + if world.isRaining() or world.isThundering() then + world.setThundering(false) + world.setRaining(false) + if _G.fuckTheRainSound then computer.beep(1500) end + end +end + +local function addDro4er(howOften) + _G.fuckTheRainDro4erID = event.timer(howOften, dro4er, math.huge) +end + +local function removeDro4er() + event.cancel(_G.fuckTheRainDro4erID) +end + +local function ask() + local cyka1, cyka2 + if _G.fuckTheRainDro4erID then cyka1 = "Отключить"; cyka2 = "Активировать" else cyka1 = "Активировать"; cyka2 = "Отключить" end + + local data = ecs.universalWindow("auto", "auto", 36, 0x373737, true, + {"EmptyLine"}, + {"CenterText", ecs.colors.orange, "FuckTheRain"}, + {"EmptyLine"}, + {"CenterText", 0xffffff, "Данная программа работает в отдельном"}, + {"CenterText", 0xffffff, "потоке и атоматически отключает дождь,"}, + {"CenterText", 0xffffff, "если он начался"}, + {"EmptyLine"}, + {"Selector", 0xffffff, ecs.colors.orange, cyka1, cyka2}, + {"EmptyLine"}, + {"Switch", ecs.colors.orange, 0xffffff, 0xffffff, "Звуковой сигнал", _G.fuckTheRainSound}, + {"EmptyLine"}, + {"Slider", 0xffffff, ecs.colors.orange, 1, 100, 10, "Частота проверки: раз в ", " сек"}, + {"EmptyLine"}, + {"Button", {ecs.colors.orange, 0xffffff, "OK"}, {0x999999, 0xffffff, "Отмена"}} + ) + + if data[4] == "OK" then + + + if data[1] == "Активировать" then + addDro4er(data[3]) + else + removeDro4er() + end + + _G.fuckTheRainSound = data[2] + end +end + +ask() + + + + + + + + diff --git a/Applications/FuckTheRain/Icon.pic b/Applications/FuckTheRain/Icon.pic new file mode 100644 index 00000000..4b66581c Binary files /dev/null and b/Applications/FuckTheRain/Icon.pic differ