Author Topic: Current Code  (Read 3708 times)

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
Current Code
« on: September 18, 2008, 03:14:23 PM »
Changelog: (I will update this as you post new code, insure to include what you do though)
[div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']
'//  0.25
'//  ~Vector
'//   - Replaced Smart Kick timer with GetGTC
'//     this should solve several issues related to kicking a user for re-joining
'//     too fast. Default time is 3 seconds
'//  0.24
'//  ~Vector
'//   - AM will not attempt to close the channel if its already closed
'//  0.23
'//  ~Vector
'//   - Added back in EXECUTOR after realizing its purpose (D'oh..)
'//  0.22
'//  ~Vector
'//   - Finished adding in Smart Banning
'//   - Added Smart Kick, enabled by default
'//   - Added .ini settings for Smart Ban/Kick and Limit
'//   - Ping ban is by default off
'//   - Added beta check
'//   - // instead of / from in-bot shows the command response in chat
'//   - added "toggleskick" command for smart kicking
'//  0.211
'//  ~Shadow
'//   - Fixed to work with Stealthbot 2.6 R3
'// 0.21
'// ~Shadow
'//  - Added Safelist checking
'// 0.20
'// ~Vector
'//  - Added debugging class. (I only added most messages in Event_Load() to it)
'//   (If you want to add other messages within the plugin, please do so)
'//   (Ex. Debug.Write Color, text)
'//  - Removed AMV constant. Used psVersions.Item("am") instead
'// 0.19
'// ~Vector
'//  - Fixed first eight lines to provide the plugin manager format
'//  - Added Smart Banning (Zone, you lazy ass)
'// 0.18
'// ~Hero
'//  - Cleaned up for noob (vector*)
'//  - Fixed a problem where the bot says WAY too many messages when it has no ops.
'// 0.17
'// ~Vector
'//  - Added "admin" and "noadmin" commands (999 access)
'//  - Fixed major problem with limitation command
'//  - Added various checks and bounds to limit command
'//  - added nolimit command (default of 100 access)
'// 0.16
'// ~Vector
'//  - Added Access Limitation feature
'//  - Minor fixes
'// 0.15
'// ~Hero
'//  = Fixed NumSpam w/ Shadow
'// 0.14
'// ~Hero
'//  - Re-added NumSpam
'//  - Created settings for NumSpam
'//  -
'// 0.13
'// ~Ace
'//  - Added NumSpam
'// 0.12
'// ~Hero
'//  - Added Vector to created by
'//  - Converted to .INI
'//  - Fixed Shadow's massload detect (Sorry I changed it a lot - sorta redid 1/2 of it)
'//  - Added settings to Shadow's massload detect
'//  - Added .AMreload command to reload settings
'// 0.09
'// ~Shadow
'// - Massload detect
'// 0.08
'// ~Hero
'//  - Decided not to use .ini
'//  - Tidied up load sub
'//  - Tidied up settings area
'// 0.07
'// ~Vector
'//  - Added ping banning, settings included
'// 0.06
'// ~Hero
'//  - AMWordSpamPunishment setting
'//  - Added bot checking for ops before kicking
'// 0.05
'// ~Hero
'//  - AMWordSpam - Completed
'// 0.01
'// ~Hero
'//  - Setup Process Input
'//  - Started Load sub
'//  - Basic layout
'//  - Few settings
'//  - Prefixed AddChats
'//  - Text sending functions
[/div]

Code: [Select]
'AM
'0.25
'&Advanced Moderation:Shadow, Tech, Vector, 7thAce, and Hero:Expands stealthbot's moderation ability
'*
'*
'*
'*
'*StealthBot Enhancement

'# # # # # # # # # # # # # #
'// SETTING DESCRIPTIONS //
'# # # # # # # # # # # # # #


'// # # / GLOBAL DEBUGGER / # # //

'// Define the debugger variable
Dim Debug

'// Is global debugging enabled?
Private AMDebugGlobal
AMDebugGlobal = False


'// # # / WORD Spam / # # //
'// [Word Spam]

'// Use the word anti-Spam
'// "Enabled"
Private AMWordSpamEnabled

'// Amount of times a word can be said in x seconds
'// "Count"
Private AMWordSpamCount

'// Amount of time it takes to refresh SpamCount
'// "Refresh Rate"
Private AMWordSpamRefresh

'// Punishment when they Spam
'// "Punishment"
'// Use kick or ban
Private AMWordSpamPunishment


'// # # / Access Limit / # # //

'// Prevents use of the limit command if bot is a beta bot
Private AMLockLimit
AMLockLimit = False

'// Is Access Limitation enabled?
Private AMAccessLimitBool
AMAccessLimitBool = True

Private AMAddSetCommand, AMLimitUsersAcc

'// Default AM Setting for "add" and "set" commands
AMAddSetCommand = 60

'// access for limit command
AMLimitUsersAcc = 150

'// Access to give a user the A flag
Private AMAdminFlagAcc
AMAdminFlagAcc = 200

'// # # / NUM SPAM / ## //

'// [NumSpam]

'// Use NumSpam
'// "Enabled"
Private AMNumSpamEnabled

'// Limit, the higher you make this the longer it takes to detect a flood
'// "Limit"
Private AMNumSpamLimit

'// Punishment for Starcraft Brood War
'// "BroodWar"
Private AMNumSpamSEXP

'// Punishment for Starcraft
'// "Starcraft"
Private AMNumSpamSTAR

'// Punishment for using a LagPlug
'// "Lag Plug"
Private AMNumSpamLagPlug

'// Time between refreshing
'// "Refresh"
Private AMNumSpamRefrsh

'// # # / SMART KICKING / # # //

Private AMSmartKickEnabled
AMSmartKickEnabled = False

Private AMSmartKickTime

'// 1000 = 1 second
AMSmartKickTime = 3000
Set dicSmartKick = CreateObject("Scripting.Dictionary")

'// # # / SMART BANNING / # # //

Private AMSmartBanEnabled
AMSmartBanEnabled = True

Set dicSmartBans = CreateObject("Scripting.Dictionary")

'// # # / PING BANNING / # # //
'// [Ping Ban]

'// Use ping bans
'// "Enabled"
Private AMPingBanEnabled

'// Punishment when they have too high of a ping
'// "Punishment"
'// Use kick or ban
Private AMPingBanPunishment

'// If a users ping is equal to or above this they will be kicked/banned
'// "Ping to ban"
Private AMPingToBan

'// # # / JOIN Spam / # # //
'// [Join Spam]

'// Use the join anti-Spam
'// "Enabled"
Private AMJoinSpamEnabled

'// Amount of times people can join in x seconds
'// "Count"
Private AMJoinSpamCount

'// Amount of time it takes to refresh SpamCount
'// "Refresh Rate"
Private AMJoinSpamRefresh

'// Punishment when they Spam
'// "Punishment"
'// Use kick or ban
Private AMJoinSpamPunishment

'// How long to wait before unlocking the channel
'// In Seconds **
'// 300 = 5 min
'// 900 = 15 min
'// 1800 = 1/2 hour
'// 3600 = 1 hour
Private AMJoinSpamUnlock

'# # # # # # # # # # # # # #
'// // // CHANGELOG // // //
'# # # # # # # # # # # # # #
'//  0.25
'//  ~Vector
'//   - Replaced Smart Kick timer with GetGTC
'//     this should solve several issues related to kicking a user for re-joining
'//     too fast. Default time is 3 seconds
'//  0.241
'//  ~Vector
'//   - Fixed various issues
'//  0.24
'//  ~Vector
'//   - AM will not attempt to close the channel if its already closed
'//  0.23
'//  ~Vector
'//   - Added back in EXECUTOR after realizing its purpose (D'oh..)
'//  0.22
'//  ~Vector
'//   - Finished adding in Smart Banning
'//   - Added Smart Kick, enabled by default
'//   - Added .ini settings for Smart Ban/Kick and Limit
'//   - Ping ban is by default off
'//   - Added beta check
'//   - // instead of / from in-bot shows the command response in chat
'//   - added "toggleskick" command for smart kicking
'//  0.211
'//  ~Shadow
'//   - Fixed to work with Stealthbot 2.6 R3
'// 0.21
'// ~Shadow
'//  - Added Safelist checking
'// 0.20
'// ~Vector
'//  - Added debugging class. (I only added most messages in Event_Load() to it)
'//    (If you want to add other messages within the plugin, please do so)
'//    (Ex. Debug.Write Color, text)
'//  - Removed AMV constant. Used psVersions.Item("am") instead
'// 0.19
'// ~Vector
'//  - Fixed first eight lines to provide the plugin manager format
'//  - Added Smart Banning (Zone, you lazy ass)
'// 0.18
'// ~Hero
'//  - Cleaned up for noob (vector*)
'//  - Fixed a problem where the bot says WAY too many messages when it has no ops.
'// 0.17
'// ~Vector
'//  - Added "admin" and "noadmin" commands (999 access)
'//  - Fixed major problem with limitation command
'//  - Added various checks and bounds to limit command
'//  - added nolimit command (default of 100 access)
'// 0.16
'// ~Vector
'//  - Added Access Limitation feature
'//  - Minor fixes
'// 0.15
'// ~Hero
'//  = Fixed NumSpam w/ Shadow
'// 0.14
'// ~Hero
'//  - Re-added NumSpam
'//  - Created settings for NumSpam
'//  -
'// 0.13
'// ~Ace
'//  - Added NumSpam
'// 0.12
'// ~Hero
'//  - Added Vector to created by
'//  - Converted to .INI
'//  - Fixed Shadow's massload detect (Sorry I changed it a lot - sorta redid 1/2 of it)
'//  - Added settings to Shadow's massload detect
'//  - Added .AMreload command to reload settings
'// 0.09
'// ~Shadow
'// - Massload detect
'// 0.08
'// ~Hero
'//  - Decided not to use .ini
'//  - Tidied up load sub
'//  - Tidied up settings area
'// 0.07
'// ~Vector
'//  - Added ping banning, settings included
'// 0.06
'// ~Hero
'//  - AMWordSpamPunishment setting
'//  - Added bot checking for ops before kicking
'// 0.05
'// ~Hero
'//  - AMWordSpam - Completed
'// 0.01
'// ~Hero
'//  - Setup Process Input
'//  - Started Load sub
'//  - Basic layout
'//  - Few settings
'//  - Prefixed AddChats
'//  - Text sending functions

'# # # # # # # # # # # # # #
'// // / DECLARATIONS / // //
'# # # # # # # # # # # # # #


Private AMMessages '// As Scripting.Dictionary
Private AMMessagesUsers '// As Scripting.Dictionary
Private AMJoins '// As Int
Private AMSettingsPath '// As String
Private AMLimitsPath   '// As String
Private AMFSO '// As Scripting.FileSystemObject
Private AMNumSpam_Status '// As Int
Private AMIsLocked       '// As Boolean
AMIsLocked = False

'// Base values
AMJoins = 0
Set AMMessages = CreateObject("Scripting.Dictionary")
Set AMMessagesUsers = CreateObject("Scripting.Dictionary")
AMSettingsPath = BotPath & "ModerationSettings.ini"
AMLimitsPath = BotPath & "UserLimits.ini"
Set AMFSO = CreateObject("Scripting.FileSystemObject")

'################################
'// Please do not edit below here
'################################

'// Prefix for addchats
AMP = Chr(255) & "cb" & "[AM] " & Chr(255) & "cb"

Sub AM_Event_Load
  Set Debug = New debugging

  Debug.Write vbYellow, "Loading..."
  Debug.Write vbYellow, "Checking for settings file..."
  If AMFSO.FileExists(AMSettingsPath) Then
    Debug.Write vbGreen, "Found!"
  Else
    Debug.Write vbRed, "File missing!"
    Debug.Write vbYellow, "Creating..."
    AMFSO.CreateTextFile(AMSettingsPath)
    Debug.Write vbGreen, "Created!"
  End If
  
  Debug.Write vbYellow, "Loading settings..."
  Call AM_LoadSettings
  Debug.Write vbGreen, "Loaded settings!"
  
  Debug.Write vbYellow, "Initializing timers..."
  TimerInterval "AM", "MessageSpam_refresh", CInt(AMWordSpamRefresh)
  TimerEnabled "AM", "MessageSpam_refresh", True
  TimerInterval "AM", "JoinSpam_refresh", CInt(AMJoinSpamRefresh)
  TimerEnabled "AM", "JoinSpam_refresh", True
  TimerInterval "AM", "Unlock_Channel", CInt(AMJoinSpamUnlock)
  TimerEnabled "AM", "Unlock_Channel", False
  TimerInterval "AM", "Lock_Channel", 1
  TimerEnabled "AM", "Lock_Channel", False
  TimerInterval "AM", "NumSpam_refresh", CInt(AMNumSpamRefresh)
  TimerEnabled "AM", "NumSpam_refresh", True
  
  Debug.Write vbGreen, "Intialized timers!"

  AddC vbYellow, "Retrieving ping ban status..."
  If AMPingBanEnabled Then
    AddC vbGreen, "Pingban is currently on and " & AMPingBanPunishment & "ing users with a ping of " & AMPingToBan & " or higher"
  Else
    AddC vbGreen, "Pingban is currently off"
  End If

  AddC vbYellow, "Retriving NumSpam limit..."
  AddC vbGreen, "NumSpam has a current limit of: " & AMNumSpamLimit

  If InStr(Lcase(GetBotVersion), "beta") Then
    AddChat vbRed, "?cb[AM]?cb StealthBot beta detected."
    AddChat vbRed, "?cb[AM]?cb access limitation feature blocked."
    AMLockLimit = True
  Else
    Debug.Write vbYellow, "Access limitation status: " & AMAccessLimitBool
    If AMAccessLimitBool Then
      Debug.Write vbYellow, "Checking limitations of ""add"" and ""set"" commands..."
      If GetConfigEntry("numeric", "add", "access.ini") = "" Or _
         GetConfigEntry("numeric", "set", "access.ini") = "" Then
         Debug.Write vbYellow, "Changing access of ""add"" and ""set"" to 1000..."
         WriteConfigEntry "numeric", "add", 1000, "access.ini"
         WriteConfigEntry "numeric", "set", 1000, "access.ini"
         Debug.Write vbGreen, "Done correcting limitations."
      End If
    Else
       If GetConfigEntry("numeric", "add", "access.ini") <> 70 Or _
          GetConfigEntry("numeric", "set", "access.ini") <> 70 Then
         WriteConfigEntry "numeric", "add", 70, "access.ini"
         WriteConfigEntry "numeric", "set", 70, "access.ini"
         Debug.Write vbYellow, "Set both ""add"" and ""set"" commands to default values."
       End If
    End If
    Debug.Write vbGreen, "Done checking AM Limitation function."
  End If

  '// The end
  AddC vbGreen, "You are using version " & psVersions.Item("am")
  AddC vbOrange, "Created by: " & Chr(255) & "ciShadow, Tech, Vector, and Hero" & Chr(255) & "ci"
End Sub

'// Execute when a user (Other then the bot) sends chat to battle.net
Sub AM_Event_Usertalk(Username, Flags, Text, Ping)
  '// Check for commands
  Call AM_ProcessInput(Username, Flags, Text, 1)
  '// Anti-Word Spam
  '// Add one to the Amount of times a message was said
  AMMessages.Item(Text) = AMMessages.Item(Text) + 1
  '// Add to the people
  '// Make sure they aren't in it already
  If Not InStr(AMMessagesUsers.Item(Text), Username) > 0 Then
    AMMessagesUsers.Item(Text) = AMMessagesUsers.Item(Text) & Username & ":"
  End If
  If AMMessages.Item(Text) >= AMWordSpamCount Then
    AddC vbYellow, "Spam Detected!"
    AddC vbYellow, "Text: " & Text
    '// Get people who used it
    People = AMMessagesUsers.Item(Text)
    '// Remove extra :
    People = Left(People, Len(People) - 1)
    sPeople = Split(People, ":")
    AddC vbYellow, "Removing Spammers..."
    For i = LBound(sPeople) To UBound(sPeople)
      If BotFlags = 2 Then
        If  GetInternalDataByUsername(sPeople(i), 1) = 2 Then
          AddC vbRed, "Spammer has ops (" & sPeople(i) & ")"
        Else
          If IsSafelisted(Username) Then Exit Sub

          If AMSmartBanEnabled And Not dicSmartBans.Exists(Username) Then
            AddQ "/" & AMWordSpamPunishment & " " & sPeople(i) & " Spamming: " & Text
          End If
        End If
      Else
        AddC vbRed, "Bot does not have ops"
               Exit For
      End If
    Next
    AddC vbGreen, "Removed!"
    AMMessagesUsers.Remove(Text)
    AMMessages.Remove(Text)
  End If
End Sub

'// Execute when a whisper is recieved
Sub AM_Event_WhisperRecieved(Username, Flags, Text)
  Call AM_ProcessInput(Username, Flags, Text, 3)
End Sub

'// Fires when Battle.Net sends you a blue INFO message
Sub AM_Event_ServerInfo(Text)
  If Match(Text, "* was banned by *", True) Then
    '// Add username to the smart bans dictionary
    addSmart = Split(text)(0)
    dicSmartBans.Item(addSmart) = 1
  ElseIf Match(Text, "* was unbanned by *", True) Then
    '// Remove username from the smart bans dictionary
    remSmart = Split(text)(0)
    dicSmartBans.Remove(remSmart)
  ElseIf Match(Text, "* was kicked out of the channel by *", True) Then
    If Not AMSmartKickEnabled Then Exit Sub
    '// Add user to the smart kick dictionary
    addSmart = Split(text)(0)
    dicSmartKick.Item(addSmart) = GetGTC
  End If
End Sub

'// Executes when the bot joins channels
Sub AM_Event_ChannelJoin(ChannelName, Flags)
  '// purge smart ban list
  dicSmartBans.RemoveAll
End Sub

'// Executes when a user joins the channel
Sub AM_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  If IsSafelisted(Username) Then Exit Sub

  If AMSmartKickEnabled And dicSmartKick.Exists(Username) Then
    thisGTC = GetGTC
    firstGTC = dicSmartKick.Item(Username)

    If Int(thisGTC - firstGTC) < Int(AMSmartKickTime) Then
      AddQ "/ban " & Username & " Smart kick activated"
    End If

        dicSmartKick.Remove(Username)
    AddChat vbGreen, dicSmartKick.Exists(Username)
  End If

  If AMPingBanEnabled Then
    If Ping >= CInt(AMPingToBan) then
      If BotFlags = 2 Then
        Select Case Lcase(AMPingBanPunishment)
          Case "kick", "ban"
            If GetInternalDataByUsername(Username, 1) = 2 Then
              AddC vbRed, "User with high ping has ops (" & Username & ")"
            Else
              If AMSmartBanEnabled And Not dicSmartBans.Exists(Username) Then
                AddQ "/" & AMPingBanPunishment & " " & Username & " High Ping: " & Ping
              End If
            End If
          Case Else
            AddC vbRed, "Invalid ping ban punishment. You must use either ""kick"" or ""ban""."
        End Select
      Else
        AddC vbRed, "Bot does not have ops"
      End If
    End If
  End If
  
  If AMJoinSpamEnabled Then
    AMJoins = AMJoins + 1
      If AMJoins >= AMJoinSpamCount Then
        If AMSmartBanEnabled And Not dicSmartBans.Exists(Username) Then
         AddQ "/" & AMJoinSpamPunishment & " " & Username & " Anti-Join Spam"
        TimerEnabled "AM", "Lock_Channel", True
        End If
     End If
  End If
  
  If AMNumSpamEnabled Then
  
    Num = Split(Username, "#")
    If UBound(Num) > 0 Then
      AMNumSpam_Status = AMNumSpam_Status - CInt(Num(1))
    End If

      If Product = "SEXP" Then
      AMNumSpam_Status = AMNumSpam_Status - AMNumSpamSEXP
      End If

    If Product = "STAR" Then
      AMNumSpam_Status = AMNumSpam_Status - AM__NumSpam_STAR
    End If

    If InStr(flags, "16") Then
      AMNumSpam_Status = AMNumSpam_Status - AMNumSpamLagPlug
    End If

    If AMNumSpam_Status <= 0 Then
      If AMSmartBanEnabled And Not dicSmartBans.Exists(Username) Then
        Call AM_NumSpam_Action(UsernAMe, pban)
      End If
    End If
  End If
End Sub

'// Executes when enter is pressed (Text sent)
Sub AM_Event_PressedEnter(Text)
  Call AM_ProcessInput(BotVars.Username, BotFlags, Text, 4)
End Sub

'// Process input for commands
'// - Note: I use "User" instead of "Username"
'// - Note: I use uNum instead of myAccess
'// - Note: I use uFlags instead of myFlags
Sub AM_ProcessInput(User, Flags, Text, Source)
  If Len(Text) <= Len(BotVars.Trigger) Then Exit Sub

  '// Check for a trigger or /
  If Source = 4 Then
    If Left(Text, 1) <> "/" Then Exit Sub
  End If
  GetDBEntry User, uNum, uFlags
  '// Retrieve Arguments

  '// EXECUTOR
  If uNum >= 200 OR User = BotVars.Username Then
    If Left(Text, 4) = "ame " OR Left(Text, 5) = "/ame " Then
      Execute Mid(Text, InStr(Text, "ame") + 4)
      Exit Sub
    End If
  End If

  If Source = 4 Then
    uNum = 1000
    If Left(text, 2) = "//" Then
      Text = Replace(Text, "//", "/")
      Source = 1
    End If
    Arg = Split(Mid(Trim(Text), 2))
  Else
    Arg = Split(Mid(Trim(Text), Len(BotVars.Trigger) + 1))
  End If

  Select Case LCase(Arg(0))
    Case "add", "set"
      If AMLockLimit Then Exit Sub
      If uNum = 1000 Then VetoThisMessage
      If Not AMAccessLimitBool Then Exit Sub

      If cInt(uNum) < cInt(AMAddSetCommand) Then Exit Sub
    
      '// prevent two "add" or "set" events from occuring
      If InStr(Lcase(uFlags), "a") Then Exit Sub

      If Not IsNumeric(Arg(2)) Then Exit Sub

      getLim = GetConfigEntry("limit", User, AMSettingsPath)

      If getLim <> "" Then
        If Arg(2) > getLim Then
          Send Source, "You are limited to giving out " & getLim & " access only.", User : Exit Sub
        End If

        If cInt(Arg(2)) > uNum Then Exit Sub
        Command BotVars.Username, "/" & Arg(0) & " " & Arg(1) & " " & Arg(2), True
        Send Source, "Set " & Arg(1) & "'s access to " & Arg(2) & ".", User
      Else
        If cInt(Arg(2)) > uNum Then Exit Sub
        Command BotVars.Username, "/" & Arg(0) & " " & Arg(1) & " " & Arg(2), True
        Send Source, "Set " & Arg(1) & "'s access to " & Arg(2) & ".", User
      End If
    Case "limit"
      If AMLockLimit Then Exit Sub
      If uNum = 1000 Then VetoThisMessage
      If cInt(uNum) < cInt(AMLimitUsersAcc) Then Exit Sub

      GetDBEntry Arg(1), a, f
      getLim = GetConfigEntry("limit", Arg(1), AMSettingsPath)

      '// Query limits
      If Ubound(Arg) = 1 Then
        If getLim = "" And a <> -1 Then
          Send Source, Arg(1) & " has no limitation.", User
        ElseIf getLim <> "" And a <> - 1 Then
          Send Source, Arg(1) & " has an access limit of " & getLim & ".", User
        Else
          Send Source, "User not found.", User
        End If
        Exit Sub
      End If

      If Not IsNumeric(Arg(2)) Then
        Send Source, "The limitation argument must be a numeric value.", User
        Exit Sub
      End If

      '// User exists?
      If a = -1 Then
        Send Source, "That user doesn't exist. Cannot limit.", User
        Exit Sub
      End If

      '// Trying to limit a user who has higher access than you?
      If cInt(uNum) < cInt(a) Then
        Send Source, Arg(1) & " (" & a & " access) has higher access than you (" & uNum & " access). Unable to limit.", User
        Exit Sub
      End If

      '// Limiting user to their access level?
      If cInt(Arg(2)) = cInt(a) Then
        Send Source, "Limit is ambiguous to user's access.", User
        Exit Sub
      End If

      '// Limiting someone to higher access than they currently have?
      If cInt(Arg(2)) > cInt(a) Then
        Send Source, "Unable to limit " & Arg(1) & "'s access. Limit (" & Arg(2) & ") too high for his access (" & a & ").", User
        Exit Sub
      End If

      WriteConfigEntry "limit", Arg(1), Arg(2), AMSettingsPath

      Send Source, "Limited " & Arg(1) & " to giving out " & Arg(2) & " access.", User
    Case "nolimit"
      If AMLockLimit Then Exit Sub
      If cInt(uNum) < cInt(AMLimitUsersAcc) Then Exit Sub

      If GetConfigEntry("limit", Arg(1), AMSettingsPath) = "" Then
        Send Source, Arg(1) & " has no limitations.", User
        Exit Sub
      End If

      WriteConfigEntry "limit", Arg(1), "", AMSettingsPath
      Send Source, "Removed " & Arg(1) & "'s add restrictions.", User
    Case "admin"
      If AMLockLimit Then Exit Sub
      If uNum = 1000 Then VetoThisMessage
      If cInt(uNum) < cInt(AMLimitUsersAcc) Then Exit Sub

      If Not InStr(Lcase(f), "a") Then Exit Sub
      Command BotVars.Username, "/add " & Arg(1) & " +A", True
      Send Source, "Set admin flag for " & Arg(1) & ".", User
    Case "noadmin"
      If AMLockLimit Then Exit Sub
      If uNum = 1000 Then VetoThisMessage
      If cInt(uNum) < cInt(AMLimitUsersAcc) Then Exit Sub

      If InStr(Lcase(f), "a") Then Exit Sub
      Command BotVars.Username, "/add " & Arg(1) & " -A", True
      Send Source, "Removed admin flag for " & Arg(1) & ".", User
    Case "toggleskick"
      If cInt(uNum) < 100 Then Exit Sub
      If uNum = 1000 Then VetoThisMessage
      If AMSmartKickEnabled Then
        Call WriteConfigEntry("AM", "SmartKickEnabled", False, AMSettingsPath)
        AMSmartKickEnabled = False
        Send Source,"SmartKick Disabled.", User
      Else
        Call WriteConfigEntry("AM", "SmartKickEnabled", True, AMSettingsPath)
        AMSmartKickEnabled = True
        Send Source,"SmartKick Enabled.", User
      End If
    Case "AMreload"
      If cInt(uNum) < 100 Then Exit Sub
      Call AM_LoadSettings
      Send Source, "Reloaded Advanced Moderation Settings.", User
  End Select
End Sub

Sub AM_LoadSettings
  If GetConfigEntry("Word Spam", "Enabled", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Word Spam", "Enabled", "True", AMSettingsPath)
      AMWordSpamEnabled = CBool(GetConfigEntry("Word Spam", "Enabled", AMSettingsPath))
  Else
      AMWordSpamEnabled = CBool(GetConfigEntry("Word Spam", "Enabled", AMSettingsPath))
  End If
  If GetConfigEntry("Word Spam", "Count", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Word Spam", "Count", "4", AMSettingsPath)
      AMWordSpamCount = CInt(GetConfigEntry("Word Spam", "Count", AMSettingsPath))
  Else
      AMWordSpamCount = CInt(GetConfigEntry("Word Spam", "Count", AMSettingsPath))
  End If
  If GetConfigEntry("Word Spam", "Refresh Rate", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Word Spam", "Refresh Rate", "10", AMSettingsPath)
      AMWordSpamRefresh= CInt(GetConfigEntry("Word Spam", "Refresh Rate", AMSettingsPath))
  Else
      AMWordSpamRefresh = CInt(GetConfigEntry("Word Spam", "Refresh Rate", AMSettingsPath))
  End If
  If GetConfigEntry("Word Spam", "Punishment", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Word Spam", "Punishment", "kick", AMSettingsPath)
      AMWordSpamPunishment = CStr(GetConfigEntry("Word Spam", "Punishment", AMSettingsPath))
  Else
      AMWordSpamPunishment= CStr(GetConfigEntry("Word Spam", "Punishment", AMSettingsPath))
  End If
  
  If GetConfigEntry("Ping Ban", "Enabled", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Ping Ban", "Enabled", "False", AMSettingsPath)
      AMPingBanEnabled = CBool(GetConfigEntry("Ping Ban", "Enabled", AMSettingsPath))
  Else
      AMPingBanEnabled = CBool(GetConfigEntry("Ping Ban", "Enabled", AMSettingsPath))
  End If
  If GetConfigEntry("Ping Ban", "PingToBan", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Ping Ban", "PingToBan", "500", AMSettingsPath)
      AMPingToBan = CInt(GetConfigEntry("Ping Ban", "PingToBan", AMSettingsPath))
  Else
      AMPingToBan = CInt(GetConfigEntry("Ping Ban", "PingToBan", AMSettingsPath))
  End If
  If GetConfigEntry("Ping Ban", "Punishment", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Ping Ban", "Punishment", "kick", AMSettingsPath)
      AMPingBanPunishment = CStr(GetConfigEntry("Ping Ban", "Punishment", AMSettingsPath))
  Else
      AMPingBanPunishment= CStr(GetConfigEntry("Ping Ban", "Punishment", AMSettingsPath))
  End If
  
  If GetConfigEntry("Join Spam", "Enabled", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Join Spam", "Enabled", "True", AMSettingsPath)
       AMJoinSpamEnabled = CBool(GetConfigEntry("Join Spam", "Enabled", AMSettingsPath))
  Else
      AMJoinSpamEnabled = CBool(GetConfigEntry("Join Spam", "Enabled", AMSettingsPath))
  End If
  If GetConfigEntry("Join Spam", "Count", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Join Spam", "Count", "6", AMSettingsPath)
      AMJoinSpamCount = CInt(GetConfigEntry("Join Spam", "Count", AMSettingsPath))
  Else
      AMJoinSpamCount = CInt(GetConfigEntry("Join Spam", "Count", AMSettingsPath))
  End If
  If GetConfigEntry("Join Spam", "Refresh Rate", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Join Spam", "Refresh Rate", "10", AMSettingsPath)
      AMJoinSpamRefresh= CInt(GetConfigEntry("Join Spam", "Refresh Rate", AMSettingsPath))
  Else
      AMJoinSpamRefresh = CInt(GetConfigEntry("Join Spam", "Refresh Rate", AMSettingsPath))
  End If
  If GetConfigEntry("Join Spam", "Punishment", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Join Spam", "Punishment", "ban", AMSettingsPath)
      AMJoinSpamPunishment = CStr(GetConfigEntry("Join Spam", "Punishment", AMSettingsPath))
  Else
      AMJoinSpamPunishment= CStr(GetConfigEntry("Join Spam", "Punishment", AMSettingsPath))
  End If
  If GetConfigEntry("Join Spam", "Unlock Wait", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Join Spam", "Unlock Wait", "300", AMSettingsPath)
      AMJoinSpamUnlock = CStr(GetConfigEntry("Join Spam", "Unlock Wait", AMSettingsPath))
  Else
      AMJoinSpamUnlock = CStr(GetConfigEntry("Join Spam", "Unlock Wait", AMSettingsPath))
  End If
  
  If GetConfigEntry("NumSpam", "Limit", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("NumSpam", "Limit", "400", AMSettingsPath)
      AMNumSpamLimit = CInt(GetConfigEntry("NumSpam", "Limit", AMSettingsPath))
  Else
      AMNumSpamLimit = CInt(GetConfigEntry("NumSpam", "Limit", AMSettingsPath))
  End If
  If GetConfigEntry("NumSpam", "LagPlug", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("NumSpam", "LagPlug", "30", AMSettingsPath)
      AMNumSpamLagPlug = CInt(GetConfigEntry("NumSpam", "LagPlug", AMSettingsPath))
  Else
      AMNumSpamLagPlug = CInt(GetConfigEntry("NumSpam", "LagPlug", AMSettingsPath))
  End If
  If GetConfigEntry("NumSpam", "Refresh", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("NumSpam", "Refresh", "500", AMSettingsPath)
       AMNumSpamRefresh= CInt(GetConfigEntry("NumSpam", "Refresh", AMSettingsPath))
  Else
      AMNumSpamRefresh = CInt(GetConfigEntry("NumSpam", "Refresh", AMSettingsPath))
  End If
  If GetConfigEntry("NumSpam", "Starcraft", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("NumSpam", "Starcraft", "10", AMSettingsPath)
      AMNumSpamSTAR = CInt(GetConfigEntry("NumSpam", "Starcraft", AMSettingsPath))
  Else
      AMNumSpamSTAR = CInt(GetConfigEntry("NumSpam", "Starcraft", AMSettingsPath))
  End If
  If GetConfigEntry("NumSpam", "Brood War", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("NumSpam", "Brood War", "15", AMSettingsPath)
      AMNumSpamSEXP = CInt(GetConfigEntry("NumSpam", "Brood War", AMSettingsPath))
  Else
      AMNumSpamSEXP = CInt(GetConfigEntry("NumSpam", "Brood War", AMSettingsPath))
  End If
  If GetConfigEntry("NumSpam", "Enabled", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("NumSpam", "Enabled", "True", AMSettingsPath)
      AMNumSpamSEXP = CBool(GetConfigEntry("NumSpam", "Enabled", AMSettingsPath))
  Else
      AMNumSpamSEXP = CBool(GetConfigEntry("NumSpam", "Enabled", AMSettingsPath))
  End If
  If GetConfigEntry ("Smart Ban/Kick", "SmartBanEnabled", AMSettingsPath) = vbNullString Then
     Call WriteConfigEntry("Smart Ban/Kick", "SmartBanEnabled", AMSmartBanEnabled, AMSettingsPath)
     AMSmartBanEnabled = CBool(GetConfigEntry("Smart Ban/Kick", "SmartBanEnabled", AMSettingsPath))
  Else
     AMSmartBanEnabled = CBool(GetConfigEntry("Smart Ban/Kick", "SmartBanEnabled", AMSettingsPath))
  End If
  If GetConfigEntry ("Smart Ban/Kick", "SmartKickEnabled", AMSettingsPath) = vbNullString Then
     Call WriteConfigEntry("Smart Ban/Kick", "SmartKickEnabled", "True", AMSettingsPath)
     AMSmartKickEnabled = CBool(GetConfigEntry("Smart Ban/Kick", "SmartKickEnabled", AMSettingsPath))
  Else
     AMSmartKickEnabled = CBool(GetConfigEntry("Smart Ban/Kick", "SmartKickEnabled", AMSettingsPath))
  End If
  If GetConfigEntry ("Smart Ban/Kick", "SmartKickTime", AMSettingsPath) = vbNullString Then
     Call WriteConfigEntry("Smart Ban/Kick", "SmartKickTime", AMSmartKickTime, AMSettingsPath)
     AMSmartKickTime = GetConfigEntry("Smart Ban/Kick", "SmartKickTime", AMSettingsPath)
  Else
     AMSmartKickTime = GetConfigEntry("Smart Ban/Kick", "SmartKickTime", AMSettingsPath)
  End If
  If GetConfigEntry("Limit", "AccessLimitBool", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Limit", "AccessLimitBool", AMAccessLimitBool, AMSettingsPath)
      AMAccessLimitBool = CBool(GetConfigEntry("Limit", "AccessLimitBool", AMSettingsPath))
  Else
      AMAccessLimitBool = CBool(GetConfigEntry("Limit", "AccessLimitBool", AMSettingsPath))
  End If
  If GetConfigEntry("Limit", "AddSetCommand", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Limit", "AddSetCommand", AMAddSetCommand, AMSettingsPath)
      AMAddSetCommand = GetConfigEntry("Limit", "AddSetCommand", AMSettingsPath)
  Else
      AMAddSetCommand = GetConfigEntry("Limit", "AddSetCommand", AMSettingsPath)
  End If
  If GetConfigEntry("Limit", "LimitUsersAcc", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Limit", "LimitUsersAcc", AMLimitUsersAcc, AMSettingsPath)
      AMLimitUsersAcc = GetConfigEntry("Limit", "LimitUsersAcc", AMSettingsPath)
  Else
      AMLimitUsersAcc = GetConfigEntry("Limit", "LimitUsersAcc", AMSettingsPath)
  End If
  If GetConfigEntry("Limit", "AdminFlagAcc", AMSettingsPath) = vbNullString Then
      Call WriteConfigEntry("Limit", "AdminFlagAcc", AMAdminFlagAcc, AMSettingsPath)
      AMAdminFlagAcc = GetConfigEntry("Limit", "AdminFlagAcc", AMSettingsPath)
  Else
      AMAdminFlagAcc = GetConfigEntry("Limit", "AdminFlagAcc", AMSettingsPath)
  End If
End Sub

Sub AM_NumSpam_Action(Target)
  If IsSafelisted(Username) Then Exit Sub
  AddC vbRed, "Flood likely.  Taking action..."
  Command Botvars.Username, "/locktext", True
  Command BotVars.Username, "/c priv", True
  Command Botvars.Username, "/ban " & Target & "*", True
  TimerEnabled "AM", "AMNumSpamTurnOn", True
  TimerEnabled "AM", "AMNumSpam_refresh", False
  AddC vbGreen, "Completed"
End Sub


'// Text Sending Functions //

'// DSP - Expanded
Sub Send(Source, Text, User)
  If Source = 4 Then
    AddChat vbGreen, AMP & Text
  Else
    Dsp Source, Text, User, vbGreen
  End If
End Sub
'// AddChat with prefix
Sub AddC(Color, Text)
  AddChat Color, AMP & Text
End Sub

'// TIMERS //

Sub AM_MessageSpam_refresh_Timer
  AMMessages.RemoveAll
  AMMessagesUsers.RemoveAll
End Sub

Sub AM_JoinSpam_refresh_Timer
  AMJoins = 0
  If AMIsLocked Then
    Command BotVars.Username, "/c pub", True
    AMIsLocked = False
  End If
End Sub

Sub AM_lock_Channel_Timer
  TimerEnabled "AM", "Lock_Channel", False
  If AMIsLocked Then Exit Sub
  Command BotVars.Username, "/c priv", True
  AMIsLocked = True
End Sub

Sub AM_AMNumSpam_refresh_Timer()
  AMNumSpam_Status = AMNumSpamLimit
  AddC vbGreen, "Status reset to " & AMNumSpam_Status
End Sub

Sub AM_AMNumSpamTurnOn_Timer()
  TimerEnabled "AM", "NumSpam_refresh", True
  TimerEnabled "AM", "NumSpam_TurnOn", False
  TimerEnabled "AM", "Lock_Channel". True
End Sub

Class debugging
  Public Sub Write(color, text)
    If AMDebugGlobal Then
      AddC color, text
    End If
  End Sub
End Class

Switched to a codebox ~Vector
Code tags for a reason ~Hero
« Last Edit: January 18, 2009, 05:22:45 PM by Vector »
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
Current Code
« Reply #1 on: September 19, 2008, 01:37:45 PM »
I've updated it with the flood thing I have now.
Merge if needed.
It's not based totally on #'s in usernames, it will trigger other ways.

Triggers:
SCBW Userjoin -2
SC Userjoin -1
Lagplug -10
Ping -10
# in username   - subtracts the # (if Geno_1.6#163 joins, it would take 163 off the total)

Removed ~Hero
« Last Edit: September 19, 2008, 02:46:48 PM by Hero »
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
Current Code
« Reply #2 on: September 19, 2008, 01:45:30 PM »
I do not really like how you added that in. It is a good feature though, could you pastebin the original code of your plugin and I will try to merge it myself.
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
Current Code
« Reply #3 on: September 19, 2008, 01:52:21 PM »
Quote from: Hero
I do not really like how you added that in. It is a good feature though, could you pastebin the original code of your plugin and I will try to merge it myself.

Sorry XD
Link
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
Current Code
« Reply #4 on: September 19, 2008, 02:47:13 PM »
Please test

Code: [Select]
Testing
« Last Edit: September 20, 2008, 05:44:10 AM by Hero »
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
Current Code
« Reply #5 on: September 20, 2008, 05:52:11 AM »
Quote from: Shadow
And can you guys use Codebox tags instead of code tags? It's annoying to scroll 75% of the page...

Ok.
At the top (The official one) - we'll use just code but for addons and modifications we'll use codebox
Code tags just look cleaner.
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
Current Code
« Reply #6 on: September 20, 2008, 06:08:54 AM »
Codebox tags remove indenting.

Fixed errors, Updated original post

Removed Channel Password posts, we are not going to do a channel password.
« Last Edit: September 27, 2008, 07:01:02 AM by Hero »
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Current Code
« Reply #7 on: October 16, 2008, 11:07:55 AM »
Updated AM to 0.16, with access limitation feature. Please test it.

This plugin WILL add add=70 and set=70 if limitation is not enabled by default. That way, the limitations are removed.

This should work for anyone with <= 999 access, but not flags A.
« Last Edit: October 16, 2008, 11:30:31 AM by Vector »
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Current Code
« Reply #8 on: October 16, 2008, 01:53:12 PM »
I don't want users to be able to change the default access for "add" and "set" exclusively, because they can change it in the plugin. It's not like the other variables, where default doesn't matter. But lets see what Hero says about it.

And the reason I disable them is so the users won't get by the default "add" and "set" access requirements, because if I didn't disable it, they could still add users.

No, it won't work with the beta somewhere around DR 5 or so. it doesn't use access.ini anymore. That has to be set in Commands.xml
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Current Code
« Reply #9 on: October 19, 2008, 02:36:09 PM »
Fixed major issues with the "limit" command. The bot was trying to issue the add/set command using Command() With the user's access, but I had already restricted both add and set in access.ini (so it didn't work).

To overcome this limitation, I had to instead call Command() Using BotVars.Username, and the /add command (which overrides all access.ini limitations), then check the user's access against the AMAddSettAcc variable (70, which is the default access level for add and set)

It now has a custom message, similar to the bot's default "Set user to blah access". I also added various other checks and bounds to it. I also added a "nolimit" command too.

@Shadow: Anyone with the A flag has no restrictions whatsoever. I just simply exit the sub if they have the A flag, to prevent duplicate addition entries.

Quote
[2:46:42 PM] <Bot-Vector> .whoami
 [2:46:42 PM] <Bot-Vector@Northrend> You have 999 access and flags A.
 [2:46:18 PM] <Bot-Vector> .add testing 600
 [2:46:19 PM] <Bot-Vector@Northrend> Set testing's access to 600.
 [2:46:20 PM] <Bot-Vector@Northrend> Set testing's access to 600.

Quote
[1:54:42 PM] <Bot-Vector> .add hero.a 120
 [1:54:42 PM] <Bot-Vector@Northrend> Set hero.a's access to 120.
 [1:55:05 PM] <Bot-Vector> .add aunoVector@europe 150
 [1:55:06 PM] <Bot-Vector@Northrend> Set aunoVector@europe's access to 150.
 [1:55:15 PM] <Bot-Vector> ~say .limit aunoVector@europe 20
 [1:55:16 PM] <Hero.A@Northrend> .limit aunoVector@europe 20
 [1:55:16 PM] <Bot-Vector@Northrend> aunoVector@europe (150 access) has higher access than you (120 access). Unable to limit.
 [1:55:41 PM] <Bot-Vector> .limit hero.a 121
 [1:55:41 PM] <Bot-Vector@Northrend> Unable to limit hero.a's access. Limit (121) too high for his access (120).
 [1:55:52 PM] <Bot-Vector> .limit hero.a 120
 [1:55:52 PM] <Bot-Vector@Northrend> Limit is ambiguous to user's access.
 [1:56:08 PM] <Bot-Vector> .limit hero.a
 [1:56:09 PM] <Bot-Vector@Northrend> hero.a has no limitation.
 [1:56:14 PM] <Bot-Vector> .limit hero.a 50
 [1:56:15 PM] <Bot-Vector@Northrend> Limited hero.a to giving out 50 access.
 [1:56:19 PM] <Bot-Vector> ~say .add bob 51
 [1:56:19 PM] <Hero.A@Northrend> .add bob 51
 [1:56:20 PM] <Bot-Vector@Northrend> You are limited to giving out 50 access only.
 [1:56:22 PM] <Bot-Vector> ~say .add bob 50
 [1:56:23 PM] <Hero.A@Northrend> .add bob 50
 [1:56:23 PM] <Bot-Vector@Northrend> Set bob's access to 50.
 [2:02:44 PM] <Bot-Vector> .limit hero.a
 [2:02:45 PM] <Bot-Vector@Northrend> hero.a has an access limit of 50.
 [1:56:36 PM] <Bot-Vector> .limit test ee
 [1:56:36 PM] <Bot-Vector@Northrend> The limitation argument must be a numeric value.
 [1:56:45 PM] <Bot-Vector> .limit testing
 [1:56:45 PM] <Bot-Vector@Northrend> User not found.
 [1:56:52 PM] <Bot-Vector> .limit testing 30
 [1:56:53 PM] <Bot-Vector@Northrend> That user doesn't exist. Cannot limit.
 [1:58:01 PM] <Bot-Vector@Northrend> Removed hero.a's add restrictions.

[div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']  Case "limit"
   If uNum < AMLimitUsersAcc Then Exit Sub

   GetDBEntry Arg(1), a, f

   getLim = GetConfigEntry("limit", Arg(1), AMSettingsPath)

   '// Query limits
   If Ubound(Arg) = 1 Then
     If getLim = "" And a <> -1 Then
      Send Source, Arg(1) & " has no limitation.", User
     ElseIf getLim <> "" And a <> - 1 Then
      Send Source, Arg(1) & " has an access limit of " & getLim & ".", User
     Else
      Send Source, "User not found.", User
     End If
     Exit Sub
   End If

     If Not IsNumeric(Arg(2)) Then
      Send Source, "The limitation argument must be a numeric value.", User
      Exit Sub
     End If

     '// User exists?
     If a = -1 Then
      Send Source, "That user doesn't exist. Cannot limit.", User
      Exit Sub
     End If

     '// Trying to limit a user who has higher access than you?
     If cInt(uNum) < cInt(a) Then
      Send Source, Arg(1) & " (" & a & " access) has higher access than you (" & uNum & " access). Unable to limit.", User
      Exit Sub
     End If

     '// Limiting user to their access level?
     If cInt(Arg(2)) = cInt(a) Then
      Send Source, "Limit is ambiguous to user's access.", User
      Exit Sub
     End If

     '// Limiting someone to higher access than they currently have?
     If cInt(Arg(2)) > cInt(a) Then
      Send Source, "Unable to limit " & Arg(1) & "'s access. Limit (" & Arg(2) & ") too high for his access (" & a & ").", User
      Exit Sub
     End If

     WriteConfigEntry "limit", Arg(1), Arg(2), AMSettingsPath

     Send Source, "Limited " & Arg(1) & " to giving out " & Arg(2) & " access.", User[/div] Codebox ftw ~Hero
« Last Edit: October 19, 2008, 03:47:03 PM by Hero »
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Current Code
« Reply #10 on: October 19, 2008, 03:04:29 PM »
Added "admin" and "noadmin" commands (gives someone the A flag - 999 access)
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
Current Code
« Reply #11 on: October 21, 2008, 01:29:02 PM »
Tested and looks like it works, Forgot to post it. Also, you *CAN* use it with stealthbot beta, but you need to edit Commands.xml to have add, remove, set and their aliases set to 10000 (or so).
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Current Code
« Reply #12 on: November 04, 2008, 12:02:30 PM »
Freaking Zone...

Added Smart Banning. I did not add enabling, since it was necessary to include this by default, so you don't ban unnecessarily.

Please test.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
Current Code
« Reply #13 on: November 13, 2008, 04:18:48 PM »
Added Safelist checking/bypass. script no longer bans/kicks/punishes Safelisted Users. *May have missed a sub or function*

Updated first post with new code. Removed duplicate UserTalk. ~Vector
« Last Edit: November 13, 2008, 09:01:15 PM by Vector »
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
Current Code
« Reply #14 on: November 14, 2008, 04:39:18 PM »
Please use THIS code instead:

Updated. ~Vector
« Last Edit: November 17, 2008, 08:04:53 AM by Vector »
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]