BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Glarawyn on September 26, 2006, 09:22:26 am
-
In an attempt to undo some of the wrongs of my MOTD (http://bebot.link/index.php/topic,336.0.html) module, I've put together a brand new module that I've dubbed NewNews!
NewNews combines the features of News.php with the feature of MOTD.php, and adds some new stuff.
Features
- Admins can delete messages
- News items can be set to expire and will be automatically removed
- News items expire time can be set by the user.
- News items can be set to never expire.
- Automatically behaves properly for guildbots and raidbots. (I hope!!!)
- If your bot is a guildbot, news is sent when a buddy logs on.
- If your bot is not a guildbot, news is sent when a player joins the channel.
- Only most resent news item is displayed in chat.
- Other news items are displayed as a click link/text window
- News link displays the time of the most recent News update
- Automatic news display can be enabled and disabled
- Automatic news display can be set to simple and full mode (simple = news.php style, full = motd.php style)
- News link prefix can be customized!
- Use !news or !motd
- If you're already using News.php, your news items will be automatiaclly imported into this module!
- I included a helpfile!
Yeah, that's alot. I haven't really cleaned up my code yet, and I think I've found most of the bugs, but there could still be some issues in this code. As such, I haven't dubbed this a 1.0 yet. Please hammer away and find bugs.
Improtant: This module depends on my New Module Settings (http://bebot.link/index.php/topic,607.0.html) Module. Install Module Settings before installing NewNews!!!
Also Important: Disable MOTD.php and News.php before using NewNews!
Last Improtant Note: I've only tested this on 0.2.8. No clue how it works in the 0.3 branch or earlier 0.2 versions.
I think that's all the gotchas...
Download: NewNews-0.9.5.zip (http://zibby.isa-geek.net/bebot/NewNews/NewNews-0.9.5.zip)
-
Updated to 0.9.1:
Changes
- Can now import MOTD items. /tell yourbot !motd import
- Added wordwrap() to clean up the motd output.
- Automatically adds campalot behavior without code edits (this is for my sanity and doesn't serve any purpose other than I don't have to maintain two different versions of the mdoule).
-
looks like a great module. but not sure where I made a mistake.
I get an error when trying to run bebot of
Fatal error: Call to a member function save <> on a non-object in C:\BeBot\modules\NewNews.php on line 51
I set up bebot settings as you posted to change.
not sure what I did wrong. any help will be greatly appreciated.
-
Looks like you missed a setup step in the settings module. You have to add a var $settings; to Bot.php for the settings module to work. Full instructions should be in the readme.
-
looks like I forgot to actually install the php files. Thanks for the help
got it going now
-
I was wondering about something.
was looking over the newnews.php and i see that at the bottom you have added some stuff for campalot. Any chance that can be used for other bots ? if so how would i go about doing it.. Tried to copy this code but as i guessed that didnt work. $output .= $this -> colorize($this -> colors['infoheadline'], "Account Information:\n");
Trying to learn this but it takes time and im not that good at beeing patient.. hehe
/LC
-
Any chance that can be used for other bots ? if so how would i go about doing it..
It is, but you would have to edit Bot.php and every other module that we've modified to get it to work. It's fairly obvious what you would need to do, but it's a lot of edits that I'm not going to track down, document, and produce a step by step guide for doing so. :)
-
Glara did you modify your apf and beast modules? because when i try to get it to show that info it comes with a error that it's calling to a member function
-
Glara does a lot of things but he forgets later what he modded :P
-
hehe oki :)
but when i set in $output .= $this -> bot -> BeastDay -> beast_day1();
(called it 1 so i still have the blob on gc and pmsg)
then it comes with a call for a member function in c:\blahblah\newnews.php
and i looked at my whois it use it for alts but there is no problems. anyone know what the problem is?
-
what are you trying to do? give beastday stuff on logon?
-jj-
-
i'm trying to get it 2 display like on campalot when you click on the news link. because the org i'm in now is talking so much about beast.
but i get
Fatal error: Call to a member function beast_day1() on a non-object in C:\sidecom\modules\NewNews.php
-
so u do !news and it shows beastday?
-
no the news get send out on logon. and it makes a blob for the news. where people can click to see the news it's in there i wan't it to show (like admin status in online) but no matter what i do i get the none-object error...
-
Glara did you modify your apf and beast modules?
Yes, that's why the Campalot function is only called on bot's running Campalot's code. You shouldn't modify your bot to use the campalot function, cause it's not going to work without other modifications. As I've stated before, the campalot function is there so I don't have to maintain multiple versions of the module. You have to add the code to make BeastDay, APF, etc. "core" modules.
-
oki i'll play a little with it... can only get worse :P
-
Like MOTD, does this display MOTD/News on login?
-
i should do if you set it up the rigth way ;)
-
k I know I am kinda stupid, BUT!! I have reread and re applied everything int he instuctions a few times now and still getting "Fatal error: Call to a member function save() on a non-object in modules\NewNews.php on line 51" what I am too dumb to get right?
Bart
-
"Fatal error: Call to a member function save() on a non-object in modules\NewNews.php on line 51" what I am too dumb to get right?
Read the first post. You need to install my Module Settings module first.
-
see told ya I was dumb, I can't even read.. modules settings not MOTD module... rofl, what an idiot I am ...... thx Glarawyn...
-
Updated to 0.9.5.
Changes:
- Updated to use New Module Settings (http://bebot.link/index.php/topic,607.0.html)
-
I love it!
-
Hello!
first off i wanna say im new to PHP, mysql, and ao bots.
But I know enough about programming to understand what i read.
I've got 0.2.11 up and running, even with a few adjustments.
One thing I can't figure out is !news never <message>.
It appears to work just fine, but when i check !news and even the sql table the item i just input did not show up.
I checked the code over a couple of times but i cant see anything wrong. ???
anyone help me out?
Vert~
-
Check your console when doing the command, most likely theres a sql insert problem.
-
MySQL error (# 0) on query: INSERT INTO news (id, name, expiretime, news) VALUES
(1177021079, 'Vertrig', 5471988374, 'This is a test')
Out of range value adjusted for column 'expiretime' at row 1
There we go, now to dig in and fix it :D
Vert~
-
From what I can tell, it sets a 'never' time as the max for int unsigned field, then it is adding the current timestamp onto that and trying to insert it, which isn't going to work as your already at the max the field is capable of. Hence you are getting the "Out of range.." error. I guess it should only be adding the $now if it's !never?
-
getting that error too , no idea how to fix ::)
also cant see, to get latests news as motd, it only shows last added news and motd :(
-
Find L316:
$expire_sec = $this -> make_seconds($expirenum, $expireunits);
Replace L317:
$expire = $now + $expire_sec;
With:
if ($expire_sec == 4294967295)
{
$expire = $expire_sec;
}
else
{
$expire = $now + $expire_sec;
}
That should fix it. Odd though it works perfectly for me. Must be another difference between the MyISAM and InnoDB storage engines...