mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-06 11:12:40 +01:00
Новая тру-прожка
This commit is contained in:
parent
78b77f1557
commit
c3f7239bcb
@ -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",
|
||||
|
||||
@ -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
|
||||
|
||||
@ -15,7 +15,8 @@ local keys = {
|
||||
[57] = "moveUp",
|
||||
[46] = "changeColor",
|
||||
[18] = "OTSOS",
|
||||
[16] = "swing",
|
||||
[16] = "dropAll",
|
||||
[33] = "toggleLeash",
|
||||
}
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
1
Applications/FuckTheRain/About.txt
Normal file
1
Applications/FuckTheRain/About.txt
Normal file
@ -0,0 +1 @@
|
||||
Простой мультипоточный скрипт, которую я написал по большей части для себя: дождь в одинойчной игре заебал меня настолько, насколько это вообще возможно. Для работы программе требуется дебаг-карта.
|
||||
77
Applications/FuckTheRain/FuckTheRain.lua
Normal file
77
Applications/FuckTheRain/FuckTheRain.lua
Normal file
@ -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()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
Applications/FuckTheRain/Icon.pic
Normal file
BIN
Applications/FuckTheRain/Icon.pic
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user