Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- set_time_limit(0);
- //CONFIG
- $n = "\n<br>";
- function isset_or(&$check, $alternate = NULL) {
- return (isset($check)) ? (empty($check) ? $alternate : $check) : $alternate;
- }
- if($_POST['submit'] == "send") {
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $site = isset_or($_POST['site'],"ts2.travian.co.uk");
- $sleep = isset_or($_POST['sleep'], 10);
- $namesP = $_POST['names'];
- $title = $_POST['title'];
- $message = $_POST['message'];
- $names = explode("\n", $namesP);
- print_r($names); echo $n;
- // BEGINNETH YE OLDE cURL
- $ch = curl_init();
- // Get LOGIN ID
- $loginURL = "http://".$site."/login.php";
- curl_setopt($ch, CURLOPT_URL, $loginURL);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $loginpg = curl_exec($ch);
- preg_match_all('#<input type="hidden" name="login" value="([0-9]+)" />#', $loginpg, $sess, PREG_SET_ORDER);
- foreach($sess as $ses)
- $sessionid = $ses[1];
- // LOGIN
- curl_setopt($ch, CURLOPT_URL, 'http://'.$site.'/dorf1.php');
- curl_setopt ($ch, CURLOPT_POST, 1);
- curl_setopt ($ch, CURLOPT_POSTFIELDS, 'lowRes=1s1=Login&name='.$user.'&password='.$pass.'&login='.$sessionid);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
- curl_exec ($ch);
- curl_close ($ch);
- echo "Running pm script on the server: http://".$site."/";
- // SEND PM
- foreach($names as $name) {
- $name = trim($name);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://'.$site.'/nachrichten.php');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 's1=send&c=4f1&an='.$name.'&be='.$title.'&message='.$message);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- //curl_setopt($ch, CURLOPT_REFERER, 'http://'.$site.'/nachrichten.php?t=1&id='.$userID);
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
- curl_exec($ch);
- echo "Sent to ".$name.". Waiting ".$sleep." seconds until next pm. ";
- echo '<small>(s1=send&c=4f1&an='.$name.'&be='.$title.'&message='.$message.')</small>'.$n;
- curl_close ($ch);
- sleep($sleep);
- }
- echo "All PMs sent. I think... :P";
- }
- else {
- echo "<!DOCTYPE html>
- <html>
- <head></head>
- <body>
- <form action='http://e-uk.net/tools/travspam.php' method='POST'>
- <select name='site'>
- <option value='ts2.travian.co.uk'>ts2.travian.co.uk</option>
- <option value='ts4.travian.co.uk'>ts4.travian.co.uk</option>
- <option value='ts5.travian.co.uk'>ts5.travian.co.uk</option>
- </select><br>
- Sleep: <input type='text' name='sleep' value='Seconds to wait between each pm (no decimals, just plain number)' /><br>
- User: <input type='text' name='user' value='Username to send from' /> Pass: <input type='password' name='pass' value='User password' /><br>
- Title: <input type='text' name='title' value='Enter title name' /><br>
- Message: <textarea name='message'/>Enter message here.</textarea><br>
- Players: <textarea name='names'/>Enter player names here, one per line.</textarea><br>
- <input type='submit' name='submit' value='send'/>
- </form>
- </body>
- </html>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment