Here are three things that are immense help, when beginning with TCL scripts for Eggdrop bots:Danielle99 wrote:I am trying to figure out how to code a script for my bot.
As you read the Suninet pages, and skim through tcl-commands.doc , pay close attention to the parts aboutI would like to have a user give a/s/l in channel and on */f/* give voice on that. I would also like the script to add the user with .chattr +fg
I have no idea where to begin. Please help.
Code: Select all
bind pub - "asl" voice_fem
proc voice_fem {nick uhost handle chan text} {
set gender [lindex [split $text] 1 ]
if {"$gender" == "f"} {
pushmode $chan +v $nick
}
}
it will trigger.asl x f xxxxx
Yes, it is a lot, at first.Danielle99 wrote:I'm still working mty way through this, Thanks for the links, there is a lot of information, I do understand the bind things, I understand the levels of use (-*nom) After looking at your example I dont understand how this connects.
This is not a sentence, so I'm having trouble figuring it out.from asl to determining the "f" in the script.
Log?Better off I was hoping for a generic Variable/f/variable trigger without a log of data to follow,
True.As i understanf a extra space or mis-type could result in the script not to trigger.
Was exactly what I ment, Thanks.[lindex [split $text] 1 ]
It was a typeo "Lot" is what I ment.Better off I was hoping for a generic Variable/f/variable trigger without a log of data to follow,
Code: Select all
set gender [lindex [split $text] 1]
Code: Select all
bind join * * asl
proc asl {nick host hand chan} {
bind pubm * * form
putserv "PRIVMSG $chan :$nick: a/s/l?"
set ::id [utimer 30 [list asl_kb $nick $chan]]
}
bind pubm * * form
proc form {nick host hand chan text} {
if {[string match -nocase "*/f/*" $text]} {
unbind pubm * * form
killutimer $::id
set host [getchanhost $nick $chan]
set user [regsub -all {[^a-z]} $nick ""]
adduser "$user *![join [lrange [split $host @] 0]]@*.[join [lrange [split $host .] end-2 end] .]"
chattr $user |+fg $chan
pushmode $chan +v $nick
} elseif {[string match -nocase "*/m/*" $text]} {
unbind pubm * * form
set host [getchanhost $nick $chan]
putquick "MODE $chan +b *![join [lindex [split $host @] 0]]@*.[join [lrange [split $host .] end-2 end] .]"
putserv "KICK $chan $nick :Wrong response to \"a/s/l\"?"
}
}
proc asl_kb {$nick $chan} {
unbind pubm * * form
set host [getchanhost $nick $chan]
putquick "MODE $chan +b *![join [lindex [split $host @] 0]]@*.[join [lrange [split $host .] end-2 end] .]"
putserv "KICK $chan $nick :Took too much time to reply to \"a/s/l?\""
}
does not seem to be working after 30 sec.proc asl_kb {$nick $chan} {
seems to be working well.} elseif {[string match -nocase "*/m/*" $text]} {