Public feed
#529501
'dbp
'1.0
'// [ Command Names ]
Const dbsCmd = "baal" '// Change this to whatever suits you just keep the quotes. Ex: chaos or baal
Const dbsPerm = "perm" '// In the event someone needs a perm
Const dbsApp = "appeal" '// Appeals to friends add
Const dbsDeapp = "deappeal" '// If on friends list, the user executing this cmd will be removed
Const dbsHelp = "dbshelp" '// Help command
Const dbsAll = "all" '// List all commands.
'// [ Possible Characters ]
Private Const dbsChar = "paladin" '// /| /| Possible characters
Private Const dbsChara = "sorceress" '// //|------// that can appeal for
Private Const dbsCharac = "necromancer" '// \\|------\\ a friends-add, also
Private Const dbsCharact = "barbarian" '// \| \| reads required level
'// [ Public's ]
Public dbsTarget, dbsWhere
Public dbsOn, TIC, TICf
Public dbsStats
Public dbsName, dbsLevel, dbsElig, dbsGame, dbsPassword
Public dbsG, dbsP, dbsGn, dbsPw
Public dbsAct, dbsTrack, dbsDelay
'// [ Command Statuses ]
'// Commands can be disabled by setting their value to False
'// Note: disabled commands can still be executed in-bot
Const dbsCmd_cmd_enabled = True
Const dbsPerm_cmd_enabled = True
Const dbsApp_cmd_enabled = True
Const dbsDeapp_cmd_enabled = True
Const dbsHelp_cmd_enabled = True
Const dbsBrackets = True '// Use brackets?
Const dbsGreets = True '// Greet diablo players?
Const minPingKick = False '// Kick if ping >= minPing?
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
Sub dbp_event_Load()
dbsOn = False
'// Timer at 0?
dbsTrack = 0 '// Time command executed
dbsDelay = 20 '// Time to wait
End Sub
Sub dbp_event_UserTalk(Username, Flags, Message, Ping)
GetDBEntry Username, MyAccess, MyFlags
If dbsOn = False Then
'// 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))
Select Case LCase(cmd(0))
Case dbsCmd: dbsCmd_cmd cmd, Username, MyAccess
Case dbsApp: dbsApp_cmd cmd, Username, MyAccess
Case dbsDeapp: dbsDeapp_cmd cmd, Username, MyAccess
Case dbsHelp: dbsHelp_cmd cmd, Username, MyAccess
End Select
End If
End Sub
Sub dbp_event_ServerInfo(Message)
If dbsOn = False Then
If Instr(Message, "offline") > 0 or Instr(Lcase(Username), "@") > 0 Then
Exit Sub '// Exit
Else '// Or
If Instr(Lcase(Message), "destruction") > 0 and Not Instr(Lcase(Username), "@") > 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) '// Now get what they are doing
dbsWhere = Replace(dbsWhere, "(private)", "") '// Then replace the following
dbsWhere = Replace(dbsWhere, "in a ", "")
dbsWhere = Replace(dbsWhere, "in the channel ", "C ] [ ")
dbsWhere = Replace(dbsWhere, "in the game ", "G ] [ ")
If InStr(Message, "..") > 0 Then
dbsWhere = Replace(dbsWhere, "..", ".") '// Remove double period
Else
dbsWhere = Replace(dbsWhere, ".", "") '// Remove period
End If
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
If dbsBrackets = True Then
AddQ "[ " & dbsTarget & " ] " & dbsMarker & "did just join the game --> [ " & 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) '// Now get what they are doing
dbsWhere = Replace(dbsWhere, "(private)", "") '// Then replace..
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 Instr(Lcase(Message), "exited battle.net.") > 0 and Not Instr(Lcase(Username), "@") > 0 Then
dbsTarget = Username
If dbsBrackets = True Then
AddQ "[ " & dbsTarget & " ] " & dbsMarker & " did just exit Battle.Net >:( Evil bot!"
Else
AddQ dbsTarget & " " & dbsMarker & " exited Battle.Net."
End If
End If
If Instr(Lcase(Message), "entered battle.net.") > 0 and Not Instr(Lcase(Username), "@") > 0 Then
dbsTarget = Username
If dbsBrackets = True Then
AddQ "[ " & dbsTarget & " ] " & dbsMarker & " has just entered Battle.Net ! Prepare for baalruns !"
Else
AddQ dbsTarget & " " & dbsMarker & " entered Battle.Net."
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
If Not InStr(Message, " ") > 0 Then Exit Sub '// Was game supplied?
If Split(Message)(0) = BotVars.Trigger & dbsPerm And InStr(Message, " ") > 0 Then
dbsG = Split(Message, " ")(1)
If dbsBrackets = True Then
AddQ "[ " & Username & " ] needs a perm in [ " & dbsG & " ]"
Else
AddQ Username & " needs a perm in " & dbsG
End If
End If
End Sub
Sub dbp_event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString, Banned)
GetDBEntry Username, MyAccess, MyFlags
If MyAccess < 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 MyFlags = 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.
End If
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 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 dbsPerm, dbsApp, dbsDeapp
VetoThisMessage
AddChat vbOrange, "This command cannot be used in-bot!"
Case dbsHelp
VetoThisMessage
AddChat vbYellow, "The command for this in-bot is '/phelp dbp'"
End Select
End If
End Sub
'// Timers //
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
'// Command Subs //
Sub dbsCmd_cmd(cmd, Username, Access)
If Username <> BotVars.Username Then
If Access < dbsCmd_cmd_access Or dbsCmd_cmd_enabled = False Then Exit Sub '// Has enough access?
End If
'// Timer started apon command execution?
If dbsTrack = 0 Then
dbsTrack = 0
AddQ "/f l"
TimerInterval "dbp", "Delay", 1
TimerEnabled "dbp", "Delay", True
Else
'// Has command already been executed?
AddQ "You must wait " & (dbsDelay - dbsTrack) & " seconds before executing command again."
End If
Exit Sub
dbsCmd_cmd cmd, Username, Access
End Sub
Sub dbsApp_cmd(cmd, Username, Access)
If Username <> BotVars.Username Then
If Access < dbsApp_cmd_access Or dbsApp_cmd_enabled = False Then Exit Sub '// Has enough access?
End If
If InStr(dbsElig, Username) > 0 Then
AddQ "You have been added to the list."
AddQ "/f a " & Username
If Access >= 51 Then Exit Sub
Else
Command BotVars.Username, "/set " & Username & " 50", True
End If
End Sub
Sub Deapp_cmd(cmd, Username, Access)
If Username <> BotVars.Username Then
If Access < dbsDeapp_cmd_access Or dbsDeapp_cmd_enabled = False Then Exit Sub '// Has enough access?
End If
AddQ "/f r " & Username
AddQ "If you where on the list you will be removed."
Command BotVars.Username, "/rem " & Username, True
End Sub
Sub dbsHelp_cmd(cmd, Username, Access)
If Username <> BotVars.Username Then
If Access < dbsHelp_cmd_access Or dbsHelp_cmd_enabled = False Then Exit Sub '// Has enough access?
End If
If UBound(cmd) < 1 Then
If dbsHelp_cmd_enabled = True Then arg = dbsCmd Or arg = dbsPerm Or arg = dbsApp Or arg = dbsDeapp End If
Else
arg = cmd(1)
End If
Select Case LCase(arg)
Case dbsCmd
AddQ "/w " & psD2 & Username & " The " & dbsCmd & " command is used to trigger the friends list command."
If dbsCmd_cmd_access = -1 Then
AddQ "/w " & psD2 & Username & " No access required."
Else
AddQ "/w " & psD2 & Username & " Required access for the " & dbsCmd & " command is " & dbsCmd_cmd_access & "."
End If
Case dbsPerm
AddQ "/w " & psD2 & Username & " The " & dbsPerm & " command is used to request a perm if needed. (Whisper only)"
If dbsPerm_cmd_access = -1 Then
AddQ "/w " & psD2 & Username & " No access required."
Else
AddQ "/w " & psD2 & Username & " Required access for the " & dbsPerm & " command is " & dbsPerm_cmd_access & "."
End If
Case dbsApp
AddQ "/w " & psD2 & Username & " The " & dbsApp & " command is used to check your character level and class to see if you can be added to friends list."
If dbsApp_cmd_access = -1 Then
AddQ "/w " & psD2 & Username & " No access required."
Else
AddQ "/w " & psD2 & Username & " Required access for the " & dbsApp & " command is " & dbsApp_cmd_access & "."
End If
Case dbsDeapp
AddQ "/w " & psD2 & Username & " The " & dbsDeapp & " command is used to remove yourself from the bot's friends list."
If dbsDeapp_cmd_access = -1 Then
AddQ "/w " & psD2 & Username & " No access required."
Else
AddQ "/w " & psD2 & Username & " Required access for the " & dbsDeapp & " command is " & dbsDeapp_cmd_access & "."
End If
Case dbsAll
AddQ "/w " & psD2 & Username & " Commands for DooR.'s BaaL//Chaos Script are as follows:"
AddQ "/w " & psD2 & Username & " " & BotVars.Trigger & dbsCmd & ", " & BotVars.Trigger & dbsApp & ", " & BotVars.Trigger & dbsDeapp & ", and " & BotVars.Trigger & dbsHelp
End Select
End Sub