blackvenomm666 commented on a Page, Need some help with a $read check/comparison   -  Sep 19, 2013

you could try switching it around and try using isin instead of ==

if ($read+ $chan $(bans- $+ .txt,w, $1-)) isin $1- ) { .msg $chan .timeout $nick | echo # 14(00 $+ $time $+ 14) 10-11-15- 5min timeout on $nick }
  elseif ($1 == !addban) {
blackvenomm666  -  Sep 19, 2013

now that i'm looking at it more you may need a while loop to cycle through everything said.

Menteroth  -  Sep 20, 2013

"isin" doesn't work either. I have no idea how loops work. as I stated above. I don't really script and I suck at it. :)

blackvenomm666  -  Sep 20, 2013

I'll help you out in a bit

Menteroth  -  Sep 21, 2013

thanks. it's no rush. I appreciate any help I can get.

blackvenomm666  -  Sep 22, 2013

i am not the best with while loops myself but i believe this should work

on 1:TEXT:*:#:{
  var %a = 1, %b = $lines(bans- $+ $chan $+ .txt)
  while (%a <= %b) {
    if ($read(bans- $+ $chan $+ .txt, %a) isin $1-) {
      .msg $chan .timeout $nick 
      echo # 14(00 $+ $time $+ 14) 10-11-15- 5min timeout on $nick 

      inc %a
    }
    inc %a
  }
  elseif ($1 == !addban) {
    if ($2 == $read(bans- $+ $chan $+ .txt,w, $2-)) { msg $chan banmask " $+ $2- $+ " is already added. }
    else { write bans- $+ $chan $+ .txt $2- | msg $chan banmask " $+ $2- $+ " added. }
  }
  elseif ($1 == !delban) {
    if ($2 != $read(bans- $+ $chan $+ .txt,w, $2-)) { msg $chan no such banmask " $+ $2- $+ ". }
    else { write -ds " $+ $2- $+ " bans- $+ $chan $+ .txt | msg $chan banmask " $+ $2- $+ " deleted. }
  }
}
Menteroth  -  Oct 03, 2013

sorrry for the late response. the banmask check works, if it's with other text or just alone but I can't add or delete banmasks. the commands doesn't work.

blackvenomm666  -  Oct 04, 2013
von 1:TEXT:*:#:{
  var %a = 1, %b = $lines(bans- $+ $chan $+ .txt)
  while (%a <= %b) {
    if ($read(bans- $+ $chan $+ .txt, %a) isin $1-) {
      .msg $chan .timeout $nick 
      echo # 14(00 $+ $time $+ 14) 10-11-15- 5min timeout on $nick 

      inc %a
    }

  elseif ($1 == !addban) {
    if ($2 == $read(bans- $+ $chan $+ .txt,w, $2-)) { msg $chan banmask " $+ $2- $+ " is already added. }
    else { write bans- $+ $chan $+ .txt $2- | msg $chan banmask " $+ $2- $+ " added. }
  }
  elseif ($1 == !delban) {
    if ($2 != $read(bans- $+ $chan $+ .txt,w, $2-)) { msg $chan no such banmask " $+ $2- $+ ". }
    else { write -ds " $+ $2- $+ " bans- $+ $chan $+ .txt | msg $chan banmask " $+ $2- $+ " deleted. }
  }
}
}   
Menteroth  -  Oct 05, 2013

thanks a lot. I will try this in a bit.

Menteroth  -  Oct 07, 2013

First thing I did was trying to add a banmask:

(10:22:15) (menteroth) !addban megamongo
(10:22:17) (mentbot) banmask "megamongo" added.
(10:22:17) (mentbot) banmask "megamongo" is already added.
(10:22:18) (mentbot) banmask "megamongo" is already added.
(10:22:18) (mentbot) banmask "megamongo" is already added.
(10:22:18) (mentbot) banmask "megamongo" is already added.
(10:22:18) (mentbot) banmask "megamongo" is already added.
(10:22:19) (mentbot) banmask "megamongo" is already added.
(10:22:19) (mentbot) banmask "megamongo" is already added.
(10:22:19) (mentbot) banmask "megamongo" is already added.
(10:22:19) (mentbot) banmask "megamongo" is already added.
(10:22:20) (mentbot) banmask "megamongo" is already added.
(10:22:20) (mentbot) banmask "megamongo" is already added.
(10:22:20) (mentbot) banmask "megamongo" is already added.
(10:22:21) (mentbot) banmask "megamongo" is already added.

like 20 times more of this segment until it disconnected for flooding.

Menteroth  -  Oct 07, 2013

same thing with !delban. floods.

and reading/comparing from text file doesn't work. if banmask is entered with other text: blabla banmask bla bla

blackvenomm666  -  Oct 07, 2013

What server can I find you on

Menteroth  -  Oct 07, 2013

I'm using twitch.tv's IRC server. you don't wanna test things there. 'cause if you flood there you can't talk for like 4 hours or something.

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.