mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
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 }

Joined: Feb 2015
Posts: 243
O
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

Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
OrFeAsGr thank you for the help. Much appreciated. Keep up the good work

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Don' mention it :))

Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
Me again. Loaded the script not working. Missing bracket at line 1
tried some options but to stupid to fix on my own

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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?


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
Thanks managed to sort out

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

Link Copied to Clipboard