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.

Simple invite script.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
v
visual
Voice
Posts: 3
Joined: Tue Feb 21, 2012 10:50 am

Simple invite script.

Post by visual »

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: Select all

bind pub n ~invite pub_do_invite

proc pub_do_invite {nick uhost hand chan arg} {
global botnick
putserv "INVITE $arg $chan"
}
jm
R
Regex
Voice
Posts: 19
Joined: Sat Mar 19, 2011 1:23 pm

Post by Regex »

Code: Select all

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
v
visual
Voice
Posts: 3
Joined: Tue Feb 21, 2012 10:50 am

Post by visual »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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