mIRC Home    About    Download    Register    News    Help

Print Thread
whats wrong with this #7852 22/01/03 08:57 PM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
on *:text:!invite*:*:{
if ($nick == isop) { /chatbot invite Chan $2 | /notice $nick $2 Has Been Invited to $Chan | /halt }
}
}

this is a script for a bot that is in any rooms
and what its supposed to do is,
when an op in that room types !invite nick,
it invites them
it should only respond if that person is an op,
can someone tell me whats wrong with this?

thanks

Re: whats wrong with this #7853 22/01/03 09:04 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Code:
on *:text:!invite *:#:{
  if ($nick isop #) {
    chatbot invite # $2
    notice $nick $2 Has Been Invited to #
  }
}


if ($nick == isop) wasn't the correct operator. see /help if-then-else for syntax info.

Also, your script is listening for !invite in both channel and private. should be channel only, I guess.

Remote commands don't have to be preceded by slash.

Finally, no need for halt as the script already ended.

(edit: is /chatbot an alias which messages your bot, or did you mean /msg chatbot?)

Last edited by Online; 22/01/03 09:08 PM.
Re: whats wrong with this #7854 22/01/03 09:16 PM
Joined: Dec 2002
Posts: 1,237
T
The_Game Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
This works for me

on *:TEXT:*!invite*:#:/invite $2 #Channel | /notice $nick you have invited $2 to #Channel!


Hope it works for you....just add this to your bot it should work

*note when you type !invite include the nick of the person you are inviting

Last edited by The_Game; 22/01/03 09:18 PM.
Re: whats wrong with this #7855 22/01/03 09:35 PM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
works perfect thanks

Re: whats wrong with this #7856 22/01/03 09:37 PM
Joined: Dec 2002
Posts: 1,237
T
The_Game Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
no problem...

Re: whats wrong with this #7857 23/01/03 03:01 PM
Joined: Dec 2002
Posts: 143
A
Aubs Offline
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
It shouldn't work peoperly, because if you are not an op in that channel, you shouldn't be able to invite anyone (I mean server doesn't let you invite)...Maybe you should use:

Code:
[color:green];You need to be an @op, otherwise it doesn't invite.[/color]
on @*:TEXT:!invite*:#:{
  [color:green];Checks to see if the person typing !invite <nick> is an op[/color]
  if ($nick isop $chan) {
    [color:green];person is an op. Checks to see if the person being invited is already in the channel[/color]
    [color:green];saves sending a command to the server if one isn't needed[/color]
    if ($2 ison $chan) { .notice $nick $2 is already on $chan | halt }
    [color:green];If they are not on the channel, invite them[/color]
    /invite $2 $chan
    .notice $nick Successfully invited $2 into $chan
    halt
  }
  [color:green];If the person typing !invote is not an op, tell them they need to be[/color]
  .notice $nick you must have operator status to invite someone into $chan
  halt
}


Ultimately, if the person typing !invite is an op, they could easilly type: //invite <nick> $active :and the person would be invited!!

Anyways, hope it helps smile


Aubs.
cool