You last visited: Today at 01:59
Advertisement
[In-Orbit][Script] Daily Bonus
Discussion on [In-Orbit][Script] Daily Bonus within the DarkOrbit forum part of the Browsergames category.
10/30/2014, 14:46
#1
elite*gold: 1
Join Date: Jun 2011
Posts: 1,464
Received Thanks: 1,065
[In-Orbit][Script] Daily Bonus
maybe someone needs it. i do not deliver copyrighted data (pictures ect.)
you get the stuff i made
you also need baus pdo-class
put this to internalstart_body.php
PHP Code:
<?php
// Daily-Login-Box
// Avoid an error (Level: Notice)
if(!isset( $_GET [ 'acceptDailyLoginBonus' ]))
$_GET [ 'acceptDailyLoginBonus' ] = 0 ;
// init class
$dailyBonus = new dailybonus ();
// set id
$dailyBonus -> setId ( $Users -> DataRow [ 'ID' ]);
// give the bonus
$dailyBonus -> executeb ();
// get html-data
$dailyBonusd = $dailyBonus -> getData ();
// Layer or not?
if( $_GET [ 'acceptDailyLoginBonus' ] != 1 && $dailyBonus -> getState () == "yes" ){
?>
<style type="text/css" media="screen"> @import "./css/cdn/layer_dailyLogin.css</style>
<div id="dailyLogin" style="top: 35px; left: 359.5px;">
<div id="dl_headline"><strong>Daily-Login-Bonus</strong></div>
<div id="dl_infoBox">
<div id="dl_infoBox_headline"><strong>Welcome back pilot!</strong></div>
<div id="dl_infoBox_content"><?php echo $dailyBonusd [ 'headline' ]; ?> </div>
</div>
<div id="dl_boni">
<div id="dl_progressbar_bonus_<?php echo $dailyBonusd [ 'progressbar' ]; ?> "></div>
<div id="dl_boniBox" onclick="do_redirect('indexInternal.es?action=internalDock&tpl=internalDockAmmo&hdl=1', false)">
<div class="dl_boniState_<?php echo $dailyBonusd [ 'boxstate_1' ] ?> ">
<div class="dl_boni_1">
<div class="dl_boni_headline">Bonus 1</div>
<?php echo $dailyBonusd [ 'boxstate_1_icon' ]; ?>
<div class="dl_boni_content dl_boni_content_1">50,000 credits<br>100x PLT-2026 rockets<br>5x GG-spin</div>
</div>
</div>
</div>
<div id="dl_boniBox" onclick="do_redirect('indexInternal.es?action=internalDock&tpl=internalDockAmmo&hdl=1', false)">
<div class="dl_boniState_<?php echo $dailyBonusd [ 'boxstate_2' ] ?> ">
<div class="dl_boni_2">
<div class="dl_boni_headline">Bonus 2</div>
<?php echo $dailyBonusd [ 'boxstate_2_icon' ]; ?>
<div class="dl_boni_content dl_boni_content_2">750x MCB-25 ammo<br>85,000 credits<br>5x GG-spin</div>
</div>
</div>
</div>
<div id="dl_boniBox" onclick="do_redirect('indexInternal.es?action=internalDock&tpl=internalDockSpecials&hdl=1', false)">
<div class="dl_boniState_<?php echo $dailyBonusd [ 'boxstate_3' ] ?> ">
<div class="dl_boni_3">
<div class="dl_boni_headline">Bonus 3</div>
<?php echo $dailyBonusd [ 'boxstate_3_icon' ]; ?>
<div class="dl_boni_content dl_boni_content_3">150x PLT-2021 rockets<br>3x Jump-voucher<br>5x GG-spin</div>
</div>
</div>
</div>
<div id="dl_boniBox" onclick="do_redirect('indexInternal.es?action=internalDock&tpl=internalDockAmmo&hdl=1', false)">
<div class="dl_boniState_<?php echo $dailyBonusd [ 'boxstate_4' ] ?> ">
<div class="dl_boni_5">
<div class="dl_boni_headline">Bonus 4</div>
<?php echo $dailyBonusd [ 'boxstate_4_icon' ]; ?>
<div class="dl_boni_content dl_boni_content_4">5x Logfile<br>250 Uridium<br>5x GG-spin</div>
</div>
</div>
</div>
<div id="dl_boniBox" onclick="do_redirect('indexInternal.es?action=internalPilotSheet&tpl=skilltree&hdl=1', false)">
<div class="dl_boniState_<?php echo $dailyBonusd [ 'boxstate_5' ] ?> ">
<div class="dl_boni_4">
<div class="dl_boni_headline">Bonus 5</div>
<?php echo $dailyBonusd [ 'boxstate_5_icon' ]; ?>
<div class="dl_boni_content dl_boni_content_5">1000x MCB-50 ammo<br>3x Repair-voucher<br>5x WIZ-X rockets</div>
</div>
</div>
</div>
<div id="dl_accept">
<div id="dl_bt_accept"><a href="/indexInternal.es?action=internalStart&acceptDailyLoginBonus=1">OK</a></div>
</div>
</div>
</div>
<?php
}
// End of Daily-Login-Box
?>
create a new classfile (Class.dailybonus.php)
PHP Code:
<?php
class dailybonus
{
// basic stuff
private $con ;
private $uid ;
private $reward ;
private $reward_level ;
public $data ;
public $layer = "no" ;
public function __construct () {
$this -> con = $GLOBALS [ 'DB' ];
}
public function setId ( $uid ) {
$this -> uid = $uid ;
}
public function getData (){
return $this -> data ;
}
public function getState (){
return $this -> layer ;
}
private function getBonus ( $day ) {
$bonus = array(
"day_one" => array(
"loot" => array ( "credits" ,
"plt2026" ,
"ggspin" ),
"count" => array ( "50000" ,
"100" ,
"5" )
),
"day_two" => array(
"loot" => array ( "mcb25" ,
"credits" ,
"ggspin" ),
"count" => array ( "750" ,
"85000" ,
"5" )
),
"day_three" => array(
"loot" => array ( "plt2021" ,
"jumpvoucher" ,
"ggspin" ),
"count" => array ( "150" ,
"3" ,
"5" )
),
"day_four" => array(
"loot" => array ( "resource_lgf" ,
"uridium" ,
"ggspin" ),
"count" => array ( "5" ,
"250" ,
"5" )
),
"day_five" => array(
"loot" => array ( "mcb50" ,
"repairvoucher" ,
"wizx" ),
"count" => array ( "1000" ,
"3" ,
"5" )
),
);
return $bonus [ 'day_' . $day ];
}
private function init ()
{
$qry = $this -> con -> prepare ( "SELECT dbonus FROM server_1_players WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
if ( $qry -> execute ()) {
if ( $qry -> rowCount () != 0 ) {
$result = $qry -> fetchAll ( PDO :: FETCH_ASSOC );
$arr = explode ( "|" , $result [ 0 ][ 'dbonus' ]);
$b [ 'level' ] = $arr [ 0 ];
$b [ 'timestamp' ] = $arr [ 1 ];
$time = new DateTime ();
$time = $time -> getTimestamp ();
if(( $b [ 'timestamp' ] + 86400 ) <= $time && $time <= ( $b [ 'timestamp' ] + 192800 ) || $b [ 'timestamp' ] == 0 ) {
if( $b [ 'level' ] == 1 )
$this -> reward = "one" ;
elseif( $b [ 'level' ] == 2 )
$this -> reward = "two" ;
elseif( $b [ 'level' ] == 3 )
$this -> reward = "three" ;
elseif( $b [ 'level' ] == 4 )
$this -> reward = "four" ;
elseif( $b [ 'level' ] == 5 )
$this -> reward = "five" ;
elseif( $b [ 'level' ] > 5 )
return FALSE ;
$this -> reward_level = $b [ 'level' ];
$this -> layer = "yes" ;
return TRUE ;
} elseif( $time >= ( $b [ 'timestamp' ] + 192800 ) && $b [ 'timestamp' ] != 0 ) {
$this -> reward_level = 1 ;
$this -> reward = "one" ;
$this -> layer = "yes" ;
return TRUE ;
} else {
$this -> layer = "no" ;
return FALSE ;
}
}
else
return FALSE ;
}
else
return FALSE ;
}
public function executeb ()
{
if(isset( $_SESSION [ 'server1' ][ 'user' ][ 'sessionId' ], $_SESSION [ 'server1' ][ 'user' ][ 'email' ]) && is_numeric ( $_SESSION [ 'server1' ][ 'user' ][ 'sessionId' ])){
if( self :: init ())
{
$btype = self :: getBonus ( $this -> reward );
for( $i = 0 ; $i < 3 ; $i ++){
if( $btype [ 'loot' ][ $i ] == "credits" ){
$qry = $this -> con -> prepare ( "UPDATE server_1_players SET credits = credits + :count WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
$qry -> execute ();
}
if( $btype [ 'loot' ][ $i ] == "uridium" ){
$qry = $this -> con -> prepare ( "UPDATE server_1_players SET uri = uri + :count WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
$qry -> execute ();
}
if( $btype [ 'loot' ][ $i ] == "ggspin" ){
$qry = $this -> con -> prepare ( "UPDATE server_1_players SET GGspins = GGspins + :count WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
$qry -> execute ();
}
if( $btype [ 'loot' ][ $i ] == "jumpvoucher" ){
$qry = $this -> con -> prepare ( "UPDATE server_1_players SET jumpvouchers = jumpvouchers + :count WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
$qry -> execute ();
}
if( $btype [ 'loot' ][ $i ] == "repairvoucher" ){
$qry = $this -> con -> prepare ( "UPDATE server_1_players SET repairvouchers = repairvouchers + :count WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
$qry -> execute ();
}
if( $btype [ 'loot' ][ $i ] != "credits" && $btype [ 'loot' ][ $i ] != "uridium" && $btype [ 'loot' ][ $i ] != "GGspins" && $btype [ 'loot' ][ $i ] != "jumpvoucher" && $btype [ 'loot' ][ $i ] != "repairvoucher" )
{
//$type = $btype['loot'][$i];
$qry = $this -> con -> prepare ( "SELECT * FROM server_1_player_ammunation WHERE playerID = :uID" );
//$qry = $this->con->prepare("SELECT id FROM server_1_player_all_items WHERE lootid = :type AND userID = :uID");
//$qry->bindParam(':type', $btype['loot'][$i], PDO::PARAM_STR);
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> execute ();
if ( $qry -> execute ()) {
if( $qry -> rowCount () != 0 ) {
$sql = "UPDATE server_1_player_ammunation SET " . $btype [ 'loot' ][ $i ] . " = " . $btype [ 'loot' ][ $i ] . " + :count WHERE playerID = :uID" ;
$qry = $this -> con -> prepare ( $sql );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
//$qry->bindParam(':type', $btype['loot'][$i], PDO::PARAM_STR);
$qry -> execute ();
} else {
//storing in old system
$qry = $this -> con -> prepare ( "INSERT INTO server_1_player_all_items (`lootid`, `Q`, `properties`, `interactive`, `playerID`, `userID`) VALUES (:type, :count, '0', 0, :uID, :uID)" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':count' , $btype [ 'count' ][ $i ], PDO :: PARAM_INT );
$qry -> bindParam ( ':type' , $btype [ 'loot' ][ $i ], PDO :: PARAM_STR );
$qry -> execute ();
}
}
}
}
if( $this -> reward_level != 5 )
$bdata [ 'headline' ] = "You logged in today and get the following bonus. Login tomorrow to get the next bonus." ;
else
$bdata [ 'headline' ] = "You get the last bonus. Login tomorrow to get this bonus again." ;
$sample_active = "active" ;
$sample_comming = "comming" ;
$sample_received = "received" ;
$icon_div = "<div class=\"dl_bonus_received_icon\"><img src=\"do_img/global/pilotSheet/dailyLogin/icon_received.png?__cv=b8d2514ac1824664d197db0587498800\" width=\"21\" height=\"22\"></div>" ;
$noicon_div = " " ;
$bdata [ 'boxstate_1' ] = ( $this -> reward_level == 1 ) ? $sample_active : (( $this -> reward_level > 1 ) ? $sample_received : $sample_comming );
$bdata [ 'boxstate_2' ] = ( $this -> reward_level == 2 ) ? $sample_active : (( $this -> reward_level > 2 ) ? $sample_received : $sample_comming );
$bdata [ 'boxstate_3' ] = ( $this -> reward_level == 3 ) ? $sample_active : (( $this -> reward_level > 3 ) ? $sample_received : $sample_comming );
$bdata [ 'boxstate_4' ] = ( $this -> reward_level == 4 ) ? $sample_active : (( $this -> reward_level > 4 ) ? $sample_received : $sample_comming );
$bdata [ 'boxstate_5' ] = ( $this -> reward_level == 5 ) ? $sample_active : (( $this -> reward_level > 5 ) ? $sample_received : $sample_comming );
$bdata [ 'boxstate_1_icon' ] = ( $this -> reward_level == 1 ) ? $noicon_div : $icon_div ;
$bdata [ 'boxstate_2_icon' ] = ( $this -> reward_level < 3 ) ? $noicon_div : $icon_div ;
$bdata [ 'boxstate_3_icon' ] = ( $this -> reward_level < 4 ) ? $noicon_div : $icon_div ;
$bdata [ 'boxstate_4_icon' ] = ( $this -> reward_level < 5 ) ? $noicon_div : $icon_div ;
$bdata [ 'boxstate_5_icon' ] = ( $this -> reward_level != 5 ) ? $noicon_div : $icon_div ;
$bdata [ 'progressbar' ] = $this -> reward_level ;
if( $this -> reward_level != 5 )
$dbarr [ 0 ] = $this -> reward_level + 1 ;
else
$dbarr [ 0 ] = $this -> reward_level ;
$time = new DateTime ();
$dbarr [ 1 ] = $time -> getTimestamp ();
$dbdata = implode ( "|" , $dbarr );
$qry = $this -> con -> prepare ( "UPDATE server_1_players SET dbonus = :level WHERE userID = :uID" );
$qry -> bindParam ( ':uID' , $this -> uid , PDO :: PARAM_INT );
$qry -> bindParam ( ':level' , $dbdata , PDO :: PARAM_INT );
$qry -> execute ();
$this -> data = $bdata ;
}
}
}
}
?>
add this to init.php
PHP Code:
require_once 'Class.dailybonus.php'
;
create the sql-column
Code:
$qry = $this->con->prepare("SELECT dbonus FROM server_1_players WHERE userID = :uID");
columnname: dbonus / varchar(50)
10/30/2014, 17:43
#2
elite*gold: 0
Join Date: Jun 2014
Posts: 507
Received Thanks: 86
Thx man
Similar Threads
Daily Login Bonus Tool
08/06/2015 - DarkOrbit - 24 Replies
Hi, this is a little tool which helps you to collect the daily login bonus ;)
It will just login every 24 hours after u started it
A user requested this tool and maybe some others need it too during the bots are still offline
Clikc the x to minimize it to the tray! use the notifyicon to close or show it again ;)
v2.0 DL :DODLBT.exe ? RGhost ? file sharing
v2.0 VT:https://www.virustotal.com/de/file/9e8552641bbf 82ad615ffb1ab3c85b12d989c05c386a77408717d6085b38fc b4/analysis/1365794944/
AUTO GEMS HACK DAILY BONUS
05/20/2014 - Dragon City - 78 Replies
If you opened daily bonus
IT will take you ~ 3 -> 36 gems to open Daily reward again
auto get 50Gem
IT will take you ~ 3 -> 36 gems to open Daily reward again
auto get 50Gem
or
IF YOU NOT OPEN DAILY BONUS
auto get 50Gem
IT will take you ~ 3 -> 36 gems to open Daily reward again
auto get 50Gem
[P-SERVER] Daily Come Back Bonus
04/07/2013 - 4Story - 3 Replies
Hey leute,
ich möchte euch heute einmal meine neuste Funktion vorstellen.
Bevor ich loslege, gehen aber ersteinmal credits an den syntaxfehler raus, da meine Funktion auf seiner basiert, allerdings grundlegend geändert wurde.
Was kann meine Funktion?
Sie gibt euch jeden Tag alle 24 Stunden etwas Geld, welche euch in einem Brief zugeschickt wird. Syntaxfehler hatte ebenfalls so dieses Feature, allerdings war der abgesendete Brief zu lückenhaft.
http://i.epvpimg.com/wKTmh.jpg
Was kann...
[CocaCola] Bonus Codes [Daily Update]
09/21/2011 - elite*gold Trading - 12 Replies
Hey,
ich bekomme täglich neue CokeBonus Codes..
__
Diese könnt ihr sammeln und für tolle Prämien eintauschen-
Startseite | MeinCokeBonus
Ich verkaufe nur > 20 Punkte Codes < !!
Darkorbit daily login bonus?
11/21/2010 - DarkOrbit - 10 Replies
Hallo ich habe bei meinem Darkorbit Acc so ein daily log in bonus erhalten und habe mich 5tage lang hintereinander eingeloggt und habe keins von den items bekommen die da aufgelistet waren.:confused:
Was soll ich tun????
All times are GMT +2. The time now is 02:01 .