Jump to content
MakeWebGames

Need a bot


chicka

Recommended Posts

i've done a lot of research and can't seem to find what i'm looking for. Hopefully someone here has one or can create one for me. I need a bot to use on my own personal site i'm working on. what I need it to do is something like this:

http://mysite.com/user.php?id=12345

http://mysite.com/user.php?id=12344

http://mysite.com/user.php?id=12343 and so on. So instead of typing all that in the browser one at a time I just enter 12345 and it automatically goes down or up 1 number at a time..

Not sure if I explained that correctly lol.

any help would be appreciated.

Thanks

Link to comment
Share on other sites

Something like;

<a href="http://makewebgames.io/showthread.php/43913-Need-a-bot">This was built for Chicka</a> <br />
   <?php
if(array_key_exists('id', $_POST)) {
   $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ? abs( (int) $_POST['id']) : 0;
   $goup = filter_input(INPUT_POST, 'goup', FILTER_VALIDATE_INT) ? abs( (int) $_POST['goup']) : 10;
   $goup = $goup > 50 ? 50 : $goup;
   echo '<ul>';
   if($_POST['direction'] == 'up') {
       //Count upwards
       for($i=0;$i<=$goup;$i++) {
           $param = $id + $i;
           echo '<li>mysite.com/user.php?id='. $param .'</li>';
       }
   } else {
       //Count downwards
       for($i=0;$i<=$goup;$i--) {
           $param = $id + $i;
           echo '<li>mysite.com/user.php?id='. $param .'</li>';
           if($param < ($id - $goup)) {
               break;
           }
       }    
   }
   echo '</ul>';
}
?>

<form action="" method="post">
   Starting ID: <input type="text" name="id" /> <br />
   Increment/Decrement by: <input type="text" name="goup" /> (Default is 10. No higher than 50) <br />
   Direction: <select name="direction">
       <option value="up" selected>Up</option>
       <option value="down">Down</option>
   </select> <br />
   <input type="submit" value="Perform Execution" />
</form>

 

The math can be done much more efficiently, however.

Edited by sniko
Link to comment
Share on other sites

Something like;
<a href="http://makewebgames.io/showthread.php/43913-Need-a-bot">This was built for Chicka</a> <br />
   <?php
if(array_key_exists('id', $_POST)) {
   $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ? abs( (int) $_POST['id']) : 0;
   $goup = filter_input(INPUT_POST, 'goup', FILTER_VALIDATE_INT) ? abs( (int) $_POST['goup']) : 10;
   $goup = $goup > 50 ? 50 : $goup;
   echo '<ul>';
   if($_POST['direction'] == 'up') {
       //Count upwards
       for($i=0;$i<=$goup;$i++) {
           $param = $id + $i;
           echo '<li>mysite.com/user.php?id='. $param .'</li>';
       }
   } else {
       //Count downwards
       for($i=0;$i<=$goup;$i--) {
           $param = $id + $i;
           echo '<li>mysite.com/user.php?id='. $param .'</li>';
           if($param < ($id - $goup)) {
               break;
           }
       }    
   }
   echo '</ul>';
}
?>

<form action="" method="post">
   Starting ID: <input type="text" name="id" /> <br />
   Increment/Decrement by: <input type="text" name="goup" /> (Default is 10. No higher than 50) <br />
   Direction: <select name="direction">
       <option value="up" selected>Up</option>
       <option value="down">Down</option>
   </select> <br />
   <input type="submit" value="Perform Execution" />
</form>

 

The math can be done much more efficiently, however.

if(array_key_exists('id', $_POST)) i think if(isset($_POST['id'])) is better bcz is much faster

Link to comment
Share on other sites

After the PM with chicka, I've come up with the following;

 

<a href="http://makewebgames.io/showthread.php/43913-Need-a-bot">This was built for Chicka</a> <br />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<?php
if (array_key_exists('id', $_POST)) {
   $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ? abs((int) $_POST['id']) : 0;
   $goup = filter_input(INPUT_POST, 'goup', FILTER_VALIDATE_INT) ? abs((int) $_POST['goup']) : 10;
   $goup = $goup > 15 ? 15 : $goup;
   ?>
   <script>
       var dataArray = [];
       function storeIt(data) {
           dataArray.push(data);
           console.log('Data is stored in the array');
           console.log(dataArray.length);
       }
       dataArray.sort();
       setTimeout(function() {
           if (dataArray.length >= <?php echo $goup - 1; ?>) {
                   $.each(dataArray, function(idx, val) {
                       $("#profile").delay(1000).queue(function(next) {
                           $(this).empty().html(val);
                           next();
                       });
                   });
           }
       }, 1000);
   </script>
   <?php
   if ($_POST['direction'] == 'up') {
       //Count upwards
       for ($i = 0; $i <= $goup; $i++) {
           $param = $id + $i;
           ?>
           <script>
               $.get('profile.php?id=' + <?php echo $param; ?>, storeIt);
           </script>
           <?php
       }
   } else {
       //Count downwards
       for ($i = 0; $i <= $goup; $i--) {
           $param = $id + $i;
           ?>
           <script>
               $.get('profile.php?id=' + <?php echo $param; ?>, storeIt);
           </script>
           <?php
           if ($param < ($id - $goup)) {
               break;
           }
       }
   }
}
?>


<div id="profile"></div>
<form action="" method="post">
   Starting ID: <input type="text" name="id" /> <br />
   Increment/Decrement by: <input type="text" name="goup" /> (Default is 10. No higher than 15) <br />
   Direction: <select name="direction">
       <option value="up" selected>Up</option>
       <option value="down">Down</option>
   </select> <br />
   <input type="submit" value="Perform Execution" />
</form>
Link to comment
Share on other sites

@rockwood

if(array_key_exists('id', $_POST)) i think if(isset($_POST['id'])) is better bcz is much faster
Proof?

In any case, array_key_exists() is considered the correct solution since isset() fails on certain values:

[[email protected] ~]$ cat test.php
<?php

$array = array(
   'a' => false,
   'b' => 0,
   'c' => null
);

echo "isset() ...\n";

echo '  ' . (isset($array['a']) ? 'true ' : 'false') . "\n";
echo '  ' . (isset($array['b']) ? 'true ' : 'false') . "\n";
echo '  ' . (isset($array['c']) ? 'true ' : 'false') . "\n";
echo '  ' . (isset($array['d']) ? 'true ' : 'false') . "\n";

echo "\nvs array_key_exists() ...\n";

echo '  ' . (array_key_exists('a', $array) ? 'true ' : 'false') . "\n";
echo '  ' . (array_key_exists('b', $array) ? 'true ' : 'false') . "\n";
echo '  ' . (array_key_exists('c', $array) ? 'true ' : 'false') . "\n";
echo '  ' . (array_key_exists('d', $array) ? 'true ' : 'false') . "\n";

which when run produces:

[[email protected] ~]$ php -f test.php
isset() ...
 true
 true
 false   <-- isset() fails to spot null values
 false

vs array_key_exists() ...
 true
 true
 true
 false
Link to comment
Share on other sites

@rockwoodProof?

In any case, array_key_exists() is considered the correct solution since isset() fails on certain values:

[[email protected] ~]$ cat test.php
<?php

$array = array(
   'a' => false,
   'b' => 0,
   'c' => null
);

echo "isset() ...\n";

echo '  ' . (isset($array['a']) ? 'true ' : 'false') . "\n";
echo '  ' . (isset($array['b']) ? 'true ' : 'false') . "\n";
echo '  ' . (isset($array['c']) ? 'true ' : 'false') . "\n";
echo '  ' . (isset($array['d']) ? 'true ' : 'false') . "\n";

echo "\nvs array_key_exists() ...\n";

echo '  ' . (array_key_exists('a', $array) ? 'true ' : 'false') . "\n";
echo '  ' . (array_key_exists('b', $array) ? 'true ' : 'false') . "\n";
echo '  ' . (array_key_exists('c', $array) ? 'true ' : 'false') . "\n";
echo '  ' . (array_key_exists('d', $array) ? 'true ' : 'false') . "\n";

which when run produces:

[[email protected] ~]$ php -f test.php
isset() ...
 true
 true
 false   <-- isset() fails to spot null values
 false

vs array_key_exists() ...
 true
 true
 true
 false

which example you given that is also right .

my point :- isset() i was mean that this is only checking this that this is existing variable or not. array_key_exists() in this case first, if that would not be array then it would create the problem.

nothing else

Link to comment
Share on other sites

which example you given that is also right .

my point :- isset() i was mean that this is only checking this that this is existing variable or not. array_key_exists() in this case first, if that would not be array then it would create the problem.

And in English?
Link to comment
Share on other sites

Why do you want a bot anyway?

Hard to explain. The point was to be able to sit back and not have to click 1 profile at a time. For example I start with id 1 (which is me) then it automatically goes to id 2 then 3 and so on. Wasn't trying to do anything illegal. its on my own site i'm working on.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
i've done a lot of research and can't seem to find what i'm looking for. Hopefully someone here has one or can create one for me. I need a bot to use on my own personal site i'm working on. what I need it to do is something like this:

http://mysite.com/user.php?id=12345

http://mysite.com/user.php?id=12344

http://mysite.com/user.php?id=12343 and so on. So instead of typing all that in the browser one at a time I just enter 12345 and it automatically goes down or up 1 number at a time..

Not sure if I explained that correctly lol.

any help would be appreciated.

Thanks

Maybe a strange question, but why do you want to have this, if it's already your own site ?

http://mysite.com/users.php?startid=1&endid=12345

http://mysite.com/users.php?startid=12345&endid=1

 

Happy Hacking: Roger

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...