So, we've added a member account module and a way for them to control their account settings. We've added a mail module integration but have decided to keep it separate as a module, just in case you didn't want it.
Once installed you can type /mam to view the modules options or select it from the settings tab in the staff bot 5 main console.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;Staff Bot 5 Module;;;;;;;
;;;;;Member Account Module.m;;;;;
;;;;;;;;;;;;;CAC: mam;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:LOAD: {
writeini sboti.ini mam title Member Account Module
writeini sboti.ini mam description Member Account Module for Staff Bot 5.
writeini sboti.ini mam updateable yes
writeini sboti.ini mam version 1.0.0.0
If ($readini(sbot.ini,settings,install_on_load) == on) {
install mam
install_mam
halt
}
Else {
echo -a To install this module, simply type /install mam
}
}
on *:UNLOAD: {
mam uninstall
}
on *:JOIN:#: {
If ($readini(sbot.ini,assigned,#)) {
If ($readini(smem.ini,$nick,registered) == yes) {
If ($mam.mmode == on) {
If ($mam.premium == on) && ($mam.pmode == on) {
If ($readini(smem.ini,$nick,premium) == yes) {
mode # +h $nick
}
Else {
mode # +v $nick
}
}
Else {
mode # +v $nick
}
}
Else {
If ($mam.premium == on) && ($mam.pmode == on) {
If ($readini(smem.ini,$nick,premium) == yes) {
mode # +h $nick
}
}
}
}
}
}
alias install_mam {
If ($dialog(install) != install) { dialog -dmv install install }
If ($readini(mam.ini,status,installed) == yes) {
did -a install 11 Already Installed!
}
Else {
mam install
}
}
alias mam {
If (!$1) {
echo -a Please select from the following options:
echo -a To install the Member Account Module, type /install mam
echo -a To uninstall the Member Account Module, type /mam uninstall
echo -a To register or unregister and account, type /mam register <nick> [password] [email, password required for email] or /mam unregister <nick>
echo -a To set account settings (including promotions and demotions), type /mam set
echo -a To change member account module settings, type /mam settings
echo -a To view the Member Account Module console, type /mam console
}
If ($1 == console) {
dialog -md mam mam
}
If ($1 == install) {
If ($dialog(install) != install) { dialog -dmv install install }
did -b install 8,9
did -a install 11 Installing...
writeini sboti.ini mam title Member Account Module
writeini sboti.ini mam description Member Account Module for Staff Bot 5.
writeini sboti.ini mam updateable yes
writeini sboti.ini mam version 1.0.0.0
writeini mam.ini status installed yes
writeini mam.ini settings account_registration on
writeini mam.ini settings account_deletion on
writeini mam.ini settings require_password on
writeini mam.ini settings require_email on
writeini mam.ini settings premium_accounts on
writeini mam.ini settings member_mode_changes on
writeini mam.ini settings premium_mode_changes on
writeini sboti.ini status modules $calc($readini(sboti.ini,status,modules) + 1)
writeini sbot.ini status modules $calc($readini(sbot.ini,status,modules) + 1)
write modules.txt mam
did -a install 11 Complete!
did -v install 13
halt
}
If ($1 == uninstall) {
.remove mam.ini
remini sboti.ini mam
write -ds $+ mam modules.txt
writeini sboti.ini status modules $calc($readini(sboti.ini,status,modules) - 1)
writeini sbot.ini status modules $calc($readini(sbot.ini,status,modules) - 1)
}
If ($1 == register) {
If (!$2) { sequence error Please type /mam register <nick> [password] [email, password is required for email] | halt }
If ($readini(smem.ini,$2,registered) == yes) { sequence error This user is already registered! $2 | halt }
writeini smem.ini $2 registered yes
$iif($3,writeini smem.ini $2 password $3,)
$iif($4,writeini smem.ini $2 email $4,)
writeini smem.ini $2 join_date $asctime(ddmmmyyyy hh:nn:ss TT)
$iif($mam.password == on,writeini smem.ini $2 logged_in yes,writeini smem.ini $2 logged_in no)
write members.txt $2
writeini smem.ini status members $calc($readini(smem.ini,status,members) + 1)
.msg $2 Your account has been registered sucessfully! You can begin by typing !account main
echo -a Account created for $2 sucessfully!
}
If ($1 == unregister) {
If (!$2) { sequence error Please type /mam unregister <nick> | halt }
If ($readini(smem.ini,$2,registered) != yes) { sequence error This user isn't registered! $2 | halt }
If ($readini(smem.ini,$2,staff) == yes) { fire $2 }
remini smem.ini $2
write -ds $+ $2 members.txt
writeini smem.ini status members $calc($readini(smem.ini,status,members) - 1)
.msg $2 Your account has been deleted sucessfully!
echo -a Account for $2 has been deleted sucessfully!
}
If ($1 == set) {
If (!$2) {
echo -a Please select from the following options:
echo -a To set someone's email: /mam set email <nick> <new email>
echo -a To set someone's password: /mam set password <nick> <new password>
echo -a To promote someone to premium status: /mam set premium <nick>
echo -a To demote someone to regular status: /mam set member <nick>
}
Else {
If ($2 == email) {
If (!$4) { sequence error Please type /mam set email <nick> <new email> | halt }
writeini smem.ini $3 email $4-
echo -a Email for $3 set to $4 $+ .
}
Elseif ($2 == password) {
If (!$4) { sequence error Please type /mam set password <nick> <new password> | halt }
writeini smem.ini $3 password $4
echo -a Password for $3 set to $4 $+ .
}
Elseif ($2 == premium) {
If (!$3) { sequence error Please type /mam set premium <nick> | halt }
writeini smem.ini $3 premium yes
writeini smem.ini $3 premium_since $asctime(ddmmmyyyy hh:nn:ss TT)
writeini smem.ini $3 premium_renewal $asctime(ddmmmyyyy hh:nn:ss TT)
echo -a Member $3 advanced to premium status.
}
Elseif ($2 == member) {
If (!$3) { sequence error Please type /mam set member <nick> | halt }
writeini smem.ini $nick premium no
echo -a Member $3 $+ 's premium status has been revoked.
}
Else { sequence error Please type /mam set for more help with this. }
}
}
If ($1 == settings) {
If (!$3) {
echo -a Please select from the following settings: (All of them are on or off settings)
echo -a To turn $iif($mam.register == on,off,on) account registrations, type /mam settings account_registration $iif($mam.register,on,off,on)
echo -a To turn $iif($mam.delete == on,off,on) account deletions, type /mam settings account_deletion $iif($mam.delete == on,off,on)
echo -a To turn $iif($mam.password == on,off,on) password requirements, type /mam settings require_password $iif($mam.password == on,off,on)
echo -a To turn $iif($mam.email == on,off,on) email requirements, type /mam settings require_email $iif($mam.email == on,off,on)
echo -a To turn $iif($mam.premium == on,off,on) premium accounts, type /mam settings premium_accounts $iif($mam.premium == on,off,on)
echo -a To turn $iif($mam.mmode == on,off,on) member mode changes, type /mam settings member_mode_changes $iif($mam.mmode == on,off,on)
echo -a To turn $iif($mam.pmode == on,off,on) premium mode changes, type /mam settings premium_mode_changes $iif($mam.pmode == on,off,on)
}
Else {
writeini mam.ini settings $2 $3
echo -a $2 has been turned $3 $+ .
echo -a If the previous statement doesn't make sense, or doesn't change anything, you've typed something wrong. Type /mam settings to get more help with this.
}
}
}
alias mam.register { return $readini(mam.ini,settings,account_registration) }
alias mam.delete { return $readini(mam.ini,settings,account_deletion) }
alias mam.password { return $readini(mam.ini,settings,require_password) }
alias mam.email { return $readini(mam.ini,settings,require_email) }
alias mam.premium { return $readini(mam.ini,settings,premium_accounts) }
alias mam.mmode { return $readini(mam.ini,settings,member_mode_changes) }
alias mam.pmode { return $readini(mam.ini,settings,premium_mode_changes) }
dialog mam {
title Member Account Module Console
option dbu
size -1 -1 101 22
button "Account Management", 1, 1 1 100 10
button "Change Settings", 2, 1 11 100 10
}
on *:DIALOG:mam:*:*: {
If ($devent == init) {
If ($readini(mam.ini,status,installed) != yes) { dialog -x mam | halt }
}
If ($devent == sclick) {
If ($did == 1) {
dialog -x mam
dialog -md mamam mamam
}
If ($did == 2) {
dialog -x mam
dialog -md mamcs mamcs
}
}
}
dialog mamam {
title Member Account Module Account Management
option dbu
size -1 -1 101 55
button "Register Account", 1, 1 1 100 10
button "Delete Account", 2, 1 11 100 10
button "View/Change/Setup Password or email", 3, 1 22 100 10
button "Promote/Demote Accounts", 4, 1 33 100 10, disable
button "Main Menu", 5, 1 44 100 10
}
on *:DIALOG:mamam:*:*: {
If ($devent == init) {
If ($readini(mam.ini,status,installed) != yes) { dialog -x mamam | halt }
If ($mam.premium == on) { did -e $dname 4 }
}
If ($devent == sclick) {
If ($did == 1) {
var %temp.1 $$?="Please enter the account's nick."
If ($mam.password == on) { var %temp.2 $?="Please enter the account's new password, or leave blank to have the member fill it out." }
If ($mam.email == on) { var %temp.3 $?="Please enter the account's new email, or leave blank to have the member fill it out." }
mam register %temp.1 $iif(%temp.2,%temp.2,) $iif(%temp.3,%temp.3,)
dialog -v mamam
}
If ($did == 2) {
var %temp.1 $$?="Please enter the account's nick to delete."
mam unregister %temp.1
dialog -v mamam
}
If ($did == 3) {
dialog -md mamvcspe mamvcspe
dialog -x mamam
}
If ($did == 4) {
dialog -md mampda mampda
dialog -x mamam
}
If ($did == 5) {
dialog -x mamam
dialog -md mam mam
}
}
}
dialog mamvcspe {
title Member Account Module View/Change/Setup Password or Email
option dbu
size -1 -1 163 44
text "Member", 1, 1 1 30 10
edit "", 2, 31 1 100 10, autohs default
button "Look-up", 3, 132 1 30 10, default
radio "Password", 4, 1 11 80 10
radio "Email", 5, 82 11 81 10
edit "", 6, 1 22 162 10, disable
button "Account Management", 7, 1 33 162 10
}
on *:DIALOG:mamvcspe:*:*: {
If ($devent == init) {
If ($readini(mam.ini,status,installed) != yes) { dialog -x mamvcspe | halt }
}
If ($devent == sclick) {
If (!$did(2)) { did -f $dname 2 | halt }
If ($did == 3) {
If ($readini(smem.ini,$did(2),registered) != yes) {
did -rf $dname 2
did -b $dname 6
}
Else {
did -e $dname 6
}
}
If ($did == 4) {
did -ra $dname 6 $readini(smem.ini,$did(2),password)
}
If ($did == 5) {
did -ra $dname 6 $readini(smem.ini,$did(2),email)
}
If ($did == 7) {
dialog -x mamvcspe
dialog -md mamam mamam
}
}
If ($devent == edit) {
If ($did == 2) {
did -b $dname 6
}
If ($did == 6) {
If (!$did(2)) { did -f $dname 2 | halt }
writeini smem.ini $did(2) $iif($did(4).state == 1,password,email) $did(6)
}
}
}
dialog mampda {
title Member Account Module Promote/Demote Accounts
option dbu
size -1 -1 163 33
text "Member", 1, 1 1 30 10
edit "", 2, 31 1 100 10, autohs default
button "Look-up", 3, 132 1 30 10, default
radio "Regular", 4, 1 11 80 10, disable
radio "Premium", 5, 81 11 81 10, disable
button "Account Management", 6, 1 22 162 10
}
on *:DIALOG:mampda:*:*: {
If ($devent == init) {
If ($readini(mam.ini,status,installed) != yes) { dialog -x mampda | halt }
}
If ($devent == sclick) {
If ($did == 3) {
If (!$did(2)) { did -f $dname 2 }
If ($readini(smem.ini,$did(2),registered) != yes) {
did -rf $dname 2
did -b $dname 4,5
}
Else {
did -c $dname $iif($readini(smem.ini,$did(2),premium) == yes,5,4)
did -e $dname 4,5
}
}
If ($did == 4) {
mam set member $did(2)
}
If ($did == 5) {
mam set premium $did(2)
}
If ($did == 6) {
dialog -x mampda
dialog -md mamam mamam
}
}
If ($devent == edit) {
If ($did == 2) {
did -b $dname 4,5
}
}
}
dialog mamcs {
title Member Account Module Change Settings
option dbu
size -1 -1 101 88
button "Account Registration: ??", 1, 1 1 100 10
button "Account Deletion: ??", 2, 1 11 100 10
button "Require Password: ??", 3, 1 22 100 10
button "Require Email: ??", 4, 1 33 100 10
button "Premium Accounts: ??", 5, 1 44 100 10
button "Member Mode Changes: ??", 6, 1 55 100 10
button "Premium Mode Changes: ??", 7, 1 66 100 10, disable
button "Main Menu", 8, 1 77 100 10
}
on *:DIALOG:mamcs:*:*: {
If ($devent === init) {
If ($readini(mam.ini,status,installed) != yes) { dialog -x mamcs | halt }
did -ra $dname 1 Account Registration: $mam.register
did -ra $dname 2 Account Deletion: $mam.delete
did -ra $dname 3 Require Password: $mam.password
did -ra $dname 4 Require Email: $mam.email
did -ra $dname 5 Premium Accounts: $mam.premium
did -ra $dname 6 Member Mode Changes: $mam.mmode
did -ra $dname 7 Premium Mode Changes: $mam.pmode
If ($mam.premium == on) { did -e $dname 7 }
}
If ($devent == sclick) {
If ($did == 1) {
writeini mam.ini settings account_registration $iif($readini(mam.ini,settings,account_registration) == on,off,on)
did -ra $dname 1 Account Registraiton: $mam.register
}
If ($did == 2) {
writeini mam.ini settings account_deletion $iif($readini(mam.ini,settings,account_deletion) == on,off,on)
did -ra $dname 2 Account Deletion: $mam.delete
}
If ($did == 3) {
writeini mam.ini settings require_password $iif($readini(mam.ini,settings,require_password) == on,off,on)
did -ra $dname 3 Require Password: $mam.password
}
If ($did == 4) {
writeini mam.ini settings require_email $iif($readini(mam.ini,settings,require_email) == on,off,on)
did -ra $dname 4 Require Email: $mam.email
}
If ($did == 5) {
writeini mam.ini settings premium_accounts $iif($readini(mam.ini,settings,premium_accounts) == on,off,on)
did -ra $dname 5 Premium Accounts: $mam.premium
}
If ($did == 6) {
writeini mam.ini settings member_mode_changes $iif($readini(mam.ini,settings,member_mode_changes) == on,off,on)
did -ra $dname 6 Member Mode Changes: $mam.mmode
}
If ($did == 7) {
writeini mam.ini settings premium_mode_changes $iif($readini(mam.ini,settings,premium_mode_changes) == on,off,on)
did -ra $dname 7 Premium Mode Changes: $mam.pmode
}
If ($did == 8) {
dialog -x mamcs
dialog -md mam mam
}
}
}
menu nicklist,query {
-
MAM Account Management
.Register User: /mam register $$1
.Unregister User: /mam unregister $$1
.Change password: /mam set password $$1 $$?="Please enter new password."
.Change email: /mam set email $$1 $$?="Please enter new email."
.Make Premium user: /mam set premium $$1
.Make Regular user: /mam set member $$1
}
menu * {
-
MAM Account Management
.Change Module Settings: /dialog -md mamcs mamcs
}
on *:TEXT:!account*:*: {
If ($readini(sbot.ini,status,installed) != yes) { halt }
If ($readini(mam.ini,status,installed) != yes) { halt }
If ($chr(36) isin $1-) { halt }
If ($readini(smem.ini,$nick,registered) != yes) {
If ($2 == register) {
If ($mam.register == on) {
mam register $nick
}
Else {
.msg $nick We are not currently accepting registrations. Please try again later.
}
}
Else {
If ($mam.register == on) {
.msg $nick Please type !account register to register for an account.
}
}
}
Else {
If ($mam.password == on) {
If (!$readini(smem.ini,$nick,password)) {
If (($2 == set) && ($3 == password)) && ($4) {
writeini smem.ini $nick password $4
writeini smem.ini $nick logged_in yes
.msg $nick You have sucessfully set your password. Please type !account to begin.
halt
}
Else {
.msg $nick We require you to have a password, please type !account set password <password here>
halt
}
}
Else {
If ($readini(smem.ini,$nick,logged_in) != yes) {
If ($2 == login) && ($readini(smem.ini,$nick,password) === $3) {
writeini smem.ini $nick logged_in yes
.msg $nick You have been logged in sucessfully! You may now begin by typing !account
halt
}
Else {
.msg $nick You must be logged in before you can do this, please type !account login <password, case sensative>
halt
}
}
}
}
If ($mam.email == on) {
If (!$readini(smem.ini,$nick,email)) {
If (($2 == set) && ($3 == email)) && ($4) {
writeini smem.ini $nick email $4
.msg $nick You have sucessfully set your email. Please type !account to begin.
halt
}
Else {
.msg $nick We require you to have an email, please type !account set email <email here>
halt
}
}
}
If (!$2) {
.msg $nick Please select from the following options:
$iif(($mam.password || $mam.email) == on,.msg $nick To view your account settings type !account settings,)
.msg $nick To view your unchangeable account settings type !account uas
$iif($mam.premium == on,.msg $nick To view available premium member options type !account premium,)
$iif($readini(sbmail.ini,status,installed) == yes,.msg $nick To view your mail options type !account mail,)
$iif($mam.delete == on,.msg $nick To delete your account type !account deletemyaccount,)
}
Else {
If ($2 == settings) {
If (($mam.password && $mam.email) != on) { .msg $nick None of this information is required by this system. | halt }
.msg $nick Please select from the following options:
If ($mam.password == on) { .msg $nick Your current password is: $readini(smem.ini,$nick,password) - To change your password, type !account set password <new password> }
If ($mam.email == on) { .msg $nick Your current email is: $readini(smem.ini,$nick,email) - To change your email, type !account set email <new email> }
}
Elseif ($2 == set) {
If ($mam.password != on) && ($mam.email != on) { halt }
If (($3 == password) || ($3 == email)) && ($4) {
writeini smem.ini $nick $3 $4
.msg $nick Your $3 has been sucessfully changed to: $4
}
Else {
.msg $nick Please type !account settings for more help with this.
}
}
Elseif ($2 == uas) {
.msg $nick The follow are your unchangeable account settings (uas):
.msg $nick Join Date: $left($readini(smem.ini,$nick,join_date), 9)
.msg $nick Join Time: $right($readini(smem.ini,$nick,join_Date), -9)
If ($readini(smem.ini,$nick,staff) == yes) {
.msg $nick Staff: Yes
.msg $nick Staff Level: $readini(smem.ini,$nick,staff_level)
}
}
Elseif ($2 == premium) {
If ($mam.premium != on) { halt }
If (!$3) {
If ($readini(smem.ini,$nick,premium) == yes) {
.msg $nick You currently are a premium member.
.msg $nick You have been a premium member since: $readini(smem.ini,$nick,premium_since)
.msg $nick If you would like to cancel your premium membership, type !account premium cancel
}
Else {
.msg $nick You currently are not a premium member.
.msg $nick If you would like to apply to be premium member, type !account premium apply
}
}
Elseif ($3 == cancel) {
If ($readini(smem.ini,$nick,premium) == yes) {
mam set member $nick
.msg $nick Your account has been changed to regular member status.
}
Else {
.msg $nick You are not a premium member!
}
}
Elseif ($3 == apply) {
If ($readini(smem.ini,$nick,premium) == yes) {
.msg $nick Your are already a premium member!
}
Else {
.msg $nick Please wait...
write premiumapply.txt $nick
writeini premiumapply.ini $nick status review
dialog -md premiumapply premiumapply
.msg $nick Your account has been added to this list of applicants for premium accounts. To check the status of your application, type !account premium status
}
}
Elseif ($3 == status) {
If ($readini(smem.ini,$nick,premium) == yes) {
.msg $nick Your application was approved and you are currently a premium member.
}
Elseif ($readini(premiumapply.ini,$nick,status) == review) {
.msg $nick Your application is currently under review and has not yet been approved. You can continue to check the status of your application by typing !account premium status
}
Else {
.msg $nick Either we have not received an application for you, or it was denied. We appologize for any inconvenience.
}
}
Else {
.msg $nick Unknown Premium command.
}
}
Elseif ($2 == mail) {
If ($readini(sbmail.ini,status,installed) != yes) { halt }
If (!$3) {
.msg $nick Please select from the following options:
.msg $nick To see your inbox or a specific message, type !account mail inbox [option message number]
.msg $nick To send a message to another user, type !account mail send <recipient> <message here>
.msg $nick To delete your inbox or a specific message, type !account mail delete <all or message number>
}
Else {
If ($3 == inbox) {
If ($4) && ($read($nick $+ mail.txt, $4)) {
.msg $nick Message $4 $+ : $read($nick $+ mail.txt, $4)
.msg $nick To delete this message, type !account mail delete $4
}
Elseif ($4) {
.msg $nick Message $4 doesn't exist!
}
Else {
.msg $nick Please wait while we retrieve your messages...
var %temp.1 1
var %temp.2 $lines($nick $+ mail.txt)
While (%temp.1 <= %temp.2) {
.msg $nick Message %temp.1 $+ : $read($nick $+ mail.txt)
inc %temp.1
}
.msg $nick End of messages. To delete your messages, type !account mail delete all
.msg $nick To delete a specific message, type !account mail delete <message number>
}
}
Elseif ($3 == send) {
If (!$5) { .msg $nick Please type !account mail send <recipient> <message here> | halt }
If ($readini(smem.ini,$4,registered) != yes) { .msg $nick $4 isn't a registered user. | halt }
sbmail send $nick $4 $5-
.msg $nick Message to $4 has been sent!
}
Elseif ($3 == delete) {
If ($4 == all) {
sbmail delete $nick all
}
Elseif ($4 isnum) {
sbmail delete $nick $4
}
Else {
.msg $nick Please type !account mail delete <all or message number>
}
}
Else {
.msg $nick Unknown mail comand.
}
}
Elseif ($2 == deletemyaccount) {
If ($mam.delete == on) {
If (!$3) {
.msg $nick If you would like to delete your account, type !account deletemyaccount $address
}
Elseif ($3 === $address) {
mam unregister $nick
}
Else {
.msg $nick If you would like to delete your account, type !account deletemyaccount $address
}
}
}
Else {
.msg $nick Unknown account command, please type !account for more help with this.
}
}
}
}
}
dialog premiumapply {
title Premium Applications
option dbu
size -1 -1 101 73
list 1, 1 1 100 50
button "Approve", 2, 1 51 100 10, disable
button "Deny", 3, 1 62 100 10, disable
}
on *:DIALOG:premiumapply:*:*: {
If ($devent == init) {
If ($lines(premiumapply.txt) == 0) { dialog -x premiumapply | halt }
var %temp.1 1
var %temp.2 $lines(premiumapply.txt)
While (%temp.1 <= %temp.2) {
did -a $dname 1 $read(premiumapply.txt, %temp.1)
inc %temp.1
}
}
If ($devent == sclick) {
If ($did == 1) {
did -e $dname 2,3
}
If ($did == 2) {
If (!$did(1).seltext) { did -b $dname 2,3 | halt }
remini premiumapply.ini $nick
write -ds $+ $did(1).seltext premiumapply.txt
mam set premium $did(1).seltext
dialog -x $dname
dialog -md premiumapply premiumapply
}
If ($did == 3) {
If (!$did(1).seltext) { did -b $dname 2,3 | halt }
remini premiumapply.ini $nick
write -ds $+ $did(1).seltext premiumapply.txt
dialog -x $dname
dialog -md premiumapply premiumapply
}
}
}
This script is for the out-dated version of Staff Bot, you should go get Staff Bot 6 which can be found here: http://www.hawkee.com/scripts/11648798/