From 56a20bb18d6fde61bb82cf160a131eb54d464148 Mon Sep 17 00:00:00 2001 From: Mysteries Date: Sun, 10 Feb 2013 22:22:23 -0500 Subject: Merged rAthena Changes - Added checkidle() command that was present in rAthena since r17126 - Documented checkidle() function - More clearly defined variables in eA Job System documentation - Added missing 'stopnpctimer' in custom Cluckers script --- src/map/script.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index a6d588113..b89121ee4 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14968,6 +14968,23 @@ BUILDIN_FUNC(checkchatting) // check chatting [Marka] return 0; } +BUILDIN_FUNC(checkidle) +{ + TBL_PC *sd = NULL; + + if (script_hasdata(st, 2)) + sd = map_nick2sd(script_getstr(st, 2)); + else + sd = script_rid2sd(st); + + if (sd) + script_pushint(st, DIFF_TICK(last_tick, sd->idletime)); + else + script_pushint(st, 0); + + return 0; +} + BUILDIN_FUNC(searchitem) { struct script_data* data = script_getdata(st, 2); @@ -17689,6 +17706,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(roclass,"i?"), //[Skotlex] BUILDIN_DEF(checkvending,"?"), BUILDIN_DEF(checkchatting,"?"), + BUILDIN_DEF(checkidle,"?"), BUILDIN_DEF(openmail,""), BUILDIN_DEF(openauction,""), BUILDIN_DEF(checkcell,"siii"), -- cgit v1.2.3-60-g2f50