BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Temar on July 17, 2007, 06:25:49 am

Title: stops
Post by: Temar on July 17, 2007, 06:25:49 am
i got a problem and i cant figure out why it stopping
Code: [Select]
<?php

function 
connect()
{
$result $this -> bot -> db -> select("SELECT * FROM #___automsgs"MYSQL_ASSOC);
$highestmsg $this -> bot -> db -> select("SELECT ID FROM #___automsgs ORDER BY ID DESC LIMIT 1"MYSQL_ASSOC);
if (!empty($result))
{
$online $this -> bot -> db -> select("SELECT * FROM #___online WHERE botname = '" $this -> bot -> botname "' AND status_gc = 1"MYSQL_ASSOC);
if (!empty($online))
{
foreach ($online as $member)
{
$result2 "";
$result2 $this -> bot -> db -> select("SELECT * FROM #___users WHERE nickname = '".$member[nickname]."'"MYSQL_ASSOC);
foreach ($result as $msg)
{
if ($msg[ID] > $result2[lastmsg])
{
$this -> bot -> send_tell($member[nickname], "Mass Message From ##highlight##".$msg[added_by]."##end##  ".$msg[msg].""1);
}
}
echo "meep ".$highestmsg[0][ID]."\n"doe
$this -> bot -> db -> query("UPDATE #___users SET lastmsg = '".$highestmsg[0][ID]."' WHERE nickname = '".$member[nickname]."'");
}
}
}
}

?>

now it sends out the mass message but thats it,                
echo "meep ".$highestmsg[0][ID]."\n";
doesnt happen or the update after it
any idea why?
Title: Re: stops
Post by: Temar on July 17, 2007, 06:36:23 am
And also is it possible to add a delay to that part above, because i want to make sure bot updates online list before it does it
Title: Re: stops
Post by: Alreadythere on July 17, 2007, 11:37:31 am
Lines like $member[nickname] should be $member['nickname'], the index is a string. Even if it works on some systems other throw out warnings or errors, depending on the php settings.
SimplePortal 2.3.7 © 2008-2024, SimplePortal