Author Topic: Advanced Scripts  (Read 31223 times)

0 Members and 4 Guests are viewing this topic.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
example of loading objects in containers
« Reply #45 on: October 29, 2013, 07:14:41 pm »
Name: 'Load_Breakfast',  VNum: [ 4409], RNum: [  441]
Trigger Intended Assignment: Rooms
Trigger Type: Time, Numeric Arg: 5, Arg list: None
Commands:
%echo% A gong sounds throughout the fort, notifying everyone that breakfast is about to begin.
wait 3s
%load% mob 4445
%echo% Parading into the room, a gathering of serving wenches brings out the breakfast.
%echo% They set the tables at neatly as possible, cheeses on plates and loaves of bread in cloth-covered baskets.
%load% obj 4407
set cont %loaded%
%load% obj 4400 %cont.name%
%load% obj 4400 %cont.name%
%load% obj 4400 %cont.name%
%load% obj 4400 %cont.name%
%load% obj 4409
set cont %loaded%
%load% obj 4401 %cont.name%
%load% obj 4401 %cont.name%
%load% obj 4401 %cont.name%
%load% obj 4401 %cont.name%
%load% obj 4411
%load% obj 4402
%load% obj 4402
%load% obj 4402
%load% obj 4402
wait until 7:00
%echo% As breakfast finishes, the serving wenches get to work again and begin to pick the tables clean.
%echo% They skillfully stack plates and silverware and carry it off to be washed.
set o %self.contents%   
while %o%   
  set next %o.next_in_list%   
  if %o.vnum% == 4407 || %o.vnum%== 4409 || %o.vnum% == 4402 || %o.vnum% == 4400 || %o.vnum%== 4401 || %o.vnum% == 4411
    %purge% %o%   
  end
  set o %next%
done
set m %self.people%
while %m%
  set next %m.next_in_room%
  if %m.vnum% == 4445
    %purge% %m%
  end
  set m %next%
done

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Seasons and Moon Phases
« Reply #46 on: October 29, 2013, 08:02:37 pm »
To get the current season, do %time.season%.
The seasons are:
winter (month 0-3), spring (month 4-7), summer (month 8-12) and autumn (month 13-16).
Note that the total amount of months is 17, and that summer has 5 months.
All other seasons have 4 months.

To get the current moon phase, do %time.moon%.
The moon phases are:
"full", "waning gibbous", "last quarter", "waning crescent",  "new", "waxing crescent", "first quarter" and "waxing gibbous".
For example, if something in a script should only happen if the moon is waning gibbous, do
 if %time.moon% == waning gibbous
  %echo% leprechauns take over the world
 end
Keep in mind that %time.moon% will return the current moon phase even if it's daytime.