mIRC Home    About    Download    Register    News    Help

Print Thread
help with on *:TEXT events if nick is ops #250918 02/02/15 07:58 PM
Joined: May 2013
Posts: 129
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 129
I'm using the below script with on *:TEXT but I have quite a few messages for ops only to read. Is there a way to combine them without having to use this script over and over for all the on *:TEXT events?
My script is this:
Quote:
on *:TEXT:*nickinfo*:#: {
/if $nick isop $chan //.notice $nick Type your selection: 5nick info - auto op - nick expire - and 8 more )
/else //.notice $nick Sorry only for use by ops )
}

;some others that i need to .notice as well
on 1:text:nick info*:#:{ /notice $nick Get all information for a nick (if registered) type: 5 /msg NickServ info nick all 4 Display in Status Window }

on 1:text:auto op:#:{ /notice $nick Sets whether the given nickname will be opped automatically or not type: 5 /msg NickServ saset nick autoop ON or OFF }

on 1:text:nick expire*:#:{ /notice $nick Sets whether the given nickname will expire or not: 5 /msg NickServ saset nickname noexpire ON or OFF }

Re: help with on *:TEXT events if nick is ops [Re: raycomp] #250920 02/02/15 09:58 PM
Joined: Feb 2015
Posts: 243
O
OrFeAsGr Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Hi there! So .. you want only ops to use these commands. First of all i suggest you use a command prefix for the commands . The usuals are ! , & , @ , but if you'll use it or not or which you use is really up to you. Secondly if you want these to work like commands you need to use some more if's
Code:
on *:text:*:#: {
;;;You use * instead of a word in the event part;;;
if ($strip($1) == !nickinfo) {
;;;So Now You Use an if.  $strip makes the script see the text even if the $nick ;;;;;;uses colours. So $1 returns the first word , im using $strip($1) .;;;;;
if ($nick isop $chan) {
if ($strip($2) == $null) {
;;;I guessed you wanted it to notice the selections if the rest was blank So I ;;;;;;;;;Added if ($strip($2) == $null) .  $null returns blank 
.notice $nick Type Your selections nick info - auto op - nick expire ...
}
if ($strip($2-) == nick info) {
.notice $nick get all info about nick (if registered) type /msg nickserv info
;; $2- returns word 2 and up ;;; $strip($2-) returns word 2 and up uncoloured
}
elseif ($strip($2-) == auto op) {
;;; use of elseif because previous if refers to $strip($2-) as well
.notice sets wether the given nickname will get auto op or not...
}
elseif ($strip($2-) == nick expire) {
.notice $nick sets wether the nick will expire....
}
}
;;closed the bracket opened at if ($nick isop $chan)  { 
;;;use of elseif here because we closed isop
elseif ($nick !isop $chan) {
.notice $nick Sorry ,only can be used by ops
}
}

This is it smile this will work the following way.
<you> !nickinfo
<script> Sorry commands only for ops
------------------------------------------------------------
<@you> !nickinfo
<script> Please make your selections bla bla bla
<@you> !nickinfo nick info
<script> shows all info about a nick bla bla bla
<@you> !nickinfo auto op
<script> determines wether the nick will get auto op bla bla
<@you> !nickinfo nick expire
<script> sets if the script will expire bla bla bla

Re: help with on *:TEXT events if nick is ops [Re: OrFeAsGr] #250928 03/02/15 06:23 AM
Joined: May 2013
Posts: 129
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 129
OrFeAsGr thank you for the help. Much appreciated. Keep up the good work

Re: help with on *:TEXT events if nick is ops [Re: raycomp] #250950 03/02/15 08:59 PM
Joined: Feb 2015
Posts: 243
O
OrFeAsGr Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Don' mention it :))

Re: help with on *:TEXT events if nick is ops [Re: OrFeAsGr] #250951 03/02/15 09:07 PM
Joined: May 2013
Posts: 129
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 129
Me again. Loaded the script not working. Missing bracket at line 1
tried some options but to stupid to fix on my own

Re: help with on *:TEXT events if nick is ops [Re: raycomp] #250954 03/02/15 09:19 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Originally Posted By: raycomp
Me again. Loaded the script not working. Missing bracket at line 1
tried some options but to stupid to fix on my own


What exactly does not working on the code?

Re: help with on *:TEXT events if nick is ops [Re: westor] #250959 04/02/15 05:44 AM
Joined: May 2013
Posts: 129
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 129
Thanks managed to sort out

Last edited by raycomp; 04/02/15 08:44 AM.