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 

Simple invite script.

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


Joined: 21 Feb 2012
Posts: 3

PostPosted: Fri Mar 23, 2012 4:34 am    Post subject: Simple invite script. Reply with quote

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


Joined: 19 Mar 2011
Posts: 19

PostPosted: Fri Mar 23, 2012 5:45 am    Post subject: Reply with quote

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


Joined: 21 Feb 2012
Posts: 3

PostPosted: Fri Mar 23, 2012 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Mar 23, 2012 3:30 pm    Post subject: Reply with quote

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