xTrivia — File Browser

xTriviav1.0 / xTriviav1.0 / xTriviaByRibellina / xtrivia / bot / Addons / Giochi / Trova.mrc

Trova.mrc — 39.73 KB — Download this file

on 1:NICK:{ 
  if (%gametrova_stato != OFF) && ( $nick != $newnick ) {
    trova_search $newnick
    if (%trovato == 1) {
      %trova_tmpp = %trova_ptsquery
      write -dl %pos sillclass.txt 
    }
    trova_search $nick
    if (%trovato == 1) {
      %trova_chnickline = $read -l %pos sillclass.txt
      %trova_ptsquery = $calc(%trova_ptsquery + %trova_tmpp)
      %trova_chnickline = $puttok(%trova_chnickline,%trova_ptsquery,2,46)
      %trova_chnickline = $puttok(%trova_chnickline,$newnick,1,46)
      write -l %pos sillclass.txt %trova_chnickline
    }
    trova_manchesearch $nick
    if (%trovato == 1) {
      %trova_chnickline = $read -l %pos trovamanche.txt
      %trova_chnickline = $puttok(%trova_chnickline,$newnick,1,46)
      write -l %pos trovamanche.txt %trova_chnickline
    }  
  }
  unset %trova_tmpp
}
on 1:TEXT:!punti:%trova_canale:{
  if (%gametrova_stato != OFF) {
    trova_search $nick
    if (%trovato == 1) {
      .msg $nick Il tuo punteggio Γ¨ %trova_ptsquery
    }
  }
}
on 1:TEXT:!trova:%trova_canale: {
  if (%gametrova_stato != OFF) {
    if (%trova_manche == ON ) { msg %trova_canale  0,2 Sillaba iniziale4,2 %trova_current 0,2finale 4,2 %trova_fina 0,2 . Limite a 4,2 %trova_lenmax 0,2 lettere. }
    else { msg %trova_canale 11,2 Nessuna manche in corso. Attendi la prossima. }
  }
} 
on 1:TEXT:!valori:%trova_canale:{
  if (%gametrova_stato != OFF) {
    if (%trova_mad != 1) msg %trova_canale 8,2 Valori:11,2 a=1 b=3 c=1 d=3 e=1 f=3 g=3 h=6 i=1 j=8 k=8 l=2 m=2 n=2 o=1 p=3 q=6 r=1 s=1 t=1 u=3 v=3 w=8 x=8 y=8 z=5
    else msg %trova_canale 8,2 Valori:11,2 %trova_madvaluesline
  } 
}
on 1:TEXT:!aiuto:%trova_canale: trova_help $nick

on 1:TEXT:*:?:{
  if (%gametrova_stato == ON) && (%trova_manche == OFF) && ($1 != $null) && ($nick != $me) { .msg $nick Manche terminata. Non posso accettare la tua richiesta }
  if (%gametrova_stato == ON) && (%trova_manche == ON) && ($1 != $null) && ($nick != $me) {
    trova_manchesearch $nick
    if ($1 == -delete) {
      if (%trovato == 1) {
        write -dl %pos trovamanche.txt
        .msg $nick Ho eliminato la tua entry. Scrivine una nuova
      } 
    }
    else { 
      set %trova_string $1
      if (%trovato == 1) { .msg $nick Hai giΓ  dato la parola %trova_wentry . -Delete per cancellarla | halt }
      if ($len(%trova_string) > %trova_lenmax) { .msg $nick Il limite per questa manche Γ¨ di %trova_lenmax  lettere | halt }
      if (%trova_current != $left(%trova_string,2)) { .msg $nick Stiamo giocando per la trova iniziale %trova_current  . La tua parola non la contiene | halt }
      if (%trova_fina != $right(%trova_string,2))  { .msg $nick Stiamo giocando per la trova finale %trova_fina  . La tua parola non la contiene | halt }
      else {
        set %trova_starlet $left(%trova_string,1)
        set %trova_trovato $read($scriptdirDictionary\ $+ italiano. [ $+ [ %trova_starlet ] ],w,%trova_string,1)
        if ( %trova_trovato == %trova_string ) {
          .msg $nick Parola Accettata
          set %trova_linez $nick
          set %trova_linez $addtok(%trova_linez,%trova_string,46)
          write trovamanche.txt %trova_linez
        }
        else .msg $nick Questa parola non esiste nel mio dizionario, spiacente
      }
    }
    close -m $nick
  }
}

alias trova_start {
  if ( %gametrova_stato == ON ) || ( %gametrova_stato == PAUSE ) { if ( $?!="Sei sicuro/a di voler avviare il gioco? Potrebbe essere giΓ  attivo oppure in pausa? " == $true ) { set %gametrova_stato OFF  } }
  if (%gametrova_stato == OFF) || (%gametrova_stato == $null) {
    unset %trova*
    set %trova_canale $?="Su che canale avviare il gioco?"
    if ( %trova_canale !ischan ) { echo -a Canale non valido | halt }
    set %trova_target $?="Inserisci il numero di punti da totalizzare per vincere:"
    if (%trova_target !isnum) { echo -a Non hai inserito un valore valido. Fai ripartire il quiz | halt }
    set %gametrova_stato ON
    set %trova_manche OFF
    set %trova_durata 80
    set %trova_pausetime 15
    set %trova_manchenum 0
    set %trova_mad 0
    if ($exists(trovarecord.txt) == $false) trova_generahs
    set %trova_record $read -l 11 trovaRecord.txt
    set %trova_reckeeper $gettok(%trova_record,1,35)
    set %trova_record $gettok(%trova_record,2,35)
    if $exists(sillclass.txt) { .remove sillclass.txt }
    if $exists(trovamanche.txt) { .remove trovamanche.txt }
    msg %trova_canale              11,2β€”] $trovalogo 11X-T.r.] O [.v.A 9By Sasuke84 11AtTivAtO !! [β€”
    msg %trova_canale              11,2β€”] $trovalogo 11Si vince a 4 %trova_target 11Punti [β€”
    echo -a 8,2 Fai partire la prima manche quando vuoi dal pannello col tasto START GAME
    dialog -m trovagame trovagame
  }
}

on 1:text:!trovaon*:#:{
  if ($3 == %game_password) {
    if (%gametrova_stato == OFF) || (%gametrova_stato == $null) {
      unset %trova*
      set %trova_canale %game_channel
      if ( %trova_canale !ischan ) { .msg $nick Non mi trovo su %trova_canale, spiacente | halt }
      set %trova_target $2
      if (%trova_target !isnum) { .msg $nick Non hai inserito un valore valido. Fai ripartire il quiz | halt }
      set %gametrova_stato ON
      set %trova_manche OFF
      set %trova_durata 50
      set %trova_pausetime 15
      set %trova_manchenum 0
      set %trova_mad 0
      if ($4 == MAD) set %trova_mad 1
      if ($exists(trovarecord.txt) == $false) trova_generahs
      set %trova_record $read -l 11 trovaRecord.txt
      set %trova_reckeeper $gettok(%trova_record,1,35)
      set %trova_record $gettok(%trova_record,2,35)
      if $exists(sillclass.txt) { .remove sillclass.txt }
      if $exists(trovamanche.txt) { .remove trovamanche.txt }
      msg %trova_canale 11,2β€”] $trovalogo 11X-T.r.] O [.v.A 9By Sasuke84 11AtTivAtO Da 4 $nick [β€” 
      msg %trova_canale 11,2β€”] $trovalogo 11Si Vince A 4 %trova_target 11Punti [β€” 
      .timerhub 1 20 trova_hub
    }
  }
}

alias trova_generahs {
  %x = 1
  while ( %x <= 11 ) {
    write trovarecord.txt none#0
    inc %x
  }
}

alias trova_endofgame {
  if ($lines(sillclass.txt) > 4) && (%trova_target > 199) && (%trova_mad == 0) {
    set %x 1
    while (%x <= $lines(sillclass.txt)) {
      set %trova_line $read -l %x sillclass.txt
      set %trova_nick $gettok(%trova_line,1,46)
      set %trova_pts $gettok(%trova_line,2,46)
      set %trova_media $calc(%trova_pts / %trova_manchenum)
      set %y 1
      if (%trova_nick == $me ) goto stophere
      trova_gcs %trova_nick
      if (%trovato == 0) {
        while (%y <= 10) {
          set %trova_procline $read -l %y trovarecord.txt
          set %trova_ptsentry $gettok(%trova_procline,2,35)
          if (%trova_media > %trova_ptsentry) {
            set %z %y
            set %trova_inline %trova_nick $+ $chr(35) $+ %trova_media
            msg %trova_canale $trovalogo 4 %trova_nick 11Raggiunge La Posizione 4 %y 11Con La Media Di 4 %trova_media 11Punti. 
            while (%z <= 10) {
              set %trova_temp $read -l %z trovarecord.txt
              write -l %z trovarecord.txt %trova_inline
              set %trova_inline %trova_temp
              inc %z          
            } 
            goto stophere 
          }
          inc %y
        }
      }
      if (%trovato == 1) {
        if (%trova_media <= %trova_ptsquery) goto stophere
        write -dl %pos trovarecord.txt
        while (%y <= %pos) {
          set %trova_procline $read -l %y trovarecord.txt
          set %trova_ptsentry $gettok(%trova_procline,2,35)
          if (%trova_media > %trova_ptsentry) {
            set %trova_inline %trova_nick $+ $chr(35) $+ %trova_media
            msg %trova_canale $trovalogo 4 %trova_nick 11Raggiunge La Posizione 4 %y 11Con La Media Di 4 %trova_media 11Punti. 
            write -il %y trovarecord.txt %trova_inline
            goto stophere 
          }
          inc %y
        }
      }
      :stophere
      inc %x
    }
  }
  if $exists(sillclass.txt) { .remove sillclass.txt }
  if $exists(trovamanche.txt) { .remove trovamanche.txt }
  msg %trova_canale           11,2β€”] $trovalogo 11X-T.r.] O [.v.A Terminato [β€” 
  msg %trova_canale           11,2β€”] $trovalogo 11Vince 4 %trova_1nick 11Con 4 %trova_1pts 11Punti [β€”  
  msg %trova_canale           11,2β€”] $trovalogo 11 Superquiz [β€”  
  msg %trova_canale           11,2β€”] $trovalogo 11 www.NonSiTrova.it [β€” 
  set %gametrova_stato OFF
  unset %trova*
}

alias trova_gcs {
  set %i 1
  set %trovato 0
  while ( ( %i <= 10 ) && ( %trovato == 0 ) ) {
    %riga = $read -l %i trovarecord.txt
    %nome = $gettok(%riga,1,35)
    %trova_ptsquery = $gettok(%riga,2,35)
    if ( %nome == $1 ) {
      set %trovato 1 
      set %pos %i
    }
    inc %i 1 
  }
}

on 1:text:!trovaoff*:#:{
  if ($2 == %game_password) && (%gametrova_stato == ON) {
    if $exists(sillclass.txt) { .remove sillclass.txt }
    if $exists(trovamanche.txt) { .remove trovamanche.txt }
    .timer* off
    msg %trova_canale           11,2β€”] $trovalogo 11X-T.r.] O [.v.A Terminato [β€” 
    msg %trova_canale           11,2β€”] $trovalogo 11Vince 4 %trova_1nick 11Con 4 %trova_1pts 11Punti [β€”  
    msg %trova_canale           11,2β€”] $trovalogo 11 Superquiz [β€”  
    msg %trova_canale           11,2β€”] $trovalogo 11 www.NonSiTrova.it [β€” 
    set %gametrova_stato OFF
    unset %trova*
  }
}


alias trova_end_query {
  if (%gametrova_stato == ON) || (%gametrova_stato == PAUSE) {
    if ( $?!="Vuoi terminare il gioco? Esso verrΓ  fermato alla fine della prossima manche o di quella in corso " == $true ) { set %trova_target -1 }
  }
}

alias trova_pause {
  if (%gametrova_stato == ON) || (%gametrova_stato == PAUSE) {
    if (%trova_manche == ON) { echo -a 8,2 Attendi il termine della manche il corso }
    if (%trova_manche == OFF) {
      if (%gametrova_stato == PAUSE) { set %gametrova_stato ON | msg %trova_canale 11,2 ©º°¨¨¨°º© 4,2 Attenzione: il TroVa riprende 11,2 ©º°¨¨¨°º© | .timernext 1 %trova_pausetime trova_start_manche | halt }
      if (%gametrova_stato == ON) { set %gametrova_stato PAUSE | msg %trova_canale 11,2 ©º°¨¨¨°º© 8,2 TroVa in Pausa. Attendere prego... 11,2 ©º°¨¨¨°º© }
    }
  }
}

on 1:text:!trovapausa*:#:{
  if ($2 == %game_password) {
    if (%gametrova_stato == ON) || (%gametrova_stato == PAUSE) {
      if (%trova_manche == ON) { .msg $nick Attendi il termine della manche il corso }
      if (%trova_manche == OFF) {
        if (%gametrova_stato == PAUSE) { set %gametrova_stato ON | msg %trova_canale 11,2 ©º°¨¨¨°º© 4,2 Attenzione: il TroVa riprende 11,2 ©º°¨¨¨°º© | .timernext 1 %trova_pausetime trova_start_manche | halt }
        if (%gametrova_stato == ON) { set %gametrova_stato PAUSE | msg %trova_canale 11,2 ©º°¨¨¨°º© 8,2 TroVa in Pausa. Attendere prego... 11,2 ©º°¨¨¨°º© }
      }
    }
  }
}

alias trova_help {
  if ( %gametrova_stato != OFF) && (%trova_antiflood != ON) {
    set %trova_antiflood ON
    .timer1 1 1 .msg $1  4,2 ©©© T.r ] O [ .V.a ©©© - Modalità di gioco :
    .timer2 1 2 .msg $1  8,2 β€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œ
    .timer3 1 3 .msg $1  11,2 Ad ogni manche viene proposta una trova. Componi una parola che contenga la trova
    .timer4 1 4 .msg $1  11,2 e che non superi il limite fissato di lettere. Dopodichè scrivila in query a $me .
    .timer5 1 5 .msg $1  11,2 0,2!trova per vedere la trova corrente. !valori 11per vedere quanto vale ciascuna
    .timer6 1 6 .msg $1  11,2 lettera. !punti per conoscere il tuo punteggio.
    .timer7 1 7 .msg $1  11,2 Puoi dare una sola parola!Se vuoi cancellare una parola scrivi -delete (sempre a $me )
    .timer8 1 8 .msg $1  8,2 β€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œ
    .timer9 1 9 .msg $1  11,2 Divertiti con il gioco trova!
    .timer10 1 10 set %trova_antiflood OFF
  }
}

alias trova_instr {
  if ( %gametrova_stato != OFF ) && (%trova_antiflood != ON) {
    set %trova_antiflood ON
    .timer11 1 1 msg %trova_canale 4,2 ©©© T.r ] O [ .V.a ©©© - Modalità di gioco :
    .timer12 1 2 msg %trova_canale 8,2 β€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œ
    .timer13 1 3 msg %trova_canale 11,2 Ad ogni manche viene proposta una trova. Componi una parola che contenga la trova
    .timer14 1 4 msg %trova_canale 11,2 e che non superi il limite fissato di lettere. Dopodichè scrivila in query a0,2 $me .
    .timer15 1 5 msg %trova_canale 11,2 0,2!trova11,2 per vedere la trova corrente.0,2 !valori 11per vedere quanto vale ciascuna
    .timer16 1 6 msg %trova_canale 11,2 lettera.0,2 !punti11,2 per conoscere il tuo punteggio.
    .timer17 1 7 msg %trova_canale 11,2 Puoi dare una sola parola!Se vuoi cancellare una parola scrivi0,2 -delete11,2 (sempre a $me )
    .timer18 1 8 msg %trova_canale 8,2 β€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œβ€œ
    .timer19 1 9 msg %trova_canale 11,2 Divertiti con il gioco trova!
    .timer20 1 10 set %trova_antiflood OFF
  }
}

on 1:text:!trovahelp*:#:{ if ($2 == %game_password) && (%gametrova_stato == ON) trova_instr }

alias trova_search {
  %lineefile = $lines(sillclass.txt)
  set %i 1
  set %trovato 0
  while ( ( %i <= %lineefile ) && ( %trovato == 0 ) ) {
    %riga = $read -l %i sillclass.txt    
    %nome = $gettok(%riga,1,46)
    %trova_ptsquery = $gettok(%riga,2,46)
    if ( %nome == $1 ) {
      set %trovato 1 
      set %pos %i
    }
    inc %i 1 
  }
}

alias trova_manchesearch {
  %lineefile = $lines(trovamanche.txt)
  set %i 1
  set %trovato 0
  while ( ( %i <= %lineefile ) && ( %trovato == 0 ) ) {
    %riga = $read -l %i trovamanche.txt
    %nome = $gettok(%riga,1,46)
    if ( %nome == $1 ) {
      set %trovato 1 
      set %pos %i
    }
    inc %i 1 
  }
}

alias trova_ordina {
  set %trova_nltxt $lines(sillclass.txt)
  set %p 1
  while (%p < %trova_nltxt) {
    set %x 1
    while (%x < %trova_nltxt) {
      set %y $calc(%x + 1 )
      set %trova_upper $read -l %x sillclass.txt
      set %trova_lower $read -l %y sillclass.txt
      set %trova_uppt  $gettok(%trova_upper,2,46)
      set %trova_lowpt $gettok(%trova_lower,2,46)
      if (%trova_uppt < %trova_lowpt) {
        write -l %x sillclass.txt %trova_lower
        write -l %y sillclass.txt %trova_upper
      }
      inc %x
    } 
    inc %p
  }
  trova_ordina_rovescio
}

alias trova_ordina_rovescio {
  set %trova_nltxt $lines(trovamanche.txt)
  set %p 1
  while (%p < %trova_nltxt) {
    set %x 1
    while (%x < %trova_nltxt) {
      set %y $calc(%x + 1 )
      set %trova_upper $read -l %x trovamanche.txt
      set %trova_lower $read -l %y trovamanche.txt
      set %trova_uppt  $gettok(%trova_upper,3,46)
      set %trova_lowpt $gettok(%trova_lower,3,46)
      if (%trova_uppt > %trova_lowpt) {
        write -l %x trovamanche.txt %trova_lower
        write -l %y trovamanche.txt %trova_upper
      }
      inc %x
    }
    inc %p
  }
}

alias trova_start_manche { if (%gametrova_stato == ON) {
    inc %trova_manchenum
    set %trova_hub OFF
    set %trova_lunghezza $rand(2,4)
    set %trova_lettera $rand(a,z)
    :again
    set %trova_llf $lines($scriptdirDictionary\ $+ italiano. [ $+ [ %trova_lettera ] ] )
    set %trova_rdln $rand(1,%trova_llf)
    set %trova_extr $read($scriptdirDictionary\ $+ italiano. [ $+ [ %trova_lettera ] ] , %trova_rdln )
    if ($len(%trova_extr) < 8) { goto again }
    set %trova_current $left(%trova_extr,2)
    set %trova_fina $right(%trova_extr,2)
    set %trova_lenmax $rand(10,20)
    if (%trova_mad == 1) trova_makevalues
    set %trova_bonustype $rand(1,5)
    if (%trova_bonustype == 1) {
      set %trova_bmult $rand(2,5)
      set %trova_bpos $rand(1,%trova_lenmax)
      set %trova_blet $rand(a,z)
      set %trova_bonusbanner 11Bonus 4 [Random x $+ %trova_bmult $+ ] 11Posizione 4 %trova_bpos $+ Βͺ 
    }
    if (%trova_bonustype == 2) {
      set %trova_bmult $rand(2,5)
      set %trova_bpos $rand(1,%trova_lenmax)
      set %trova_blet $rand(a,z)
      set %trova_bonusbanner 11Bonus 4 [Random x $+ %trova_bmult $+ ] 11Lettera 4 $upper(%trova_blet) 
    }
    if (%trova_bonustype == 3) { set %trova_bonusbanner 11Bonus 4 [Vocali x2]  } 
    if (%trova_bonustype == 4) {
      set %trova_bmult 2
      set %trova_blet $rand(a,z)
      set %trova_bonusbanner 11Bonus 4 [x2] 11Su Ogni Lettera 4 $upper(%trova_blet)  
    }
    if (%trova_bonustype == 5) {
      set %trova_bpoints $rand(2,7)
      set %trova_blet $rand(a,z)
      set %trova_bonusbanner 4 %trova_bpoints 11Punti Se La Parola Inizia Per 4 $upper(%trova_blet) 
    }
    .timer21 1 1 msg %trova_canale $trovalogo  11Round NΒ°  4 [ %trova_manchenum  ] 
    .timer22 1 2 msg %trova_canale $trovalogo  11Vediamo Un Po' Cosa Esce Fuori.... 
    .timer23 1 3 msg %trova_canale $trovalogo  11Attenzione..... 
    .timer24 1 4 msg %trova_canale $trovalogo  11Trovare Una Parola Con Una Lunghezza MAX Di 9 --> 4 %trova_lenmax 11Lettere 
    .timer25 1 5 msg %trova_canale $trovalogo  11Che Inizi Con 9 --> 4 %trova_current 11 e Finisca Con 9 --> 4 %trova_fina 
    .timer26 1 6 msg %trova_canale $trovalogo  %trova_bonusbanner 
    .timer27 1 7 msg %trova_canale $trovalogo  11E Scriverla In PVT o QUERY a 4 $me 
    .timer28 1 8 msg %trova_canale $trovalogo  11Per Sapere I Valori Delle Lettere Digitate 4!VALORI 
    if (%trova_mad == 1) {
      .timer29 1 9 msg %trova_canale 8,2 %trova_oklets
      .timer30 1 9 msg %trova_canale 8,2 %trova_badlets
    }
    .timer31 1 10 msg %trova_canale $trovalogo  11Avete 4 %trova_durata 11Secondi A Partire Da Ora! 
    set %trova_manche ON
    .timeralert 1 $calc(%trova_durata + 2) { trova_alert }
  }
}

alias trova_makevalues {
  %trova_madvalues = $calc($rand(0,8)-3)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),2,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),3,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),4,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,8)-3),5,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),6,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),7,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),8,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,8)-3),9,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),10,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),11,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),12,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),13,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),14,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,8)-3),15,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),16,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),17,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),18,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),19,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),20,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,8)-3),21,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),22,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),23,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),24,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),25,32)
  %trova_madvalues = $instok(%trova_madvalues,$calc($rand(0,15)-5),26,32)
  unset %trova_madvaluesline
  unset %trova_oklets
  unset %trova_badlets
  %i = 1
  while (%i <= 26) {
    if ($gettok(%trova_madvalues,%i,32) < 0) set %trova_temp 4 $+ $chr($calc(64 + %i)) $+ = $+ $gettok(%trova_madvalues,%i,32)
    else set %trova_temp 8 $+ $chr($calc(64 + %i)) $+ = $+ $gettok(%trova_madvalues,%i,32)
    %trova_madvaluesline = $instok(%trova_madvaluesline,%trova_temp,%i,32)
    if ($gettok(%trova_madvalues,%i,32) < 0) set %trova_badlets $addtok(%trova_badlets,%trova_temp,32)
    else set %trova_oklets $addtok(%trova_oklets,%trova_temp,32)
    inc %i
  }
}

alias trova_alert {
  msg %trova_canale           11,2 β€”] Mancano Solo 4 10 11Secondi. Fate In Fretta! [β€”
  set %trova_comline $me
  set %trova_comline $addtok(%trova_comline,%trova_extr,46)
  if ($len(%trova_extr) <= %trova_lenmax) write trovamanche.txt %trova_comline
  .timerend 1 10 trova_endofmanche
}

alias trova_endofmanche {
  set %trova_manche OFF
  msg %trova_canale           11,2  β€”] Tempo Scaduto! 11Si giocava per la sillaba 4 %trova_current 11[β€” 
  if (%trova_bonustype == 1) msg %trova_canale  11,2 11Lettera Bonus X 4 %trova_bmult 11In Posizione 4 %trova_bpos 11Era La 4 $upper(%trova_blet) 11Risultati Della 4 %trova_manchenum Βͺ 11Manche 
  if (%trova_bonustype == 2) msg %trova_canale  11,2 11Lettera 4 $upper(%trova_blet) 11Bonus X 4 %trova_bmult 11Era Sulla Posizione 4 %trova_bpos 11Risultati Della 4 %trova_manchenum Βͺ 11Manche 
  if (%trova_bonustype == 3) msg %trova_canale  11,2 11Tutte Le Vocali Valgono 4DOPPIO. 11Risultati Della 4 %trova_manchenum Βͺ 11Manche 
  if (%trova_bonustype == 4) msg %trova_canale  11,2 11Tutte Le Lettere 4 $upper(%trova_blet) 11In Questa Manche Valgono 4DOPPIO. 11Risultati Della 4 %trova_manchenum Βͺ 11Manche 
  if (%trova_bonustype == 5) msg %trova_canale  11,2 11Le Parole Chiave Erano: 4 $upper(%trova_blet) 11Hanno 4 %trova_bpoints 11Punti. Risultati Della 4 %trova_manchenum Βͺ 11Manche 
  trova_elabora
  close -m
  set %trova_timercount 1
  set %trova_fatto 0
  set %trova_ntim $calc($lines(trovamanche.txt) + 1)
  .timermsg %trova_ntim 2 trova_resmsg
}

alias trova_elabora {
  set %z 1
  while ( %z <= $lines(trovamanche.txt) ) {
    set %trova_finale 0
    set %trova_elline $read -l %z trovamanche.txt
    set %trova_remains $gettok(%trova_elline,2,46)
    set %trova_elline $instok(%trova_elline,-,3,46)
    set %trova_elline $instok(%trova_elline,-,3,46)
    if (%z == 1) { set %trova_elline $puttok(%trova_elline,VelocitΓ [2],4,46) }
    set %trova_letpos 1
    while ($len(%trova_remains) > 0) {
      set %trova_leflet $calc($len(%trova_remains) - 1 )
      set %trova_proclet $left(%trova_remains,1)
      set %trova_remains $right(%trova_remains,%trova_leflet)
      set %trova_let_pts $trova_ptsxlet(%trova_proclet)
      if (%trova_bonustype <= 2) {
        if ( %trova_blet == %trova_proclet ) && ( %trova_bpos == %trova_letpos ) {
          set %trova_let_pts $calc(%trova_let_pts * %trova_bmult)
          set %trova_elbonuses $gettok(%trova_elline,4,46)
          if (%trova_elbonuses == -) { set %trova_elline $puttok(%trova_elline,Bonus[ $+ x $+ %trova_bmult $+ ],4,46) }
          else { 
            set %trova_elbonuses $addtok(%trova_elbonuses,Bonus[ $+ x $+ %trova_bmult $+ ],43)
            set %trova_elline $puttok(%trova_elline,%trova_elbonuses,4,46)
          }
        }
      }
      if (%trova_bonustype == 4) && (%trova_proclet == %trova_blet) { set %trova_let_pts $calc(%trova_let_pts * 2) }
      if (%trova_bonustype == 5) && (%trova_proclet = %trova_blet) && (%trova_letpos == 1) {
        set %trova_elbonuses $gettok(%trova_elline,4,46)
        if (%trova_elbonuses == -) { set %trova_elline $puttok(%trova_elline,LetteraIniziale,4,46) }
        else { 
          set %trova_elbonuses $addtok(%trova_elbonuses,LetteraIniziale,43)
          set %trova_elline $puttok(%trova_elline,%trova_elbonuses,4,46)
        }
      }
      inc %trova_finale %trova_let_pts
      inc %trova_letpos
    }
    set %trova_elline $puttok(%trova_elline,%trova_finale,3,46)
    write -l %z trovamanche.txt %trova_elline
    inc %z
  }
  trova_bonusleng
}

alias trova_ptsxlet {
  if (%trova_mad == 0) {
    if ($1 == a) && (%trova_bonustype != 3) return 1
    if ($1 == a) && (%trova_bonustype == 3) return 2
    if ($1 == b) return 3
    if ($1 == c) return 1
    if ($1 == d) return 3
    if ($1 == e) && (%trova_bonustype != 3) return 1
    if ($1 == e) && (%trova_bonustype == 3) return 2
    if ($1 == f) return 3
    if ($1 == g) return 3
    if ($1 == h) return 6
    if ($1 == i) && (%trova_bonustype != 3) return 1
    if ($1 == i) && (%trova_bonustype == 3) return 2
    if ($1 == j) return 8
    if ($1 == k) return 8
    if ($1 == l) return 2
    if ($1 == m) return 2
    if ($1 == n) return 2
    if ($1 == o) && (%trova_bonustype != 3) return 1
    if ($1 == o) && (%trova_bonustype == 3) return 2
    if ($1 == p) return 3
    if ($1 == q) return 6
    if ($1 == r) return 1
    if ($1 == s) return 1
    if ($1 == t) return 1
    if ($1 == u) && (%trova_bonustype != 3) return 3
    if ($1 == u) && (%trova_bonustype == 3) return 6
    if ($1 == v) return 3
    if ($1 == w) return 8
    if ($1 == x) return 8
    if ($1 == y) return 8
    if ($1 == z) return 5
    if ($1 == -) return 0
    if ($1 == `) return 0
  }
  if (%trova_mad == 1) {
    if ($1 == a) && (%trova_bonustype != 3) return $gettok(%trova_madvalues,1,32)
    if ($1 == a) && (%trova_bonustype == 3) return $calc(2 * $gettok(%trova_madvalues,1,32))
    if ($1 == b) return $gettok(%trova_madvalues,2,32)
    if ($1 == c) return $gettok(%trova_madvalues,3,32)
    if ($1 == d) return $gettok(%trova_madvalues,4,32)
    if ($1 == e) && (%trova_bonustype != 3) return $gettok(%trova_madvalues,5,32)
    if ($1 == e) && (%trova_bonustype == 3) return $calc(2 * $gettok(%trova_madvalues,5,32))
    if ($1 == f) return $gettok(%trova_madvalues,6,32)
    if ($1 == g) return $gettok(%trova_madvalues,7,32)
    if ($1 == h) return $gettok(%trova_madvalues,8,32)
    if ($1 == i) && (%trova_bonustype != 3) return $gettok(%trova_madvalues,9,32)
    if ($1 == i) && (%trova_bonustype == 3) return $calc(2 * $gettok(%trova_madvalues,9,32))
    if ($1 == j) return $gettok(%trova_madvalues,10,32)
    if ($1 == k) return $gettok(%trova_madvalues,11,32)
    if ($1 == l) return $gettok(%trova_madvalues,12,32)
    if ($1 == m) return $gettok(%trova_madvalues,13,32)
    if ($1 == n) return $gettok(%trova_madvalues,14,32)
    if ($1 == o) && (%trova_bonustype != 3) return $gettok(%trova_madvalues,15,32)
    if ($1 == o) && (%trova_bonustype == 3) return $calc(2 * $gettok(%trova_madvalues,15,32))
    if ($1 == p) return $gettok(%trova_madvalues,16,32)
    if ($1 == q) return $gettok(%trova_madvalues,17,32)
    if ($1 == r) return $gettok(%trova_madvalues,18,32)
    if ($1 == s) return $gettok(%trova_madvalues,19,32)
    if ($1 == t) return $gettok(%trova_madvalues,20,32)
    if ($1 == u) && (%trova_bonustype != 3) return $gettok(%trova_madvalues,21,32)
    if ($1 == u) && (%trova_bonustype == 3) return $calc(2 * $gettok(%trova_madvalues,21,32))
    if ($1 == v) return $gettok(%trova_madvalues,22,32)
    if ($1 == w) return $gettok(%trova_madvalues,23,32)
    if ($1 == x) return $gettok(%trova_madvalues,24,32)
    if ($1 == y) return $gettok(%trova_madvalues,25,32)
    if ($1 == z) return $gettok(%trova_madvalues,26,32)
    if ($1 == -) return 0
    if ($1 == `) return 0
  }
}

alias trova_bonusleng {
  set %z 1
  set %trova_blmax 0
  while (%z <= $lines(trovamanche.txt)) {
    set %trova_blline $read -l %z trovamanche.txt
    set %trova_blword $gettok(%trova_blline,2,46)
    if ($len(%trova_blword) > %trova_blmax) { set %trova_blmax $len(%trova_blword) }
    inc %z
  }
  set %z 1
  while (%z <= $lines(trovamanche.txt)) {
    set %trova_blline $read -l %z trovamanche.txt
    set %trova_blword $gettok(%trova_blline,2,46)
    if ($len(%trova_blword) == %trova_blmax) {
      set %trova_bonuses $gettok(%trova_blline,4,46)
      if (%trova_bonuses == -) { set %trova_blline $puttok(%trova_blline,Lunghezza[4],4,46) | write -l %z trovamanche.txt %trova_blline }
      else {      
        set %trova_bonuses $addtok(%trova_bonuses,Lunghezza[4],43)
        set %trova_blline $puttok(%trova_blline,%trova_bonuses,4,46)
        write -l %z trovamanche.txt %trova_blline
      }
    }
    inc %z
  }
  trova_bonusorig
} 

alias trova_bonusorig {
  set %z 1
  while (%z <= $lines(trovamanche.txt)) {
    set %trova_rfwf 0
    set %q 1
    set %trova_borefline $read -l %z trovamanche.txt
    set %trova_borefword $gettok(%trova_borefline,2,46)
    while (%q <= $lines(trovamanche.txt)) && (%trova_rfwf == 0) {
      set %trova_boline $read -l %q trovamanche.txt
      set %trova_boword $gettok(%trova_boline,2,46)
      if (%trova_borefword == %trova_boword) && (%z != %q) { set %trova_rfwf 1 }
      inc %q
    }
    if (%trova_rfwf == 0) {
      set %trova_bonuses $gettok(%trova_borefline,4,46)
      if (%trova_bonuses == -) { set %trova_borefline $puttok(%trova_borefline,OriginalitΓ [3],4,46) | write -l %z trovamanche.txt %trova_borefline }
      else { 
        set %trova_bonuses $addtok(%trova_bonuses,OriginalitΓ [3],43)
        set %trova_borefline $puttok(%trova_borefline,%trova_bonuses,4,46)
        write -l %z trovamanche.txt %trova_borefline
      }
    }
    inc %z
  }
  trova_attrbonus
}

alias trova_attrbonus {
  set %z 1
  while (%z <= $lines(trovamanche.txt)) {
    set %trova_baline $read -l %z trovamanche.txt
    set %trova_bapts  $gettok(%trova_baline,3,46)
    set %trova_babonu $gettok(%trova_baline,4,46)
    if ( $istok(%trova_babonu,VelocitΓ [2],43) == $true ) { inc %trova_bapts 2 }
    if ( $istok(%trova_babonu,Lunghezza[4],43) == $true ) { inc %trova_bapts 4 }
    if ( $istok(%trova_babonu,OriginalitΓ [3],43) == $true ) { inc %trova_bapts 3 }
    if ( $istok(%trova_babonu,LetteraIniziale,43) == $true ) { inc %trova_bapts %trova_bpoints }
    set %trova_baline $puttok(%trova_baline,%trova_bapts,3,46)
    write -l %z trovamanche.txt %trova_baline
    inc %z
  }
  trova_agg_class
}

alias trova_agg_class {
  set %z 1
  while (%z <= $lines(trovamanche.txt)) {
    set %trova_clline $read -l %z trovamanche.txt
    set %trova_clnick $gettok(%trova_clline,1,46)
    set %trova_manchepts $gettok(%trova_clline,3,46)
    trova_search %trova_clnick
    if (%trovato == 0) {
      set %trova_input %trova_clnick
      set %trova_input $addtok(%trova_clnick,%trova_manchepts,46)
      write sillclass.txt %trova_input
    }  
    if (%trovato == 1) {
      set %trova_input $read -l %pos sillclass.txt
      set %trova_oldpts $gettok(%trova_input,2,46)
      inc %trova_oldpts %trova_manchepts
      set %trova_input $puttok(%trova_input,%trova_oldpts,2,46)
      write -l %pos sillclass.txt %trova_input
    }
    inc %z
  }
  trova_ordina
}

alias trova_resmsg {
  if ($lines(trovamanche.txt) == $null ) || ($lines(trovamanche.txt) == 0) && (%trova_fatto == 0) { msg %trova_canale 11,2 <- nessuna parola trovata -> Una parola che conteneva la trova era 8,2 %trova_extr | set %trova_fatto 1 }
  if (%trova_timercount <= $lines(trovamanche.txt)) {
    set %linez $read -l %trova_timercount trovamanche.txt
    set %nick $gettok(%linez,1,46)
    set %word $gettok(%linez,2,46)
    set %wscore $gettok(%linez,3,46)
    set %bonuses $gettok(%linez,4,46)
    msg %trova_canale 11,2  Complimenti 4 %nick 11Con La Parola 4 %word 11 Totalizzi 4 %wscore 11Punti 4 %bonuses 
  }
  if (%trova_timercount == $calc($lines(trovamanche.txt) + 1)) { .timerpreclass 1 5 trova_prepreclass }
  inc %trova_timercount
}

alias trova_prepreclass {
  if $exists(trovamanche.txt) {
    set %trova_pnrline $read -l $lines(trovamanche.txt) trovamanche.txt
    set %trova_pnrecord $gettok(%trova_pnrline,3,46)
    set %trova_pnrkeeper $gettok(%trova_pnrline,1,46)
    if (%trova_pnrecord > %trova_record) && (%trova_mad == 0) {
      msg %trova_canale 11,2Nuovo Record 4 %trova_pnrecord 11Di Punti In Una Manche. Il Precedente 4 %trova_record 11Apparteneva a 4 %trova_reckeeper 
      set %trova_record %trova_pnrecord
      set %trova_reckeeper %trova_pnrkeeper
      set %trova_pnrline %trova_reckeeper $+ $chr(35) $+ %trova_record
      write -l 11 trovaRecord.txt %trova_pnrline
    }
    .remove trovamanche.txt
  }
  .timerclass 1 5 trova_preclass
}

alias trova_preclass {
  set %timercounter 1
  .timerclass 8 2 trova_msgclass
}

alias trova_msgclass {
  if (%timercounter == 1) { msg %trova_canale 11,2 Ecco La 4 CLASSIFICA 11Dopo la 4 %trova_manchenum Βͺ 11Manche: }
  if (%timercounter == 2) { 
    set %trova_1line $read -l1 sillclass.txt
    set %trova_1nick $gettok(%trova_1line,1,46)
    set %trova_1pts  $gettok(%trova_1line,2,46)
    if (%trova_1pts == $null) { set %trova_1pts - }
    msg %trova_canale 9,2 1Β° 11Posto CoN: 9 β€”]4 %trova_1pts 9[β€” 11Punti 4 %trova_1nick 
  }
  if (%timercounter == 3) {
    set %trova_2line $read -l2 sillclass.txt
    set %trova_2nick $gettok(%trova_2line,1,46)
    set %trova_2pts  $gettok(%trova_2line,2,46)
    if (%trova_2pts == $null) { set %trova_2pts - }
    msg %trova_canale 9,2 2Β° 11Posto CoN: 9 β€”]4 %trova_2pts 9[β€” 11Punti 4 %trova_2nick 
  }
  if (%timercounter == 4) {
    set %trova_3line $read -l3 sillclass.txt
    set %trova_3nick $gettok(%trova_3line,1,46)
    set %trova_3pts  $gettok(%trova_3line,2,46)
    if (%trova_3pts == $null) { set %trova_3pts - }
    msg %trova_canale 9,2 3Β° 11Posto CoN: 9 β€”]4 %trova_3pts 9[β€” 11Punti 4 %trova_3nick 
  }
  if (%timercounter == 5) {
    set %trova_4line $read -l4 sillclass.txt
    set %trova_4nick $gettok(%trova_4line,1,46)
    set %trova_4pts  $gettok(%trova_4line,2,46)
    if (%trova_4pts == $null) { set %trova_4pts - }
    msg %trova_canale 9,2 4Β° 11Posto CoN: 9 β€”]4 %trova_4pts 9[β€” 11Punti 4 %trova_4nick 
  }
  if (%timercounter == 6) {
    set %trova_5line $read -l5 sillclass.txt
    set %trova_5nick $gettok(%trova_5line,1,46)
    set %trova_5pts  $gettok(%trova_5line,2,46)
    if (%trova_5pts == $null) { set %trova_5pts - }
    msg %trova_canale 9,2 5Β° 11Posto CoN: 9 β€”]4 %trova_5pts 9[β€” 11Punti 4 %trova_5nick 
  }
  if (%timercounter == 7) {
    set %trova_6line $read -l6 sillclass.txt
    set %trova_6nick $gettok(%trova_6line,1,46)
    set %trova_6pts  $gettok(%trova_6line,2,46)
    if (%trova_6pts == $null) { set %trova_6pts - }
    msg %trova_canale 9,2 6Β° 11Posto CoN: 9 β€”]4 %trova_6pts 9[β€” 11Punti 4 %trova_6nick 
  }
  if (%timercounter == 8) {
    set %trova_7line $read -l7 sillclass.txt
    set %trova_7nick $gettok(%trova_7line,1,46)
    set %trova_7pts  $gettok(%trova_7line,2,46)
    if (%trova_7pts == $null) { set %trova_7pts - }
    msg %trova_canale 9,2 7Β° 11Posto CoN: 9 β€”]4 %trova_7pts 9[β€” 11Punti 4 %trova_7nick 
  }
  if (%timercounter == 8) { .timerhub 1 %trova_pausetime trova_hub }
  inc %timercounter
}

alias trova_hub {
  if ( (( %trova_1pts > %trova_2pts ) && ( %trova_1pts >= %trova_target )) || (!($exists(sillclass.txt)) && (%trova_target == -1)) ) { trova_endofgame }
  else { if (%gametrova_stato == ON) { msg %trova_canale            11,2 β€”] Attenzione! 11Sta Per Partire La Prossima Manche [β€” | .timernew 1 5 trova_start_manche | set %trova_hub ON } }
}


menu channel,menubar {
  -
  Giochi
  .Trova
  ..Avvia:trova_start
  ..Dialog ON:dialog -m trovaGame trovaGame
  ..Dialog OFF:dialog -x trovaGame trovaGame
  ..Pausa/riprendi:trova_pause
  ..End of game:trova_end_query
  ..Istruzioni:trova_instr
  -
}

dialog trovaGame {
  title "trova Game by PanToufLe"
  size -1 -1 240 288
  icon $mircdirskin\1.ico, 0
  box "trova Game Commands Console", 500, 1 1 240 135, autohs
  button "Start Game", 501, 1 16 240 30, autohs
  button "Pausa/Riprendi", 502, 1 46 240 30, autohs
  button "Dai istruzioni", 503, 1  76 240 30, autohs
  button "End-Of-Game", 504, 1 106 240 30, autohs
  box "Regola tempi di gioco", 510, 1 136 240 120, autohs 
  text "Aumenta/decrementa di 10 secondi la durata di ogni manche", 511, 65 160 105 40, autohs
  button "+10", 512, 5  160 50 30, autohs
  button "-10", 513, 186 160 50 30, autohs
  text "Aumenta/decrementa di 5 secondi l'attesa tra 2 manches", 514, 65 210 105 40, autohs
  button "+5", 515, 5  210 50 30, autohs
  button "-5", 516, 186 210 50 30, autohs
  button "Chiudi questa finestra", 517, 1 255 240 30, ok
} 

on 1:dialog:trovaGame:sclick:501: { if (%trova_manchenum == 0) && (%trova_hub != ON) { trova_hub } }

on 1:dialog:trovaGame:sclick:502: { trova_pause }

on 1:dialog:trovaGame:sclick:503: { trova_instr }

on 1:dialog:trovaGame:sclick:504: { trova_end_query }

on 1:dialog:trovaGame:sclick:513: {
  if (%gametrova_stato != OFF) {
    if (%trova_durata < 50) { echo -a 4,2 Non puoi scendere sotto i 40 secondi }
    else {
      dec %trova_durata 10
      msg %trova_canale 8,2 Il tempo a disposizione per ogni manche Γ¨ ora di 4,2 %trova_durata 8,2 secondi
    }
  }
}

on 1:dialog:trovaGame:sclick:512: {
  if (%gametrova_stato != OFF) {
    inc %trova_durata 10
    msg %trova_canale 8,2 Il tempo a disposizione per ogni manche Γ¨ ora di 4,2 %trova_durata 8,2 secondi
  }
}


on 1:dialog:trovaGame:sclick:516: {
  if (%gametrova_stato != OFF) {
    if (%trova_pausetime < 15) { echo -a 4,2 Non puoi scendere sotto i 10 secondi }
    else {
      dec %trova_pausetime 5
      msg %trova_canale 8,2 L'attesa tra due manche Γ¨ ora di 4,2 %trova_pausetime 8,2 secondi
    }
  }
}

on 1:dialog:trovaGame:sclick:515: {
  if (%gametrova_stato != OFF) {
    inc %trova_pausetime 5
    msg %trova_canale 8,2 L'attesa tra due manche Γ¨ ora di 4,2 %trova_pausetime 8,2 secondi
  }
}

on 1:text:!trovam-10*:#: {
  if (%gametrova_stato != OFF) && ($2 == %game_password) && (%trova_target < 500) {
    if (%trova_durata < 50) { .msg $nick Non puoi scendere sotto i 40 secondi }
    else {
      dec %trova_durata 10
      msg %trova_canale Il tempo a disposizione per ogni manche Γ¨ ora di %trova_durata secondi
    }
  }
}

on 1:text:!trovam+10*:#: {
  if (%gametrova_stato != OFF) && ($2 == %game_password) && (%trova_target < 500) {
    inc %trova_durata 10
    msg %trova_canale Il tempo a disposizione per ogni manche Γ¨ ora di %trova_durata secondi
  }
}

on 1:text:!trovap-5*:#:{
  if (%gametrova_stato != OFF) && ($2 == %game_password) {
    if (%trova_pausetime < 15) { .msg $nick Non puoi scendere sotto i 10 secondi }
    else {
      dec %trova_pausetime 5
      msg %trova_canale L'attesa tra due manche Γ¨ ora di %trova_pausetime secondi
    }
  }
}

on 1:text:!trovap+5*:#:{
  if (%gametrova_stato != OFF)  && ($2 == %game_password) {
    inc %trova_pausetime 5
    msg %trova_canale L'attesa tra due manche Γ¨ ora di %trova_pausetime secondi
  }
}

on 1:text:!trovatarget*:#:{
  if (%gametrova_stato != OFF)  && ($3 == %game_password) && ($2 > 0) {
    set %trova_target $2
    msg %trova_canale 8,2 Il punteggio da raggiungere ora Γ¨:11,2 %trova_target
  }
}

on 1:text:!trovaHs:%game_channel:{
  set %i 1
  unset %hs
  while (%i <= 10) {
    set %line $read -l %i trovarecord.txt
    set %nick $gettok(%line,1,35)
    set %pts $gettok(%line,2,35)
    if $calc(%i % 2) { set %line 8,2 %Pts $+ 8,2 %nick }  
    else { set %line 11,2 %Pts $+ 11,2 %nick }
    set %hs %hs $+ 4,2 β€’Β·β€’ $+ %line
    inc %i
  }
  set %line $read -l 11 trovarecord.txt
  set %nick $gettok(%line,1,35)
  set %pts $gettok(%line,2,35)
  msg %game_channel 9,2 ©º°¨8,2 trova High Scores9,2 ¨°º©
  msg %game_channel 4,2 Record punti in una manche:8,2 %nick 4,2 $+ (8,2 %pts  4,2)
  msg %game_channel 4,2 Top Ten media punti: %hs
}


alias trovalogo { return 11,2[ .4T15.0r8 ]7 O 8[ 15.4V11.a ] 9-->11 }