Hello.
1st script
local LIST = { 'Char1', 'Char2', 'Char3' }
local RingID_NotInUse = 3051
local RingID_InUse = 3088
if paround(0, table.unpack(LIST)) > 0 then
local ring = finger()
if ring.id ~= RingID_InUse then
moveitems(RingID_NotInUse, 'finger')
end
else
local ring = finger()
if ring.id == RingID_InUse then
moveitems(RingID_InUse, '0', 'finger')
end
end
2nd script
local RingID_NotInUse = 3051
local RingID_InUse = 3088
local flag = false
local creatures = getcreatures()
for _, creature in ipairs(creatures) do
if creature.skull == 4 then
flag = true
break
end
end
if flag then
local ring = finger()
if ring.id ~= RingID_InUse then
moveitems(RingID_NotInUse, 'finger')
end
else
local ring = finger()
if ring.id == RingID_InUse then
moveitems(RingID_InUse, '0', 'finger')
end
end
3rd script
local MESSAGE = 'Server is restarting in'
local ALERT_TIMES = 5
if connected() then
MESSAGE = MESSAGE:lower()
local flag = false
local screen_message = screenmessage(true)
if screen_message ~= nil and screen_message ~= '' then
screen_message = screen_message:lower()
if string.find(screen_message, MESSAGE) then
flag = true
end
end
if flag == false and ischannelselected('Server Log') then
local messages = getnewmessages()
for _, msg in ipairs(messages) do
if msg.type == 3 and string.find(msg.content:lower(), MESSAGE) then
flag = true
break
end
end
end
if flag then
for i = 1, ALERT_TIMES do
playsound('default')
flashclient()
wait(100)
end
end
end
3rd script for multiple messages
local MESSAGES = {
'Server is restarting in',
'Server is saving in',
}
local ALERT_TIMES = 5
if connected() then
local flag = false
local screen_message = screenmessage(true)
if screen_message ~= nil and screen_message ~= '' then
screen_message = screen_message:lower()
for _, text in ipairs(MESSAGES) do
if string.find(screen_message, text:lower()) then
flag = true
break
end
end
end
if flag == false and ischannelselected('Server Log') then
local messages = getnewmessages()
for _, msg in ipairs(messages) do
if msg.type == 3 then
local messageContent = msg.content:lower()
for __, text in ipairs(MESSAGES) do
if string.find(messageContent, text:lower()) then
flag = true
break
end
end
end
end
end
if flag then
for i = 1, ALERT_TIMES do
playsound('default')
flashclient()
wait(100)
end
end
end