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

Title: Standard BeBot News Module + My MOTD module = NewNews!
Post 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

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)
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on October 19, 2006, 07:36:38 pm
Updated to 0.9.1:

Changes
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: eracet1 on October 30, 2006, 01:35:57 am
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.
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on October 30, 2006, 04:53:38 am
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.
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: eracet1 on October 30, 2006, 05:48:30 am
looks like I forgot to actually install the php files. Thanks for the help
got it going now
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Landcast on November 02, 2006, 01:34:26 am
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.
Code: [Select]
$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
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on November 02, 2006, 04:37:41 am
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. :)
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: neongen on November 23, 2006, 04:34:33 pm
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
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Naturalistic on November 23, 2006, 08:26:10 pm
Glara does a lot of things but he forgets later what he modded :P
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: neongen on November 23, 2006, 09:09:05 pm
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?
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: jjones666 on November 23, 2006, 09:39:13 pm
what are you trying to do? give beastday stuff on logon?

-jj-
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: neongen on November 23, 2006, 10:08:15 pm
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
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: jjones666 on November 23, 2006, 11:26:23 pm
so u do !news and it shows beastday?
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: neongen on November 23, 2006, 11:38:24 pm
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...
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on November 24, 2006, 05:03:12 am
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.
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: neongen on November 24, 2006, 06:27:54 am
oki i'll play a little with it... can only get worse :P
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: nebhyper on December 06, 2006, 06:20:57 pm
Like MOTD, does this display MOTD/News on login?
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: neongen on December 06, 2006, 06:35:06 pm
i should do if you set it up the rigth way  ;)
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Bart on December 06, 2006, 07:39:15 pm
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
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on December 06, 2006, 08:01:43 pm
"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.
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Bart on December 06, 2006, 11:14:41 pm
see told ya I was dumb, I can't even read.. modules settings not MOTD module... rofl, what an idiot I am ...... thx Glarawyn...
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on December 29, 2006, 05:39:01 pm
Updated to 0.9.5.

Changes:
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: pusikas on December 30, 2006, 06:02:27 pm
I love it!
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: vertek on April 19, 2007, 04:01:48 am
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~
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Malosar on April 19, 2007, 08:01:44 pm
Check your console when doing the command, most likely theres a sql insert problem.
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: vertek on April 20, 2007, 12:25:27 am
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~
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Malosar on April 20, 2007, 05:25:35 pm
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?
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Ornaola on April 24, 2007, 05:34:57 pm
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   :(
Title: Re: Standard BeBot News Module + My MOTD module = NewNews!
Post by: Glarawyn on April 24, 2007, 05:47:17 pm
Find L316:
Code: [Select]
$expire_sec = $this -> make_seconds($expirenum, $expireunits);

Replace L317:
Code: [Select]
$expire = $now + $expire_sec;

With:
Code: [Select]
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...
SimplePortal 2.3.7 © 2008-2024, SimplePortal