Jump to content
Zeiyan

Utility: GM Tools

Recommended Posts

@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 [email protected]$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + [email protected]$ + "'",[email protected];
		next;
		break;
		
		case 2:
		input [email protected]$;
		query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '" + [email protected]$ + "'",[email protected];
		next;
		break;
		}
		query_sql "SELECT `userid`,`email`,`group_id`,`last_ip`,`birthdate`,`last_mac` FROM `login` WHERE `account_id` ='" + [email protected] + "'", [email protected]$,[email protected]$,[email protected],[email protected]$,[email protected]$,[email protected]$;
		if ( [email protected] > 0 ) { mes "[ Account Information ]"; mes "GM Account Information are not available"; close; }
		else if ( [email protected] < 2000000 || [email protected] > 3000000 ) { mes "[ Account Information ]"; mes "Character Not Found"; close; }
		query_sql "SELECT `name`, `base_level`, `job_level` FROM `char` WHERE `account_id` =" + [email protected] + "  ORDER BY `base_level` DESC",[email protected]$, [email protected], [email protected];
		mes "[Character List]"	;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
			mes [email protected]+1+". ^00CC00"[email protected]$[[email protected]]+"^000000 ";
			mes "Level: "[email protected][[email protected]]+"/"[email protected][[email protected]]+" "; 
		}
		next;
		mes "[ Account Information ]";
		mes "Account ID: "[email protected];
		mes "Username: "[email protected]$;
		mes "Email: "[email protected]$;
		mes "Last IP: ^00CC00"[email protected]$+"^000000";
		mes "Birthdate: "[email protected]$;
		mes "Mac Address: ^FF0000"[email protected]$+"^000000";
		query_sql "SELECT `account_id`,`last_mac` FROM `freebies` WHERE `account_id` =" + [email protected] + " ",[email protected], [email protected]$;
		if ([email protected] > 0) { set [email protected], 1; } else { set [email protected], 0; }
		if ([email protected] > 0) { set [email protected]$, "^00CC00Yes^000000"; }
		if ([email protected] == 0) { set [email protected]$, "^FF0000No^000000"; }
		mes "Freebies from account: "[email protected]$;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
		set [email protected], [email protected] +1;	
		}
		if ([email protected] < 1) { set [email protected]$, "^FF0000No^000000"; }
		if ([email protected] > 0) { set [email protected]$, "^00CC00Yes^000000"; }
		mes "Freebies from MAC: "[email protected]$;
		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 [email protected]$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + [email protected]$ + "'",[email protected];
		query_sql "SELECT `last_ip`,`group_id` FROM `login` WHERE `account_id` ='" + [email protected] + "'", [email protected]$, [email protected];
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_ip` ='" + [email protected]$+ "'", [email protected], [email protected]$, [email protected], [email protected]$;
		if ([email protected] < 2000000 || [email protected] > 3000000) { mes "Character Not Found"; close; }
		if ([email protected] > 0) { mes "GM Accounts Not Available"; close; }
		mes "Name: ^00CC00"[email protected]$+"^000000 ";
		mes "IP Address: ^FF0000"[email protected]$+"^000000 ";
		next;
		mes "Displaying Users with IP: ^00CC00"[email protected]$;
		next;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
			mes [email protected]+1+". ^00CC00"[email protected]$[[email protected]]+"^000000 ";
			mes "Login Count: "[email protected][[email protected]]+" ";
			mes "Last Login: "[email protected]$[[email protected]]+" "; 
		}
		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 [email protected]$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + [email protected]$ + "'",[email protected];
		query_sql "SELECT `last_mac`,`group_id` FROM `login` WHERE `account_id` ='" + [email protected] + "'", [email protected]$, [email protected];
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_mac` ='" + [email protected]$+ "'", [email protected], [email protected]$, [email protected], [email protected]$;
		if ([email protected] < 2000000 || [email protected] > 3000000) { mes "Character Not Found"; close; }
		if ([email protected] > 0) { mes "GM Accounts Not Available"; close; }		
		mes "Name: ^00CC00"[email protected]$+"^000000 ";
		mes "Mac Address: ^FF0000"[email protected]$+"^000000 ";
		next;
		mes "Displaying Users with Mac: ^00CC00"[email protected]$;
		next;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
			mes [email protected]+1+". ^00CC00"[email protected]$[[email protected]]+"^000000 ";
			mes "Login Count: "[email protected][[email protected]]+" ";
			mes "Last Login: "[email protected]$[[email protected]]+" "; 
		}
		close;
		}
}
  • Upvote 1
  • Love 1
Link to comment
Share on other sites

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 [email protected]$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + [email protected]$ + "'",[email protected];
		next;
		break;
		
		case 2:
		input [email protected]$;
		query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '" + [email protected]$ + "'",[email protected];
		next;
		break;
		}
		query_sql "SELECT `userid`,`email`,`group_id`,`last_ip`,`birthdate`,`last_mac` FROM `login` WHERE `account_id` ='" + [email protected] + "'", [email protected]$,[email protected]$,[email protected],[email protected]$,[email protected]$,[email protected]$;
		if ( [email protected] > 0 ) { mes "[ Account Information ]"; mes "GM Account Information are not available"; close; }
		else if ( [email protected] < 2000000 || [email protected] > 3000000 ) { mes "[ Account Information ]"; mes "Character Not Found"; close; }
		query_sql "SELECT `name`, `base_level`, `job_level` FROM `char` WHERE `account_id` =" + [email protected] + "  ORDER BY `base_level` DESC",[email protected]$, [email protected], [email protected];
		mes "[Character List]"	;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
			mes [email protected]+1+". ^00CC00"[email protected]$[[email protected]]+"^000000 ";
			mes "Level: "[email protected][[email protected]]+"/"[email protected][[email protected]]+" "; 
		}
		next;
		mes "[ Account Information ]";
		mes "Account ID: "[email protected];
		mes "Username: "[email protected]$;
		mes "Email: "[email protected]$;
		mes "Last IP: ^00CC00"[email protected]$+"^000000";
		mes "Birthdate: "[email protected]$;
		mes "Mac Address: ^FF0000"[email protected]$+"^000000";
		query_sql "SELECT `account_id`,`last_mac` FROM `freebies` WHERE `account_id` =" + [email protected] + " ",[email protected], [email protected]$;
		if ([email protected] > 0) { set [email protected], 1; } else { set [email protected], 0; }
		if ([email protected] > 0) { set [email protected]$, "^00CC00Yes^000000"; }
		if ([email protected] == 0) { set [email protected]$, "^FF0000No^000000"; }
		mes "Freebies from account: "[email protected]$;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
		set [email protected], [email protected] +1;	
		}
		if ([email protected] < 1) { set [email protected]$, "^FF0000No^000000"; }
		if ([email protected] > 0) { set [email protected]$, "^00CC00Yes^000000"; }
		mes "Freebies from MAC: "[email protected]$;
		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 [email protected]$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + [email protected]$ + "'",[email protected];
		query_sql "SELECT `last_ip`,`group_id` FROM `login` WHERE `account_id` ='" + [email protected] + "'", [email protected]$, [email protected];
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_ip` ='" + [email protected]$+ "'", [email protected], [email protected]$, [email protected], [email protected]$;
		if ([email protected] < 2000000 || [email protected] > 3000000) { mes "Character Not Found"; close; }
		if ([email protected] > 0) { mes "GM Accounts Not Available"; close; }
		mes "Name: ^00CC00"[email protected]$+"^000000 ";
		mes "IP Address: ^FF0000"[email protected]$+"^000000 ";
		next;
		mes "Displaying Users with IP: ^00CC00"[email protected]$;
		next;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
			mes [email protected]+1+". ^00CC00"[email protected]$[[email protected]]+"^000000 ";
			mes "Login Count: "[email protected][[email protected]]+" ";
			mes "Last Login: "[email protected]$[[email protected]]+" "; 
		}
		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 [email protected]$;
		query_sql "SELECT `account_id` FROM `char` WHERE `name` = '" + [email protected]$ + "'",[email protected];
		query_sql "SELECT `last_mac`,`group_id` FROM `login` WHERE `account_id` ='" + [email protected] + "'", [email protected]$, [email protected];
		query_sql "SELECT `account_id`,`userid`,`logincount`,`lastlogin` FROM `login` WHERE `last_mac` ='" + [email protected]$+ "'", [email protected], [email protected]$, [email protected], [email protected]$;
		if ([email protected] < 2000000 || [email protected] > 3000000) { mes "Character Not Found"; close; }
		if ([email protected] > 0) { mes "GM Accounts Not Available"; close; }		
		mes "Name: ^00CC00"[email protected]$+"^000000 ";
		mes "Mac Address: ^FF0000"[email protected]$+"^000000 ";
		next;
		mes "Displaying Users with Mac: ^00CC00"[email protected]$;
		next;
		for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){
			mes [email protected]+1+". ^00CC00"[email protected]$[[email protected]]+"^000000 ";
			mes "Login Count: "[email protected][[email protected]]+" ";
			mes "Last Login: "[email protected]$[[email protected]]+" "; 
		}
		close;
		}
}

hi sir how to add this ?

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.