Jump to content

Question

Hello,

 

I'd like know if anyone could edit this script that Dastgir made. I would like to kick all the players from all maps that are afk for 6 hours.

 

 

-	script	afkwoe	-1,{OnInit:	.timetocheck = 30;		//Seconds after which idle is checked.	.idle_time = 30;		//Idle time in seconds, from which one can be warped.end;OnPCLoginEvent:	addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckAFK";	end;                                                               OnCheckAFK:	if(checkidle() >= .idle_time && getmapflag(strcharinfo (3), mf_gvg)) {		dispbottom "The Police, has detected him as bot because you were in afk a long time during woe";		warp "SavePoint",0,0;		end;	}	addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckAFK";} 

 

Kind Regards,

 

Yoh.

Edited by Yoh Asakura

Share this post


Link to post
Share on other sites

19 answers to this question

Recommended Posts

  • 0

Edit and adjust the setting .idle_time accordingly.

OnCheckAFK:	if( checkidle() >= .idle_time ) {	    atcommand "@kick" + strcharinfo(0);		end;	}
Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

Seconds between each check. If you'll set it to 60 it'll trigger once a minute, if you'll set it to 3600, it'll trigger once an hour. And so on.

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

Example:

 

OnInit:	.timetocheck = 60;		//Seconds after which idle is checked.	.idle_time = 3600;		//Idle time in seconds, from which one can be warped.

 

This way it will check every minute if any player is afk for 1 hour, is that right?

Share this post


Link to post
Share on other sites
  • 0

Not working.

 

It's not kicking...no error in ssh.

Try this, buddy:

 

-    script    afkwoe    -1,{    OnInit:        .timetocheck = 60;	    //Seconds after which idle is checked.        .idle_time = 3600;	    //Idle time in seconds, from which one can be warped.        end;    OnPCLoginEvent:        addtimer .timetocheck*1000,strnpcinfo(1)+"::OnCheckAFK";        end;                                                                       OnCheckAFK:        if(checkidle() >= .idle_time) {            atcommand "@kick "+ strcharinfo(0);            end;        }        addtimer .timetocheck*1000,strnpcinfo(1)+"::OnCheckAFK";        end;}
Edited by Oxxy

Share this post


Link to post
Share on other sites
  • 0

Not working.

 

It's not kicking...no error in ssh.

The script was to detect afk on Gvg maps, oxxy changes would make it for all maps.

Share this post


Link to post
Share on other sites
  • 0

@@Dastgir

I know that. I followed what @Gaar mentioned but it's still not working.

 

 

OnCheckAFK:    if( checkidle() >= .idle_time ) {	    atcommand "@kick" + strcharinfo(0);	    end;    }

 

Share this post


Link to post
Share on other sites
  • 0

Hello,

 

I'd like know if anyone could edit this script that Dastgir made. I would like to kick all the players from all maps that are afk for 6 hours.

 

 

-	script	afkwoe	-1,{OnInit:	.timetocheck = 30;		//Seconds after which idle is checked.	.idle_time = 30;		//Idle time in seconds, from which one can be warped.end;OnPCLoginEvent:	addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckAFK";	end;                                                               OnCheckAFK:	if(checkidle() >= .idle_time && getmapflag(strcharinfo (3), mf_gvg)) {		dispbottom "The Police, has detected him as bot because you were in afk a long time during woe";		warp "SavePoint",0,0;		end;	}	addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckAFK";} 

 

Kind Regards,

 

Yoh.

 

here you go.

http://pastebin.com/f04Vk6Pp

Share this post


Link to post
Share on other sites
  • 0

set .afk_timer, 1000;

 

1000 = 1 second

 

well, better explanation: the time is in milliseconds.

Share this post


Link to post
Share on other sites
  • 0

@@Yoh Asakura

 

just change this line

    set .afk_timer, 1000*60; //Timer in milliseconds(Formula 1000=1second(do not change) / 60=1minute(do not change).
    set .Max_Idle_Time, 60*60*6; //Maximum Time for IDLE Characters (60=seconds / 60=minutes / 6=hours)
 
change it to this :
    set .afk_timer, 1000*1;
    set .Max_Idle_Time, 60*1;
 
or
    set .afk_timer, 1000;
    set .Max_Idle_Time, 60;

Share this post


Link to post
Share on other sites
  • 0

it was in above post
 

    set .afk_timer, 1000*60; //Timer in milliseconds(Formula 1000=1second(do not change) / 60=1minute(do not change).    set .Max_Idle_Time, 60*60*6; //Maximum Time for IDLE Characters (60=seconds / 60=minutes / 6=hours)

 

 

just remove the set .afk_timer, 1000*60;

and look like this .afk_timer, 1000;

 

and remove set .Max_Idle_Time, 60*60*6;

and look like this .Max_Idle_Time, 60*60;

Edited by Zhao Chow

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.