Figured it'd just be easier to post in this thread than make a new one for you guys to poke through -
I'm back to my hacker database, but now I'm coming up with a new error that only seems to appear when I'm trying to set a table with 'Integers':
Quote
[09:35:27 PM] Scripting runtime error '-2147217900' in Sierra Squadron Database: (line 176; column 0)
[09:35:27 PM] [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition.
[09:35:27 PM] Offending line: >>
The script in it's current form:
Script("Name") = "Sierra Squadron Database"
Script("Author") = "Sierra.Komodo"
Script("Major") = 1
Script("Minor") = 00
Script("Revision") = 0
Script("Description") = "Custom Database Script designed for SierraCom."
'// Extended Description
'//
'//
'// Commands
'//
'//
'// Known Bugs
'//
'//
'// To-Do List
'//
'//
Public ssConn '// Connection to the database.
Public ssDBPath '// Path to the database.
Private SSRStep '// Contains current report step
Private SSRTitle
Private SSRHost
Private SSRRealm
Private ssFSO '// FileSystemObject
Sub Event_Load()
Version = Script("Major") & "." & Script("Minor") & " R" & Script("Revision")
AddChat 10010200, "SSDB: ", 10010020, "Sierra.Komodo's " & Script("Name") & " Version " & Version & " Loaded."
If GetSettingsEntry("Version") = vbNullString Then
AddChat 10010200, "SSDB: ", 10010020, "Writing settings entries..."
WriteSettingsEntry "Version", Version & " '// Don't edit this line. It won't change anything anyway, it's for your reference."
Call CleanINI()
End If
AddChat 10010200, "SSDB: ", 10010020, "Checking commands, writing if needed..."
Call CreateCmds()
ssDBPath = BotPath() & "SSDBData.mdb"
Set ssFSO = CreateObject("Scripting.FileSystemObject")
If Not ssFSO.FileExists(ssDBPath) Then
ss_create_database
AddChat 10010200, "SSDB: ", 10010020, "Sierra Squadron Database created."
Else
ss_connect
AddChat 10010200, "SSDB: ", 10010020, "Sierra Squadron Database loaded."
End If
End Sub
Private Sub CreateCmds
Set cmd = OpenCommand("ReportStart")
If cmd Is Nothing Then
Set cmd = CreateCommand("ReportStart")
With cmd
.Description = "Orders the script to begin a game report."
.RequiredRank = "-1"
.Save
End With
End If
Set cmd = OpenCommand("ReportEnd")
If cmd Is Nothing Then
Set cmd = CreateCommand("ReportEnd")
With cmd
.Description = "Orders the script to terminate a game report."
.RequiredRank = "-1"
.Save
End With
End If
Set cmd = OpenCommand("Report")
If cmd Is Nothing Then
Set cmd = CreateCommand("Report")
With cmd
.Description = "Placeholder for report entries."
.RequiredRank = "-1"
.Save
End With
End If
End Sub
Public Sub Event_Command(Command)
If Command.IsLocal Then Command.Username = BotVars.Username
Select Case LCase(Command.Name)
Case "reportstart": Call reportstartcmd(Command, Command.Username)
Case "reportend": Call reportendcmd(Command, Command.Username)
Case "report": Call reportcmd(Command, Command.Username)
End Select
End Sub
Private Sub reportstartcmd(Command, user)
cmdArr = Split(Command.Args)
Command.Respond "Please give the realm for the report (Syntax: /report realm)"
SSRID = 1
SSRStep = 1
End Sub
Private Sub reportcmd(Command, user)
If Command.IsValid Then
If Command.HasAccess Then
cmdArr = Command.Args
If SSRStep = 0 Then
Command.Respond "There is no active report. Please use the ReportStart command."
End If
If SSRStep = 3 Then
SSRHost = cmdArr
Command.Respond "Host set to: " & SSRHost
Command.Respond "Initial database information is now being written..."
ssConn.Execute("INSERT INTO `report` (`id`, `requested`, `realm`, `title`, `host`)" & _
"VALUES (" & 1 & ", " & 0 & ", '" & SSRRealm & "', '" & SSRTitle & "', '" & SSRHost & "')")
SSRStep = 4
End If
If SSRStep = 2 Then
SSRTitle = cmdArr
Command.Respond "Title set to: " & SSRTitle
Command.Respond "Please give the game host (Syntax: /report host)"
SSRStep = 3
End If
If SSRStep = 1 Then
SSRRealm = cmdArr
Command.Respond "Realm set to: " & SSRRealm
Command.Respond "Please give the game title (Syntax: /report title)"
SSRStep = 2
End If
End If
End If
End Sub
Private Sub reportendcmd(command, user)
If SSRStep > 0 Then
SSRStep = 0
Command.Respond "Report cancelled"
Else
Command.Respond "No report in progress"
End If
End Sub
Sub ss_create_database()
Set Catalog = CreateObject("ADOX.Catalog")
Catalog.Create "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=" & ssDBPath
ss_connect()
ssConn.Execute("CREATE TABLE `report` (`id` Integer, `requested` Integer, `realm`, Text, `title` Text, `host` Text)")
ssConn.Execute("CREATE TABLE `reportP` (`pcount` Integer, `p1name` Text, `p2name` Text, `p3name` Text, `p4name` Text, `p5name` Text, `p6name` Text, `p7name` Text, `p8name` Text)")
ssConn.Execute("CREATE TABLE `reportS` (`scount` Integer, `s1name` Text, `s2name` Text, `s3name` Text, `s4name` Text, `s5name` Text, `s6name` Text, `s7name` Text, `s8name` Text)")
ssConn.Execute("CREATE TABLE `reportH` (`hcount` Integer, `h1name` Text, `h2name` Text, `h3name` Text, `h4name` Text, `h5name` Text, `h6name` Text, `h7name` Text, `h8name` Text)")
ssConn.Execute("CREATE TABLE `hackers` (`gateway` Text, `username` varchar(30), `offenses` Integer, `multicommand` Integer, `automine` Integer, `autoqueue` Integer, `maphack` Integer, `spoof` Integer, `drophack` Integer)")
'// Gateway-0 Username-1 Offenses-2 SH-3 AutoMine-4 AutoQueue-5 MH-6 Spoof-7 DH-8
ssConn.Execute("CREATE TABLE `spoofers` (`gateway` Text, `spoofname` Text, `truename` varchar(30), `ip` text)")
End Sub
Sub ss_connect()
Set ssConn = CreateObject("ADODB.connection")
dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & ssDBPath
ssConn.ConnectionString = dsn
ssConn.Open
End Sub
Private Sub CleanINI '// Removes the " = " after the commented out lines that this script makes. Taken from TheBlackNinja's CRS script.
Set fso = CreateObject("Scripting.FileSystemObject")
Set File = fso.OpenTextFile(BotPath & "scripts\scripts.ini", 1, True)
data = Split(File.ReadAll, vbNewLine)
File.Close
tMatch = False
For i = 0 To UBound(data) -1
If tMatch Then
If Left(data(i), 3) = "'//" Then
line = line & Split(data(i), "=")(0) & vbNewLine
ElseIf InStr(data(i), "[") > 0 AND InStr(data(i), "]") > 0 Then
tMatch = False
line = line & data(i) & vbNewLine
Else
line = line & data(i) & vbNewLine
End If
Else
If data(i) = "[" & Script("Name") & "]" Then
tMatch = True
line = line & data(i) & vbNewLine
Else
line = line & data(i) & vbNewLine
End If
End If
Next
fso.DeleteFile(BotPath & "scripts\scripts.ini")
temp = Split(line, vbNewLine)
For i = 0 To Ubound(temp) -1
Set File = fso.OpenTextFile(BotPath & "scripts\scripts.ini", 8, True)
File.WriteLine temp(i)
File.Close
Next
End Sub
Sub Event_Close()
AddChat 10020100, "SSDB: ", 10010020, "Closing Database..."
ssConn.Close
End Sub
Also, if you're wondering why it seems orientated toward writing reports for games, this is because I'm planning to have the script put out a generated report for each game which can be added to an email sent to blizzard. The information on who's using what hacks are being gathered from BWHF and personal observations.