Jump to content

quest to disconnect staff member after X minutes afk ?


Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Active Member

quest afkauto begin
	state start begin
	end
	state run begin
		when login begin
			if(game.get_event_flag("afk_mod") == 0) then
				return
			else
				if(pc.getqf("afk") == 0) then
					pc.setqf("limit_time",get_time()+15*60)
					pc.setqf("afk",1)
					pc.setqf("localy",pc.get_local_y())
					pc.setqf("localx",pc.get_local_x())
					timer("Check",10)
				elseif(pc.getqf("afk") == 1 and not pc.is_polymorphed() and not pc.is_gm()) then
					if(get_time() >= pc.getqf("limit_time") and pc.getqf("localy") == pc.get_local_y() and pc.getqf("localx") == pc.get_local_x()) then
						command("logout")
						notice_in_map(pc.name.." Afk moduna geçmiştir.Bu yüzden oyundan çıkartıldı. [AFK-MOD] ")
						notice_all("Writer By : Mehmet")
						pc.setqf("afk",0)
					else
						timer("Check",10)
					end
				else
					timer("Check",10)
				end
			end
		end
		
		when Check.timer begin
			if(game.get_event_flag("afk_mod") == 0) then
				return
			else
				if(pc.getqf("afk") == 0) then
					pc.setqf("limit_time",get_time()+15*60)
					pc.setqf("afk",1)
					pc.setqf("localy",pc.get_local_y())
					pc.setqf("localx",pc.get_local_x())
				 elseif(pc.getqf("afk") == 1 and not pc.is_polymorphed()) then
					if(get_time() >= pc.getqf("limit_time") and pc.getqf("localy") == pc.get_local_y() and pc.getqf("localx") == pc.get_local_x()) then
						command("logout")
						notice_in_map(pc.name.." Afk moduna geçmiştir.Bu yüzden oyundan çıkartıldı. [AFK-MOD] ")
						notice_all("Writer by : Mehmet")
						pc.setqf("afk",0)
						cleartimer("Checkone")
						cleartimer("Check")						
					else
						timer("Checkone",10)
					end
				else
					timer("Checkone",10)
				end
			end
		end
		
		when Checkone.timer begin
			if(game.get_event_flag("afk_mod") == 0) then
				return
			else
				if(pc.getqf("afk") == 0) then
					pc.setqf("limit_time",get_time()+15*60)
					pc.setqf("afk",1)
					pc.setqf("localy",pc.get_local_y())
					pc.setqf("localx",pc.get_local_x())
				 elseif(pc.getqf("afk") == 1 and not pc.is_polymorphed()) then
					if(get_time() >= pc.getqf("limit_time") and pc.getqf("localy") == pc.get_local_y() and pc.getqf("localx") == pc.get_local_x()) then
						command("logout")
						notice_in_map(pc.name.." Afk moduna geçmiştir.Bu yüzden oyundan çıkartıldı. [AFK-MOD] ")
						notice_all("Writer by : Mehmet")
						pc.setqf("afk",0)
						cleartimer("Checkone")
						cleartimer("Check")
					else
						timer("Check",10)
					end
				else
					timer("Check",10)
				end
			end
		end 

 

Writed by Aveline, I hope that would be enough

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 113

      Ulthar SF V2 (TMP4 Base)

    2. 2

      Feeding game source to LLM

    3. 0

      Target Information System

    4. 2

      Feeding game source to LLM

    5. 2

      anti exp explanation pls

    6. 2

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.