botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 04-02-2006, 16:02   #1 (permalink)
Dan
Junior Member
 
Dan's Avatar
 
Join Date: Sep 2005
Age: 22
Posts: 3
Rep Power: 0
Dan is an unknown quantity at this point
Default csc tcl

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.
Dan is offline   Reply With Quote
Old 04-02-2006, 17:34   #2 (permalink)
Administrator

aka aqwzsx
 
Join Date: Jun 2004
Posts: 832
Blog Entries: 126
Rep Power: 3
UniversaliA is on a distinguished road
Default

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.
UniversaliA is offline   Reply With Quote
Old 07-02-2006, 14:08   #3 (permalink)
Member
 
caesar's Avatar
 
Join Date: Dec 2004
Location: Under a rock!
Posts: 116
Rep Power: 32
caesar will become famous soon enough
Default

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"
}
M-am plictisit si nu mai am chef... Face-ti voi mai departe. Exemple:
Quote:
[13:01:29] (oaie): [13:01] Channel :&nbsp;#write
[13:01:29] (oaie): [13:01] Posted on :&nbsp;Jan 30 2006 14:58:54 CSST
[13:01:29] (oaie): [13:01] by user :&nbsp;BuRu
[13:01:29] (oaie): [13:01] Current status :&nbsp;Accepted
[13:01:29] (oaie): [13:01] Description :&nbsp;This is a channel for me and my friends . We liky to write and i want to surprise them by meaking a channel . we hope to become write`s . thank you cservice . (my english is bad :&gt; )
[13:01:29] (oaie): [13:01] Decision date :&nbsp;Feb 07 2006 03:51:29 CSST
[13:01:29] (oaie): [13:01] Decision comment :&nbsp;by Saralee (CService Admin)
[13:01:29] (oaie): [13:01] Congratulations for your channel registration.Remember, having X isn't a right but a privilege than can be revoked at any point if abuse is done by you or channel ops.Enjoy
[13:01:29] (oaie):
[13:01:29] (oaie): [13:01] <
[13:01:36] (oaie):
[13:01:36] (oaie): [13:01] Channel :&nbsp;#aid
[13:01:36] (oaie): [13:01] Posted on :&nbsp;Feb 06 2006 21:12:12 CSST
[13:01:36] (oaie): [13:01] by user :&nbsp;DarrK
[13:01:36] (oaie): [13:01] Current status :&nbsp;Pending
[13:01:36] (oaie): [13:01] Description :&nbsp;i make this channel with my special friends for all people who are enjoying here and we hope to do a nice atmosfer and we try to help peoples with their problems.
[13:01:36] (oaie): [13:01] Add an Objection for that applicationnote: you can only post ONE objection per channel.
[13:01:36] (oaie):
[13:01:36] (oaie):
[13:01:36] (oaie): [13:01] You must be logged in in order to post objections
[13:01:36] (oaie): [13:01] Click here to log in
[13:01:36] (oaie):
[13:01:36] (oaie):
[13:01:36] (oaie): [13:01] Current Objections
[13:01:36] (oaie): [13:01] no objections for this application
[13:01:36] (oaie):
[13:01:36] (oaie): [13:01] <
[13:19:10] (oaie): [13:19] Channel :&nbsp;#bapti
[13:19:10] (oaie): [13:19] Posted on :&nbsp;Feb 02 2006 13:14:03 CSST
[13:19:10] (oaie): [13:19] by user :&nbsp;leinto87
[13:19:10] (oaie): [13:19] Current status :&nbsp;Pending
[13:19:10] (oaie): [13:19] Description :&nbsp;This channel is for me and my friends
[13:19:10] (oaie): [13:19] Add an Objection for that applicationnote: you can only post ONE objection per channel.
[13:19:10] (oaie):
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] You must be logged in in order to post objections
[13:19:10] (oaie): [13:19] Click here to log in
[13:19:10] (oaie):
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] Current Objections
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] Posted by :&nbsp;PUSTlU
[13:19:10] (oaie): [13:19] On :&nbsp;Feb 03 2006 18:00:27 CSST
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] Comment :This channels is full for bots clones drones and Bncs This channel has have a X and the cservice manager purged this because leinto87 have a multiple users registration leinto87,WaW,Bapti etc. CService if you ar a smart reject this aplication
[13:19:10] (oaie):
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] Posted by :&nbsp;Locker
[13:19:10] (oaie): [13:19] On :&nbsp;Feb 05 2006 14:14:13 CSST
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] Comment :CService Reject this channel . is clonned . They are lammers . Reject
[13:19:10] (oaie):
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] 2 total objections for #bapti.
[13:19:10] (oaie):
[13:19:10] (oaie):
[13:19:10] (oaie): [13:19] <
caesar is offline   Reply With Quote
Old 27-06-2006, 15:42   #4 (permalink)
TCB & Ratings projects Member, #Mythic representative
 
arcade's Avatar
 
Join Date: Jun 2004
Location: In fatza calculatorului!!
Age: 19
Posts: 221
Rep Power: 37
arcade is on a distinguished road
Send a message via Yahoo to arcade
Default

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 {&nbsp;} $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"
}
si nu uitati tot meritul apartine lui caesar kre a scris 99% din cod

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.
arcade is offline   Reply With Quote
Old 24-03-2007, 16:18   #5 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0
MasT3r is an unknown quantity at this point
Question se poate ? :(

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 !!!!!
MasT3r is offline   Reply With Quote
Old 24-03-2007, 16:50   #6 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0
MasT3r is an unknown quantity at this point
Smile

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 {&nbsp;} $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"
}
nu este chiar asha greu.. 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!
mai vreau chestia cu obiectiile si cu url-ul ..spunetimi cum pot face,sau dati-mi macar liniile ! pls !
MasT3r is offline   Reply With Quote
Old 24-03-2007, 20:24   #7 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0
MasT3r is an unknown quantity at this point
Talking

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"}
                        "&egrave;" {append y "%E8"}
                        "î" {append y "%CE"}
                        "É" {append y "%E9"}
                        "&Egrave;" {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 *."
MasT3r is offline   Reply With Quote
Old 25-03-2007, 00:30   #8 (permalink)
lsn
Member
 
lsn's Avatar
 
Join Date: Jun 2004
Location: In the NeXuS
Posts: 160
Rep Power: 37
lsn will become famous soon enough
Default

Quote:
Originally Posted by MasT3r
l-am gasit,l-am facut...cine vrea sa ia codu de aici :
Cred ca urmeasa za primesti un ban nelimitat pe forum pentru ca iti atribui tie munca altcuiva

Quote:
putlog " * CsC From MasT3r ENABLE *."
__________________
RESTRICTED AREA
lsn is offline   Reply With Quote
Old 25-03-2007, 03:11   #9 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0
MasT3r is an unknown quantity at this point
Unhappy

Quote:
Originally Posted by lsn View Post
Cred ca urmeasa za primesti un ban nelimitat pe forum pentru ca iti atribui tie munca altcuiva
Scuze man ,eu nu am facut nik ,doar am adaugat linia aia,etc,l-am facut initial pt mn ,nu pt voi l-am pus doar ca sa il ia cineva dak il vrea ! oricum nu ma pricep deloc in scripting
MasT3r is offline   Reply With Quote
Old 15-09-2007, 18:45   #10 (permalink)
#a&a representative
 
Erised's Avatar
 
Join Date: Jun 2004
Location: 127.0.0.1
Age: 20
Posts: 169
Rep Power: 0
Erised is an unknown quantity at this point
Send a message via MSN to Erised Send a message via Yahoo to Erised
Default

Eu am incercat sa-l folosesc pe cel al lui arcade si pur si simplu nu il incarca.
Am pus in .conf si cand am dat rehash (chiar restart) nu zice nimic.
Si ofc, nici nu merge
__________________
Best regards,
Erised
Erised is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +3. The time now is 12:29.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.