mIRC Home    About    Download    Register    News    Help

Print Thread
if else goto ( something very wrong #103105 16/11/04 05:54 AM
Joined: Nov 2004
Posts: 8
M
m1rcNb Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Nov 2004
Posts: 8
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- } 
}

Re: if else goto ( something very wrong #103106 16/11/04 01:32 PM
Joined: May 2004
Posts: 95
W
wiebe Offline
Babel fish
Offline
Babel fish
W
Joined: May 2004
Posts: 95
goto can only be used within the same part, not outside it as you are trying with the timer.

Re: if else goto ( something very wrong #103107 18/11/04 01:53 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
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- } 
}

  


billythekid