mIRC Homepage
Posted By: Sturm code for text just submitted - 11/07/06 07:59 PM
I want to make it so when you type, say, !op <username> it ops that person. I know the part below but what is after it?
Code:
on @*:text:!op  

also, how do i put it so only users specified in a .txt file can use it?
Posted By: sas22 Re: code for text just submitted - 11/07/06 08:01 PM
Code:
on @*:text:!op*:#:/mode # +o $2

Eh I know a way to use it in a var you would do this /set %opnicks nick1,nick2,etc...
Then the code would be:
Code:
on @*:text:!op*:#:if ($istok(%opnicks,$nick,44)) { mode # +o $nick} else 
{ halt }
Posted By: Sturm Re: code for text just submitted - 11/07/06 08:04 PM
ok thanks, that worked but how do i get it so only users in (example.txt) can use it? I know they each go on their own line but how would i do that?

EDIT: or better yet so people can only make others as high as they are.
For example someone with op status can only make someone halfop, op, or voice.
Posted By: sas22 Re: code for text just submitted - 11/07/06 08:09 PM
I hope that helped
Posted By: Sturm Re: code for text just submitted - 11/07/06 08:27 PM
umm i cant get that to work could you tell me where to specifically put everything?
the /set %opnicks goes in variables right?
and the rest goes in remote?
Posted By: sas22 Re: code for text just submitted - 11/07/06 08:29 PM
yup
Posted By: Sturm Re: code for text just submitted - 11/07/06 08:35 PM
i put both of them in where i said, exactly how they are and it wont work!
Posted By: sas22 Re: code for text just submitted - 11/07/06 08:44 PM
Code:
on @*:text:!op*:#:{ if $istok(%opnicks,$nick,44) { mode # +o $nick } | else { halt } }

Eh i saw the problem =) my bad I was in a hurry.
Posted By: Sturm Re: code for text just submitted - 11/07/06 08:46 PM
all on one line just like that?

EDIT: oh and would it work if i did:
Code:
 if $nick isin(ops.txt)
  mode # +o $2 


or could you do it so someone can only use it if they're op or higher?
ex. halfops can't use it, people with & rank can etc. Would you just have it like:
Code:
 on &amp;*:text:!protect*:*: {
   mode # +a $2

would that make it so only people with & status can make others up to &?
Posted By: sas22 Re: code for text just submitted - 11/07/06 08:53 PM
Quote:
all on one line just like that?

yes
Posted By: Sturm Re: code for text just submitted - 11/07/06 08:58 PM
it still wont work when i type !op sturm (yes, sturm is my nick and im using another nick to run the code)
Posted By: sas22 Re: code for text just submitted - 11/07/06 09:16 PM
No you would just type !op And strum needs to be in the varlist for %opnicks
Code:
on @*:text:!op*:#:/mode # +o $2
Would react to $op Strum
Posted By: Sturm Re: code for text just submitted - 11/07/06 09:18 PM
I want it so only users in the varlist can use the commands, and that they can use them on other people

or if its easier, only people listed in a .txt file (this is what i would prefer)
Posted By: sas22 Re: code for text just submitted - 11/07/06 09:21 PM
What I gave you before will work.
Just make sure in the variables section has this %opnicks Strum,nick2,etc...
Then just use the code I gave you
Posted By: sas22 Re: code for text just submitted - 11/07/06 09:22 PM
Quote:
all on one line just like that?

EDIT: oh and would it work if i did:
Code:
 if $nick isin(ops.txt)
  mode # +o $2 


or could you do it so someone can only use it if they're op or higher?
ex. halfops can't use it, people with & rank can etc. Would you just have it like:
Code:
 on &amp;*:text:!protect*:*: {
   mode # +a $2

would that make it so only people with & status can make others up to &?
No mIRC wont reconize ~ or & thats IRCD protocol..
Posted By: Sturm Re: code for text just submitted - 11/07/06 09:24 PM
I want it so only people on the varlist can use the commands, but so they can use them on other people

for example, say sturm is on the varlist
with sturm i type !op sturm2
this makes sturm2 an op
now with sturm2(not on varlist) i type !op sturm
it will not do anything because he isnt allowed to use it
Posted By: sas22 Re: code for text just submitted - 11/07/06 09:25 PM
So you want the op nicks to op others who aren't on the oplist in your var?
Posted By: Sturm Re: code for text just submitted - 11/07/06 09:32 PM
yes, it seems like it would be easier to do with a .txt file
Posted By: sas22 Re: code for text just submitted - 11/07/06 09:35 PM
Quote:
yes, it seems like it would be easier to do with a .txt file

Code:
on @*:text:!op*:#:{ if $istok(%opnicks,$nick,44) { mode # +o $nick } | else { halt } }

All you have to do is place that in remote and type this:
/set %opnicks nick1,nick2,nick3
It works like this:
<nick1> !op
* You sets mode: +o nick1
<NickX>!op
Nothing happens..
Posted By: RusselB Re: code for text just submitted - 11/07/06 10:38 PM
A small re-write of the code
Code:
on @*:text:!op*:#: $iif($istok(%opnicks,$nick,44),mode # +o $iif(!$2,$nick,$2))


Checks first to see if the person using the !ops command is in the %opnicks variable,.
If they aren't then nothing else happens.
If they are, then there's a check to see if a nick was specified.
If no nick was specified, then the person using the !op command is opped, otherwise the nick specified is opped. Please note that there is nothing in the code (at the moment) that ensures the nick specified is in the channel.
Posted By: Mark_markieham Re: code for text just submitted - 13/07/06 01:21 PM
Code:
 on *:text:!op *:#: {
  var %lines = $lines(access.txt)
  var %current = 1
   while (%current &lt;= %lines) {
      if ($nick == $read(access.txt, %current) {
         mode # +o $iif(!$2,$nick,$2)
         var %current = $calc(%lines + 1)
      }
      elseif (%current == %lines) {
          .notice $nick You're Not In My Access List. You Can't Use This Command.
          break
        }
;This can be left out ^^ (from elseif (%current == %lines) to break } )
      else  {
         inc %current
      }
   }
}


That should op $2 if $nick is in access.txt, or op $nick if no $2 is specified...


Now, to make sure only ops can make ops, and halfops cant...

add this before the while:

if ($nick isop $chan) {
WHILE LOOP HERE
}
© mIRC Discussion Forums