ID:142831
 
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
Those are all horrible, horrible, horrible, and you should not use them.

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.
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
hatchet
name = "hatchet"
icon = 'hatchet.dmi'
worn = 0
price = 2000
density=1
ammount=1
oname="hatchet"
New()
..()
spawn()
src.CheckAmount()
proc
CheckAmount()
src.name= "[oname] ([src.ammount])"
verb
Wear()
if(src.worn)
src.worn = 0
usr.overlays -= 'hatchet.dmi'
usr.overlays -= 'hatchet.dmi'
usr << "You remove the [src.name]."
src.suffix = ""
usr.swordD = 0
else
src.worn = 1
usr.overlays += 'hatchet.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"
usr.swordD = 100
Look()
usr<<"This a standard hatchet."
Drop()
if(src.worn)
usr << "Not while its being worn."
return
for(var/obj/hatchet/O in usr.contents)
if(O.ammount<=0)
del(src)
else
var/drop = input("How many hatchet do you wish to drop?")as num
if(src.ammount>drop)
usr<<"You don't have that many to drop."
if(drop<=0)
usr<<"You cannot do that."
if(src.ammount>=drop)
src.ammount-=drop
var/obj/hatchet/B = new/obj/hatchet
B.loc=locate(usr.x,usr.y-1,usr.z)
B.ammount=drop
view(usr)<<"[usr] drops [drop] hatchet."
if(src.ammount<=0)
del(src)
usr.SaveK()
Get()
set src in oview(1)
usr<<"You picked up a [src]"
usr.hatchet+=1
src.icon_state=""
var/counter=0
for(var/obj/hatchet/O in usr.contents)
counter+=1
if(counter<=0)
Move(usr)
else
for(var/obj/hatchet/O in usr.contents)
O.ammount+=src.ammount
O.name= "[O.name] ([O.ammount])"
del(src)
Throw()
if(usr.firing)
return
if(usr.weaponthrow)
return
var/obj/hatchet/K = new()
K.icon_state="Throw"
usr.overlays -= 'hatchet.dmi'
if(src.worn)
src.worn=0
usr.swordD = 0
usr.hatchet-=1
K.tai=usr.tai
K.dir = usr.dir
usr.weaponthrow=1
K.Move_Delay=1.5
K.Gowner=usr
walk(K,usr.dir)
for(var/obj/hatchet/O in usr.contents)
O.ammount-=1
if(O.ammount<=0)
del(O)
else
src.name="[O.oname] ([O.ammount])"
sleep(13)
usr.weaponthrow=0
sleep(20)

Bump(A)
var/mob/O = src.Gowner
if(istype(A,/obj/Log))
for(var/obj/Log/L in oview(3,O))
if(L)
O<<"You cannot be that close to the log"
O.weaponthrow=0
del(src)
return
O.random=rand(1,5)
if(O.random==1)
O.taiexp+=rand(1,7)
O.taiup()
if(O.random==3)
O.ninexp+=rand(1,7)
O.ninup()
if(O.random==2)
O.random=rand(1,25)
if(O.random==5)
O.Mnin+=rand(1,2)
O.nin=O.Mnin
O<<"<font color=blue>Your Ninjutsu has increased!"
if(O.random==1)
O.Mtai+=rand(1,2)
O.tai=O.Mtai
O<<"<font color=blue>Your Taijutsu has increased!"
if(O.random==9)
O.random=rand(1,5)
if(O.random==5)
O<<"Your hatchet skill increases!"
O.hatchetskill+=1
if(ismob(A))
var/mob/M = A
if(M.Kaiten||M.sphere)
return
var/damage = round(src.tai*2)
if(damage >= 1)
M.health -= damage
view(M) << "[M] was hit by [O]'s hatchet for [damage] damage!!"
M.Death(O)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)