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.

request auto notice of rules

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
t
tagoy
Voice
Posts: 8
Joined: Thu Jul 05, 2012 10:01 pm
Location: Philippines

request auto notice of rules

Post by tagoy »

please help.
wew
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

more info

Post by SpiKe^^ »

I think we are going to need a little more information on your request.
What exactly are we looking for here?
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
t
tagoy
Voice
Posts: 8
Joined: Thu Jul 05, 2012 10:01 pm
Location: Philippines

Post by tagoy »

thanks for the reply. Well i need an auto notice script tcl. That an eggdrop notice the rules every 20minutes. Also if type !rules then it will show the channel rules. thanks
wew
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Have you tried looking in the script archive for something close to what your looking for?
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
t
tagoy
Voice
Posts: 8
Joined: Thu Jul 05, 2012 10:01 pm
Location: Philippines

Post by tagoy »

yes i already did that, ive been searching in egghelp.org for the tcl that i need. But i dont know the name also im reading the description still no luck.
wew
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

have you looked at BlackRules script in the archive?

if that script was to work all we would need is a bind time to do the timed readings of the rules.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
t
tagoy
Voice
Posts: 8
Joined: Thu Jul 05, 2012 10:01 pm
Location: Philippines

Post by tagoy »

okay thanks i will search for it.
wew
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Let me know here if the script is functional, as not all scripts in the archive work without error. If it does, I would be glad to make it also read the rules to the channel on a 20 min timer.

I'll be around the forum for a couple more hours, and again tomorrow. Goodluck with that script:)
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
t
tagoy
Voice
Posts: 8
Joined: Thu Jul 05, 2012 10:01 pm
Location: Philippines

Post by tagoy »

Thansk for the help sir spike.
wew
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Think that script needs timers?

Post by SpiKe^^ »

So, now that we have a working trigger script for for your channel rules, don't we still need a way to post the rules on a 20 minute timer?
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
t
tagoy
Voice
Posts: 8
Joined: Thu Jul 05, 2012 10:01 pm
Location: Philippines

Post by tagoy »

Yes if you could do it sir spike i want to post the channel rules via notice every 20minutes. Uhmm i want another script not on the blackrules. If its okay.
wew
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Think i would just try to get the same script sending the same rules on a 20 min deal. Believe i would use bind times instead of timers tho...
Add this code near the top of the script:

Code: Select all

bind time - "00 *" callrules
bind time - "20 *" callrules
bind time - "40 *" callrules

proc callrules {mn hr da mo yr} {  global botnick
  publicrules $botnick :TIMED: :RULES: #yourchannel none
}
Replace #yourchannel with the channel we are sending the timed rules to.
Then change the last process in the script to look more like this:

Code: Select all

proc publicrules {nick host hand chan arg} {
 global rules count
 set dir "logs/rules($chan).txt"
 if {![validchan $chan]} { return 0 }
 if {[channel get $chan rules]} {

   if {![info exists count(rules:on)]} { 
     set count(rules:on) 0 
   }

   if {$count(rules:on) >= 1} {
     puthelp "NOTICE $nick :Please wait for $rules(time) seconds before i can show the rules."
     return 0
   }

   incr count(rules:on)
   utimer $rules(time) [list unset count(rules:on)]

   if {[file exists $dir] == 0} {
     set file [open $dir w]
     close $file
   }
   set file [open $dir "r"]
   set w [read -nonewline $file]
   close $file
   set data [split $w "\n"]
   set i 0

   if {$data == ""} { puthelp "NOTICE $nick :There are no rules for $chan"
     return 0
   }

   foreach rule $data {
    set i [expr $i +1]
    if {$host eq ":TIMED:"} {  set sendto $chan
    } else {  set sendto $nick  }
    puthelp "NOTICE $sendto :12The rules for 4$chan 12are:"
    puthelp "NOTICE $sendto :12 $i . $rule"
   }
 }
}
None of this is tested tho, but looks to me to work

Goodluck
SpiKe^^

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