egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Please, need some help on this one!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
onthego
Voice


Joined: 01 Nov 2012
Posts: 1

PostPosted: Thu Nov 01, 2012 11:07 pm    Post subject: Please, need some help on this one! Reply with quote

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
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Jan 27, 2013 8:35 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Jan 27, 2013 10:51 am    Post subject: Reply with quote

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
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Jan 27, 2013 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber