| View previous topic :: View next topic |
| Author |
Message |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Tue Oct 30, 2007 2:16 am Post subject: something is Wrong to this code |
|
|
| 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 |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Oct 30, 2007 3:40 am Post subject: |
|
|
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 |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Tue Oct 30, 2007 7:44 am Post subject: :( |
|
|
| 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 |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Tue Oct 30, 2007 7:50 am Post subject: Re: :( |
|
|
| Thanhas wrote: | thats the error of ur fiven code ( |
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 |
|
 |
|