Author Topic: Test "Nick" to see if user is online?  (Read 1561 times)

0 Members and 1 Guest are viewing this topic.

Offline HaArD

  • Double Ace
  • *
  • Posts: 104
  • Karma: +2/-1
Test "Nick" to see if user is online?
« on: 12 November, 2003, 05:40:21 »
Is there a way to determine if "Nick" is currently online?

I have seen workarounds that monitor logins and disconnects and track currently connected users that way but it's.... inelegant.

HaArD

PtokaX forum

Test "Nick" to see if user is online?
« on: 12 November, 2003, 05:40:21 »

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #1 on: 12 November, 2003, 07:27:14 »
GetItemByName(nick) - Returns user object of the nick
  nick - the nick of user.
it returns nil if the user is not in the hub.
Code: [Select]
if GetItemByName(nick) then
   user:SendData(Bot, nick.." is online")
else
   user:SendData(Bot, nick.." is offline")
end
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline HaArD

  • Double Ace
  • *
  • Posts: 104
  • Karma: +2/-1
(No subject)
« Reply #2 on: 12 November, 2003, 13:32:42 »
Sweet, thx Plop!!

PtokaX forum

(No subject)
« Reply #2 on: 12 November, 2003, 13:32:42 »