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.

[Solved] Issues with fortune.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
Carlin0
Halfop
Posts: 57
Joined: Tue Dec 04, 2018 3:41 pm
Location: Turin - Italy

[Solved] Issues with fortune.tcl

Post by Carlin0 »

It works on Ubuntu 22.04 but not on Debian 13

Script

Code: Select all

# Fortune Interface
#   by BarkerJr <http://barkerjr.net>
catch Fortune::uninstall
namespace eval Fortune {


##### SETTING #####

# Uncomments (remove the # from) the following set commands if you wish to
# change the defaults.

# Set this to what you wish to profex the command with ("" for none)
set cmdchar "!"

# [0/1] send via NOTICE (1=notice, 0=privmsg)
set notice 0


##### THE SCRIPT #####

if {[info exists notice]} {
  if {($notice != 0) && ($notice != 1)} {
    set notice 0
    putlog "WARNING: Fortune::notice must be 0 or 1\
            (setting to default of $notice)"
  }
} else { set notice 0 }

if {![info exists cmdchar]} { set cmdchar {!} }

bind pub - ${cmdchar}fortune Fortune::doit
proc doit {nick uhost hand chan arg} {
  variable notice
  switch -- $arg {
    {a} {set fortune {-a}}
    {c} {set fortune {-c}}
    {o} {set fortune {-o}}
    default {set fortune {}}
  }
  regsub -all \t [split [exec {fortune} $fortune] \n] {     } fortune
  if {$notice} { set way {NOTICE} } else { set way {PRIVMSG} }
  foreach line $fortune { puthelp "$way $chan :$line" }
  return 1
}

bind evnt - prerehash Fortune::uninstall
proc uninstall {args} {
  variable cmdchar
  catch "unbind pub - ${cmdchar}fortune Fortune::doit"
  global cmdchar
  catch "unbind pub - ${cmdchar}fortune Fortune::doit"
  unbind evnt - prerehash Fortune::uninstall
  namespace delete ::Fortune
}

}
Error

Code: Select all

[14:46:10] Tcl error [Fortune::doit]: couldn't execute "fortune": no such file or directory
.set errorInfo
[14:46:27] #Carlin0# set errorInfo
Currently: couldn't execute "fortune": no such file or directory
Currently:     while executing
Currently: "exec {fortune} $fortune"
Currently:     (procedure "Fortune::doit" line 9)
Currently:     invoked from within
Currently: "Fortune::doit $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
Thanks in advance
Last edited by Carlin0 on Mon Dec 01, 2025 4:24 pm, edited 1 time in total.
"From the diamonds nothing is born, from the manure the flowers are born ..."
--- F. De Andrè ---
n
nml375
Revered One
Posts: 2861
Joined: Fri Aug 04, 2006 2:09 pm

Re: Issues with fortune.tcl

Post by nml375 »

Hello,
The (debian) host you are running on, does not have the fortune package installed

See https://wiki.debian.org/fortune

Best regards,
nml375
NML_375
User avatar
Carlin0
Halfop
Posts: 57
Joined: Tue Dec 04, 2018 3:41 pm
Location: Turin - Italy

Re: Issues with fortune.tcl

Post by Carlin0 »

nml375 wrote: Mon Dec 01, 2025 2:09 pm Hello,
The (debian) host you are running on, does not have the fortune package installed

See https://wiki.debian.org/fortune

Best regards,
nml375
What are you saying?

Code: Select all

dpkg -l | grep fortune
ii  fortune-mod                     1:1.99.1-9                           amd64        provides fortune cookies on demand
ii  fortunes-it                     2.16-2                               all          Data files containing Italian fortune cookies
ii  fortunes-it-brianza             2.16-2                               all          Data files containing Brianza fortune cookies
ii  fortunes-it-off                 1.99-4.1                             all          Data files containing Italian fortune cookies, offensive section
EDIT: I simply restarted the bot and now it works...mystery
"From the diamonds nothing is born, from the manure the flowers are born ..."
--- F. De Andrè ---
Post Reply