| View previous topic :: View next topic |
| Author |
Message |
onthego Voice
Joined: 01 Nov 2012 Posts: 1
|
Posted: Thu Nov 01, 2012 11:07 pm Post subject: Please, need some help on this one! |
|
|
I got the following script, I'd like someone to help me to put something in plus, for example, when i type, !Register <channel> <nick>, give the bot join the channel and to say "Status channel. .. please stand by .. "then give its cycle time, and say on channel then "!seen a" and if another bot responds like "i dont remember seen a" then the bot give an reply to chan and say "Channel Status: Rejected" and the bot purge that channel, and leave. I would appreciate if you help me!
| Quote: |
bind pub m|- !register pub:register
proc pub:register {nick uhost hand chan txt} {
if {[llength $txt] != 2} {
putserv "PRIVMSG $chan :$nick folosire !register <#channel> <nick>"
return
}
foreach {channel owner} [split $txt] {
break
}
if {[validchan $channel]} {
putserv "PRIVMSG $chan :I'm already monitoring $chan channel. Registration had been stoped."
return
}
channel add $channel
chattr $hand -|+Nnf $channel
putserv "PRIVMSG $chan :this $channel was accepted by $hand and gives manager atributes on $channel on $owner"
putserv "PRIVMSG $channel :Channel STATUS...."
putserv "PRIVMSG $channel :!seen a"
putserv "PRIVMSG $channel :Status Channel: accepted by $hand, don't forget $owner if u do any abuse i will leave the channel."
}
|
|
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sun Jan 27, 2013 8:35 am Post subject: |
|
|
Try this
| Quote: |
Commands
!register #channel $nick
|
| Code: |
bind PUB - !register register:pub
bind PUBM - "*i dont remember*" seen:pubm
proc register:pub {nick uhost hand chan arg} {
global temp
if {[lindex [split $arg] 0] || [lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick - USAGE: !register <\$channel> <\$nick>"; return }
if {[string match "#*" [lindex [split $arg] 0]]} { set temp(chan) [lindex [split $arg] 0]; channel add [lindex [split $arg] 0] }
utimer 15 [list putserv "PRIVMSG [lindex [split $arg] 0] :!seen a"]
utimer 45 [list doacc [lindex [split $arg] 0] [lindex [split $arg] 2]]
}
proc seen:pubm {nick uhost hand chan arg} {
global temp
if {$temp(chan) == $chan} {
channel remove $chan
}
}
proc doacc {chan nick} {
if {![validuser [nick2hand $nick]]} {
adduser $nick "*!*@[lindex [split [getchanhost $nick $chan] @] 1]"
chattr $nick +N $chan
} else {
chattr [nick2hand $nick] +N $chan
}
}
|
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Last edited by Madalin on Sun Jan 27, 2013 10:57 am; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jan 27, 2013 10:51 am Post subject: |
|
|
Just a comment, list indexes start at 0, not at 1.
When using pub bindings, the trigger word is stripped from the text argument. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sun Jan 27, 2013 10:59 am Post subject: |
|
|
Modified.. weird because i tested this yet i think i wanted to do something more complex and i got back to the standard version and forgot to modify the old var's.
The script should be ok now
Thanks
Thats why users who request must test the script so that if i/we make something wrong the script should be corrected _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
|