| View previous topic :: View next topic |
| Author |
Message |
visual Voice
Joined: 21 Feb 2012 Posts: 3
|
Posted: Fri Mar 23, 2012 4:34 am Post subject: Simple invite script. |
|
|
Hi, i have tried making this script which will trigger the bot to invite the given nick but it seems to be not responding. What did i miss here? Thanks in advance.
| Code: |
bind pub n ~invite pub_do_invite
proc pub_do_invite {nick uhost hand chan arg} {
global botnick
putserv "INVITE $arg $chan"
}
|
_________________ jm |
|
| Back to top |
|
 |
Regex Voice
Joined: 19 Mar 2011 Posts: 19
|
Posted: Fri Mar 23, 2012 5:45 am Post subject: |
|
|
| Code: |
bind pub - ~invite do_invite
proc do_invite {nick uhost hand chan text} {
global botnick
if {![string match -nocase "Rootnick" $nick]} { return }
set inv(nick) [lindex $text 0]
set inv(chan) [lindex $text 1]
putserv "INVITE $inv(nick) $inv(chan)"
}
|
"Rootnick" is your nick. Please change it.
You may use this script like that ~invite nick #channel |
|
| Back to top |
|
 |
visual Voice
Joined: 21 Feb 2012 Posts: 3
|
Posted: Fri Mar 23, 2012 12:28 pm Post subject: |
|
|
Thanks but if i'm correct wouldn't this just be inviting me? the owner? Or whatever nick i'll be putting on the "Rootnick"?
What i wanted is, that i can command the bot to invite whichever or whoever person/nick i specify after the ~invite command. Thanks again. _________________ jm |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Mar 23, 2012 3:30 pm Post subject: |
|
|
Visual,
Your script should work well enough, though you don't need the "global botnick" part. The first reason I could think of, for this to not work, is that your eggdrop does not recognize you as an owner. The second I could think of, would be if your eggdrop isn't opped on the channel.
Clubber,
$text does not hold a valid tcl-list, so you cannot use lindex here. You'd atleast have to split the string into a list first (using split).
Also, matching against a litteral nick is not the best practise for security. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|