Author Topic: bankick on autorejoin  (Read 7333 times)

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
bankick on autorejoin
« on: April 14, 2006, 08:37:12 AM »
I'd like to make a script that automatically bankicks users with autorejoin.

If a user rejoins a channel too fast (like 2-3seconds) after being kicked, the script would ban him/her.

I'd do the script myself, but I don't know how to work with timers and some other stuff needed for the script
"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: bankick on autorejoin
« Reply #1 on: April 14, 2006, 01:50:49 PM »
Give this a try out Morio.
If it works well, I'll add it do the Script Downloads.

Code: [Select]
Dim Kicked
Set Kicked = CreateObject("Scripting.Dictionary")

Sub ONKICK(Nickname,Host,Channel,WhoKicked,Reason,ServerNumber)

If Not Kicked.Exists(NickName & ":" & Channel) And IsOP("$me",Channel,ServerNumber) then
   'NickName does not exist, add to Kicked Collection
   Kicked.Add NickName & ":" & Channel, Nickname & ":" & Channel

   'add timer to remove nickname from kicked list in 60 seconds
   SendCommand "/timer $randtimer 1 60 /! RemoveNick " & Nickname & ":" & Channel,ServerNumber
End if

End Sub

Sub ONJOIN(Nickname,Host,Channel,ServerNumber)

If Kicked.Exists(NickName & ":" & Channel) And IsOP("$me",Channel,ServerNumber) then
    'nick already in , set a ban
    SendCommand "/kick " & Channel & " " & Nickname & " AutoRejoin Kick/Ban",ServerNumber
    SendCommand "/mode " & Channel & " +b *!*" & Host ,ServerNumber

    'remove the ban in 180 seconds
    SendCommand "/timer $randtimer 1 180 /mode " & Channel & " -b *!*" & Host,ServerNumber

    'remove nickname from Kicked Collection
    RemoveNick Nickname & ":" & Channel
End If

End Sub

Sub RemoveNick(Key)

If Kicked.Exists(Key) then
    Kicked.Remove Key
End If

End Sub
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: bankick on autorejoin
« Reply #2 on: April 15, 2006, 12:21:54 AM »
the script doesn't work for me, nothing happens, when someone rejoins right after being kicked
"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

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: bankick on autorejoin
« Reply #3 on: May 07, 2006, 10:09:42 AM »
hmm, the script now bans people on autorejoin, but doesn't remove the people from the banlist, it just keeps banning them when they join.

Also when using $randtimer it doesn't even unban them after time has passed I just get this message:
** Timer ID [$randtimer] already exist

if I use specific timers it unbans them after the time has passed, but that's not a good solution, since that only works for 1 person at a time
« Last Edit: May 07, 2006, 10:23:32 AM by Morio »
"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: bankick on autorejoin
« Reply #4 on: May 07, 2006, 12:24:00 PM »
Well, all I can say is, the script works perfect for me when I created it, so something must have been changed in the script.
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: bankick on autorejoin
« Reply #5 on: May 07, 2006, 12:26:32 PM »
Ah, I see the issue now.
Its $rndtimer , not $randtimer.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: bankick on autorejoin
« Reply #6 on: May 08, 2006, 05:58:53 AM »
Still:
** Timer ID [$rndtimer] already exists
:/
"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: bankick on autorejoin
« Reply #7 on: May 08, 2006, 08:23:36 AM »
Does it show exactly like that? Or is there a value in $rndtimer ?
If its not parsing $rndtimer , add a / in front of the timer command.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: bankick on autorejoin
« Reply #8 on: May 08, 2006, 10:32:25 AM »
That line was copied directly from the console

Adding another '/' in front of the timer causes a long list of errors, it caused the error.txt to increase about 1MB in size, I won't post the errors here, since this forum probably doesn't support that long posts anyway. But all the errors seem to be like this:
Code: [Select]
Module: modParseCommands Function: ParseCommands:0:/aline @Error [20:17:30]  ->> ERROR:modParseIdentifiers:Function:ParseIdentifiers:0:/timer $rndtimer 1 10 /mode #moriotest -b *!*~Moriobot@adsl-85-157-222-37.regionline.fi:$rndtimer 1 10 /mode #moriotest -b *!*~Moriobot@adsl-85-157-222-37.regionline.fi Error Number:91 : Object variable or With block variable not set Error Number:91 : Object variable or With block variable not set
« Last Edit: May 08, 2006, 10:34:27 AM by Morio »
"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: bankick on autorejoin
« Reply #9 on: May 08, 2006, 10:37:32 AM »
Well, start over again, with the script as above.
I tested it, and it worked fine.
If you have that many errors, I would suspect something else is screwed up as well.
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: bankick on autorejoin
« Reply #10 on: May 08, 2006, 05:03:38 PM »
Wait for the next Beta Build, Morio, and see what happens.
I am coming out with a fix for a couple of things, maybe the build I am using has some $identifier problems fixed, and script engine stuff as well, as I have been tinkering around with them a bit.
The IceChat God