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.

Auto Picks Quote

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Auto Picks Quote

Post by Thanhas »

Hello,

in this Script all i need to Avoid !wright system it should say random Quote in x minutes and partyline .chanset * +Quote so please edit this code i did alot of emails to the Author but no replay so now i am here.
to mention agian
1 = Auto Display random Quotes from wright.txt in x minutes
2 = Works on .chanset #chan +Quote
3 = Remove !wright system

Thanks in advance,


Code: Select all

# Wrightie script by Flash___, based on Steinsky's quote script.
# ircflash@digdilem.org - #3am at irc.quakenet.org - Flash____
#
# Steven Wright is the weird-looking American comic who's so off the wall he's 
# on a completely different wall. The guy's a genius, I love his stuff!
#
# Adds channel commands: !wright
# This picks a line at random from a plain ascii file (one quote per line) and
# puts it in the same channel !wright was called from. Would be trivial to change
# for any other set of random quotes. Just change the bind and the quotes...
#
# To install: Place this .tcl and wright.txt into the scripts/ dir of your eggdrop
# and add the line to your eggdrop.conf file:
#
# source scripts/wright.tcl
#
# .rehash or reload your bot and job's done.

# Where are the wrights ganna be kept? (Relative or absolute path to ascii file)
set wrightfile scripts/wright.txt

# 0 = display wrights in channel
# 1 = display wrights via private notice.
set wrightvianotice 0

#------- Nothing else needs to be twiddled with --------

if { ![info exists toolbox_loaded] } { source scripts/alltools.tcl }

# Change !wright to something else if you need a different trigger
bind pub - !wright wright:pub:wright

proc wright:pub:wright {nick uhost hand chan arg} {
 global wrightfile wrightvianotice
 set wrights ""
 if { [file exists $wrightfile] } { set file [open $wrightfile r] 
 } else {
  if { $wrightvianotice == 0 } { putmsg $chan "$wrightfile does not exist. You'll need to add wrights to the database first by typing \002!addwright <a wright>\002" }
  if { $wrightvianotice == 1 } { putnotc $nick "$wrightfile does not exist. You'll need to add wrights to the database first by typing \002!addwright <a wright>\002" }
  return 0
 }
 while { ![eof $file] } {
  set wright [gets $file]
  if { $wright != "" } {
   set wrights [linsert $wrights end $wright]
  }
 }
 close $file
 if { $arg != "" } {
  set pattern [string tolower $arg]
  set awrights ""
  set wright ""
  foreach wright $wrights {
   set lowwright [string tolower $wright]
   if { [string match $pattern $lowwright] } {
    set awrights [linsert $awrights end $wright]
   }
   set wrights ""
   set wrights $awrights
  }
 }
 set row [rand [llength $wrights]]
 if { [expr $row >= 0] && [expr $row < [llength $wrights]] } {
  set wright [lindex $wrights $row]
 }
 if { $wright != "" } {
  if { $wrightvianotice == 0 } {
   putmsg $chan "Wrightism: $wright"
  }
  if { $wrightvianotice == 1 } {
   putnotc $nick "$wright"
  }
 }
 return 1
}

putlog "Wright.tcl By Flash____ running. !wright to invoke."
l
lenooxx
Voice
Posts: 27
Joined: Tue Mar 24, 2009 10:56 am
Location: Hungarian
Contact:

heya

Post by lenooxx »

i tried this script and i get this

Tcl error [wright:pub:wright]: random limit must be greater than zero
Post Reply