mIRC Homepage
Posted By: Natoriousb Help me please, Just learnin to script - 02/08/04 06:04 PM
I need some help with an auto response. I want to responed to people after I auto op them, but only if I op them. This is what i have so far

On *:Text:*Thanks for the*:#mar-ops:{
/msg $chan Not a problem $nick
}

any suggestions?
Thanks grin
Posted By: theRat Re: Help me please, Just learnin to script - 02/08/04 06:29 PM
on @*:Text:*Thanks for the*:#mar-ops:{
if ( $istok(%opped,$nick,32) ) {
/msg $chan Not a problem $nick
set %opped $remtok(%opped,$nick,1,32)
}
}

on @:op:#mar-ops: {
if ( $nick == $me ) {
set %opped %opped $opnick
}
}



try something like that...
Thanks, but that doesnt seem to be working.

Whats : %opped

thanks for ya help
Posted By: MikeChat Re: Help me please, Just learnin to script - 03/08/04 04:00 AM
in mode changes like op deop and so on the person making the change is held in $nick
Code:
 
on *:op:#:if ($nick == $me) { msg $chan $nick has opped $opnick }
 

and if you're making the change you can do this:

on me:*:op:#:msg $chan $nick has opped $opnick

That will only trigger when YOU do it. If you're planning on using things for others and you, use what MikeChat showed you as it'll be easier to integrate
This is what i have
------------------------------------------------
on @*:Text:*Thanks for the*:#mar-ops:{
if ( $istok(%opped,$nick,32) ) {
/say Not a problem $nick
set %opped $remtok(%opped,$nick,1,32)
}
}

on *:op:#:if ($nick == $me) { msg $chan $nick gave ops to $opnick }
on me:*:op:#:msg $chan $nick gave ops to $opnick
---------------------------------------------------------------
Only the last line of code works. Can you help me fix the top part?
on me:*:op:#:msg $chan $nick gave ops to $opnick

replaces:

on *:op:#:if ($nick == $me) { msg $chan $nick gave ops to $opnick }

So you dont need both of them.

Code:
on @*:Text:*Thanks for the*:#mar-ops:{
  if ( $istok(%opped,$nick,32) ) {
   say Not a problem $nick
   set %opped $remtok(%opped,$nick,1,32)
  }
}


As for the above, does it even trigger? Maybe try this to test to see if it even triggers:

Code:
on @*:Text:*Thanks for the*:#mar-ops:{
  echo -s THIS IS A TEST
  if ( $istok(%opped,$nick,32) ) {
   say Not a problem $nick
   set %opped $remtok(%opped,$nick,1,32)
  }
}


If the "this is a test" does not even fire, that would be a place to start figuring out why it wont (like multiple on text events etc)
This is a test showed up...but the rest doesnt.
This might sound stupid but why not use:

Code:
if ($nick isin %opped) {
 say Not a problem $nick
 set %opped $remtok(%opped,$nick,1,32)
}


I understand you are trying to see if the token (which is actually the nickname firing the event) exists in that variable, but would my above example work for you? Tokens arent my thing and while I understand them, I feel like Im missing something important but it could just be me.
Posted By: Coolkill Re: Help me please, Just learnin to script - 08/08/04 10:15 PM
One usually doesnt use "isin" when searching for specific set of characters in a phrase, because:

%var being; testingabc this is a test

if (abc isin %var) would return true, because, it appears in the string, however it is NOT a "word" on its own.. whereas $istok checked if it was a "word" by looking to see if there was a space either side..

If you are still looking for a working solution, with the same effect as the first lot of coding..

On *:Text:*Thanks for the*:[color:red]#channel
:{
if (!$hget(opr,$nick)) {
msg $chan Not a problem $nick
hadd -mu60 opr $nick 1
}
}
[/color]
Eamonn.
I agree for that exact reason, but I just couldnt (for some stupid reason) figure out that simple token code - it just wasnt happening lol Im sure you know what I mean
Posted By: Iori Re: Help me please, Just learnin to script - 08/08/04 10:52 PM
Then you're probably not adding the nick to the var when you op them.
  • on me:@*:op:#mar-ops:set %opped $addtok(%opped,$opnick,32)

that works but it does it even when Im not the one doing the opping

[01:30] * murda-- sets mode: +v T-MaC
[01:30] <T-MaC> • Thanks for the +v •
[01:30] > Not a problem T-MaC

I want it to do it just for opping when i do it. I figured out how to get it to do it in any chan im in but I cant figure out how to do it just for ops by me. Any Suggestions?
so then do something as simple as

if ($nick == $me) { stuff }

the above means if YOU op the person.

if ($opnick == $me) { stuff }

the above means if you're the one being opped

if (($opnick == $me) && ($nick == $me)) { stuff }

the above means if you're the one opping and you're the one being opped (thought Id throw this in anyhow jsut to illustrate is all). Do any of those help you out at all??
I tried what you posted , but it doesnt work? what goes where "stuff" is?

if ($nick == $me) { stuff }
referrencing therat's example:

Code:
on @:op:#mar-ops: {
  if ($nick == $me) { set %opped %opped $opnick }
}


See how it all fits together? if you have more if statements that you want to fire when you're the one who opped somebody you'd use (totally made up code):


Code:
on @:op:#mar-ops: {
  if ($nick == $me) {
    if ($nick == hello-there) { command1 }
    if ($me == Bossman) { msg # Bossman says know your role }
  }
}
© mIRC Discussion Forums