Jump to content
  • 0

Kick player if inactive while dialog "mes" is open (avoid mes from changing to "close")


Question

Posted (edited)

if you open a dialog "mes" with OnPCLoginEvent, let's say:
 

-    script    test015677    -1,{

    OnPCLoginEvent: 
             mes "Welcome to rAthena";
             next;
             mes "Hello";
    close;
}


If you wait about 1 minute without clicking next, it will change next for close. Is there a way to kick the player if that happens? Or maybe avoid the button from changing to close.

Edited by Syon

5 answers to this question

Recommended Posts

  • 0
Posted
On 9/30/2022 at 9:18 AM, Syon said:

Or maybe avoid the button from changing to close

-	script	test015677	-1,{
    OnPCLoginEvent: 
		ignoretimeout 1;   // <------- ADD THIS
		mes "Welcome to rAthena";
		next;
		mes "Hello";
		close;
}

 

  • Upvote 1
  • 1
Posted
5 hours ago, Syon said:

Hi, @Start_,

Thanks for replying. I couldn't find any reference of attachtimer in script_commands.txt. Could you point me to the documentation or share a sample? Thanks!

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6998

These timers are stored as part of the player.

-   script test015677   -1,{
OnPCLoginEvent: 
    addtimer 60000,"test015677::On60secs"; // Apply Timer...
    end;

On60secs:
	dispbottom "60 seconds have passed!";
    if(checkidle() >= 60 && !checkchatting() && !checkvending()) // Check if idle for 60 seconds or more and not in a chatroom and not vending.
        atcommand "@kick " + strcharinfo(0); // Is it even possible to kick yourself? xD
    else
        addtimer 60000,"test015677::On60secs"; // Reapply timer...
	end;
}

 

  • Upvote 1
  • 0
Posted
5 hours ago, Emistry said:
-	script	test015677	-1,{
    OnPCLoginEvent: 
		ignoretimeout 1;   // <------- ADD THIS
		mes "Welcome to rAthena";
		next;
		mes "Hello";
		close;
}

 

It was exactly what I was looking for, @Emistry! Thank you so much.
@Skorm you gave me a hint for another part of the script. Thanks!
SOLVED

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

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