[Release] White stats calculator program ( Can be used with PHP ).

06/23/2016 01:04 .TheKraken.#1
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($statsArr0);
}

$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($statsArr0);
    }

    
$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 
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

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 RedWoman#2
Awesome, thanks!
06/23/2016 19:36 ILowe#3
What exactly does it do?
images have?
i try and white page only
06/23/2016 22:48 [GM]JuStiCe#4
Awesome :D, good job
06/24/2016 02:04 .TheKraken.#5
Quote:
Originally Posted by ILowe View Post
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:
[Only registered and activated users can see links. Click Here To Register...]
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($statsArr0);
    }

    
$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 LastThief*#6
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 .TheKraken.#7
Quote:
Originally Posted by LastThief* View Post
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 Devsome#8
Quote:
Originally Posted by .TheKraken. View Post
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 LastThief*#9
Quote:
Originally Posted by .TheKraken. View Post
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 Timlock#10
32bit / 64 bit does not effect the max size of an integer value. Use float or long instead.
06/24/2016 16:42 ILowe#11
just 0000-32 write
06/24/2016 17:14 .TheKraken.#12
Quote:
Originally Posted by ILowe View Post
just 0000-32 write
What?
Quote:
Originally Posted by Devsome View Post
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* View Post
Why are you trying to cast a value bigger then the maximum value of integer into an integer.
Quote:
Originally Posted by Timlock View Post
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: [Only registered and activated users can see links. Click Here To Register...]

And about "use long instead"? I have never heard about long variables in PHP before.
06/24/2016 17:34 Devsome#13
Quote:
Originally Posted by .TheKraken. View Post
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: [Only registered and activated users can see links. Click Here To Register...]

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');
[Only registered and activated users can see links. Click Here To Register...]
06/24/2016 19:40 .TheKraken.#14
Quote:
Originally Posted by Devsome View Post
Then you need to convert the INT to a STRING

Code:
$check = '34359738336';
echo bcmod($check, '19');
[Only registered and activated users can see links. Click Here To Register...]
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 Devsome#15
Quote:
Originally Posted by .TheKraken. View Post
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