# --LandCopier-- 12/9/2016 1:35:38 PM $LandInput:"PASTE" once Self "main" "Custom89pp" SetImage Self "main" 0 0 0 0 SetImageColor <-LandInput "PASTE" eq if 1 ->copying else 0 ->copying <-LandInput ";" split ->l1 CreateList ->Clipboard <-l1 GetListCount 0 do CreateList ->row <-l1[I] "," split ->l2 <-l2 GetListCount 0 do <-row <-l2[I] asint AppendToList loop <-Clipboard <-row AppendToList loop @Setup --l1 --l2 endif endonce <-copying if "X" GetKeyDown if GetMouseCell ->my ->mx <-corner if 0 ->corner <-mx ->x2 <-my ->y2 1 ->set else 1 ->corner <-mx ->x1 <-my ->y1 <-mx <-my SetCurrentCoords endif <-set if Self "main" 0 255 0 128 SetImageColor <-x2 <-x1 sub ->width <-y2 <-y1 sub ->height Self "main" <-width abs 1 add asfloat 3.0 div <-height abs 1 add asfloat 3.0 div SetImageScale Self "main" <-width 2 mul <-height 2 mul -10 SetImagePosition endif endif "C" GetKeyDown if <-set if CreateList ->Clipboard <-y1 <-y2 max 1 add <-y1 <-y2 min do CreateList ->row <-x1 <-x2 max 1 add <-x1 <-x2 min do <-row I J GetLand AppendToList loop <-Clipboard <-row AppendToList loop 0 ->copying @Setup endif endif else GetMouseCell SetCurrentCoords "B" GetKeyDown if "" <-height 0 do <-Clipboard[I] ->row <-width 0 do <-row[I] concat I <-width 1 sub neq if "," concat endif loop I <-height 1 sub neq if ";" concat endif loop print "Output saved!" trace endif "Escape" GetKeyDown if 1 ->copying 0 ->set Self "main" 0 0 0 0 SetImageColor endif "N" GetKeyDown if CreateList ->NewClipboard <-height 0 do <-NewClipboard <-Clipboard[I] PrependToList loop <-NewClipboard ->Clipboard "Vertical Flip" trace endif "M" GetKeyDown if <-height 0 do CreateList ->NewRow <-Clipboard[I] ->row <-width 0 do <-NewRow <-row[I] PrependToList loop <-NewRow ->Clipboard[I] loop "Horizontal Flip" trace endif "J" GetKeyDown if CreateList ->NewClipboard <-width 0 do CreateList ->row <-height 0 do <-row <-Clipboard I GetListElement J GetListElement AppendToList loop <-NewClipboard <-row PrependToList loop <-NewClipboard ->Clipboard @Setup "Turnwise Rotate" trace endif "K" GetKeyDown if CreateList ->NewClipboard <-width 0 do CreateList ->row <-width 1 sub I sub ->j <-height 0 do <-height 1 sub I sub ->i <-row <-Clipboard <-i GetListElement <-j GetListElement AppendToList loop <-NewClipboard <-row PrependToList loop <-NewClipboard ->Clipboard @Setup "Widdershins Rotate" trace endif "V" GetKeyDown if <-height 0 do <-Clipboard[I] ->row <-width 0 do CurrentX I add CurrentY J add <-row[I] SetLand loop loop endif endif :Setup <-Clipboard GetListCount ->height <-row GetListCount ->width Self "main" <-width asfloat 3.0 div <-height asfloat 3.0 div SetImageScale Self "main" <-width 1 sub 2 mul <-height 1 sub 2 mul -10 SetImagePosition Self "main" 0 0 255 128 SetImageColor :awake Self 0 SetUnitTakeMapSpace IsEditMode if 1 OperateWhilePaused else Self 0 DestroyUnit endif