Online Bot

Started on the old forum in December 2011 · view the original in the archive · old links redirect here

#bot

17 replies · 1,496 views · started 14 years ago · 1 min read

8 participants
rockman Junior · 20 posts #1

help me how to make an online bot at lavalair to maintain have online on my site thanks 🙂

something else Fellow · 2,296 posts #2
$botid = 18;// change this to your bot user id
$ran = rand(1,4);
if($ran==1){
$rplace = "Online List";
}else if($ran==2){
$rplace = "Home";
}else if($ran==3){
$rplace = "Forums";
}else if($ran==4){
$sql = "SELECT userid FROM ibwf_online ORDER BY RAND()  LIMIT 1";
$items = mysql_query($sql);
while ($item = mysql_fetch_array($items))
{
$whonick = getnick_uid($item[0]);
}
$rplace = "Viewing $whonick`s Profile";
}

$rob = mysql_query("INSERT INTO ibwf_online SET userid='".$botid."', actvtime='".$tm."', place='".$rplace."'");
if(!$rob){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace."' WHERE userid='".$botid."'");
}
rockman Junior · 20 posts #3

something else wrote:

$botid = 18;// change this to your bot user id
$ran = rand(1,4);
if($ran==1){
$rplace = "Online List";
}else if($ran==2){
$rplace = "Home";
}else if($ran==3){
$rplace = "Forums";
}else if($ran==4){
$sql = "SELECT userid FROM ibwf_online ORDER BY RAND()  LIMIT 1";
$items = mysql_query($sql);
while ($item = mysql_fetch_array($items))
{
$whonick = getnick_uid($item[0]);
}
$rplace = "Viewing $whonick`s Profile";
}

$rob = mysql_query("INSERT INTO ibwf_online SET userid='".$botid."', actvtime='".$tm."', place='".$rplace."'");
if(!$rob){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace."' WHERE userid='".$botid."'");
}

thanks where can i insert that?

stratosphere Junior · 42 posts #5

thank you but its not working 🙁 please help

sharil Junior · 44 posts #7

this just for 1 bot id right? how about if i want to put 5 bot id?

-PeaCe-

subzero Super moderator Fellow · 3,954 posts #8

I will make this work for my script lol Other words Rebuilt the idea and place 20 Bots lmao

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

ozziemale31 Lead · 861 posts #9

re

in my old script mobilzonez i implemented this on the index page

	$brws = explode(" ",$HTTP_USER_AGENT);
$ubr = $brws[0];
$uip = getip();
$uid = "2";//guest
$HTTP_USER_AGENT = mysql_escape_string($HTTP_USER_AGENT);
$HTTP_USER_AGENT = getenv("HTTP_USER_AGENT");
$agent = $_SERVER['HTTP_USER_AGENT'];
$ip= $_SERVER["REMOTE_ADDR"];
$jul = "1308828763";
$uip = getip();
$index = $index[0];

$rampagetime = time() + (addhours());
addvisitor();
 $res=mysql_query("INSERT INTO ibwf_online SET activetime='".$jul."',  userid='".$uid."', brows='".$agent."', ip='".$ip."'");
addonline($uid,"Guest On Index Page","index.php","$agent","$ip");

or a better version of the code is this

<?php
$indiatime = time() + (10.5 * 60 * 60);
$agent=$_SERVER["HTTP_USER_AGENT"];
$tm=time();
if (strpos($agent, 'Firefox') || strpos($agent, 'MSIE') || strpos($agent, 'Safari') || strpos($agent, 'Googlebot')){
 	$flag = 1;
}
if(strpos($agent, 'Mobi') || strpos($agent, 'mobi') || substr_count($agent, 'Nokia') || substr_count($agent, 'Sony')){
	$flag=0;
}
if($flag==1){ 
header("Content-type: text/html");
} 
else {
header("Content-type: application/vnd.wap.xhtml+xml");
} 

header("Cache-Control: no-store, no-cache, must-revalidate");
$blah=mysql_connect("localhost","ibwf_forum","user");
//$blah=mysql_connect("localhost","root","");
if($blah){
$blah1=mysql_select_db("ibwf_forum");
}
if(!$blah1){
	echo "Couldn't connect to database.";
	exit();
}

//////////////////////////////
echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML Mobile 1.0//EN\"". " \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";

$HTTP_USER_AGENT=$_SERVER["HTTP_USER_AGENT"];
$REMOTE_ADDR=$_SERVER["REMOTE_ADDR"];
$flag=0;
if(substr_count($agent, "Googlebot")){
$idn=27;
}
else if(substr_count($agent, "Yahoo")){
	$idn=29;// user id in dbase
}
else if(substr_count($agent, "msnbot")){
	$idn=83;
}
else{
	$flag=1;
}
if($flag==0){
	getbrip($idn);
addonline($idn,"Crawling forums list","");
}

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

sharil Junior · 44 posts #10

I think c0de sh0wn by s0mething else is m0re easy to understand. . Perhaps s0me0ne can update to 5 bot id? Or Can we just add an0ther bot id? $botid=18; $botid=19;

-PeaCe-

ozziemale31 Lead · 861 posts #11

re

sharil wrote: I think c0de sh0wn by s0mething else is m0re easy to understand. . Perhaps s0me0ne can update to 5 bot id? Or Can we just add an0ther bot id? $botid=18; $botid=19;

//the actual code for the bots are here make user ids ie googlebot ,yahoobot etc idn=27 is the position of the userid on the dbase easy peasy 
$HTTP_USER_AGENT=$_SERVER["HTTP_USER_AGENT"];
$REMOTE_ADDR=$_SERVER["REMOTE_ADDR"];
$flag=0;
if(substr_count($agent, "Googlebot")){
$idn=27;
}
else if(substr_count($agent, "Yahoo")){
    $idn=29;// user id in dbase
}
else if(substr_count($agent, "msnbot")){
    $idn=83;
}
else{
    $flag=1;
}
if($flag==0){
    getbrip($idn);
addonline($idn,"Crawling forums list","");
}

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

fullcircle Junior · 13 posts #12

im only a noob and it can probrobly can be done with lot less coding 🙂 but u mean sumat like this?

$botid = 18;// change this to your bot user id 
$botid2 = 19;
$botid3 = 20;
$ran = rand(1,4); 
if($ran==1)
{ 
$rplace = "Online List"; 
$rplace2 = "Forums";
$rplace3 = "Home";
}
else if($ran==2)
{ 
$rplace = "Home"; 
$rplace2 = "Online List";
$rplace3 = "Forums";
}
else if($ran==3)
{ 
$rplace = "Home";
$rplace2 = "Forums";
$rplace3 = "Online List";
}
else if($ran==4)
{ 
$sql = "SELECT id FROM ibwf_users ORDER BY RAND()  LIMIT 1"; 
$items = mysql_query($sql); 
while ($item = mysql_fetch_array($items)) 
{ 
$whonick = getnick_uid($item[0]); 
} 
$rplace = "Viewing $whonick`s Profile"; 
$rplace2 = "Viewing $whonick`s Profile";
$rplace3 = "Viewing $whonick`s Profile";
} 
$rob = mysql_query("INSERT INTO ibwf_online SET userid='".$botid."', actvtime='".$tm."', place='".$rplace."'");
if(!$rob){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace."' WHERE userid='".$botid."'");
}
$rob2 = mysql_query("INSERT INTO ibwf_online SET userid='".$botid2."', actvtime='".$tm."', place='".$rplace2."'");
if(!$rob2){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace2."' WHERE userid='".$botid2."'");
}
$rob3 = mysql_query("INSERT INTO ibwf_online SET userid='".$botid3."', actvtime='".$tm."', place='".$rplace3."'");
if(!$rob3){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace3."' WHERE userid='".$botid3."'");
}
sharil Junior · 44 posts #13

fullcircle wrote: im only a noob and it can probrobly can be done with lot less coding 🙂 but u mean sumat like this?

$botid = 18;// change this to your bot user id 
$botid2 = 19;
$botid3 = 20;
$ran = rand(1,4); 
if($ran==1)
{ 
$rplace = "Online List"; 
$rplace2 = "Forums";
$rplace3 = "Home";
}
else if($ran==2)
{ 
$rplace = "Home"; 
$rplace2 = "Online List";
$rplace3 = "Forums";
}
else if($ran==3)
{ 
$rplace = "Home";
$rplace2 = "Forums";
$rplace3 = "Online List";
}
else if($ran==4)
{ 
$sql = "SELECT id FROM ibwf_users ORDER BY RAND()  LIMIT 1"; 
$items = mysql_query($sql); 
while ($item = mysql_fetch_array($items)) 
{ 
$whonick = getnick_uid($item[0]); 
} 
$rplace = "Viewing $whonick`s Profile"; 
$rplace2 = "Viewing $whonick`s Profile";
$rplace3 = "Viewing $whonick`s Profile";
} 
$rob = mysql_query("INSERT INTO ibwf_online SET userid='".$botid."', actvtime='".$tm."', place='".$rplace."'");
if(!$rob){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace."' WHERE userid='".$botid."'");
}
$rob2 = mysql_query("INSERT INTO ibwf_online SET userid='".$botid2."', actvtime='".$tm."', place='".$rplace2."'");
if(!$rob2){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace2."' WHERE userid='".$botid2."'");
}
$rob3 = mysql_query("INSERT INTO ibwf_online SET userid='".$botid3."', actvtime='".$tm."', place='".$rplace3."'");
if(!$rob3){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace3."' WHERE userid='".$botid3."'");
}

No Fullcircle, i dont think it will works for if used code above. should be add some more on the code. rand () is for place. rand() actually referred to places not botid and cannot add 2 places in 1 one code.Please corect if im wrong.

-PeaCe-

something else Fellow · 2,296 posts #14
$bots = array(1, 2, 3, 4, 5);// change this to your bot user id
foreach ($bots as $botid) {
$ran = rand(1,4);
if($ran==1){
$rplace = "Online List";
}else if($ran==2){
$rplace = "Home";
}else if($ran==3){
$rplace = "Forums";
}else if($ran==4){
$sql = "SELECT userid FROM ibwf_online ORDER BY RAND()  LIMIT 1";
$items = mysql_query($sql);
while ($item = mysql_fetch_array($items))
{
$whonick = getnick_uid($item[0]);
}
$rplace = "Viewing $whonick`s Profile";
}

$rob = mysql_query("INSERT INTO ibwf_online SET userid='".$botid."', actvtime='".$tm."', place='".$rplace."'");
if(!$rob){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace."' WHERE userid='".$botid."'");
} 
}
///random text here to get rid of opera bug and this forum :/
sharil Junior · 44 posts #15

Thanks s0methng else 4 da c0de. .

-PeaCe-

sharil Junior · 44 posts #16

something else wrote:

$bots = array(1, 2, 3, 4, 5);// change this to your bot user id
foreach ($bots as $botid) {
$ran = rand(1,4);
if($ran==1){
$rplace = "Online List";
}else if($ran==2){
$rplace = "Home";
}else if($ran==3){
$rplace = "Forums";
}else if($ran==4){
$sql = "SELECT userid FROM ibwf_online ORDER BY RAND()  LIMIT 1";
$items = mysql_query($sql);
while ($item = mysql_fetch_array($items))
{
$whonick = getnick_uid($item[0]);
}
$rplace = "Viewing $whonick`s Profile";
}

$rob = mysql_query("INSERT INTO ibwf_online SET userid='".$botid."', actvtime='".$tm."', place='".$rplace."'");
if(!$rob){
mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$rplace."' WHERE userid='".$botid."'");
} 
}
///random text here to get rid of opera bug and this forum :/

Aleady implement this code.. work well for me, but this bot id only shown in all online list. How to differentiate between male & female so that it will also count in male online & female online.

-PeaCe-

sharil Junior · 44 posts #17

Any0ne can advice?

-PeaCe-

nclemale36 Lead · 537 posts #18

add this to your addonline function in core .make as many bots as you want.

mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='1'");
mysql_query("INSERT INTO ibwf_online SET userid='1', place='".$place."', actvtime='".$tm."'");  

mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='2'");
mysql_query("INSERT INTO ibwf_online SET userid='2', place='".$place."', actvtime='".$tm."'");

mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='3'");
mysql_query("INSERT INTO ibwf_online SET userid='3', place='".$place."', actvtime='".$tm."'");

mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='4'");
mysql_query("INSERT INTO ibwf_online SET userid='4', place='".$place."', actvtime='".$tm."'"); 

change the WHERE id='" "); and userid=' ' , to any users id number.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close