|
teion Wanderer
Joined: 03 May 2005 Posts: 72
|
Posted: Fri Feb 20, 2015 7:19 pm
looping through map database to color rooms. |
Hi guys I currently have a small script I wrote to check to see if a room is in a certain zone and then color it if the room description is filled. The problem is when I have more then one if condition the searching (looping) through rooms is really slow.
Let me know if there is a better way to do this.
Code: |
#wh (@rnum < 50001) {#if (%roomzone(@rnum,) != 74 && %roomname(@rnum,) = "") {%roomcol(@rnum,536870911} {};#math rnum @rnum+1} |
rnum is a counter for the rooms. The zone id that I am interested in is 74 |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Sat Feb 21, 2015 3:17 am |
The long delays is unavoidable, however, if you put a
#WAIT 0
before the #WHILE it should shunt the processing off into its own #THREAD so as not to lock up the client for the duration. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Tue Feb 24, 2015 7:54 am |
You can use the %mapfilter function to select only rooms in a specific zone, then iterate over them directly.
|
|
|
|
|
|