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.

Alternative commands in BogusTrivia

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

Alternative commands in BogusTrivia

Post by juanamores »

¿ Is possible alternative commands to turn on and off the trivial ?

Example commands for play: !start or !comenzar
Example commands for stop: !stop or !detener

If you could modify that , commands can be understood by Spanish and English speakers.
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
d3n
Voice
Posts: 15
Joined: Wed Jul 13, 2016 2:30 pm
Location: Italy
Contact:

Post by d3n »

go to file t-2.settings.tcl and edit this line

Code: Select all

set t2(on) "!trivia"      ;# public trigger to turn game on #
set t2(off) "!strivia"        ;# public trigger, game off  ("" = same as on trigger)
!trivia on !comenzar
!strivia on !detener

try and let me know if it works.......
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

if I use this, I just change the names of the commands, but I cannot use altenatives commands.

What I want is that Trivial could be started and stopped with two differents commands.

Example:
@oper: !start
@BoT: BogusTrivia loading......
@oper: !stop
@BoT: BogusTrivia stopped.
@oper: !comenzar
@BoT: BogusTrivia loading......
@oper: !detener
@BoT: BogusTrivia stopped.
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

I am working on this request.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

BogusTrivia: multiple on and/or off triggers.

Post by SpiKe^^ »

Great request juanamores.

Making that happen for you will require quite a bit of editing of the t-2.tcl file. If you are careful and follow these directions exactly, you should be able to do the editing:)


1) Find this line in the t-2.tcl file...

Code: Select all

 set v(tls2) "chan on off upubq hint p-cmdpre m-cmdpre hintchar"
and make it look more like this...

Code: Select all

 set v(tls2) "chan upubq hint p-cmdpre m-cmdpre hintchar"

2) Then Find this line...

Code: Select all

 set v(tls3) "p-mystat p-opstat p-info p-owner p-page p-top-d p-t20-d p-tmor-d"
and make it look more like this...

Code: Select all

 set v(tls3) "on off p-mystat p-opstat p-info p-owner p-page p-top-d p-t20-d p-tmor-d"

3) Next find this chunk of code...

Code: Select all

 if {$t2(p-cmdpre) ne "."} {
   foreach x {on off} {  set y $t2($x)
    if {[string match .* $y]} {  set t2($x) "$t2(p-cmdpre)[string range $y 1 end]"  }
   }
 }
and delete that entire chunk of code (All 5 lines)


4) Then Find these two lines...

Code: Select all

if {$t2(off) ne $t2(on)} {  bind pubm $t2(sflag) "$t2(chan) $t2(off)" TOnOff  }
bind pubm $t2(oflag) "$t2(chan) $t2(on)" TOnOff
delete those 2 lines and replace them with these...

Code: Select all

foreach ttmp(x) $t2(on) {  bind pubm - "$t2(chan) $ttmp(x)" TOnOff  }
if {$t2(off) ne $t2(on)} {
  foreach ttmp(x) $t2(off) {
   if {[lsearch -nocase $t2(on) $ttmp(x)]=="-1"} {
     bind pubm - "$t2(chan) $ttmp(x)" TOnOff
   }
  }
}

5) Then Find this line...

Code: Select all

   if {$from=="0" && ![string match -nocase $t2(on) $tx]} {  return 0  }
delete that line and replace it with these...

Code: Select all

   if {$from=="0"} {
     if {[lsearch -nocase $t2(on) $tx]=="-1"} {  return 0  }
     if {$t2(oflag) ne "-" && $hn eq "*"} {  return 0  }
     if {$t2(oflag) ne "-" && ![matchattr $hn $t2(oflag) $ch]} {  return 0  }
   }

6) Then Find this line...

Code: Select all

   if {$from=="0" && ![string match -nocase $t2(off) $tx]} {  return 0  }
delete that line and replace it with these...

Code: Select all

   if {$from=="0"} {
     if {[lsearch -nocase $t2(off) $tx]=="-1"} {  return 0  }
     if {$t2(sflag) ne "-" && $hn eq "*"} {  return 0  }
     if {$t2(sflag) ne "-" && ![matchattr $hn $t2(sflag) $ch]} {  return 0  }
   }

7) Save & close the t-2.tcl file, and now edit the t-2.settings.tcl file. Find this chunk of code in the t-2.settings.tcl file...

Code: Select all

set t2(on) ".t2"      ;# public trigger to turn game on #
set t2(off) ""        ;# public trigger, game off  ("" = same as on trigger) #
set t2(oflag) "o|o"   ;# flags to turn the game on ("" = everyone) #
set t2(sflag) ""      ;# flags to turn game off    ("" = same as on flags) #
                      ;# separate off flags requires using separate on & off triggers #
and make it look more like this...

Code: Select all

set t2(on) "!start !comenzar"      ;# public trigger(s) to turn game on #
set t2(off) "!stop !detener"       ;# public trigger(s), game off  ("" = same as on trigger(s)) #
set t2(oflag) "o|o"   ;# flags to turn the game on ("" = everyone) #
set t2(sflag) ""      ;# flags to turn game off    ("" = same as on flags) #
                      ;# Separate off flags No Longer Requires using separate on & off triggers !! #

8) Save & close the t-2.settings.tcl file. Upload the t-2.tcl & t-2.settings.tcl files to the shell and rehash the bot.


Please test this code and report back.
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 »

SpiKe^^ it works perfectly, thank you so much! :D

So, as far as I can see, that could allow to make it able to play in several channels, right ?

When you'll hace a minute I would thank you to helping me in that.
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^^ »

No, not at all.

BogusTrivia will probably never be a multi-channel script.
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 »

SpiKe^^ wrote:No, not at all.

BogusTrivia will probably never be a multi-channel script.
Ok, I assumed it would be difficult the cuestion of databases of users and scores.
Thank you
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 :)
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

Post by sky6419 »

Hello asked a question in this section do not know if it is correct.
However the question is how can I accept the answers of those who write the script colored bogus trivia?
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

sky6419

Try turning on the strip colors setting, it is off by default...

Code: Select all

# strip color codes from players answers # requires eggdrop 1.6.17+ #
# allow BogusTrivia to accept answers typed in color ? #
# this will have the bot remove color codes to look for an answer match #
set t2(stripcolor) "1"   ;# (1=yes | 0=no) #

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

Post by sky6419 »

Thank you so much you could tell me the guides for writing tcl? :D SpiKe^^.
Post Reply