lua:scripting:examples:scriptingolc
Differences
This shows you the differences between two versions of the page.
| lua:scripting:examples:scriptingolc [2014/12/24 05:40] – created vodur | lua:scripting:examples:scriptingolc [2026/10/15 13:26] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Using the CH:olc() command we can script olc editing if desired. | ||
| - | |||
| - | Let's set all rooms in Bastion to be no_teleport. | ||
| - | |||
| - | For this script, we will not use a trigger, but instead use the ' | ||
| - | So we just need an mprog vnum and we're good to go. I will use my favorite one, which is 31404. | ||
| - | <code lua> | ||
| - | local rooms=mob.room.area.rooms | ||
| - | local cnt=0 | ||
| - | for _,room in pairs(rooms) do | ||
| - | -- Maybe it is already no_teleport, | ||
| - | if not(room: | ||
| - | goto(room.vnum) | ||
| - | mdo(" | ||
| - | olc(" | ||
| - | olc(" | ||
| - | cnt=cnt+1 | ||
| - | end | ||
| - | end | ||
| - | sendtochar(mob, | ||
| - | </ | ||
| - | |||
| - | Remember that since you are using mprun, ' | ||
| - | In our script we choose the area based on the mob location, so need to make sure we're in Bastion when we run it. | ||
| - | |||
| - | < | ||
| - | goto 10204 | ||
| - | The Palace Square [Room 10204 city] | ||
| - | You stand in the common area of the walled city of Bastion. | ||
| - | buildings line the streets in all directions. | ||
| - | four cardinal directions, roads meet the square and continue outward into | ||
| - | the rest of the city. Looking up you see a complex system of support beams, | ||
| - | columns, and stone work that supports the " | ||
| - | earned its name long before the walls of Bastion were built, when the palace | ||
| - | seemed to float above the rest of city and was visible from anywhere on the | ||
| - | island. | ||
| - | leading up into the palace. | ||
| - | with white marble tiles, decorated in the patterns of the island. | ||
| - | your feet in the center of the square is a great gold seal, and the donation | ||
| - | pit is through a hole down from here. | ||
| - | |||
| - | [Exits: north east south west up down northeast southeast southwest northwest] | ||
| - | |||
| - | mprun 31404 | ||
| - | Running mprog 31404 on Ranglor(0) in room The Palace Square(10204) | ||
| - | Room flags toggled. | ||
| - | Room flags toggled. | ||
| - | ... | ||
| - | ... | ||
| - | Room flags toggled. | ||
| - | Updated 275 rooms | ||
| - | Mprog completed. | ||
| - | </ | ||
| - | |||
| - | Now, if it worked right, we should be able to run it again and have 0 updates. | ||
| - | |||
| - | < | ||
| - | mprun 31404 | ||
| - | Running mprog 31404 on Ranglor(0) in room Before a Shadowed Throne(10505) | ||
| - | Updated 0 rooms | ||
| - | Mprog completed. | ||
| - | </ | ||
| - | |||
