Jump to content

make this faster more efficient anyway?


devWhiz

Recommended Posts



$ch = curl_init();
////////////////////////////////////
////////////////////////////////////
for($cwb=1; $cwb!=$Amount; $cwb++)
  {
  $action = file_get_contents($Game."refresh_stat_manual?user_id=".$Keys[0]."&auth_key=".$Keys[1]);
  $xml = simplexml_load_string($action);
  foreach($xml->xml->viewer->user as $stats)	
    {
    $energy=$stats->energy;
    $level=$stats->level;
}
  if($energy <= 0 || $Stop <= $level) { echo "REACHED EITHER LEVEL $Stop OR... YOU ARE OUT OF ENERGY...\n"; sleep(100000);  }
  $send1 = $Game."send_requests?user_id=".$IDone."&to_user_ids=".$Keys[0]."&auth_key=".$AuthOne;
  curl_setopt($ch, CURLOPT_URL, $send1);
  curl_exec($ch);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $send2 = $Game."send_requests?user_id=".$IDtwo."&to_user_ids=".$Keys[0]."&auth_key=".$AuthTwo;
  curl_setopt($ch, CURLOPT_URL, $send2);
  curl_exec($ch);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $accept = $Game."accept_all_mob_requests?user_id=".$Keys[0]."&auth_key=".$Keys[1];
  curl_setopt($ch, CURLOPT_URL, $accept);
  curl_exec($ch);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $job = $Game."do_job?user_id=".$Keys[0]."&job_id=7200018&auth_key=".$Keys[1];
  curl_setopt($ch, CURLOPT_URL, $job);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $exec1 = curl_exec($ch);
  if(stristr($exec1, 'You gained 6') || stristr($exec1, 'You gained 1') || stristr($exec1, 'ambulance'))
  { echo "#$cwb: <-- You've gained 1 ambulance... Level - ".$level." ::: ENERGY - ".$energy." :::\n"; }
  for($abc =1; $abc!=2; $abc++){
  $remove1 = $Game."remove_mob_member?user_id=".$Keys[0]."&remove_user_id=".$IDone."&auth_key=".$Keys[1];
  curl_setopt($ch, CURLOPT_URL, $remove1);
  curl_exec($ch);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);}
  for($abc =1; $abc!=2; $abc++){
  $remove2 = $Game."remove_mob_member?user_id=".$Keys[0]."&remove_user_id=".$IDtwo."&auth_key=".$Keys[1];
  curl_setopt($ch, CURLOPT_URL, $remove2);
  curl_exec($ch);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);}
  $sell = $Game."buy_item?user_id=".$Keys[0]."&item_id=32&amount=".$Amount."&auth_key=".$Keys[1];
  curl_setopt($ch, CURLOPT_URL, $sell);
  $exec2 = curl_exec($ch);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  if(stristr($exec2, 'sold'))
  { echo "::: You've sold 1 ambulance...\n"; }
  }
curl_close();

 

Any idea on how I could make this faster or what I could change to make it to more efficient

Link to comment
https://forums.phpfreaks.com/topic/233902-make-this-faster-more-efficient-anyway/
Share on other sites

In many of the cases it does not appear as though you need curl as you don't do anything with the data.  I would just use fopen to open particular URLs.  That way you don't have to set any parameters.  Again this is ONLY in cases where you do NOT care about returning the data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.