|
You last visited: Today at 09:11
Advertisement
[Release] White stats calculator program ( Can be used with PHP ).
Discussion on [Release] White stats calculator program ( Can be used with PHP ). within the SRO PServer Guides & Releases forum part of the SRO Private Server category.
06/23/2016, 01:04
|
#1
|
elite*gold: 0
Join Date: Jun 2016
Posts: 21
Received Thanks: 8
|
[Release] White stats calculator program ( Can be used with PHP ).
Hello,
This is my first release on elitepvpers, I hope you will like it.
So today I'm going to release a small program, made by me.
This program calculates white stats of any item you give it,
take a look on the PHP code and you will understand how simple is to use that.
Most of you use PHP 32 BIT, in PHP 32 BIT you don't have the abilities to do what the program does, PHP 32 BIT can't get high numbers into int variables, so you have to use this program for make it works perfectly.
I think that it's the first time that someone posts it, so enjoy!
# Simple program, coded in C.
PHP Code:
// The next code is made by .TheKraken. $shardName = 'SRO_VT_SHARD'; // Type your shard database name. $j = 0;
$stats = mssql_query("select Variance from $shardName.dbo._Items where ID64 = '$row[ID64]'"); $takeStatsRow = mssql_fetch_row($stats); $stats = $takeStatsRow[0];
$statsRes = shell_exec("wStats-Calculator.exe $stats"); // If you didn't put the program in the same folder with this PHP file, you have to give the full path for make it works. $statsArr = explode(',', $statsRes); for($i = 0; $i <= 10; $i++) { array_push($statsArr, 0); }
$arrSize = count($statsArr); while($j < $arrSize) { $statsArr[$j] = floor(((int)$statsArr[$j]) / 31 * 100); $j++; }
/* So now focus on $statsArr!! Here is what the program returns, feel free to use it:
// Phy Weapon: ////////////////////////////// $statsArr[0] = Durability $statsArr[1] = Phy. reinforce $statsArr[3] = Attack rate $statsArr[4] = Phy. atk. pwr. $statsArr[6] = Critical
// Mag Weapon: ////////////////////////////// $statsArr[0] = Durability $statsArr[2] = Mag. reinforce $statsArr[3] = Attack rate $statsArr[5] = Mag. atk. pwr. $statsArr[6] = Critical
// China Weapon: ////////////////////////////// $statsArr[0] = Durability $statsArr[1] = Phy. reinforce $statsArr[2] = Mag. reinforce $statsArr[3] = Attack rate $statsArr[4] = Phy. atk. pwr. $statsArr[5] = Mag. atk. pwr. $statsArr[6] = Critical
// Accsesory: ////////////////////////////// $statsArr[0] = Phy. absorption $statsArr[1] = Mag. absorption
// Clothes: ////////////////////////////// $statsArr[0] = Durability $statsArr[1] = Phy. reinforce $statsArr[2] = Mag. reinforce $statsArr[3] = Parry rate $statsArr[4] = Phy. def. pwr $statsArr[5] = Mag. def. pwr.
*/
Example for how it works:
PHP Code:
$shardName = 'SRO_VT_SHARD'; // Type your shard database name.
$charName = $_GET['charname']; // If you type &charName=TheKraken at the URL, it will take the Items of TheKraken. // $charName = 'TheKraken';
$charID = mssql_query("select CharID from $shardName.dbo._Char where CharName16 = '$charName'"); // Takes the CharID of the charname $ID = mssql_fetch_row($charID); // Takes the CharID of the charname $charID = $ID[0]; // Takes the CharID of the charname
$query = mssql_query("select * from $shardName.dbo._Inventory where CharID = $charID and Slot between 0 and 12 and Slot != 8");
while ($row = mssql_fetch_array($query)){ $j = 0; $stats = mssql_query("select Variance from $shardName.dbo._Items where ID64 = '$row[ID64]'"); $takeStatsRow = mssql_fetch_row($stats); $stats = $takeStatsRow[0];
$statsRes = shell_exec("wStats-Calculator.exe $stats"); // If you didn't put the program in the same folder with this PHP file, you have to give the full path for make it works. $statsArr = explode(',', $statsRes); for($i = 0; $i <= 10; $i++) { array_push($statsArr, 0); }
$arrSize = count($statsArr); while($j < $arrSize) { $statsArr[$j] = floor(((int)$statsArr[$j]) / 31 * 100); $j++; } if(!($row['Slot'])) // If the slot is 0 so the item is head. { echo 'The Parry Rate of ' + $charName + "' head is $statsArr[3]%. </br>"; // Example for result: The Parry Rate of TheKraken's head is 60%. } else if($row['Slot'] == 6) // If the slot is 6 so the item is weapon. { // Last Example if($row['RefObjID'] < 3000) // If the player is china { // So now the item is China Weapon: echo 'The Phy. atk. pwr of ' + $charName + "' weapon is $statsArr[4]%. </br>"; echo 'The Mag. atk. pwr of ' + $charName + "' weapon is $statsArr[5]%. </br>"; echo 'The Critical of ' + $charName + "' weapon is $statsArr[6]%. </br>"; } } } // ItemID in _Inventory = ID64 in _Items

Make sure that you put the program in the same folder as the PHP page folder.
If I helped to you, please press thanks.
Pressing the Thanks button will keep me releasing posts like this.
|
|
|
06/23/2016, 17:03
|
#2
|
elite*gold: 80
Join Date: Nov 2015
Posts: 172
Received Thanks: 89
|
Awesome, thanks!
|
|
|
06/23/2016, 19:36
|
#3
|
elite*gold: 0
Join Date: Mar 2012
Posts: 679
Received Thanks: 29
|
What exactly does it do?
images have?
i try and white page only
|
|
|
06/23/2016, 22:48
|
#4
|
elite*gold: 0
Join Date: Nov 2014
Posts: 170
Received Thanks: 66
|
Awesome  , good job
|
|
|
06/24/2016, 02:04
|
#5
|
elite*gold: 0
Join Date: Jun 2016
Posts: 21
Received Thanks: 8
|
Quote:
Originally Posted by ILowe
What exactly does it do?
images have?
i try and white page only
|
It gives you the option to calculate white stats of item.
All you need to do is to give it the Variance of the item you want.
It's not supposed to run alone, you should put it in your website and to embed it in loop of items, the score should be the ability to do this in website:
Here is example for how it works in the code:
PHP Code:
$shardName = 'SRO_VT_SHARD'; // Type your shard database name.
$charName = $_GET['charname']; // If you type &charName=TheKraken at the URL, it will take the Items of TheKraken. // $charName = 'TheKraken';
$charID = mssql_query("select CharID from $shardName.dbo._Char where CharName16 = '$charName'"); // Takes the CharID of the charname $ID = mssql_fetch_row($charID); // Takes the CharID of the charname $charID = $ID[0]; // Takes the CharID of the charname
$query = mssql_query("select * from $shardName.dbo._Inventory where CharID = $charID and Slot between 0 and 12 and Slot != 8");
while ($row = mssql_fetch_array($query)){ $j = 0; $stats = mssql_query("select Variance from $shardName.dbo._Items where ID64 = '$row[ID64]'"); $takeStatsRow = mssql_fetch_row($stats); $stats = $takeStatsRow[0];
$statsRes = shell_exec("wStats-Calculator.exe $stats"); // If you didn't put the program in the same folder with this PHP file, you have to give the full path for make it works. $statsArr = explode(',', $statsRes); for($i = 0; $i <= 10; $i++) { array_push($statsArr, 0); }
$arrSize = count($statsArr); while($j < $arrSize) { $statsArr[$j] = floor(((int)$statsArr[$j]) / 31 * 100); $j++; } if(!($row['Slot'])) // If the slot is 0 so the item is head. { echo 'The Parry Rate of ' + $charName + "' head is $statsArr[3]%. </br>"; // Example for result: The Parry Rate of TheKraken's head is 60%. } else if($row['Slot'] == 6) // If the slot is 6 so the item is weapon. { // Last Example if($row['RefObjID'] < 3000) // If the player is china { // So now the item is China Weapon: echo 'The Phy. atk. pwr of ' + $charName + "' weapon is $statsArr[4]%. </br>"; echo 'The Mag. atk. pwr of ' + $charName + "' weapon is $statsArr[5]%. </br>"; echo 'The Critical of ' + $charName + "' weapon is $statsArr[6]%. </br>"; } } } // ItemID in _Inventory = ID64 in _Items
Sorry if I have made mistakes in the example code, I didn't check it before.
|
|
|
06/24/2016, 02:31
|
#6
|
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
|
I've no idea where you came up with nonsense such as "php can't assign high values into variables"
|
|
|
06/24/2016, 12:55
|
#7
|
elite*gold: 0
Join Date: Jun 2016
Posts: 21
Received Thanks: 8
|
Quote:
Originally Posted by LastThief*
I've no idea where you came up with nonsense such as "php can't assign high values into variables"
|
Feel free to check it by yourself.
PHP Code:
$check = 34359738336; // Example for common variance...
$check = (int)$check;
echo $check; // -32 ..
|
|
|
06/24/2016, 13:09
|
#8
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,867
Received Thanks: 4,685
|
Quote:
Originally Posted by .TheKraken.
Feel free to check it by yourself.
PHP Code:
$check = 34359738336; // Example for common variance...
$check = (int)$check;
echo $check; // -32 ..
|
Then use float ?
Code:
$check = 34359738336; // Example for common variance...
var_dump($check); // it sayes float
$check = (float)$check; // so use float
echo $check; // output: 34359738336
|
|
|
06/24/2016, 14:00
|
#9
|
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
|
Quote:
Originally Posted by .TheKraken.
Feel free to check it by yourself.
PHP Code:
$check = 34359738336; // Example for common variance...
$check = (int)$check;
echo $check; // -32 ..
|
Why are you trying to cast a value bigger then the maximum value of integer into an integer.
|
|
|
06/24/2016, 15:31
|
#10
|
elite*gold: 2
Join Date: Aug 2011
Posts: 833
Received Thanks: 1,130
|
32bit / 64 bit does not effect the max size of an integer value. Use float or long instead.
|
|
|
06/24/2016, 16:42
|
#11
|
elite*gold: 0
Join Date: Mar 2012
Posts: 679
Received Thanks: 29
|
just 0000-32 write
|
|
|
06/24/2016, 17:14
|
#12
|
elite*gold: 0
Join Date: Jun 2016
Posts: 21
Received Thanks: 8
|
Quote:
Originally Posted by ILowe
just 0000-32 write
|
What?
Quote:
Originally Posted by Devsome
Then use float ?
Code:
$check = 34359738336; // Example for common variance...
var_dump($check); // it sayes float
$check = (float)$check; // so use float
echo $check; // output: 34359738336
|
Quote:
Originally Posted by LastThief*
Why are you trying to cast a value bigger then the maximum value of integer into an integer.
|
Quote:
Originally Posted by Timlock
32bit / 64 bit does not effect the max size of an integer value. Use float or long instead.
|
And what about modulo?
PHP Code:
$check = 34359738336; // Example for common variance... $check = (float)$check; $check %= 19; echo $check; // -13
Everyone knows that:
[ Positive Number % Positive Number = Positive Number / 0 ].
And about "32bit / 64 bit does not effect the max size of an integer value",
better you read the next page:
And about "use long instead"? I have never heard about long variables in PHP before.
|
|
|
06/24/2016, 17:34
|
#13
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,867
Received Thanks: 4,685
|
Quote:
Originally Posted by .TheKraken.
What?
And what about modulo?
PHP Code:
$check = 34359738336; // Example for common variance... $check = (float)$check; $check %= 19; echo $check; // -13
Everyone knows that:
[ Positive Number % Positive Number = Positive Number / 0 ].
And about "32bit / 64 bit does not effect the max size of an integer value",
better you read the next page:
And about "use long instead"? I have never heard about long variables in PHP before.
|
Then you need to convert the INT to a STRING
Code:
$check = '34359738336';
echo bcmod($check, '19');
|
|
|
06/24/2016, 19:40
|
#14
|
elite*gold: 0
Join Date: Jun 2016
Posts: 21
Received Thanks: 8
|
Quote:
Originally Posted by Devsome
Then you need to convert the INT to a STRING
Code:
$check = '34359738336';
echo bcmod($check, '19');

|
Cool, I didn't hear about this function before.
Anyway, I don't want everyone to know how it works, so in my mind, program isn't bad idea.
Good to know, thanks.
|
|
|
06/24/2016, 20:43
|
#15
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,867
Received Thanks: 4,685
|
Quote:
Originally Posted by .TheKraken.
Cool, I didn't hear about this function before.
Anyway, I don't want everyone to know how it works, so in my mind, program isn't bad idea.
Good to know, thanks.
|
Maybe I got some php only for white stats calculation. When I found it, i can post it here. Will search it later :3
|
|
|
All times are GMT +1. The time now is 09:12.
|
|