im using sven90 afk checker
and i was wondering how do i make it show how long they have been inactive
Code:
proc/AFKCHECK()//the afk checker
sleep(18000)//wait half an hour
checking = 1//make checking = 1
world<<"Talk in OOC to show your not afk!"//tell them to talk
sleep(300)//wait 30 seconds
for(var/mob/M in world)//Look through all the mobs in the world
if(M.afk&&!M.host&&M.client)//if they are afk and they arn't the host or a NPC
world<<"[M] has been booted!"//tell them they have been booted
del(M)//boot them
else
M.afk = 1
AFKCHECK()//Do the proc again
checking = 0
world.New()//when a new world is created
AFKCHECK()//Do the AFKCHECK proc
mob/proc/checkhost()//this is to see if they are the host
if(client) //the the mob has a client
if(client.address==null | client.address==world.address)//they have the same IP as the world
src.host = 1//make them host..
also i was wondering how to give a person tiered kill points? like if they kill a rank 1 and they are rank 1 they get 2 points but if they are rank 2 they get 1 point etc?
Problem description:
dont know how to do it
ID:142831
Feb 25 2008, 5:30 pm
|
|
In response to Garthor
|
|
as i said not my afk checker
but what i want is when it boots them offline i want to to tell me how long of an inactivity they have had when it boots them and was looking at the inactive thing too but then people can still use macros//bots and that what i want to avoid! also since it is you garthor who has responded and i see your name on damn near every code problem topic maybe you could also assist me in this i have 3 different object that are thrown im trying to make it so that as your skill raises you do more damage with them obj |
First, AFKCHECK() is being called recursively. That's a no-no, it's going to (slowly, admittedly) pointlessly eat up resources. It should be a while() loop.
Second, looping through every mob when you just want clients is dumb.
Third, just check the inactivity variable. Much better than doing some stupid goddamn "OMG TALK 2 SHO U R NUT EFKK". Talk about obnoxious.
Fourth, I don't even think "world.New()" should compile at all. It's just the wrong syntax. Also: calling AFKCHECK() so that it will never, ever return is very poor form.
Fifth, your if() statement in checkhost() is wrong. It's using the bitwise or | rather than the logical or || . And, of course, giving host powers to mobs rather than clients is a surefire way to end up with Bad News. Those should all be under client, not mob.
As for your other question... what the hell are you talking about?
Oh, right, and the code goes BETWEEN the <DM></DM> tags.