mIRC Homepage
Posted By: m1rcNb if else goto ( something very wrong - 16/11/04 05:54 AM
Oke.. here it is i am not that of a mirc scripter and basicly what i am trying to do is to determen when and if somebody has either voice or ops, and if i am opped yes or no. ( no need for auth flags and things like that. )

i had a bit trouble with waiting for chanserv to give ops and than execute the kick / ban. However now in my status window it keeps on saying that it can not find checknick.

I prolly did alot of things wrong here, so hopefully somebody can help me on this.

Code:
on *:TEXT:!spam*:#:{
  if ($2 isop $chan) { .notice $nick Status: $2 es un Operador del Canal | .notice $nick Request: DENIED } { halt }
  .notice $nick Request: ACCEPTED
  .notice $nick Procedure: In Progress...
  if ($me !isop $chan) goto needops
  if ($me isop $chan) goto checknick

  :gettingops 
  .timer 0 3 goto checknick

  :checknick
  if ($nick isop $chan) goto action
  elseif  ($nick isvoice $chan) goto isvoiced
  elseif  ($nick !isvoice $chan) goto unvoiced

  :needops
  if ($me !isop $chan) { .chanserv op $chan $me } goto gettingops

  :action 
  if ($2 == $me) { .notice $nick Status: $2 es un Operador del Canal | .notice $nick Request: DENIED } { halt }
  .msg $chan O_o
  if ($nick isop $chan) { .timer 0 30 | .ban -u300 $chan $2 Spammer 3 | .kick $chan $2 4Banned(30s)13 [OPS]: $nick found $2 Spamming }

  :unvoiced
  if ($nick !isvoice $chan) { .notice $nick Disculpa no tienes voice ó ops en $chan } 

  :isvoiced
  if (!$3) { .notice $nick Disculpa tiene que poner un razon } { halt }
  if ($nick isvoice $chan) { .timer 0 30 | .ban -u60 $chan $2 $3- | .kick $chan $2 4Banned(60s)13 [+v SN] Reason: $3- } 
}
Posted By: wiebe Re: if else goto ( something very wrong - 16/11/04 01:32 PM
goto can only be used within the same part, not outside it as you are trying with the timer.
Posted By: billythekid Re: if else goto ( something very wrong - 18/11/04 01:53 PM
change the gotos to aliases then call each alias with the timer something like....
Code:
on *:TEXT:!spam*:#:{
  if ($2 isop $chan) { .notice $nick Status: $2 es un Operador del Canal | .notice $nick Request: DENIED } { halt }
  .notice $nick Request: ACCEPTED
  .notice $nick Procedure: In Progress...
  if ($me !isop $chan) needops
  if ($me isop $chan) checknick
}
alias -l gettingops { .timer 0 3 checknick }
alias -l checknick {
  if ($nick isop $chan) action
  elseif  ($nick isvoice $chan) isvoiced
  elseif  ($nick !isvoice $chan) unvoiced
}
alias -l needops {
  if ($me !isop $chan) { .chanserv op $chan $me } gettingops
}
alias -l action {
  if ($2 == $me) { .notice $nick Status: $2 es un Operador del Canal | .notice $nick Request: DENIED } { halt }
  .msg $chan O_o
  if ($nick isop $chan) { .timer 0 30 .ban -u300 $chan $2 Spammer 3 | .kick $chan $2 4Banned(30s)13 [OPS]: $nick found $2 Spamming }
}
alias -l unvoiced {
  if ($nick !isvoice $chan) { .notice $nick Disculpa no tienes voice ó ops en $chan } 
}
alias -l isvoiced {
  if (!$3) { .notice $nick Disculpa tiene que poner un razon } { halt }
  if ($nick isvoice $chan) { .timer 0 30 .ban -u60 $chan $2 $3- | .kick $chan $2 4Banned(60s)13 [+v SN] Reason: $3- } 
}

  
© mIRC Discussion Forums