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.

a little help

Old posts that have not been replied to for several years.
Locked
s
sirkrunch
Voice
Posts: 19
Joined: Wed Oct 09, 2002 2:36 am

a little help

Post by sirkrunch »

i'm wanting to write info to a file
this is what I have so far

set filename NewInformation.info

bind msg - "!info*" writefile

proc writefile { <not sure what to have here> } {
set WriteFile [open $filename w]
puts $WriteFile "<not sure how to but the text after !note in here>"
close $WriteFile
}

can some1 help
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

1.

Code: Select all

proc writefile { <not sure what to have here> } { 
here u should have

Code: Select all

proc writefile {nick host hand text} {
2.

Code: Select all

puts $WriteFile "<not sure how to but the text after !note in here>" 
put in what u want, in your case u should have

Code: Select all

puts $WriteFile $text
I suggest u take a look at the tcl-commands.doc in the /doc dir of your eggdrop...
Elen sila lúmenn' omentielvo
s
sirkrunch
Voice
Posts: 19
Joined: Wed Oct 09, 2002 2:36 am

Post by sirkrunch »

don't i need to set $text?

and does the rest of the code look fine?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

$text is the text that comes after the !info command... (i.e !info this is just a little note)

u have to make the $filename variable global
also maybe u have to set the $filename to the dir to where u are storing the file... i.e set filename "/home/eggdrop/text/NewInformation.info"
Elen sila lúmenn' omentielvo
s
sirkrunch
Voice
Posts: 19
Joined: Wed Oct 09, 2002 2:36 am

Post by sirkrunch »

another question
why
{ nick host hand text }
whats it mean and why do you need it?
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

Procs

Post by spyda »

Code: Select all

bind PUB - test script:pub
proc script:pub {nick uhost hand chan text} {
In this cause with a trigger of PUB the proc will automaticly pick up the $nick $uhost $hand $chan $text. In this case:
$nick = person that triggered the command
$uhost = the host of the person that triggered the command
$hand = (if the next is on user file) the scripts will make the $hand the nick that is used in the user file) eg: I triggered with nick ThePop bot the bot knows I am ThePope from the user file so it sets $hand ThePope
$chan = the channels where the command is triggered
$test = anything after the wrote test www.eggdrop.org would set $text to www.egghelp.org

Code: Select all

bind MSG - test script:msg
proc script:msg {nick uhost hand text} {
In this case there is no $chan set in the proc, for that the bot dont know what chan it came from cause it was a msg and not a pubil command
$nick = person the triggered the command
$uhost = the host of the person that triggered the command
$hand = (if the next is on user file) the scripts will make the $hand the nick that is used in the user file) eg: I triggered with nick ThePop bot the bot knows I am ThePope from the user file so it sets $hand ThePope
$test = anything after the wrote test www.eggdrop.org would set $text to www.egghelp.org

Hope that helps you out.. Also aways look at tcl-command.doc that is located in you /eggdrop/docs.
------------
ThePope
s
sirkrunch
Voice
Posts: 19
Joined: Wed Oct 09, 2002 2:36 am

Post by sirkrunch »

thanx alot :)

cleared that all up
Locked