Jump to content

Utility: Ingame GM List


Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

File Name: Ingame GM List

File Submitter: DeadlySilence

File Submitted: 06 May 2013

File Category: Utilities

Content Author: DeadlySilence

This script shows a list of all GMs with their corresponding status (i.e. online or offline).

You can configure the script to show or hide the last login time of each GM.

As a special feature, the result is cached for a certain amount of time if you wish (see inline configuration, by default caching for 30 seconds is enabled). This prevents players from spamming the database with SELECT queries.

Version 2.0 comes with a source modification to show the group name the GM is in and the option to show the list directly in the user's chat (dispbottom) rather than the NPC dialogue.

Special thanks to Akinari for helping me with the script command and Armor for requesting this feature.

Instructions

To get version 2.0 working, you need to patch your src/map/script.c file with the "groupid.diff" and recompile.

To apply the patch use

patch -p0 < /location/to/the/groupid.diff

from your rAthena directory root.

If you use Windows and TortoiseSVN, you have to right click into your rAthena directory root, select "TortoiseSVN -> Apply Patch" and select the patch file. Click "patch all items" and you're done.

If you do not want to change your source for this, you can remove all occurences of "groupIdToName" inside the script to deactivate the automatic group name display.

Click here to download this file

  • Upvote 1
Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   2
  • Joined:  02/18/12
  • Last Seen:  

Thank you for sharing this bro ~ :) more power

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

NVM. Thank you!

Edited by Vlync
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

As requested by Armor, I updated the script a bit.

The group name of every GM (thus, his/her position on your server) is now shown in front of the name. To enable this feature you have to follow the instructions and apply the patch.

 

Thanks to Akinari for helping me with the script command and Armor for suggesting this feature.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  4
  • Reputation:   3
  • Joined:  07/06/13
  • Last Seen:  

A litte Bug Report,

 

Our Server Version: rAthena Verion SVN r17407

 

is it normal that every last login shows the exact same date/time?

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

Oh, I see the problem. I'll fix this later today, thanks for the bug report.

Should be fixed in version 2.1. Thanks for reporting.

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

Oh, I see the problem. I'll fix this later today, thanks for the bug report.

 

Should be fixed in version 2.1. Thanks for reporting.

 

sir have u fix it ? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

Oh, I see the problem. I'll fix this later today, thanks for the bug report.

 

Should be fixed in version 2.1. Thanks for reporting.

 

sir have u fix it ? 

I have fixed it one week ago with version 2.1 :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

 

Oh, I see the problem. I'll fix this later today, thanks for the bug report.

 

Should be fixed in version 2.1. Thanks for reporting.

 

sir have u fix it ? 

I have fixed it one week ago with version 2.1 :)

 

thx you.

i need to diff manually right ? :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

You don't need to diff it manually, you can simply replace your current version with the latest script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

sir i would like to ask, why all player online list are there ? 

what do i mistake ? 

here the source i edit.

 

http://pastebin.com/DcJngnXu

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

You need to configure it first.

// minimum level to be recognized as a GM
.minLevel = 0;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

You need to configure it first.

// minimum level to be recognized as a GM
.minLevel = 0;

 

yay! its works like charm. fuhh.. luckily no need to edit source . heheh :) Thanks alot bro :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

    parse_line: need ';'
    31 :        // if .msgToChat is enabled, send the list directly to the chat
    32 :        if (.msgToChat) {
    33 :
    34 :                dispbottom "GM List:";
    35 :                for (.@i = 0; .@i < getarraysize(.online$); .@i += 1) {
*   36 :                        dispbottom "[" + groupIdToName'('.group[.@i]) + "] " +.name$[.@i] + ": " + (("0" != .online$[.@i]) ? "online" : "offline" + ((.showLastOnline) ? ", last online at " + .date$[.@i] + " " + .time$[.@i] : ""));
    37 :                }
    38 :                end;
    39 :        }
    40 :
    41 :        mes "[GM List]", "";

This is from gm_status_v2_1.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

@ude, have u patch manually ?

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

@ude, have u patch manually ?

 

Ah. My bad. I didn't apply the .diff provided. Thank you very much. My problem solved.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

@ude, have u patch manually ?

 

Ah. My bad. I didn't apply the .diff provided. Thank you very much. My problem solved.

haha ok sir xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Hello, is there any possibility you'll make an eA-compatible release for this?

Edited by rqueen
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

Hello, is there any possibility you'll make an eA-compatible release for this?

This might work, but I didn't test it:

 

prontera,160,180,4	script	GMs Online	857,{
	// check if caching is enabled AND caching time is over OR caching is disabled
	if ((.caching && (.onlineCachingTime + .cachingTime <= gettimetick(2))) || !.caching) {
		query_sql(
			"SELECT `l`.`level`, DATE_FORMAT( `l`.`lastlogin`, '" + .dateString$ + "') as date, DATE_FORMAT(`l`.`lastlogin`, '" + .timeString$ + "') as time, `c`.`name`, `c`.`online` FROM `login` l "
			+ "JOIN (`char` c) "
			+ "ON (`l`.`account_id` = `c`.`account_id`) "
			+ "WHERE `l`.`group_id` >= " + .minLevel + " "
			+ "ORDER BY `c`.`online` DESC, `l`.`group_id` DESC, `c`.`name` ASC"
			, .group, .date$, .time$, .name$, .online$
		);
		
		.onlineCachingTime = gettimetick(2);
	}

	// if .msgToChat is enabled, send the list directly to the chat
	if (.msgToChat) {
		
		dispbottom "GM List:";
		for (.@i = 0; .@i < getarraysize(.online$); .@i += 1) {
			dispbottom "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + (("0" != .online$[.@i]) ? "online" : "offline" + ((.showLastOnline) ? ", last online at " + .date$[.@i] + " " + .time$[.@i] : ""));
		}
		end;
	}
	
	mes "[GM List]", "";
	for (.@i = 0; .@i < getarraysize(.online$); .@i += 1) {
		
		mes "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + ("0" != .online$[.@i] ? "^00AA00online^000000" : "^FF0000offline^000000");
		if ((.showLastOnline) && ("0" == .online$[.@i])) {
			mes "last online at " + .date$[.@i] + " " + .time$[.@i];
		}
		mes "———————————————————";
	}
	
	close;
	
	OnInit:	
		// cache the results to prevent spam
		.caching = 0;
		
		// caching time in seconds
		.cachingTime = 30;
		
		// minimum level to be recognized as a GM
		.minLevel = 1;
		
		// if activated, show when the GM was online the last time (account based)
		.showLastOnline = 1;
		
		// format the date string (%Y for year, %m for month, %d for day)
		.dateString$ = "%m/%d/%Y";
		
		// format the time string (%H for hour (24 hour format), %h for hour (12 hour format), %i for minute)
		.timeString$ = "%H:%i";
		
		// show GM list directly to chat rather than in an NPC window
		.msgToChat = 0;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Hello! Thanks for entertaining my post. Much appreciated.

 

I tried your revised script, I get this:

 


    parse_line: expect command, missing function name or calling undeclared function
    20 :                        + "WHERE `l`.`group_id` >= " + .minLevel + " "
    21 :                        + "ORDER BY `c`.`online` DESC, `l`.`group_id` DESC, `c`.`name` ASC"
    22 :                        , .group, .date$, .time$, .name$, .online$
    23 :                );
    24 :
*   25 :                '.'onlineCachingTime = gettimetick(2);
    26 :        }
    27 :
    28 :        // if .msgToChat is enabled, send the list directly to the chat
    29 :        if (.msgToChat) {
    30 :

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

Oh, right... I forgot eAthena doesn't support this method of setting variables...

prontera,160,180,4	script	GMs Online	857,{
	// check if caching is enabled AND caching time is over OR caching is disabled
	if ((.caching && (.onlineCachingTime + .cachingTime <= gettimetick(2))) || !.caching) {
		query_sql(
			"SELECT `l`.`level`, DATE_FORMAT( `l`.`lastlogin`, '" + .dateString$ + "') as date, DATE_FORMAT(`l`.`lastlogin`, '" + .timeString$ + "') as time, `c`.`name`, `c`.`online` FROM `login` l "
			+ "JOIN (`char` c) "
			+ "ON (`l`.`account_id` = `c`.`account_id`) "
			+ "WHERE `l`.`group_id` >= " + .minLevel + " "
			+ "ORDER BY `c`.`online` DESC, `l`.`group_id` DESC, `c`.`name` ASC"
			, .group, .date$, .time$, .name$, .online$
		);
		
		set .onlineCachingTime, gettimetick(2);
	}

	// if .msgToChat is enabled, send the list directly to the chat
	if (.msgToChat) {
		
		dispbottom "GM List:";
		for (set .@i, 0; .@i < getarraysize(.online$); set .@i, .@i + 1) {
			dispbottom "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + (("0" != .online$[.@i]) ? "online" : "offline" + ((.showLastOnline) ? ", last online at " + .date$[.@i] + " " + .time$[.@i] : ""));
		}
		end;
	}
	
	mes "[GM List]", "";
	for (set .@i, 0; .@i < getarraysize(.online$); set .@i, .@i + 1) {
		
		mes "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + ("0" != .online$[.@i] ? "^00AA00online^000000" : "^FF0000offline^000000");
		if ((.showLastOnline) && ("0" == .online$[.@i])) {
			mes "last online at " + .date$[.@i] + " " + .time$[.@i];
		}
		mes "———————————————————";
	}
	
	close;
	
	OnInit:	
		// cache the results to prevent spam
		set .caching, 0;
		
		// caching time in seconds
		set .cachingTime, 30;
		
		// minimum level to be recognized as a GM
		set .minLevel, 1;
		
		// if activated, show when the GM was online the last time (account based)
		set .showLastOnline, 1;
		
		// format the date string (%Y for year, %m for month, %d for day)
		set .dateString$, "%m/%d/%Y";
		
		// format the time string (%H for hour (24 hour format), %h for hour (12 hour format), %i for minute)
		set .timeString$, "%H:%i";
		
		// show GM list directly to chat rather than in an NPC window
		set .msgToChat, 0;
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Thanks! A new error at line 38 though.

 

    parse_line: need ';'
    33 :                        dispbottom "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + (("0" != .online$[.@i]) ? "online" : "offline" + ((.showLastOnline) ? ", last online at " + .date$[.@i] + " " + .time$[.@i] : ""));
    34 :                }
    35 :                end;
    36 :        }
    37 :
*   38 :        mes "[GM List]"',' "";
    39 :        for (set .@i, 0; .@i < getarraysize(.online$); set .@i, .@i + 1) {
    40 :
    41 :                mes "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + ("0" != .online$[.@i] ? "^00AA00online^000000" : "^FF0000offline^000000");
    42 :                if ((.showLastOnline) && ("0" == .online$[.@i])) {
    43 :                        mes "last online at " + .date$[.@i] + " " + .time$[.@i];

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

Ok, I fixed this problem and tried to run it. The map server gives no more errors now.

prontera,160,180,4	script	GMs Online	857,{
	// check if caching is enabled AND caching time is over OR caching is disabled
	if ((.caching && (.onlineCachingTime + .cachingTime <= gettimetick(2))) || !.caching) {
		query_sql(
			"SELECT `l`.`level`, DATE_FORMAT( `l`.`lastlogin`, '" + .dateString$ + "') as date, DATE_FORMAT(`l`.`lastlogin`, '" + .timeString$ + "') as time, `c`.`name`, `c`.`online` FROM `login` l "
			+ "JOIN (`char` c) "
			+ "ON (`l`.`account_id` = `c`.`account_id`) "
			+ "WHERE `l`.`group_id` >= " + .minLevel + " "
			+ "ORDER BY `c`.`online` DESC, `l`.`group_id` DESC, `c`.`name` ASC"
			, .group, .date$, .time$, .name$, .online$
		);
		
		set .onlineCachingTime, gettimetick(2);
	}

	// if .msgToChat is enabled, send the list directly to the chat
	if (.msgToChat) {
		
		dispbottom "GM List:";
		for (set .@i, 0; .@i < getarraysize(.online$); set .@i, .@i + 1) {
			dispbottom "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + (("0" != .online$[.@i]) ? "online" : "offline" + ((.showLastOnline) ? ", last online at " + .date$[.@i] + " " + .time$[.@i] : ""));
		}
		end;
	}
	
	mes "[GM List]";
	for (set .@i, 0; .@i < getarraysize(.online$); set .@i, .@i + 1) {
		
		mes "[Level " + .group[.@i] + "] " +.name$[.@i] + ": " + ("0" != .online$[.@i] ? "^00AA00online^000000" : "^FF0000offline^000000");
		if ((.showLastOnline) && ("0" == .online$[.@i])) {
			mes "last online at " + .date$[.@i] + " " + .time$[.@i];
		}
		mes "———————————————————";
	}
	
	close;
	
	OnInit:	
		// cache the results to prevent spam
		set .caching, 0;
		
		// caching time in seconds
		set .cachingTime, 30;
		
		// minimum level to be recognized as a GM
		set .minLevel, 1;
		
		// if activated, show when the GM was online the last time (account based)
		set .showLastOnline, 1;
		
		// format the date string (%Y for year, %m for month, %d for day)
		set .dateString$, "%m/%d/%Y";
		
		// format the time string (%H for hour (24 hour format), %h for hour (12 hour format), %i for minute)
		set .timeString$, "%H:%i";
		
		// show GM list directly to chat rather than in an NPC window
		set .msgToChat, 0;
}
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Getting some SQL errors, but that's probably on my side. Thanks!

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

@Dealysilence possible to add feature P.M or A.M ?

Thanks in Advance!

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
Reply to this topic...

×   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...