forked from Ascerr/Lua-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBed Regeneration.lua
More file actions
51 lines (32 loc) · 1.35 KB
/
Bed Regeneration.lua
File metadata and controls
51 lines (32 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--[[
Script Name: Bed Regeneration
Description: Relogin to game every some time for a couple of seconds for make runes and use bed (sleep)
Author: Ascer - example
]]
local BED_SLEEP_TIME = 0.5 -- mintues we are stay offline in bed.
local STAY_LOGGED_SECONDS = 15 -- amount of seconts we stay logged before use bed.
local BED_POS = {31329, 32431, 7} -- position of bed in house.
local BED_ID = 2488 -- ID of bed
-- DONT'T EDIT BELOW THIS LINE
local mainTime = 0
-- mod to run functions
Module.New("Bed Regeneration", function (mod)
-- check if we should login.
if (os.clock() - mainTime) >= (BED_SLEEP_TIME * 60) then
-- if we are connected to game.
if Self.isConnected() then
-- wait 15s
wait(STAY_LOGGED_SECONDS * 1000)
-- set logout true
logout = true
-- use house bed
Map.UseItem(BED_POS[1], BED_POS[2], BED_POS[3], BED_ID, 0)
-- set time to wait before we login again
mainTime = os.clock()
else
-- reconnect to game
Rifbot.PressKey(13, 2000) -- press enter key
end
end
mod:Delay(200, 350)
end)