BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.4 support => Topic started by: Aesgaard on September 02, 2007, 09:31:36 pm

Title: Always post news 0.4.1
Post by: Aesgaard on September 02, 2007, 09:31:36 pm
Is there a way to always show news to members when they log on ?

Oh, and I have a problem setting Headline, is there a command to make this ?
!headline gives /tell botname !help
Title: Re: Always post news 0.4.1
Post by: Alreadythere on September 03, 2007, 11:58:48 am
headline has LEADER access per default, perhaps that's causing your problems.

About spamming on logon, check !settings news, logonspam should be what you want.
Title: Re: Always post news 0.4.1
Post by: Aesgaard on September 03, 2007, 02:43:04 pm
To [botname]: !settings news
[botname]: /tell botname !help

Owner access, tried with SA's too but I dont seem to get this to work lol
Title: Re: Always post news 0.4.1
Post by: kuznechik on September 03, 2007, 06:12:36 pm
Code: [Select]
--- News.php.orig       Tue Jul 31 16:36:26 2007
+++ News.php    Fri Aug 17 20:37:48 2007
@@ -105,6 +105,7 @@
                $this -> bot -> settings -> create ("News", "Raid_Add", "LEADER", "Who should be able to add raids", "ADMIN;LEADER;MEMBER;GUEST;ANONYMOUS");
                $this -> bot -> settings -> create ("News", "Raid_Del", "LEADER", "Who should be able to delete raids", "ADMIN;LEADER;MEMBER;GUEST;ANONYMOUS");
                $this -> bot -> settings -> create("News", "LogonSpam", FALSE, "Should the news be spammed to all buddies on their logon?");
+               $this -> bot -> settings -> create("News", "PrintLastHeadline", FALSE, "Should the last headline be shown out of blob?");

                $this -> help['description'] = 'Sets and shows headlines, news and raid events.';
                $this -> help['command']['news']="Shows current headlines and news";
@@ -216,6 +217,12 @@
                {
                        $newsdate = gmdate($this -> bot -> settings -> get("Time", "FormatString"), $val[1]);
                }
+               $result = $this -> bot -> db -> select("SELECT id, time, news  FROM #___news WHERE type = '2' ORDER BY id DESC LIMIT 0, 1");
+               if (!empty($result))
+               foreach ($result as $val)
+               {
+                       $lasthead = "<font color=CCInfoHeadline>" . $val[2] . "</font>";
+               }

                $result_headline = $this -> bot -> db -> select("SELECT id, time, name, news FROM #___news WHERE type = '2' ORDER BY time DESC LIMIT 0, 3");
                if (!empty($result_headline))
@@ -246,7 +253,11 @@
                        }
                        $inside .= "\n\n";
                }
+               if ($this -> bot -> settings -> get("News", "PrintLastHeadline")) {
+                    return $lasthead . ":: " . $this -> bot -> make_blob("click to view other news", $inside); }
+               else {
                return "News last updated " . $newsdate . ":: " . $this -> bot -> make_blob("click to view", $inside);
+               }
        }

        /*
This is how I did that last headline is showed when some1 logs/do -news.
Title: Re: Always post news 0.4.1
Post by: Aesgaard on September 04, 2007, 02:51:51 pm
I should modify logon spam to "true" ? :P
Title: Re: Always post news 0.4.1
Post by: kuznechik on September 05, 2007, 11:39:10 am
If you turn logon spam to "true" - it'll be giving link with news to players upon logon. But not the headlines/news itself.
SimplePortal 2.3.7 © 2008-2024, SimplePortal