obj
Friends
Friend
name = ""
Status = ""
Level = 0
Race = ""
Class = ""
Source = ""
var/src = /obj/Friends/Friend
verb
Remove_Friend()
set category = null
switch(alert("Are you sure you wish to remove [src.name] from your Friends List?","Removal Confirmation","Yes","No"))
if("Yes")
usr << "You have removed [src.name] from your Friends List"
del(src)
else
return
mob
verb
Add_Friend()
var/friendname = input("Who would you like to add to your freinds list?","Add Friend") as text
for(var/mob/Player/M in world)
if(friendname == "")
src << "You must enter a name to add."
else
if(M.Name == friendname)
src.contents += new /obj/Friends/Friend
for(var/obj/Friends/Friend/O in src.contents)
if(O.name == "")
O.Source = M.ckey
O.name = M.Name
O.Level = M.Level
O.Race = M.Race
O.Class = M.Class
O.suffix = "Level [O.Level] [O.Race] [O.Class] - [O.Status]"
Check_Friend_Status(O)
else
src << "There appears to be no person called [friendname] logged in."
mob
proc
Check_Friend_Status()
for(var/mob/Player/M in world)
if(M.Name == src.name && M.ckey == src.Source)
src.Status = "Online"
sleep(300)
return .(Check_Friend_Status(src))
else
src.Status = "Offline"
sleep(300)
return .(Check_Friend_Status(src))
Problem description:The problem is that the status of the friend does not get updated for some reason.
I am testing this by adding myself as a friend then renaming my character.
This system is attempting to make use of a Statpanel just so you know, hense why O has a suffix.
in the proc?
also...get rid of the return deals, they aren't needed
and why are you waiting 30 seconds to update?
also, the reason it isn't updating is because it only asks for the variables once and then it keeps them. You need to put that in another proc that repeats.
see it doesn't update because it only asks once, you need to make it refresh