mIRC Homepage
Posted By: Kev_Uk OP thanker - 01/01/04 06:31 PM
Hello i have a code here that says thanks for ops if opped, some channels can't stand that sort of thing as it can appear to be lame, but was wondering how do i go about making a
%var so i can set in the popup menu what channels i would want it to go in.

Here's what i got so far, i would imagine i would need to have somesort of /set command to choose what channels i want

#op.thanker off
on *:OP:#: { if ($opnick == $me) && ($nick != $me) /msg # 12,8 Thanks for the @4 $nick 12!¡!¡!¡!  }
#op.thanker end
Posted By: Hauxi Re: OP thanker - 01/01/04 07:05 PM
#op.thanker off
on *:OP:#mirc,#help,#something: { if ($opnick == $me) && ($nick != $me) /msg # 12,8 Thanks for the @4 $nick 12!¡!¡!¡!  }
#op.thanker end
Posted By: Kev_Uk Re: OP thanker - 01/01/04 08:47 PM
Thanks but i'm looking for something that you can add via popup menu as some newbies won't know how to add channels via going into remotes, basically looking for something that uses a possible

on *:OP:%:

then something in the popup for it to add a channel with a
%var that tells the script to what channel it is, if that makes any sense lol.

I knew some auto join scripts which can't remember where they are now, which has 1 to 10 preset channels and you just add them and it saves.
Posted By: Cheech Re: OP thanker - 01/01/04 09:33 PM
how about using $read and /write ?

Code:
  
on *:OP:*: {
 if ($chan isin $read(opchan.txt,s,$chan)) && ( $opnick == $me) {
msg thx etc .. 


then just do a /write popup to add to the .txt file

sorry its sloppy but i only had a few mins
Posted By: Hauxi Re: OP thanker - 01/01/04 09:42 PM
#op.thanker on
on ^*:OP:#:{
if ($chan isin %op.chans) && ($opnick == $me) {
msg $chan Thanks for the op $nick
}
}
#op.thanker end

alias addchan { if ($1 isin %op.chans) { echo -a * $1 is already in thanks list } | else { set %op.chans %op.chans $1- } }
alias remchan { if ($1 isin %op.chans) { set %op.chans $remove(%op.chans,$1) } | else { /echo -a * $1 isn't in thanks list } }

something like that...
Posted By: Kev_Uk Re: OP thanker - 01/01/04 09:43 PM
Hmm that sounds that it could be but is that code for only the rooms i'm opped in, as i'm trying to make it so i can add it manually via popup menu, but not sure what format to do it in
Posted By: J0ke Re: OP thanker - 01/01/04 11:23 PM
try smth like this laugh
Code:
on ^*:OP:%thxch:{ if ($opnick == $me) { msg $chan Thanks for the op $nick } }
menu channel {
  -
  $iif($chan isin %thxch,$style(1)) Thank 4 op:{
    $iif($chan isin %thxch,set %thxch $remtok(%thxch,$chan,1,44),set %thxch $addtok(%thxch,$chan,44))
  }
}


just a quickedit =]
Posted By: Kev_Uk Re: OP thanker - 02/01/04 12:01 AM
No luck on that one, the %var seems to add them on the same line and not a different one, making it conflict and only allowing to paste the text on whatever first channel it was set too.
Posted By: Kev_Uk Re: OP thanker - 02/01/04 12:02 AM
This didn't work as it only added the %op.chans to the %var and not the actual channel
Posted By: KingTomato Re: OP thanker - 02/01/04 01:11 AM
Try this grin:

Code:
on !*:OP:#: { if (($opnick == $me) && (!$istok(%opthanks.exceptions, $chan, 44))) /msg $chan Thanks for op, $nick $+ ! }
menu channel {
  Op Exception
  .Add Channel $active: /opthnx_Add $active
  .Add Channel ???: /opthnx_Add $$?="Enter Channel Name:"
  .-
  .$submenu($opthnx_e($$1))
}
alias opthnx_e {
  if ($1 isin begin,end) return -
  else if ($gettok(%opthanks.exceptions, $1, 44)) {
    var %chan = $gettok(%opthanks.exceptions, $1, 44)
    return Remove %chan : /opthnx_rem %chan
  }
}
alias opthnx_add {
  /set %opthanks.exceptions $addtok(%opthanks.exceptions, $1, 44)
}
alias opthnx_rem {
  /set %opthanks.exceptions $remtok(%opthanks.exceptions, $1, 1, 44)
}
Posted By: Kev_Uk Re: OP thanker - 02/01/04 02:25 AM
Wow that worked pretty cool, although is it possible you could make it so that you add the channels that you want to op to work in rather then adding the channel you don't want op in, seems easily for me to work out
Posted By: KingTomato Re: OP thanker - 02/01/04 04:41 AM
remove the ! from the $istok check on the op event. And viola!
Posted By: Kev_Uk Re: OP thanker - 02/01/04 01:12 PM
Woohoo thanks that worked great, also, how do i go about making that list in alphabetical order?
Posted By: EVH Re: OP thanker - 02/01/04 02:35 PM
Code:
alias opthnx_add {
  /set %opthanks.exceptions $sorttok($addtok(%opthanks.exceptions,$1,44),44)
}
© mIRC Discussion Forums