mIRC Home    About    Download    Register    News    Help

Print Thread
auto op help #210573 20/03/09 03:27 PM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
Hello,

Whats wrong with this? it works apart from if i am opped it searches for gavsta and then checks his ip to make sure it is him befor ei op

Code:
on op:JOIN:#:{
  if ($me isop $chan) {
    mode $chan +o $nick
  }
  else {
    set %opidle $nick
    msg juicer op pass
    .timeropidle 1 10 mode # +o %opidle
  }
}

on *:RAWMODE:#:{
  if (+o isin $1) && ($me isin $2) { 
    whois gavsta
  }
}

raw 338:*: {
  haltdef
  if (194.203.84.231 isin $1) {
    mode # +o gavsta
  }
}

Re: auto op help [Re: state] #210574 20/03/09 03:49 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I have some problems understanding your request and the code in particular. What's the idea for the timer, the rawmode event...? I'm not familiar with raw No. 338 either.
Do you want to give some user ops in every common channel he's joining, if his IP is "194.203.84.231"? If yes - what is the user's hostmask (the part after @ in nick!ident@host)? If the IP of the user is a static one, he should have a static host as well.

Last edited by Horstl; 20/03/09 04:03 PM.
Re: auto op help [Re: Horstl] #210575 20/03/09 04:02 PM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
I hardly ever script. so i just kinda made up the code to how i thought it would work

the timer is just a 10second delay so that if a user on the op list joins i want to op him, but if im not an op i will message juicer(are bot) to op me then op the user after a 10second delay just in case there is a slight server lag


raw 338 is just part of a whois reply

15:23 :194.203.84.231 actually using host

basically when ever i am 'oped' i want to op every one on my op list

The hosts are

op:*!*gavsta@post.coopervision.eu.com
op:*!*ident@cpc2-cmbg6-0-0-cust862.cmbg.cable.ntl.com
op:*!*gavsta@194.203.84.231

Last edited by state; 20/03/09 04:04 PM.
Re: auto op help [Re: state] #210577 20/03/09 04:46 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I made it check all the users in the channel for being on your op list, if you get ops after requesting it. Untested - hope it works smile
Code:
; if someone joins a channel that is on your op list, and it's not yourself joining (the ! prefix)
on !op:join:#: { 

  ; you're oped: give op tp that nick
  if ($me isop $chan) { mode # +o $nick }

  ; you're not oped
  else {

    ; set a variable "%oprequest.<channel>" to remember "I requested ops here"
    ; the variable unsets after 10 seconds
    set -eu10 $+(%,oprequest.,#) 

    ; and request ops
    msg juicer op pass
  }
}

; you get ops in a channel
on me:*:op:#: {

  ; it's by request (there was a variable set)
  if ($var($+(oprequest.,#))) {

    ; loop the addresses of all users in this channel (internal address list)
    var %n = 1
    while ($ialchan(*,#,%n)) {

      ; if the address of the currently looped user matches a mask in the users list with level "op"
      if ($ulist($v1,op)) {

        ; nick is the first chr-33 delimited token of the address
        var %nick = $gettok($ialchan(*,#,%n),1,33)

        ; if this nick isn't already oped: give ops to that nick
        if (%nick !isop #) { mode # +o %nick }

      }
      inc %n
    }
  }
}

(You can remove all the comments of course)


Alternatively, for
Quote:
basically when ever i am 'oped' i want to op every one on my op list

Code:
on me:*:op:#: {
  var %n = 1
  while ($nick(#,%n,a,o)) {
    if ($ulist($ial($v1),op)) { mode # +o $nick(#,%n,a,o) }
    inc %n
  }
}

if you get ops it loops the non-opped users of the channel and gives op to those who match your oplist. Won't trigger for joining users of course. Also note that it's using the internal address list again, which may not hold addresses of users who joined before you did and said/did nothing since then. Especially don't expect it to work if you get ops right after joining.

Re: auto op help [Re: Horstl] #210595 21/03/09 10:47 AM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
it dont work mate ????

Re: auto op help [Re: state] #210596 21/03/09 12:11 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Hum, please try the following, modified code. I added some echoes for debugging purposes - please depict what's happening (or isn't happening) and which of the echoes you see.
Code:
on !op:join:#: { 
  ECHO # * Join: $nick is oplisted 
  if ($me isop #) { mode # +o $nick }
  elseif (!$var($+(oprequest.,$cid,.,#))) {
    ECHO $chan * requesting op from juicer
    set -eu10 $+(%,oprequest.,$cid,.,#) 
    msg juicer op pass
  }
}

on !*:join:#: { ECHO # * Join: $nick isn't oplisted }

on me:*:op:#: {
  ECHO # * Got ops. Users: $nick(#,0)  Unoped: $nick(#,0,a,o)  In internal address list: $ialchan(*,#,0)  Oplist masks: $ulist(*,op,0) 

  var %always.op.oplist = $true

  if ((%always.op.oplist == $true) || ($var($+(oprequest.,$cid,.,#)))) {
    ECHO # * checking for oplisted users - $iif(%always.op.oplist,always,op requested)
    var %n = 1
    while ($nick(#,%n,a,o)) {
      if ($ulist($ial($v1),op)) {
        ECHO # * $nick(#,%n,a,o) oplisted
        mode # +o $nick(#,%n,a,o)
      }
      inc %n
    }
  }
}

The variable %always.op.oplist determines in which case the script will check for oplisted users:
- if you put "$true" there, it will check the users of the channel everytime you get ops
- if you don't put "$true", it will check only if you got this @ because you did request it from "juicer" in the last 10s (because an oplisted user joined while you didn't have @)

You can remove the second on join event and the ECHO lines if it's working as expected.

Re: auto op help [Re: Horstl] #210601 21/03/09 03:23 PM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
the onjoin works. i get all the echos. But i dont get any echos if i am oped

on me:*:op:#: { is not working

It is being very strange. In the room im testing in there is Me, Juicer(are bot) and 2 test nicks. If i am opped it does nothing. But if i op juicer who is not on the op list it will op eveyr one who is on the list

Last edited by state; 21/03/09 03:34 PM.
Re: auto op help [Re: state] #210602 21/03/09 03:34 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You're right - this won't trigger if you're oped but if you're giving op to someone. Sorry smile Instead, use:
Code:
on *:op:#: {
  if ($opnick == $me) {
    -- rest of on op event --
  }
}

Re: auto op help [Re: Horstl] #210603 21/03/09 03:44 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
on me:*:op:#: { echo -a true }
does work though. I op myself and it echos true.

Re: auto op help [Re: Tomao] #210604 21/03/09 03:54 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Exactly the pitfall I stepped into, doing only a quick test on myself with 2 scons which worked - but by triggering "me gives op", not the intended "me gets op"

Re: auto op help [Re: Horstl] #210605 21/03/09 04:12 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Ah..I see. So this works the same as "me gives op" then:
Code:
on @*:RAWMODE:#: {
  if ($1 === +o) && ($2 != $me) {
    ....
  }
}

Re: auto op help [Re: Tomao] #210607 21/03/09 04:35 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Only if a single +o is issued - which isn't always the case, mode strings may be quite complex.
mIRC parses mode strings fine so we can make use of all the supported on *something* events, and I'd go for on rawmode only if really required (that is to parse modes that have no disctinct event). hixxy made a nice script for this smile

Re: auto op help [Re: Horstl] #210613 21/03/09 06:24 PM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
works great. thanks for your time.

some reason though it works on every nick but ignores gavst4. Strange. his address is in the user list

Re: auto op help [Re: state] #210617 21/03/09 07:10 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The script compares every user (their addresses, out of the internal address list) to the op-leveled addresses of your users list. If the address in the users list is correct, I assume he isn't in mIRCs internal address list yet (joining before you did, and did/say nothing in any common channel or query).
You can check this with //echo -a address: $ial(gavst4)

Re: auto op help [Re: Horstl] #210629 22/03/09 12:14 AM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
i got it working. for some reason again thats weird

Control
.Add:/auser op $address($$1,1)

works on every nick, but was not adding gavst4

i had the echo stopped so could not tell if the user was added or not. as i assumed it was added.

* /auser: insufficient parameters was what mirc was saying for gavst4

which is odd again as the same code works for ever one else.

so i manually added the host and it works fine


Re: auto op help [Re: state] #210633 22/03/09 03:12 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
it's not "weird" unless you completely ignored Horstl's post. it won't only be that nick, and unless you start properly dealing with IAL it *will* happen in the future.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: auto op help [Re: state] #210645 22/03/09 04:03 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Maybe I missed someone explaining this. Sorry if I am giving redundant info.

The IAL collects users information when they join or do any action which sends an event to your mirc. (text,mode, etc)

What this means is when you join a room and they are idle, not doing anything, they won't be entered into your IAL. (They means anyone in the room)

To fix this you should who the channel when you join.

Now keep in mind, if you have a lot of people in the room it may flood you out. Or if you join several large rooms at once and automatically who all the channels at once. You may need to devise a queu system to slow down the incoming information.

This is the basic idea.

on me:*:join:#:who #

Re: auto op help [Re: DJ_Sol] #210712 23/03/09 07:24 PM
Joined: Jun 2004
Posts: 133
S
state Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 133
thanks eveyr one.

sol: thank you. to me it was weird as im not a scripter. but you just made it make sense to me. mirc was not oping gavsta when i joined the channel and got opped. but by now /who the channel on join it is finding him

thank you