This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

BogusTrivia automatic shutdown if no one plays

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

BogusTrivia automatic shutdown if no one plays

Post by juanamores »

Dear, SpiKe^^:
You can modify the script so that the bot turns off automatic if no one is playing for space ..... minutes?

Regards
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

juanamores: BogusTrivia already has settings to do that, it's called idle-stop.

There are 2 settings that can enable idle-stop, in this section of the t-2.settings.tcl file...

Code: Select all

# slow-times or idle-stop #  after this many questions with no one playing the game: #
# the times between hints & questions increase to these settings, #
# or idle-stop the bogustrivia game. #
set t2(sqcnt) "6"     ;# use slow-times or idle-stop after this many questions not played #
set t2(qslow) "20"    ;# slow time between hints (6 to 90 seconds) (0 = idle-stop the game) #
set t2(pslow) "25"    ;# slow time between questions (6 to 90 seconds) #
# Note: if set to less than play-times & more than 0, slow-times will be same as play #

# resting-times or idle-stop #  after this many questions with no one playing the game: #
# the times between hints & questions increase to these settings, #
# or idle-stop the bogustrivia game. #
set t2(rqcnt) "15"   ;# use resting-times or idle-stop after this many not played #
set t2(rest) "30"    ;# resting time between hints/questions (6 to 120) (0 = idle-stop the game) #
# Note: if set to less than slow-times & more than 0, rest-times will be same as slow #

Using the example above,
setting t2(qslow) to "0" would have the game stopping after no one plays for 6 questions
|OR|
setting t2(rest) to "0" would have the game stopping after no one plays for 15 questions.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

Thanks SpiKe^^, works!!.
but.....
Oops... on-join auto-start was activated when I set Idle-stop :?
You can solve for the game may not start when users join the channels ?

Another thing..
You can put a custom message when it is turned off automatically because nobody has played ?
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

BogusTrivia has a LOT of settings, Please read the entire settings file and set them as you require.

Right below the 2 settings discussed above is the setting you are currently seeking...

Code: Select all

# on-join auto-start #
# automaticly start bogustrivia when someone joins the channel ??  (0 = no) #
# Note:  for this to function, Idle-stop Must Be Turned ON!  #
# Note:  using the public off command overrides auto-start!  #
#        use the public on command to reactivate auto-start. #
# Note:  auto-start only triggers if bogus was idle-stopped. #
# 1 = silently start game  |  2 = say public  |  3 = say channel notice #
#  SEE BELOW:  Advanced On-Join Auto-Start Settings #
set t2(autostart) "2"

As stated in the settings file, setting t2(autostart) to "0" will disable on-join auto-start
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

Thanks SpiKe^^, I thought it was incompatible to set Idle-stop with on-join auto-start (Off).
For my little knowledge of English, I had misunderstood the following note:
# on-join auto-start #
# automaticly start bogustrivia when someone joins the channel ?? (0 = no) #
# Note: for this to function, Idle-stop Must Be Turned ON! #

Apologies, solved. :D
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Custom idle-stop message for BogusTrivia

Post by SpiKe^^ »

juanamores wrote:Another thing..
You can put a custom message when it is turned off automatically because nobody has played ?
That could be done, but there is no current setting that does that.
You would have to edit the script code in t-2.tcl

Search for this line in the t-2.tcl file...

Code: Select all

   putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped."
and replace that line with something more like...

Code: Select all

   if {$uh eq "idle" && $hn eq "stop"} {
     putquick "PRIVMSG $ch :What you want to say on an idle-stop"
   } else {
     putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped."
   }
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

I had already solved, in a perhaps less professional than yours form, but equally it worked well:

Code: Select all

  if {$t2(qslow)=="0" } {
     putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped, because nobody has played in 6 questions."
   } else {
     putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped."
   } 
Thanks SpiKe^^, for the excellent support provided.
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

juanamores
Your method will make all game stops read as though it was stopped due to the game being idle, even when you stop the game manually with the off command.

Change your patch to look more like this...

Code: Select all

   if {$uh eq "idle" && $hn eq "stop"} {
     putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped, because nobody has played in 6 questions."
   } else {
     putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped."
   }
That way the new edited stop message will only be used when the script idle-stops itself.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

I have performed the recommended way. Thank you :D
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
Post Reply