triv break in trivbot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

triv break in trivbot

Started by slick, 30 August, 2005, 01:33:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

slick

hello it's me again  :D ummm i'm running a trivbot Trivia Ex V 0.645 by chilla problem i'm having with it is it won't take a break when it should. If i set it to run for 2 mins it works i set it for over 2 it just keeps running



Max1 = 30         -- How many questions are loaded into Memory

Max7 = 10         -- Trivia Break Time in minutes
Max4 = 30         -- Time in minutes till Trivia Break

Trivbreak = 1         -- 1 = do a triviabreak between Max4 Minutes., 2 == no triviabreak

--------------------------------------------

Max2 = 15         -- Time between each hint in seconds

--------------------------------------------

Max3 = 100         -- The number of trivia scores shown
Max9 = 100         -- Number of top trivias shown

Max5 = 10         -- Time in minutes between each score and player saving
--------------------------------------------

Max6 = 1         -- Stands for how many chars are rvealed per hint.
Max8 = 20         -- Stands for how many Hints are displayed. This overruns Max6 (May not be totally accurate)
Max10 = 1         -- The Question will be solved when there are only Max10 hints left

------------------------------------------------------------------------

function OnTimer()
   foreachi(trivtimerset, function(i,_) trivtimerset = trivtimerset + 1 end)
   if (trivtimerset[2] == tTrivBreak) then
      trivtimerset[2] = 0
      if (Trivbreak == 1) and (curTriv.GetQues == 1) then
         curTriv.GetQues = 3
         tTrivBreak = Max7
         SendDataMP("Short Trivia break for "..(Max7/60).." min.")
      elseif (Trivbreak == 1) and (curTriv.GetQues == 3) then
         curTriv.GetQues = 1
         tTrivBreak = Max4
      end
   end
   if trivtimerset[1] == Max2 then
      trivtimerset[1] = 0
      if (curTriv.GetQues == 1) then
         if getn(tTrivQuestions) == 0 then

            GetQuestions(Max1)

         end

         curTriv.curNum = tTrivQuestions[1][4]

         curTriv.curCat = tTrivQuestions[1][1]

         curTriv.curQues = tTrivQuestions[1][2]

         curTriv.curAnswer = tTrivQuestions[1][3]
         curTriv.curAvailAnswers = getn(curTriv.curAnswer)

         tremove(tTrivQuestions,1)
         curTriv.Points = 0
         UnRevealed = {}
         curTriv.curHint = gsub(curTriv.curAnswer[1],"(%S)",function (w)  curTriv.Points = curTriv.Points + 1 return(RevealChar) end)
         if TriviaConfig.TrivShowHint == 2 then
            if ((curTriv.Points/Max8 - floor(curTriv.Points/Max8)) >= 0.5) then
               curTriv.RevealHowMany = floor(curTriv.Points/Max8) + 1
            elseif (floor(curTriv.Points/Max8) == 0) then
               curTriv.RevealHowMany = 1
            else
               curTriv.RevealHowMany = floor(curTriv.Points/Max8)
            end
         else
            curTriv.RevealHowMany = Max6
         end

         SendQuestion(curTriv.curCat,curTriv.curQues,curTriv.curHint,curTriv.Points,curTriv.curNum,curTriv.QuestionsTotal,curTriv.curAvailAnswers)
         curTriv.curstart = clock()

         curTriv.GetQues = 0
      elseif (curTriv.GetQues == 0) then
         curTriv.curHint = RevealChars(curTriv.curAnswer[1],curTriv.curHint)

         if curTriv.curAnswer[1] ~= curTriv.curHint then

            SendQuestion(curTriv.curCat,curTriv.curQues,curTriv.curHint,curTriv.Points,curTriv.curNum,curTriv.QuestionsTotal,curTriv.curAvailAnswers)

         else
            SendDataMP("The right answer was:  "..curTriv.curHint)
            if curTriv.curAvailAnswers > 1 then
               local msg = ""
               for i = 2,getn(curTriv.curAnswer) do
                  msg = msg..curTriv.curAnswer..", "
               end
               SendDataMP("Other answers were: "..msg)
            end
            curTriv.GetQues,curTriv.curAnswer = 1,nil
            if curTriv.curStreak.curStreak >= 3 then
               SendDataMP("There goes "..curTriv.curStreak.curNick.."'s streak of  "..curTriv.curStreak.curStreak)
            end
            curTriv.curStreak.curNick,curTriv.curStreak.curStreak,curTriv.curStreak.set = "",0,0

         end
      end
   end

   if trivtimerset[3] >= Max5 then

      trivtimerset[3] = 0

      WriteTable(Scores, "Scores", "Scores.txt")

   end

end






I believe these are the 2 sections that effect this hope somebody can help :)

SMF spam blocked by CleanTalk