I've edit the following calc.tcl to store Computerized Bulletin Board System information set by channel users and no longer display calculation results. Bulletin Board System is shortened by a lot of SysOp (System Operators) to BBS.
Code: Select all
#calc.tcl v0.3g by RufusDE <rufus@o-town.de>
#
# Copyright (c) 1996 Jason P Schanuel (calcbot@gobills.com)
# permission is granted to do anything you want with this
# as the above copyright stays intact (or whatever :-)
That being said I see a part of the script where it has information for picking random calc stored in the calcdata.tcl file. What I'm wanting to is in every so many minutes let the bot select a random calc from the calcdata.tcl and display it in the IRC chatroom. Since, I run the only IRC server for the network, and I run the bot I don't see this as a flooding problem. Especially since I sit on the server alone unless someone needs help with setting up an Old DOS based BBS.
Also I'm not a TCL programmer, I'm an old DOS QBasic programmer. However I'm great at copying and pasting into TCL. I will give display the entire randomizing part of the script here, and maybe you can tell me what to add to make it display a random calc from the calcdata.tcl after a set amount of minutes. Like for example:
Set Timer : 120 minutes (Which is 2 hours, incase your didn't know.)
Display randcalc from the database.
Code: Select all
#
# forward pub randcalcs to main routine
#
proc pub_randcalc {nick uhost hand chan arg} {
global debug_calc calc_dict
if {[limit $nick $chan 1]} {return 0}
set arg "calc [lindex [array names calc_dict] [rand [array size calc_dict]]]"
if {$debug_calc} {
putlog "pub_randcalc - nick=$nick, uhost=$uhost, hand=$hand, chan=$chan arg=$arg"
}
return [main_calc $nick $uhost $hand $chan pub $arg]
}