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 

Hadace messaging problem
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
mrhex
Voice


Joined: 13 Nov 2005
Posts: 12

PostPosted: Thu Nov 17, 2005 10:17 pm    Post subject: Reply with quote

It by default want to create a folder in botdir/ called data/ , well actually it wants to create the path+file.(see uzeno.tcl code snippet below).

Code:

set message_db "data/h_message.dat"


I joined in his channel as he posted here, and did some bugfinding with him.

When i created the file manually by, mkdir data,
touch data/h_message.dat
Then added the line as below in uzeno.tcl to see if the script could read and continue, in h_message.dat.
Quote:
Hadace !messaging database file created

It is as the script is able to READ from the file but unable to write to/create the file.

it is not a write rights problem, i even made the file when creating it, rwxrwxrwx just to make shure.

I was to join in on #hadace today, to test a debug version of his script that he was gonna make, but i got RL (workrelated) hindrances.

Bseen is my personal favourite, well havent tried much nor have i needed to try any other seen scripts.
Has all the functions needed and supports wildcard searches on nicknames and such.

It states a database file also just as uzeno.tcl does.

named bs_data.<channame>

In which it stores and sort its data.

It uses this method to create the file.
Code:


proc bs_save {} {
  global bs_list userfile bs ; if {[array size bs_list] == 0} {return}
  if {![string match */* $userfile]} {set name [lindex [split $userfile .] 0]} {
    set temp [split $userfile /] ; set temp [lindex $temp [expr [llength $temp]-1]] ; set name [lindex [split $temp .] 0]
  }
  if {[file exists $bs(path)bs_data.$name]} {catch {exec cp -f $bs(path)bs_data.$name $bs(path)bs_data.$name.bak}}
  set fd [open $bs(path)bs_data.$name w] ; set id [array startsearch bs_list] ; putlog "Backing up seen data..."
  puts $fd "#$bs(updater)"   
  while {[array anymore bs_list $id]} {set item [array nextelement bs_list $id] ; puts $fd "$bs_list($item)"} ; array donesearch bs_list $id ; close $fd
}



Uzeno does this:

Code:

proc mess_write { nick cimzett uzenet } {
        global message_db
        set cimzett [string tolower $cimzett]
        if {![file exists $message_db]} {
                file mkdir [lindex [split $message_db /] 0]
                set filemuvelet [open $message_db w+] 
                puts $filemuvelet "Hadace !messaging database file created"
        } else {
                set filemuvelet [open $message_db a]       
        }
        set systemTime [clock seconds]
        set ido [clock format $systemTime -format {%d.%m.%Y. %H.%M:}]
        puts $filemuvelet "$nick $cimzett $ido [join $uzenet] "
        close $filemuvelet
}


The tcl wiki documentation say this about "open"

Code:



This command opens a file, serial port, or command pipeline and returns a channel identifier that may be used in future invocations of commands like read, puts, and close. If the first character of fileName is not | then the command opens a file: fileName gives the name of the file to open, and it must conform to the conventions described in the filename manual entry.
The access argument, if present, indicates the way in which the file (or command pipeline) is to be accessed. In the first form access may have any of the following values:


r
Open the file for reading only; the file must already exist. This is the default value if access is not specified.

r+
Open the file for both reading and writing; the file must already exist.

w
Open the file for writing only. Truncate it if it exists. If it doesn't exist, create a new file.

w+
Open the file for reading and writing. Truncate it if it exists. If it doesn't exist, create a new file.

a
Open the file for writing only. If the file doesn't exist, create a new empty file. Set the initial access position to the end of the file.

a+
Open the file for reading and writing. If the file doesn't exist, create a new empty file. Set the initial access position to the end of the file.
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Nov 17, 2005 11:00 pm    Post subject: Reply with quote

mrhex wrote:
Bseen is my personal favourite, well havent tried much nor have i needed to try any other seen scripts.

I only use the gseen module; faster, smaller.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
mrhex
Voice


Joined: 13 Nov 2005
Posts: 12

PostPosted: Thu Nov 17, 2005 11:18 pm    Post subject: Reply with quote

I am trying to but to tired after work today, need to get me sum sleep.

But it cant be that the script cant "open" h_message.dat.
Since it can READ it.

if i create the file and put "Hadace !messaging database file created" in the file. It triggers on !messages and goes through the file.
But it does not go through the file creation/write code when i trigger with
!msg nick message.
Something makes it pass "proc mess_write" part of the script, if i understand it correctly it would have displayed a Notice:

"Message for <nickname> accepted"

If i had written the syntax wrong i would have gotten:

"The right format: !msg <nick> <message(uzenet in code)>"

If something above had displayed the write to file code would have been passed through. So something makes the entire "proc mess_write" code section be bypassed.

I am using the latest "stable" tcl version.
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Nov 18, 2005 2:46 am    Post subject: Reply with quote

BSeen creates the folder that the db file is to be created and this is the method used to create and access that file: $bs(path)bs_data.$name.

If the script you are playing with is "bypassing" an entire proc it would be that it cannot either create the folder or find the folder that the file is in. Either way, there should be a log of any error event.

As for gseen, it's simple and as it is based on BSeen it has all the functions your are used to. Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Stella
Voice


Joined: 02 Jan 2006
Posts: 1

PostPosted: Mon Jan 02, 2006 2:31 pm    Post subject: Reply with quote

In line 4 of the english tcl

Code:
bind pub v|o "!msg" mess_do


change to

Code:
bind pub o|o "!msg" mess_do


Now it will write to the database file..Very Happy

I'm not sure at this stage if "voices" can use it, but ops definately can

Stella
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 Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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