Jump to content

Utility: GM Tools


Zeiyan

Recommended Posts


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  275
  • Reputation:   23
  • Joined:  01/06/13
  • Last Seen:  

@charinfo

 

A @command (via script) that gives you and your GM Staff (GM level 2 NOT group level)information about Player account informations without having to login to phpmyadmin. I'm quite used to making very simple scripts but this is my first time to give back to the community and also my first time using sql query in scripts (in short i'm a newbie) Please leave comments about what you think  :). ( I use it on my own server so it includes checking if they have freebies received via account or via mac address)

 

You can choose to input Character name or Username

 

NOTE: I know the @accinfo almost do the same thing but i'm a big noob in source editing so i made this for my own use ( then i can include the stuff i want to display)

-	script	charinfo	-1,{
OnInit:
	bindatcmd "charinfo","charinfo::OnCharInfo", 0, 2;
	end;
OnCharInfo:
	if(getgroupid() >= 2) {
		mes " [ Character Info ] ";
		mes " Hello GM ^00CC00"+strcharinfo(0)+"^000000!";
		mes " What would you like to check? ";
		switch (select("Character Name:Username")) {
		
		case 1:
		input .@chrnm$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + .@chrnm$ + "'",.@acid;
		next;
		break;
		
		case 2:
		input .@acnme$;
		query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '" + .@acnme$ + "'",.@acid;
		next;
		break;
		}
		query_sql "SELECT `userid`,`email`,`group_id`,`last_ip`,`birthdate`,`last_mac` FROM `login` WHERE `account_id` ='" + .@acid + "'", .@usrd$,.@eml$,.@ggm,.@lstip$,.@brtdy$,.@macad$;
		if ( .@ggm > 0 ) { mes "[ Account Information ]"; mes "GM Account Information are not available"; close; }
		else if ( .@acid < 2000000 || .@acid > 3000000 ) { mes "[ Account Information ]"; mes "Character Not Found"; close; }
		query_sql "SELECT `name`, `base_level`, `job_level` FROM `char` WHERE `account_id` =" + .@acid + "  ORDER BY `base_level` DESC",.@chrlst$, .@blvl, .@jlvl;
		mes "[Character List]"	;
		for(set .@i, 0; .@i < getarraysize(.@chrlst$); set .@i, .@i + 1){
			mes .@i+1+". ^00CC00"+.@chrlst$[.@i]+"^000000 ";
			mes "Level: "+.@blvl[.@i]+"/"+.@jlvl[.@i]+" "; 
		}
		next;
		mes "[ Account Information ]";
		mes "Account ID: "+.@acid;
		mes "Username: "+.@usrd$;
		mes "Email: "+.@eml$;
		mes "Last IP: ^00CC00"+.@lstip$+"^000000";
		mes "Birthdate: "+.@brtdy$;
		mes "Mac Address: ^FF0000"+.@macad$+"^000000";
		query_sql "SELECT `account_id`,`last_mac` FROM `freebies` WHERE `account_id` =" + .@acid + " ",.@rcvfrbs, .@lstmc$;
		if (.@rcvfrbs > 0) { set .@rcvfrbs, 1; } else { set .@rcvfrbs, 0; }
		if (.@rcvfrbs > 0) { set .@rcvfrbs$, "^00CC00Yes^000000"; }
		if (.@rcvfrbs == 0) { set .@rcvfrbs$, "^FF0000No^000000"; }
		mes "Freebies from account: "+.@rcvfrbs$;
		for(set .@i1, 0; .@i1 < getarraysize(.@lstmc$); set .@i1, .@i1 + 1){
		set .@lstmc, .@lstmc +1;	
		}
		if (.@lstmc < 1) { set .@lstmc$, "^FF0000No^000000"; }
		if (.@lstmc > 0) { set .@lstmc$, "^00CC00Yes^000000"; }
		mes "Freebies from MAC: "+.@lstmc$;
		close;
	}
} 

2. @ipinfo

 

This one displays all users (displays username) with login count and last login from IP address of a certain character (Input Character name)

-	script	ipinfo	-1,{
OnInit:
	bindatcmd "ipinfo","ipinfo::OnIPInfo", 2, 2;
	end;
OnIPInfo:
	if(getgroupid() >= 2) {
		input .@chrnm$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + .@chrnm$ + "'",.@acid;
		query_sql "SELECT `last_ip`,`group_id` FROM `login` WHERE `account_id` ='" + .@acid + "'", .@lstp$, .@grplvl;
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_ip` ='" + .@lstp$+ "'", .@acidlip, .@acidlip$, .@lgncnt, .@lstlgn$;
		if (.@acid < 2000000 || .@acid > 3000000) { mes "Character Not Found"; close; }
		if (.@grplvl > 0) { mes "GM Accounts Not Available"; close; }
		mes "Name: ^00CC00"+.@chrnm$+"^000000 ";
		mes "IP Address: ^FF0000"+.@lstp$+"^000000 ";
		next;
		mes "Displaying Users with IP: ^00CC00"+.@lstp$;
		next;
		for(set .@i, 0; .@i < getarraysize(.@acidlip$); set .@i, .@i + 1){
			mes .@i+1+". ^00CC00"+.@acidlip$[.@i]+"^000000 ";
			mes "Login Count: "+.@lgncnt[.@i]+" ";
			mes "Last Login: "+.@lstlgn$[.@i]+" "; 
		}
		close;
		}
} 

3. @macinfo

 

Same as @ipinfo except this one displays mac address information (if you have harmony or in my case have last_mac table)

-	script	macinfo	-1,{
OnInit:
	bindatcmd "macinfo","macinfo::OnMacInfo", 2, 2;
	end;
OnMacInfo:
	if(getgroupid() >= 2) {
		input .@chrnm$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + .@chrnm$ + "'",.@acid;
		query_sql "SELECT `last_mac`,`group_id` FROM `login` WHERE `account_id` ='" + .@acid + "'", .@lstp$, .@grplvl;
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_mac` ='" + .@lstp$+ "'", .@acidlmac, .@acidlmac$, .@lgncnt, .@lstlgn$;
		if (.@acid < 2000000 || .@acid > 3000000) { mes "Character Not Found"; close; }
		if (.@grplvl > 0) { mes "GM Accounts Not Available"; close; }		
		mes "Name: ^00CC00"+.@chrnm$+"^000000 ";
		mes "Mac Address: ^FF0000"+.@lstp$+"^000000 ";
		next;
		mes "Displaying Users with Mac: ^00CC00"+.@lstp$;
		next;
		for(set .@i, 0; .@i < getarraysize(.@acidlmac$); set .@i, .@i + 1){
			mes .@i+1+". ^00CC00"+.@acidlmac$[.@i]+"^000000 ";
			mes "Login Count: "+.@lgncnt[.@i]+" ";
			mes "Last Login: "+.@lstlgn$[.@i]+" "; 
		}
		close;
		}
}
  • Upvote 1
  • Love 1
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

Very useful, thank you very much!

Link to comment
Share on other sites

  • 3 years later...

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   1
  • Joined:  05/21/17
  • Last Seen:  

On 11/9/2014 at 7:52 PM, Zeiyan said:

@charinfo

 

A @command (via script) that gives you and your GM Staff (GM level 2 NOT group level)information about Player account informations without having to login to phpmyadmin. I'm quite used to making very simple scripts but this is my first time to give back to the community and also my first time using sql query in scripts (in short i'm a newbie) Please leave comments about what you think  :). ( I use it on my own server so it includes checking if they have freebies received via account or via mac address)

 

You can choose to input Character name or Username

 

NOTE: I know the @accinfo almost do the same thing but i'm a big noob in source editing so i made this for my own use ( then i can include the stuff i want to display)


-	script	charinfo	-1,{
OnInit:
	bindatcmd "charinfo","charinfo::OnCharInfo", 0, 2;
	end;
OnCharInfo:
	if(getgroupid() >= 2) {
		mes " [ Character Info ] ";
		mes " Hello GM ^00CC00"+strcharinfo(0)+"^000000!";
		mes " What would you like to check? ";
		switch (select("Character Name:Username")) {
		
		case 1:
		input .@chrnm$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + .@chrnm$ + "'",.@acid;
		next;
		break;
		
		case 2:
		input .@acnme$;
		query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '" + .@acnme$ + "'",.@acid;
		next;
		break;
		}
		query_sql "SELECT `userid`,`email`,`group_id`,`last_ip`,`birthdate`,`last_mac` FROM `login` WHERE `account_id` ='" + .@acid + "'", .@usrd$,.@eml$,.@ggm,.@lstip$,.@brtdy$,.@macad$;
		if ( .@ggm > 0 ) { mes "[ Account Information ]"; mes "GM Account Information are not available"; close; }
		else if ( .@acid < 2000000 || .@acid > 3000000 ) { mes "[ Account Information ]"; mes "Character Not Found"; close; }
		query_sql "SELECT `name`, `base_level`, `job_level` FROM `char` WHERE `account_id` =" + .@acid + "  ORDER BY `base_level` DESC",.@chrlst$, .@blvl, .@jlvl;
		mes "[Character List]"	;
		for(set .@i, 0; .@i < getarraysize(.@chrlst$); set .@i, .@i + 1){
			mes .@i+1+". ^00CC00"+.@chrlst$[.@i]+"^000000 ";
			mes "Level: "+.@blvl[.@i]+"/"+.@jlvl[.@i]+" "; 
		}
		next;
		mes "[ Account Information ]";
		mes "Account ID: "+.@acid;
		mes "Username: "+.@usrd$;
		mes "Email: "+.@eml$;
		mes "Last IP: ^00CC00"+.@lstip$+"^000000";
		mes "Birthdate: "+.@brtdy$;
		mes "Mac Address: ^FF0000"+.@macad$+"^000000";
		query_sql "SELECT `account_id`,`last_mac` FROM `freebies` WHERE `account_id` =" + .@acid + " ",.@rcvfrbs, .@lstmc$;
		if (.@rcvfrbs > 0) { set .@rcvfrbs, 1; } else { set .@rcvfrbs, 0; }
		if (.@rcvfrbs > 0) { set .@rcvfrbs$, "^00CC00Yes^000000"; }
		if (.@rcvfrbs == 0) { set .@rcvfrbs$, "^FF0000No^000000"; }
		mes "Freebies from account: "+.@rcvfrbs$;
		for(set .@i1, 0; .@i1 < getarraysize(.@lstmc$); set .@i1, .@i1 + 1){
		set .@lstmc, .@lstmc +1;	
		}
		if (.@lstmc < 1) { set .@lstmc$, "^FF0000No^000000"; }
		if (.@lstmc > 0) { set .@lstmc$, "^00CC00Yes^000000"; }
		mes "Freebies from MAC: "+.@lstmc$;
		close;
	}
} 

2. @ipinfo

 

This one displays all users (displays username) with login count and last login from IP address of a certain character (Input Character name)


-	script	ipinfo	-1,{
OnInit:
	bindatcmd "ipinfo","ipinfo::OnIPInfo", 2, 2;
	end;
OnIPInfo:
	if(getgroupid() >= 2) {
		input .@chrnm$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + .@chrnm$ + "'",.@acid;
		query_sql "SELECT `last_ip`,`group_id` FROM `login` WHERE `account_id` ='" + .@acid + "'", .@lstp$, .@grplvl;
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_ip` ='" + .@lstp$+ "'", .@acidlip, .@acidlip$, .@lgncnt, .@lstlgn$;
		if (.@acid < 2000000 || .@acid > 3000000) { mes "Character Not Found"; close; }
		if (.@grplvl > 0) { mes "GM Accounts Not Available"; close; }
		mes "Name: ^00CC00"+.@chrnm$+"^000000 ";
		mes "IP Address: ^FF0000"+.@lstp$+"^000000 ";
		next;
		mes "Displaying Users with IP: ^00CC00"+.@lstp$;
		next;
		for(set .@i, 0; .@i < getarraysize(.@acidlip$); set .@i, .@i + 1){
			mes .@i+1+". ^00CC00"+.@acidlip$[.@i]+"^000000 ";
			mes "Login Count: "+.@lgncnt[.@i]+" ";
			mes "Last Login: "+.@lstlgn$[.@i]+" "; 
		}
		close;
		}
} 

3. @macinfo

 

Same as @ipinfo except this one displays mac address information (if you have harmony or in my case have last_mac table)


-	script	macinfo	-1,{
OnInit:
	bindatcmd "macinfo","macinfo::OnMacInfo", 2, 2;
	end;
OnMacInfo:
	if(getgroupid() >= 2) {
		input .@chrnm$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + .@chrnm$ + "'",.@acid;
		query_sql "SELECT `last_mac`,`group_id` FROM `login` WHERE `account_id` ='" + .@acid + "'", .@lstp$, .@grplvl;
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_mac` ='" + .@lstp$+ "'", .@acidlmac, .@acidlmac$, .@lgncnt, .@lstlgn$;
		if (.@acid < 2000000 || .@acid > 3000000) { mes "Character Not Found"; close; }
		if (.@grplvl > 0) { mes "GM Accounts Not Available"; close; }		
		mes "Name: ^00CC00"+.@chrnm$+"^000000 ";
		mes "Mac Address: ^FF0000"+.@lstp$+"^000000 ";
		next;
		mes "Displaying Users with Mac: ^00CC00"+.@lstp$;
		next;
		for(set .@i, 0; .@i < getarraysize(.@acidlmac$); set .@i, .@i + 1){
			mes .@i+1+". ^00CC00"+.@acidlmac$[.@i]+"^000000 ";
			mes "Login Count: "+.@lgncnt[.@i]+" ";
			mes "Last Login: "+.@lstlgn$[.@i]+" "; 
		}
		close;
		}
}

hi sir how to add this ?

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

On 12/26/2017 at 9:32 AM, core said:

hi sir how to add this ?

copy the script into notepad/wordpad save it.

after that put it into npc\custom

and enable it at npc_custom.conf

  • Upvote 1
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...