Code:
Sub Init()
Script "PartyLine-Script 1.0a by gangasta"
Hook "Chan_Msg"
End Sub
Sub Chan_Msg(Chan, Nick, RegUser, Line)
Select Case LCase(Param(Line, 1))
Case "!adduser"
If MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") Then
If Param(Line, 2) = "*" Then
For i = 1 To ChanUserCount(ChanNum(Chan))
If ChanUser(ChanNum(Chan), i, CU_RegUser) = vbNullString Then
ExecuteCommand 0, ".adduser " & ChanUser(ChanNum(Chan), i, CU_Nick)
End If
Next
SendLine "NOTICE " & Nick & " :All users in " & Chan & " have been added!", 2
ElseIf IsOn(Param(Line, 2), Chan) Then
ExecuteCommand 0, ".adduser " & Param(Line, 2)
SendLine "NOTICE " & Nick & " :User has been added!", 2
Else
SendLine "NOTICE " & Nick & " :No such user in " & Chan, 2
End If
Else
SendLine "NOTICE " & Nick & " :You aren't a owner of this AnGelBot!", 2
End If
Case "!flags"
If IsOn(Param(Line, 2), Chan) Then
If MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") Then
ExecuteCommand 0, ".chattr " & GetRest(Line, 2)
SendLine "NOTICE " & Nick & " :Flags set!", 2
Else
SendLine "NOTICE " & Nick & " :You aren't a owner of this AnGelbot!", 2
End If
Else
SendLine "NOTICE " & Nick & " :No such user in " & Chan, 2
End If
Case "!remuser"
If IsOn(Param(Line, 2), Chan) Then
If MatchFlags(GetUserChanFlags(RegUser, Chan), "+n") Then
ExecuteCommand 0, ".remuser " & Param(Line, 2)
SendLine "NOTICE " & Nick & " :User has been removed with all data!", 2
Else
SendLine "NOTICE " & Nick & " :You aren't a owner of this AnGelbot!", 2
End If
Else
SendLine "NOTICE " & Nick & " :No such user in " & Chan, 2
End If
End Select
End Sub