egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

!add !del true and black IP (transformed from mrc to tcl)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
AdmiraL
Voice


Joined: 21 Feb 2021
Posts: 1
Location: Germany

PostPosted: Sun Feb 21, 2021 5:31 pm    Post subject: !add !del true and black IP (transformed from mrc to tcl) Reply with quote

Hello all..

I need a little help from everyone ..

With this code under, example if I do in my channel #egitim! Add 1.1.1.1 or! Add 1.1. * And then bot automatically makes the IP in this file blacklist.txt

Code:

on *:TEXT:!add *:#egitim:{
  if ($nick ison #) && ($2 = $read(blacklist.txt,w,$2)) && ($2) { msg #egitim 47I can't add this IP 4IP:  $+ $2 $+  47because is in the List! | halt }
  if ($nick ison #) && ($2 != $read(blacklist.txt,s,$2)) && ($2) { write blacklist.txt $2 | msg #egitim 4IP:  $+ $2 $+  47I have add in List! | kline *@ $+ $2 5m | halt }
}

If i want a ip delete, and when i do !del 1.1.1.1 and the bot can automatically delete this IP from blacklist.txt
Code:

on *:TEXT:!del *:#egitim:{
  if ($nick ison #) && ($2 != $read(blacklist.txt,s,$2)) && ($2) { //filter -ffcx blacklist.txt blacklist.txt $2 | msg #egitim 4IP:  $+ $2 $+  47I have deleted from the List! | kline -*@ $+ $2 | halt }
}
}

and last code when I do trueip 1.1.1.1 and bot automatically puts this ip in list allow.txt! if this IP is in list, bot says * Nick 1 or 2 IP are in my list! * and if there is no IP in this list allow.txt then automatically writes in this channel #egitim! add 1.1.1.1
Code:

ON *:TEXT:*trueip*:#egitim: {
  var %f = allow.txt

  if (!$file(%f)) { msg $chan ( $+ $nick $+ ): Error, file $qt(%f) does NOT exists or it is empty! | return }

  if ($window(@temp)) { window -c $v1 }

  window -hj1000000000 @temp
  loadbuf @temp $qt(%f)

  var %t = $line(@temp,0)
  var %i = 1

  while (%i <= %t) {
    var %w = $strip($line(@temp,%i))

    if (!%w) { goto next }

    if (%w iswm $2) || (%w == $2) { var %tot = $addtok(%tot,%w,32) }

    :next
    inc %i
  }

  window -c @temp

  if (%tot) { msg $chan ( $+ $nick $+ ): $numtok(%tot,32) Matches: %tot }
  else { msg $chan ( $+ $nick $+ ): No results founded! | /msg #egitim !add $2 }
}

thank you if someone has time, i would be grateful.

AdmiraL
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber