Trivia bot v26

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

Locked
Cuddles
Posts: 5
Joined: 2003-08-13 11:14

Trivia bot v26

Post by Cuddles » 2003-08-19 18:36

Hello i am really new to this scripting and wanted to know about the trivia bot script i can get it working but I would like it not to play in pm and also have it so that you didnt have to login to play it. Is there any way of doing this. Any Help would be much appreciated.

thanks

Lightning Man
Posts: 53
Joined: 2003-08-09 10:00
Location: Wilmington, NC
Contact:

Post by Lightning Man » 2003-08-19 21:47

The code would be helpful.

Cuddles
Posts: 5
Joined: 2003-08-13 11:14

Post by Cuddles » 2003-08-20 08:46

thanks for the reply ( i told you I was very new to this :D ) is this what is needed

*** TrivaBot: LurkerScript (c)2002 _-=[PhoenixRising]=-_
' *** This script originated at _-=P-[LukersLair]-R=-_ lurkerslair.no-ip.com
' *** Written by Damion NightHawk, aka Lurker

Dim sBotName ' TriviA-Bot
Dim sBotQuickTrig ' Bot Quick PM Trigger
Dim sBotVers ' Bot Version
Dim response ' response to trigger message
Dim wasPM ' boolean - was message a PM to the bot?
Dim sFrom ' who trigger message was from
Dim sTo ' mail to
Dim superOp(10) ' superOps are protected from some commands (max 20)
Dim sPath ' Path to Text Files
Dim sFile ' File to read
Dim sWelcomeMsg ' Welcome Message
Dim oFileSys ' File System Object
Dim sBotTrig ' Trigger String, like !pr
Dim sHelp ' Help Message
Dim sHelpOp ' Help for Ops

Dim Questions ' Questions Dictionary
Dim Answers ' Answers Dictionary
Dim Scores() ' Scores by Place
Dim iNumScores ' Number of people in array
Dim iQuestID ' Qustion Number
Dim iLastQuestID ' last question number
Dim iQuestCount ' How many questions total
Dim sLastWinner ' Last peron who answered correctly
Dim iTotalWon ' Questions answered in a row
Dim sQuest, sAns ' Question and answer strings
Dim sHint ' Reveiled answer
Dim iHint ' Hint count
Dim sCategory ' Question Category
Dim bQuestFlag ' okay to ask a new question
Dim bAnsFlag ' Answer Flag
Dim iScore ' Score
Dim iPlace ' Placement
Dim sFirstPlace ' First Place
Dim sBehind ' Who Behind
Dim iBehind ' Points Behind
Dim iUsers ' Number of users logged in
Dim Users ' User Dictionary
Dim iInactiveCount ' Max inactivity count
Dim bContinous ' Run Continously
Dim bChat ' Chat in PM?
Dim bMain ' Run in PM or Main chat
Dim bPMNewUsers ' Switch to PM newly connected users
Dim bFirstIn ' First person logged in

Dim iTimeTook ' Time it took to answer
Dim iDelay ' Delay between hints
Dim iDelayNorm ' Normal delay
Dim iDelayBreak ' Break Delay
Dim iAsked ' Questions Asked
Dim iToAsk ' Questions to ask before break
Dim iSaveCount ' Timer Counter to autosave scores

sub Main()
'set object to get path from Registry
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
sPath = wshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\NeoModus\Hub\PhoenixRisingScripts\AppPath") & "\Scripts"

'Setup Scripting Dictionaries for Questions and Users
Set Questions = CreateObject("Scripting.Dictionary")
Set Answers = CreateObject("Scripting.Dictionary")
Set Users = CreateObject("Scripting.Dictionary")

'Name of the Bot and set other bot variables
sBotName = "TriviA-BoT"
sBotQuickTrig = "trivia-bot"
sBotVers = "v2.3"
sBotTrig = "!tb "

'Setup File System Object
Set oFileSys = CreateObject("Scripting.FileSystemObject")

'Path to text files ' not used, to use this rem the get from registry.
'sPath = "C:\Program Files\Direct Connect Hub\Scripts"

'Default Settings in case Config file not found
iDelayNorm = 4 ' Delay between hints * tmrScriptTimer.Interval
iDelayBreak = 1200 ' Default Break time * tmrScriptTimer.Interval
iToAsk = 40 ' Questions to ask before break
iInactiveCount = 10 ' Questions asked before user is logged out
bContinous = False ' Bot takes breaks
bChat = False ' Chat in bot while playing in PM
bMain = True ' Bot runs in main
bPMNewUsers = False ' PM new user on connect?
iSaveCount = 0 ' Init autosave counter

'Static Settings needed before bot is started
tmrScriptTimer.Interval = 5000 ' Timer Interval is 5 Seconds, best not to change
tmrScriptTimer.Enabled = False ' Timer Off before bot is started
iAsked = 0 ' Questions Asked
iUsers = 0 ' Users Logged in

'Load SuperOps and Config Settings from File
frmHub.DoEventsForMe
Call SetConfig("trivops.txt")
frmHub.DoEventsForMe
Call SetConfig("trivbot.txt")
frmHub.DoEventsForMe
iDelay = iDelayNorm

If Not bMain Then
bFirstIn = True
Else
bFirstIn = False
End If

'Set Scoring Array
ReDim Scores(1,0)
Scores(0,0) = "Triva-Bot"
Scores(1,0) = 10000

'Set Ops Help and User Help
sHelp = "Hello %USER%"
sHelp = sHelp & sBotName & " Help:" & vbCrlf
sHelp = sHelp & "The following commands are available to you %USER%." & vbCRLF
sHelp = sHelp & sBotTrig & "Help - Read the help for " & sBotName & "!" & vbCRLF
sHelp = sHelp & sBotTrig & "AskMe - Show a question." & vbCRLF
sHelp = sHelp & sBotTrig & "HintMe - Show part of answer." & vbCRLF
sHelp = sHelp & sBotTrig & "SkipMe - Skip the question." & vbCRLF
sHelp = sHelp & sBotTrig & "TopTen - Show the top ten scorers." & vbCRLF
sHelp = sHelp & sBotTrig & "Scores - Show the all the scorers in PM." & vbCRLF
sHelp = sHelp & sBotTrig & "MyScore - View your score and place in main." & vbCRLF
sHelp = sHelp & sBotTrig & "LogIn - Login to play Trivia." & vbCRLF
sHelp = sHelp & sBotTrig & "LogOut - Logout and stop playing Trivia." & vbCRLF
sHelp = sHelp & sBotTrig & "ListUsers - show people playing." & vbCRLF
sHelp = sHelp & sBotTrig & "StartMe - Start The Bot!" & vbCRLF
sHelp = sHelp & sBotTrig & "StopMe - Stop the bot." & vbCRLF
sHelp = sHelp & sBotTrig & "SaveScores - Save the scores." & vbCRLF
sHelp = sHelp & sBotTrig & "LoadScores - Load the scores." & vbCRLF
sHelp = sHelp & sBotTrig & "ClearScores NoW! - Clear the scores." & vbCRLF
sHelp = sHelp & sBotTrig & "SetNonStop On/Off- Set trivia to run nonstop." & vbCRLF
sHelp = sHelp & sBotTrig & "SetChat On/Off- Set trivia so can Chat in pm." & vbCRLF
sHelp = sHelp & sBotTrig & "SetMain On/Off- Set trivia so plays in Main or PM." & vbCRLF
sHelp = sHelp & sBotTrig & "PMNewUsers On/Off- Set trivia PMs User on Connect." & vbCRLF
sHelp = sHelp & sBotTrig & "SetHintDelay # - Set hint delay # of 5 sec intervals." & vbCRLF
sHelp = sHelp & sBotTrig & "SetBreakDelay # - Set Break in Minutes." & vbCRLF
sHelp = sHelp & sBotTrig & "SetQToAsk # - Set number questions to ask between breaks." & vbCRLF
sHelp = sHelp & sBotTrig & "SetQToLogOut # - Set number questions to ask before LogOut." & vbCRLF
sHelp = sHelp & sBotTrig & "SaveConfig - Save Bot Settings." & vbCRLF
sHelp = sHelp & sBotTrig & "ResetConfig - Load Bot Settings." & vbCRLF
sHelp = sHelp & sBotTrig & "BotStatus - View Bot Settings." & vbCRLF & vbCRLF
sHelp = sHelp & sBotTrig & "ListTrivOps - List Trivia Ops." & vbCRLF
sHelp = sHelp & sBotTrig & "AddTrivOps - Add a Trivia Op." & vbCRLF
sHelp = sHelp & sBotTrig & "DelTrivOps - Delete a Trivia Op." & vbCRLF
sHelp = sHelp & vbCRLF & "Scoring is 1 - 4 points, depending on number of hints shown." & vbCRLF
sHelp = sHelp & vbCrlf & sBotName & " is an Phoenix Rising Script (" & sBotVers & ") ¬2002 _-=P-[Lurker's Lair]-R=-_"
sHelpOp = sHelp

sHelp = "Hello %USER%"
sHelp = sHelp & sBotName & " Help:" & vbCrlf
sHelp = sHelp & "The following commands are available to you %USER%." & vbCRLF
sHelp = sHelp & sBotTrig & "Help - Read the help for " & sBotName & "!" & vbCRLF
sHelp = sHelp & sBotTrig & "TopTen - Show the top ten scorers." & vbCRLF
sHelp = sHelp & sBotTrig & "Scores - Show the all the scorers in PM." & vbCRLF
sHelp = sHelp & sBotTrig & "MyScore - View your score and place in main." & vbCRLF
sHelp = sHelp & sBotTrig & "LogIn - Login to play Trivia." & vbCRLF
sHelp = sHelp & sBotTrig & "LogOut - Logout and stop playing Trivia." & vbCRLF
sHelp = sHelp & sBotTrig & "ListUsers - show people playing." & vbCRLF
sHelp = sHelp & vbCRLF & "Scoring is 1 - 4 points, depending on number of hints shown." & vbCRLF
sHelp = sHelp & vbCrlf & sBotName & " is an Phoenix Rising Script (" & sBotVers & ") ¬2002 _-=P-[Lurker's Lair]-R=-_"

'Register bot to Hub, do not change
frmHub.RegisterBotName(sBotName)

end sub



if so i want to be able to keep a record of the scores, stop having to login every time and keep the trivia in main.

thanks for any help

Lightning Man
Posts: 53
Joined: 2003-08-09 10:00
Location: Wilmington, NC
Contact:

Post by Lightning Man » 2003-08-20 10:12

I am not the best scripter in the world, but it seems that it is set to run the chat in main:

Code: Select all

bMain = True ' Bot runs in main


As to the other thing, what do you mean not having to log in? Do you want to access the script without being in your hub?

Cuddles
Posts: 5
Joined: 2003-08-13 11:14

Post by Cuddles » 2003-08-20 11:43

When i run the trivia it starts in a private message window until i switch it to main, which i have to do each time i start it. And what i mean by login is, when the trivia runs anyone who wants to play it has to type !tb LogIn first, i wanted it so that anyone could just play. If that is possible?

Lightning Man
Posts: 53
Joined: 2003-08-09 10:00
Location: Wilmington, NC
Contact:

Post by Lightning Man » 2003-08-20 12:02

How are you running the script? How do you start it?

Lightning Man
Posts: 53
Joined: 2003-08-09 10:00
Location: Wilmington, NC
Contact:

Post by Lightning Man » 2003-08-20 12:08

As to logging in, it is designed for people to have to log in so it knows to pay attention to what they're saying. That can't be changed.

Cuddles
Posts: 5
Joined: 2003-08-13 11:14

Post by Cuddles » 2003-08-20 16:01

It is started in main !tb startme, thanks for all the help llightning man

NeuromancerUltra
Posts: 1
Joined: 2003-12-08 17:35
Location: St. Cloud State Unv. MN
Contact:

Post by NeuromancerUltra » 2003-12-11 19:46

I would like to make a trivia bot based on this... except I have no clue how to make or run this bot or any form of script for DC++! My programming expertise are limited to Matlab in physical-chemistry simulations, I did do some visual basic in High school but that was some time ago. Please help.

Snooze
Posts: 119
Joined: 2003-01-26 13:42
Location: Denmark
Contact:

Post by Snooze » 2003-12-12 05:34

The trivia bot can run both in main or in PM. To reach these setting you have to give yourself superop status in the script. read the readme.txt file on how to do that...

Snooze
Posts: 119
Joined: 2003-01-26 13:42
Location: Denmark
Contact:

Post by Snooze » 2004-01-15 08:34

*BUMP*

latest version can be found here:

http://mainserver.dk/snooze3/viewtopic.php?t=51

Locked