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.

Change from private message to public channel (BogusTrivia)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
daigo
Voice
Posts: 37
Joined: Fri Jun 27, 2014 8:02 pm

Change from private message to public channel (BogusTrivia)

Post by daigo »

The IRC network I am on has private messages, notices, etc. disabled, so I cannot control the BogusTrivia script on there via PM to the bot. Is there a way I can edit the script so that everything is done via public channel instead of private messaging the bot?
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: Change from private message to public channel (BogusTriv

Post by willyw »

daigo wrote:The IRC network I am on has private messages, notices, etc. disabled, so I cannot control the BogusTrivia script on there via PM to the bot. ....
Before you get into all that, try to find out exactly what the IRC network is doing to accomplish this.

I have bots on one IRC network that blocks CTCP, for example. Upon further investigation, it is merely a default setting - a user mode flag that is applied to every login. The solution was simple then : simply toggle it off, upon every time the bot logs in.

What network is it?
d
daigo
Voice
Posts: 37
Joined: Fri Jun 27, 2014 8:02 pm

Post by daigo »

It is the twitch.tv IRC network.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

As I told you in IRC chat, do
/mode your_nick
and see what the reply is. Perhaps there are some user mode flags set by default upon log in. You may have to visit their website or something to find out the meaning of any that you find.

For some reason unknown to me, you simply stopped responding there.
Maybe you had some emergency pop up?
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

daigo,

First off, I agree completely with willyw.
It would be better to just remove the irc mode that is disabling private message from yourself & the trivia bot.
Anything else forces us to try modifying BogusTrivia.

That being said, I have worked up an untested public .add\.mix patch for BogusTrivia.
This should disable the private message .add & .mix commands and create public .add & .mix commands.
You will need to edit your t-2.tcl file as follows:

Step #1
On or about line 3224, find this line of code...

Code: Select all

bind msgm $t2(mflag) y* TReply  ;  bind msgm $t2(mflag) n* TReply
and replace that line with this code...

Code: Select all

bind pubm $t2(mflag) y* TPubReply  ;  bind pubm $t2(mflag) n* TPubReply
Step #2
On or about line 3582, find this line of code...

Code: Select all

unbind msgm $t2(mflag) $trgr* TReply
and replace that line with this code...

Code: Select all

unbind pubm $t2(mflag) $trgr* TPubReply
Step #3
On or about line 671, find these 3 lines of code...

Code: Select all

if {$t2(m-cmdpre) ne "."} {  bind msgm $t2(mflag) $t2(m-cmdpre)add* TAdd
  bind msg $t2(mflag) $t2(m-cmdpre)mix TMix
} else {  bind msgm $t2(mflag) .add* TAdd  ;  bind msg $t2(mflag) .mix TMix  }
and replace those 3 lines with this code...

Code: Select all

bind pubm $t2(mflag) $t2(m-cmdpre)add* TPubAdd
bind pub $t2(mflag) $t2(m-cmdpre)mix TPubMix
proc TPubAdd {nk uh hn ch tx} {
  TAdd $ch $uh $hn $tx
  return 0
}
proc TPubMix {nk uh hn ch tx} {
  TMix $ch $uh $hn $tx
  return 0
}
proc TPubReply {nk uh hn ch tx} {
  TReply $ch $uh $hn $tx
  return 0
}
Step #4
Save the file, Upload the patched file to the bot, and Rehash to load the patch.


Notes:
Line numbers reference BogusTrivia 2.06.4.6 (patch should work on other versions).
New public .add/.mix commands use the original .add/.mix settings for flags & command prefix.

Please let me know how it works out for you.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Post Reply