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.

CHATstats 3.1.2 everything works but ftp to website

Support & discussion of released scripts, and announcements of new releases.
Post Reply
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

CHATstats 3.1.2 everything works but ftp to website

Post by DallasD »

I have managed to get CHATstats 3.1.2 to work in every way on my windrop, if i set it to publish the webpages it always fails. I sure could use some help to figure this out. I know it is going to be something simple.

i all was get "CHATstats: An error occured while trying to use FTP."
but if i set it to just make the web page and leave them alone it works fine.

Setup is as follows:

set cs(workdir) "E:/Documents/Webs/my_stats/"
set cs(trigger) "!"
set cs(idle) 900
set cs(dont) "fserv type trigger"
set cs(global) {
post=2
rankrange=10
timebalance=0
trimlimit=50
adinterval=90
adsite=http://www.mysite.com
update=5
htmsuffix=.htm
ulmethod=2
localfolder=E:/Documents/Webs/mysite/public_html
ftpname=www.mysite.com/
ftpport=21
ftpfolder=/public_html/
username=me
password=123
}

if i do .set errorInfo after i get the error this is what i get:

09:01] CHATstats: An error occured while trying to use FTP.
.set errorInfo
[09:01] #Dallas_Dom# set errorInfo
Currently: couldn't duplicate output handle: bad file number
Currently: while executing
Currently: "open "|$cs(ftpclient) -n $cs(ftpname) $cs(ftpport)" w"
Currently: couldn't duplicate output handle: bad file number

Can someone please tell me what i have done wrong or even how to make or get a script that will move the webpages to the site once this script makes them.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Try changing this

Code: Select all

 ftpname=www.mysite.com/
to the IP address of your ftp server and make surer there is no trailing /
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

Post by DallasD »

Thanks for the idea. But alas even after making that change I still get the same responce.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Can you manually ftp into your ftp account using 'cmd'? ie

Code: Select all

ftp

open www.yoursite.com 21

enter username

enter password
If this works then we will have to look at what chatstats is trying todo more closely.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

Post by DallasD »

Yes i can ftp into my site that way. for now i am manualy sending web pages to the site. I just can not get the script to do it
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Ok looking at the script it seems to me that it is looking for an ftp program within a unix operating environment. As you are using a windrop it seems that it cant find the ftp program and cannot upload a file.

Code: Select all

set cs(ftperror) [catch {set cs(ftpclient) [exec which ftp]}]; set cs(rehash) 1
 if {$cs(ftperror) && [file executable /usr/bin/ftp]} {set cs(ftpclient) "/usr/bin/ftp"; set cs(ftperror) 0}
 if {$cs(ftperror) && [file executable /bin/ftp]} {set cs(ftpclient) "/bin/ftp"; set cs(ftperror) 0}
 if {$cs(ftperror) && [info commands auto_execok] != ""} {
  set cs(ftpclient) [auto_execok ftp]
 
Also there have been several posts over the past few months where users cannot get windrops to 'exec' any program outside of the eggdrop this could also be your problem. This all said and done doesn't help you much into fixing the problem and unfortunately I cant see any quick fix either. :cry:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

Post by DallasD »

Thanks! The following is from the script. I managed to stop the error by removing the "user " from the script. But although this stops the error it still does not put the web pages on my site.

Code: Select all

switch -exact $cs(ulmethod) {
   1 {foreach e $ullist {
       if {[file exists $e]} {
        file copy -force $e $cs(localfolder)
        file delete -force $e
       } else {putlog "CHATstats: Skipped moving $e, file not found."}
      }
     }
   2 {set ftperror [catch {
       set ftpid [open "|$cs(ftpclient) -n $cs(ftpname) $cs(ftpport)" w]
       puts $ftpid "user $cs(username) $cs(password)"
       foreach a $ullist {
        if {[file exists $a]} {
         puts $ftpid "put $a $cs(ftpfolder)[lindex [split $a "/"] end]"
        } else {putlog "CHATstats: Skipped uploading $a, file not found."}
       }
       puts $ftpid "quit"
       close $ftpid
      }]

I am really not sure where to go from here. Any ideas?
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

Post by DallasD »

Correction: The error is still coming up.

Currently: couldn't duplicate output handle: bad file number
Currently: while executing
Currently: "open "|$cs(ftpclient) -n $cs(ftpname) $cs(ftpport)" w"

Now i really need some ideas. I do not know what to do now.
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

Post by DallasD »

Ok corrected the code to the following:

Code: Select all

if {$ullist != ""} {
  switch -exact $cs(ulmethod) {
   1 {foreach e $ullist {
       if {[file exists $e]} {
        file copy -force $e $cs(localfolder)
        file delete -force $e
       } else {putlog "CHATstats: Skipped moving $e, file not found."}
      }
     }
   2 {set ftperror [catch {
       set ftpid [open "$cs(ftpclient) -n $cs(ftpname) $cs(ftpport)" w]
       puts $ftpid "$cs(username) $cs(password)"
       foreach a $ullist {
        if {[file exists $a]} {
         puts $ftpid "put $a $cs(ftpfolder)[lindex [split $a "/"] end]"
        } else {putlog "CHATstats: Skipped uploading $a, file not found."}
       }
       puts $ftpid "quit"
       close $ftpid
      }]
      if {$ftperror} {putlog "CHATstats: An error occured while trying to use FTP."}
      foreach a $ullist {file delete -force $a}
     }
  }
 }
Now the error reads:

update #mychannel
Successfully updated webpages for #mychannel
[07:12] Tcl error in script for 'timer15':
[07:12] couldn't open "/Windrop/mychannel.html~new": no such file or directory
.set errorInfo
[07:13] #Me# set errorInfo
Currently: couldn't open "/Windrop/mychannel.html~new": no such file or directory
Currently: while executing
Currently: "open $dir$file2~new w"
Currently: (procedure "do_ques" line 25)
Currently: invoked from within
Currently: "do_ques"

This erro i do not understand. As far as i know i have nothing that points this script to the Windrop dir. Now i really neew help!
D
DallasD
Voice
Posts: 14
Joined: Sat May 14, 2005 10:08 pm

Post by DallasD »

I have managed to fix every error but one. But i have gotten it to make the web pages on my system. Does anyone think that they may be able to help me on this. It seems to br the FTP part of the script. The error is as follows:

#me# set errorInfo
Currently: couldn't execute "which": no such file or directory
Currently: while executing
Currently: "exec which ftp"
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

it is trying to locate the ftp client ("which" should return its path).
so either you replace "exec which ftp" with its path, or you grab a copy of "which" compiled for windows.
photon?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you can install it via the cygwin installer, under base there is which. just unselect all other packages or better... install the inet utils (under net), i doubt it would find any ftp without being any there :D.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
H
Hunty
Voice
Posts: 1
Joined: Sun Aug 14, 2005 7:41 am
Location: Third stone from the Sun

Post by Hunty »

We have exactlly the same problem as DallasD has described.

we are using eggdrop v1.6.17, on Linux 2.6.10-grsec.

No matter what we do the script refuses to open ftp, weve tried, ftp.name ftp.ipnumber ft://ipnumber etc have also tried to link it too two other ftp sites we have but no matter what we do it refuses to open ftp.

Weve tried setting both ulmethod=0 and ulmethod=1 which (should ??) avoid the need for the ftp to open, that didnt work either, still just the same error message,

In despertaion we uncommented ftpname= thru to password, set ulmethod=0 but again all we get is, Cannot find FTP client.

Any ideas where we can go from here are more than welcome, i appologise if this should have been in a seperate thread as were using linux and not windows, but as the problem is the same it seemed like an idea to start with it here.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

read the top thread in "Scripting Help" forum and proceed accordingly
Post Reply