mIRC Home    About    Download    Register    News    Help

Active Threads | Unanswered Past 24 hours | Past 48 hours | Past Week | Past Month | Past Year
Feature Suggestions Jump to new posts
Feature to read and edit yml files Zenti 30/09/23 01:34 PM
I would be happy if you could read and edit yml files.
Similar to the $read and /write functions.

Spaces should also be taken into account when setting variables!
0 31 Read More
General Discussion Jump to new posts
New Network Towie 25/09/23 01:59 AM
Hi just wanting to know how we go about getting out network added to the next version of mirc ? Thanks smile
0 45 Read More
Scripts & Popups Jump to new posts
Control Bot by commands Epic 24/09/23 07:00 AM
Request from Robert

Please help me a bit with this code snippet. Thanks my friend !
Users or Admins (of Bot) can be able to use Bot commands if and only if the following two conditions are:

1. Must be present in the channel #userbot or #botadmin
2. Ip/hostmask must be in the file list userbot.txt or botadmin.txt

Here is my code write by myself:
Code
on *:text:#:{
  if (!$read(BOTCOMMAND_CHAN.txt,nwt,$chan)) { return }
  var %host $ial($nick).host 
  if ($read(userbot.txt,ntw,%host) && $nick ison #userbots) || ($read(botadmin.txt,ntw,%host) && $nick ison #botadmins) {
  tokenize 32 ($1-)
  if ($1 == ~command1) || ($1 == .command1) || ($1 == .command1) || ($1 == command1) {
  ....... (do command 1).......
  if ($1 == ~command2) || ($1 == .command2) || ($1 == .command2) || ($1 == command2) {
  ....... (do command 2).......
  if ($1 == ~command 3) || ( $1 == .command 3) || ($1 == !command 3) || ($1 == command3) {
  ........ (do command 3)......
  .....
  .....
    }
  }
}

;------------- file userbot.txt and botadmin.txt -------------
Ip/hostmask per line:

NickChat.users.undernet.org
102.245.32.51
254.114.52.78
........


------------------------------------------------------------------------------------------------------------------------------------------------------

Solution

Try using this script code:
Code
on *:TEXT:*:#:{
  if (!$read($file_bcc,ntw,$chan)) { return }
  if (!$on_access($ial($nick).host)) { return }
  if (!$on_chan(#userbot,#botadmin)) { return }
  ;----------------------------------------
  if (command1 isin $1 && $is_pref($1,!.~)) {
    echo -a 30test:38 $chan $nick - do $1
  }
  if (command2 isin $1 && $is_pref($1,!.~)) {
    echo -a 30test:38 $chan $nick - do $1
  }
  if (command3 isin $1 && $is_pref($1,!.~)) {
    echo -a 30test:38 $chan $nick - do $1
  }
}

alias -l file_bcc { return $scriptdir\botcomchan.txt }
alias -l file_user { return $scriptdir\userbot.txt }
alias -l file_admin { return $scriptdir\botadmin.txt }
alias -l on_access { if ($read($file_user,ntw,$1)) || ($read($file_admin,ntw,$1)) return $true }
alias -l on_chan { var %i 1 | while (%i <= $0) { if ($nick ison $eval($+($,%i),2)) return $true | inc %i } }
alias -l is_pref { if ($1) || ($left($1,1) isin $2) return $true }

Note: All files related to this script should be located in the same folder where the script itself is located. Take this as a rule for the future.
0 154 Read More
Scripts & Popups Jump to new posts
Scan NickName,Ident,Ip/hostmask blacklist help Robert 15/09/23 02:35 PM
Can someone help me to update new version of this code to scan blacklist on file text when MyBot join channel, and automatic scan for blacklisted from globalkickdatabase.txt,in file text structure like this:

(1) (2) (3) (4) (5) (6)
[id: xxxx];<Nickname>;<ident>;<ip/host>;<#channel>;<reason kick>

Example: in file globalkickdatabase.txt i save per line

[id: 5678];NickName;uid405139;sven.users.undernet.org;#myroom;NickName is not welcome here any more
[id: 1234];NickTest;testident;10.20.30.40;#happy;NickTest is not welcome here
[id: 6789];Hithere;hithereident;my.host.org;#test;Are you hithere?
...........

I want Bot scan and check NickName and IDENT and IP/HOSTMASK when my Bot join channel:
1. Check NICKNAME (if found then ban NICKNAME and kick on <#channel> (5) with the <reason kick> (6) in file.txt structure above.)
2. Check IDENT (if found then ban IDENT and kick on <#channel>(5) with the <reason kick>(6) in file.txt structure above.)
3. Check IP/HOSTMASK if found then ban IP/HOSTMASK and kick on <#channel>(5) with the <reason kick>(6) in file.txt structure above.)

Here is code (made by Epic):
Code
;#####################################################################
;#   Name: Scan Joining Users (Beta dev 2)
;#   Author: Epic (epicnet@mail.ru, http://epicnet.ru)
;#   Idea: Robert
;#   Description: Scans for all blacklisted users who join channels, or when the bot reconnects to channels, it will scan all users on the channels.
;#   Note: You must create a file "globalkickdatabase.txt" in the mIRC root folder in this format for each line: [ID: 1234];*!*@Host;Reason kick
;#####################################################################

alias -l scanjoin_set {
  %sj_work = yes
  %sj_who_delay = 5000
  %sj_ban_time = 10800
  %sj_rem_nick = MyBotName
}
on *:JOIN:#:{
  if (!$read(SCANBLACKLISTONMEJOIN_CHAN.txt,ntw,$chan)) { return }
  scanjoin_set
  if (%sj_work == yes) {
    if ($nick == $me) {
      %scanjoin = on
      .timerSJWHOME $+ $chan -m 1 %sj_who_delay .who $chan
    }
  }
  else {
    var %ident $ial($nick).user
    var %host $ial($nick).host
    scanjoin $chan $nick %ident %host
  }
}

raw 352:*: if (%scanjoin == on) { scanjoin $2 $6 $3 $4 | haltdef }
raw 315:*: if (%scanjoin == on) { unset %scanjoin | haltdef }
alias -l scanjoin {
  if ($me !isop $1 && !$hget(scanjoin,stop)) {
    .echo -s For further actions, I need the rights of the channel operator:12 $1
    .hadd -mz scanjoin stop 30
    halt
  }
  var %chan $1
  var %nick $2
  var %ident $3
  var %host $4
  var %file = globalkickdatabase.txt
   if ($read(%file,ntw,$+(*,%ident,*))) {
    var %str $read(%file,$readn)
    if ($chr(35) == $left(%str,1)) goto next1
    tokenize 59 %str
    if ($+(*,%ident,*) iswm $2) {
      var %idban $1
      var %reason $3
      .ban $+(-u,%sj_ban_time) %chan $+($gettok($address(%nick,0),1,64),@*)
      .kick %chan %nick 04([Banned] (reason: %reason $+ ) %idban $+ )
      goto next2
    }
    : next1
  }
  if ($read(%file,ntw,$+(*,%host,*))) {
    var %str $read(%file,$readn)
    if ($chr(35) == $left(%str,1)) goto next2
    tokenize 59 %str
    if ($+(*,%host,*) iswm $2) {
      var %idban $1
      var %reason $3
      .ban $+(-u,%sj_ban_time) %chan $+(*!*@,$gettok($address(%nick,0),2,64))
      .kick %chan %nick 04([Banned] (reason: %reason $+ ) %idban $+ )
    }
    :next2 
  }
}

Thanks all for help and i hope receive the aswer with the new code version soon!!!!
0 110 Read More
mIRC Help Jump to new posts
Quote people in channels marisco 10/09/23 12:34 PM
Hello
I use mirc to connect to the irc-hispano server.
When I enter a channel with desires, hundreds of users are shown in the right area....how do I quote the people in the chat when I'm writing in the bottom bar?
I see that if I write an "@" and press tab, down in the bar the nicknames are exchanged between the operators/admins of the channel.
If I write a letter and press tab it jumps between the nicknames that begin with that letter...
When writing a nickname is it cited?
And tell the person that you have written their name?
Thank you
0 81 Read More