• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern AAC] Injection - Guild statistics V3!

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Greetings Fellows.

I would like you to present a Injection for the latest Aac maker. Its not official don't its still a beta version but you might use it later.

I made a injection based on showing the amount of players in guild and the amount of players that are invited in the guild. I hope i inspirited you and i hope that you people take a chance and try to make a new and safer aac maker!

Tutorial where to place it?

enter the following direction \injections\guild_view crate a new folder with a name Advanced Table paste in it the code.. Save it as injection.php. Why Advanced table? Since it will be the easiest way to avoid troubles. There is a
PHP:
 @DEFINE ('INJECTION_PATH', 'injections/guild_view/Advanced Table');
So change it if you have a other source. But I recommend you to leave it.

In version 3

Much changes. Also remember to download the required files (including the injection.php file) in the attachment.
ncz9jm.jpg



I added

PHP:
## | DONE: v.3
## | - @DEFINE INJECTION_PATH - path to the folder 
## | - Skill ranking (all skills,mlvl experience) credits : http://otland.net/members/mipo91/ 
## | - Alert Box 
## | - Average level script fix .round(value) 
## | - Typo fixes 
## | - New Functions: 
## |  - $get=member($guildMembers); 
## |  - $get=invite($invite); 
## |  - $get=online($allM); 
## |  - $get=level($allM1 ,$allM2); 
## |  - $get=rank($allM3 ,$allM4);    
## |  - $get=points($sum);


PHP:
<?php
#################################################################################
##                            CONFIGURATION PAGE                               ##
#################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                  #
## ---------------------------------------------------------------------------- #
## Script created by  Kavvson (http://otland.net/members/kavvson/)              #
## Author & developer:  Kavvson                                                 #
##                                                                              #
## Helpers:             Stian       <http://www.otland.net>                     #
##                      MiPo91      <http://www.otland.net>                     #
#################################################################################
## +--------------------------Guild_View Injection------------------------------+
## | DONE: v.1 & v.2
## | - Fade
## | - Jquery Tabs
## | - Show online members in the guild
## | - Show the total level of members in guild
## | - Show the average level of members in guild
## | - Show the highest level in guild
## | - Show the lowest level in guild
## |
## | DONE: v.3
## | - @DEFINE INJECTION_PATH - path to the folder
## | - Skill ranking (all skills,mlvl experience) credits : http://otland.net/members/mipo91/
## | - Alert Box
## | - Average level script fix .round(value)
## | - Typo fixes
## | - New Functions:
## |  - $get=member($guildMembers);
## |  - $get=invite($invite);
## |  - $get=online($allM);
## |  - $get=level($allM1 ,$allM2);
## |  - $get=rank($allM3 ,$allM4);
## |  - $get=points($sum);
## +----------------------------------------------------------------------------+
#################################################################################
#################################################################################
## +---------------------------------------------------------------------------
## | Database connection + Specific variables + Importing
## +---------------------------------------------------------------------------
#################################################################################
##########################################
##              Define                  ##
##########################################
## Please write the path to this folder ##
## Else leave it                        ##
##########################################
@DEFINE('INJECTION_PATH', 'injections/guild_view/Advanced Table');
################################
##          Style part        ##
################################
## You might change this part ##
################################
$image_i = '<img style="border: medium none;" src="' . WEBSITE . '/' . INJECTION_PATH . '/images/Golden_Goblet.gif">';
echo '<link rel="stylesheet" href="' . WEBSITE . '/' . INJECTION_PATH . '/jquery.alerts.css" /><script src="' . WEBSITE . '/' . INJECTION_PATH . '/jquery.alerts.js" type="text/javascript"></script>';
########################
##      Connection    ##
########################
## Leave these values ##
########################
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$connection = POT::getInstance()->getDBHandle();
$CI = & get_instance();
$CI->load->helper("url");
$guild_id = $CI->uri->segment(3);
###############
## Variables ##
###############
$skills = array(0 => "Fist Fighting", 1 => "Club Fighting", 2 => "Sword Fighting", 3 => "Axe Fighting", 4 => "Distance Fighting", 5 => "Shielding", 6 => "Fishing");
#################################################################################
## +---------------------------------------------------------------------------
## | Database queries
## +---------------------------------------------------------------------------
#################################################################################
$guildMembers = $connection->query('SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = ' . $guild_id)->fetch();
$invite = $connection->query('SELECT COUNT(*) FROM `guild_invites` WHERE `guild_id` = ' . $guild_id)->fetch();
$allM = $connection->query('SELECT COUNT(1) as `people` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') AND online = 1')->fetch();
$allM1 = $connection->query('SELECT SUM(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ')->fetch();
$allM2 = $connection->query('SELECT AVG(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ')->fetch();
$allM3 = $connection->query('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ORDER BY `level` ASC LIMIT 1')->fetch();
$allM4 = $connection->query('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ORDER BY `level` DESC LIMIT 1')->fetch();
$a = round($allM2[0]);
$b = $allM1[0];
$sum = $a + $b + $guildMembers[0] + $allM3[0];
#################################################################################
## +---------------------------------------------------------------------------
## | Functions
## +---------------------------------------------------------------------------
#################################################################################
function member($guildMembers) {
    if ($guildMembers[0] == 1) {
        echo "The Guild has <p style='color:green;display:inline;'><b>" . $guildMembers[0] . "</b></p> member";
    } else {
        echo "The Guild has <p style='color:green;display:inline;'><b>" . $guildMembers[0] . "</b></p> members";
    }
}
function invite($invite) {
    if ($invite[0] == 0) {
        echo "No members are invited";
    } elseif ($invite[0] == 1) {
        echo "One member is invited";
    } else {
        echo "<p style='color:green;display:inline;'><b>" . $invite[0] . "</b></p> Members are currently invited";
    }
}
function online($allM) {
    if ($allM[0] == 0) {
        echo "No one is online";
    } elseif ($allM[0] == 1) {
        echo "One member is invited";
    } else {
        echo "<p style='color:green;display:inline;'><b>" . $allM[0] . "</b></p> Members are currently online";
    }
}
function level($allM1, $allM2) {
    echo "<p style='color:green;display:inline;'><b>" . $allM1[0] . "</b></p> Total level in guild<br>";
    echo "<p style='color:green;display:inline;'><b>" . round($allM2[0]) . "</b></p> Average level of all members in the guild";
}
function rank($allM3, $allM4) {
    echo "<p style='color:green;display:inline;'><b>" . $allM3[0] . "</b></p> Has the best level in guild<br>";
    echo "<p style='color:green;display:inline;'><b>" . $allM4[0] . "</b></p> Has the lowest level in guild";
}
function points($sum) {
    echo "<br><p style='color:green;display:inline;'><b>" . $sum . "</b></p> guild points";
}
?>

<a id="alert_button" href="#">Highscores</a>
<style type="text/css">
.ui-tabs {
    height: !auto;
}
</style>
<script>
    $(document).ready(function () {
        $('#serverStats').fadeIn(6000)
    });
    $("a#alert_button").click(function () {
        jAlert('<?php echo "<div class=i_head>Skills</div><hr><table align=center>";
foreach ($skills as $key => $value) {
    $allM5 = $connection->query('
        SELECT`p`.`name`AS`Name`, `ps`.`value`AS`Sword`, `p`.`maglevel`, `p`.`experience`FROM`players`AS`p`JOIN`player_skills`AS`ps`WHERE`ps`.`player_id` = `p`.`id`AND`ps`.`skillid` = ' . $key . '
        AND`rank_id`IN(SELECT`id`FROM`guild_ranks`WHERE`guild_id` = ' . $guild_id . ') ORDER BY`Sword`DESC Limit 1 ')->fetch();
    echo "<tr align=center><td><img style=\"border:medium none;\" src=\"" . WEBSITE . "/" . INJECTION_PATH . "/images/skills/" . $key . ".png\"></td><td><div class=i_name>" . $allM5[0] . "</div></td><td><div class=i_skill>" . $allM5[1] . " : " . $value . "</div></td></tr>";
}
echo "</table><div class=i_head>Experienice</div><hr><table align=center>";
echo "<tr align=center><td><img style=\"border:medium none;\" src=\"" . WEBSITE . "/" . INJECTION_PATH . "/images/skills/7.png\"></td><td><div class=i_name>" . $allM5[0] . "</div></td><td><div class=i_skill>" . $allM5[3] . " : Experience</div></td></tr>";
echo "<tr align=center><td><img style=\"border:medium none;\" src=\"" . WEBSITE . "/" . INJECTION_PATH . "/images/skills/8.png\"></td><td><div class=i_name>" . $allM5[0] . "</div></td><td><div class=i_skill>" . $allM5[2] . " : Magic Level</div></td></tr>"; ?></table>', '<?php echo $image_i; ?> Skill Ranking <?php echo $image_i; ?>');
    });
</script>
<script>
$(function () {
    $("#tabs").tabs();
});
</script>

    <div id="serverStats" style="display:none;">
        <div id='tabs'>
    <ul>
        <li><a href="#general">General Informations</a></li>
        <li><a href="#statistics">Statistics</a></li>
        <li><a href="#glory">Fame Hall</a></li>
    </ul>
    <div id='general'>
        <?php $get = member($guildMembers); ?>
        <br>
            <?php $get = invite($invite); ?>
            <br>
                <?php $get = online($allM); ?>
    </div>
            <div id='statistics'>
                <?php $get = level($allM1, $allM2); ?>
            </div>
            <div id='glory'>
                <?php $get = rank($allM3, $allM4); $get = points($sum); ?>
            </div>
        </div>
    </div>
    <br>
        <br>
            <br>

Dont Forget to rep me ;)

Still not enough :eek:? check other scripts for Modern AAC
OtLand - Threads Tagged with modern aac kavvson
 

Attachments

  • Advanced Table.rar
    27.8 KB · Views: 306 · VirusTotal
Last edited by a moderator:
Ncie repped!

Crisstobaal
Has the best level in guild

Redirlost Knigth
Has the lowest level in guild
They are changed.
 
Last edited by a moderator:
Aff ye forgot about that just change the description. Lowest is the highest and highest is the lowest.
 
But the readablility.

Ran it through vapus php prettyfier:
PHP:
<?php
#################################################################################
##							CONFIGURATION PAGE							   ##
#################################################################################
##			  -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-				  #
## ---------------------------------------------------------------------------- #
## Script created by  Kavvson (http://otland.net/members/kavvson/)			  #
## Author & developer:  Kavvson												 #
##																			  #
## Helpers:			 Stian	   <http://www.otland.net>					 #
##					  MiPo91	  <http://www.otland.net>					 #
#################################################################################
## +--------------------------Guild_View Injection------------------------------+
## | DONE: v.1 & v.2
## | - Fade
## | - Jquery Tabs
## | - Show online members in the guild
## | - Show the total level of members in guild
## | - Show the average level of members in guild
## | - Show the highest level in guild
## | - Show the lowest level in guild
## |
## | DONE: v.3
## | - @DEFINE INJECTION_PATH - path to the folder
## | - Skill ranking (all skills,mlvl experience) credits : http://otland.net/members/mipo91/
## | - Alert Box
## | - Average level script fix .round(value)
## | - Typo fixes
## | - New Functions:
## |  - $get=member($guildMembers);
## |  - $get=invite($invite);
## |  - $get=online($allM);
## |  - $get=level($allM1 ,$allM2);
## |  - $get=rank($allM3 ,$allM4);
## |  - $get=points($sum);
## +----------------------------------------------------------------------------+
#################################################################################
#################################################################################
## +---------------------------------------------------------------------------
## | Database connection + Specific variables + Importing
## +---------------------------------------------------------------------------
#################################################################################
##########################################
##			  Define				  ##
##########################################
## Please write the path to this folder ##
## Else leave it						##
##########################################
@DEFINE('INJECTION_PATH', 'injections/guild_view/Advanced Table');
################################
##		  Style part		##
################################
## You might change this part ##
################################
$image_i = '<img style="border: medium none;" src="' . WEBSITE . '/' . INJECTION_PATH . '/images/Golden_Goblet.gif">';
echo '<link rel="stylesheet" href="' . WEBSITE . '/' . INJECTION_PATH . '/jquery.alerts.css" /><script src="' . WEBSITE . '/' . INJECTION_PATH . '/jquery.alerts.js" type="text/javascript"></script>';
########################
##	  Connection	##
########################
## Leave these values ##
########################
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$connection = POT::getInstance()->getDBHandle();
$CI = & get_instance();
$CI->load->helper("url");
$guild_id = $CI->uri->segment(3);
###############
## Variables ##
###############
$skills = array(0 => "Fist Fighting", 1 => "Club Fighting", 2 => "Sword Fighting", 3 => "Axe Fighting", 4 => "Distance Fighting", 5 => "Shielding", 6 => "Fishing");
#################################################################################
## +---------------------------------------------------------------------------
## | Database queries
## +---------------------------------------------------------------------------
#################################################################################
$guildMembers = $connection->query('SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = ' . $guild_id)->fetch();
$invite = $connection->query('SELECT COUNT(*) FROM `guild_invites` WHERE `guild_id` = ' . $guild_id)->fetch();
$allM = $connection->query('SELECT COUNT(1) as `people` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') AND online = 1')->fetch();
$allM1 = $connection->query('SELECT SUM(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ')->fetch();
$allM2 = $connection->query('SELECT AVG(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ')->fetch();
$allM3 = $connection->query('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ORDER BY `level` ASC LIMIT 1')->fetch();
$allM4 = $connection->query('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ORDER BY `level` DESC LIMIT 1')->fetch();
$a = round($allM2[0]);
$b = $allM1[0];
$sum = $a + $b + $guildMembers[0] + $allM3[0];
#################################################################################
## +---------------------------------------------------------------------------
## | Functions
## +---------------------------------------------------------------------------
#################################################################################
function member($guildMembers) {
	if ($guildMembers[0] == 1) {
		echo "The Guild has <p style='color:green;display:inline;'><b>" . $guildMembers[0] . "</b></p> member";
	} else {
		echo "The Guild has <p style='color:green;display:inline;'><b>" . $guildMembers[0] . "</b></p> members";
	}
}
function invite($invite) {
	if ($invite[0] == 0) {
		echo "No members are invited";
	} elseif ($invite[0] == 1) {
		echo "One member is invited";
	} else {
		echo "<p style='color:green;display:inline;'><b>" . $invite[0] . "</b></p> Members are currently invited";
	}
}
function online($allM) {
	if ($allM[0] == 0) {
		echo "No one is online";
	} elseif ($allM[0] == 1) {
		echo "One member is invited";
	} else {
		echo "<p style='color:green;display:inline;'><b>" . $allM[0] . "</b></p> Members are currently online";
	}
}
function level($allM1, $allM2) {
	echo "<p style='color:green;display:inline;'><b>" . $allM1[0] . "</b></p> Total level in guild<br>";
	echo "<p style='color:green;display:inline;'><b>" . round($allM2[0]) . "</b></p> Average level of all members in the guild";
}
function rank($allM3, $allM4) {
	echo "<p style='color:green;display:inline;'><b>" . $allM3[0] . "</b></p> Has the best level in guild<br>";
	echo "<p style='color:green;display:inline;'><b>" . $allM4[0] . "</b></p> Has the lowest level in guild";
}
function points($sum) {
	echo "<br><p style='color:green;display:inline;'><b>" . $sum . "</b></p> guild points";
}
?>

<a id="alert_button" href="#">Highscores</a>
<style type="text/css">
.ui-tabs {
	height: !auto;
}
</style>
<script>
	$(document).ready(function () {
		$('#serverStats').fadeIn(6000)
	});
	$("a#alert_button").click(function () {
		jAlert('<?php echo "<div class=i_head>Skills</div><hr><table align=center>";
foreach ($skills as $key => $value) {
	$allM5 = $connection->query('
		SELECT`p`.`name`AS`Name`, `ps`.`value`AS`Sword`, `p`.`maglevel`, `p`.`experience`FROM`players`AS`p`JOIN`player_skills`AS`ps`WHERE`ps`.`player_id` = `p`.`id`AND`ps`.`skillid` = ' . $key . '
		AND`rank_id`IN(SELECT`id`FROM`guild_ranks`WHERE`guild_id` = ' . $guild_id . ') ORDER BY`Sword`DESC Limit 1 ')->fetch();
	echo "<tr align=center><td><img style=\"border:medium none;\" src=\"" . WEBSITE . "/" . INJECTION_PATH . "/images/skills/" . $key . ".png\"></td><td><div class=i_name>" . $allM5[0] . "</div></td><td><div class=i_skill>" . $allM5[1] . " : " . $value . "</div></td></tr>";
}
echo "</table><div class=i_head>Experienice</div><hr><table align=center>";
echo "<tr align=center><td><img style=\"border:medium none;\" src=\"" . WEBSITE . "/" . INJECTION_PATH . "/images/skills/7.png\"></td><td><div class=i_name>" . $allM5[0] . "</div></td><td><div class=i_skill>" . $allM5[3] . " : Experience</div></td></tr>";
echo "<tr align=center><td><img style=\"border:medium none;\" src=\"" . WEBSITE . "/" . INJECTION_PATH . "/images/skills/8.png\"></td><td><div class=i_name>" . $allM5[0] . "</div></td><td><div class=i_skill>" . $allM5[2] . " : Magic Level</div></td></tr>"; ?></table>', '<?php echo $image_i; ?> Skill Ranking <?php echo $image_i; ?>');
	});
</script>
<script>
$(function () {
	$("#tabs").tabs();
});
</script>

	<div id="serverStats" style="display:none;">
		<div id='tabs'>
	<ul>
		<li><a href="#general">General Informations</a></li>
		<li><a href="#statistics">Statistics</a></li>
		<li><a href="#glory">Fame Hall</a></li>
	</ul>
	<div id='general'>
		<?php $get = member($guildMembers); ?>
		<br>
			<?php $get = invite($invite); ?>
			<br>
				<?php $get = online($allM); ?>
	</div>
			<div id='statistics'>
				<?php $get = level($allM1, $allM2); ?>
			</div>
			<div id='glory'>
				<?php $get = rank($allM3, $allM4); $get = points($sum); ?>
			</div>
		</div>
	</div>
	<br>
		<br>
			<br>
 
Ok thx. I thinking about extend the guild points system. Like top 5 guild points. But there is needed a SQL query or what? To make it more simpler.
 
Actually this code can be reduced pretty well to a single query (which will make it faster and better). About a rank of points, can be done with this same SQL query i am refering to.
 
Hmm sounds interesting. Could you provide me in such SQL?
 
what is guild points? it looks like the total lvl + something else.

suggestions.
1)under stats i think you should have the average rank of the whole guild together. but mabye just for lvl,fishing b/c those dont depend on vocation. EX. for my server the guilds average lvl is 369 so the lvl of the guilds average rank in the high scores would be 20. or you could go by rank average find the rank of each player in the guild and divid by # of players. thats instead of comparing the average lvl to the highscore. depending on which way it was done the #'s would be different. the second way is more accurate.
2)i think a new tab called skill ranking should be another tab instead of a pop-up.
 
Back
Top