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.

Help needed with Tcl trigger script

Old posts that have not been replied to for several years.
Locked
s
scorchin
Voice
Posts: 13
Joined: Mon Jun 07, 2004 5:28 am

Help needed with Tcl trigger script

Post by scorchin »

Hi, i am trying to make a trigger script for my clan channel. It will get info about a username that is placed after the !whatis command. But so far, its just fubarred up my Eggdrop, can anyone help? Here is the code...

Code: Select all

bind pub - !whatis pub:definition

proc pub:definition {n u h c t} {
  if {[string match -nocase "" $text]} { putserv "PRIVMSG $chan :Please specify a member you want info about" } { return 0 }
  if {[string match -nocase "scorchin" $text]} { putserv "PRIVMSG $chan :Scorchin is a nublet...." } { return 0 }
}
p
puffi
Voice
Posts: 25
Joined: Tue Jun 01, 2004 10:09 am

Post by puffi »

Code: Select all

bind pub - !whatis pub:definition 

proc pub:definition {n u h c t} { 
  set honk [split $t]
  if {[llength $honk] == 0} {
    putserv "PRIVMSG $chan :Please specify a member you want info about"
    return 0
  }
  set honk [lindex $honk 0]

  if {[string match -nocase "scorchin" $honk]} {
    putserv "PRIVMSG $chan :Scorchin is a nublet...."
    return 0
  } 

}
It checks if the user gave an argument. Repeat the

Code: Select all

  if {[string match -nocase "scorchin" $honk]} {
    putserv "PRIVMSG $chan :Scorchin is a nublet...."
    return 0
  } 
for each user/member you want to give information about.
If i got you right, that is what you want.
s
scorchin
Voice
Posts: 13
Joined: Mon Jun 07, 2004 5:28 am

Post by scorchin »

thanks that brilliant :lol: :mrgreen: :lol:
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

you forgot to change the $chan to $c :)

Code: Select all

bind pub - !whatis pub:definition 

proc pub:definition {n u h c t} { 
  set honk [split $t] 
  if {[llength $honk] == 0} { 
    putserv "PRIVMSG $c :Please specify a member you want info about" 
    return 0 
  } 
  set honk [lindex $honk 0] 

  if {[string match -nocase "scorchin" $honk]} { 
    putserv "PRIVMSG $c :Scorchin is a nublet...." 
    return 0 
  } 

} 
also it would be better to use the switch command or make a global list of names and do lsearch on it
Last edited by Papillon on Mon Jun 07, 2004 6:00 am, edited 1 time in total.
Elen sila lúmenn' omentielvo
s
scorchin
Voice
Posts: 13
Joined: Mon Jun 07, 2004 5:28 am

Post by scorchin »

Thanks all, will test script when Eggdrop comes online! :P
p
puffi
Voice
Posts: 25
Joined: Tue Jun 01, 2004 10:09 am

Post by puffi »

An array might be not wrong there too.
Then you fill it once (maybe from a file) and access the description(value) by accessing $member_description_array(membername) only.
Locked