Public feed #529377

Stuff

public text v1 · immutable
Raw Edit
·published 2007-06-01 22:01 UTC
rendered paste body
'dbp
'3.99
'&BaaL//Chaos Script:T)a(Z and DooR.
'&baal:appeal:deappeal:gn <Game>|<Pass>:p <Pass>:<Game>|<Pass>
'&13893
'&!gn and !p only work as Whisper commands:There is no trigger for in-chat <Game>|<Pass>

'// [ Updates ]
'//  - Version 3.99

'//   - Removed errors users were receiving when using in bot commands(Thanks T)a(Z)
'//   - Added "/" commands to specific functions
'//   - Repaired bugs some 'Beta Testers' were having when using the betas
'//      *IE: !appeal and !deappeal
'//   - Added a 'Delay' timer to delay the time between each friends print command(Thanks T)a(Z)

'//  - Version 3.75
'//   - Added more applicants, (characters) that can appeal

'//  - Version 3.50 <
'//   - Beta devolepment releases


'// BaaL Script 3.99
'//   by DooR.
'//     Last modified by T)a(Z and DooR. 4:24 AM 12/25/06
'//       Plugin Version


Public dbsTarget, dbsWhere
Public dbsOn, TIC, TICf
Public dbsStats
Public dbsName, dbsLevel, dbsElig, dbsGame, dbsPassword
Public dbsG, dbsP, dbsGn, dbsPw
Public dbsAct, dbsTrack, dbsDelay

Const dbsMarker = ":"
Const dbsBrackets = True
Const dbsGreets = True
Const dbsCmd = "baal" '// Change this to whatever suits you just keep the quotes. Ex: chaos or baal
Const dbsApp = "appeal" '// appeals to friends add
Const dbsDeapp = "deappeal" '//If on friends list, you will be removed.

Const dbsAccess = 90  '// Access to use personal commands
Const minPingKick = False
Const minPing = 500 '// Kicks if ping is higher then that
Const minDupe = True '// Ban double names
Const minIP = True  '// Ban ignored players
Const alloAppeal = True '// Allow players to appeal a friends-add
Const alloRemove = True '// Allow players to remove themselves from your friends

'// It doesnt matter what order its in as long as its in here spelled correctly.
Private Const dbsChar = "paladin" '//Reads Possible characters that can appeal for friends add
Private Const dbsChara = "sorceress" '//Reads Possible characters that can appeal for friends add
Private Const dbsCharac = "necromancer" '//Reads Possible characters that can appeal for friends add
Private Const dbsCharact = "assassin" '//Reads Possible characters that can appeal for friends add
Private Const dbsLev = 80

Sub dbp_event_Load()
    dbsOn = False
dbsTrack = 0 '// Time command executed
dbsDelay = 20 '// Time to wait
End Sub

Sub dbp_event_UserTalk(Username, Flags, Message, Ping)

 If InStr(Message, "|") > 0 Then
   dbsPw = Split(Message, "|")(1)
   dbsGn = Split(Message, "|")(0)
 If dbsBrackets = True Then
  AddQ "[ " & Username & " making: " & dbsGn & "/" & dbsPw & " ]"
Else
  AddQ USername & " making: " & dbsGn & "/" & dbsPw
End If
End If
GetDBEntry Username, Access, MyAccess

'// User is executing a command?
If Username <> BotVars.Username Then
  If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
Else
  If Left(Message, 1) <> "/" Then Exit Sub
End If

'// Avoid errors during command extraction
If Len(Message) < 2 Then Exit Sub
If Instr(Trim(Message), " ") = 0 Then dbsMsg = Message & " " Else dbsMsg = Message End If

'// Get the command and arguments
cmd = Split(Mid(Trim(dbsMsg), 2), " ")

 If dbsOn = False Then

 If InStr(LCase(Message), BotVars.Trigger & dbsApp) > 0 Then
 If alloAppeal = True Then
 If InStr(dbsElig, Username) > 0 Then
  AddQ "You have been added to the list."
  AddQ "/f a " & Username
 If Access => 99 Then
Exit Sub
Else
   Command BotVars.Username, "/set " & Username & " 50", True
End If
End If
End If
End If

 If InStr(LCase(Message), BotVars.Trigger & dbsDeapp) > 0 Then
 If alloRemove = True Then
  AddQ "/f r " & Username
  AddQ "If you where on the list you will be removed."
 If Access => 99 Then
Exit Sub
Else
  Command BotVars.Username, "/rem " & Username, True
End If
End If
End If

 If InStr(LCase(Message), BotVars.Trigger & dbsCmd) > 0 Then
 If dbsTrack = 0 Then
      dbsTrack = 0
  AddQ "/f l"
 If Access => 50 Then
Exit Sub
Else
TimerInterval "dbp", "Delay", 1
TimerEnabled "dbp", "Delay", True
End If
Else
  AddQ "You must wait " & (dbsDelay - dbsTrack) & " seconds before executing command again."
End If
End If
Exit Sub
End If
End Sub

Sub dbp_event_ServerInfo(Message)
 If dbsOn = False Then
 If Instr(Message, "offline") > 0 or Instr(Lcase(Username), "@azeroth") > 0 Then
Exit Sub '// Exit
Else '// Or

 If Instr(Lcase(Message), "destruction") > 0 and Not Instr(Lcase(Username), "@azeroth") > 0 Then
   dbsTarget = Split(Message, ",")(0)  '// Cut off everything after the comma
   dbsTarget = Split(dbsTarget, ": ")(1)   '// Then cut off everything before the colon
   dbsWhere = Split(Message, "Destruction ")(1)  '// Get what they are doing
   dbsWhere = Replace(dbsWhere, "(private)", "")  '// Replace if private
   dbsWhere = Replace(dbsWhere, "in a ", "")  '// Remove "in a "
   dbsWhere = Replace(dbsWhere, "in the channel ", "C ] [ ")  '// Remove "in the channel "
   dbsWhere = Replace(dbsWhere, "in the game ", "G ] [ ")  '// Remove "in the game "
   dbsWhere = Replace(dbsWhere, " . ", "")  '// Remove period and spaces
   dbsWhere = Replace(dbsWhere, ".", "")  '// Remove period
   dbsWhere = Replace(dbsWhere, "Smite", "Smite.")  '// Add period if in Op Smite.1337
   dbsWhere = Replace(dbsWhere, "smite", "Smite.")  '// Add period if in Op Smite.1337
   dbsWhere = Replace(dbsWhere, "CrueL", "CrueL.")  '// Add period if in Op CrueL.X
   dbsWhere = Replace(dbsWhere, "Op x", "Op x.")  '// Add period if in Op x.HoD
 If dbsBrackets = True Then
  AddQ "[ " & dbsTarget & " ] " & dbsMarker & " [ " & dbsWhere & " ]"
Else
  AddQ dbsTarget & " " & dbsMarker & " " & dbsWhere
End If
End If
End If
End If
End Sub

Sub dbp_event_WhisperFromUser(Username, Flags, Message)
 If dbsOn = False Then
 If Instr(Lcase(Message), "entered a diablo ii lord of destruction game called") > 0 Then
   dbsTarget = Split(Message, "friend ")(1)  '// Cut off everything after the comma
   dbsTarget = Split(dbsTarget, " entered ")(0)   '// Then cut off everything before the colon
   dbsTarget = Replace(dbsTarget, " has", "") '// Remove " has" in the account
   dbsWhere = Split(Message, "called ")(1)  '// Get what they are doing
   dbsWhere = Replace(dbsWhere, "(private)", "")  '// Replace if private
   dbsWhere = Replace(dbsWhere, " . ", "")  '// Remove period and spaces
   dbsWhere = Replace(dbsWhere, ".", "")  '// Remove period
 If dbsBrackets = True Then
AddQ dbsTarget & " entered " & dbsWhere
Else
  AddQ dbsTarget & " entered " & dbsWhere
End If
End If
End If
 If Instr(Lcase(Message), "entered a diablo ii lord of destruction game called") > 0 Then
   dbsTarget = Split(Message, "friend ")(1)  '// Cut off everything after the comma
   dbsTarget = Split(dbsTarget, " entered ")(0)   '// Then cut off everything before the colon
   dbsWhere = Split(Message, "called ")(1)  '// Get what they are doing
   dbsWhere = Replace(dbsWhere, "(private)", "")  '// Replace if private
   dbsWhere = Replace(dbsWhere, " . ", "")  '// Remove period and spaces
   dbsWhere = Replace(dbsWhere, ".", "")  '// Remove period
End If
 If Split(Message)(0) = BotVars.Trigger & "p" And InStr(Message, " ") > 0 Then
   dbsPassword = Split(Message, " ")(1)
 If dbsBrackets = True Then
  AddQ "[ " & dbsTarget & " ] " & dbsMarker & " [ " & dbsWhere & "/" & dbsPassword & " ]"
Else
  AddQ dbsTarget & " : " & dbsWhere & "/" & dbsPassword
End If
End If





 If Split(Message)(0) = BotVars.Trigger & "gn" And InStr(Message, " ") > 0 And Instr(Message, "|") > 0 Then
   dbsP = Split(Message, "|")(1)
   dbsG = Split(Message, "|")(0)
   dbsG = Replace(dbsG, BotVars.Trigger & "gn ", "") '// Remove "!gn "
 If dbsBrackets = True Then
  AddQ "[ " & Username & " says: " & dbsG & "/" & dbsP & " ]"
Else
  AddQ Username & " says: " & dbsG & "/" & dbsP
End If
End If
End Sub

Sub dbp_event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
GetDBEntry Username, Access, MyAccess
 If Access < 30 Then
 If Instr(Lcase(Username), "#") > 0 Then
 If minDupe = True Then
  AddQ "/kick " & Username & "  Kicked ) : ( No #2+ Accounts "
End If
End If
 If minPingKick = True Then
 If Ping >= minPing Then
  AddQ "/kick " & Username & " Ping" & dbsMarker & " " & Ping
End If
 If Flags = 16 Then
 If minIP = True Then
  AddQ "/ban " & Username & " IPBanned"
End If
End If
End If
End If

 If dbsGreets = True Then
 If Instr(LCase(Message), "diablo ii ") > 0 Then
   dbsName = Split(Message, "(")(1)
   dbsName = Split(dbsName, ", ")(0)
  AddQ "" '// You could enter a greeting message here.
 If InStr(Lcase(Message), "(open character).") > 0 Then
Exit Sub
Else
   dbsCheck = Split(Message, "level " & dbsLevel)(1)
   dbsCheck = Split(dbsCheck, " on realm")(0)
   Utility= Replace(dbsCheck, " ", "")  '// Remove spaces
  AddChat vbRed, dbsCheck
 If Instr(dbsCheck, dbsCharact) > 0 and Level => dbsLev Then
    dbsElig = dbsElig + "|" & Username
ElseIf Instr(dbsCheck, dbsCharac) > 0 and Level => dbsLev Then
    dbsElig = dbsElig + "|" & Username
ElseIf Instr(dbsCheck, dbsChara) > 0 and Level => dbsLev Then
    dbsElig = dbsElig + "|" & Username
ElseIf Instr(dbsCheck, dbsChar) > 0 and Level => dbsLev Then
    dbsElig = dbsElig + "|" & Username
End If
End If
End If
End If
End Sub

Sub dbp_Delay_Timer()
dbsTrack = dbsTrack + 1
If dbsTrack => dbsDelay Then
dbsTrack = 0 '//Reset timer value for next print command.
TimerEnabled "dbp", "Delay", False
End If
End Sub

Sub dbp_event_ServerError(Message)
 If Instr(Lcase(Message), "don't have any friends") > 0 Then
  AddQ "No players to return."
End If
End Sub

Sub dbp_event_PressedEnter(Text)
'// Avoid errors during command extraction
If Len(Text) < 2 Then Exit Sub
If Instr(Text, " ") = 0 Then dbsText = Text & " " Else dbsText = Text End If

If Left(dbsText, 1) = "/" Then

  '// Get the command
  commandName = Split(Mid(Trim(dbsText), 2), " ")(0)

  Select Case commandName
    Case dbsCmd
      VetoThisMessage
     AddQ "/f l"
    Case dbsApp, dbsDeapp
      VetoThisMessage
     AddChat vbOrange, "This command cannot be used in-bot!"
  End Select
End If
dbp_event_UserTalk BotVars.Username, "", Text, 1
End Sub