mIRC Homepage
Posted By: Taenadar help with triggers - 01/11/05 07:23 PM
I got a little problem in my script.

I got

Code:
on *:TEXT:op *:?:/mode $2 +o $nick | //.notice $nick Gata !!!


but when i trigger it. It wont op the user. Also it doesnt display $nick. It just leaves it empty.

-edit

i found out why it wouldnt op me.. I have to type op #chan nick.

Tnx for the help
Posted By: Riamus2 Re: help with triggers - 01/11/05 07:26 PM
Just a note... you don't need /'s inside a script. It's also a good practice to use {}'s.
Posted By: Taenadar Re: help with triggers - 01/11/05 07:30 PM
Quote:
Just a note... you don't need /'s inside a script. It's also a good practice to use {}'s.


well since this is working and i dont want to [censored] it all up i leave it like this. I just need a little help with the $nick
Posted By: Riamus2 Re: help with triggers - 01/11/05 07:36 PM
The script isn't written to ever display nick. It's written to op the nick and to notice the nick with a message.

Give an example of what it should be doing.
Posted By: Taenadar Re: help with triggers - 01/11/05 07:44 PM
well since this working.. leave it smile

i found a new problem...

when i use

Code:
on @!*:TEXT:!kick *:*:/k $2 | //.notice $nick He's gone !!


it will only notice me that the user is kicked. But the guy who should be kicked is still there.

Other questen, when i use * all users can use the commands, right? When i use @ before a script only ops can use it? Because its not allowed that normal users can kick other people
Posted By: Riamus2 Re: help with triggers - 01/11/05 07:54 PM
Ok... You're missing pieces in your codes... I think you may want to review the help file.

Invalid:
/kick nick

Valid:
/kick chan nick

Code:
on @*:text:!kick *:#: {
  if ($nick !isop $chan || $2 isop $chan || $2 == [color:red]Your nick[/color]) { return }
  kick $chan $2
  .notice $nick $knick has been kicked.
}


As for @... No, it doesn't mean only ops can use it. It means that it will only work if the BOT (or person with the script) is an op. The way you have it, it will trigger if anyone types the command as long as the bot is an op. It will not trigger if the bot is not an op. You definitely want @ in front because you'll get an error if the bot tries to kick someone when the bot isn't an op if you don't have the @ there. But, you need to include a check to see if the $nick is an op. I included one method above to show how.

You also don't need the ! prefix in an ON TEXT event because you can't trigger those yourself, anyhow.

Btw, for the opping script, you should also put in a check to see if the person SHOULD be opped. The way it is, anyone can become and op if they know the command. You should also have the @ on there like with the kick part so you don't get an error if the bot isn't an op.
Posted By: Taenadar Re: help with triggers - 01/11/05 08:17 PM
Ok tnx for the help but the !kick trigger doesnt work how it have to. When i type !kick nick. It will kick me. That doesnt seems right to me :P

And i cant find the mistake you made.
Posted By: Riamus2 Re: help with triggers - 01/11/05 08:21 PM
Hahah! Oops. Ok, it's been fixed. smile
Posted By: Taenadar Re: help with triggers - 01/11/05 08:35 PM
Ah thank you very much laugh

Still got one question :P... yeah i know all the questions :P

How can i make the !kick trigger not let kick ops.. Or kick me :P
Posted By: Riamus2 Re: help with triggers - 01/11/05 08:50 PM
Edited to include that. Just replace the red with your nick. If you use multiple nicks, then stick another || (or) section in that IF line that matches the current one for your nick.
Posted By: Taenadar Re: help with triggers - 01/11/05 09:31 PM
`tnx dude your a hero laugh if i got more question i will place it here.. the || thing i already knew from javascripting
© mIRC Discussion Forums