01-20-2018, 03:51 +0100
Search result (9)
All posts by: Mettwurst
AuthorPost
Topic: Keepout Script Error   Forum: workimminent problem solving      Goto post
Mettwurst  10-22-2005, 19:48 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
                                                                                                                              
1
2
3
4
5
6
7
proc keepout::ban {host} {
    if {![string match *[b]users.quakenet[/b]* $host]} {
        return "[string map "~ *[b]" [/b]*!$host]"
    } else {
        return "*!*@[lindex [split $arguments] 0]"
    }
}


that is your problem.
var "arguments" does not exist

should be
                                                                                                                              
1
2
3
4
5
6
7
proc keepout::ban {host} {
    if {![string match "*!*@users.quakenet.org" $host]} {
        return "*![string map "~ ?" $host]"
    } else {
        return "*!*@[lindex [split $host] 0]"
    }
}

Topic: [EGG] How to ping a person via ctcp   Forum: #tclcode snippets      Goto post
Mettwurst  08-11-2005, 16:12 | [EGG] How to ping a person via ctcp Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
German                                                                                                                               
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace eval ::pingCheck:: {
    set [namespace current](V) "0.1"

    bind pub n !ping  [namespace current]::pubPing
    bind ctcr - PING  [namespace current]::ctcrPing


    proc [namespace current]::pubPing {nick host hand chan text} {
        global [namespace current]
        if {[set victim [string tolower [lindex [split $text] 0]]] == ""} {
            set victim [string tolower $nick]
        }
        set [namespace current](replyTo:$victim) $nick
        set [namespace current](TimerID:$victim) [utimer 30 [list [namespace current]::deletePing $victim $nick]]
        putserv "PRIVMSG $victim :\001PING [clock seconds]\001"
        putserv "NOTICE $nick :\273\273 Pingrequest gesendet."
        set [namespace current](Startping:$victim) [clock clicks]
    }

    proc [namespace current]::ctcrPing {nick host hand dest key text} {
        set endTime [clock clicks]
        global [namespace current]
        set startTime [set [namespace current](Startping:[string tolower $nick])]
        if {![info exists [namespace current](Startping:[string tolower $nick])]} {
            putcmdlog "Unbekannte PingrŁckgabe von $nick."
            return
        }
        set resultTime [expr {($endTime - $startTime)/1000.0}]ms
        putserv "NOTICE [set [namespace current](replyTo:[string tolower $nick])] :\273\273 Der Ping zu $nick benŲtigte $resultTime."
        catch {killutimer [set [namespace current](TimerID:[string tolower $nick])]}
        catch {unset [namespace current](Startping:[string tolower $nick])}
        catch {unset [namespace current](replyTo:[string tolower $nick])}
        catch {unset [namespace current](TimerID:[string tolower $nick])}
    }


    proc [namespace current]::deletePing {victim nick} {
        global [namespace current]
        catch {unset [namespace current](Startping:$victim)}
        catch {unset [namespace current](replyTo:$victim)}
        catch {unset [namespace current](TimerID:$victim)}
        putserv "NOTICE $nick :\273\273 $victim hat auch nach 30 Sekunden nicht geantwortet. Pingcheck wird abgebrochen."
    }
};#NAMESPACE END


English:                                                                                                                               
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace eval ::pingCheck:: {
    set [namespace current](V) "0.1"

    bind pub n !ping  [namespace current]::pubPing
    bind ctcr - PING  [namespace current]::ctcrPing


    proc [namespace current]::pubPing {nick host hand chan text} {
        global [namespace current]
        if {[set victim [string tolower [lindex [split $text] 0]]] == ""} {
            set victim [string tolower $nick]
        }
        set [namespace current](replyTo:$victim) $nick
        set [namespace current](TimerID:$victim) [utimer 30 [list [namespace current]::deletePing $victim $nick]]
        putserv "PRIVMSG $victim :\001PING [clock seconds]\001"
        putserv "NOTICE $nick :\273\273 Pingrequest sent."
        set [namespace current](Startping:$victim) [clock clicks]
    }

    proc [namespace current]::ctcrPing {nick host hand dest key text} {
        set endTime [clock clicks]
        global [namespace current]
        set startTime [set [namespace current](Startping:[string tolower $nick])]
        if {![info exists [namespace current](Startping:[string tolower $nick])]} {
            putcmdlog "Unknown pingreply by $nick."
            return
        }
        set resultTime [expr {($endTime - $startTime)/1000.0}]ms
        putserv "NOTICE [set [namespace current](replyTo:[string tolower $nick])] :\273\273 Duration of pingrequest to $nick: $resultTime."
        catch {killutimer [set [namespace current](TimerID:[string tolower $nick])]}
        catch {unset [namespace current](Startping:[string tolower $nick])}
        catch {unset [namespace current](replyTo:[string tolower $nick])}
        catch {unset [namespace current](TimerID:[string tolower $nick])}
    }


    proc [namespace current]::deletePing {victim nick} {
        global [namespace current]
        catch {unset [namespace current](Startping:$victim)}
        catch {unset [namespace current](replyTo:$victim)}
        catch {unset [namespace current](TimerID:$victim)}
        putserv "NOTICE $nick :\273\273 $victim did not answer after 30 seconds. Pingcheck stopped."
    }
};#NAMESPACE END


SYNTAX !ping ?nick?
This post was edited 2 times, last on 08-12-2009, 22:18 by thommey
Topic: (ger) Bot schmiert immer ab.   Forum: workimminent problem solving      Goto post
Mettwurst  06-16-2005, 17:43 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
Quote by "DeadCanny":
Und wieso is die bei ihm fast 2 GB gro√ü?  :shock:

Zufall. Is halt "Datenschrott"

                                                                                                                              
1
2
3
4
bind time - * *time:deleteCoreFiles
proc *time:deleteCoreFiles args {
    foreach file [glob core.*] { catch {file delete $file} }
}


entfernt es...
Topic: (ger) Bot schmiert immer ab.   Forum: workimminent problem solving      Goto post
Mettwurst  06-16-2005, 17:39 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
Quote by "DeadCanny":
Darunter hinaus erstellt der Bot im eggdrop ordner eine Datei mit dem namen "core" (ohne endung usw.)
Diese Datei ist stolze ~1,8 GB groß Shocked

Dat mein ich ;D


Ist halt so.. hab auch 4 Core-Dateien aber kannste löschen und ned beachten...
Topic: (ger) Bot schmiert immer ab.   Forum: workimminent problem solving      Goto post
Mettwurst  06-16-2005, 17:37 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
Quote by "DeadCanny":
Sag doch mal die Lösung, das Problem mit dem Core hatte schonma wer


Das hat nichts mit "Core" zutun, sondern, dass seine Sockets nen timeout hatten. Er hatte:

                                                                                                                              
1
2
3
4
5
if {[catch {set sock [socket <host> <port]} error]} {
    return "Error: $error"
} else {
    return "Socket ok"
}


Aber da sein Host nicht geantwortet hat, kam der Bot eben in's Timeout.

Funktionierende Version:
                                                                                                                              
1
2
3
4
5
if {[catch {set sock [socket -async <host> <port]} error]} {
    return "Error: $error"
} else {
    return "Socket ok"
}


Das "-async" sch√ľtzt vor Timeouts..
Topic: (ger) Bot schmiert immer ab.   Forum: workimminent problem solving      Goto post
Mettwurst  06-07-2005, 21:27 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
Du darfst es ruhig hier posten. es gibt noch mehr leute als mich die helfen könnten. raten wird hier keiner.
Topic: (ger) Bot schmiert immer ab.   Forum: workimminent problem solving      Goto post
Mettwurst  06-07-2005, 21:24 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
hast irgend nen script das mit der dns meldung was zutun haben könnte? (irgend nen script das sockets oder ähnliches hat?)
wenn ja wäre es evtl sinnvoll den code zu posten...
Topic: (ger) supportscript   Forum: workimminent problem solving      Goto post
Mettwurst  11-11-2004, 13:37 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
1. Dir fehlen die Grundladen.
- Du gibst einem Command (lindex) einen string, der will aber eine Liste.
Les dir mal http://www.suninet.nl/tclguide/ durch.

Zu deinen Scripten:
Solche existieren bereits. Siehe www.egghelp.org -> TCL-Archive -> search for "next"
Topic: [TCL] Getting the source code of a web site   Forum: #tclcode snippets      Goto post
Mettwurst  08-26-2004, 22:02 Homepage
(Moderator)

Avatar

Member since 04/2004
13 Posts
Location: Stuttgart/Germany
another one:                                                                                                                               
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

# load the http package
package require http

# send the http request, -timeout sets up a timeout to occur after the specified number of milliseconds, we use catch to avoid an abort of the script in case of an error when executing http::geturl (e.g. due to an unsupported url)
if {[catch { set token [http::geturl http://yourhost.com -timeout 3000]} error] == 1} {
    putcmdlog "$error"
    return
    # if the the site does not exist
} elseif {[http::ncode $token] == "404"} {
    putcmdlog "Error: [http::code $token]"
    # check if the request was successful, if yes -> put the html source code into $data
} elseif {[http::status $token] == "ok"} {
    set data [http::data $token]
    # if a timeout has occurred, send "Timeout occured" to the standad output device
} elseif {[http::status $token] == "timeout"} {
    putcmdlog "Timeout occurred"
    # send the error to the standard output device if there is one
} elseif {[http::status $token] == "error"} {
    putcmdlog "Error: [http::error $token]"
}
# last but not least, release the memory which was used for these operations
http::cleanup $token



same like mirage's but with check if the site exists

Edit: small bugs fixed
This post was edited 3 times, last on 08-14-2009, 04:22 by thommey
Go to forum
Unclassified NewsBoard 1.5.3-d | © 2003-4 by Yves Goergen | Time: 718.2 msec, CPU time: 132 msec, 59 Database queries in 145.4 msec | 6.8 kB (62.5 kB) | Timezone: +0100