mIRC Home    About    Download    Register    News    Help

Print Thread
#266455 13/12/19 09:56 PM
Joined: Nov 2019
Posts: 32
A
An0o Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2019
Posts: 32
When me ban ip users

*!*@*.75544455.655456.7654466.ip

Ban -ku 360 adrdress($nick, 4)

The ban active hostip ( *!*@*.655456.7654466.ip)

But

I need active host ip(*!*@*.7654466ip)

The last number of ip only

Haw to work?

An0o #266456 13/12/19 10:16 PM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
var -s %a $address($nick,4) , %a $regsubex(foo,%a,(.*@\*)(.*)(\.[0-9A-F]+\.IP),\1\3) | Ban -ku 360 %a

Ban -ku 360 $regsubex(foo,$address($nick,4),(.*@\*)(.*)(\.[0-9A-F]+\.IP),\1\3)

This only touches the host if it looks like something1@*something2.hex.IP and removes 'something2'

maroon #266457 13/12/19 11:17 PM
Joined: Nov 2019
Posts: 32
A
An0o Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2019
Posts: 32
Thnx

If need change this code only The last section of ip

Read *!*@*..... . ...... . 7654466.ip banlist.txt (read last section only in ip) when user join into the channel read that and ban him When the last section of ip user identical
What change in this code?


ON !*:JOIN:#: {
var %domain = $address($nick,4)
var %ident = $remove($gettok($gettok(%fullhost,2,33),1,64),~)
If ($read(banlist.txt)
Ban -ku 360 $address($nick,4)
}


And that code does not read the second and third and fourth......... lines. It only reads the first line in the banlist.txt

Thnx for help

An0o #266458 14/12/19 04:51 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I still have trouble understanding what you want. And I was trying so hard to figure out what you were saying that I was assuming your original code made sense except for the mask you were needing. The 360 should be touching the 'u' not being a separate parameter. Your code here doesnt make sense. You define the %domand and %ident variables then don't use them again, then you calculate the same address string as in %domain, again, instead of using %domain. But you're using $address($nick,4) again instead of the modified form of it which you asked for earlier.

Also, your IF statement doesn't make sense because it doesn't have matching parenthesis, and doesn't have a THEN condition.
Also, the syntax $read(filename) obtains a randomly different line from the filename each time you repeat it. By not using the 't' switch, it checks to see if line#1 is a number indicating the count of lines following it, and by not using 'n' it checks to see if the file contains %variable and $identifier needing to be evaluated.

maroon #266459 14/12/19 06:14 AM
Joined: Nov 2019
Posts: 32
A
An0o Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2019
Posts: 32

I want code that reads the last section of the ID of the person I have on file and when the last number of the person’s ID matches the file I have saved with this person’s band
*!*@*.75544455.655456.7654466.ip

An0o #266460 14/12/19 12:07 PM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
if it needs to match just the number then the next-to-last token when separated by period chars:

//var -s %a *!*@*.75544455.655456.7654466.ip , %find $gettok(%a,-2,46)

if you have a text file containing these list of numbers, with each on a separate row, then $read can check the file in several methods. In this situation, you're looking for an exact match, so:

if ($read(filename,ntw,%find)) echo -a match for %find found in line $readn

For more examples of using $read see https://en.wikichip.org/wiki/mirc/identifiers/$read

If you need faster access than disk access, you can create a hashtable where these numbers are used to create itemnames, then check to see if the itemname has a value:

//hadd -m jointable 765432 anytext | if ($hget(jointable,765432)) echo -a address match

maroon #266462 14/12/19 10:58 PM
Joined: Nov 2019
Posts: 32
A
An0o Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2019
Posts: 32
Thanks alot mr maroon


Link Copied to Clipboard