Author Topic: !warn Script  (Read 10923 times)

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
!warn Script
« on: July 08, 2008, 03:54:16 AM »
I came up with this idea while I was getting pissed a player in a hangout channel for spam, and for disobeying other rules, and I don't like to kick and ban people, I think its unfair..

So I came up with the idea of a !warn script.

So that I can !warn <member> when they do something wrong to give them a warning to straighten up.

They get 3 warnings.

If they reach 3, a 1 long ban.

I want to know if anyone can make me this script?

If someone does it will be MUCH appreciated.

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: !warn Script
« Reply #1 on: July 09, 2008, 01:15:37 AM »
Also it would be nice if there could be a !unwarn command.

And make this so that it is only able to be used by me.

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: !warn Script
« Reply #2 on: July 09, 2008, 03:25:53 AM »
And another thing that would be nice to have is a !warni script.

So that if I type !warni <member> it shows there warn level.

(That command can be used by anyone).

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: !warn Script
« Reply #3 on: July 09, 2008, 11:21:49 AM »
How do you want to give them a warning?
The IceChat God

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: !warn Script
« Reply #4 on: July 09, 2008, 07:56:21 PM »
You have been warned for <reason>. (1/3)

And I mean (1/3) to show how many warns he has and how many he has left.

And and you throw in some colors? lol, like orange, and then once you get to the reason, red, then orange again.

So the total commands would be.

!warn

!unwarn

!warni

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: !warn Script
« Reply #5 on: July 09, 2008, 10:49:34 PM »
Do you want to send them a private message, channel message, notice?
The IceChat God

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: !warn Script
« Reply #6 on: July 09, 2008, 10:53:50 PM »
I would like for it to be a channel message.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: !warn Script
« Reply #7 on: July 11, 2008, 11:01:54 AM »
Ok, here is the script, it does not set a timed ban, it simply sets a ban.
It tries to get the users host from the IAL, if not, it will just ban the nickname.

Paste this into the Script Editor, and save it as a IceChat 5 Script file.
If you want to change the message colors for each warning number, simply
change the numbers (Which are the Color Code Numbers) at the beginning of the script.
This script will work in any channel on any server, and settings are saved by nickname.

All these commands can only be used by you, except for the !warni , which can be used by you, or anyone else.

Code: [Select]
Dim WarnColors(3)
WarnColors(1) = 8
WarnColors(2) = 7
WarnColors(3) = 4

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
if left(Message,7) = "!warni " then
    'get the nickname
    if len(Message) > 7 then
        nick = mid(OutGoingText,8)
        ShowCWarning nick,Channel,ServerNumber
    end if   
end if
End Sub

Function OUTTEXT(OutgoingText)
if left(OutGoingText,6) = "!warn " then
    SendCommand OutGoingText
    'get the nickname
    if len(OutGoingText) > 6 then
        nick = mid(OutGoingText,7)
        AddWarning nick
    end if   
elseif left(OutGoingText,7) = "!warni " then
    SendCommand OutGoingText
    'get the nickname
    if len(OutGoingText) > 7 then
        nick = mid(OutGoingText,8)
        ShowWarning nick
    end if   
elseif left(OutGoingText,8) = "!unwarn " then
    SendCommand OutGoingText
    'get the nickname
    if len(OutGoingText) > 8 then
        nick = mid(OutGoingText,9)
        RemoveWarning nick
    end if   
else
    OutText = OutGoingText
end if
End Function

Sub AddWarning(Nickname)
'check if warning exists
check = GetIniFile("warnings.ini","Warnings",Nickname,0)
if check < 3 then check = check + 1
WriteIniFile "warnings.ini","Warnings",Nickname,check
SendCommand "/say " & WarnColors(check) & "You have now been warned (" & check & "/3) times, " & Nickname
if check => 3 then
   'try and get the host from the IAL
   host = GetIdentifier("$ial(" & Nickname & ").host")
   if host <> "" then
     SendCommand "/mode # +b *!" & host 
   else
     SendCommand "/mode # +b " & Nickname & "!*@*"
   end if
end if
End Sub

Sub ShowWarning(Nickname)
check = GetIniFile("warnings.ini","Warnings",Nickname,0)
SendCommand "/say " & WarnColors(check) & Nickname & " has been warned (" & check & "/3) times"
End Sub

Sub ShowCWarning(Nickname,Channel,ServerNumber)
check = GetIniFile("warnings.ini","Warnings",Nickname,0)
SendCommand "/msg " & Channel & " " & WarnColors(check) & Nickname & " has been warned " & check & " times",ServerNumber
End Sub

Sub RemoveWarning(Nickname)
WriteIniFile "warnings.ini","Warnings",Nickname,""
SendCommand "/say Warnings have been removed for " & Nickname
End Sub
« Last Edit: July 11, 2008, 11:11:58 AM by Snerf »
The IceChat God

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: !warn Script
« Reply #8 on: July 11, 2008, 11:45:14 AM »
[14:44] <~SniperPro> !warn sladewill Test
[14:44] <~SniperPro> You have now been warned (1/3) times, sladewill Test
[14:44] <~SniperPro> !warn sladewill Test
[14:44] <~SniperPro> You have now been warned (2/3) times, sladewill Test
[14:44] <~SniperPro> !warn sladewill Test
[14:44] <~SniperPro> You have now been warned (3/3) times, sladewill Test
[14:44] * SniperPro sets mode +b *!$null@* for #test

Thats what it does, I just want it to kick + ban, only the nickname.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: !warn Script
« Reply #9 on: July 11, 2008, 01:42:29 PM »
How is "sladeWill Test" a nickname?

You only send the nickname, and nicknames do not have spaces in them.

Change the AddWarning sub code, with the code below.

Code: [Select]
Sub AddWarning(Nickname)
'check if warning exists
check = GetIniFile("warnings.ini","Warnings",Nickname,0)
if check < 3 then check = check + 1
WriteIniFile "warnings.ini","Warnings",Nickname,check
SendCommand "/say " & WarnColors(check) & "You have now been warned (" & check & "/3) times, " & Nickname
if check => 3 then
  SendCommand "/mode # +b " & Nickname & "!*@*"
  SendCommand "/kick # " & Nickname   
end if
End Sub
The IceChat God

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: !warn Script
« Reply #10 on: July 12, 2008, 03:29:03 PM »
Thankyou!

It works great


Rizzo

  • Newbie
  • *
  • Posts: 3
Re: !warn Script
« Reply #11 on: July 18, 2008, 12:38:59 AM »
I would be very keen to use this, but a kick instead of a ban - would someone be able to do this for me please?

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: !warn Script
« Reply #12 on: July 18, 2008, 03:10:33 AM »
Just remove the ban line :)

Rizzo

  • Newbie
  • *
  • Posts: 3
Re: !warn Script
« Reply #13 on: July 18, 2008, 12:00:50 PM »
Which bit is that? (sorry i wouldn't have posted ifi knew)

'if check => 3 then
   'try and get the host from the IAL
   host = GetIdentifier("$ial(" & Nickname & ").host")
   if host <> "" then
     SendCommand "/mode # +b *!" & host 
   else
     SendCommand "/mode # +b " & Nickname & "!*@*"
   end if
end if'

?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: !warn Script
« Reply #14 on: July 18, 2008, 07:54:23 PM »
if check => 3 then
  SendCommand "/kick # " & Nickname
end if
The IceChat God