;Alan's basic gate script ;Last updated April 10, 2001 ;This is a general-purpose script to put in your gate. ;It performs common gate functions and defines functions that can be used in other rooms. ;Place this entire script in your gate. ;Tailor the signon and room list for your palace at the start of this script. ;Tailor the functions you want near the end of this script. ;Place the last portion of this script, only, in rooms where you want these functions. ON SIGNON { ;*****Tailor here***** "Welcome to " SERVERNAME & ", " & USERNAME & "!" & LOCALMSG { "your_welcome" SOUND } 100 ALARMEXEC ;*****Tailor here***** ; ; ;Roomlist - go to a room by saying its name ;Say "roomlist" to get a list of the rooms you can go to. ;This is an OUTCHAT script. roomlist GLOBAL { [ ; ;*****Tailor here***** ;Put room names and numbers here in form: [ roomname roomnumber ] [ roomname roomnumber ] [ "gate" 86 ] ;*****Tailor here***** ; ] roomarray = { temparray = { "" CHATSTR = temparray 1 GET GOTOROOM } CHATSTR temparray 0 GET == IF } roomarray FOREACH { "You may type any of the following room names to go directly there: " { temparray = temparray 0 GET & "," & } roomarray FOREACH LOCALMSG "" CHATSTR = } CHATSTR "roomlist" == IF } roomlist DEF ; ; ;ICameFrom - send a message to Owners/Operators when someone arrives ICameFrom GLOBAL { { "(unknown)" ICameFrom = } ICameFrom VARTYPE SWAP POP 4 == NOT IF CLIENTTYPE } { { "(unknown)" ICameFrom = } ICameFrom 0 == IF { "PC" } { "Mac" } DATETIME 0 > IFELSE } IPTVERSION IFELSE "I am using a " SWAP & " client and I came from '" & ICameFrom & "'. My userID is " & WHOME ITOA & SUSRMSG SERVERNAME ICameFrom = ; ; ;The following are standard scripts for any room ;You may call them individually, or as a whole with the commands at the end of this script. ; ; ;Allscray - cause others in room to say/do things. Does not affect other Owners/Operators. ;If you whisper to someone they are the only one affected. ; ";as" makes everyone say/do something ; ";ao" makes everyone except you say/do something. ;Includes part of 'clone' script. ;This is an INCHAT script xDoIt GLOBAL nDoIt GLOBAL ; let anybody use Allscary - NOT RECOMMENDED. { { "$1" GREPSUB STRTOATOM EXEC } CHATSTR LOWERCASE "^;as (.*)" GREPSTR ISWIZARD NOT AND IF { "$1" GREPSUB STRTOATOM EXEC } CHATSTR LOWERCASE "^;ao (.*)" GREPSTR WHOCHAT WHOME == NOT AND ISWIZARD NOT AND IF { "$1" GREPSUB STRTOATOM EXEC } CHATSTR LOWERCASE "^;*allscray (.*)" GREPSTR ISWIZARD NOT AND IF ;myavis - receive the cloned av { "$1 SETPROPS" GREPSUB STRTOATOM EXEC "Received cloned prop." LOGMSG } CHATSTR LOWERCASE "^;myavis (.*)$" GREPSTR WHOCHAT WHOTARGET == AND IF } xDoIt DEF ; let only Owners and Operators use Allscray. They must be wearing their *. RECOMMENDED. { xDoIt GLOBAL { xDoIt EXEC } WHOCHAT WHONAME "^[*]" GREPSTR IF } nDoIt DEF ; ;Allscraycommands - useful allscray commands ;Uses Owners/Operators, only, allscray. ;This is an OUTCHAT script allscraycommands GLOBAL { ;gothere - send to mouse position { ";ao " MOUSEPOS SWAP ITOA " " & SWAP ITOA & & " SETPOS" & CHATSTR = } CHATSTR "gothere" == IF ;sendroom - send to another room { ";ao $1 GOTOROOM" GREPSUB CHATSTR = } CHATSTR LOWERCASE "sendroom ([0-9]*)" GREPSTR IF ;sendpal - send to another palace { ";ao \"palace://$1\" NETGOTO" GREPSUB CHATSTR = } CHATSTR LOWERCASE "sendpal (.*)" GREPSTR IF ;sendmail - send to a web address { ";ao \"mailto:$1\" NETGOTO" GREPSUB CHATSTR = } CHATSTR LOWERCASE "sendmail (.*)" GREPSTR IF ;sendweb - send to a web address { ";ao \"http://$1\" NETGOTO" GREPSUB CHATSTR = } CHATSTR LOWERCASE "sendweb (.*)" GREPSTR IF ;ghost - see if the person has poofed { ";ao \"I'm still here.\" WHOCHAT PRIVATEMSG" CHATSTR = } CHATSTR "ghost" == IF ;clone - clone the avatar of another person. { { ";ao 0 i = \"i: \" i ITOA & LOGMSG { \";myavis [ \" { i USERPROP ITOA & \" \" & i ++ } { i NBRUSERPROPS < } WHILE \"]\" & WHOCHAT PRIVATEMSG } NBRUSERPROPS IF" WHOTARGET PRIVATEMSG } { "Clone: You must be whispering to someone." LOGMSG } WHOTARGET IFELSE "" CHATSTR = } CHATSTR "clone" == IF ;giveav - give your av to other(s) { ";allscray [ " p = 0 i = { p i USERPROP ITOA & " " & p = i ++ } { i NBRUSERPROPS < } WHILE p "] SETPROPS" & CHATSTR = } CHATSTR "giveav" == IF } allscraycommands DEF ; ; ;Offer/Accept/URL - trade avs and URLs with others. ;Whisper to offer to one person, say to offer to all people. ;This part is an INCHAT script. offerInScript GLOBAL { offeredAvatar GLOBAL offeredURL GLOBAL { "$1" GREPSUB offeredURL = "You have been offered a URL link to $1 by " GREPSUB WHOCHAT WHONAME & ". To visit it say \"accepturl\"." & LOCALMSG } CHATSTR "^;urloffer ([0-9a-zA-Z\./?=%:@~]+)" GREPSTR WHOCHAT WHOME == NOT AND IF ; { "$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 IF "" CHATSTR = } CHATSTR "^;avoffer [\[] ([0-9<>A-Fa-f -]+) [\]]" GREPSTR WHOCHAT WHOME == NOT AND IF } offerInScript DEF ; ;This part is an OUTCHAT script. offeredAvatar GLOBAL "" offeredAvatar = offeredURL GLOBAL "" offeredURL = offerOutScript GLOBAL { offeredAvatar GLOBAL offeredURL GLOBAL ;offerweb - offer a web address { { ";urloffer http://$1" GREPSUB WHOTARGET PRIVATEMSG } { "You must whisper to offer." STATUSMSG } WHOTARGET IFELSE "" CHATSTR = } CHATSTR LOWERCASE "^offerweb ([0-9a-zA-Z\./?=%:@~]+)$" GREPSTR IF ;offerpal - offer a palace address { { ";urloffer palace://$1" GREPSUB WHOTARGET PRIVATEMSG } { "You must whisper to offer." STATUSMSG } WHOTARGET IFELSE ""CHATSTR = } CHATSTR LOWERCASE "^offerpal ([0-9a-zA-Z\./?=%:@~]+)$" GREPSTR IF ;offermail - offer an email address { { ";urloffer mailto:$1" GREPSUB WHOTARGET PRIVATEMSG } { "You must whisper to offer." STATUSMSG } WHOTARGET IFELSE ""CHATSTR = } CHATSTR LOWERCASE "^offermail ([0-9a-zA-Z\./?=%:@~]+)$" GREPSTR IF ;accepturl - accept web, palace or email address { offeredURL NETGOTO "" CHATSTR = } CHATSTR "accepturl" == offeredURL "" == NOT AND IF ;offer - offer av { { { 0 i = ";avoffer [ " { i USERPROP ITOA & " " & i ++ } { i NBRUSERPROPS < } WHILE "]" & WHOTARGET PRIVATEMSG } NBRUSERPROPS IF } { "You must whisper to offer." STATUSMSG } WHOTARGET IFELSE "" CHATSTR = } CHATSTR "offer" == IF ;accept - accept av { offeredAvatar STRTOATOM EXEC "" CHATSTR = } CHATSTR "accept" == offeredAvatar "" == NOT AND IF ; ;Dont let anybody say the automated commands ; { "" CHATSTR = } CHATSTR "^;avoffer" GREPSTR IF { "" CHATSTR = } CHATSTR "^;urloffer" GREPSTR IF } offerOutScript DEF ; ; ;Helpmsgs - help messages ;This is an OUTCHAT script. helpmsgs GLOBAL { { "Help messages written to your Log." STATUSMSG "For a list of rooms you can go to by name type 'roomlist'" LOGMSG "Whisper/say 'offer' to offer your av, say 'accept' to accept it." LOGMSG "Whisper 'offerweb
', 'offerpal
' or 'offermail
' to offer an address." LOGMSG "Say 'accepturl' to open your browser, go to a palace or open an email to the offered address." LOGMSG { "\x0dOperator/Owner commands. You must be wearing your *." LOGMSG "clone - clone another person's av." LOGMSG "giveav - give your av to another person(s)." LOGMSG "ghost - check to see if person(s) has poofed." LOGMSG "gothere - move person(s) to mouse position." LOGMSG "sendroom - send person(s) to room here." LOGMSG "sendpal
- send person(s) to palace at address." LOGMSG "sendmail - open person(s) email program to addressee." LOGMSG "sendweb
- open person(s) browser to address." LOGMSG } ISWIZARD IF "" CHATSTR = } CHATSTR "help" == IF } helpmsgs DEF ; ; ;Cleanroom - clean up a room when the last person leaves it. ;This is a LEAVE script. cleanroom GLOBAL { { CLEARLOOSEPROPS PAINTCLEAR } NBRROOMUSERS 2 < IF } cleanroom DEF ; ; ;***************************************************************** ;The following enable all of the above for easy reference in rooms. ;If you do not want a particular script put a semicolon (;) in front of the appropriate line(s). ;Use all ENTER scripts AllENTERScripts GLOBAL { } AllENTERScripts DEF ; ;Use all INCHAT scripts AllINCHATScripts GLOBAL { nDoIt GLOBAL nDoIt EXEC ;allscray offerInScript GLOBAL offerInScript EXEC ;offer/accept } AllINCHATScripts DEF ; ;Use all OUTCHAT scripts AllOUTCHATScripts GLOBAL { allscraycommands GLOBAL allscraycommands EXEC ;allscray commands offerOutScript GLOBAL offerOutScript EXEC ;offer/accept roomlist GLOBAL roomlist EXEC ;room list helpmsgs GLOBAL helpmsgs EXEC ;help messages } AllOUTCHATScripts DEF ; ;Use all SELECT scripts AllSELECTScripts GLOBAL { } AllSELECTScripts DEF ; ;Use all ALARM scripts AllALARMScripts GLOBAL { } AllALARMScripts DEF ; ;Use all LEAVE scripts AllLEAVEScripts GLOBAL { cleanroom GLOBAL cleanroom EXEC ;cleanroom } AllLEAVEScripts DEF ;***************************************************************** } ;The following is part of this gate script. ;In addition, place the following part, only, in rooms where you want the functions defined above. ;Enable all gate functions ON ENTER { AllENTERScripts GLOBAL AllENTERScripts EXEC } ON INCHAT { AllINCHATScripts GLOBAL AllINCHATScripts EXEC } ON OUTCHAT { AllOUTCHATScripts GLOBAL AllOUTCHATScripts EXEC } ON SELECT { AllSELECTScripts GLOBAL AllSELECTScripts EXEC } ON ALARM { AllALARMScripts GLOBAL AllALARMScripts EXEC } ON LEAVE { AllLEAVEScripts GLOBAL AllLEAVEScripts EXEC }