Author Topic: Protection Scripts  (Read 33407 times)

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #15 on: July 28, 2008, 03:17:26 AM »
Sorry forget what i said about the NOT operator,the "If ModeSetter = GetIdentifier("$me") then exit sub"
is very convenient thnx.

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #16 on: July 30, 2008, 08:39:21 AM »
Lets say my ident and host mask (cloaked +x) is like this: myident @ 61ACE7BC.B769553C.3D50937B.IP

With what code do i get my ident?

Also if someone bans me like this +b *!*@*.B769553C.3D50937B.IP can i counter the ban somehow or even counter an atempt of another operator to ban my domain?

Code: [Select]
if LCase(mode) = "+b *!*@" & LCase(MyHost) then
SendCommand "/mode " & channel & " -b *!*@" & myhost,ServerNumber
SendCommand "/kick " & channel & " " & modesetter & " Do Not Ban Me",servernumber
        SendCommand "/mode " & channel & " +b " & modesetter &" !*@*",ServerNumber
end if

this works perfectly if they ban me like this *!*@61ACE7BC.B769553C.3D50937B.IP which is the most common host mask ban but i'd like to counter more sofisticated efforts  8-) .Does anyone know how?

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Protection Scripts
« Reply #17 on: July 30, 2008, 10:33:48 AM »
look at the $mask identifier in the scripting section of this site, then make a 'for' loop check all the alternatives
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Protection Scripts
« Reply #18 on: July 30, 2008, 10:59:01 AM »
When this script gets completed, let me know please, and I can place it in the Downloads Section on the website.

Thanks
The IceChat God

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #19 on: July 30, 2008, 02:16:00 PM »
Okkie i made something in an attempt to counter all kinds of bans.I'll test it later but i'm complete noob with VB and icechat identifiers...So before i get a dozen of errors i'd like some opinion or corrections.

Code: [Select]
Sub ONMODE(Channel,ModeSetter,Mode,ServerNumber)

'if you do not have ops on the channel then the script does not need to run
If Not IsOp(GetIdentifier("$me"),Channel,ServerNumber) then Exit Sub

Dim N as integer
FullMask = GetIdentifier("$fullhost",ServerNumber)
For N = 0 To 10
MyHost = $mask(FullMask,N)
if LCase(mode) = "+b *!*@" & LCase(MyHost) then
SendCommand "/mode " & channel & " -b *!*@" & myhost,ServerNumber
SendCommand "/kick " & channel & " " & modesetter & " Do Not Ban Me",servernumber
        SendCommand "/mode " & channel & " +b " & modesetter &" !*@*",ServerNumber
end if
Next N

End Sub

I searched some stuff for VB and i just let my imagination do the rest  :lol:
Sorry for such an eyesore...

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Protection Scripts
« Reply #20 on: July 30, 2008, 03:18:03 PM »
The $mask identifier actually adds the *!* and such in front of the host, so there is no need to add that in there, to check for it.

The IceChat God

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #21 on: July 30, 2008, 05:22:07 PM »
I've removed the *!*@ from lines 10 and 11.

So far i get an error:1025:Expected end of line:line #4 -- Dim N as integer
I don't know if this code is needed for the $mask(FullMask,N)
and if it is i don't know how to end it in VB...

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Protection Scripts
« Reply #22 on: July 30, 2008, 09:47:31 PM »
You can not dim as integer, because VB Script does not have variable 'types'
You simply "Dim N"
The IceChat God

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #23 on: July 31, 2008, 06:49:42 AM »
I removed "as integer" and simply used 'Dim N' now i get this:

-- Script Engine Error:1032:The character isn't valid: Line #7 -- MyHost = $mask(FullMask,N)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Protection Scripts
« Reply #24 on: July 31, 2008, 08:27:50 AM »
Because you did not use GetIdentifier. Look at the others.

MyHost = GetIdentifier("$mask(" & FullMask & "," & N & ")")

You can not use straight $identifiers like that, you need to parse them with GetIdentifier.
The IceChat God

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #25 on: July 31, 2008, 09:06:48 AM »
Code: [Select]
Sub ONMODE(Channel,ModeSetter,Mode,ServerNumber)

'if you do not have ops on the channel then the script does not need to run
If Not IsOp(GetIdentifier("$me"),Channel,ServerNumber) then Exit Sub

Dim N
FullMask = GetIdentifier("$fullhost",ServerNumber)
For N = 0 To 10
MyHost = GetIdentifier("$mask(" & FullMask & "," & N & ")",ServerNumber)
if LCase(mode) = "+b " & LCase(MyHost) then
SendCommand "/mode " & channel & " -b " & myhost,ServerNumber
SendCommand "/kick " & channel & " " & modesetter & " Do Not Ban Me",servernumber
        SendCommand "/mode " & channel & " +b " & modesetter &" !*@*",ServerNumber
end if
Next N
End Sub

This is it so far:-- Script Engine Error:1025:Expected end of line: Line #13 -- Next N

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Protection Scripts
« Reply #26 on: July 31, 2008, 11:31:16 AM »
the line should say just 'Next' not 'Next N'
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Protection Scripts
« Reply #27 on: July 31, 2008, 11:39:49 AM »
Lol, I guess I should have taken more then 5 seconds to look at it quickly and gone through the whole thing, but all in all, it's good to make mistakes, because then you learn for next time.  :mrgreen:
The IceChat God

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #28 on: July 31, 2008, 12:04:40 PM »
It's ok  :-P i am learning - (at least i think so  :-D) - i'll check that baby again

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Protection Scripts
« Reply #29 on: July 31, 2008, 01:15:56 PM »
Okkie i removed the N next to "Next".
Now the script doesn't have any errors,
it doesn't work though.

It's supposed to counter all kinds of bans,
i tested it for the most simple but nothing happened.
-any ideas  :?