AnGelBot-Portal²

Normale Version: OP/VOICE/KICK-Script
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Zitat:' Op/Voice/Kick Script by samiyah!
' [ #lamerpark @ de.quakenet.org - http://www.lamerpark.com ]

Dim cmd_prefix, max_matches, protect_me, protect_owner

Sub Init()
Script "OP/Voice/Kick Script by samiyah v0.5"
Hook "Chan_Msg"
cmd_prefix = ReadINIString("Others", "CMDPrefix", "!", "angel.ini")


' //- CONFIG/README -\\

' BEFEHLE:
' !kick [wildcard] [wildcard] ...
' !op [wildcard] [wildcard] ...
' !deop [wildcard] [wildcard] ...
' !v [wildcard] [wildcard] ...
' !dev [wildcard] [wildcard] ...

' ERKLÄRUNG:
' !op - ohne Parameter, wird DICH oppen, dasselbe gilt für alle anderen Befehle
' !op * - wird alle User Kicken, es sei denn max_matches lässt dies nicht zu
' !op b* a* -alph* -br* ist das selbe wie: !op +b* +a* -alph* -br*
' Kickt alle User die mit a oder b anfangen, ausser die die mit alph oder br anfangen, das + ist Optional!
' Bedingung ist das der User der das Kommando ausführt +o als ChannelFlag im Bot hat

' EINSTELLUNGEN:

' Hier können noch einige Sachen eingestellt werden:

' max_matches (0/1,2,3,...): Wieviel User dürfen Maximal betroffen sein,
' max_matches = 4 verhindert !kick * (da nur maximal 4 User betroffen sein dürfen)
' max_matches = 0 erlaubt !kick *
max_matches = 0

' protect_me (0/1): Schützt Bot vor Bot-DeOp und davor sich selbst zu kicken
protect_me = 1

' protect_owner (0/1): Schützt den SuperOwner vor DeOp oder Kick durch andere
protect_owner = 1

' Schutz trifft nur bei Op/DeOp/Kick in Kraft, bei Voice/DeVoice nicht!

' \\- CONFIG/README ENDE -//
End Sub


Sub Chan_Msg(Chan, Nick, RegUser, Line)

Select Case lcase(Param(Line,1))
Case cmd_prefix & "op"
if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+o") then Exit Sub
if (Param(Line,2) = "") then SendLine "MODE " & Chan & " +o " & Nick, 1: Exit Sub

Exeqt Chan, "MODE %chan% +o %nick%", GetRest(Line,2), Nick, 1

case cmd_prefix & "deop"
if (Param(Line,2) = "") then SendLine "MODE " & Chan & " -o " & Nick, 3: Exit Sub
if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+o") then Exit Sub

Exeqt Chan, "MODE %chan% -o %nick%", GetRest(Line,2), Nick, 1

case cmd_prefix & "kick"
if (Param(Line,2) = "") then SendLine "KICK " & Chan & " " & Nick, 3: Exit Sub
if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+o") then Exit Sub

Exeqt Chan, "KICK %chan% %nick% Bye!", GetRest(Line,2), Nick, 1

case cmd_prefix & "v"
if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+o") then Exit Sub
if (Param(Line,2) = "") then SendLine "MODE " & Chan & " +v " & Nick, 1: Exit Sub

Exeqt Chan, "MODE %chan% +v %nick%", GetRest(Line,2), Nick, 0

case cmd_prefix & "dev"
if (Param(Line,2) = "") then SendLine "MODE " & Chan & " -v " & Nick, 3: Exit Sub
if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+o") then Exit Sub

Exeqt Chan, "MODE %chan% -v %nick%", GetRest(Line,2), Nick, 0
End Select

End Sub

Sub Exeqt(Chan, CmdStr, Line, Nick, protected)
Dim matchnicks

matchnicks = GetMatches(Chan,Line,protected)

if (protected) and (max_matches > 0) and (ubound(matchnicks) + 1 > max_matches) then SendLine "NOTICE " & Nick & " :Zuviele Matches!",3:Exit Sub

for u = 0 to ubound(matchnicks)
SendLine replace(replace(CmdStr,"%nick%",matchnicks(u)),"%chan%",Chan), 2
next

End Sub

Function GetMatches(Chan,Line,Protect)
dim nicks, match_tmp, match_nicks
dim schutz, betroffen

nicks = Split(Line,chr(32))
CNum = ChanNum(Chan)

For i = 1 To ChanUserCount(CNum)
schutz = 0
betroffen = 0

for j = 0 to ubound(nicks)
select case left(nicks(j),1)
case "-"
if wildmatch(mid(nicks(j),2),ChanUser(CNum, i, CU_Nick)) then schutz = 1
case "+"
if wildmatch(mid(nicks(j),2),ChanUser(CNum, i, CU_Nick)) then betroffen = 1
case else
if wildmatch(nicks(j),ChanUser(CNum, i, CU_Nick)) then betroffen = 1
end select
next

if (Protect) and (ChanUser(CNum,i,CU_Nick) = MyNick) And (protect_me) then schutz = 1
if (Protect) and (ChanUser(CNum,i,CU_RegUser) <> "") And (MatchFlags(GetUserChanFlags(ChanUser(CNum,i,CU_RegUser), Chan),"+s")) And (protect_owner) then schutz = 1

if not schutz and betroffen then match_tmp = match_tmp & " " & ChanUser(CNum,i,CU_Nick)
Next

match_nicks = split(Trim(match_tmp),chr(32))

GetMatches = match_nicks
End Function

kann mir da jmd plz folgendes einfügen:

!ban --- user bannen
!kickban --- user kickbannen
!unban --- user entbannen

es wird wahrscheinlich wieder der beitrag kommen: 'es gibt auch eine suchfunktion Smile' aber ich hätt die sachen gern für DIESES script.

thx im voraus.

mfg Loman
!ban habe ich
!unban dann macht der unbanall
!kickban ist !ban
!ban = Partyline .+ban *!*@bla
!kickban = !kb = Voice Control
!unban = Partyline .-ban

oder mein unbanall-script

Code:
Sub Init()
  Script "Unbanall by Necrox"
  Hook "Chan_Msg"
End Sub

Sub Chan_Msg(Chan, Nick, RegUser, Line)

If LCase(Param(line,1)) = "!unbanall" Then
  If Not Isop(Nick, Chan) Then
    SendLine "PRIVMSG " & CHAN & " :You are not authorized to use this command", 2
  Else
    SendLine "MODE " & Chan & " +b-b * *", 1
    Sendline "PRIVMSG " & chan & " :Done", 2
  End If
  End If
End Sub

PS: Man kann auch die normalen IRC-Funktionen benutzten. :D

/mode #channel +b *!*@bla
/mode #channel -b *!*@bla

Nec
Code:
Sub Init()
   Script "OP/Voice/Kick Script"
   Hook "Chan_Msg"
   cmd_prefix = ReadINIString("Others", "CMDPrefix", "!", "angel.ini")
   max_matches = 0
   protect_me = 1
   protect_owner = 1
End Sub

Dim cmd_prefix, max_matches, protect_me, protect_owner

Sub Chan_Msg(Chan, Nick, RegUser, Line)
If LCase(Param(line,1)) = "!unban" Then
  If Not Isop(Nick, Chan) Then Exit Sub
    SendLine "PRIVMSG L :UNBANALL " & Chan, 1
    SendLine "PRIVMSG Q :UNBANALL " & Chan, 1
  End If
Select Case lcase(Param(Line,1))
     Case cmd_prefix & "op"
               if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") then Exit Sub
               if (Param(Line,2) = "") then SendLine "MODE " & Chan & " +o " & Nick, 1: Exit Sub
               Exeqt Chan, "MODE %chan% +o %nick%", GetRest(Line,2), Nick, 1
     case cmd_prefix & "deop"
               if (Param(Line,2) = "") then SendLine "MODE " & Chan & " -o " & Nick, 3: Exit Sub
               if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") then Exit Sub
               Exeqt Chan, "MODE %chan% -o %nick%", GetRest(Line,2), Nick, 1
     case cmd_prefix & "kick"
               if (Param(Line,2) = "") then SendLine "KICK " & Chan & " " & Nick, 3: Exit Sub
               if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") then Exit Sub
               Exeqt Chan, "KICK %chan% %nick% Bye!", GetRest(Line,2), Nick, 1
     case cmd_prefix & "voice"
               if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") then Exit Sub
               if (Param(Line,2) = "") then SendLine "MODE " & Chan & " +v " & Nick, 1: Exit Sub
               Exeqt Chan, "MODE %chan% +v %nick%", GetRest(Line,2), Nick, 0
     case cmd_prefix & "devoice"
               if (Param(Line,2) = "") then SendLine "MODE " & Chan & " -v " & Nick, 3: Exit Sub
               if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") then Exit Sub
               Exeqt Chan, "MODE %chan% -v %nick%", GetRest(Line,2), Nick, 0
     case cmd_prefix & "ban"
               if (Param(Line,2) = "") then SendLine "MODE " & Chan & " +b " & mask(hostmask(chan,Nick,2)), 3: Exit Sub
               if not MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") then Exit Sub
               Exeqt Chan, "MODE %chan% +b %mask%", GetRest(Line,2), Nick, 0

End Select
End Sub

Sub Exeqt(Chan, CmdStr, Line, Nick, protected)
Dim matchnicks
matchnicks = GetMatches(Chan,Line,protected)
if (protected) and (max_matches > 0) and (ubound(matchnicks) + 1 > max_matches) then SendLine "NOTICE " & Nick & " :Zuviele Matches!",3:Exit Sub
for u = 0 to ubound(matchnicks)
SendLine replace(replace(replace(CmdStr,"%nick%",matchnicks(u)),"%chan%",Chan), "%mask%", mask(hostmask(chan,matchnicks(u)),2)) , 2
next
End Sub

Function GetMatches(Chan,Line,Protect)
    dim nicks, match_tmp, match_nicks
    dim schutz, betroffen
    nicks = Split(Line,chr(32))
    CNum = ChanNum(Chan)
    For i = 1 To ChanUserCount(CNum)
        schutz = 0
        betroffen = 0
        for j = 0 to ubound(nicks)
            select case left(nicks(j),1)
                case "-"
                    if wildmatch(mid(nicks(j),2),ChanUser(CNum, i, CU_Nick)) then schutz = 1
                case "+"
                    if wildmatch(mid(nicks(j),2),ChanUser(CNum, i, CU_Nick)) then betroffen = 1
                case else
                    if wildmatch(nicks(j),ChanUser(CNum, i, CU_Nick)) then betroffen = 1
            end select
        next
        if (Protect) and (ChanUser(CNum,i,CU_Nick) = MyNick) And (protect_me) then schutz = 1
        if (Protect) and (ChanUser(CNum,i,CU_RegUser) <> "") And (MatchFlags(GetUserChanFlags(ChanUser(CNum,i,CU_RegUser), Chan),"+s")) And (protect_owner) then schutz = 1
        if not schutz and betroffen then match_tmp = match_tmp & " " & ChanUser(CNum,i,CU_Nick)
    Next
    match_nicks = split(Trim(match_tmp),chr(32))
    GetMatches = match_nicks
End Function

Extra Funktionen:
!ban nick
!unban (macht er unbanall bei L/Q)

naja mehr weiß ich net sry
Referenz-URLs