This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

I have write a litlle url script but need help

Help for those learning Tcl or writing their own scripts.
Post Reply
Z
Zest
Voice
Posts: 3
Joined: Mon Aug 15, 2005 6:09 am

I have write a litlle url script but need help

Post by Zest »

Hello
first, sorry for bad englisch.

I have a Problem with my little script.

Code: Select all

proc achan {cchan} {

set activechans "#chan1 und #chan2"

if {[string length $activechans] > 0} {
if {[string first [string tolower $cchan] $activechans] < 0} {
    return no_achan
  }
 }
}


proc putnot {nick msg} { putserv "NOTICE $nick :$msg" }
proc putchan {chan msg} { putserv "PRIVMSG $chan :$msg" }


proc pub_!urls {nick uhost hand chan rest} {
  if {([achan $chan] != "no_achan")} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == ""} {
    putchan $chan "\001ACTION hat Folgende URLs im Detail. Abrufen mit: !blabla1, !blabla2, !blabla3, !blabla4 \001" ;return 0}
 }
}
bind pub - !urls pub_!urls


proc pub_!blabla1 {nick uhost hand chan rest} {
if {([achan $chan] != "no_achan")} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == ""} {
    putchan $chan "\001ACTION Folgende details zu blabla1 verfügbar: Webseite http://*****.de den Chat dazu im Aplett im Forum ganz unten.\001" ;return 0}
 }
}
bind pub - !blabla1 pub_!blabla1


proc pub_!blabla2 {nick uhost hand chan rest} {
if {([achan $chan] != "no_achan")} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == ""} {
    putchan $chan "\001ACTION: Folgende details zu blabla2 verfügbar: Webseite: http://www.*****.de den Chat findet ihr im **** unter #**** .\001" ;return 0}
 }
}
bind pub - !blabla2 pub_!blabla2


proc pub_!blabla3 {nick uhost hand chan rest} {
if {([achan $chan] != "no_achan")} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == ""} {
    putchan $chan "\001ACTION Folgende details zu blabla3 verfügbar: Webseite: http://www.****.ch den Chat dazu findet ihr im **** unter #**** oder für Gäste im Aplett in der Navigation.\001" ;return 0}
 }
}
bind pub - !blabla3 pub_!blabla3


proc pub_!blabla4 {nick uhost hand chan rest} {
  if {([achan $chan] != "no_achan")} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == ""} {
    putchan $chan "\001ACTION Folgende details zu blabla4 verfügbar: Webseite: http://www.****.de den Chat dazu findet ihr im **** unter #***** .\001" ;return 0}
 }
}
bind pub - !blabla4 pub_!blabla4


###

putlog "URL Service von Zest" 
Now the Problem is:
The Bot don't accept more than 3 Url's.
Normal, with these script is possible to write more tan 50 Url's.
Ex:
blabla3 don't work but the rest when i write in chan !blabla1 or !blabla4, works perfect. The sort of !blabla is not a problem.

hope you can help.

Greet
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

LOL, what a script. Has it been converted from an mIRC script or something like that? I mean, would it be more clear, if you used only 1 proc, used a normal string match or lsearch for chan checking, and seltected the output line via a switch construct? :D

btw... what does mean it doesnt work? any TCL errors? maybe you made a typo or something like that.
*puts up a sign: "geht nicht" ist keine Fehlerbeschreibung*
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Z
Zest
Voice
Posts: 3
Joined: Mon Aug 15, 2005 6:09 am

Post by Zest »

i found the error.
"\001ACTION:
right is:
"\001ACTION

No its not convertet from mirc.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

putserv "PRIVMSG $chan :\001ACTION blah blah\001"
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply