mirror of
https://github.com/tbamud/tbamud.git
synced 2026-04-03 02:47:19 +02:00
Remove DG scripts in favor of Python scripting
This commit is contained in:
parent
5273201d1b
commit
a1976f92dd
80 changed files with 4332 additions and 2430 deletions
14
lib/scripts/sample_echo.py
Normal file
14
lib/scripts/sample_echo.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Room echo script example (attach to a room trigger)
|
||||
|
||||
def on_trigger(event):
|
||||
# Room entity the script is attached to.
|
||||
room = event["self"]
|
||||
|
||||
while True:
|
||||
# Pick between two messages using a dice roll.
|
||||
if mud.roll("1d2") == 1:
|
||||
mud.echo_room(room, "someone spills a drink at the bar")
|
||||
else:
|
||||
mud.echo_room(room, "a game of cards gets rowdy as a dwarf slams a fist on a table")
|
||||
# Wait before the next echo.
|
||||
mud.sleep(60)
|
||||
Loading…
Add table
Add a link
Reference in a new issue