![]() |
|
|||||||
| Tcl scripting Tcl scripting related questions |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Sep 2005
Age: 22
Posts: 3
Rep Power: 0 ![]() |
as vrea sa stiu cam cum s-ar putea face un astfel de tcl :P
<Gunz> .csc #Lebhelp <SeXivItY> #Lebhelp Stage: Pending | Applicant: COBLITA | Submitted on: Jan 29 2006 18:43:46 CSST | Objections: 0 | Comment: | URL: CService eggdropul citeste de pe pagina de la cservice.. si reda pe canal informatiile despre un canal in pending thx
Last edited by UniversaliA; 30-06-2008 at 03:02. |
|
|
|
|
|
#2 (permalink) |
|
Administrator
aka aqwzsx |
Incearca http://cservice.undernet.org/live/ch...p?name=LebHelp si daca stii cum sa lucrezi cu http la eggdrop - elementar o sa-ti dai seama ce sa faci. In caz contrar ia orice script !google si vezi ce face si cum ce face si pe baza lui simplu o sa faci script`ul dorit.
P.S. Toate comentariile ce nu tin de solutionarea acestei probleme, au fost sterse si data viitoare va rog fara flood pe forum. Deja imi apare tot mai des tentatia sa dau ban`uri si pe forum. |
|
|
|
|
|
#3 (permalink) | |
|
Member
Join Date: Dec 2004
Location: Under a rock!
Posts: 116
Rep Power: 32 ![]() |
Code:
namespace eval csc {
package require Tcl 8.3
package require eggdrop 1.6
package require http
variable version "0.1"
bind pub n .csc [namespace current]::pub
proc pub {nick uhost hand chan text} {
if {![llength [set check [lindex [split $text] 0]]]} {
putserv "PRIVMSG $chan :Usage: !csc <channel>"
return
}
set url "http://cservice.undernet.org/live/check_app.php?name=$check"
set result [read $url]
putserv "PRIVMSG $chan :$result"
}
proc read {url} {
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
regsub -all {<[^>]*>} $content { } content
foreach line [split $content \n] {
if {![llength $line] || [string match "*CService*" $line]} continue
set message $line
break
}
if {![info exists message]} {
upvar #0 $token state
foreach {name value} $state(meta) {
if {![regexp -nocase ^location$ $name]} continue
set url "http://cservice.undernet.org/live/$value"
break
}
redirect $url
} else {
return $message
}
}
proc redirect {url} {
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
set top "<table border=0 cellspacing=0 cellpadding=3>"
set bottom "<script language=\"JavaScript1.2\">"
set tosave [string range $content [set f [string first $top $content]] [string first $bottom $content $f]]
regsub -all {<[^>]*>} $tosave {} tosave
foreach line [split $tosave \n] {
putlog $line
}
}
putlog "csc.tcl v$version loaded"
}
Quote:
|
|
|
|
|
|
|
#4 (permalink) |
|
TCB & Ratings projects Member, #Mythic representative
|
dupa 2 ore juma de munca azi am reusit sa il fac sa functioneze perfect
Code:
namespace eval csc {
package require Tcl 8.3
package require eggdrop 1.6
package require http
variable version "0.1"
bind pub - .csc [namespace current]::pub
proc pub {nick uhost hand chan text} {
if {![llength [set check [lindex [split $text] 0]]]} {
putserv "PRIVMSG $chan :Usage: .csc <channel>"
return
}
set check [string range $check 1 end]
set url "http://cservice.undernet.org/live/check_app.php?name=$check"
set result [read $url]
puthelp "PRIVMSG $chan :#$check $result"
}
proc read {url} {
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
regsub -all {<[^>]*>} $content { } content
foreach line [split $content \n] {
if {![llength $line] || [string match "*CService*" $line]} continue
set message $line
break
}
if {![info exists message]} {
upvar #0 $token state
foreach {name value} $state(meta) {
if {![regexp -nocase ^location$ $name]} continue
set url "http://cservice.undernet.org/live/$value"
break
}
redirect $url
} else {
return $message
}
}
proc redirect {url} {
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
set top "<table border=0 cellspacing=0 cellpadding=3>"
set bottom "<script language=\"JavaScript1.2\">"
set tosave [string range $content [set f [string first $top $content]] [string first $bottom $content $f]]
regsub -all {<[^>]*>} $tosave {} tosave
regsub -all { } $tosave {} tosave
regsub -all {CHANNEL SERVICE APPLICATIONS - VIEW APPLICATION} $tosave {} tosave
regsub -all {Check another application} $tosave {} tosave
regsub -all {Add an Objection for that application} $tosave {} tosave
regsub -all {note: you can only post ONE objection per channel.} $tosave {} tosave
regsub -all {You must be logged in in order to post objections} $tosave {} tosave
regsub -all {Click here to log in} $tosave {} tosave
regsub -all {Current Objections} $tosave {} tosave
regsub -all {<} $tosave {} tosave
regsub -all {:} $tosave {} tosave
set id "0"
set number 1
foreach line [split $tosave \n] {
set linie($number) "$line"; incr number
}
set posted [lrange $linie(3) 2 end]
set user [lindex $linie(4) [expr [lsearch $linie(4) user]+1]]
set status [lindex $linie(5) [expr [lsearch $linie(5) status]+1]]
return "Stage: $status | Applicant: $user | Submitted on: $posted"
}
putlog "csc.tcl v$version loaded"
}
![]() EDIT: adaugata o mica modificare pentru a observa # in numele canalelor pt k eu folosisem regsub si asta scotea # din nume (thx to krimson for noticing)
Last edited by arcade; 27-06-2006 at 16:21. |
|
|
|
|
|
#5 (permalink) |
|
Junior Member
Join Date: Mar 2007
Posts: 8
Rep Power: 0 ![]() |
Cum spunea :
<Gunz> .csc #Lebhelp <SeXivItY> #Lebhelp Stage: Pending | Applicant: COBLITA | Submitted on: Jan 29 2006 18:43:46 CSST | Objections: 0 | Comment: | URL: http://cservice.undernet.org/live/vi...&back=checkapp se poate face ceva de genu acesta ? adik cel de dinainte ,dar adaugate cu objections ,comment si url ?? va rog eu mult !!!!! |
|
|
|
|
|
#6 (permalink) |
|
Junior Member
Join Date: Mar 2007
Posts: 8
Rep Power: 0 ![]() |
Am modificat tcl-ul
sper ca nu va suparati ! Code:
namespace eval csc {
package require Tcl 8.3
package require eggdrop 1.6
package require http
variable version "0.1"
bind pub - .csc [namespace current]::pub
proc pub {nick uhost hand chan text} {
if {![llength [set check [lindex [split $text] 0]]]} {
putserv "PRIVMSG $chan :Usage: .csc <channel>"
return
}
set check [string range $check 1 end]
set url "http://cservice.undernet.org/live/check_app.php?name=$check"
set result [read $url]
puthelp "PRIVMSG $chan :#$check $result"
}
proc read {url} {
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
regsub -all {<[^>]*>} $content { } content
foreach line [split $content \n] {
if {![llength $line] || [string match "*CService*" $line]} continue
set message $line
break
}
if {![info exists message]} {
upvar #0 $token state
foreach {name value} $state(meta) {
if {![regexp -nocase ^location$ $name]} continue
set url "http://cservice.undernet.org/live/$value"
break
}
redirect $url
} else {
return $message
}
}
proc redirect {url} {
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
set top "<table border=0 cellspacing=0 cellpadding=3>"
set bottom "<script language=\"JavaScript1.2\">"
set tosave [string range $content [set f [string first $top $content]] [string first $bottom $content $f]]
regsub -all {<[^>]*>} $tosave {} tosave
regsub -all { } $tosave {} tosave
regsub -all {CHANNEL SERVICE APPLICATIONS - VIEW APPLICATION} $tosave {} tosave
regsub -all {Check another application} $tosave {} tosave
regsub -all {Add an Objection for that application} $tosave {} tosave
regsub -all {note: you can only post ONE objection per channel.} $tosave {} tosave
regsub -all {You must be logged in in order to post objections} $tosave {} tosave
regsub -all {Click here to log in} $tosave {} tosave
regsub -all {Current Objections} $tosave {} tosave
regsub -all {<} $tosave {} tosave
regsub -all {:} $tosave {} tosave
set id "0"
set number 1
foreach line [split $tosave \n] {
set linie($number) "$line"; incr number
}
set posted [lrange $linie(3) 2 end]
set user [lindex $linie(4) [expr [lsearch $linie(4) user]+1]]
set status [lindex $linie(5) [expr [lsearch $linie(5) status]+1]]
set description [lrange $linie(6) 1 end]
return "11,1Status: $status 7| 8Inregistrat de: $user 7| 9La data de: $posted 7| 9Description :4 $description"
}
putlog "csc.tcl v$version loaded"
}
problema e urmatoarea : mai vreau chestia cu obiectiile ..si nu stiu care e linia aceea..imi spune careva ? ca rezolv eu dup-aia ![]() app ,akm ,tcl arata cam asha : Code:
[14:47:56] <MasT3r> .csc #trakerteam [14:47:59] <TraK3RT3aM> #trakerteam 11,1Status: Pending 7| 8Inregistrat de: JustMeX 7| 9La data de: Mar 20 2007 184641 CSST 7| 9Description :4 Welcome to #TrakerTeam . I want to register this channel for my friends,i want to make a place where they to talk and to stay, to make new friends, and not the last for the all people from the undernet! |
|
|
|
|
|
#7 (permalink) |
|
Junior Member
Join Date: Mar 2007
Posts: 8
Rep Power: 0 ![]() |
l-am gasit,l-am facut...cine vrea sa ia codu de aici :
Code:
package require http
bind pub -|- .csc checkcsc
proc checkcsc {nick host hand chan arg} {
set valchan [join [lindex [split $arg] 0]]
if { $valchan == "" } { return 0 }
set token [http::config -useragent "lynx"]
set check [wt:filter $valchan]
set token [http::geturl "http://194.109.147.174/live/check_app.php?name=$check"]
set html [http::data $token]
if {[string match "*No applications*" $html]} {
puthelp "PRIVMSG $chan :$valchan: Nu exista nici o aplicatie pentru acest canal"
return 0
}
if {[string match "*DB is currently being maintained*" $html]} {
puthelp "PRIVMSG $chan :$valchan: Baza de date de la Cservice are o mica problema,va rugam reveniti !"
return 0
}
upvar #0 $token state
foreach {name value} $state(meta) {
if {[regexp -nocase ^location$ $name]} {
set regurl "http://cservice.undernet.org/live/$value"
set token [http::geturl $regurl]
set html [http::data $token]
set html [split $html "\n"]
set regobj 0
set regcomment ""
foreach line $html {
if {[string match "*by user :*" $line]} {
regexp {(.*)<b>(.*)</b>(.*)} $line match blah reguser blah
}
if {[string match "*Posted on :*" $line]} {
regexp {(.*)<b>(.*)</b>(.*)} $line match blah regdate blah
}
if {[string match "*Current status :*" $line]} {
regexp {(.*)<b>(.*)</b>(.*)} $line match blah regstatus blah
regsub -all {<[^>]*>} $regstatus {} regstatus
}
if {[string match "*Decision comment :*" $line]} {
regexp {(.*)<b>(.*)</b>(.*)} $line match blah regcomment blah
regsub -all {<[^>]*>} $regcomment {} regcomment2
}
if {[string match "*Comment :*" $line]} {
incr regobj 1
}
if {![info exists regcomment2]} {
set regcomment2 "n/a"
}
}
}
}
set regstatus2 [string tolower $regstatus]
if {$regstatus2 == "pending"} {
set regstatus "11 $regstatus"
} elseif {$regstatus2 == "incoming"} {
set regstatus "\00308$regstatus"
} elseif {$regstatus2 == "rejected"} {
set regstatus "\00304$regstatus"
} elseif {$regstatus2 == "accepted"} {
set regstatus "\00309$regstatus"
} elseif {$regstatus2 == "ready for review"} {
set regstatus "\00306$regstatus"
} elseif {$regstatus2 == "cancelled by the applicant"} {
set regstatus "\00314$regstatus"
}
putserv "PRIVMSG $chan 4,1Canal 0,1 :4,1 $valchan 4Status 0,1: 11,1 $regstatus 0,1 | 4,1 Inregistrat de 8,1 $reguser 7,1 La data de 0,1 :8,1 $regdate 0,1 | 7,1 Obiectii 0,1: 4,1 $regobj 0,1 | 8,1 Comentarii 0,1 : 4,1 $regcomment2 0,1| 4,1 URL 0,1: 11,1 $regurl "
return 0
}
proc wt:filter {x {y ""} } {
for {set i 0} {$i < [string length $x]} {incr i} {
switch -- [string index $x $i] {
"é" {append y "%E9"}
"è" {append y "%E8"}
"î" {append y "%CE"}
"É" {append y "%E9"}
"È" {append y "%E8"}
"Î" {append y "%CE"}
"&" {append y "%26"}
"#" {append y "%23"}
" " {append y "+"}
default {append y [string index $x $i]}
}
}
return $y
}
#################################################################################
putlog " * CsC From MasT3r ENABLE *."
|
|
|
|
|
|
#8 (permalink) | ||
|
Member
Join Date: Jun 2004
Location: In the NeXuS
Posts: 160
Rep Power: 37 ![]() |
Quote:
Quote:
__________________
RESTRICTED AREA |
||
|
|
|
|
|
#9 (permalink) | |
|
Junior Member
Join Date: Mar 2007
Posts: 8
Rep Power: 0 ![]() |
Quote:
l-am pus doar ca sa il ia cineva dak il vrea ! oricum nu ma pricep deloc in scripting
|
|
|
|
|