Vegito commented on a Page, Make your bot Talk  -  Dec 16, 2013
on *:TEXT:*:#: {
  if ($1-2 = quote info) {
    if (!%waitthreeagain) {
      msg # Totaal aantal Quotes: $+(,$lines($+(quotes.,#,.txt)),)   
      set -u3 %waitthreeagain 1
    }
    else msg # Om flooding te voorkomen: 1 quote om de 3 seconden.
  }
  if ($istok($+($me,:) $me,$1,32)) {
    if (!%waitthree) {    
      set -u3 %waitthree 1
      if (!$2) msg # $+(,$nick,:) $read($+(quotes.,#,.txt),n)
      elseif ($2- !isin $read($+(quotes.,#,.txt), nw, $2-, $readn)) write $+(quotes.,#,.txt) $2- 
    }
    else msg # Om flooding te voorkomen: 1 quote om de 3 seconden.
  }
}

Zo is het veel beter.

DjSxX  -  Dec 21, 2013

thnx @Vegito heb er weer wat bij geleerd :D
Ik ben er nog redelijk n00b in, Heb allen de if regel nog achter de elsif gezet zodat ie ook reageert als je wel een $2 typt ;)

on :TEXT::#: {
if ($1-2 = quote info) {
if (!%waitthreeagain) {
msg # Totaal aantal Quotes: $+(,$lines($+(quotes/quotes.,#,.txt)),)
set -u3 %waitthreeagain 1
}
else msg # Om flooding te voorkomen: 1 quote om de 3 seconden.
}
if ($istok($+($me,:) $me,$1,32)) {
if (!%waitthree) {
set -u3 %waitthree 1
if (!$2) msg # $+(,$nick,:) $read($+(quotes/quotes.,#,.txt),n)
elseif ($2- !isin $read($+(quotes/quotes.,#,.txt), nw, $2-, $readn)) write $+(quotes/quotes.,#,.txt) $2- | msg # $+(,$nick,:) $read($+(quotes/quotes.,#,.txt),n)
}
else msg # Om flooding te voorkomen: 1 quote om de 3 seconden.
}
}

Maar het werkt wel :D

Vegito  -  Dec 22, 2013

Hoe jij het bij elseif hebt gedaan zal niet werken omdat je { } mist.

Maar je zou het ook veel makkelijker kunnen doen.

on *:TEXT:*:#: {
  if ($1-2 = quote info) {
    if (!%waitthreeagain) {
      msg # Totaal aantal Quotes: $+(,$lines($+(quotes.,#,.txt)),)   
      set -u3 %waitthreeagain 1
    }
    else msg # Om flooding te voorkomen: 1 quote om de 3 seconden.
  }
  if ($istok($+($me,:) $me,$1,32)) {
    if (!%waitthree) {    
      set -u3 %waitthree 1
      msg # $+(,$nick,:) $read($+(quotes.,#,.txt),n)
      if ($2- !isin $read($+(quotes.,#,.txt), nw, $2-, $readn)) write $+(quotes.,#,.txt) $2- 
    }
    else msg # Om flooding te voorkomen: 1 quote om de 3 seconden.
  }
}
Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.