Da ich mal wieder langweile hatte, habe ich ein Tag-Nacht-Script für mein Tool Diabolus geschrieben.
Einbau:
German
English
1.) Ladet euch
runter und entpackt diabolus.zip!
2.) Lest euch am Besten alle Infos vom Hauptprogramm (Diabolus) durch.
3.) Speichert dieses Script als "day_night.lua" ab:
4.) Passt die Daten an (Näher erläutert bei "Wichtige Info" @
).
5.) Zieht die neue Datei ("day_night.lua") auf die diabolus.exe.
6.) Bewundert das Script xD
runter und entpackt diabolus.zip!2.) Lest euch am Besten alle Infos vom Hauptprogramm (Diabolus) durch.
3.) Speichert dieses Script als "day_night.lua" ab:
Code:
--http://www.lua.org/pil/22.1.html
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end
ret = metin2.rcon_connect(HOST, PORT, PASSWORD)
if ret then
print "Connection is successfully established."
else
print "Connection could not be establish."
end
notice_array = {"It is day.", "It is night."}
while ret do
hours = tonumber(os.date("%H"))
if hours > 6 and hours < 19 then
ret = metin2.day()
if ret then
print "Day sent successfully."
else
print "An error has occurred."
break
end
ret = metin2.notice(notice_array[1])
if ret then
print "Notice sent successfully."
else
print "An error has occurred."
break
end
hours = tonumber(os.date("%H"))
minutes = tonumber(os.date("%M"))
seconds = tonumber(os.date("%S"))
if hours > 19 then
sleep(((24-hours+19)*60*60)-(minutes*60)-seconds)
else
sleep(((19-hours)*60*60)-(minutes*60)-seconds)
end
else
ret = metin2.night()
if ret then
print "Night sent successfully."
else
print "An error has occurred."
break
end
ret = metin2.notice(notice_array[2])
if ret then
print "Notice sent successfully."
else
print "An error has occurred."
break
end
hours = tonumber(os.date("%H"))
minutes = tonumber(os.date("%M"))
seconds = tonumber(os.date("%S"))
if hours > 7 then
sleep(((24-hours+7)*60*60)-(minutes*60)-seconds)
else
sleep(((7-hours)*60*60)-(minutes*60)-seconds)
end
end
end
sleep(1)
metin2.rcon_disconnect()
).5.) Zieht die neue Datei ("day_night.lua") auf die diabolus.exe.
6.) Bewundert das Script xD
1.) Download
and unpack diabolus.zip!
2.) Read all the information from the main program (Diabolus), please.
3.) Save this script as "day_night.lua" off:
4.) Fits the data (explained in "Wichtige Info" @
).
5.) Put the new file ("day_night.lua") on the diabolus.exe.
6.) Admire the script xD
and unpack diabolus.zip!2.) Read all the information from the main program (Diabolus), please.
3.) Save this script as "day_night.lua" off:
Code:
--http://www.lua.org/pil/22.1.html
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end
ret = metin2.rcon_connect(HOST, PORT, PASSWORD)
if ret then
print "Connection is successfully established."
else
print "Connection could not be establish."
end
notice_array = {"It is day.", "It is night."}
while ret do
hours = tonumber(os.date("%H"))
if hours > 6 and hours < 19 then
ret = metin2.day()
if ret then
print "Day sent successfully."
else
print "An error has occurred."
break
end
ret = metin2.notice(notice_array[1])
if ret then
print "Notice sent successfully."
else
print "An error has occurred."
break
end
hours = tonumber(os.date("%H"))
minutes = tonumber(os.date("%M"))
seconds = tonumber(os.date("%S"))
if hours > 19 then
sleep(((24-hours+19)*60*60)-(minutes*60)-seconds)
else
sleep(((19-hours)*60*60)-(minutes*60)-seconds)
end
else
ret = metin2.night()
if ret then
print "Night sent successfully."
else
print "An error has occurred."
break
end
ret = metin2.notice(notice_array[2])
if ret then
print "Notice sent successfully."
else
print "An error has occurred."
break
end
hours = tonumber(os.date("%H"))
minutes = tonumber(os.date("%M"))
seconds = tonumber(os.date("%S"))
if hours > 7 then
sleep(((24-hours+7)*60*60)-(minutes*60)-seconds)
else
sleep(((7-hours)*60*60)-(minutes*60)-seconds)
end
end
end
sleep(1)
metin2.rcon_disconnect()
).5.) Put the new file ("day_night.lua") on the diabolus.exe.
6.) Admire the script xD






