VapiD Posted March 26, 2010 Share Posted March 26, 2010 Hello, prior to reformatting, the PHP script I'm using worked in cmd line perfectly fine. However, after formatting, it goes partway through then ends when it should be looping. If you can help me figure out the issue, it would be much appreciated. Thanks. It makes it to the point the following is displayed in cmd prompt echo "CONNECTING TO MYSPACE FOR: $login\n"; echo "Please Stand By \n\n"; Anyways heres the code. <?php ///////////////////////////////////////////////////////////////// ////// $myHeader[]=get_myspace_header('[email protected]','pass'); $myHeader[]=get_myspace_header([email protected]','pass'); ///////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// ////// ID of person to attack you need to heal with outside program //////////////////////////////////////////////////////////////// $ATTACK_THIS_GUY= 474714782; //////////////////////////////////////////////////////////////// /////// Number of wins to put on the guys //////////////////////////////////////////////////////////////// $THISMANYWINS= 5000; //////////////////////////////////////////////////////////////// ///// Other Settings //////////////////////////////////////////////////////////////// set_time_limit(180000); // Set time limit $STAMINA_MIN= 1; //Will only attack if stamina is above this $MAXLEVEL=1000; $MINLEVEL=1; /////////////////////////////////////////////////// //////////// END SETTINGS ///////////////////////// /////////////////////////////////////////////////// /////////////////////////////////////////////////// //////////// PROCESSING /////////////////////////// /////////////////////////////////////////////////// $myDoomCount=count($myHeader); // Get the Open Social Token of each user for($i=0; $i<$myDoomCount; $i++) { // Split the header string on the left side of the token $iTemp = split("token=", $myHeader[$i]); // Split the second half of the header string on the right side of the token $iTemp = split("&open", $iTemp[1]); // Set $myOSKey[$i] as the token $myOSKey[$i] = $iTemp[0]; } // Get the ID of each user for($i=0; $i<$myDoomCount; $i++) { $iTemp = split("user_id%3D", $myHeader[$i]); $iTemp = split("%26", $iTemp[1]); $myID[$i] = $iTemp[0]; } // Header text strings $sHost = "http://api.msappspace.com/proxy/relay.proxy?opensocial_authtype=SIGNED&opensocial_token="; $sHost2 = "&opensocial_url=http%3A//mob-dynamic-lb1.mobsters06.com/mob/"; // Sesssion id's for heal and bank for($i=0; $i<$myDoomCount; $i++){ $iTemp= split("session_id%", $myHeader[$i]); $iTemp= split("%", $iTemp[1]); $mySESID[$i]=$iTemp[0]; $mySESID2[$i]=$iTemp[0]; } // Success on Attack Remove Bats and Bank Money if($BANK==TRUE){ file_get_contents($sHost.$myOSKey[$i].$sHost2."deposit%3Fuser_id%3D".$myID[$i]."%26amount%3D".$bounty."%26session_id%3D".$mySESID[$i]."&nocache=1"); } /////////////////////////////////////////////////// ////////// END PROCESSING /////////////////////// /////////////////////////////////////////////////// /////////////////////////////////////////////////// //////////// BEGIN PERFORMANCE //////////////////// /////////////////////////////////////////////////// // Start the transfer loop, perform 10 transfers total echo "Stamina Release Begins\t".date("H:i:s")."\n"; $a=0; for($b_count=0; TRUE; $b_count++){ for($i=0;$i<$myDoomCount;$i++){ $iStatList= file_get_contents($sHost.$myOSKey[$i].$sHost2."refresh_stat_manual%3Fuser_id%3D".$myID[$i]."%26level%3D300%26session_id%3D".$mySESID[$i]."&nocache=1"); $cash = split("<cash>", $iStatList); $cash = split("<", $cash[1]); $user_id= split("<user_id>", $iStatList); $user_id= split("</user_id>", $user_id[1]); $health= split("<health>", $iStatList); $health= split("</health>", $health[1]); $healthmax= split("<max_health>", $iStatList); $healthmax= split("</max_health>", $healthmax[1]); $iName= split("<mob_name>", $iStatList); $iName= split("<", $iName[1]); $iStamina= split("<stamina>", $iStatList); $iStamina= split("<", $iStamina[1]); $iLevel= split("<level>", $iStatList); $iLevel= split("<", $iLevel[1]); $temp= split("<message>", $iStatList); if(count($temp)>1){ $temp=split("</message>", $temp[1]); $this->message=$temp[0]; if(stristr($temp[0], "Captcha")!=FALSE) { $captcha=TRUE; $fp=fopen("CAPTCHA_LOG", "w"); $captcha_string="NAME= $iName[0] USER_ID=$user_id[0] at time ".Date('H:i:s')." \n"; fputs($fp, $captcha_string); fclose($fp); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////// Release Stamina on person you want to level ////////////////////////////////////////////// if(($STAMINA_MIN)<$iStamina[0]&&$iLevel[0]<=$MAXLEVEL&&$iLevel[0]>=$MINLEVEL){ if((((float)$health[0])/((float)$healthmax[0]))<.19){ file_get_contents($sHost.$myOSKey[$i].$sHost2."heal%3Fuser_id%3D".$myID[$i]."%26level%3D300%26session_id%3D".$mySESID[$i]."&nocache=1"); sleep(1); } //do the attack ... read the message look for captcha add to win total $fightstring=urldecode(file_get_contents($sHost.$myOSKey[$i].$sHost2."attack%3Fuser_id%3D".$myID[$i]."%26target_id%3D".$ATTACK_THIS_GUY."%26session_id%3D".$mySESID2[$i]."&nocache=1")); $temp= split("<message>", $fightstring); if(count($temp)>1){ $temp=split("</message>", $temp[1]); $message=$temp[0]; if(stristr($temp[0], "Captcha")!=FALSE) { $captcha=TRUE; $fp=fopen("CAPTCHA_LOG", "w"); $captcha_string="NAME= $iName[0] USER_ID=$user_id[0] at time ".Date('H:i:s')." \n"; fputs($fp, $captcha_string); fclose($fp); } if(stristr($temp[0], "lost")!=FALSE) { $fp=fopen("fight_log.txt", "a+"); $fight_string="NAME= $iName[0] USER_ID=$user_id[0] at time ".($THISMANYWINS--)." \n"; if($THISMANYWINS==0)exit; fputs($fp, $fight_string); echo $fight_string."\n"; fclose($fp); } } } } //while(date('H')%8==0||date('H')%8==1)sleep(10); if($b_count%5==4) { // echo "SLEEP 10\n"; sleep(10); } } function get_myspace_header($login, $pass, $auth_key_header=FALSE){ $BASE_DIR = "./"; $dirPath = $BASE_DIR .'myspacecookie.txt'; // folder path $fp = fopen($dirPath,'w'); fclose($fp); $cookie_file_path = $dirPath ; // Please set your Cookie File path $fp = fopen($cookie_file_path,'wb'); fclose($fp); echo "CONNECTING TO MYSPACE FOR: $login\n"; echo "Please Stand By \n\n"; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "https://secure.myspace.com/index.cfm?fuseaction=login.process"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)'); curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, '__VIEWSTATE=%2FwEPDwULLTIwOTI5NDgxMzlkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBTRjdGwwMCRjdGwwMCRjcE1haW4kY3BNYWluJExvZ2luQm94JFJlbWVtYmVyX0NoZWNrYm94&NextPage=&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Email_Textbox='.urlencode($login).'&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Password_Textbox='.urlencode($pass).'&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24SingleSignOnHash=&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24SingleSignOnRequestUri=&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24nexturl=&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24apikey=&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24ContainerPage=&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24SMSVerifiedCookieToken=&dlb=Log+In&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Remember_Checkbox=on');curl_setopt($ch, CURLOPT_REFERER,'http://www.myspace.com/index.cfm?fuseaction=splash');curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, 0); $output=curl_exec($ch); curl_close($ch); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&friendId=476831935&appParams={%22show_user_id%22%3A%22465399425%22}&newinstall=1"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)'); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $output=curl_exec($ch); curl_close($ch); $fileOut=fopen("myspace.html", "a+"); fputs($fileOut, $output); fclose($fileOut); //Parsing info from file $temp=split('<iframe id="apppanel_104283_canvas"', $output); $temp=split('src="',/*%20*/$temp[1]); $temp=split('"',$temp[1]); $temp_os=split('render.app#',$temp[0]); $temp_os=split('&open',$temp_os[1]); $os_key=urldecode($temp_os[0]); $temp_id=split('viewerId=',$temp[0]); $temp_id=split('&',$temp_id[1]); $friend_id=$temp_id[0]; if($friend_id>10){ $sHost = "http://api.msappspace.com/proxy/relay.proxy?opensocial_authtype=SIGNED&opensocial_token="; $sHost2 ="&opensocial_url=http%3A//mob-dynamic-lb1.mobsters05.com/mob/refresh_stat_manual%3Fuser_id%3D"; $header=$sHost.$os_key.$sHost2.$friend_id."%26session_id%3Db170c3c03a2c8c9e08e44a97d1cc7a018a80b73b"; if($auth_key_header==FALSE) return($header); else { $tempstring=file_get_contents($header); $strAuthkey=split('<auth_key>', $tempstring); if(count($strAuthkey)>1){ $strAuthkey=split('</auth_key>', $strAuthkey[1]); $header="http://mob-dynamic-lb5.mobsters02.com/mob/refresh_stat_manual?user_id=".$friend_id."&auth_key=".$strAuthkey[0]."&nocache=1234321"; return($header); } else return 0; } } else{ echo "NOT A VALID LOGIN PLEASE CHECK YOUR INFO"; sleep(298); exit; return (0); } } ?> Link to comment https://forums.phpfreaks.com/topic/196560-problem-with-php-script-in-cmd/ Share on other sites More sharing options...
trq Posted March 26, 2010 Share Posted March 26, 2010 Is curl enabled? Link to comment https://forums.phpfreaks.com/topic/196560-problem-with-php-script-in-cmd/#findComment-1032016 Share on other sites More sharing options...
VapiD Posted March 26, 2010 Author Share Posted March 26, 2010 Is curl enabled? Not sure, I did a fresh install of PHP. Never really done anything other than actual website php stuff. This code was something I purchased but doesn't work for me. How do I enable curl? Link to comment https://forums.phpfreaks.com/topic/196560-problem-with-php-script-in-cmd/#findComment-1032017 Share on other sites More sharing options...
trq Posted March 26, 2010 Share Posted March 26, 2010 You enabled extensions within the php.ini. You will see them all listed in there, just un-comment whatever you need making sure they actually exist within the ext directory first. Link to comment https://forums.phpfreaks.com/topic/196560-problem-with-php-script-in-cmd/#findComment-1032018 Share on other sites More sharing options...
VapiD Posted March 26, 2010 Author Share Posted March 26, 2010 extension=php_curl.dll was the only thing i found for curl. I took out the commenting and verified it exists within the ext directory, same issue. so, if that's what you had meant for me to do, it didn't work. Link to comment https://forums.phpfreaks.com/topic/196560-problem-with-php-script-in-cmd/#findComment-1032031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.