Police Afk in the woe!

OmarAcero

New member
Messages
173
Points
0
Location
Lima-Perú
Github
https://github.com/OmarAcero
Emulator
Hello friends, I would like to ask for help, in to make a script that activates police only in woe, and to detect users who are in afk for 5 minutes and transferred to your point saved or  kick of server...

Code:
-	script	afkwoe	-1,{//-- If woe on, Start the ScriptOnAgitStart:attachnpctimer ""+strcharinfo(0)+"";initnpctimer;end;}OnTimer30000://Check if only users afkif(checkvending() >= 1 || checkchatting() == 1) {dispbottom "The Police, has detected him as bot because you were in afk  a long time  during woe";stopnpctimer;//atcommand "@kick "+strcharinfo(0)+"";warp "SavePoint",0,0;end;}
 
Last edited by a moderator:
something like this:

- script afkwoe -1,{OnAgitStart: attachnpctimer ""+strcharinfo(0)+""; initnpctimer; end;OnTimer30000: if(checkafk() > 0 && getmapflag(strcharinfo (3), mf_gvg_castle)) { dispbottom "The Police, has detected him as bot because you were in afk a long time during woe"; stopnpctimer; warp "SavePoint",0,0; end; }}
(not tested)

 
hmm error!  9(>.<)9"

A question,  exist the función "checkafk"  ????

Sin_t_tulo.jpg


 
Last edited by a moderator:
man, not work, i am trying with:   mf_gvg_castle ;   mf_gvg;   and   mf_nowarp ;   this is result: 

- script afkwoe -1,{OnAgitStart: attachnpctimer ""+strcharinfo(0)+""; initnpctimer; end; OnTimer30000: if(checkidle() > 0 && getmapflag(strcharinfo (3), mf_nowarp)) { dispbottom "The Police, has detected him as bot because you were in afk a long time during woe"; stopnpctimer; warp "SavePoint",0,0; end; }}
Sin_t_tulo2.jpg


 
Last edited by a moderator:
Uhh. That script will not work. First of all who are you attaching script to? I'd suggest adding OnMapLoadEvent and add loadevent mapflag to the maps that interest you. Second of all, using checkidle like this will net you kicking almost all players that haven't moved for a sec or more.

- script afkwoe -1,{OnLoadMapEvent: if( !woetimer && (agitcheck() || agitcheck2()) && (getmapflag(strcharinfo (3), mf_gvg_castle) || getmapflag(strcharinfo (3), mf_gvg)) ) { addtimer 30000,strnpcinfo(0) + "::OnCheck"; woetimer = 1; //To prevent multiple timers on same character } end;OnCheck: if( checkidle() > 300 && (agitcheck() || agitcheck2()) && (getmapflag(strcharinfo (3), mf_gvg_castle) || getmapflag(strcharinfo (3), mf_gvg)) ) { //He's still on GvG map and was AFK for 300 seconds (5 minutes) dispbottom "You were kicked for being AFK for more than 5 minutes inside GvG zone."; warp "SavePoint",0,0; woetimer = 0; end; } else if( !(getmapflag(strcharinfo (3), mf_gvg_castle) || getmapflag(strcharinfo (3), mf_gvg)) || !(agitcheck() || agitcheck2()) ) { //He's not in castle anymore or WoE ended woetimer = 0; end; } addtimer 30000,strnpcinfo(0) + "::OnCheck"; //Still on map, WoE still going, and not idling for 5 minutes. Need a recheck in another 30 secs. end; OnPCLogoutEvent: woetimer = 0; //To keep it clean, if you have some central PCLogoutEvent, may add it there. end;}
But not tested.

 
Code:
-	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";} 
 
- 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";} 
Working good*

 
Code:
-    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:    addtimer .timetocheck*1000,strnpcinfo(3)+"::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;    }}
 
Back
Top