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.

Please, need some help on this one!

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
o
onthego
Voice
Posts: 1
Joined: Thu Nov 01, 2012 10:57 pm

Please, need some help on this one!

Post by onthego »

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!
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."
}
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

Try this
Commands

!register #channel $nick

Code: Select all

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 
   } 
} 
Last edited by Madalin on Sun Jan 27, 2013 10:57 am, edited 1 time in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

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
Post Reply