LCKB
online time point bug - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Guides & Help Section (https://lckb.dev/forum/forumdisplay.php?fid=193)
+---- Forum: Help & Support (https://lckb.dev/forum/forumdisplay.php?fid=157)
+----- Forum: Ep2 Support (https://lckb.dev/forum/forumdisplay.php?fid=166)
+------ Forum: Solved Topics (https://lckb.dev/forum/forumdisplay.php?fid=144)
+------ Thread: online time point bug (/showthread.php?tid=2590)

Pages: 1 2


- MrBuSta - 10-30-2013


Hi all

I have problem with added online time point script on my website,im added it and in bg_user added a_online_time,but its not give 5 online time point after 5min online in game...
here is screen:

2

and here is script:

 
<!DOCTYPE html>
<html>
<head>
<title>AutoIT Script By MaX</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
 
 
function Timer(id, minLimit, callback){
var thisTimer = this;
this.limit = minLimit * 60;
this.callback = callback;
this.timer = 0;
this.addEvent(window, load, function(){
thisTimer.el = document.getElementById(id);
thisTimer.txt = thisTimer.el.firstChild;
thisTimer.intv = setInterval(function(){thisTimer.intvFunc();}, 1000);
});
}
 
Timer.prototype = {
 
intvFunc: function(){
this.txt.nodeValue = this.formatTime(++this.timer);
if(this.timer === this.limit){
clearInterval(this.intv);
this.callback.call(this);
}
},
 
formatNum: function(n){
return n < 10? 0 + n : n;
},
 
formatTime: function (n, m, s){
s = n % 60;
m = (n - s) / 60;
return [this.formatNum(m), :, this.formatNum(s)].join();
},
 
addEvent: (function(){return window.addEventListener? function(el, ev, f){
el.addEventListener(ev, f, false);
}:window.attachEvent? function(el, ev, f){
el.attachEvent(on + ev, f);
}:function(){return;};
})()
};
 
// Usage: new Timer(id_of_counting_element, #_of_mins, callback_function(){});
new Timer(timer1, 5, function(){this.el.parentNode.style.color = red});
</script>
</head>
<body>
<?php
include settings.php ;
 $connect = mysql_connect($server_ip, $user, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
mysql_select_db($database2) or die(mysql_error());
mysql_select_db($database3) or die(mysql_error());
// Add all needed website setting below:
$SiteSQL["config-server"] = 127.0.0.1 // mysql ip
$SiteSQL["config-username"] = username"     // mysql username
$SiteSQL["config-password"] = password    // mysql password
$SiteSQL["config-database_auth"] = newproject_db_auth   // auth database
$SiteSQL["config-database_db"] = newproject_db     // db database
$SiteSQL["config-database_data"] = newproject_data   // data database
 
 
$Site_sqlcon = mysql_connect( $SiteSQL["config-server"] , $SiteSQL["config-username"] , $SiteSQL["config-password"] ) or die( mysql_error() );
 
echo "<b><font size=6>AutoIT Script By MaX</font></b><br />KEEP THIS FILE HIDDEN, ONLY RUN ON ROOT<br/>";
$mysql = mysql_select_db( $SiteSQL["config-database_db"] , $Site_sqlcon) or die( mysql_error() );
$result1 = mysql_query("SELECT a_portal_index from t_users WHERE a_zone_num > -1");
$result1a = mysql_query("SELECT count(a_index) from t_users WHERE a_zone_num > -1");
$r1a = mysql_fetch_row( $result1a );
$Effected = $r1a[0];
while($r1 = mysql_fetch_array( $result1 )) 
{
$UID = $r1[a_portal_index];
$mysql2 = mysql_select_db( $SiteSQL["config-database_auth"] , $Site_sqlcon) or die( mysql_error() );
$result2 = mysql_query("UPDATE bg_user SET a_online_time = a_online_time + 5 where user_code = $UID");
}
?>
<hr/><br/>
Effected Accounts: <?PHP print $Effected; ?>
<div>Next AutoIT in 5 minutes: <span id="timer1">00:00</span></div>
Players will receive <font color = red><b><? print $points; ?></b></font> online points every 5 minutes.
<meta http-equiv="refresh" content="300; url=onlinetime.php">
</body>
</html>



- Creep - 10-30-2013

I think you basically need to leave it online on the server, there was something like that but I cant remember




- MrBuSta - 10-30-2013


I think you basically need to leave it online on the server, there was something like that but I cant remember

What you mean with "Need to leave it online" ? Sorry i dont understand it :/




- SibaN - 11-02-2013


you need to open that page every time 

 

exemple 2

 

you need to open that every time in youre pc to work if you clos it dont get cash 




- macacoloco - 12-07-2013


Hi this script does not work for me could someone help me?

 

 

 

Parse error: syntax error, unexpected T_VARIABLE in /home/u577391235/public_html/onlinetime.php on line 62

 

is   $SiteSQL["config-username"] = root"     // mysql username




- Sutz - 12-07-2013


Its my script. you need to open it in a browser an leave it open. every time the time hits 5min the page with auto reload an add cash to every account thats online then wait for 5min an do the same again over an over an over.

The script HAS to be open always in your browser to work.

 

 

$SiteSQL["config-username"] = root"     // mysql username

change to

$SiteSQL["config-username"] = root;     // mysql username




- macacoloco - 12-07-2013

thx




- macacoloco - 12-07-2013


continuing with the same error = /

beyond the online team have to have another scrypt?




- macacoloco - 12-07-2013


i have this i need help =/
I can pay if needed

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/...../...../onlinetime.php on line 70 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/........./........./onlinetime.php on line 72




- Paramount - 12-08-2013

and whats wrong with it? because of this warning script does not work? if it does, just past error_reporting(0); after <?php