egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto Picks Quote

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Thanhas
Op


Joined: 02 Sep 2006
Posts: 124
Location: Ottawa, Canada

PostPosted: Mon Oct 19, 2009 1:04 am    Post subject: Auto Picks Quote Reply with quote

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:
# 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."
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lenooxx
Voice


Joined: 24 Mar 2009
Posts: 27
Location: Hungarian

PostPosted: Sat Oct 31, 2009 3:36 pm    Post subject: heya Reply with quote

i tried this script and i get this

Tcl error [wright:pub:wright]: random limit must be greater than zero
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber