mIRC Homepage
Posted By: Acefspds !invite Help Please - 04/08/06 04:47 AM
on *:text:!invite *:#CHANNEL:{
if ($nick ishop #) || ($nick isop #) {
invite $2- $chan
notice $chan .... 11,1 $2- Has been invited to #CHANNEL by $nick .
notice $2- 9,1 You have been invited to join #CHANNEL
}



Ok this is the script I have at the moment. Is there a way for people to set a name and pass or for me to add their name to a list so they can invite theirself. I would like to keep the script above so I can invite new users. Would just like to add this feature to the bot.

Maybe:

!add (Name) for a hop or op to add them
or
/msg (Bots Name) !add (name) (pass)

Either will work if possiable. Maybe even give a notice to the chan saying $nick Has been added to the Invite list.

They would type this to the bot if name and pass....
Ex. /msg (Bot's Name) !Invite (Name) (Pass)

Or

This if it is the list.....
ex. /msg (Bots Name) !Invite (Name added to list)

And the bot will invite them? Is there a code available for this option?

Also is there a way to upload this script so the bot is online all the time?
Posted By: Taggnostr Re: !invite Help Please - 04/08/06 05:19 AM
you can use this event to intercept the /msg (Bot's Name) !Invite (Name) (Pass)
Code:
on *:text:!add *:?:
  

For the list you can set a tokenized var like
%invitelist nick1-nick2-nick3
and use $addtok to add a nick to the var and $istok to see if the nick is in the list (for the password you can do another list, or use the same)
you can also save the list in a file if you want but i think that the tokenized var is the easiest way :P
Posted By: Acefspds Re: !invite Help Please - 04/08/06 05:31 AM
ummm I think I get what ur saying.

Just adding the name will be fine...dont need to have a pass.

Is there a way u can add that to the script i have up there? Where I can add names to a list and itlet the player added to send a message to the bot to invite them?

I want to have the code above so I can also invite new people to the channel so i kinda need the code above. Just wanted to add this feature to it so people can get in whenever they want without me or another op or hop inviting them.
Posted By: Taggnostr Re: !invite Help Please - 04/08/06 05:38 AM
if you want to invite all the nick of the list you should do something like:
Code:
alias invitenick {
   var %count 1
   while ($gettok(%invitelist,%count,%tokchar)) {
    invite $ifmatch #yourchannel
    inc %count
  }
}
  


where %tokchar is the ascii of the char that you choose, for example if the %invitelist is nick1,nick2,nick3 you should use
$gettok(%invitelist,%count,44)
i didn't try the code, see if it works
Posted By: Taggnostr Re: !invite Help Please - 04/08/06 05:44 AM
to add the nick
Code:
 
on *:text:!add &:?: set %invitelist $addtok(%invitelist,$2,44)
 
Posted By: Acefspds Re: !invite Help Please - 04/08/06 05:47 AM
I dont want to send a mass invite. I would just like to have the bot setup to where it has a acecss list. Whenever a user wants to enter the channel they just send the bot a message and if they are on the access list the bot will invite just that nick into the channel.

ex: If im trying to join the channel and im on the list I would type..

/msg _bot_ !invite Acefspds

and if the user Acefspds is on the access list it will trigger the bot to invite that nick. The bot will have full op in the channel.
Posted By: Acefspds Re: !invite Help Please - 04/08/06 06:56 AM
Still need help please.....
Posted By: Taggnostr Re: !invite Help Please - 04/08/06 09:32 AM
Code:
 
on *:text:!invite &:?: if ($istok(%invitelist,$2,44)) invite $2 #chan
 

msg bot nick1, if nick1 isin the list, than it will be invited in the chan
Posted By: Acefspds Re: !invite Help Please - 04/08/06 10:10 AM
alias invitenick {
var %count 1
while ($gettok(%invitelist,%count,%tokchar)) {
invite $ifmatch #yourchannel inc %count
}
}
on *:text:!invite &:?: if ($istok(%invitelist,$2,44)) invite $2 #chan
}
}
on *:text:!add &:?: set %invitelist $addtok(%invitelist,$2,44)

-------------------------------------------------------------------------
So the code will look like that....And when the channel is invite only I can add names to a list and they can type...

/msg (Bot) (name)

and if the name has been added the bot will invite the name into the channel?

To add a name in the channel u can type !add (name) to add a name to the list. Like this.....

!add (name)
Posted By: Acefspds Re: !invite Help Please - 04/08/06 10:55 AM
Also how would I set it so only a certain user can use the command. Instead of hop and op say I wasted it to only be used by Acefspds?

Ex.
on @*:TEXT:!(COMMAND)*:#CHANNEL: {
if (($nick ishop $chan) || ($nick isop $chan)) {

instead og hop and op can it only be Acefspds?
Posted By: Taggnostr Re: !invite Help Please - 04/08/06 10:58 AM
just use if ($nick == Acefspds)
Posted By: KingTomato Re: !invite Help Please - 04/08/06 05:29 PM
You mentioned apassword, but this should work without one. It takes advantage of the user levels in mIRC. I assume you wanted to give special users the ability to invite others users to the channel, without them being an operator or half-op? If so, I've created the following snipplet:

Code:
; !add <name>
; Adds user to invite allow list
on *:TEXT:!add &:[color:blue]#CHANNEL[/color]: {
  if ($nick ishop #) || ($nick isop #) {
    if ($ulist($2,invite,0)) {
      notice $chan $2 is presently on the invite allow list.
    }
    else {
      auser -a $nick invite Invite Allow List
      notice $chan $2 has been added to the invite allow list.
    }
  }
}
; !remove <name>
; Removes user from invite allow list
on *:TEXT:!remove &:[color:blue]#CHANNEL[/color]: {
  if ($nick ishop #) || ($nick isop #) {
    if (!$ulist($2,invite,0)) {
      notice $chan $2 is not on the invite allow list.
    }
    else {
      ruser invite $2
      notice $chan $2 has been removed from the invite allow list.
    }
  }
}
; !invite <name>
; Invites a user to the channel
on *:TEXT:!invite &:[color:blue]#CHANNEL[/color]: {
  if ($nick ishop #) || ($nick isop #) {
    invite $2- $chan
    notice $chan .... 11,1 $2- Has been invited to #CHANNEL by $nick .
    notice $2 9,1 You have been invited to join #CHANNEL
  }
}
; !invite <name>
; PERSONAL MESSAGE (/msg <bot> !invite <name>)
; Inites a user from outside the channel, assuming they are on the allow list.
on invite:TEXT:!invite &:?: {
  var %chan = [color:blue]#CHANNEL[/color]
  invite $2 %chan
  notice %chan .... 11,1 $2 has been invited to %chan by $2 $+ .
  notice $2 9,1 You have been invited to join %chan $+ .
}


If I'm off base, or still would like a password setup, let me know. I'll see what I can setup. This is, to the best of my knowledge, what you were aiming for. Be sure to change the channel names marked in blue.
Posted By: Taggnostr Re: !invite Help Please - 04/08/06 05:41 PM
KingTomato, you always complete what i begin :P
Posted By: Acefspds Re: !invite Help Please - 04/08/06 10:30 PM
Thanks a ton.....Will give it a try. It looks wonderful and just a access list will be fine =-)
Posted By: Acefspds Re: !invite Help Please - 04/08/06 10:44 PM
KingTomato ,

Everything works great except the message to the script for a user to invite if on the list.

I tried it and it just sends a message to the script but the script does not invite the nick. World_Bot will be the scripts name.

Im typing:
/msg World_Bot !invite (Nick)
Would like that message to make the script invite them automatically. But only when the message is typed.

Also is there a way to kick them when !remove it typed?
Posted By: KingTomato Re: !invite Help Please - 05/08/06 04:20 PM
You need 'invite' access to use the PM command and invite a user. I can make it so OPs or allowed users can do so if you'd like? Also, here is the remove command:

Code:
; !remove <name>
; Removes a user form the channel, assuming the victim is not an operator.
on @*:TEXT:!remove & *:[color:blue]#CHANNEL[/color]: {
  if (($2 !isop $chan) && ($2 !ishop $chan) && ($2 ison $chan)) {
    /kick $chan $nick $iif($3,$3-,Kicked by $nick $+($chr(40),!remove command,$chr(41)))
  }
}
Posted By: Acefspds Re: !invite Help Please - 05/08/06 06:13 PM
First of all Thanks for all the help!

Second the remove partworks great.

What I was looking for on the /msg <bot> !invite <name> command is to be able to let everyoneuse it no matter their status on the channel. That is why the <bot> will have OP status. So I want to make sure the person typing the message to the <bot> can be someone without OP, HOp, and even voice.
Posted By: KingTomato Re: !invite Help Please - 05/08/06 07:09 PM
In that case, change the following:

on invite:TEXT:!invite &:?: {

to

on *:TEXT:!invite &:?: {
Posted By: Acefspds Re: !invite Help Please - 06/08/06 12:23 AM
Thanks King your tha Shhhh!......

Everything works great but 1 thing and I promise this will be the last of it.

When you message the bot is there a way for the bot to only trigger for the people on the !add list when they /msg <bot> !invite Acefspds?

Even when I remove auser by using !remove <name> the user can still join the channel.
Posted By: KingTomato Re: !invite Help Please - 06/08/06 03:14 PM
That's how it was previosuly setup. shocked

Replace the invite, and only users on the !add list can use the invite command.

on invite:TEXT:!invite &:?: ...

invite means those on your add list. Any command you want only those users to be able to use, use the invite user level.

[edit]
As far as joining, they will be able to. If you want the script to ban the user, replace the /kick command with the following:

/ban -k $chan $2 2 $iif($3,$3-,Kicked by $nick $+($chr(40),!remove command,$chr(41)))
© mIRC Discussion Forums