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 

Help script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Feb 23, 2009 1:11 pm    Post subject: Help script Reply with quote

Couldn't find in the archieve here a script that when you type !Help it plays a help file which you can configure..
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Mon Feb 23, 2009 1:22 pm    Post subject: Reply with quote

Something like:
Code:

bind pub - !help pub:help
 
proc pub:help {nick uhost hand chan arg} {
set chan [string tolower $chan]
 
  putserv "NOTICE $nick :Hello this is a help text"
 }

This will notic the one typing, instead of posting in the chanel.

Very simple, but i'm sure someone can make a better one
as i'm no pro at .tcl scripting.

*EDIT gah, didn't see you wanted it to read from a file
which mine doesn't.
Back to top
View user's profile Send private message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Tue Feb 24, 2009 4:19 pm    Post subject: Reply with quote

Code:

###
# Help script
###
#
###
# Config
###
#
##
# Helpfile:
set helpfile(file) "omfg_its_a_helpfile.txt"
##
#
##
# Output Target (private=0 channel=1)
set helpfile(target) 0
##
#
##
# Output Method (either "PRIVMSG" or "NOTICE")
set helpfile(method) "NOTICE"
##
#
###
# End of Config
###

bind pub !help pub:help

proc pub:help {nick host hand chan text} {
global helpfile

set fp [open $helpfile(file) r]
set data [split [read -nonewline $fp] "\n"]
close $fp

if {$helpfile(target) == 1} {
set target $chan
} else {
set target $nick
}

foreach line $data {
puthelp "$helpfile(method) $target :$line"
}
}

putlog "Helpfile Reader loaded with file $my_helpfile"


I wrote it in the forums textbox, so its not well formatted, but it should work.

The bot will output every line of the file in its own message, example:

Helpfile:
"Commands:
!help - Shows this text
!kickall - Kicks all users"

Channel:
<User> !help
<Bot> Commands:
<Bot> !help - Shows this text
<Bot> !kickall - Kicks all users
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 -> Script Requests 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