Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xlog if a character is in your screen
#1
Hello, i would like an script that would Xlog if a specific character name is in your screen after second Log out.

I know there's a function in alerts that can do the Xlog but i have marked "Logout instead of Xlog" so i would need a persistent script that would Xlog if a specific player would be on screen for second time after logout, for example 

16:04:54 - Alerts->Player on Screen: XXX
16:07:54 - Alerts->Player on Screen: XXX

Then XLOG instead of logout

I have a persistent script that relog after X minutes if my character is logged out, so i would need a script that if same player that i specify is in the screen to just Xlog directly, to avoid kill.
Reply

#2
Hello.

Try this
PLAYERS_SCREEN = PLAYERS_SCREEN or { }

if connected() then
    local players = getcreatures('pfs')
    for _, player in ipairs(players) do
        if table.find(PLAYERS_SCREEN, player.id) == nil then
            table.insert(PLAYERS_SCREEN, player.id)
            print('Logout. ' .. player.name .. ' is on screen for the first time.')
            logout()
        else
            printerror('Xlogging. ' .. player.name .. ' is on screen again.')
            xlog()
        end
        break
    end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016