Games for PtokaX
 

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

Games for PtokaX

Started by NemeziS, 14 November, 2004, 16:45:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NemeziS

Hello everybody!
[12:19]  Answer was: confusion
[12:19]  Answer was solved by: SuRfer
[12:19]  Next question in 30 (?15) Secs
[12:19]  SuRfer points: 44
I saw a game like that on one of  foreign hubs. Bot asks a question and gives a hint.

Anybody knows what  game is that? And where can I get some more cool games for my hub?

--LUA forever! =)

zinden

Try this one

Xsthetic-Netserver

It got triva and anagram and something else if i remember right.
So that script got 2 or more games.
Xion++ - Where it all begins
http://www.zinden.net

NemeziS

I don't like multi scripts at all. Thanx! :(
--LUA forever! =)

((UKSN))shad_dow

looks like trivia to me and if u search ur find alot more games all so Xsthetic-Netserver
got more games than any bot i know :)

yours

shad
creator of Therapy-X? bot

LiqUiD~TrolL

hello nemezisss well my firend here

take this address there are some game scripts
you can find some in there


http://ptokax.times.lv/scripts.html
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

UwV

#5
nice ones here too ..
-=-=-= link =-=-=-  

 8)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

jackthebest

#6
Try this fight - game bot meded by me...
at the moment it is in Italian only...
i will traslete it....


jackthebest

??????Hawk??????



NemeziS

#9
Hi, ((UKSN))shad_dow !

You was right! It is TriviaBot!

But I have some questions. I've found Trivia at ptokax.times.lv and I'm already using it.

1)  It works fine, but I decided to make a function that will end the game if nobody plays it for a long time (2 or more unsolved questions and no activity). You can download Trivia from  here

2) I also have another game - JumbleWords. So I wanted to prevent starting both of games. For example If Trivia is running and somebody writes !start  (this is my Jumble start cmd) he will get a message like this:

"You can't run JumbleWords while Trivia is active".

This is my peace of script in  "function DataArrival(curUser, data)":
 local _, _, firstWord = strfind(data, "%b<>%s+(%S+)")
 
  if (firstWord ~= nil) then
	if (((strlower(firstWord) == "!start")) and (lngWord ~= 0)) then 
	   curUser:SendData(BotName, "You can't run JumbleWords while Trivia is active!") 
	   return 1
	end
  end

It works good.

BUT If JumbleWords is running and I'm writing !tbstart  then Trivia game STARTS!!! :(

My jumblewords file is named "Jumble.lua" and Trivia is named "Trivia.lua". I understand that "Trivia.lua" is executed by PtokaX firstly. That's why this is not working in a way with Jumble-->Trivia.

Who can make this scripts for me? :((
--LUA forever! =)

??????Hawk??????

#10
hi m8  


try some of my early generation   esthetic bot's

triv  and jumble  were  in the very first  ..

you might have to try a couple of different vers to get the one your wanting.

download all but the latest bot  from here


read about the earlier vers

Here

And Here


failing that you could just use the latest Xsthetic Netserver and Disable all the options you dont want.

Quote2) I also have another game - JumbleWords. So I wanted to prevent starting both of games. For example If Trivia is running and somebody writes !start (this is my Jumble start cmd) he will get a message like this:

You say you dont like multi scripts
so the only way i can see you being able to do this is by having Each script generate or write to an external file and have them both read it on game start.

Good Luck  :-)


??????Hawk??????

NemeziS

QuoteOriginally posted by ??????Hawk??????
...so the only way i can see you being able to do this is by having Each script generate or write to an external file and have them both read it on game start....

Hi, Hawk!

As I understood your idea, I wrote this peace of script for chering the games:

handle2=openfile("bothgamesprev.dat","r")

if (handle2) then
	line = read(handle2)
   if line == "JUMBLE_IS_RUNNING" then
	curUser:SendData(BotName, "You can't run Trivia game now, because Jumble game is already running!")
	return 1

   elseif line == "TRIVIA_IS_RUNNING" then
         curUser:SendData(BotName, "Trivia is already running!")
         return 1
   end

closefile(handle2)

else
          SendToAll(BotName, strStart)
          StopQuiz(1)
              local handle3=openfile("bothgamesprev.dat","a")
              write(handle3,"TRIVIA_IS_RUNNING")
              closefile(handle3)
end

and this peace of script for deleting the file at the game end  (Trivia):
       SaveScores()
        HoldQuiz()
        StopQuiz()
	remove("bothgamesprev.dat")
        SendToAll(BotName, strStopp)

But I have a problem! If the scripts in PtokaX is been restarted this file (bothgamesprev.dat) is not deleted at all!
If someone starts the game after all the scripts been restarted he gets a message "Trivia is already running!"

How can I make this file be deleted afret script restarts? Help me plzzz :(
--LUA forever! =)

nErBoS

Hi,

Put the remove() on the Main().

function Main()
   remove("bothgamesprev.dat")
end

Best regards, nErBoS
--## nErBoS Spot ##--

NemeziS

Thanx, nErBoS! Works perfectly! :)

But I found another bug! :((

Here is a log from main:

[15:59]  [B]!start[/B] 
[15:59]  NemeziS has [U]started a New Jumble[/U] game...
[15:59]  Word: u b s y  
[15:59]  [B]!tbstart[/B] 
[15:59]  You can't run Trivia game now, because Jumble game is already running!
[15:59]  [B]!stop[/B] 
[15:59]  The word was: busy
[15:59]  NemeziS [U]has stoped Jumble game[/U] ...
[15:59]  [B]!tbstart[/B] 
[15:59]  You can't run Trivia game now, because Jumble game is already running!

I don't understand anything! It seems like a bug in my script:
handle2=openfile("bothgamesprev.dat","r")

if (handle2) then
	line = read(handle2)
   if line == "JUMBLE_IS_RUNNING" then
	curUser:SendData(BotName, "You can't run Trivia game now, because Jumble game is already running!")
	return 1

   elseif line == "TRIVIA_IS_RUNNING" then
         curUser:SendData(BotName, "Trivia is already running!")
         return 1
   end

closefile(handle2)

else
          SendToAll(BotName, strStart)
          StopQuiz(1)
              local handle3=openfile("bothgamesprev.dat","a")
              write(handle3,"TRIVIA_IS_RUNNING")
              closefile(handle3)
end

Can someone help me?
--LUA forever! =)

NemeziS

--LUA forever! =)

nErBoS

#15
Hi,

Show us all your script, the problem isn't in the loading for what i can see.

Best regards, nErBoS
--## nErBoS Spot ##--

NemeziS

Ok, but the script is too long to be posted in here! I will divide it into 2 parts

Here is first part:

BotName = "Joker"
BotVersion = "Trivia game"

strTrivScoreFile = "txt/TrivScores.dat"
strDefTrivFile = "txt/Trivia.dat"
strTrivFile = strDefTrivFile
strQFile = "txt/TrivQuestions.dat"
folder = "txt"
strGSep = "*"
strCMask = "?"

lngMaxHints = 4
boolHintAlwaysHitHidden = nil

-- How much time before a question end. Time in Trivia is measured in 15 seconds, 1 = 15 seconds, 2 = 30 seconds etc!
-- Rest is how long to rest after a question is solved depening on when the word is solved in the Timer loop it is ?15 secs to the setting!
lngMaxTime = 8 -- (Needs to be a multiple of 4, ?.?. 4 / 8 / 12 / 16)
lngRestTime = 1
lngHintTime = lngMaxTime / 4
countSaveTurns = 1 -- After how many questions should the scores be saved
boolRevealAnswer = 1 -- (nil = off, 1 = on) Should bot reveal the correct answer once time is up?
boolAutoHint = 1 -- (nil = off, 1 = on) To allow bot show hints

StartTrigg = "!tbstart"
StopTrigg = "!tbstop"
WordTrigg = "!tbshowword"
QuizTrigg = "!tbshowquestion"
RestartTrigg = "!tbrestart"
PointTrigg = "!tbmyscores"
ScoreTrigg = "!tbscores"
ReloadTrigg = "!tbreload"
HelpTrigg = "!tbhelp"
ExtraHelpTrigg = "!tbhelp+"
SaveTrigg = "!tbsavescores"
LoadTrigg = "!tbloadscores"
HintTrigg = "!tbhintme"
TopTrigg = "!tbtopten"
AddTrigg = "!tbaddquestion"
OtvetTrigg = "!tbanswer"

bcount = 0
scount = 0
sQuestion = ""
sAnswer = ""
guessArray = {}
lngGuessmax = 0
pointArray = {}
lngWord = 0
lngPassed = 0
lngHinted = 0
strWord = ""
strQuestion = ""
strSolved = ""

function Main()
  remove(""..folder.."/bothgamesprev.dat")
  ReloadQuestions()
  LoadScores()
end

function DataArrival(curUser, data)
strBaner = "Use "..StopTrigg.." to stop the game!"
strBanner = "Use "..StartTrigg.." to start a new game!"
strStart = ""..curUser.sName.." has started a new Trivia game!  "..strBaner
strStopp = ""..curUser.sName.." has stopped  Trivia game!  "..strBanner

  local boolPlaydata = nil
  if (strsub(data, 1, 1) == "<") then
    data = strsub(data, 1, (strlen(data) - 1))
      boolPlaydata = 1

  elseif (strsub(data, 1, 4) == "$To:") then
    data = strsub(data, 1, (strlen(data) - 1))
    local _, _, whoTo = strfind(data,"$To:%s+(%S+)")
    if (whoTo == BotName) then
      data = strsub(data, (15 + strlen(BotName) + strlen(curUser.sName)))
    end
  end

  local _, _, firstWord = strfind(data, "%b<>%s+(%S+)")
 
  if (firstWord ~= nil) then
    if ((strlower(firstWord) == strlower(HelpTrigg)) or (strlower(firstWord) == strlower(ExtraHelpTrigg))) then
      showHelp(curUser)
    elseif (strlower(firstWord) == strlower(SaveTrigg)) then
      if (curUser.iProfile) == 0 then
        SaveScores(curUser)
	curUser:SendData(BotName,"Scores saved!")
      end
    elseif (strlower(firstWord) == strlower(LoadTrigg)) then
      if (curUser.iProfile) == 0 then
        LoadScores(curUser)
  	curUser:SendData(BotName,"Scores loaded!")
      end
    elseif (strlower(firstWord) == strlower(TopTrigg)) then
	  TopTen(curUser)
    elseif (strlower(firstWord) == strlower(AddTrigg)) then
      if (curUser.iProfile) == 0 then
      	s,e,sQuestion,sAnswer = strfind(data, "%b<>%s+%S+%s+(.+)#(.+)")	
	  AddQuestion(curUser,sQuestion,sAnswer)
      else
	  SendToPlayers("Questions cannot be added by users at this time")
      end

    elseif (strlower(firstWord) == strlower(RestartTrigg)) then
      if (curUser.iProfile) == 0 then
        SendToPlayers("TriviaBot restarted. All points etc are lost!")
        SendToPlayers("If Save is used now it will overwrite the old save!")
        pointArray = {}
        StopQuiz(1)
      end
    elseif (strlower(firstWord) == strlower(OtvetTrigg)) then
      if ((curUser.iProfile) == 0 and (lngWord ~= 0)) then
        curUser:SendData(BotName,"Real answer is: "..strWord.."")
      elseif ((curUser.iProfile) == 0 and (not (lngWord ~= 0))) then
        curUser:SendData(BotName,"The game is inactive or there is no question yet!")
      end
    elseif strlower(firstWord) == strlower(PointTrigg) then
      if (pointArray[curUser.sName]) then
        curUser:SendData(BotName, "You have "..pointArray[curUser.sName].." scores!")
      else
        curUser:SendData(BotName, "You have no scores at all!")
      end
    elseif strlower(firstWord) == strlower(HintTrigg)  then
      if ((lngWord ~= 0) and strfind(strSolved, strCMask, 1, plain)) then
        if (lngHinted < lngMaxHints) then
  	  for nn=1,bcount do
              local lngRepChar = random(1, strlen(strWord))
              while 1 do
                if (boolHintAlwaysHitHidden == 1) then
                  if (strsub(strSolved, lngRepChar, lngRepChar) == strCMask) then
                    break
                  end
                else
                  break
                end
                lngRepChar = random(1, strlen(strWord))
              end
              local strTurn = ""
              for x=1, strlen(strWord) do
                if (x == lngRepChar) then
                 strTurn = strTurn..strsub(strWord, x, x)
                else
                  strTurn = strTurn..strsub(strSolved, x, x)
                end
	      end
              strSolved = strTurn
	  end
            lngHinted = lngHinted + 1
	    lngHintTimeCount = lngHintTimeCount + lngHintTime
            SendToPlayers("Hint: "..strSolved)
	    acount = ""
         else
            curUser:SendData(BotName, "All hints used for this word!")
       end
      else
        curUser:SendData(BotName, "There will be no hints!")
      end
    elseif strlower(firstWord) == strlower(ScoreTrigg)  then
      curUser:SendData(BotName, "")
      curUser:SendData(BotName, "---------------------------------------------------------")
      curUser:SendData(BotName, "Player scores:")
      curUser:SendData(BotName, "---------------------------------------------------------")
      for index, value in pointArray do
        curUser:SendData(BotName, "Nick: "..index.." ** Scores: "..value.."")
      end
      curUser:SendData(BotName, "---------------------------------------------------------")
      curUser:SendData(BotName, "")

    elseif (strlower(firstWord) == strlower(StartTrigg)) then

handle2=openfile(""..folder.."/bothgamesprev.dat","r")

if (handle2) then
	line = read(handle2)
   if line == "JUMBLE_IS_RUNNING" then
	curUser:SendData(BotName, "You can't run Trivia game now, because Jumble game is already running!")
	return 1

   elseif line == "TRIVIA_IS_RUNNING" then
         curUser:SendData(BotName, "Trivia is already running! ")
         return 1
   end

closefile(handle2)

else
          SendToAll(BotName, strStart)
          StopQuiz(1)
              local handle3=openfile(""..folder.."/bothgamesprev.dat","a")
              write(handle3,"TRIVIA_IS_RUNNING")
              closefile(handle3)
end

    elseif ((strlower(firstWord) == strlower(StopTrigg)) and  (lngWord ~= 0)) then
        SaveScores()
        HoldQuiz()
        StopQuiz()
	remove(""..folder.."/bothgamesprev.dat")
        SendToAll(BotName, strStopp)

    elseif ((strlower(firstWord) == strlower(StopTrigg)) and  (not (lngWord ~= 0))) then
          curUser:SendData(BotName, "The game is not active already!")
    elseif (strlower(firstWord) == strlower(WordTrigg)) then
      if (lngWord ~= 0) then
        curUser:SendData(BotName, "Answer: "..strSolved.." ("..strlen(strSolved).." chars)")
else
        curUser:SendData(BotName, "The game is not active at this moment!")
      end
    elseif (strlower(firstWord) == strlower(QuizTrigg)) then
      if (lngWord ~= 0) then
        curUser:SendData(BotName, "Question: "..strQuestion)
else
        curUser:SendData(BotName, "The game is not active at this moment!")
      end
    elseif (strlower(firstWord) == strlower(ReloadTrigg)) then
      if (curUser.iProfile) == 0 then
        local _, _, secondWord = strfind(data, "%b<>%s+%S+%s+(%S+)")
        if (secondWord) then
        handle = openfile(secondWord, "r")
          if (handle) then
            closefile(handle)
            strTrivFile = secondWord
          end
        end
        
        HoldQuiz()
        ReloadQuestions()
      end
    else
	if ((lngWord ~= 0) and (boolPlaydata)) then
          local msg = strsub(data, (4 + strlen(curUser.sName)))
          if (strlen(msg) >= strlen(strWord)) then
            local boolDisc = nil
            
	local strTurn = "" 
		  if strlower(msg) == strlower(strWord) then 
		    strTurn = strWord
		    boolDisc = 1 
		  else 
		    strTurn = strSolved
		  end 

            if (boolDisc) then
              strSolved = strTurn
            end
            if (boolDisc) then
              if (strlower(msg) ~= strlower(strWord)) then
                SendToPlayers("Answer: "..strSolved)
              end
            end
            if (strlower(msg) == strlower(strWord)) then
              if (not (pointArray[curUser.sName])) then
                pointArray[curUser.sName] = 0
              end
		if lngHinted == 3 then pointArray[curUser.sName] = pointArray[curUser.sName] + 4
		elseif lngHinted == 2 then pointArray[curUser.sName] = pointArray[curUser.sName] + 5
		elseif lngHinted == 1 then pointArray[curUser.sName] = pointArray[curUser.sName] + 6
		else pointArray[curUser.sName] = pointArray[curUser.sName] + 8
		end 
              SendToPlayers("Answer was: "..strSolved)
              SendToPlayers("Answer was solved by "..curUser.sName)
              SendToPlayers("Next question in "..(lngRestTime * 15).." (?15) sec")
              lngPassed = lngMaxTime
              SendToPlayers(curUser.sName.." scores: "..pointArray[curUser.sName])
              HoldQuiz()
            end
          end
        end
      end
    end
  end
--LUA forever! =)

NemeziS

#17
And here is second part of those script:
function HoldQuiz()
  strWord = ""
  strQuestion = ""
  strSolved = ""
end

function StopQuiz(restart)
  lngWord = 0
  lngPassed = 0
  strWord = ""
  strQuestion = ""
  strSolved = ""
  StopTimer()
  if (restart) then
    StartQuiz()
  end
end

function StartQuiz()
  lngWord = random(1, lngGuessmax)
  QWarray = tokenize(guessArray[lngWord], strGSep)
  strQuestion = QWarray[1]
  strWord = QWarray[2]
  strSolved = ""
  for x=1, strlen(strWord) do
    if (strsub(strWord, x, x) == " ") then
      strSolved = strSolved.." "
    else
      strSolved = strSolved..strCMask
    end
  end
  lngPassed = 0
  lngHinted = 0
  lngHintTimeCount = lngHintTime
  if strlen(strWord) < 4 then
	bcount = random(1, 2)
  elseif strlen(strWord) >= 4 and strlen(strWord) <= 9 then
	bcount = random(1, 3)
  elseif strlen(strWord) >= 9 and strlen(strWord) <= 20 then
	bcount = random(2, 4)
  else
	bcount = random(3, 5)
  end
  SetTimer(15000)
  StartTimer()
  SendToPlayers("Question: "..strQuestion)
  SendToPlayers("Answer: "..strSolved.." ("..strlen(strSolved).." ????)")
end

function OnTimer()
SaveScores()
  lngPassed = lngPassed + 1
  if (lngPassed == lngMaxTime) then
    scount = scount + 1
    if scount == countSaveTurns then
	   local handle = openfile(strTrivScoreFile, "w")
	    	for index, value in pointArray do
   	   write(handle,index..strGSep..value.."\r\n")
 	   end
   	   closefile(handle)
    scount = 0
    end
    if (boolRevealAnswer) then
      SendToPlayers("Answer was '"..strWord.."' and was not solved!")
    else
      SendToPlayers("Answer was not solved!")
    end
    SendToPlayers("Next question in "..(lngRestTime * 15).." sec")
    HoldQuiz()
  elseif (lngPassed >= (lngRestTime + lngMaxTime)) then
    StopQuiz(1)
  elseif (lngPassed == lngHintTimeCount) then
    if (boolAutoHint) then
	for nn=1,bcount do
            local lngRepChar = random(1, strlen(strWord))
            while 1 do
              if (boolHintAlwaysHitHidden) then
                 if (strsub(strSolved, lngRepChar, lngRepChar) == strCMask) then
                  break
                end
              else
                break
              end
              lngRepChar = random(1, strlen(strWord))
            end
            local strTurn = ""
            for x=1, strlen(strWord) do
              if (x == lngRepChar) then
               strTurn = strTurn..strsub(strWord, x, x)
              else
                strTurn = strTurn..strsub(strSolved, x, x)
              end
	    end
            strSolved = strTurn
	end
            lngHinted = lngHinted + 1
	    lngHintTimeCount = lngHintTimeCount + lngHintTime
            SendToPlayers("Hint: "..strSolved)
	end  
  end
end


function tokenize (inString,token)
  _WORDS = {}
  local matcher = "([^"..token.."]+)"
  gsub(inString, matcher, function (w) tinsert(_WORDS,w) end)
  return _WORDS
end

function ReloadQuestions()
  guessArray = {}
  lngGuessmax = 0
  local boolRestart = nil
  if (lngWord ~= 0) then
    SendToPlayers("Reloading questions, game will be shut down!")
    StopQuiz()
    boolRestart = 1
  end
  handle = openfile(strTrivFile, "r")
  if (handle) then
    local line = read(handle)
    
    while line do
      if ((line ~= "") and (strfind(line, strGSep, 1, plain))) then
        tinsert(guessArray, line)
        lngGuessmax = lngGuessmax + 1
      end
      line = read(handle)
    end
  closefile(handle)
  end
  if (lngGuessmax < 1) then
  guessArray = {
    "The finest car there is?"..strGSep.."Honda CRX del Sol",
    "Who brought you this TriviaBot"..strGSep.."Leon a.k.a. Don Leon"
  }
  lngGuessmax = 2
  end
  if (boolRestart) then
    SendToPlayers("Reloaded questions, game will be restarted! Current # of questions: "..lngGuessmax)
    StartQuiz()
  end
  strTrivFile = strDefTrivFile
end

function SaveScores(curUser)
  local handle = openfile(strTrivScoreFile, "w")
  for index, value in pointArray do
    write(handle,index..strGSep..value.."\r\n")
  end
  closefile(handle)
end

function LoadScores(curUser)
  local handle = openfile(strTrivScoreFile, "r")
  if (handle) then
    local line = read(handle)
    while line do
      local arrTmp = tokenize(line, strGSep)
      if ((arrTmp[1] ~= nil) and (arrTmp[2] ~= nil)) then
        pointArray[arrTmp[1]] = tonumber(arrTmp[2])
      end
      line = read(handle)
    end
  closefile(handle)
  end
end

function AddQuestion(curUser, sQuestion, sAnswer)
  local handle = openfile(strQFile, "a")
  write(handle,"Submitted by <"..curUser.sName.."> "..sQuestion..strGSep..sAnswer.."\r\n")
  SendToPlayers(curUser.sName.." added a question for a game "..sQuestion)
  curUser:SendPM(BotName,curUser.sName.." answered on question: "..sAnswer)
  closefile(handle)
end

function SendToPlayers(msg)
 SendToAll(BotName, msg)
end

function showHelp(curUser)
  curUser:SendData(" ")
  curUser:SendData("    Trivia help:")
  curUser:SendData(" ") 
  curUser:SendData("    "..StartTrigg.." - Starts the TriviaBot")
  curUser:SendData("    "..StopTrigg.." - Stops the TriviaBot")
  curUser:SendData("    "..WordTrigg.." - Shows current word (answer)")
  curUser:SendData("    "..QuizTrigg.." - Shows current question")
  curUser:SendData("    "..PointTrigg.." - Shows your points only")
  curUser:SendData("    "..ScoreTrigg.." - Shows everyones score")
  curUser:SendData("    "..HintTrigg.." - Reveals a char in current word")
  curUser:SendData("    "..TopTrigg.." - Shows top ten scores")
  curUser:SendData("    "..HelpTrigg.." - Displays this help")
  curUser:SendData(" ")

 
  if (curUser.iProfile) == 0 then


    curUser:SendData("    "..BotVersion.." Master's commands:")
    curUser:SendData(" ")
    curUser:SendData("    "..OtvetTrigg.." - Shows a right answer on a question! ;))")
    curUser:SendData("    "..RestartTrigg.." - Restarts the bot, reseting all scores!")
    curUser:SendData("    "..ReloadTrigg.." () - Reloads questions from "..strDefTrivFile)
    curUser:SendData("    "..AddTrigg.." - Adds a question to the Trivia Questions File. Type the question, then separate the answer with a #")
    curUser:SendData("    EXAMPLE : tbquestion How fast does a bird fly?#Dont know")
    curUser:SendData("    "..SaveTrigg.." - Saves scores into "..strTrivScoreFile)
    curUser:SendData("    "..LoadTrigg.." - Loads scores from "..strTrivScoreFile)
    curUser:SendData(" ")
  end
end

function TopTen(curUser, data)
	local index = {n=0}
	foreach(pointArray, function(nick, score) tinsert(%index, nick) end)
	local func = function(a, b) return %pointArray[a] > %pointArray[b] end
	sort(index, func)
	x = x or 10 if x > index.n then x = index.n end
	local result = "\r\r\n"
	for i = 1, x do result = result..""..i..") Nick: "..index[i].." ** Scores: "..pointArray[index[i]].."\r\n" end
	msg = result
	curUser:SendData(BotName, "Top "..x.." Trivia Players: "..msg.."")
end

To make this script work you should complete first part of the script with the second part.  ;)
--LUA forever! =)

NemeziS

Hmm..

Can someone help me? :(

Best regards,
NemeziS
--LUA forever! =)

nErBoS

Hi,

Tell me one thing, when you stop the quizz the file "bothgamesprev.dat" (is in the "scripts\txt" folder) is deleted ???

Best regards, nErBoS
--## nErBoS Spot ##--

NemeziS

Yes, it is removed every time I stop the game or scripts are restarted
--LUA forever! =)

SMF spam blocked by CleanTalk