Jump to content
  • 0

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


Syon

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   10
  • Joined:  10/31/16
  • Last Seen:  

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
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 1

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   167
  • Joined:  04/05/13
  • Last Seen:  

Use 'attachtimer' to those character and use 'atcommand' kick

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   10
  • Joined:  10/31/16
  • Last Seen:  

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!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   10
  • Joined:  10/31/16
  • Last Seen:  

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

Link to comment
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.   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.

×
×
  • Create New...