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 

CHATstats 3.1.2 everything works but ftp to website

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Sat May 14, 2005 10:15 pm    Post subject: CHATstats 3.1.2 everything works but ftp to website Reply with quote

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.
Back to top
View user's profile Send private message
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon May 16, 2005 5:38 am    Post subject: Reply with quote

Try changing this
Code:
 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
Back to top
View user's profile Send private message Visit poster's website
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Mon May 16, 2005 5:50 am    Post subject: Reply with quote

Thanks for the idea. But alas even after making that change I still get the same responce.
Back to top
View user's profile Send private message
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon May 16, 2005 6:00 am    Post subject: Reply with quote

Can you manually ftp into your ftp account using 'cmd'? ie
Code:
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
Back to top
View user's profile Send private message Visit poster's website
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Mon May 16, 2005 6:10 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon May 16, 2005 6:32 am    Post subject: Reply with quote

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.
Quote:
Code:
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. Crying or Very sad
_________________
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
Back to top
View user's profile Send private message Visit poster's website
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Mon May 16, 2005 6:39 am    Post subject: Reply with quote

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:
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?
Back to top
View user's profile Send private message
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Mon May 16, 2005 7:54 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Mon May 16, 2005 8:18 am    Post subject: Reply with quote

Ok corrected the code to the following:
Code:
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!
Back to top
View user's profile Send private message
DallasD
Voice


Joined: 14 May 2005
Posts: 14

PostPosted: Sun Jun 19, 2005 7:53 am    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
spock
Master


Joined: 12 Dec 2002
Posts: 319

PostPosted: Sun Jun 19, 2005 8:56 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Mon Jun 20, 2005 6:06 pm    Post subject: Reply with quote

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 Very Happy.
_________________
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...
Back to top
View user's profile Send private message MSN Messenger
Hunty
Voice


Joined: 14 Aug 2005
Posts: 1
Location: Third stone from the Sun

PostPosted: Sun Aug 14, 2005 9:59 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Aug 14, 2005 10:37 am    Post subject: Reply with quote

read the top thread in "Scripting Help" forum and proceed accordingly
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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