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 

Tcl Error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
smolder
Voice


Joined: 06 Jul 2015
Posts: 11

PostPosted: Tue Jul 07, 2015 11:11 am    Post subject: Tcl Error Reply with quote

[Edit] (Just realized i have posted my topic on wrong forum, it should be on "Tcl FAQ" i think, i am sorry.)

Hello to all Tcl Gurus,
I got the Tcl script from this post http://forum.egghelp.org/viewtopic.php?t=19009
While trying to run the script i get this error message...

"Tcl error [curl:image]: couldn't open "/home/amo/public_html/images/dupe.db"

what is "dupes.db" and how to fix this error?

As mentioned in script Curl is required, i have already installed the Curl on my shell, do i need to configure it as well ? I am zero in Curl.
Hope you guys will help me out.
many thanks.

Code:
# 16/06/2012
# by doggo #omgwtfnzbs @ EFNET
# curl_image.tcl
#
# curl is required on the shell to use this script
# available @ http://curl.haxx.se/
#########################################################


bind pubm -|- {*://*.jpg*} curl:image
bind pubm -|- {*://*.jpe*} curl:image
bind pubm -|- {*://*.jpeg*} curl:image
bind pubm -|- {*://*.gif*} curl:image
bind pubm -|- {*://*.png*} curl:image
bind pubm -|- {*://*.bmp*} curl:image


set save_folder "/home/amo/public_html/images"
set dupe_links  "/home/amo/public_html/images/dupe.db"
set your_site "http://your.website.url"

proc curl:image {nick userhost handle channel str} {
global save_folder dupe_links your_site

set urlcheck(ext) {
       jpg
       jpe
       jpeg
       gif
       png
       bmp
}

if {![regexp {((?:http://|www\.)+[^ ]+)} $str str]} { return }
set extension ""
       set wlink $str
       if { [string match -nocase "*$your_site*" "$wlink"] == 1 } { return }
       regsub -all -- {(http://)+} $str "" str
       regexp {(www.)?[A-z|0-9|\-|\.|\_]*\.[A-z]{2,3}} $str host
       regexp {[/]+(.)*} $str url
       regexp {[A-z]{3,4}$} $str extension
       set ispic 0
       foreach i $urlcheck(ext) {
               if {[string match -nocase $extension $i]} {
                       set ispic 1
               }
       }

       if {$ispic != 1} { return }

       set file_name [md5 $wlink]

       set file [open $dupe_links r]
       set data [read $file]
       close $file
       set isdupe 0
       foreach line [split $data \n] {
           if { [string match -nocase "*$file_name*" "$line"] == 1 } {
               catch {unset data}
             set isdupe 1
           }
       }

       if {$isdupe == 1} { return }

       catch {exec curl $wlink -o $save_folder/$file_name.$extension}

       if {![file exists $save_folder/$file_name.$extension]} {
       return
       } else {
       set fp [open $dupe_links "a"]
       puts $fp $file_name.$extension
       close $fp
 
    }
}

putlog "curl_image.tcl loaded"
Back to top
View user's profile Send private message
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 221
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Mon Jul 13, 2015 7:30 pm    Post subject: Re: Tcl Error Reply with quote

the error is:
set save_folder "/home/amo/public_html/images"
set dupe_links "/home/amo/public_html/images/dupe.db"

change amo for user access example
set dupe_links "/home/my logging/public_html/images/dupe.db"
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
smolder
Voice


Joined: 06 Jul 2015
Posts: 11

PostPosted: Tue Jul 14, 2015 12:37 pm    Post subject: Re: Tcl Error Reply with quote

Arnold_x-p: thank you for your reply.
"amo" is my username on shell account. The issue is... there's no such file named "dupe.db" in any directory, it's kind of database file But i have no idea how to create/generate this file. Confused
Back to top
View user's profile Send private message
caesar
Mint Rubber


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

PostPosted: Wed Jul 15, 2015 1:55 am    Post subject: Reply with quote

in shell
Code:

touch /home/amo/public_html/images/dupe.db

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
smolder
Voice


Joined: 06 Jul 2015
Posts: 11

PostPosted: Fri Jul 17, 2015 5:05 pm    Post subject: Reply with quote

caesar wrote:
in shell
Code:

touch /home/amo/public_html/images/dupe.db


Thank you for you help Caesar. Dupe.db has been created but still this script is not working for me. Sad
I think i should find alternative.
Thank you once again for all you help guys.
Regards.
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 Requests 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