collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Guildbot/Raidbot Message of the Day  (Read 13269 times)

0 Members and 4 Guests are viewing this topic.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Guildbot/Raidbot Message of the Day
« on: March 07, 2006, 06:27:47 am »
Found myself in need of a Message of the Day.  ;D

Glara-MOTD-1.0.2.zip

Features:

  • Raidleaders and Admins can add items to the MOTD
  • Admins can delete messages
  • MOTD items expire and will be automatically removed
  • MOTD item expire time can be set by the user.
  • MOTD items can be set to never expire.
  • Automatically behaves properly for guildbots and raidbots.
  • If your bot is a guildbot, MOTD is sent when a buddy logs on.
  • If your bot is not a guildbot, MOTD is sent when a player joins the channel.
  • Only most resent MOTD item is displayed in chat.
  • Other MOTD items are displayed as a click link/text window
  • MOTD link displays the time of the most recent MOTD update
  • I included a helpfile!



Usage:

motd
Display MOTD

motd add <message>
Adds message to MOTD with default expire time (7 days)

motd add <num>(h|d|w|m) <message>
Adds <message> to MOTD. Message will expire in <num>(Hours|Days|Weeks|Months)
For the sake of simplicity 1 month = 30 days. Cope.

motd add never <message>
Adds <message> to MOTD. Message will never expire.
(Actually, the message will expire on Sun, 07 Feb 2106 06:28:15 GMT. If this code is stil in use on this date, I'll fix it at the age of 125, and I'll be damn happy to do so.)

motd edit
Displays the MOTD with click links to delete MOTD messages.
« Last Edit: January 03, 2007, 06:24:34 am by Glarawyn »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #1 on: March 07, 2006, 10:26:09 am »
Sounds nice, got to test it!

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #2 on: March 09, 2006, 06:40:55 am »
Decided I didn't like the output, so I changed it. New version bump. :)

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #3 on: March 09, 2006, 07:34:21 am »
Found a little bug that made the bot spam the motd to all online org members when it started. Fixed.

Also changed the way the full MOTD in the text window is sorted.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #4 on: March 09, 2006, 10:30:59 am »
Two comments:

You should add an is_member check in the buddy function, or the MOTD gets spammed to all people showing up on the buddy list, even if they are there only for an !is check (haven't gotten around to test it, but pretty sure that's the way it works).

And instead of selecting all MOTD entries in the cleanup function, you could just add a
Code: [Select]
" WHERE expiretime <= " . time() to the select, would save the if running over all entries.

Offline Ainen

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #5 on: March 31, 2006, 04:13:13 pm »
You should add an is_member check in the buddy function, or the MOTD gets spammed to all people showing up on the buddy list, even if they are there only for an !is check (haven't gotten around to test it, but pretty sure that's the way it works).

I can confirm this happens. Got a complaint from someone about my bot spamming them with tells and checking the logs found the !is and !whois commands and the tell => out for the MOTD. Not sure if it's a MOTD problem or the temp add to buddylist that should be blamed.
BeBot 0.3.4 svn 91 // PHP 4.3.9 // MySQL 4.1.12

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #6 on: April 03, 2006, 05:01:08 pm »
I can confirm this happens. Got a complaint from someone about my bot spamming them with tells and checking the logs found the !is and !whois commands and the tell => out for the MOTD. Not sure if it's a MOTD problem or the temp add to buddylist that should be blamed.

As Alreadythere said, I need to add a member check in the buddy sign on/off function so the MOTD doesn't get sent to non members who get added to the buddy list. I just haven't had time. :)

Offline Ainen

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #7 on: April 04, 2006, 10:29:46 pm »
I guess what I was trying to say was "Should the issue be handled in the MOTD module, or should it really be looked at as an issue with commands like is and whois actually adding and removing people to the bot's buddy list when they are processing?".
BeBot 0.3.4 svn 91 // PHP 4.3.9 // MySQL 4.1.12

Offline Tsuyoi

  • BeBot User
  • **
  • Posts: 30
  • Karma: +0/-0
  • BigT
    • Adrenaline Rush Forums
Re: Guildbot/Raidbot Message of the Day
« Reply #8 on: April 07, 2006, 08:15:42 pm »
I don't know if it's standard practice for everyone else, but I wrapped "if (!empty($result))" around the cleanup's foreach loop to prevent spamming of MYSQL errors if the table is empty.  Not a huge problem, just a OCD type thing really :)

- Tsuyoi

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #9 on: April 08, 2006, 04:58:09 pm »
Generally, you're always suppose to check if the data coming from the database is empty :p
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline Zacix

  • Contributor
  • *******
  • Posts: 73
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #10 on: April 10, 2006, 10:45:09 am »
Generally, you're always suppose to check if the data coming from the database is empty :p
Generally any variable that receives it's value from another function should be checked if it has the correct value, not just database values ;)
Zacix
Current projects:
RINGBot, BeBot branch
Neutnet, RK2 Neutral massmessage network

Offline Tsuyoi

  • BeBot User
  • **
  • Posts: 30
  • Karma: +0/-0
  • BigT
    • Adrenaline Rush Forums
Re: Guildbot/Raidbot Message of the Day
« Reply #11 on: April 10, 2006, 06:24:21 pm »
Eh, I was just noting that apparently it's not common practice around here, as I've had to correct this several times...

Offline Jarras

  • BeBot Rookie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #12 on: April 20, 2006, 03:48:49 pm »
Added the is_member check.

Offline Pharexys

  • BeBot Apprentice
  • ***
  • Posts: 117
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #13 on: April 24, 2006, 12:28:22 pm »
Added the is_member check.

nice thanks :P

Offline neongen

  • BeBot User
  • **
  • Posts: 64
  • Karma: +0/-0
Re: Guildbot/Raidbot Message of the Day
« Reply #14 on: May 15, 2006, 02:08:38 pm »
i'm new to host bebot. but think it's going oki  ;D

but i get this all the time ???

Warning: Invalid argument supplied for foreach() in C:\BeBot\modules\MOTD.php on line 493

and that line looks like this

foreach ($result as $motd)

what do i do to stop that Warning ???

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 332
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal