Jump to content
chain

Dutch trivia game with random topic

Recommended Posts

  • Administrators
On *:load: { 
  /echo  5*** made by Baloe12nl ***
  /echo 12.Trivial persuitgame whit topic
  /echo 12.For help type !trivia help 
  if ( $readini(trivia/higescore.ini, n, 1, highescore) == $null ) {
    /writeini trivia/highscore.ini 1 name naam | /writeini trivia/highscore.ini 1 highscore 1
    /writeini trivia/highscore.ini 2 name naam | /writeini trivia/highscore.ini 2 highscore 1
    /writeini trivia/highscore.ini 3 name naam | /writeini trivia/highscore.ini 3 highscore 1
    /writeini trivia/highscore.ini 4 name naam | /writeini trivia/highscore.ini 4 highscore 1
    /writeini trivia/highscore.ini 5 name naam | /writeini trivia/highscore.ini 5 highscore 1
    /echo 12.Trivial Persuitgame highscore.ini is loaded.
    /echo 4.Notice 12By reload this script you will delete the top 5 highscore.
  }
  else /halt
}

on 9:TEXT:*trivia*:*: {
  if ($1 == !trivia) {
    if ($2 == on) { /enable #Otrivia | /disable #Atrivia | /msg $chan 5The trivia game is on, | set %st.trivia on | set %last.used.command.trivia on | set %last.persons.trivia $nick | halt }
    if ($2 == off) { /disable #Otrivia | /enable #Atrivia | /msg $chan 5The trivia game Is off. | unset %st.trivia | set %last.used.command.trivia off | set %last.persons.trivia $nick | /unset %Quest | /unset %trivQ | halt }
    else { /notice $nick 5Incorrect command usage: !trivia <on/off/help> | halt }
  }
  else /halt
}
on *:TEXT:*trivia*:*: {
  if ($1 == !trivia) {
    if ($2 == help) { 
      /notice $nick 5 ** al trivia comands **
      /notice $nick 5< 10!trivia help 5> Get help Trivia comando's.
      /notice $nick 5< 10!trivia on 5> Enable the trivia game. Disable trivia add questions.  OP. only.
      /notice $nick 5< 10!trivia off 5> Disable the trivia game. Enable trivia add questions.  OP. only.
      /notice $nick .
      /notice $nick 5 ** if trivia is enable **
      /notice $nick 5..< 10!TrivQ 5> Start / next question trivia game.
      /notice $nick 5..< 10!trivA 5> Answer the question. 
      /notice $nick 5..< 10!hint 5> asc a hint.
      /notice $nick 5..< 10!triv-score 5> Top 5 highscore   
      /notice $nick .
      /notice $nick 5 ** if trivia is disabled en add questions enabled ** OP. only.
      /notice $nick 5..< 10!triv-ad 5> Discription to ad a question whit topic start.
      /notice $nick 5..< 10!triv-antt 5> If question is done file in anwser.
      /notice $nick 5..< 10!triv-hint 5> If anwser is done fil in a hint.
      /notice $nick .
    }
  }
  else /halt
}

#Otrivia on

; part to close trivia after last man is out of the chat

on *:PART:#: {
  if ( % [ $+ [ $nick ] ] != $null ) { 
    /msg $chan 5 $nick heeft de Trivial Persuite game verlaten met % [ $+ [ $nick ] ] Goed (e) antwoord (en).
    /timer0 1 3 /unset % $+ $nick
    if ( [ $nick(#FRS-chat,0) ] == 2 ) { /disable #Otrivia | /enable #Atrivia | /msg $chan 5The trivia game Is off. | unset %st.trivia | set %last.used.command.trivia off | set %last.persons.trivia $nick | /unset %Quest | /unset %trivQ | /timer7 off | halt }
  }
  else { /msg $chan $nick heeft de $chan verlaten 
    if ( [ $nick(#FRS-chat,0) ] == 2 ) { /disable #Otrivia | /enable #Atrivia | /msg $chan 5The trivia game Is off. | unset %st.trivia | set %last.used.command.trivia off | set %last.persons.trivia $nick | /unset %Quest | /unset %trivQ | /timer7 off | halt }
  }
}

;read a questin of teh random ini

on *:text:*:#: {
  if ( $1 == !trivQ ) {
    /set %trivQ on
    if ( %Quest == $null ) /set %Quest 0
    if ( %trivQ == on ) /TrivaPursuit
  }

  ;anwser the question.

  if ( $1 == !trivA ) {
    /echo $readini( $+ trivia/ $+ %topic $+ .ini, n, %Qtrivia.rand $+ , Antwoord)
    if ( $2- isin $readini( $+ trivia/ $+ %topic $+ .ini, n, %Qtrivia.rand $+ , Antwoord) ) {
      if ( % $+ $nick == $null) {
        /var % $+ $nick=1
        /msg # 5.
        /msg # 5 $nick heeft voor de % [ $+ [ $nick ] ] $+ e X een vraag goed beantwoord.
        /msg # 5.
        /set %trivQ on
        /unset %HighNr | /set %HighNr 1 |
        /score
      }
      else {                                                                               
        /inc % $+ $nick 1
        /msg # 5.
        /msg # 5 $nick heeft voor de % [ $+ [ $nick ] ] $+ e X een vraag goed beantwoord.
        /msg # 5.
        /set %trivQ on
        /unset %HighNr | /set %HighNr 1
        /score
      }
    }
    if ( $2- !isin $readini( $+ trivia/ $+ %topic $+ .ini, n, %Qtrivia.rand $+ , Antwoord) ) {
      /msg # 5.
      /msg # 5 $nick $+ , Je hebt een fout antwoord gegeven.
      /msg # 5.
    }
    if ( $2 == $null ) /msg # 5De juiste manier om een vraag te beantwoordden is10 !trivA < antwoord van de vraag >
    if ( %trivQ == on ) /TrivaPursuit
    if ( $1 == !hint ) {
      /msg # 5Er wordt een hint laten zien in 3 sec.
      /timer9 1 3 /msg # 5 $readini( $+ trivia/ $+ %topic $+ .ini, n, %Qtrivia.rand $+ , Hint ) 
    }
  }

  ;highscore top 5

  If ( $1 == !triv-score ) {
    /msg # 5*** HIGHSCORE TRIVIAL PERSUIT GAME ***
    /msg # 5************* Top 5 ****************
    /msg # 7 1E 5plaats: $readini(trivia/highscore.ini, 1, name) met $readini(trivia/highscore.ini, 1, higescore) punten
    /msg # 4 2E 5plaats: $readini(trivia/highscore.ini, 2, name) met $readini(trivia/highscore.ini, 2, higescore) punten
    /msg # 12 3E 5plaats: $readini(trivia/highscore.ini, 3, name) met $readini(trivia/highscore.ini, 3, higescore) punten
    /msg # 13 4E 5plaats: $readini(trivia/highscore.ini, 4, name) met $readini(trivia/highscore.ini, 4, higescore) punten
    /msg # 9 5E 5plaats: $readini(trivia/highscore.ini, 5, name) met $readini(trivia/highscore.ini, 5, higescore) punten
  }
  else /halt
}

;alias to write the top 5 highscore to ini

alias /score {
  :1A
  if ( $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) != $null ) {
    if ( % [ $+ [ $nick ] ] < $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ) { /inc %HighNr 1 | goto 1A }
    if ( % [ $+ [ $nick ] ] > $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ) {
      if ( $nick == $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ) /writeini trivia/highscore.ini %HighNr highscore % [ $+ [ $nick ] ]
      else {
        /var %1name= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ] | /var %1highscore= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ]
        /writeini trivia/highscore.ini [ %HighNr ] name $nick | /writeini trivia/highscore.ini [ %HighNr ] highscore % [ $+ [ $nick ] ]
        /inc %HighNr
        if ( $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) != $null ) {
          if ( %1higescore >= $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ) {
            /var %2name= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ] | /var %2highscore= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , higescore) ]
            if ( %1name == $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ) {
              /writeini trivia/highscore.ini [ %HighNr ] higescore %1highscore | /unset %1*
            }
            else {
              /writeini trivia/highscore.ini [ %HighNr ] name [ %1name ] | /writeini trivia/highscore.ini [ %HighNr ] highscore [ %1highscore ] | /unset %1* | /inc %HighNr
              if ( $readini(trivia/higescore.ini, [ %HighNr ] $+ , higescore) != $null ) {
                if ( %2higescore >= $readini(trivia/highscore.ini, [ %HighNr ] $+ , higescore) ) {
                  /var %1name= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ] | /var %1highscore= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ]
                  if ( %2name == $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ) {
                    /writeini trivia/highscore.ini [ %HighNr ] higescore %2highscore | /unset %2*
                  }
                  else {
                    /writeini trivia/highscore.ini [ %HighNr ] name [ %2name ] | /writeini trivia/highscore.ini [ %HighNr ] highscore [ %2highscore ] | /unset %2* | /inc %HighNr
                    if ( $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) != $null ) {
                      if ( %1highscore >= $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ) {
                        /var %2name= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ] | /var %2highscore= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ]
                        if ( %1name == $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ) { 
                          /writeini trivia/highscore.ini [ %HighNr ] higescore %1highscore | /unset %1*
                        }
                        else {
                          /writeini trivia/highscore.ini [ %HighNr ] name [ %1name ] | /writeini trivia/highscore.ini [ %HighNr ] higescore [ %1highscore ] | /unset %1* | /inc %HighNr
                          if ( $readini(trivia/highscore.ini, [ %HighNr ] $+ , higescore) != $null ) {
                            if ( %2higescore >= $readini(trivia/higescore.ini, [ %HighNr ] $+ , highscore) ) {
                              /var %1name= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ] | /var %1highscore= $+ [ $readini(trivia/highscore.ini, [ %HighNr ] $+ , highscore) ]
                              if ( %2name == $readini(trivia/highscore.ini, [ %HighNr ] $+ , name) ) { 
                                /writeini trivia/higescore.ini [ %HighNr ] highscore %2highscore | /unset %2*
                                else {
                                  /writeini trivia/highscore.ini [ %HighNr ] name [ %2name ] | /writeini trivia/highscore.ini [ %HighNr ] highscore [ %2highscore ]
                                  /unset %2* | /unset %1*
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

;alis to read the naxt question

alias /TrivaPursuit {
  if ( %trivQ == on ) {
    /unset %trivQ
    /inc %QuesT 1
    /set %trivia.rand $rand(1, 6)
    /set %Qtrivia.rand $rand(1, [ %Tnr ] )
    if ( %trivia.rand == 1) /set %topic Aarderijkskunde
    if ( %trivia.rand == 2) /set %topic Vermaak
    if ( %trivia.rand == 3) /set %topic Geschiedenis
    if ( %trivia.rand == 4) /set %topic Kunst.en.Literatuur
    if ( %trivia.rand == 5) /set %topic Wetenschap.en.Natuur
    if ( %trivia.rand == 6) /set %topic Sport.en.Ontspanning
    /msg # 5The %Quest $+ th question is in 3 sec.
    /timer1 1 3 /msg # 5.
    /timer2 1 3 /msg # 5Het onderwerp is: 10 %topic
    /timer3 1 3 /msg # 5The %QuesT $+ th queastion:10 $readini( $+ trivia/ $+ %topic $+ .ini, n, %Qtrivia.rand $+ , vraag)
    /timer4 1 3 /msg # 5.
    /timer5 1 3 /msg # 5Geef het antwoord door nu !trivA <antwoord> te typen.
    /timer6 1 33 /msg # 5Er wordt een hint laten zien in 3 sec.
    /timer7 1 36 /msg # 5 $readini( $+ trivia/ $+ %topic $+ .ini, n, %Qtrivia.rand $+ , Hint) 
  }
}

#Otrivia end 

#Atrivia off

;ad new question to a topic

on 9:text:*:#: {
  if ( $1 == !triv-ad ) {
    if ( %TNr == $null ) { /set %TNr 1 }
    /notice $nick 5 .
    /notice $nick 5 Je staat op het punt een vraag aan het bestand toe te voegen.
    /notice $nick 5 dit doe je als volgt, typ: een categorie < spatie > De vraag.
    /notice $nick 5 .
    /notice $nick 5 !A == 10Aarderijkskunde
    /notice $nick 5 !V == 10Vermaak
    /notice $nick 5 !G == 10Geschiedenis
    /notice $nick 5 !KL == 10Kunst en Literatuur
    /notice $nick 5 !WN == 10Wetenschap en Natuur
    /notice $nick 5 !SO == 10Sport en Ontspanning
    /notice $nick .
    /notice $nick 5Typ nu je categorie < VB: 10!A 5> en vraag, druk op enter.
    /notice $nick 5 .
  }
  if ( $1 == !A ) {
    /set %topic Aarderijkskunde                                                                       
    If ( %ANr == $null ) { /set %ANr 1 }
    else { 
      /inc %ANr 1 
      if ( %ANr > %TNr ) { /set %TNr %ANr }
    }
    /set %temp1 on
    /set %linkV2 %ANr
    goto 2
  }
  if ( $1 == !V ) {
    /set %topic Vermaak                                                                      
    If ( %VNr == $null ) { /set %VNr 1 }
    else { 
      /inc %VNr 1 
      if ( %VNr > %TNr ) { /set %TNr %VNr }
    }
    /set %temp1 on
    /set %linkV2 %VNr
    goto 2
  }
  if ( $1 == !G ) {
    /set %topic Geschiedenis                                                                      
    If ( %GNr == $null ) { /set %GNr 1 }
    else { 
      /inc %GNr 1 
      if ( %GNr > %TNr ) { /set %TNr %GNr }
    }
    /set %temp1 on
    /set %linkV2 %GNr
    goto 2
  }
  if ( $1 == !KL ) {
    /set %topic Kunst.en.Literatuur                                                                      
    If ( %KLNr == $null ) { /set %KLNr 1 }
    else { 
      /inc %KLNr 1 
      if ( %KLNr > %TNr ) { /set %TNr %KLNr }
    }
    /set %temp1 on
    /set %linkV2 %KLNr
    goto 2
  }
  if ( $1 == !WN ) {
    /set %topic Wetenschap.en.Natuur                                                                      
    If ( %WNNr == $null ) { /set %WNNr 1 }
    else { 
      /inc %WNNr 1 
      if ( %WNNr > %TNr ) { /set %TNr %WNNr }
    }
    /set %temp1 on
    /set %linkV2 %WNNr
    goto 2
  }
  if ( $1 == !SO ) {
    /set %topic Sport.en.Ontspanning                                                                      
    If ( %SONr == $null ) { /set %SONr 1 }
    else { 
      /inc %SONr 1 
      if ( %SONr > %TNr ) { /set %TNr %SONr }
    }
    /set %temp1 on
    /set %linkV2 %SONr
    goto 2
  }
  :2
  If ( %temp1 == on ) {  
    /writeini -n trivia/ $+ [ %topic ] $+ .ini %linkV2 vraag $2- 
    /load -rs trivia/ $+ [ %topic ] $+ .ini
    /unset %temp1 
    /set %temp2 on
    /notice $nick 5Typ nu het antwoord < VB: 10!antt het antwoord op de vraag5 > op de vraag in de categerie %topic $+ .
  }

  ;at anwser to the question

  If ( %temp2 == on ) {
    if ( $1 == !triv-antt ) {
      /writeini -n trivia/ $+ [ %topic ] $+ .ini %linkV2 Antwoord $2- 
      /load -rs trivia/ $+ [ %topic ] $+ .ini
      /notice $nick 5Typ nu een hint < VB: 10!hint het antwoord op de vraag met een paar letters ( N** )5 > op de vraag in de categerie %topic $+ .
      /unset %temp2
      /set %temp3 on
    }
  }
  ;at a hint to the question
  if ( %temp3 == on ) {
    if ( $1 == !triv-hint ) {
      /writeini -n trivia/ $+ [ %topic ] $+ .ini %linkV2 Hint $2- 
      /load -rs trivia/ $+ [ %topic ] $+ .ini
      /notice $nick 5De vraag, antwoord en hint zijn ingevuld in de categerie %topic $+ .
      /unset %temp3
      /unset %topic
      /unset %linkV2
    }
  }
}

#Atrivia end

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...