| |
| |
| |
|
Page: 1 2
Comments:
<0> __mac3: you want to randomize a list? <1> __mac3: perhaps you can use lsort using the -command option, and make a proc which does some type of randomization, for instance, $a > [expr (rand()+2)*5] <2> is there a function in tcl which opens a file and delete a line? for example !delete test.works ... <- on this trigger the eggdrop should open quotes.txt and delete test.works .. even when there are more words in the line like: time test.works said in #chan <1> no <1> you have to rewrite the entire file <1> if its a text file that is <2> :( <1> ? i dont see the problem <0> proc randomize_list {list} {while {[llength $list]} {set idx [expr int(rand() * [llength $list])]; lappend nlist [lindex $list $idx]; lreplace list $idx $idx}; set nlist} <0> randomize_list {1 2 3 4 5 6 7 8 9 10} <1> broked! <0> :/ <3> ; stripcodes <4> BL4DE: #4955 (574 clicks) Tcl error: wrong # args: should be "stripcodes strip-flags string" <3> ; info body stripcodes
<4> BL4DE: #4956 (1014 clicks) Tcl error: "stripcodes" isn't a procedure <3> ; info body stripcolors <4> BL4DE: #4957 (424 clicks) Tcl: <4> BL4DE: #4957 (424 clicks) Tcl: puts unknown {Use stripcodes instead if you're using Eggdrop v1.6.17 or higher. http://www.eggheads.org/support/egghtml/1.6.17/tcl-commands.html#misc} <4> BL4DE: #4957 (424 clicks) Tcl: regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\007} $text {} <4> BL4DE: #4957 (424 clicks) Tcl: <0> __mac3: ya, here you are: <0> proc randomize_list {list} {while {[llength $list]} {set idx [expr int(rand() * [llength $list])];lappend nlist [lindex $list $idx]; set list [lreplace $list $idx $idx]}; set nlist} <0> ;proc randomize_list {list} {while {[llength $list]} {set idx [expr int(rand() * [llength $list])]; lappend nlist [lindex $list $idx]; set list [lreplace $list $idx $idx]}; set nlist} <4> hest: #4964 (538 clicks) Tcl: <2> oh wtf.. <0> randomize_list {1 2 3 4 5 6} <4> hest: #4966 (3048 clicks) Tcl: 5 3 4 6 1 2 <1> let me try something <1> ;proc test {a b} {if {$a > [expr int(rand()*10)]} {return -1} else {return 1}} <4> fedex: #4970 (535 clicks) Tcl: <1> ;lsort -command test {1 2 3 4 5 6 7 8 9 10} <4> fedex: #4971 (3972 clicks) Tcl: 6 9 10 5 4 7 8 2 3 1 <1> k nm, more clicks <0> hmm <0> why should it be faster, fedex? <0> btw, dont rely 100% on SafeTcl <0> it might not show the correct amount of clicks <0> try it on your comp instead <5> hrmm <5> anyone that can help me with using cookies with ncgi <0> oh yah <0> i've never used ncgi <0> good thing you asked, cuz i had a look at it at tcllib <0> is it supposed to be a package to enable cgi-browsing using the html package? <5> pretty much a replacement of cgi_tcl <0> cgi.tcl :) <0> which is what im using <0> why should you rather use ncgi? <0> and are you running cgi, fcgi og scgi with it, btw? <0> im asking out of curiousity <5> well the box im deploying this cgi on only has ncgi <5> and im not sure <5> im new to tcl cgi <0> kewl <0> so am i <0> running lighttpd+cgi.tcl at the moment as apache+rivet won't run very good on win32 <6> blah, i cant seem to find hellgrammites for sale online :/ <0> what were you trying to do again, prh? <5> simply set a cookie <5> :/ <0> store a cookie? <0> i found that in the documentation <5> yeah <5> i can see the syntax <5> but i cant seem to get it to work <0> http://tcllib.sourceforge.net/doc/ncgi.html <0> what are you using now? <0> "This must be done before ::ncgi::header or ::ncgi::redirect is called in order for the cookie to be returned properly." <5> yeah thats not a problem <5> hrmm <5> keep in mind i've never used ncgi or a cookie before... <5> ncgi::setCookie -name user -value "test" <5> :S <6> blah, my apache server wont load a page. <0> neither have i
<0> well, i've set cookies with both rivet and mod_dtcl and it worked great <0> also works nice with cgi.tcl <0> from the examples <5> hrmm <0> what's the syntax you're using now? <5> ncgi::setCookie -name user -value "test" -expires never <0> try: <0> set cok [ncgi::setCookie -name user -value "test" -expires never] <0> and do a puts on $cok and see what it contains <5> ohhh <0> ? <5> hrmm <5> no difference <5> could not find channel cok <7> =/ <5> im amazed at the complete lack of documentation and examples for ncgi... :/// <0> ya <0> i noticed <0> tried googling it? <0> try to get them to install cgi.tcl instead <5> yeah <6> using dtcl, how would i do something like .be/?about ? <6> im not sure what var to use like $_SERVER['QUERY_STRING'] <0> ? <0> wth are you talking about? <0> and why are you still using dtcl? <0> rivet is the new dtcl <6> because rivet is for 2+ <6> and i use 1.3 <0> no <0> mod_tcl is for 2+ <0> rivet is for 1.3 <6> uh. <6> Apache/1.3.33 Server at juggalo.be <6> i have mod_dtcl installed. not rivet. <6> http://juggalo.be:81/test.tcl ;/ <0> yes, and im telling you to switch as rivet is the next generation mod_dtcl <6> eh. <0> excerpt from tcl.apache.org: "Apache Rivet is the "next generation" of mod_dtcl and neowebscript. We have taken the things we like most about both, fixed things we didn't like, and combined efforts in order to come up with something we're very pleased with. For Apache 1.3." <5> ahh my bad <5> i didnt have ncgi::header <5> :O <7> smokey? <8> is this tcl as in... the eggdrop scripting language ? <8> :( thats a no then <9> :|lol <9> r2 misses his v <7> ^^ <7> :P <7> ^^ <10> =) <7> =( <10> =) <10> =\ <7> :D <10> WHAHEY! <11> mwahaha! <10> =( <11> proc steal_fireegl_cookies {cookies} {set cookiejar 10;return "there are [expr $cookiejar - $cookies] left in FireEgl's cookiejar :("} <11> ;steal_fireegl_cookies 2 <4> dreamss: #5257 (580 clicks) Tcl: there are 8 left in FireEgl's cookiejar :( <10> =O <10> steal_fireegl_cookies -999 <4> FireEgl: #5259 (467 clicks) Tcl: there are 1009 left in FireEgl's cookiejar :( <10> \o/ <11> hey! <10> muaha! <11> ;steal_fireegl_cookies -999+1005 <4> dreamss: #5263 (478 clicks) Tcl: there are 2014 left in FireEgl's cookiejar :(
Return to
#tcl or Go to some related
logs:
#stocks calzaghi #stocks efnet serrvers
stealing porn passwords cryhavoc rapidshare #stocks #linuxhelp #microsoft #photoshop
|
|