mIRC Home    About    Download    Register    News    Help

Print Thread
#187916 15/10/07 01:25 AM
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
why dont this work and/or can u make it shorter

Code:
on $5:TEXT:/^[!@.]channel/Si:#The_Channel: { 
  if (%thechan == on) {
    if ($nick isop #The_Channel) {
      /notice $nick You are already an op! You can't get any higher! If you wish to though, type 3/msg $me $+  12Request Admin 
      /notice $nick If you type anything else your request will be void. Also, You have to be on #The_Channel at the time. We may ask you later why or anything else.
    }
  } 
  else { /notice $nick The System is currently offline. Please try again later. Sorry }
}
on $*:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan == on) {
    if ($nick isop #The_Channel) {
      /var %tc. [ $+ [ $nick ] ] $r(0,1000000)
      if (%tc. [ $+ [ $nick ] ] == 0) { /cs access #The_Channel add $nick 5 | notice $nick Congradulations! You have been Auto Opped! | /msg #The_Channel $nick has been Auto Opped! Congradulations! } 
    }
    else { /notice $nick The System is currently offline. Please try again later. Sorry }
  }
}
on $4:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan == on) {
    if ($nick ishop #The_Channel) {
      /var %tc. [ $+ [ $nick ] ] $r(0,10000)
      if (%tc. [ $+ [ $nick ] ] == 0) { /cs op #The_Channel $nick | notice $nick Congradulations! You have been Opped! | /msg #The_Channel $nick has been Opped! Congradulations! } 
    } 
  }
  else { /notice $nick The System is currently offline. Please try again later. Sorry }
}
on $*:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan == on) {
    if ($nick ishop #The_Channel) {
      /var %tc. [ $+ [ $nick ] ] $r(0,100)
      if (%tc. [ $+ [ $nick ] ] == 0) { /cs access #The_Channel add $nick 4 | notice $nick Congradulations! You have been Auto Half-Opped! | /msg #The_Channel $nick has been Auto Half-Opped! Congradulations! } 
    }
  }
  else { /notice $nick The System is currently offline. Please try again later. Sorry }
}
on $3:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan == on) {
    if ($nick isvoice #The_Channel) {
      /var %tc. [ $+ [ $nick ] ] $r(0,50)
      if (%tc. [ $+ [ $nick ] ] == 0) { /cs halfop #The_Channel $nick | notice $nick Congradulations! You have been Half-Opped! | /msg #The_Channel $nick has been Half-Opped! Congradulations! } 
    }
  }
  else { /notice $nick The System is currently offline. Please try again later. Sorry }
}
on $*:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan == on) {
    if ($nick isvoice #The_Channel) {
      /var %tc. [ $+ [ $nick ] ] $r(0,20)
      if (%tc. [ $+ [ $nick ] ] == 0) { /cs access #The_Channel add $nick 3 | notice $nick Congradulations! You have been Auto Voiced! | /msg #The_Channel $nick has been Auto Voiced! Congradulations! } 
    }
  }
  else { /notice $nick The System is currently offline. Please try again later. Sorry }
}
on $*:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan == on) {
    if ($nick isreg #The_Channel) {
      /var %tc. [ $+ [ $nick ] ] $r(0,10)
      if (%tc. [ $+ [ $nick ] ] == 0) { /cs voice #The_Channel $nick | notice $nick Congradulations! You have been Voiced! | /msg #The_Channel $nick has been Voiced! Congradulations! } 
    }
    else { notice $nick Sorry, not this time. try again! }
  }
  else { /notice $nick The System is currently offline. Please try again later. Sorry }
}


This is not the signature you are looking for
Joined: Oct 2007
Posts: 36
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Oct 2007
Posts: 36
Originally Posted By: foshizzle
why dont this work and/or can u make it shorter


Code:
#CODE ON
%tell1 = notice $nick
%tell2 = msg $chan $nick
on $5:TEXT:/^[!@.]channel/Si:#The_Channel: { 
  if (%thechan != on) { goto end } 
    if ($nick isop) { 
      %tell1 You are already an op! You can't get any higher! If you wish to though, type 3/msg $me $+  12Request Admin
      %tell1 If you type anything else your request will be void. Also, You have to be on #The_Channel at the time. We may ask you later why or anything else.
    }
  }
on $*:TEXT:/^[!@.]channel/Si:#The_Channel: {
   if (%thechan != on) { goto end }
     if ($nick isop) {
       var %tc. [ $+ [ $nick ] ] $r(0,1000000)
          if (%tc. [ $+ [ $nick ] ] == 0) { 
            cs access #The_Channel add $nick 5 
            %tell1 Congradulations! You have been Auto Opped! 
            %tell2 has been Auto Opped! Congradulations!
            halt
         } 
     }
     if ($nick ishop) {     
       var %tc. [ $+ [ $nick ] ] $r(0,100)
          if (%tc. [ $+ [ $nick ] ] == 0) { 
            cs access #The_Channel add $nick 4 
            %tell1 Congradulations! You have been Auto Half-Opped!
            %tell2 has been Auto Half-Opped! Congradulations!
            halt
        }
     }
     if ($nick isvoice) {
        var %tc. [ $+ [ $nick ] ] $r(0,20)
           if (%tc. [ $+ [ $nick ] ] == 0) {
             cs access #The_Channel add $nick 3
             %tell1 Congradulations! You have been Voiced! 
             %tell2 has been Voiced! Congradulations!
             halt
         }
     }   
     if ($nick isreg) {
       var %tc. [ $+ [ $nick ] ] $r(0,10)
          if (%tc. [ $+ [ $nick ] ] == 0) { 
          cs voice #The_Channel $nick 
          %tell1 Congradulations! You have been Voiced! 
          %tell2 has been Voiced! Congradulations! 
          halt
        }
     }       
 }
on $4:TEXT:/^[!@.]channel/Si:#The_Channel: {
   if (%thechan != on) { goto end }
     if ($nick ishop) {
       var %tc. [ $+ [ $nick ] ] $r(0,10000)
          if (%tc. [ $+ [ $nick ] ] == 0) { 
            cs op #The_Channel $nick
            %tell1 Congradulations! You have been Opped!
            %tell2 has been Opped! Congradulations!
            halt
          } 
      }
  }
on $3:TEXT:/^[!@.]channel/Si:#The_Channel: {
  if (%thechan != on) { goto end }
    if ($nick isvoice #The_Channel) {
      var %tc. [ $+ [ $nick ] ] $r(0,50)
         if (%tc. [ $+ [ $nick ] ] == 0) {
           cs halfop #The_Channel $nick 
           %tell1 Congradulations! You have been Half-Opped! 
           %tell2 has been Half-Opped! Congradulations!
         } 
      }
   }
   :end
   %tell1 The System is currently offline. Please try again later. Sorry
   unset %tell*
  }
}
#CODE END

I Hope help you, but the CODE can impruve
Hi for all smile

Last edited by asmodeo; 15/10/07 05:47 AM.

·´¯`·.¸¸“Jã¢k øf ãll ‡rãÐ꧅„…Mã§têR øf Nønꔸ¸.·´¯`·
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
You can't goto a point outside of the current function/event.

Also, go back to how you previously had it with if (%thechan == on). Gets rid of the need for the goto's.

Now, that being said, %tell1 = & %tell2 = won't work that way. $nick and $chan have no scope outside of an event. So.. yeah.. not so much help there asmodeo..

Now, back to the original code, as it isn't so bad.

First.. The %tc variables are throw-away. From what I saw, there's no reason to remember then, so don't bother with the [ $+ [ $nick ] ] stuff.. Just set it, use it, then toss it away (/var = good for this).

As events aren't triggered simultaneously, there's no chance of contamination of variables.

When within a script, you don't need to use the '/' command identifier. Every line is considered a command, so you can remove all of the /'s.

As for why it doesn't work, asmodeo got that bit right. You're trigger for all the bits and pieces is basically the same, for all the same level of user. Combining it into one event with the structured 'if' is the right way to go for that.

Anyway, just some thoughts.

Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
?... but how do u stack all the user lvls into one.. im not good with the levels thing


This is not the signature you are looking for
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
You may try this
Code:
on $*:TEXT:/^[!@.]channel/Si:#The_Channel:{ 
  if (%thechan != on) { notice $nick Sorry, the System is currently offline. Please try again later. | return }
  if ($istok(5 4 3 1,$ulevel,32)) { goto $ulevel }
  return

  :5
  if ($nick isop #) {
    notice $nick You are already an op! You can't get any higher! If you wish to though, type 3/msg $me $+  12Request Admin 
    notice $nick If you type anything else your request will be void. Also, You have to be on # at the time. $&
      We may ask you later why or anything else.
  }
  return

  :4
  if ($nick ishop # && $r(0,10000) == 0) { cs op # $nick | _access Opped! }
  return

  :3
  if ($nick isvoice # && $r(0,50) == 0) { cs halfop # $nick | _access Half-Opped! }
  return

  :1
  if ($nick isop # && $r(0,1000000) == 0) { cs access # add $nick 5 | _access Auto Opped! }
  elseif ($nick ishop # && $r(0,100) == 0) { cs access # add $nick 4 | _access Auto Half-Opped! }
  elseif ($nick isvoice # && $r(0,20) == 0) { cs access # add $nick 3 | _access Auto Voiced! }
  elseif ($nick isreg # && $r(0,10) == 0) { cs voice # $nick | _access Voiced! }
}
alias -l _access {
  notice $nick Congratulations! You have been $1-
  msg # $nick has been $1- Congratulations! 
}


Link Copied to Clipboard