PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Thor on 06 September, 2006, 22:53:48

Title: Massmessager bot
Post by: Thor on 06 September, 2006, 22:53:48
As the topic says, this is a massmessager bot: sends massmessages from files in the given time, or when a command typed.
Usage and commands:
Add:
Quote!addmass <filename> <time> [-c <minimum_class>] [-C <maximum_class>] [-b <bot_nick>] [-p <prefix>] [-w <MP>] [-d <day>]
So, first is the filename, and then the time, when you want to send, in HH:MM format. All other parameter is just optional.
-c <minimum class> - The lowest class, who still get the message.
-C <maximum class> - The highest class, who still get the message.
-b <bot_nick> - The nick of the bot, who will send the message. If it's not the hubsecurity, the script will register a bot, while it sends the message, then delreg it. (The script will register the bot one minute before the mass)
-p <prefix> - If setted, just those users will get the message, whoes have this desired prefix. If you want to send message to prefixless users, set it to []
-w <PM> - To set up, where the message send: P - private ; M - main
-d <day> - To set up, on which days the message send (the english name of days)

In one time, there can be just one massmessage, if you add a new with an existing time, the ist will just update with the new settings. You can mix the settings, as you want, but if you don't set up them, they will have default values:
minimum class: 0
maximum class: 6
Bot nick: hubsecurity
Prefix: not setted (NONE)
Where: private
Day: every day

List:
Quote!listmass
It will send all the massmessages ordered by time in private by hubsecurity

Delete:
Quote!delmass <time>
You can delete massmessage from the list by this command, just add the time of it.

Add/modify a file:
Quote!addfile <filename> <content>
You can add or modify a file, which is in the massmessage folder. It can be good, if you hasn't got FTP acess to the hub, and it's faster too. If the action was successfully, the bot will send back the new contents of the file.

Show a file:
Quote!showfile <filename>
The bot will send back the contents of the given file, if the file is exist in the massmessages folder.

Delete a file:
Quote!delfile <filename>
It will finally delete the given file, if the file is exist in the massmessages folder.

List files:
Quote!listfiles
It will list all the files, which are in the massmessages folder.

Send message with settings:
Quote!send <time>
Use this command, if you want to send a massmessage with a command, and with the given settings. So just those users will get the message, whose have higher profile, than 'c' and lower than 'C', message send by 'b', and so on...

Send message to all users:
Quote!sendtoall <filename>
Use this command, if you want to send a massmessage to all users. The file must be in the massmessage folder.

Help:
Quote!masshelp
Show some help, if you forget something.

Script attached (made for LUA5.02 but i think it will work on LUA5.11 too)
Title: Re: Massmessager bot
Post by: 6Marilyn6Manson6 on 07 September, 2006, 13:31:36
Magic Script Hungarista  ;D
Title: Re: Massmessager bot
Post by: Thor on 07 September, 2006, 18:06:47
New version attached, because I forgot to rewrite all things in the listing part as is in the hungarian version, so it slipped... Now I think everything is O.K.. If you want to use it on LUA5.11 hub, please DON'T USE converter applications, because you will get error! This script works well in 5.02 and 5.11 as well as it must! If somebody has bugreport or feature-request, it's always welcomed :)