Register for your free account! | Forgot your password?

You last visited: Today at 08:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Boss timer fail :(

Discussion on Boss timer fail :( within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2013
Posts: 22
Received Thanks: 0
Boss timer fail :(

I am in this sphere new and I do not understand much.
please if anyone can help me only with the addition of the first boss because I do not quite understand php
as I said I'm new and I'm not with you in the php language thank you in advance

$boss1 = date_format($date_create($detail['ActionTime']),"H:i:s", strtotime("+43200"));

PHP Code:
<?php
function mssql_escape_string($data) {
if(!isset(
$data) or empty($data)) return '';
if(
is_numeric($data)) return $data;
$non_displayables = array(
'/%0[0-8bcef]/'// url encoded 00-08, 11, 12, 14, 15
'/%1[0-9a-f]/'// url encoded 16-31
'/[\x00-\x08]/'// 00-08
'/\x0b/'// 11
'/\x0c/'// 12
'/[\x0e-\x1f]/' // 14-31
);
foreach(
$non_displayables as $regex)
$data preg_replace($regex,'',$data);
$data str_replace("'","''",$data);
return 
$data;
}

$host '127.0.0.1';
$dbuser 'Shaiya'// put here your DB login
$dbpass 'Shaiya123'// put here your password DB
$database 'PS_GameLog';
$conn =  [MENTION=311501]ODB[/MENTION]c_connect("Driver={SQL Server};Server=$host;Database=$database"$dbuser$dbpass) or die("Database Connection Error!");
$boss1 odbc_exec($conn"SELECT [ActionTime] FROM [dbo].[Boss_Death_Log] WHERE [MobID]='901'order by ActionTime desc");
$detail=odbc_fetch_array($boss1);

//Here need to add an if where you see if the time i expired or not! in case is not expired show the countdown else need to return something like "UP NOW".

$boss1 date_format($date_create($detail['ActionTime']),"H:i:s"strtotime("+43200"));

echo 
"
<table cellspacing=1 cellpadding=4 border=1 style=\"border-style:hidden;\">
<tr>
<th>Boss Name</th>
<th>Kill Zeit</th>
<th>Respawn</th>
</tr>"
;
echo 
"<tr>";
echo 
"<td>Asiris</td><td>"substr($s['ActionTime'],019) ."</td><td>"$boss1 ."</td>";
nicki93 is offline  
Old 04/23/2019, 07:25   #2
 
elite*gold: 0
Join Date: Jun 2017
Posts: 69
Received Thanks: 6
msql>?
mr.hellraven is offline  
Old 04/23/2019, 17:38   #3
 
elite*gold: 0
Join Date: Jul 2013
Posts: 22
Received Thanks: 0
Quote:
Originally Posted by mr.hellraven View Post
msql>?
nope mssql
nicki93 is offline  
Old 07/03/2019, 03:06   #4
 
jenny2011's Avatar
 
elite*gold: 0
Join Date: Oct 2011
Posts: 169
Received Thanks: 47
Quote:
I am in this sphere new and I do not understand much.
please if anyone can help me only with the addition of the first boss because I do not quite understand php
as I said I'm new and I'm not with you in the php language thank you in advance

$boss1 = date_format($date_create($detail['ActionTime']),"H:i:s", strtotime("+43200"));

PHP-Code:
<?php
function mssql_escape_string($data) {
if(!isset($data) or empty($data)) return '';
if(is_numeric($data)) return $data;
$non_displayables = array(
'/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15
'/%1[0-9a-f]/', // url encoded 16-31
'/[\x00-\x08]/', // 00-08
'/\x0b/', // 11
'/\x0c/', // 12
'/[\x0e-\x1f]/' // 14-31
);
foreach($non_displayables as $regex)
$data = preg_replace($regex,'',$data);
$data = str_replace("'","''",$data);
return $data;
}

$host = '127.0.0.1';
$dbuser = 'Shaiya'; // put here your DB login
$dbpass = 'Shaiya123'; // put here your password DB
$database = 'PS_GameLog';
$conn = @c_connect("Driver={SQL Server};Server=$host;Database=$database", $dbuser, $dbpass) or die("Database Connection Error!");
$boss1 = odbc_exec($conn, "SELECT [ActionTime] FROM [dbo].[Boss_Death_Log] WHERE [MobID]='901'order by ActionTime desc");
$detail=odbc_fetch_array($boss1);

//Here need to add an if where you see if the time i expired or not! in case is not expired show the countdown else need to return something like "UP NOW".

$boss1 = date_format($date_create($detail['ActionTime']),"H:i:s", strtotime("+43200"));

echo "
<table cellspacing=1 cellpadding=4 border=1 style=\"border-style:hidden;\">
<tr>
<th>Boss Name</th>
<th>Kill Zeit</th>
<th>Respawn</th>
</tr>";
echo "<tr>";
echo "<td>Asiris</td><td>". substr($s['ActionTime'],0, 19) ."</td><td>". $boss1 ."</td>";

German

Ist nicht Perfekt. Aber vielleicht hilft es ja.
Bitte beachte, das du >> SQLSRV <<brauchst.


PHP Code:
<html>
<meta http-equiv="refresh" content="20">
<head>
<style type="text/css">
html, body {height:100%; margin:0; padding:0;}
#page-background {position:fixed; top:0; left:0; width:50%; height:50%;}
#content {position:relative; z-index:1; padding:10px;}
body,th {
color: #f0d693;
font-size: 15px;
}
td {
    font-size: 13px;
    color: #f0d693;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#FFFFFF">
<div id="page-background"></div>
<div id="content">
<?php

//    Connect to server with Shaiya credentials using PDO
$sqlUser 'Shaiya'//    YOUR SHAIYA ACCOUNT NAME
$sqlPass 'Shaiya123';    //    YOUR SHAIYA ACCOUNT PASSWORD
$database 'PS_UserData';

try {
$conn = new PDO("sqlsrv:Server=127.0.0.1;Database=$database"$sqlUser$sqlPass);
}
catch (
PDOException $e){
die(
$e->getMessage());
}

echo 
'<table width="275"> 
<tr class="boss-record">
<th class="boss-record"><span style="color:CD661D; margin: 3px;">-----------------</th>
<th class="boss-record"><span style="color:CD661D; margin: 3x;">-----------------</th>
<th class="boss-record"><span style="color:CD661D; margin: 3x;">-----------------</th>
</tr>'
;

@
$time date("Y-m-d H:i:s.000");

// add here more bosses, just the MobID.
@$bosses = array(=> '2785');

foreach (
$bosses as $key => $value) {
$query $conn->prepare ("SELECT TOP 1 [MobName], [CharName], [ActionTime] FROM PS_GameLog.dbo.Boss_Death_Log WHERE MobID= ? ORDER BY ActionTime DESC");
$query->bindValue(1$valuePDO::PARAM_INT);
$query->execute();
$boss $query->fetch(PDO::FETCH_NUM);

if (
$boss[0] != NULL){

// WHEN YOU ADD A MOB REMEMBER TO ADD THE TIME
switch ($value){
case 
2785$hours 12; break;

}

@
$nextTime date("Y-m-d H:i:s"strtotime($boss[2].'+'.$hours.' hours'));

if (
$nextTime $time){
$time_Result '<span style="color:green; margin: 3px;">Boss is Ready</span>';
} else{

$newTime strtotime($nextTime);
$time1 strtotime($time);

$countdown $newTime $time1;
$days_left gmdate("d"$countdown);
$hours_left gmdate("H"$countdown);
$min_left gmdate("i"$countdown);
$sec_left gmdate("s"$countdown);
$daysstr "d";
if (
$days_left != "1"){
$daysstr "d";
}else{
$daysstr "";
$days_left "";
}
$hstr "h";
if (
$hours_left != "1"){
$hstr "h";
}
$mstr "m";
if (
$min_left != "1"){
$mstr "m";
}
$sstr "s";
if (
$sec_left != "1"){
$sstr "s";
}

$time_Result ''.$days_left.' '.$daysstr.' '.$hours_left.' '.$hstr.' '.$min_left.' '.$mstr.' '.$sec_left.' '.$sstr.' '; } echo ' '


echo 
'
<tr>
<td>'
.$boss[0].'</td>
<td>'
.$boss[1].'</td>
<td>'
.$time_Result.'</td>
</tr>'
;
?>
jenny2011 is offline  
Reply


Similar Threads Similar Threads
Job Timer (Taxi Timer, etc)
09/01/2011 - SRO Hacks, Bots, Cheats & Exploits - 2 Replies
A small utility to keep track of jobs that need timing. http://img834.imageshack.us/img834/6076/jt01.png Always read the changelog! To get access to Job Timer, register at "www.error- soft.net" ( without the spaces between the - ) Press thanks if this helps at all.
Intervention Fail | Quickscope Fail | Lobby Fail
08/11/2011 - Call of Duty - 16 Replies
Hallo Leute, Zuerst zum Intervention Fail: ich habe seit einiger Zeit in MW2 das Problem, dass ich nurnoch Hitmaker bekomme. Ich benutze eine Intervention mit Vollmantelgeschoss und Feuerkraft(Pro) Egal ich ich stundenlang ziele, oder einen Quickscope mache, ich bekomme einfach nur einen Hitmaker. Eines meiner neusten Probleme ist, dass die Intervention garnicht mehr trifft. Egal ob Quickscope oder Hardscope, der Schuss geht daneben. In 70% der Fälle. selbst wenn ich genau vor dem...
FAIL | WAS FÜR EIN FAIL [ VIDEO ] | FAIL
09/22/2010 - Off Topic - 12 Replies
Schaut euch das an OMG XD YouTube - Durchfall im Pool



All times are GMT +1. The time now is 08:12.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.