Version: 1 for Script Engine Version: 44 Description Returns array of all sectors in Universe, race selectable. Arguments 1: Race , Var/Race , 'Race, null = All :' Source Text 001 * -------------------------------------------------------------------------------- 002 * Author : mark_a_condren a.k.a MarCon 003 * -------------------------------------------------------------------------------- 004 * Created : May - 2010 005 * -------------------------------------------------------------------------------- 006 007 *$Testing = [TRUE] 008 $Testing = [FALSE] 009 010 $max.x = get max sectors in x direction 011 $max.y = get max sectors in y direction 012 013 $x = 0 014 $y = 0 015 016 $sectors.array = array alloc: size=0 017 018 while $x <= $max.x AND $y <= $max.y 019 |$sector = get sector from universe index: x=$x, y=$y 020 |if $sector -> exists 021 ||if not $Race == null 022 |||$sector.owner = $sector -> get owner race 023 |||if $sector.owner == $Race 024 ||||append $sector to array $sectors.array 025 |||end 026 ||else 027 |||append $sector to array $sectors.array 028 ||end 029 |end 030 |if $y == $max.y 031 ||$y = 0 032 ||inc $x = 033 |else 034 ||inc $y = 035 |end 036 end 037 038 if $Testing 039 |$Sectors.count = size of array $sectors.array 040 |$desc = sprintf: fmt='%s', $Sectors.count, null, null, null, null 041 |$ret = open custom menu: title='Sectors :' description=$desc option array=$sectors.array 042 |$sect = $sectors.array[$ret] 043 |$sect = sprintf: fmt='%s', $sect, null, null, null, null 044 |display subtitle text: text=$sect duration=3000 ms 045 end 046 047 return $sectors.array
Version: 1 for Script Engine Version: 44 Description Lib - Get all sectors from universe, by race array. Arguments 1: race.array , Value , 'Inc Races Array, Null = All:' Source Text 001 * -------------------------------------------------------------------------------- 002 * Author : mark_a_condren a.k.a MarCon 003 * -------------------------------------------------------------------------------- 004 * Created : May - 2010 005 * -------------------------------------------------------------------------------- 006 007 $Testing = [TRUE] 008 *$Testing = [FALSE] 009 010 $max.x = get max sectors in x direction 011 $max.y = get max sectors in y direction 012 013 $x = 0 014 $y = 0 015 016 $sectors.array = array alloc: size=0 017 018 while $x <= $max.x AND $y <= $max.y 019 |$sector = get sector from universe index: x=$x, y=$y 020 |if $sector -> exists 021 ||if $race.array 022 |||$race = $sector -> get owner race 023 |||if find $race in array: $race.array 024 ||||append $sector to array $sectors.array 025 |||end 026 ||else 027 |||append $sector to array $sectors.array 028 ||end 029 |end 030 |if $y == $max.y 031 ||$y = 0 032 ||inc $x = 033 |else 034 ||inc $y = 035 |end 036 end 037 038 if $Testing 039 |$Sectors.count = size of array $sectors.array 040 |$desc = sprintf: fmt='%s', $Sectors.count, null, null, null, null 041 |$ret = open custom menu: title='All Sectors :' description=$desc option array=$sectors.array 042 end 043 044 return $sectors.array