PDA

View Full Version : Offer-Accept


complexity
12-27-2004, 12:04 PM
;Almost all hosted palaces come with the offer and accept script because of the plugin (offer/accept), but a great script for a free palace server that doesnt support plugins.

To use: whisper offer


;This is the part that goes in a door at your gate

ON SIGNON
{
offeredAvatar GLOBAL
offerInScript GLOBAL
offerOutScript GLOBAL
{
offeredAvatar GLOBAL prps GLOBAL
{
"$1" GREPSUB prps =
{
"[ " prps & " ] SETPROPS" & offeredAvatar =
"@" WHOCHAT WHOPOS ITOA SWAP ITOA "," & SWAP & &
" You have been offered an avatar by " & WHOCHAT WHONAME &
". To accept it, type \"accept\"." & LOCALMSG
} prps ".* .* .* .* .* .* .* .* .* .*" GREPSTR NOT prps "-$" GREPSTR
NOT AND
prps "- " GREPSTR NOT AND prps ">$" GREPSTR NOT AND prps "> "
GREPSTR NOT AND
prps "<$" GREPSTR NOT AND prps "< " GREPSTR NOT AND WHOCHAT WHOME
<> AND IF
"" CHATSTR =
} CHATSTR "^;avoffer [\[] ([0-9<>A-Fa-f -]+) [\]]" GREPSTR IF
} offerInScript DEF
{
offeredAvatar GLOBAL
{
{
{
0 i = ";avoffer [ "
{
i USERPROP ITOA & " " & i ++
} { i NBRUSERPROPS < } WHILE "]" & WHOTARGET PRIVATEMSG
} NBRUSERPROPS IF
}
{
"You have to whisper the offer." STATUSMSG
} WHOTARGET IFELSE
"" CHATSTR =
} CHATSTR "offer" == IF
{
"" CHATSTR = offeredAvatar STRTOATOM EXEC
} "accept" CHATSTR == "\"accept\"" CHATSTR == OR offeredAvatar "" <>
AND IF
{
"" CHATSTR =
} CHATSTR "^;avoffer" GREPSTR IF
} offerOutScript DEF
}
ON OUTCHAT { offerOutScript GLOBAL offerOutScript EXEC }
ON INCHAT { offerInScript GLOBAL offerInScript EXEC }

;this goes in all other rooms you want offer/accept to be available to members

ON OUTCHAT { offerOutScript GLOBAL offerOutScript EXEC }
ON INCHAT { offerInScript GLOBAL offerInScript EXEC }