About
Community
Bad Ideas
Drugs
Ego
Erotica
Fringe
Society
Technology
register | bbs | search | rss | faq | about
meet up | add to del.icio.us | digg it
Go Back   Community > Technology > Everything *NIX
Register FAQ Members List Calendar Today's Posts

Everything *NIX This is a general forum about all forms of *nix. Post your ideas and thoughts on this wonderful OS family. Talk about your personal favorite flavor of *nix and why you think it's so much better than the others. Anything pertaining to *nix and *nix administration should be posted here.

Reply
 
Thread Tools Display Modes
  #1   Add ThunderChicken to your ignore list  
Old 2008-04-07, 19:22
ThunderChicken ThunderChicken is offline
Regular
 
The Internet :P
Default Cron job outputting errors

Ok i understand the undefinned offset error, I get that when i run it from the browser also. Yet it still does what it suppose to. Everything else works when i run it from the browser ect....... but when i run it from cron with the below command i get this. :S Is there another way to run this script without getting this error. what am i doing wrong that causing these errors?

Quote:
Output from command php -q /home/shockey/public_html/Beta/666.php ..

PHP Warning: fopen(headers/xxxxxxxxx@hotmail.com.txt): failed to open stream: No such file or directory in /home/shockey/public_html/Beta/666.php on line 29

Warning: fopen(headers/xxxxxxx@hotmail.com.txt): failed to open stream: No such file or directory in /home/shockey/public_html/Beta/666.php on line 29
PHP Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in /home/shockey/public_html/Beta/666.php on line 43

Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in /home/shockey/public_html/Beta/666.php on line 43
PHP Warning: fclose(): supplied argument is not a valid stream resource in /home/shockey/public_html/Beta/666.php on line 45

Warning: fclose(): supplied argument is not a valid stream resource in /home/shockey/public_html/Beta/666.php on line 45
PHP Warning: file(headers/wolverine1666@hotmail.com.txt): failed to open stream: No such file or directory in /home/shockey/public_html/Beta/666.php on line 670

Warning: file(headers/xxxxxxxxxxxx@hotmail.com.txt): failed to open stream: No such file or directory in /home/shockey/public_html/Beta/666.php on line 670
PHP Warning: Invalid argument supplied for foreach() in /home/shockey/public_html/Beta/666.php on line 672

Warning: Invalid argument supplied for foreach() in /home/shockey/public_html/Beta/666.php on line 672
14:17:06 - xxxxxxxxxxxxxxx@hotmail.com<br>
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 332

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 332
14:17:06 - Repair cost = <br>
14:17:06 - Already bought mercs<br>
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 391

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 391
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 398

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 398
14:17:06 - gold
14:17:06 - No deposits statements found<br>
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 417

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 417
14:17:06 - not enough money to bank<br>
14:17:06 - recruiting started!<br>
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 591

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 591
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 592

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 592
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 594

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 594
(0) no ticket number found<br>
PHP Notice: Undefined variable: ticket in /home/shockey/public_html/Beta/666.php on line 616

Notice: Undefined variable: ticket in /home/shockey/public_html/Beta/666.php on line 616
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 626

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 626
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 629

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 629
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 630

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 630
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 647

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 647
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 648

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 648
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 651

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 651
(0) no ticket number found<br>
14:17:09 - recruiting done!<br>
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 275

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 275
14:17:09 - logged out.<br>
Reply With Quote
  #2   Add Zok to your ignore list  
Old 2008-04-09, 14:50
Zok Zok is offline
Forum Administrator
 
Columbus Ohio
Default Re: Cron job outputting errors

Use absolute paths. Cron doesn't run the script from the script's actual location.
__________________
[zok@zoklet ~]$ whereis Zok
Zok: /derzok/at/gmail/dot/com http://bbs.zoklet.net/ http://itcrawledupmy.com/ http://therevoltpress.org
Reply With Quote
  #3   Add ThunderChicken to your ignore list  
Old 2008-04-10, 05:19
ThunderChicken ThunderChicken is offline
Regular
 
The Internet :P
Default Re: Cron job outputting errors

Quote:
Originally Posted by Zok View Post
Use absolute paths. Cron doesn't run the script from the script's actual location.
so that means the www.website.com/path/to/script right?
Reply With Quote
  #4   Add Zok to your ignore list  
Old 2008-04-11, 21:05
Zok Zok is offline
Forum Administrator
 
Columbus Ohio
Default Re: Cron job outputting errors

That means that if your cronjob does anything that involves moving files, editing files, or even looking at files, you need to tell it exactly where that file is, ie: /home/username/path/to/file.ext

Post the contents of 666.php if you can. That'll give us a better idea of why it's bailing.
__________________
[zok@zoklet ~]$ whereis Zok
Zok: /derzok/at/gmail/dot/com http://bbs.zoklet.net/ http://itcrawledupmy.com/ http://therevoltpress.org
Reply With Quote
  #5   Add ThunderChicken to your ignore list  
Old 2008-04-14, 18:55
ThunderChicken ThunderChicken is offline
Regular
 
The Internet :P
Default Re: Cron job outputting errors

Quote:
Originally Posted by Zok View Post
That means that if your cronjob does anything that involves moving files, editing files, or even looking at files, you need to tell it exactly where that file is, ie: /home/username/path/to/file.ext

Post the contents of 666.php if you can. That'll give us a better idea of why it's bailing.
so tell it exactly where it is in the file? Or would i do this with some line in the cron job command?

btw: here the script

Quote:
<?php

dtdarkmanage ("email@email.com","password","1","1290000","1","3 ","100000000");


function dtdarkmanage($email,$password,$bangsa,$harga,$min_ fort_damages,$mode,$min_bank){
set_time_limit(0);

$post_arr = array ("email" => $email, "password" => $password, "submit" => 'TRUE',);
$dthrones = "http://www.darkthrone.com";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0";
//$agent = "MSIE 6.0 (compatible; Mozilla/4.0; Windows NT 5.1) Opera 7.54u1 [en]";
$error_msg='';
$newfile = "headers/".$email.".txt";
$url="darkthrone.com/login.dt";
$headertemp = fopen($newfile,"w");


//AUTO LOGIN
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$headers = array("Expect:");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_POST,1);
//curl_setopt($ch, CURLOPT_PROXY, "220.225.196.124: 80");
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_arr);
//curl_setopt($ch, CURLOPT_REFERER, "darkthrone.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt ($ch, CURLOPT_WRITEHEADER, $headertemp);
curl_exec($ch);
fclose($headertemp);
curl_close($ch);
$fillheader = $newfile;
$confim = findme2($fillheader, "20", "32", "redirect.dt?s");

echo date('H:i:s');
echo " - $email<br>\n";

if ($confim <> "") {
echo date('H:i:s');
echo " - Login succesful! SESSION-ID = $confim<br>\n";
}
$session=$confim;

//modes:
//1 = build mode with miners (repair, mercs, train miners, auto buy, bank remaining)
//2 = bank mode (repair, mercs, train miners, bank)
//3 = pop build (repair, mercs, bank)
//4 = drone mode (mercs, bank)
if ($mode==1){
//AUTO_REPAIR
auto_repair($dthrones,$agent,$session);

//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//TRAIN_MINERS
trainminers($dthrones,$agent,$session);

//AUTO_BUY
$duit = getmoney($dthrones,$agent,$session);
auto_buy($dthrones,$agent,$session,$harga,$duit,$b angsa);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - Logged out.<br><br>\n";
}

elseif ($mode==2){
//AUTO_REPAIR
auto_repair($dthrones,$agent,$session);

//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//TRAIN_MINERS
trainminers($dthrones,$agent,$session);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - Logged out.<br>\n";
}

elseif ($mode==3){
//AUTO_REPAIR
auto_repair($dthrones,$agent,$session);

//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - logged out.<br>\n";
}
elseif ($mode==4){
//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - logged out.<br>\n";
}

}
Reply With Quote
  #6   Add Zok to your ignore list  
Old 2008-04-16, 16:10
Zok Zok is offline
Forum Administrator
 
Columbus Ohio
Default Re: Cron job outputting errors

Your use of $newfile is incorrect.

When you set it to "headers/" . $email . ".txt" you should instead set it to: "/home/username/path/to/headers/" . $email . ".txt"

If you don't know the path to the headers folder, navigate there from the command line (or ftp) and issue the command "pwd" (print working directory).

Code:
bash-3.1$ ls test/

email.txt

bash-3.1$ ls /home/zok/test/

email.txt
Notice how /home/zok/test and test/ are the same thing? That works here. But if I were to navigate to... /home/notzok and run "ls test/" it would instead tell me "ls: cannot access test: No such file or directory" - why? Because "header/" and "test/" are relative in comparison to the script. If you supply the full path beginning with a /, it assumes that it's an absolute path.

Analogy time: Question: "Where is ohio?" Answer 1: "North" Answer 2: "Latitude 38° 24′ N to 41° 59′ N - Longitude 80° 31′ W to 84° 49′ W" Answer 1 will only be correct some of the time - it depends on where you are. Answer 2 will always be correct - regardless of where you are.

When your cron script runs, it is not running your script from the script's location on the computer - instead cron runs it from its own area on the computer (I don't know where or how). The problem is that it's looking for a directory called "headers" there. If you give it the absolute path, it can't make a mistake because you're telling it exactly where your "headers/" directory is.

Does that make sense?

http://linux.about.com/cs/linux101/g...ivevsdtabs.htm
__________________
[zok@zoklet ~]$ whereis Zok
Zok: /derzok/at/gmail/dot/com http://bbs.zoklet.net/ http://itcrawledupmy.com/ http://therevoltpress.org
Reply With Quote
  #7   Add ThunderChicken to your ignore list  
Old 2008-04-16, 19:30
ThunderChicken ThunderChicken is offline
Regular
 
The Internet :P
Default Re: Cron job outputting errors

Yes it does, thanks for the help and explanation of it and reason behind it. I understand it now

Now the undefined offset error is causing alot of problems with my preg_match arrays.

Quote:
Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 332
14:24:43 - Repair cost = <br>
14:24:43 - Already bought mercs<br>
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 391

Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 391
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 398

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 398
14:24:44 - gold
14:24:44 - No deposits statements found<br>
PHP Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 417

Notice: Undefined offset: 1 in /home/shockey/public_html/Beta/666.php on line 417
14:24:44 - not enough money to bank<br>
14:24:44 - recruiting started!<br>
PHP Notice: Undefined offset: 0 in /home/shockey/public_html/Beta/666.php on line 591
Reply With Quote
  #8   Add Zok to your ignore list  
Old 2008-04-17, 04:16
Zok Zok is offline
Forum Administrator
 
Columbus Ohio
Default Re: Cron job outputting errors

Quote:
Originally Posted by ThunderChicken View Post
Yes it does, thanks for the help and explanation of it and reason behind it. I understand it now

Now the undefined offset error is causing alot of problems with my preg_match arrays.
What is on each of those lines? The code you pasted above only has 189 lines.
__________________
[zok@zoklet ~]$ whereis Zok
Zok: /derzok/at/gmail/dot/com http://bbs.zoklet.net/ http://itcrawledupmy.com/ http://therevoltpress.org
Reply With Quote
  #9   Add ThunderChicken to your ignore list  
Old 2008-04-17, 18:01
ThunderChicken ThunderChicken is offline
Regular
 
The Internet :P
Default Re: Cron job outputting errors

<?php

// comments
// bangsha: 2 for human ; 1 for rest
// harga: total amount of money needed to buy 1 full set of equipment
//dtdarkmanage("e-mail","pass","human(2)/rest(1)","715000(money needed for one full offense set (+steeds)","(max fort dmg)","mode");
//1 = build mode with miners (repair, mercs, train miners, auto buy, bank remaining)
//2 = bank mode (repair, mercs, train miners, bank)
//3 = pop build (repair, mercs, bank)
//4 = drone mode (mercs bank)

// 1= non human 665,000/steeds 1,095,000 off *& spy off: 1290000/ steeds 1720000
// 2= human 715,000/ steeds 1145000 Off & Spy Off:1340000 / steeds 1965000

dtdarkmanage ("email","passdfasdfas","1","1290000","1","3","100 000000");


function dtdarkmanage($email,$password,$bangsa,$harga,$min_ fort_damages,$mode,$min_bank){
set_time_limit(0);

$post_arr = array ("email" => $email, "password" => $password, "submit" => 'TRUE',);
$dthrones = "http://www.darkthrone.com";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0";
//$agent = "MSIE 6.0 (compatible; Mozilla/4.0; Windows NT 5.1) Opera 7.54u1 [en]";
$error_msg='';
$newfile = "/home/shockey/public_html/Beta/headers/".$email.".txt";
$url="darkthrone.com/login.dt";
$headertemp = fopen($newfile,"w");


//AUTO LOGIN
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$headers = array("Expect:");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_POST,1);
//curl_setopt($ch, CURLOPT_PROXY, "220.225.196.124: 80");
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_arr);
//curl_setopt($ch, CURLOPT_REFERER, "darkthrone.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt ($ch, CURLOPT_WRITEHEADER, $headertemp);
curl_exec($ch);
fclose($headertemp);
curl_close($ch);
$fillheader = $newfile;
$confim = findme2($fillheader, "20", "32", "redirect.dt?s");

echo date('H:i:s');
echo " - $email<br>\n";

if ($confim <> "") {
echo date('H:i:s');
echo " - Login succesful! SESSION-ID = $confim<br>\n";
}
$session=$confim;

//modes:
//1 = build mode with miners (repair, mercs, train miners, auto buy, bank remaining)
//2 = bank mode (repair, mercs, train miners, bank)
//3 = pop build (repair, mercs, bank)
//4 = drone mode (mercs, bank)
if ($mode==1){
//AUTO_REPAIR
auto_repair($dthrones,$agent,$session);

//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//TRAIN_MINERS
trainminers($dthrones,$agent,$session);

//AUTO_BUY
$duit = getmoney($dthrones,$agent,$session);
auto_buy($dthrones,$agent,$session,$harga,$duit,$b angsa);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - Logged out.<br><br>\n";
}

elseif ($mode==2){
//AUTO_REPAIR
auto_repair($dthrones,$agent,$session);

//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//TRAIN_MINERS
trainminers($dthrones,$agent,$session);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - Logged out.<br>\n";
}

elseif ($mode==3){
//AUTO_REPAIR
auto_repair($dthrones,$agent,$session);

//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - logged out.<br>\n";
}
elseif ($mode==4){
//AUTO_MERCENARY
auto_mercenary($dthrones,$agent,$session);

//BANK
$duit = getmoney($dthrones,$agent,$session);
$duit2 = floor($duit/100*80);
if ($duit > $min_bank){
auto_bank($dthrones,$agent,$session,$duit2,$duit);
}
else{
echo date('H:i:s');
echo " - not enough money to bank<br>\n";
}

//AUTO_REKRUT
echo date('H:i:s');
echo " - recruiting started!<br>\n";
auto_rekrut($dthrones,$session, $agent);
echo date('H:i:s');
echo " - recruiting done!<br>\n";

//AUTO_LOGOUT
$ID = getID($dthrones,$agent,$session);
$url_logout = $dthrones."/logout.dt?session=".$session;
execute_post($url_logout,$agent,"&user=".$ID);
echo date('H:i:s');
echo " - logged out.<br>\n";
}

}

function auto_repair($dthrones,$agent,$session){
$url = $dthrones."/repair.dt?session=".$session;
$DamageCost=check_damage_cost($url,$agent);

if($DamageCost > 0){
$CheckDuitUtkRepair = getavailgold($url,$agent);
if ($CheckDuitUtkRepair < $DamageCost) {
//Duit tak cukup nak repair.. Keluar duit dari bank
auto_withdraw($dthrones,$agent,$session,$DamageCos t);
}

$postfield3="action=repair&all=true";
$postfieldsize3=strlen($postfield3);
execute_post($url,$agent,$postfield3);
echo date('H:i:s');
echo " - Repair completed<br>\n";
}
return "true";
}

function getavailgold($url,$agent){

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_HEADER, 1);
$res=curl_exec($ch);

$a=preg_match("/\bGold: \b.*/i",$res,$d);
$b=preg_match_all('/(?[0-9]+)|.)/i', $d[0], $d2);

$availgold=implode('',$d2[1]);

curl_close($ch);
return $availgold;
}

function getuntrained($dthrones,$agent,$session){
$url = $dthrones."/members.dt?session=".$session;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_HEADER, 1);
$res=curl_exec($ch);

$a=preg_match("/\bUntrained Citizens:\n\b.*/i",$res,$d);
$b=preg_match_all('/(?[0-9]+)|.)/i', $d[0], $d2);

$untrained=implode('',$d2[1]);

curl_close($ch);

return $untrained;
}
Reply With Quote
  #10   Add ThunderChicken to your ignore list  
Old 2008-04-17, 18:02
ThunderChicken ThunderChicken is offline
Regular
 
The Internet :P
Default Re: Cron job outputting errors

code removed to save scrolling

Last edited by ThunderChicken; 2008-04-18 at 18:48.
Reply With Quote
This thread continued for 2 pages in the real archive, 14 posts total - only page 1 survived here.
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

 
To the best of our knowledge, the text on this page may be freely reproduced and distributed.
 

totse.com certificate signatures
 
 
About | Community | Bad Ideas | Drugs | Ego | Erotica | Fringe | Society | Technology
Hot Topics