Changes the guild motd by taking text said in a declared chat channel and passing to the guildmotd. Uses an ini to maintain a user list of people who are allowed to call this function. Toon running the macro must have guild officer rights or better.
2005-3-14
+ Release
Code: Select all
| -- Sqwak.mac
|
| Program by MPonthePC.
| Date: 3/14/2005
| Version: 1.0
|
| Overview: Allows people to change the MOTD from chat channel without being an officer.
| Usage: /macro sqwak ChatChannel
| Props: Code derived from assitance from blueninja and Goofmester1 as well as much liberty taken from Gimp's Buffbot.
| Note: Requires Sqwak.ini
| * ex: /macro sqawk guildcommand:mypassword
#chat chat
#define NOT_FOUND -1
#define SQWAK_INI "SQWAK.INI"
#define BOOL_TRUE 1
#define BOOL_FALSE 0
sub main
/declare ChatChannel string outer None
/echo Sqwak Box Activated
/if (${Defined[Param0]}) {
/varset ChatChannel ${Param0}
/echo Watching channel ${ChatChannel}
/join ${ChatChannel}
} else {
/Echo No Channel Specified... Quitting.
/end
}
:talkloop
/doevents
/goto :talkloop
/return
Sub Event_Chat(ChatType,Sender,ChatText)
/declare AllowedSqwak int local NOT_FOUND
/varset AllowedSqwak ${Ini[SQWAK_INI, AllowedMOTD, ${Sender}, BOOL_FALSE]}
/if (${AllowedSqwak} == BOOL_FALSE) {
/echo # Debug: Ignoring MOTD '${ChatText}' from ${Sender}
/return
} ELSE {
/if (${ChatType.Equal[${ChatChannel}]}) {
/guildmotd ${Sender}: ${ChatText}
} ELSE {
/echo # Debug: Command in the wrong channel.
}
/return
}
Code: Select all
| sqwak.ini
[AllowedMOTD]
ToonName1=1
ToonName2=1

