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 

something is Wrong to this code

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


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

PostPosted: Tue Oct 30, 2007 2:16 am    Post subject: something is Wrong to this code Reply with quote

Code:

# Change this binding if you want.

bind pub - !help pub_help

# }------------------------------------------------------------------{
# You shouldnt need to change anything from hereon.

global helpcount
set helpcount 0

proc decr {var} {
   return [expr $var -1]
}

proc addhelp {modes usage info} {
   global helpmodes helpusage helpinfo helpcount
   
   set helpmodes($helpcount) $modes
   set helpusage($helpcount) $usage
   set helpinfo($helpcount) $info
   set helpcount [incr helpcount]
   return 1
}

proc pub_help {nick uhost hand chan args} {
   global helpmodes helpusage helpinfo helpcount
   
   set helptotal [decr $helpcount]
   if { $helptotal == "-1" } {
      putserv "NOTICE $nick :No commands for $chan documented...sorry =("
      return 0
   }
   
   putserv "NOTICE $nick :\002Commands available to you on $chan\002"
   
   set i 0
   while { 1 } {
      if { [matchattr $hand $helpmodes($i)] || $helpmodes($i) == "" } {
         # Ok, the user has access to this one..display it
         putserv "NOTICE $nick :Usage: \002$helpusage($i)\002"
         putserv "NOTICE $nick :  $helpinfo($i)"
      }
      # If not, oh well...they wont care.
      
      # Increment the count
      set i [incr i]
      
      if { [decr $i] == $helptotal } {
         # Yep...we're past due..
         break
      }
      # Otherwise, just let the loop flow.
   }
   
   # End the help.
   
   putserv "NOTICE $nick :\002 --- Thats all --- \002"
   return 0
}

addhelp "" "!help" "--- My Useful Commands ---"
addhelp "" "\002!google\002 <define:|spell:> <search terms> \002!images\002 <search terms> \002!groups\002 <search terms> \002!local\002 <what> near <where> \002 !QL \002 <General Quotes> \002 !mash \002 <Quotes of mash>"
addhelp "" "\002!print\002 <search term> \002!video\002 <search terms> \002!fight\002 <word(s) one> vs <word(s) two> \002!stat\002 <This is to know about ur stats on Channel>"
addhelp "" "\002!top10\002 <For General Stats of the Channel> \002!ip\002 <Nick/host/IP ---- an easy way to know about the address \002!ip\002 <Nick/host/IP - an easy way to know about the address"
addhelp "" "\002!ip\002 <Nick/host/IP ---- an easy way to know about the address \002 !QL \002 <General Quotes> \002 !mash \002 <Quotes of mash>"

putlog "Global-Hel. v1.00 by BLuEPhYsH Successfully loaded!"



The Errors are

Code:
[06:10] Tcl error in file 'HosTer.conf':
[06:10] wrong # args: should be "addhelp modes usage info"
    while executing
"addhelp "" "\002!google\002 <define:|spell:> <search terms> \002!images\002 <search terms> \002!groups\002 <search terms> \002!local\002 <what> near <..."
    (file "scripts/chelp.tcl" line 92)
    invoked from within
"source scripts/chelp.tcl"
    (file "HosTer.conf" line 248)
[06:10] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)


it should not show one thing thats it
Code:

-HosTer- Usage: !help
-HosTer-   --- My Useful Commands ---
-HosTer- Usage: !google
-HosTer-   <define:|spell:> <search terms> !images <search terms> !groups <search terms> !local <what> near <where>


it shuold not do 2 notices for one line :((
Usage:etc please Remove this things
i will be so glad if helped :P
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Oct 30, 2007 3:40 am    Post subject: Reply with quote

Read here about how to load scripts without crashing the bot and getting more useful debug output from it:

http://forum.egghelp.org/viewtopic.php?p=63899#63899

The info you posted isn't really helpful in debugging that script..

If all you want is a basic help file type thing, here's an example of what I use:
Code:

bind pub - !help pub:help

proc pub:help{nick uhost hand chan text} {
        global botnick
        if {$chan == "privmsg"} {set chan $nick}
        if {[onchan $nick]} {
                puthelp "PRIVMSG $nick :\00310Fun & Games\003"
                puthelp "PRIVMSG $nick :blackjack: Blackjack/21 card game. Type .bjhelp for usage."
                puthelp "PRIVMSG $nick :.bofh    : Bastard Operator From Hell Excuse Generator!"               
                puthelp "PRIVMSG $nick :.deliver : Send a friend some ascii art! /msg $botnick deliver help"
                puthelp "PRIVMSG $nick :.dice    : Advanced dice rolling script - Type .dice help for usage"
                puthelp "PRIVMSG $nick :.fhoro   : Funny Horoscopes - Type .fhoro <sign> in channel."       
                puthelp "PRIVMSG $nick :.greet   : Greet script - Set a custom greeting when you join"     
                return
        }
}
#-antiword-wrap-##############################################################################################     

Now go read some basic tcl scripting and eggdrop documentation so you can learn how to add/edit the lines to say whatever you want for your help file.
Back to top
View user's profile Send private message
Thanhas
Op


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

PostPosted: Tue Oct 30, 2007 7:44 am    Post subject: :( Reply with quote

Quote:
invalid command name "\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1025{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}}
[04:07:47:p:30:Oct] <(HosTer> {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\ltrpar\sb100\sa100\lang1033\f0\fs24 bind pub - !help pub:help \line\line proc pub:help\{nick uhost hand chan text\} \{ \line global botnick \line if \{$chan == "privmsg"\} \{set chan $nick\} \line if \{[onchan $nick]\} \{ \line puthelp "PRIVMSG $nick :\\00310Fun & Games\\003" \line puth
[04:07:47:p:30:Oct] <(HosTer> [11:37] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
[04:07:47:p:30:Oct] <(HosTer> [12] Chat closed


thats the error of ur fiven code :((
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Tue Oct 30, 2007 7:50 am    Post subject: Re: :( Reply with quote

Thanhas wrote:
thats the error of ur fiven code Sad(

No. That error is caused by you saving the script in some weird format. (looks like wordpad rtf)
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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