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.

Quotes.tcl v0.1

Support & discussion of released scripts, and announcements of new releases.
Post Reply
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Quotes.tcl v0.1

Post by rt »

Quotes.tcl - Created by Calum Wood(cal@e-frag.net)

To-do list:
- A !search command to be able to search for quotes- ie. !search *moo*
- An online interface using xela's web interface to show quotes.

Bugs:
- None as of yet.

If you find one or have a suggestion connect to Quakenet and type /msg mrBot qbug <bug/suggestion>

Commands:
- !status (to view status)
- !status on/off to change wether the script is active on the channel.
- !add <quote here>
- !del <quote here>
- !rand - brings up a random quote
- !view <quote id> - views the quote.

I am sure you all reckon that !search would be a good idea - I'm just waiting for a little feedback on v0.1 before I work on anything else.

Feedback/Comments/Suggestions Appreciated. :)

Download link: http://www.djcalleh.net/quotes.tcl

YOU MUST HAVE http://www.djcalleh.net/vars.tcl
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Post by rt »

Umm, no one interested? :P
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Some notes

Code: Select all

source /home/Kicky/calbot/scripts/vars.tcl
this line is found in the code, this is basically stupid as this path will never be right for 99.9999% of all users

Code: Select all

     if {[string match -nocase $arguments ""]} { 
i would personally just use

Code: Select all

if {[lindex [split $arguments] 0] == ""} {
seeing as your code would get an error because you don't split $arguments

Code: Select all

     if {[string match -nocase $arguments ""]} { 
         putquick "NOTICE $nickname :Quotes.tcl is currently [quotes::check $channel]"
      }
      if {[string match -nocase $arguments "on"]} { 
           channel set $channel +quote
           putquick "NOTICE $nickname :Done. Quotes are now enabled."
           return
      }
      if {[string match -nocase $arguments "off"]} { 
           channel set $channel -quote
           putquick "NOTICE $nickname :Done. Quotes are now disabled."
      }
It's imo better to use

Code: Select all

if {[string equal -nocase [lindex [split $arguments] 0] on]} {
  channel set $channel +quote
  putquick "NOTICE $nickname :Done. Quotes are now enabled."
} elseif {[string equal -nocase [lindex [split $arguments] 0] off]} {
  channel set $channel -quote
  putquick "NOTICE $nickname :Done. Quotes are now enabled."
} else {
  putquick "NOTICE $nickname :Quotes is currently [expr {[channel get $channel quote] ? "on" : "off"}]"
}
Viewing your code i see alot of if's where you can easily use elseif's.
All those if's are not needed and elseif would be a better a choice.

It's upto you to use what i'm saying, i'm not forcing upon it nor am i saying your a bad scripter. I used to write my scripts the same way :)

Take my advice/suggestions or don't. That's completely upto you :)
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Post by rt »

Hi metroid

Thanks for your suggestions, I appreciate them. I hope you didn't mind however I updated the script with your suggestions.
k
krieg
Voice
Posts: 13
Joined: Tue Nov 20, 2007 11:11 am

Post by krieg »

Links are broken.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

krieg wrote:Links are broken.
Look at the original post date and then put 2 and 2 together. :roll:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
MenzAgitat
Op
Posts: 118
Joined: Tue Jul 04, 2006 12:35 pm
Location: France
Contact:

Post by MenzAgitat »

If you are looking for a full featured quotes manager script and a working link, you can take a look at my Public Quotes System :wink:
Post Reply