BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.4.x Custom/Unofficial Modules => Topic started by: Temar on August 03, 2007, 12:54:10 am

Title: AutoMsg.php
Post by: Temar on August 03, 2007, 12:54:10 am
AutoMsg

This is Like a cross between !announce and !news

Wiki (http://bebot.link/wiki/temar) - Documentation/Help

Change Log


Currently Doing

Things to do

If you have Any ideas of What you would like this Module to do Please Post
Title: Re: AutoMsg.php
Post by: Temar on August 06, 2007, 04:03:21 am
Made some Improvments (see top)
Title: Re: AutoMsg.php
Post by: Temar on August 07, 2007, 01:40:23 am
Added Ability to edit Messages, This will Change the Message for people who havn't yet seen original to see, People who have seen the original will not get the edited 1
Title: Re: AutoMsg.php
Post by: Temar on August 08, 2007, 03:15:23 pm
Made some Changes but Not fully Tested due to AO Server Move
Title: Re: AutoMsg.php
Post by: Temar on August 10, 2007, 05:35:13 am
Added use of blob for messages

!automsg addb message

this will add the message and send as normal but the message will be in a blob(which is the window you look at items in)
Title: Re: AutoMsg.php
Post by: Nytridr on September 02, 2007, 12:32:41 am
maybe be able to send it to just ranks also..

!automsg SC msg..   This would send to SC, Gens, and Prez's
!automsg gens msg..   Gens and prez
!automsg rank msg..   Look up/\
!automsg all msg..   this would send to all reguardless of the rank.

also I am getting this error
Code: [Select]
Fatal error: Cannot use string offset as an array in C:\aobots\Bebot\custom\modu
les\automsg.php on line 96
Title: Re: AutoMsg.php
Post by: Temar on September 02, 2007, 03:58:20 am
line 95 and 96
Code: [Select]
$highestmsg = $this -> bot -> db -> select("SELECT ID FROM #___automsgs ORDER BY ID DESC LIMIT 1", MYSQL_ASSOC);
$this -> highestmsg = $highestmsg[0][ID];
This is basicly getting list ording by ID desc
then getting the ID of the 1st entry so basicly geting highest
im not sure why you got that error
Title: Re: AutoMsg.php
Post by: Temar on September 02, 2007, 04:08:40 am
ah i think it maybe due to an empty table

try this
Code: [Select]
$highestmsg = $this -> bot -> db -> select("SELECT ID FROM #___automsgs ORDER BY ID DESC LIMIT 1", MYSQL_ASSOC);
if (!empty($highestmsg))
$this -> highestmsg = $highestmsg[0][ID];
else
$this -> highestmsg = 0;
Title: Re: AutoMsg.php
Post by: Nytridr on September 02, 2007, 07:28:37 am
That works, new problem..

Code: [Select]
rsbot [2007-09-02 05:45:35]     [TELL]  [INC]   Nytridra: !automsg add this is o
nly a test
MySQL error (# 0) on query: INSERT INTO rsbot_automsgs (type, added_by, added_at
, msg) VALUES ('text', 'Nytridra', 1188711935, 'this is only a test')
Unknown column 'type' in 'field list'
rsbot [2007-09-02 05:45:35]     [TELL]  [OUT]   -> Nytridra: Message Added as ID
 0 and Sent to Those Online.

and ofc this one..

Code: [Select]
rsbot [2007-09-02 06:00:42]     [TELL]  [INC]   Nytridra: !automsg addb Test
MySQL error (# 0) on query: INSERT INTO rsbot_automsgs (type, added_by, added_at
, msg) VALUES ('blob', 'Nytridra', 1188712842, 'Test')
Unknown column 'type' in 'field list'
rsbot [2007-09-02 06:00:42]     [TELL]  [OUT]   -> Nytridra: Message Added as ID
 0 and Sent to Those Online.
Title: Re: AutoMsg.php
Post by: Temar on September 02, 2007, 07:53:47 am
yer im alerady aware of that prob
bug with make table field "type" isnt there
but is in the update table part im not sure why it doesnt work

Change it to this near top of file

Code: [Select]
$db -> query("CREATE TABLE IF NOT EXISTS ".$db -> define_tablename("automsgs", "true")." (
           ID INT NOT NULL auto_increment PRIMARY KEY,
   type VARCHAR(20) DEFAULT 'text' NOT NULL,
   added_by VARCHAR(30) default NULL,
   added_at INT NOT NULL default '0',
           msg TEXT
           )");

you can drop current table then let it make or add the field ur self
Title: Re: AutoMsg.php
Post by: Nytridr on September 02, 2007, 08:06:27 am
That fixed both problems.. look forward to the other updates..:)
Title: Re: AutoMsg.php
Post by: Aesgaard on September 02, 2007, 02:01:45 pm
Fatal error: Cannot use string offset as an array in C:\Bebot0.4\modules\AutoMsg
.php on line 96

Please post fix'ed file and not fixes ? :D
Title: Re: AutoMsg.php
Post by: Temar on September 02, 2007, 03:33:01 pm
yer i didnt post changed file as i was already working on new stuff for it
will be posting some updates over the next day or 2
Title: Re: AutoMsg.php
Post by: Aesgaard on September 02, 2007, 03:58:53 pm
Cool, it looks awesome but I have a tendency of messing stuff up even more when trying to fix it so I dont really dare trying hehe, cant wait to get it <3
Title: Re: AutoMsg.php
Post by: Nytridr on September 02, 2007, 06:44:41 pm
Cool, it looks awesome but I have a tendency of messing stuff up even more when trying to fix it so I dont really dare trying hehe, cant wait to get it <3

Look up.. he posted the fix when I had the same problem

NVM..:)
Title: Re: AutoMsg.php
Post by: Temar on September 20, 2007, 05:24:01 am
Updated

Added Expire
u can use these formats to set expire
DD:HH:MM
D and H are option and 2 digits are Not Require like 15:5 is 15hours 5mins
*D or *H or *M - easy way to get just days, hours or mins
and lastly
http://www.gnu.org/software/tar/manual/html_node/tar_109.html
which mean u can do alot like "tomorrow" or "2nd october" and lots more

Will update Screen Shot with some new pics in next few days
Title: Re: AutoMsg.php
Post by: Nytridr on November 08, 2007, 07:03:13 am
Code: [Select]
Fatal error: Cannot use string offset as an array in C:\aobots\Bebot\custom\modu
les\automsg.php on line 95

Line 95
Code: [Select]
$lastmsg = $result2[0]['lastmsg'];
and somewhere along the line seems we can do addb anymore. 

I just redownloaded it and put it back in.. not sure what happened
Title: Re: AutoMsg.php
Post by: Temar on November 08, 2007, 04:17:12 pm
addb is becoming obsolete as the interface makes it easy to choose
Title: Re: AutoMsg.php
Post by: Temar on November 23, 2007, 07:30:02 am
Bump for Update
Read 1st post for Details
Title: Re: AutoMsg.php
Post by: Allisande on January 14, 2009, 06:35:13 am
Does this mod work on an AoC bot?  Will it work for 6.1?
SimplePortal 2.3.7 © 2008-2024, SimplePortal