[script]
n0=menu @Steel_Rat {
n1=  Новая Игра: unset %ptext | ptext 0
n2=  -
n3=  Сохранить Игру:dialog -m strtd strtd
n4=  -
n5=  Загрузить Игру:dialog -m strtd strtd
n6=  -
n7=  Закрыть: close -@ $active | unset %ptext %ptf %iptx
n8=}
n9=
n10=on 1:load: {
n11=  echo -s -
n12=  echo -s Игра "Стальная Крыса" загружена. Желаем приятно провести время!
n13=  echo -s -
n14=}
n15=
n16=on *:signal:strt:{
n17=  window -aek @Steel_Rat
n18=  clear @Steel_Rat
n19=  loadbuf $lines(system\game\strt\welcome.txt) -pi @Steel_Rat system\game\strt\welcome.txt
n20=  set %ptext Menu
n21=}
n22=
n23=alias ptext {
n24=  if ( $ptallow($1) == 1 ) {
n25=    set %ptext $1
n26=    clear @Steel_Rat
n27=    aline @Steel_Rat 3 $1 $+ :
n28=    loadbuf $lines(system\game\strt\ $+ $1 $+ .txt) -pi @Steel_Rat system\game\strt\pfl\ $+ $1 $+ .txt
n29=  }
n30=  else {
n31=    aline @Steel_Rat 
n32=    aline -p @Steel_Rat %ss2 Вы ввели номер выхода, который не соответствует данному моменту игры. Помните, что игра интересна только если вы не пытаетесь жульничать ;) 4[Если же это глюк, то НЕМЕДЛЕННО сообщите об этом Watcher]
n33=  }
n34=}
n35=
n36=alias ptallow {
n37=  if ( %ptext == $null ) { return 1 }
n38=  set %iptx 1
n39=  set %ptf $mircdirsystem\game\strt\pfl\ $+ %ptext $+ .ini
n40=  while ( %iptx <= $lines(%ptf) ) {
n41=    if ( $1 == $read( %ptf , $calc( %iptx -1 ) ) ) { return 1 }
n42=    if ( $read( %ptf , $calc( %iptx -1 )) == any ) { return 1 }
n43=    inc %iptx
n44=  }
n45=}
n46=
n47=on 1:input:@Steel_Rat: {
n48=  if ( $1 isnum ) { ptext $1 }
n49=  else halt
n50=}
n51=
n52=dialog strtd {
n53=  title "Steel Rat"
n54=  size -1 -1 491 198
n55=  option pixels, notheme
n56=  box "Save", 1, 10 8 467 79,
n57=  combo 3, 20 25 260 125,  drop size
n58=  edit "", 4, 20 55 260 20,
n59=  button "Save Existing", 5, 285 25 85 20,
n60=  button "Save New", 6, 285 55 85 20,
n61=  box "Chapter", 7, 393 53 70 30,
n62=  text "-", 8, 396 66 62 14,  center
n63=  box "Load", 2, 10 94 467 53,
n64=  combo 9, 20 114 260 125,  drop size
n65=  button "Load", 10, 285 114 85 20,
n66=  box "Chapter", 11, 388 104 70 33,
n67=  text "-", 12, 392 119 62 14,  center
n68=  button "New Game", 13, 314 155 75 27,
n69=  button "Close", 14, 401 155 75 27,
n70=  button "Delete Existing", 15, 380 25 85 20,
n71=}
n72=on 1:dialog:strtd:init:*:{
n73=  did -o strtd 8 1 %ptext
n74=  var %ist 1
n75=  while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n76=    did -a strtd 9 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n77=    inc %ist
n78=  }
n79=  var %ist 1
n80=  while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n81=    did -a strtd 3 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n82=    inc %ist
n83=  }
n84=}
n85=on 1:dialog:strtd:sclick:*:{
n86=  if ($did == 0) {
n87=    did -o strtd 8 1 %ptext
n88=  }
n89=  if ($did == 5) {
n90=    write -l $+ $did(strtd,3).sel system\game\strt\save.txt $did(strtd,3).seltext $+ $chr(134) $+ %ptext
n91=    var %ist 1
n92=    did -r strtd 9
n93=    while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n94=      did -a strtd 9 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n95=      inc %ist
n96=    }
n97=    var %ist 1
n98=    did -r strtd 3
n99=    while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n100=      did -a strtd 3 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n101=      inc %ist
n102=    }
n103=  }
n104=  if ($did == 6) {
n105=    write $mircdirsystem\game\strt\save.txt $did(strtd,4) $+ $chr(134) $+ %ptext
n106=    var %ist 1
n107=    did -r strtd 9
n108=    while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n109=      did -a strtd 9 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n110=      inc %ist
n111=    }
n112=    var %ist 1
n113=    did -r strtd 3
n114=    while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n115=      did -a strtd 3 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n116=      inc %ist
n117=    }
n118=  }
n119=  if ($did == 9) {
n120=    did -o strtd 12 1 $gettok($read($mircdirsystem\game\strt\save.txt,$did(strtd,9).sel),2,134)
n121=  }
n122=  if ($did == 10) {
n123=    unset %ptext
n124=    ptext $did(strtd,12)
n125=  }
n126=  if ($did == 13) {
n127=    unset %ptext
n128=    ptext 0
n129=  }
n130=  if ($did == 14) {
n131=    dialog -x strtd
n132=  }
n133=  if ($did == 15) {
n134=    write -dl $+ $did(strtd,3).sel system\game\strt\save.txt
n135=    var %ist 1
n136=    did -r strtd 3
n137=    while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n138=      did -a strtd 3 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n139=      inc %ist
n140=    }
n141=    var %ist 1
n142=    did -r strtd 9
n143=    while ( %ist <= $lines($mircdirsystem\game\strt\save.txt) ) {
n144=      did -a strtd 9 $gettok($read($mircdirsystem\game\strt\save.txt,%ist),1,134)
n145=      inc %ist
n146=    }
n147=  }
n148=}
