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.

need help for TheHelper script

Old posts that have not been replied to for several years.
Locked
t
tesa

need help for TheHelper script

Post by tesa »

i want use this scirpt with windrop under windows. i have this error on start windrop :
[] * You need to edit thehelper.tcl and compile the help files.

i configured the thehelper100.tcl and create an example irc.dat file.

whats wrong? can anyone help me plz? you need more info from my error?

thank you for helping


ps: sorry for my bad englisch. i hope you understand me ;)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

showing thehelper.tcl script would be good.
t
tesa

Post by tesa »

ok here is it :

Code: Select all

#         Script : TheHelper v1.00 by David Proper (Dr. Nibble [DrN])
#                  Copyright 2002 Radical Computer Systems
#                             All Rights Reserved
#
#       Testing
#      Platforms : Linux 2.2.16   TCL v8.3
#                  Eggdrop v1.6.2
#            And : SunOS 5.8      TCL v8.3
#                  Eggdrop v1.5.4
#
#    Description : TheHelper is a simple TCL for doing quick and easy FAQ
#                  type help files for a channel. Ideal for help channels
#                  or anyone sick of answering the same [censored] over and over
#                  again. :)
#
#          Setup : The FAQ files comes in a data file that must be compiled.
#                  The compiler is mkhelper.
#                  The format of the datafile is as follows:
#                  Lines starting with a - is added to the main index
#                  Lines starting with a ? begin a question
#                  Lines starting with a space are added to the question file
# Example:
# -This is an example help file
# ?Question 1
#  This would be the answer to question 1
# ?Question 2
#  This would be the answer to question 2
#
#        History : Version history is now an external file. See thehelper.hst
#
#
#   Future Plans : Fix Bugs. :)
#
# Author Contact :     Email - DProper@stx.rr.com
#                  Home Page - http://home.stx.rr.com/dproper
#                        IRC - Primary Nick: DrN
#                     UseNet - alt.irc.bots.eggdrop
# Support Channels: #RCS @UnderNet.Org
#                   #RCS @DALnet
#                   #RCS @EFnet (Not sure if this will be perm or not)
#                   #RCS @GalaxyNet (Not sure if this will be perm or not)
#
# New TCL releases are sent to the following sites as soon as they're released:
#
# FTP Site                   | Directory                     
# ---------------------------+-------------------------------
# ftp.chaotix.net            | /pub/RCS                      
# ftp.eggheads.org           | Various                       
# http://www.botcentral.net  | Various                       
# drn.realmweb.org           | /drn                          
#
# Chaotix.Net has returned. Web site and mailing list running.
#
#   Radical Computer Systems - http://www.chaotix.net:3000/rcs/
# To subscribe to the RCS mailing list: mail majordomo@chaotix.net and in
#  BODY of message, type  subscribe rcs-list
#
#  Feel free to Email me any suggestions/bug reports/etc.
# 
# You are free to use this TCL/script as long as:
#  1) You don't remove or change author credit
#  2) You don't release it in modified form. (Only the original)
# 
# If you have a "too cool" modification, send it to me and it'll be
# included in the official release. (With your credit)
#
# Commands Added:
#  Where     F CMD       F CMD         F CMD        F CMD
#  -------   - --------- - ----------- - ---------- - --------- - -------
#  Public:   - helper
#     MSG:   - helper
#     DCC:   - helper
#
# Public Matching: N/A
#

set cmdchar_ "!"
set helperver "v1.00.01"

set helperfiles {
  {irc   /scipts/irc/ General Questions about IRC}
}

die "You need to edit thehelper.tcl and compile the help files."

proc cmdchar { } {
global cmdchar_
return $cmdchar_
}

bind pub - [cmdchar]helper pub_helper
proc pub_helper {nick uhost hand chan rest} {
start_helper $hand $nick $chan 3 $rest
}

bind msg - helper msg_helper
proc msg_helper {nick uhost hand rest} {
 start_helper $hand $nick $nick 2 $rest
}


bind dcc - helper dcc_helper
proc dcc_helper {hand idx rest} {
 set channel [lindex [console $idx] 0]
 putidx $idx "Set $channel as your defualt channel"
 start_helper $hand $idx $channel 4 $rest
}

proc start_helper {hand nick chan dirc rest} {
global helperfiles
 set topic [lindex $rest 0]
 set rest [lrange $rest 1 end]
 if {$topic == ""} {
                   helper_sendit $nick $chan $dirc "Calling Syntax: [cmdchar]helper topic \[question#\]"

                   helper_sendit $nick $chan $dirc "To list avaliable topics:  [cmdchar]helper list"
                   return 0}
 if {[string tolower $topic] == "list"} {
   helper.list $nick $chan $dirc
   return 0}
 set usehelpfile [helper.getpath $topic]
 if {$usehelpfile == ""} {
                   helper_sendit $nick $chan $dirc "I can't find any topic called $topic."
                   helper_sendit $nick $chan $dirc "To list avaliable topics:  [cmdchar]helper list"
                   return 0}
 do_thehelper $dirc $nick $hand $chan "$usehelpfile" "$rest"
}

proc helper.list {nick chan dirc} {
global helperfiles
 set totalhelp [llength $helperfiles]
 set helploop 0
 helper_sendit $nick $chan $dirc "\26Name           \26 \26Description                \26"
 helper_sendit $nick $chan $dirc "--------------- -------------------------------"
  while {$helploop < $totalhelp} {
  set dl_data [lindex $helperfiles $helploop]
  set dl_trig [lindex $dl_data 0]
  set dl_path [lindex $dl_data 1]
  set dl_desc [lrange $dl_data 2 end]
  helper_sendit $nick $chan $dirc "[format "%-15s" $dl_trig] $dl_desc"
  incr helploop
                                  }
  helper_sendit $nick $chan $dirc "\26 * \26 EX: [cmdchar]helper name"
}

proc do_thehelper {dirc nick hand chan path rest} {
global helperver
set quey [lindex $rest 0]
set toey [lindex $rest 1]
set howsend "NOTICE"

if {([string index $quey 0] == "#")} {set quey [string range $quey 1 [string length $quey]]}

set gotaccess 0
if {($nick != $chan) && ([matchchanattr $hand |o $chan])} {set gotaccess 1}
if {([matchattr $hand o])} {set gotaccess 1}

if {($gotaccess) && ($toey != "")} {
      if {($toey == "#")} {
                           set toey $chan
                           helper_sendit $nick $chan $dirc "Sending Question $quey to $toey"
                           set dirc 1
                            } {
  helper_sendit $nick $chan $dirc "Sending Question $quey to $toey"
  set nick $toey
  set dirc 3
                              }
                                            }

if {$rest != ""} {set helpfile "${path}$quey"
                 } {set helpfile "${path}index"
                   }
helper_sendit $nick $chan $dirc "The Helper $helperver by DrN"
if {![file exists $helpfile]} {helper_sendit $nick $chan $dirc "Sorry, can't find the answer to that."; return 0}

if {[catch {set fd [open $helpfile r]}] == 0} {
                                               while {![eof $fd]} {
                                                  set inp [gets $fd]
                                                  helper_sendit $nick $chan $dirc "$inp"
                                                                  }
                                               close $fd
                                               helper_sendit $nick $chan $dirc "--- \002end\002"
                                              }
 }

###########################################################################
proc helper.getpath {topic} {
 global helperfiles
 set totalhelp [llength $helperfiles]
 set helperloop 0
 set usehelpfile [lindex [lindex $helperfiles 0] 1]
 set usehelpfile ""
 while {$helperloop < $totalhelp} {
  set dl_data [lindex $helperfiles $helperloop]
  set dl_trig [lindex $dl_data 0]
  set dl_path [lindex $dl_data 1]
  set dl_desc [lrange $dl_data 2 end]
  if {($topic == [string tolower $dl_trig])} {set usehelpfile $dl_path}
  incr helperloop
                               }
 return $usehelpfile
}

proc helper_sendit {nick channel dirc txt} {
 if {$dirc == "1"} { puthelp "PRIVMSG $channel :$txt" }
 if {$dirc == "2"} { puthelp "PRIVMSG $nick :$txt" }
 if {$dirc == "3"} { putnotc $nick "$txt" }
 if {$dirc == "4"} { putdcc $nick "$txt" }
}


putlog "TheHelper $helperver by David Proper (DrN) -: LoadeD :-"
return "TheHelper $helperver by David Proper (DrN) -: LoadeD :-"
i change this:

Code: Select all

set helperfiles {
  {irc   /scipts/irc/ General Questions about IRC}
}
i create in the directory /scripts/irc the irc.dat with the example.
here is the code from irc.dat :

Code: Select all

-This is an example help file 
?Question 1 
This would be the answer to question 1 
?Question 2 
This would be the answer to question 2 
i hope this help you to find the error
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

its pretty obvious,
you must remove this line:
die "You need to edit thehelper.tcl and compile the help files."

or just add a # before it, like this:
#die "You need to edit thehelper.tcl and compile the help files."
t
tesa

Post by tesa »

hi. now the bot goes online without error , but now i have another error :roll: :

Code: Select all

Tcl error [pub_helper]: invalid command name "putnotc"
the error comes when i use the helper command !helper list or !helper or the other commands
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Load the alltools.tcl from the scripts/ dir.
Once the game is over, the king and the pawn go back in the same box.
t
tesa

Post by tesa »

caesar wrote:Load the alltools.tcl from the scripts/ dir.
ok. he script is ready. and then?

edit: aaaaaaaaaaah. is running without errors. thank you very much caesar
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try putserv "NOTICE $nick :$txt"
instead of putnotc $nick "$txt" in the script.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ignore Sir_Fz's last post, no need to change it anymore :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

lol, sorry my connection was too slow so when I was replying I didn't see your reply caesar :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

No problem dude.. glad you're around. :)
Once the game is over, the king and the pawn go back in the same box.
Locked