• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Auto-Clean/Auto-Save/Auto-Restart.

Status
Not open for further replies.

Elaajten

Member
Joined
Apr 8, 2009
Messages
19
Reaction score
5
How to find these? I was when it's clean its coming up " Auto-Clean in 1 minutes. " and then it comes /clean, when I not type it. Same with Auto Save, I want text when it will be Save.
I need Auto Restart also, Thanks.
 
You can edit these in your globalevents folder.

As for the auto restarter it depends on what OS you're using.
 
How to find these? I was when it's clean its coming up " Auto-Clean in 1 minutes. " and then it comes /clean, when I not type it. Same with Auto Save, I want text when it will be Save.
I need Auto Restart also, Thanks.

Please use the request board next time.

Anyway, I'll help you.

Go to /data/globalevents/scripts/
Create a new lua file called save.lua
Insert:
Code:
function executeSave()
	doSaveServer()
	doBroadcastMessage("Server saved, next save in 30 minutes.")
	return TRUE
end

function onThink(interval, lastExecution)
	doBroadcastMessage("Server saving in 1 minute!")
	addEvent(executeSave, 100000)
	return TRUE
end
Then create another lua file called clean.lua
Insert:
Code:
function executeClean()
	doCleanMap()
	doBroadcastMessage("Game map cleaned, next clean in 2 hours.")
	return TRUE
end

function onThink(interval, lastExecution)
	doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!")
	addEvent(executeClean, 100000)
	return TRUE
end
Then go to /data/globalevents/ and open globalevents.xml
Add these 2 lines:
Code:
<globalevent name="save" interval="1800" event="script" value="save.lua"/>
<globalevent name="clean" interval="7200" event="script" value="clean.lua"/>
 
there is anyway to show, how many items cleaned?
 
The doCleanMap() command returns a value when executed, that value is the amount of items cleaned, so thus you could do something like this:

Code:
function onSay (cid, msg, param)

local clean = doCleanMap()

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESC, "The cleaning command collected " .. clean .. " items from the floor. Enjoy your new cleaner server.")

end

And it will say something like...

The cleaning command collected 65535 items from the floor. Enjoy your new cleaner server.
 
Hello!
Can anybody make an script for "Auto Reset" every 24h?

This person which do this will be reputet!
 
doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!")
addEvent(executeClean, 100000)

from when 100 seconds is 1 minute :<?
 
restart... I need somethink to restart server every 24h
 
Please use the request board next time.

Anyway, I'll help you.

Go to /data/globalevents/scripts/
Create a new lua file called save.lua
Insert:
Code:
function executeSave()
	doSaveServer()
	doBroadcastMessage("Server saved, next save in 30 minutes.")
	return TRUE
end

function onThink(interval, lastExecution)
	doBroadcastMessage("Server saving in 1 minute!")
	addEvent(executeSave, 100000)
	return TRUE
end
Then create another lua file called clean.lua
Insert:
Code:
function executeClean()
	doCleanMap()
	doBroadcastMessage("Game map cleaned, next clean in 2 hours.")
	return TRUE
end

function onThink(interval, lastExecution)
	doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!")
	addEvent(executeClean, 100000)
	return TRUE
end
Then go to /data/globalevents/ and open globalevents.xml
Add these 2 lines:
Code:
<globalevent name="save" interval="1800" event="script" value="save.lua"/>
<globalevent name="clean" interval="7200" event="script" value="clean.lua"/>

This is exactly what i need, but its not for 0.2.2. Any suggestions for ppl using TFS 0.2.2?
 
Status
Not open for further replies.
Back
Top