MUSH SUPPORT
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Hotel code

Go down

Hotel code Empty Hotel code

Post  Void Mon Aug 31, 2009 10:26 am

For people that aren't familiar with wetfiction, we've got a hotel based on http://www.mushcode.com/ViewFile.aspx?Id=5 which is a room digging tool.

apart from making it compatible with our chat, I've added some extra features such as banning, kicking, room protect (which disables the prior two), and room lock, which only allows people on the "allow list" to enter the room. I'll be posting bits and pieces of that code here.
Void
Void
Admin

Posts : 14
Join date : 2009-08-17

https://mush.board-directory.net

Back to top Go down

Hotel code Empty Per room command

Post  Void Mon Aug 31, 2009 10:41 am

Code:

@@ Protect Code. If you say protect on, it changes the ban/kick commands and stops teleporting out@@
@@ Saying protect off resets the ban/kick commands and enables teleporting out(since thats how you ban@@

&PROTECT here=^* says, "Protect *":@switch %1=on,{@pemit %n=This room is now protected.;@oemit %#=This room is now protected;@lock/telout me =#0;&ban_cmd me=$ban *:@pemit \%#=No banning\, this room is protected.\;@oemit \%#=\%n tried to ban \%0 but failed hard.;&kick_cmd me=$kick *:@pemit %#=lol no\, this room is protected so no kicking.\;@oemit \%#=\%n tried to kick \%0 but failed hard.},off,{@pemit %#=This room is no longer protected.;@oemit %n=This room is no longer protected;@unlock/telout me;&ban_cmd me=$ban *:@pemit \%0=[get(me/ban_message)]\;@oemit \%0= [get(me/ban_message2)]\;@WAIT 4={@tel \%0=#130};&kick_cmd me=$kick *:@tel \%0=#173\;@remit #173=[get(me/kick_message)]\;

@@ Ban and Kick commands@@
&BAN_CMD here=$ban *:@pemit %0=%n BANS UUUU;@oemit %0= The darkness rises from the ground and swallows %0, banishing them to the dungeon.";@WAIT 4=@tel %0=#130

&KICK_CMD here=$kick *:@tel %0=#173;@remit #173=OLOLOLOL I BAN UUUUU PWN'D LOLOLOL XDDDD";

@@ Option to set custom kick/ban messages@@
&BANMSGSET here=^* says, "Ban message is "*" and others will see "*":&Ban_message me=%1;&Ban_message2 me=%2;@pemit %n=Message set.;@oemit %n=Message Set.

&KICKMSGSET here=^* says, "Kick message is "*";&Kick_message me=%1;@pemit %n=Message set.;@oemit %n=Message Set.

&BAN_MESSAGE here=%n BANS UUUU
&KICK_MESSAGE here=OLOLOLOL I BAN UUUUU PWN'D LOLOLOL XDDDD
&BAN_MESSAGE2 here=The darkness rises from the ground and swallows %0, banishing them to the dungeon."

@@ Adding people to the allow list@@
&ALLOW_CMD here=^* says, "Allow *":[setq(5,[replace(%1, 1, *%1)])];@switch 1=[hastype(%q5,PLAYER)],{setq(0,[insert([get(me/allow_rist)],1,%q5)]);&allow_rist me=%q0;@pemit %#=Added.;[if([get(me/lock_data)]=1,{@lock me==[ldelete(iter(get(me/allow_rist),| ##),1)]}},@pemit %#=Not a player.

@@ deny access when room is locked(remove from list)@@
&DENY_CMD here=^* says, "Deny *":[setq(5,[replace(%1, 1, *%1)])];[setq(0,[get(me/allow_rist)])];[setq(4,[edit(%q0,%q5,)])];&allow_rist me=%q4;[if([get(me/lock_data)]=1,{@lock me==[ldelete(iter(get(me/allow_rist),| ##),1)]};@pemit %#=Denied!;@oemit %#=Denied!

@@ locking the room@@
&LOCK_CMD here=^* says, "* room":@switch %1=Lock,{@lock me==[ldelete(iter(get(me/allow_rist),| ##),1)];@pemit %n=Room locked.;@oemit %n=Room has been locked;&lock_data me=1},Unlock,{@unlock me;@pemit %n=Room unlocked.;@oemit %n=Room has been unlocked.;&lock_data me=0}

@@ Room status (locked? protected?)@@
&STATUS_CMD here=$status:@pemit %#=[switch([get(me/protect_data)]|[get(me/lock_data)],1|1,Locked and Protected,1|*,Room is protected,*|1,Room is locked,Room neither locked nor protected.)]%r[switch([get(me/allow_rist)],*,[ldelete(iter(strip(get(me/allow_rist),*),and [capstr(##)]),1) are allowed when the room is locked.],There isn't anyone on the allow list.)] %r[switch([get(me/ban_list)],,Nobody on the ban list.,[ldelete(iter(strip(get(me/ban_list),*),and [capstr(##)]),1)] are permaBANNED from this room.,)]

&TIME here=$time:@pemit %# =time()
&PROTECT_DATA here=0
&LOCK_DATA here=1

@set here=HAVEN
@set here=MONITOR
Void
Void
Admin

Posts : 14
Join date : 2009-08-17

https://mush.board-directory.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum