Hello.
Well, there are many ways to achieve that, but you can only do that if you run a LUA script on the bait character.
1. You can make bait character send a PM to other characters and once they receive the PM then logout.
1. You can make bait character write in a file and other characters reads this file then logout.
etc.
# Private message approach #
How it works: Bait character send a PM to other characters and once they receive the PM then logout. Alternatively (reason explained below), send a PM to another character which logouts then other characters logouts as well.
The downside of using the PM approach is that you would need to send messages to all the makers you want to log out. If you have a lot of characters, it will take a while to avoid getting mutated.
But this can be solved in a simple way: Using scripts to check the vip list on all makers except in one maker. This exception will use the script that will receive the private message and logout. So you will only send a private message to this maker and that maker will log out, so everyone else will log out too.
Example: Let's say that you have 5 characters. 1 character blocking path (let's call it 'bait character') and 4 characters making runes (let's call it makers A, B, C and D).
1. Use the script #1 on character blocking path (bait character). You should setup one of the makers names (for example: "maker A") on table "PLAYERS", so once bait character see a player, etc it will send a private message ONLY for "maker A".
2. Use the script #2 on "maker A". It will receive the private message from "bait character" then logout.
3. Add "maker A" to other makers (B, C and D) vip list, use the script #3 on the other makers (B, C and D). They will check if "maker A" is offline then logout.
Script #1 to be used on bait character to check and send private message. If you follow my recommendation, you just need to leave one maker name on the script below.
local PLAYERS = { 'main maker' } -- Players to send message.
local MESSAGE = 'player' -- Sends this message to players on table above.
local DELAY_BETWEEN_MESSAGES = 1500 -- Delay (in milliseconds) between writing a message to a player to avoid being muted.
local DELAY_BETWEEN_WARNINGS = 6 -- In seconds. How long should it wait between warnings. So you dont get warned multiple times about same.
local CHECK_PLAYERS = true -- Check for players.
local CHECK_PLAYERS_DIST = 5 -- Maximum distance to trigger this.
local CHECK_PLAYERS_SAFE = { 'main character' } -- Safe list.
local CHECK_HP = true -- Check for your health%.
local CHECK_HP_WARNING = 80 -- If your health% lower than that warn another player.
local CHECK_BATTLESIGN = true -- Check for battle sign.
if LAST_WARNING_TIME == nil then
LAST_WARNING_TIME = 0
end
if (runningtime() - LAST_WARNING_TIME) >= DELAY_BETWEEN_WARNINGS and ((CHECK_BATTLESIGN and battlesigned()) or (CHECK_HP and hppc() < CHECK_HP_WARNING) or (CHECK_PLAYERS and paroundignore(CHECK_PLAYERS_DIST, table.unpack(CHECK_PLAYERS_SAFE)) > 0)) then
for _, player in ipairs(PLAYERS) do
say('*' .. player .. '* ' .. MESSAGE)
if #PLAYERS > 1 and DELAY_BETWEEN_MESSAGES > 0 then
wait(DELAY_BETWEEN_MESSAGES)
end
end
LAST_WARNING_TIME = runningtime()
end
Script #2 to use on characters that will receive the private message. Once this character receives the private message, it will logout. If you follow my recommendation, you will use the script below only in a single maker, which should be listed on script above.
local PLAYER = 'bait character' -- Bait character name. To prevent someone (maybe even a GM) from discovering the message and making your makers log out.
local MESSAGE = 'player'
local LAST_PM = getlastprivatemessage()
if LAST_PM.visible and LAST_PM.sender:lower() == PLAYER:lower() and LAST_PM.content:lower() == MESSAGE then
logout()
end
Script #3 to use on other makers to check for the maker #1. When maker #1 logout then who's using this script will logout as well.
local VIPS = { 'main maker'} -- Characters to check. If one of them is offline then logout.
if connected() then
local vips = getviplist()
for _, vip in ipairs(vips) do
if vip.status == false and table.find(VIPS, vip.name) ~= nil then
logout()
break
end
end
end
# File approach #
How it works: Bait character writes in a file and other characters checks for this file then logout.
Script to be used on bait character to check and write file.
local FILE = 'runemaker' -- Writes on this file.
local CHECK_PLAYERS = true -- Check for players.
local CHECK_PLAYERS_DIST = 5 -- Maximum distance to trigger this.
local CHECK_PLAYERS_SAFE = { 'main character' } -- Safe list.
local CHECK_HP = true -- Check for your health%.
local CHECK_HP_WARNING = 80 -- If your health% lower than that warn another player.
local CHECK_BATTLESIGN = true -- Check for battle sign.
if (CHECK_BATTLESIGN and battlesigned()) or (CHECK_HP and hppc() < CHECK_HP_WARNING) or (CHECK_PLAYERS and paroundignore(CHECK_PLAYERS_DIST, table.unpack(CHECK_PLAYERS_SAFE)) > 0) then
file.rewrite(FILE, unixtime())
wait(500)
end
local FILE = 'runemaker' -- Check for this file.
if connected() then
local file_text = file.readfile(FILE)
if type(file_text) == 'string' and file_text ~= '' then
local timestamp = tonumber(file_text)
if timestamp ~= nil and math.abs(timestamp - unixtime()) <= 3 then
logout()
wait(1000)
end
end
end