I have a script by Flash, which I've modified to only be turned on in a single channel and other very simple things.
I'm using it to display quotes with, however, it doesn't like quite large ones.
I made a techsupport one, and that's got a few long ones - and they end before the "punchline.."
Here's the code:
Code: Select all
# techsupportie script by Flash___, based on Steinsky's quote script.
# ircflash@digdilem.org - #3am at irc.quakenet.org - Flash____
# Modified by Froberg to handle other stuff.. yup..
#
# Adds channel commands: !techsupport
# This picks a line at random from a plain ascii file (one quote per line) and
# puts it in the same channel !techsupport 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 techsupport.txt into the scripts/ dir of your eggdrop
# and add the line to your eggdrop.conf file:
#
# source scripts/techsupport.tcl
#
# .rehash or reload your bot and job's done.
# Where are the techsupports ganna be kept? (Relative or absolute path to ascii file)
set techsupportfile scripts/techsupport.txt
# Which channels it's active on..
set activechannel [list #DSRack]
# 0 = display techsupports in channel
# 1 = display techsupports via private notice.
set techsupportvianotice 0
#------- Nothing else needs to be twiddled with --------
if { ![info exists toolbox_loaded] } { source scripts/alltools.tcl }
# Change !techsupport to something else if you need a different trigger
bind pub - !techsupport techsupport:pub:techsupport
proc techsupport:pub:techsupport {nick uhost hand chan arg} {
global techsupportfile techsupportvianotice
set techsupports ""
if {[lsearch -exact $::activechannel $chan] == -1} {
return 0
}
if { [file exists $techsupportfile] } { set file [open $techsupportfile r]
} else {
if { $techsupportvianotice == 0 } { putmsg $chan "$techsupportfile does not exist. You'll need to add techsupports to the database first by typing \002!addtechsupport <a techsupport>\002" }
if { $techsupportvianotice == 1 } { putnotc $nick "$techsupportfile does not exist. You'll need to add techsupports to the database first by typing \002!addtechsupport <a techsupport>\002" }
return 0
}
while { ![eof $file] } {
set techsupport [gets $file]
if { $techsupport != "" } {
set techsupports [linsert $techsupports end $techsupport]
}
}
close $file
if { $arg != "" } {
set pattern [string tolower $arg]
set atechsupports ""
set techsupport ""
foreach techsupport $techsupports {
set lowtechsupport [string tolower $techsupport]
if { [string match $pattern $lowtechsupport] } {
set atechsupports [linsert $atechsupports end $techsupport]
}
set techsupports ""
set techsupports $atechsupports
}
}
set row [rand [llength $techsupports]]
if { [expr $row >= 0] && [expr $row < [llength $techsupports]] } {
set techsupport [lindex $techsupports $row]
}
if { $techsupport != "" } {
if { $techsupportvianotice == 0 } {
putmsg $chan "Poor Tech Guys: $techsupport"
}
if { $techsupportvianotice == 1 } {
putnotc $nick "$techsupport"
}
}
return 1
}
putlog "techsupport.tcl By Flash! modified by Froberg running. !techsupport to invoke."
I tried using the code provided, but I couldn't make it work.
Here's a sample of it in action:
[03:47:44] <Froberg> !techsupport
[03:47:46] <DSRack> Poor Tech Guys: I can't connect with the network, remote user tells help desk. "After several minutes of troubleshooting, it was clear that the problem was the user's modem, which basically died," tech reports. Impatient user's next question: "Where can I download another modem?"
And here's a sample of a random line that's too long:
[03:49:56] <Froberg> !techsupport
[03:49:58] <DSRack> Poor Tech Guys: Customer: "My keyboard is not working anymore." Helpdesk: "Are you sure it's plugged into the computer?" Customer: "No. I can't get behind the computer." Helpdesk: "Pick up your keyboard and walk 10 paces back." Customer: "Okay." Helpdesk: "Did the keyboard come with you?" Customer: "Yes." Helpdesk: "That means the keyboard is not plugged in. Is there another keyboard?" Customer: "Yes, there's another one here. Ah, that o
--
If you wanted all of it;
Customer: "My keyboard is not working anymore." Helpdesk: "Are you sure it's plugged into the computer?" Customer: "No. I can't get behind the computer." Helpdesk: "Pick up your keyboard and walk 10 paces back." Customer: "Okay." Helpdesk: "Did the keyboard come with you?" Customer: "Yes." Helpdesk: "That means the keyboard is not plugged in. Is there another keyboard?" Customer: "Yes, there's another one here. Ah, that one works!"
Anyway - I kinda love these tech support things, and I'd hate having to shorten them down, or keep them out because of length :/
Can someone be my saviour?