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 

Qoutes...kind of !

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Tue May 13, 2003 5:42 pm    Post subject: Qoutes...kind of ! Reply with quote

Hi
i wonder if it is possible to make a command available in dcc like .something (text) and have it store in a txt file in the format

date-text-bywhom

so it will lokk like that

in dcc : .something this is a test

in the text file

11-05-2003 : this is a test : set by user

thanks for ideas

Pitchat
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
stdragon
Owner


Joined: 23 Sep 2001
Posts: 959

PostPosted: Wed May 14, 2003 1:33 am    Post subject: Reply with quote

Yes it is possible. Have a text file with each line in the format:

unixtime username text

The reason is that unixtime and username are guaranteed to be only one word, whereas text may be several words with any character. This way it's easier to parse the data.

Anyway, have your script read in each line and search for whatever the user typed, displaying any matches.

If you have any more specific questions as your script progresses, feel free to ask.
Back to top
View user's profile Send private message Visit poster's website
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed May 14, 2003 2:16 am    Post subject: Reply with quote

sure i have questions lol

i try almost all quotes scripts available and i must admit i am lost so if you can get me started in the right direction it will be appreciate
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3581
Location: Mint Factory

PostPosted: Wed May 14, 2003 2:26 am    Post subject: Reply with quote

Code:

set bla(file) "bla.txt"

bind dcc - bla dcc:bla

proc dcc:bla {hand idx text} {
if {![file exists $::bla(file)]} {
putdcc $idx "Error: $::bla(file) dose not exist."
return 0
}
set file [open "$::bla(file)" r]
while {![eof $file]} {
set line [gets $file]
if {[string match [lrange [split $text] 1 end] $line]} {
putdcc $idx "Topic already exists."
return 0
}
}
catch {close $file}
set file [open "$::bla(file)" a]
puts $file "[unixtime] [lrange [split $text] 1 end] $hand"
putdcc $idx "New topic added: [lrange [split $text] 1 end]"
catch {close $file}
}

I haven't tested it cos I don't have where (ATM) cos I'm @ school Smile
_________________
I tawt I taw a puddy tat!
Back to top
View user's profile Send private message
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed May 14, 2003 12:49 pm    Post subject: Reply with quote

it seems to work but not the way i want Wink

[12:45] (Pitchat): .potin test
[12:45] (Precieuse): Topic already exists.

it is not for a topic purpose it is more of a reminder thing so it doesnt add the infos in the txt file.


ideas ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3581
Location: Mint Factory

PostPosted: Thu May 15, 2003 2:43 am    Post subject: Reply with quote

Replace from:
Code:

if {[string match [lrange [split $text] 1 end] $line]} {

to:
Code:

if {[string match [lrange [split $text] 0 end] $line]} {

and from:
Code:

puts $file "[unixtime] [lrange [split $text] 1 end] $hand"
putdcc $idx "New topic added: [lrange [split $text] 1 end]"

to:
Code:

puts $file "[unixtime] [lrange [split $text] 0 end] $hand"
putdcc $idx "New topic added: [lrange [split $text] 0 end]"

and should be working..
_________________
I tawt I taw a puddy tat!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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