IPB

Welcome Guest ( Log In | Register )

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

17 Pages V < 1 2 3 4 5 > »   
Closed TopicStart new topic
> DoTa Script, alot of code..
Hero.A
post Dec 22 2007, 07:28 PM
Post #61


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



It shouldnt be causing it because the path is your plugins folder. I will look into this though

Added 1v1 -- Pretty simple to add

http://rafb.net/p/6XbANB78.html

CODE

'ngoc
'0.06

'By Hero.A ~
'Set Clan to your clan and security to the number i give you!
Public Clan, Security
Clan = "You Clan Tag Here"
Security = "10" 'Put the number from me here!

'************************
'*******Variables*********
'**For Database and Code**
'*************************

Private Const db_cTypeBoolean = 11
Private Const db_cTypeCurrency = 6
Private Const db_cTypeDate = 7
Private Const db_cTypeDouble = 5
Private Const db_cTypeInteger = 3
Private Const db_cTypeText = 202

Private Const db_cModeReadOnly = 1
Private Const db_cModeForUpdate = 2


Public Compare, Confirm, GameOn, SignedUp, SignedAmnt, Data, Teams, Mode



Sub ngoc_Event_Load()

AddChat vbBlue, "Welcome to the NGOC Game Script By: Hero.A Ver: 1.0"
AddChat vbBlue, "Most messages in blue are this script working. (it may show messages you do not understand)"


TimerInterval "ngoc", "StartGame", 5
TimerEnabled "ngoc", "StartGame", FALSE

Dim db, t, db_path, rs, l

Set db = New db_clsDatabase
db_path = BotPath() & "plugins\NGOCData.mdb"


'***************************
'**Setting Up the Database**
'***************************

If not db.Exists(db_path) Then
If Not db.Create(db_path) Then
AddChat vbRed, "Unable to Create Database!"
Exit Sub
End If
Else
If Not db.Open(db_path) Then
AddChat vbRed, "Unable to Open Database!"
Exit Sub
End If
End If

If db.IsOpen() Then
AddChat vbBlue, "Database opened."
Else
Exit Sub
End If

If Not db.TableExists("Game") Then
If db.CreateTable("Game") Then
AddChat vbBlue, "Created Table Game"
Else
AddChat vbRed, "Could not create Table Game"
Exit Sub
End If
End If


Set t = db.Table("Game")
If Not db.ColumnExists(t.Name, "Name") Then
t.Columns.Append "Name", db_cTypeText, 32
AddChat vbBlue, "Created Column Name"
End If
AddChat vbBlue, "Deleting all records from Game ..."
l = db.ExecuteQuery("DELETE FROM Game")
AddChat vbBlue, "Deleted "

End Sub

'************
'**Commands**
'************

Sub ngoc_event_usertalk(Username, Flags, Message, Ping)

If Left(Message, 1) = BotVars.Trigger Then
GetDBEntry Username, myAccess, myFlags
If myAccess >= 20 Then
If lcase(left(message, 5)) = BotVars.Trigger & "sign" Then
ngoc_Sign Username
ElseIf lcase(left(message, 4)) = BotVars.Trigger & "out" Then
ngoc_Out Username
ElseIf lcase(left(message, 10)) = BotVars.Trigger & "startgame " Then
ngoc_startgame Username, Message
ElseIf lcase(left(message, 8)) = BotVars.Trigger & "confirm" Then
ngoc_Confirm
ElseIf lcase(left(message, 11)) = BotVars.Trigger & "cancelgame" Then
ngoc_Cancel
End If
End If
Else
Exit Sub
End If

End Sub

'**************
'***Sign Sub***
'**************

Sub ngoc_Sign(Username)

If GameOn = 0 Then
Exit Sub
End If

If SignedUp(Username) = 0 Then
AddQ "/me " & Username & " has signed into the game"
Set rs = db.OPenRecordSet("Game", db_cModeForUpdate)
rs.AddNew
rs("Name") = Username
rs.Update
rs.Close
SignedAmnt = SignedAmnt + 1
Else
Exit Sub
End If

End Sub


'*****************
'****Out Sub******
'*****************


Sub ngoc_Out(Username)

If GameOn = 0 Then
Exit Sub
End If

If SignUp(Username) = 1 Then
AddQ "/me " & Username & " has signed out of the game"
db.ExecuteQuery("DELETE FROM Game WHERE Name = '" & Username & "'")
SignedAmnt = SignedAmnt - 1
Else
Exit Sub
End If

End Sub


'******************
'**Start Game Sub**
'******************

Sub ngoc_startgame(Username, Message)

If GameOn = 0 Then
AddQ "Please Wait"
Exit Sub
End If

Data = Split(Message, " ")
Mode = Data(1)
Teams = Data(2)

AddChat vbBlue, "Checking Data..."
AddChat vbBlue, "Teams = " & Teams & " Mode = " & Mode

If lcase(Teams) <> "5v5" Then
If lcase(Teams) <> "4v4" Then
If lcase(teams) <> "1v1" Then
AddQ "Only 5v5 or 4v4 or 1v1 teams allowed"
Exit Sub
End If
End If

GameOn = 1
AddQ "Dota " & Mode & " game created by " & Username
AddQ "Use " & BotVars.Trigger & "sign to sign in and " & BotVars.Trigger & "out to signout"
TimerEnabled "ngoc", "StartGame", TRUE

End Sub

'********************
'**Start Game Timer**
'********************

Sub ngoc_StartGame_Timer()

If Teams = "5v5" Then
Compare = 10
ElseIf Teams = "4v4" Then
Compare = 8
ElseIF Teams = "1v1" Then
Compare = 2
End If

If Compare > SignedAmnt Then
TimerEnabled "NGOC", "StartGame", FALSE
AddChat vbBlue, "Lol we passed it"
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & "confirm to start the game"
ElseIf Compare = SignedAmnt Then
TimerEnabled "NGOC", "StartGame", FALSE
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & "confirm to start the game"
End If

End Sub

'************
'**Confirm***
'************

Sub ngoc_Confirm

If GameOn = 0 Then
Exit Sub
End If

GN = GN + 1
AddQ "Confirmed"
AddQ "GN = " & Clan & "" & GN & " Mode = " & Mode & " Teams = " & Teams

AddChat vbBlue, "Deleting all records from Game ..."
l = db.ExecuteQuery("DELETE FROM Game")
AddChat vbBlue, "Deleted "

GameOn = 0
Teams = 0
Mode = 0

End Sub

'*****************
'***Cancel Game***
'*****************

Sub ngoc_Cancel

If GameOn = 0 Then
Exit Sub
End If

AddChat vbBlue, "Deleting all records from Game ..."
l = db.ExecuteQuery("DELETE FROM Game")
AddChat vbBlue, "Deleted "

GameOn = 0
Teams = 0
Mode = 0

End Sub




'*****************
'**Signed Up Func*
'*****************

Function SignUp(User)
Set rs = db.OpenRecordSet("SELECT * FROM Game ORDER BY Name", db_cModeReadOnly)
AddChat vbBlue, "Searching for a player ..."
rs.MoveFirst
rs.Find "Name='" & User & "'"
If Not rs.EOF Then
AddChat vbBlue, "Found player!"
SignUp = 1
Else
AddChat vbBlue, "Could not find player!"
SignUp = 0
End If
End Function



'******************
'**J3M's CLass*****
'******************


Class db_clsDatabase

Private path_, conn_, xconn_

Public Function Exists(path)
Dim fso
Exists = False
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(path) Then
Exists = True
End If
Set fso = Nothing
End Function

Public Function Close()
If Not conn_ Is Nothing Then
If IsOpen() Then
conn_.Close
End If
Set conn_ = Nothing
End If
Close = True
End Function

Public Function IsOpen()
IsOpen = False
If Not conn_ Is Nothing Then
If conn_.State = 1 Then
IsOpen = True
End If
End If
End Function

Public Function Open(path)
On Error Resume Next
Close()
Open = False
path_ = path
Set conn_ = CreateObject("ADODB.Connection")
conn_.Provider = "Microsoft.Jet.OLEDB.4.0"
conn_.Open path_
If IsOpen() Then
Set xconn_ = CreateObject("ADOX.Catalog")
xconn_.ActiveConnection = conn_
Open = True
End If
If Err.Number <> 0 Then
AddChat vbRed, "Error in Open('" & path & "'): " & Err.Description
Err.Clear
End If
End Function

Public Function Create(path)
On Error Resume Next
Dim obj_
Close()
Set obj_ = CreateObject("ADOX.Catalog")
obj_.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Jet OLEDB:Engine Type=5;Data Source=" & path
Set obj_ = Nothing
Create = Open(path)
If Err.Number <> 0 Then
AddChat vbRed, "Error in Create('" & path & "'): " & Err.Description
Err.Clear
End If
End Function

Public Function TableExists(tabname)
Dim i
TableExists = False
If Not IsOpen() Then Exit Function
If xconn_.Tables.Count = 0 Then Exit Function
For i = 0 To xconn_.Tables.Count - 1
If UCase(tabname) = UCase(xconn_.Tables(i).Name) Then
TableExists = True
Exit Function
End If
Next
End Function

Public Function ColumnExists(tabname, colname)
Dim i, t
ColumnExists = False
If Not IsOpen() Then Exit Function
If Not TableExists(tabname) Then Exit Function
Set t = xconn_.Tables(tabname)
If t.Columns.Count = 0 Then Exit Function
For i = 0 To t.Columns.Count - 1
If UCase(colname) = UCase(t.Columns(i).Name) Then
ColumnExists = True
Exit Function
End If
Next
End Function

Public Function CreateTable(tabname)
On Error Resume Next
Dim tbl_
If Not IsOpen() Then Exit Function
If TableExists(tabname) Then Exit Function
Set tbl_ = CreateObject("ADOX.Table")
tbl_.Name = tabname
xconn_.Tables.Append tbl_
CreateTable = True
If Err.Number <> 0 Then
AddChat vbRed, "Error in CreateTable('" & tabname & "'): " & _
Err.Description
Err.Clear
End If
End Function

Public Property Get Table(tabname)
On Error Resume Next
Dim tbl_
Set tbl_ = Nothing
If IsOpen() Then
Set tbl_ = xconn_.Tables(tabname)
End If
Set Table = tbl_
If Err.Number <> 0 Then
AddChat vbRed, "Error in Table('" & tabname & "'): " & Err.Description
Err.Clear
End If
End Property

Public Function OpenRecordset(sql, mode)
On Error Resume Next
Dim rs_
Set OpenRecordset = Nothing
If Not IsOpen() Then Exit Function
Set rs_ = CreateObject("ADODB.Recordset")
rs_.ActiveConnection = conn_
Select Case mode
Case db_cModeReadOnly
rs_.CursorType = 2 ' adOpenStatic
rs_.LockType = 1 ' adLockReadOnly
Case db_cModeForUpdate
rs_.CursorType = 1 ' adOpenKeyset
rs_.LockType = 3 ' adLockOptimistic
Case Else
rs_.CursorType = 0 ' adOpenForwardOnly
rs_.LockType = 1 ' adLockReadOnly
End Select
rs_.Source = sql
rs_.Open
If Err.Number <> 0 Then
AddChat vbRed, "Error in OpenRecordSet('" & sql & "', " & _
mode & "): " & Err.Description
Err.Clear
Exit Function
End If
Set OpenRecordset = rs_
End Function

Public Function ExecuteQuery(sql)
On Error Resume Next
Dim rs_, rows_affected
ExecuteQuery = 0
If Not IsOpen() Then Exit Function
Set rs_ = conn_.Execute(sql, rows_affected)
ExecuteQuery = rows_affected
If Err.Number <> 0 Then
AddChat vbRed, "Error in ExecuteQuery('" & sql & "'): " & Err.Description
Err.Clear
End If
End Function

End Class

Private Sub Class_Initialize()
path_ = BotPath() & "plugins\NGOCData.mdb"
Set conn_ = Nothing
Set xconn_ = Nothing
End Sub
Private Sub Class_Terminate()
Close()
Set conn_ = Nothing
Set xconn_ = Nothing
End Sub


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
riffruff
post Dec 22 2007, 07:41 PM
Post #62


I riffruff
********

Group: Sr. Members
Posts: 3,727
Joined: 19-February 06
From: USA
Member No.: 278



I don't really understand how the database tutorial works -- so I don't use it anymore...I think it's easier to just write everything yourself, and not use the database class...(short story is I have no clue why theres an error on the open)


--------------------
What you should tell your girlfriend...
QUOTE
ALL men see in only 16 colors, like Windows default settings. Peach, for example, is a fruit, not a color. Pumpkin is also a fruit. We have no idea what mauve is.

QUOTE
Women, learn to work the toilet seat. You're a big girl. If it's up, put it down. We need it up, you need it down. You don't hear us complaining about you leaving it down.

http://riffruff.mybrute.com
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Dec 23 2007, 07:57 PM
Post #63


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



O.k. how about we screw the database class in open (and some other places) But use it in other spots.

Could you even do it yourself & use class?


Added Pool Commands

http://rafb.net/p/2MElac78.html

CODE
'ngoc
'0.06

'By Hero.A ~
'Set Clan to your clan and security to the number i give you!
Public Clan, Security
Clan = "You Clan Tag Here"
Security = "10" 'Put the number from me here!

'************************
'*******Variables*********
'**For Database and Code**
'*************************

Private Const db_cTypeBoolean = 11
Private Const db_cTypeCurrency = 6
Private Const db_cTypeDate = 7
Private Const db_cTypeDouble = 5
Private Const db_cTypeInteger = 3
Private Const db_cTypeText = 202

Private Const db_cModeReadOnly = 1
Private Const db_cModeForUpdate = 2


Public Compare, Confirm, GameOn, SignedUp, SignedAmnt, Data, Teams, Mode



Sub ngoc_Event_Load()

AddChat vbBlue, "Welcome to the NGOC Game Script By: Hero.A Ver: 1.0"
AddChat vbBlue, "Most messages in blue are this script working. (it may show messages you do not understand)"


TimerInterval "ngoc", "StartGame", 5
TimerEnabled "ngoc", "StartGame", FALSE

Dim db, t, db_path, rs, l

Set db = New db_clsDatabase
db_path = BotPath() & "plugins\NGOCData.mdb"


'***************************
'**Setting Up the Database**
'***************************

If not db.Exists(db_path) Then
If Not db.Create(db_path) Then
AddChat vbRed, "Unable to Create Database!"
Exit Sub
End If
Else
If Not db.Open(db_path) Then
AddChat vbRed, "Unable to Open Database!"
Exit Sub
End If
End If

If db.IsOpen() Then
AddChat vbBlue, "Database opened."
Else
Exit Sub
End If

If Not db.TableExists("Game") Then
If db.CreateTable("Game") Then
AddChat vbBlue, "Created Table Game"
Else
AddChat vbRed, "Could not create Table Game"
Exit Sub
End If
End If


Set t = db.Table("Game")
If Not db.ColumnExists(t.Name, "Name") Then
t.Columns.Append "Name", db_cTypeText, 32
AddChat vbBlue, "Created Column Name"
End If
AddChat vbBlue, "Deleting all records from Game ..."
l = db.ExecuteQuery("DELETE FROM Game")
AddChat vbBlue, "Deleted "

End Sub

'************
'**Commands**
'************

Sub ngoc_event_usertalk(Username, Flags, Message, Ping)

If Left(Message, 1) = BotVars.Trigger Then
GetDBEntry Username, myAccess, myFlags
If myAccess >= 20 Then
If lcase(left(message, 5)) = BotVars.Trigger & "sign" Then
ngoc_Sign Username
ElseIf lcase(left(message, 4)) = BotVars.Trigger & "out" Then
ngoc_Out Username
ElseIf lcase(left(message, 10)) = BotVars.Trigger & "startgame " Then
ngoc_startgame Username, Message
ElseIf lcase(left(message, 8)) = BotVars.Trigger & "confirm" Then
ngoc_Confirm
ElseIf lcase(left(message, 11)) = BotVars.Trigger & "cancelgame" Then
ngoc_Cancel
ElseIF lcase(left(message, 5)) = BotVars.Trigger & "pool" Then
ngoc_pool
End If
End If
Else
Exit Sub
End If

End Sub


'**************
'***Pool Sub***
'**************

Sub ngoc_pool()
If GameOn = 0
Then
AddQ "There are no players to report!"
Exit Sub
End If
x = "Players: "
Set rs = db.OpenRecordSet("SELECT * FROM Game ORDER BY Name", db_cModeReadOnly)
Do While Not rs.EOF
x = x & rs("Name") & ", "
rs.MoveNext
Loop
DSP 1, x, vbBlue
End Sub

'**************
'***Sign Sub***
'**************

Sub ngoc_Sign(Username)

If GameOn = 0 Then
Exit Sub
End If

If SignedUp(Username) = 0 Then
AddQ "/me " & Username & " has signed into the game"
Set rs = db.OPenRecordSet("Game", db_cModeForUpdate)
rs.AddNew
rs("Name") = Username
rs.Update
rs.Close
SignedAmnt = SignedAmnt + 1
Else
Exit Sub
End If

End Sub


'*****************
'****Out Sub******
'*****************


Sub ngoc_Out(Username)

If GameOn = 0 Then
Exit Sub
End If

If SignUp(Username) = 1 Then
AddQ "/me " & Username & " has signed out of the game"
db.ExecuteQuery("DELETE FROM Game WHERE Name = '" & Username & "'")
SignedAmnt = SignedAmnt - 1
Else
Exit Sub
End If

End Sub


'******************
'**Start Game Sub**
'******************

Sub ngoc_startgame(Username, Message)

If GameOn = 0 Then
AddQ "Please Wait"
Exit Sub
End If

Data = Split(Message, " ")
Mode = Data(1)
Teams = Data(2)

AddChat vbBlue, "Checking Data..."
AddChat vbBlue, "Teams = " & Teams & " Mode = " & Mode

If lcase(Teams) <> "5v5" Then
If lcase(Teams) <> "4v4" Then
If lcase(teams) <> "1v1" Then
AddQ "Only 5v5 or 4v4 or 1v1 teams allowed"
Exit Sub
End If
End If

GameOn = 1
AddQ "Dota " & Mode & " game created by " & Username
AddQ "Use " & BotVars.Trigger & "sign to sign in and " & BotVars.Trigger & "out to signout"
TimerEnabled "ngoc", "StartGame", TRUE

End Sub

'********************
'**Start Game Timer**
'********************

Sub ngoc_StartGame_Timer()

If Teams = "5v5" Then
Compare = 10
ElseIf Teams = "4v4" Then
Compare = 8
ElseIF Teams = "1v1" Then
Compare = 2
End If

If Compare > SignedAmnt Then
TimerEnabled "NGOC", "StartGame", FALSE
AddChat vbBlue, "Lol we passed it"
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & "confirm to start the game"
ElseIf Compare = SignedAmnt Then
TimerEnabled "NGOC", "StartGame", FALSE
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & "confirm to start the game"
End If

End Sub

'************
'**Confirm***
'************

Sub ngoc_Confirm

If GameOn = 0 Then
Exit Sub
End If

GN = GN + 1
AddQ "Confirmed"
AddQ "GN = " & Clan & "" & GN & " Mode = " & Mode & " Teams = " & Teams

AddChat vbBlue, "Deleting all records from Game ..."
l = db.ExecuteQuery("DELETE FROM Game")
AddChat vbBlue, "Deleted "

GameOn = 0
Teams = 0
Mode = 0

End Sub

'*****************
'***Cancel Game***
'*****************

Sub ngoc_Cancel

If GameOn = 0 Then
Exit Sub
End If

AddChat vbBlue, "Deleting all records from Game ..."
l = db.ExecuteQuery("DELETE FROM Game")
AddChat vbBlue, "Deleted "

GameOn = 0
Teams = 0
Mode = 0

End Sub




'*****************
'**Signed Up Func*
'*****************

Function SignUp(User)
Set rs = db.OpenRecordSet("SELECT * FROM Game ORDER BY Name", db_cModeReadOnly)
AddChat vbBlue, "Searching for a player ..."
rs.MoveFirst
rs.Find "Name='" & User & "'"
If Not rs.EOF Then
AddChat vbBlue, "Found player!"
SignUp = 1
Else
AddChat vbBlue, "Could not find player!"
SignUp = 0
End If
End Function



'******************
'**J3M's CLass*****
'******************


Class db_clsDatabase

Private path_, conn_, xconn_

Public Function Exists(path)
Dim fso
Exists = False
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(path) Then
Exists = True
End If
Set fso = Nothing
End Function

Public Function Close()
If Not conn_ Is Nothing Then
If IsOpen() Then
conn_.Close
End If
Set conn_ = Nothing
End If
Close = True
End Function

Public Function IsOpen()
IsOpen = False
If Not conn_ Is Nothing Then
If conn_.State = 1 Then
IsOpen = True
End If
End If
End Function

Public Function Open(path)
On Error Resume Next
Close()
Open = False
path_ = path
Set conn_ = CreateObject("ADODB.Connection")
conn_.Provider = "Microsoft.Jet.OLEDB.4.0"
conn_.Open path_
If IsOpen() Then
Set xconn_ = CreateObject("ADOX.Catalog")
xconn_.ActiveConnection = conn_
Open = True
End If
If Err.Number <> 0 Then
AddChat vbRed, "Error in Open('" & path & "'): " & Err.Description
Err.Clear
End If
End Function

Public Function Create(path)
On Error Resume Next
Dim obj_
Close()
Set obj_ = CreateObject("ADOX.Catalog")
obj_.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Jet OLEDB:Engine Type=5;Data Source=" & path
Set obj_ = Nothing
Create = Open(path)
If Err.Number <> 0 Then
AddChat vbRed, "Error in Create('" & path & "'): " & Err.Description
Err.Clear
End If
End Function

Public Function TableExists(tabname)
Dim i
TableExists = False
If Not IsOpen() Then Exit Function
If xconn_.Tables.Count = 0 Then Exit Function
For i = 0 To xconn_.Tables.Count - 1
If UCase(tabname) = UCase(xconn_.Tables(i).Name) Then
TableExists = True
Exit Function
End If
Next
End Function

Public Function ColumnExists(tabname, colname)
Dim i, t
ColumnExists = False
If Not IsOpen() Then Exit Function
If Not TableExists(tabname) Then Exit Function
Set t = xconn_.Tables(tabname)
If t.Columns.Count = 0 Then Exit Function
For i = 0 To t.Columns.Count - 1
If UCase(colname) = UCase(t.Columns(i).Name) Then
ColumnExists = True
Exit Function
End If
Next
End Function

Public Function CreateTable(tabname)
On Error Resume Next
Dim tbl_
If Not IsOpen() Then Exit Function
If TableExists(tabname) Then Exit Function
Set tbl_ = CreateObject("ADOX.Table")
tbl_.Name = tabname
xconn_.Tables.Append tbl_
CreateTable = True
If Err.Number <> 0 Then
AddChat vbRed, "Error in CreateTable('" & tabname & "'): " & _
Err.Description
Err.Clear
End If
End Function

Public Property Get Table(tabname)
On Error Resume Next
Dim tbl_
Set tbl_ = Nothing
If IsOpen() Then
Set tbl_ = xconn_.Tables(tabname)
End If
Set Table = tbl_
If Err.Number <> 0 Then
AddChat vbRed, "Error in Table('" & tabname & "'): " & Err.Description
Err.Clear
End If
End Property

Public Function OpenRecordset(sql, mode)
On Error Resume Next
Dim rs_
Set OpenRecordset = Nothing
If Not IsOpen() Then Exit Function
Set rs_ = CreateObject("ADODB.Recordset")
rs_.ActiveConnection = conn_
Select Case mode
Case db_cModeReadOnly
rs_.CursorType = 2 ' adOpenStatic
rs_.LockType = 1 ' adLockReadOnly
Case db_cModeForUpdate
rs_.CursorType = 1 ' adOpenKeyset
rs_.LockType = 3 ' adLockOptimistic
Case Else
rs_.CursorType = 0 ' adOpenForwardOnly
rs_.LockType = 1 ' adLockReadOnly
End Select
rs_.Source = sql
rs_.Open
If Err.Number <> 0 Then
AddChat vbRed, "Error in OpenRecordSet('" & sql & "', " & _
mode & "): " & Err.Description
Err.Clear
Exit Function
End If
Set OpenRecordset = rs_
End Function

Public Function ExecuteQuery(sql)
On Error Resume Next
Dim rs_, rows_affected
ExecuteQuery = 0
If Not IsOpen() Then Exit Function
Set rs_ = conn_.Execute(sql, rows_affected)
ExecuteQuery = rows_affected
If Err.Number <> 0 Then
AddChat vbRed, "Error in ExecuteQuery('" & sql & "'): " & Err.Description
Err.Clear
End If
End Function

End Class

Private Sub Class_Initialize()
path_ = BotPath() & "plugins\NGOCData.mdb"
Set conn_ = Nothing
Set xconn_ = Nothing
End Sub
Private Sub Class_Terminate()
Close()
Set conn_ = Nothing
Set xconn_ = Nothing
End Sub


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Java-
post Dec 24 2007, 01:33 PM
Post #64


Veteran
**

Group: Members
Posts: 67
Joined: 18-November 07
Member No.: 30,637



Any update on this?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Dec 26 2007, 02:18 PM
Post #65


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



____________________________


I am going to totally rewrite this.

It will use a dictionary instead of a database.

It wil use Select Case for cmds.

I finally got a VB book ( The one recommended in the script creation forums) and its great!


________________________________

Beginning of the load sub allows you to customize commands

CODE

Option Explicit

Dim PersonalizeCmds
Dim dStartCmd
Dim dPoolCmd
Dim dSignCmd
Dim dOutCmd
Dim dCancelCmd
Dim dRanksOn
Dim dGameStatus
Dim FirstTime
FirstTime = "True"

Sub d_Event_Load()

If FirstTime = "True" Then

    PersonalizeCmds = MsgBox("Would you like to personalize the commands?", vbYesNo)

    If PersonalizeCmds = vbNo Then
        dStartCmd = "startgame"
        dPoolCmd = "pool"
        dSignCmd = "sign"
        dOutCmd = "out"
        dCancelCmd = "cancel"
     ElseIf PersonalizeCmds = vbYes Then
        dStartCmd = InputBox("Please enter a command for starting games (ALL LOWER CASE PLEASE). If you wish to leave this command as default leave this blank.
        If IsEmpty(dStartCmd) OR dStartCmd = " " Then
            dStartCmd = "startgame"
        End If
        dPoolCmd = InputBox("Please enter a command for showing players that are signed in. Leave blank for defualt")
        If IsEmpty(dPoolCmd) OR dPoolCmd = " " Then
            dPoolCmd = "pool"
        End If
        dSignCmd = InputBox("Please enter a command for siging into the game. Leave blank for default")
        If IsEmpty(dSignCmd) OR dSignCmd = " " Then
            dSignCmd = "sign"
        End If
        dOutCmd = InputBox("Please enter a command for exiting the game once signed in. Leave blank for default")
        If IsEmpty(dOutCmd) OR dOutCmd = " " Then
            dOutCmd = "out"
        End If
        dCancelCmd = InputBox("Please enter a command for canceling the game once started. Leave blank for default")
        If IsEmpty(dCancelCmd) OR dCancelCmd = " " THen
            dCancelCmd = "cancel
        End If
    Dim CmdsMsg
    CmdsMsg = "Your Commands Are : " & vbNewLine
    CmdsMsg = CmdsMsg + "StartGame : " & dStartCmd & vbNewLine
    CmdsMsg = CmdsMsg + "CancelGame : & dCancelCmd & vbNewLine
    CmdsMsg = CmdsMsg + "SignOut : " & dOutCmd & vbNewLine
    CmdsMsg = CmdsMsg + "Signin : " & dSignCmd & vbNewLine
    CmdsMsg = CmdsMsg + "Players Signed : " & dPoolCmd & vbNewLine
    
    MsgBox CmdsMsg
                
                RanksOn = MsgBox("Would you like to use the ranking system?", vbYesNo)
                If RanksOn = vbYes Then
                    RanksOn = "True"
                ElseIf RanksOn = vbNo Then
                    RanksOn = "False"
                End If

    
    FirstTime = "False"

ElseIf FirstTime = "False" Then


This post has been edited by Hero.A: Dec 26 2007, 02:22 PM


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
riffruff
post Dec 26 2007, 04:53 PM
Post #66


I riffruff
********

Group: Sr. Members
Posts: 3,727
Joined: 19-February 06
From: USA
Member No.: 278



You do realize that all settings will be erased each time the script is reloaded?


--------------------
What you should tell your girlfriend...
QUOTE
ALL men see in only 16 colors, like Windows default settings. Peach, for example, is a fruit, not a color. Pumpkin is also a fruit. We have no idea what mauve is.

QUOTE
Women, learn to work the toilet seat. You're a big girl. If it's up, put it down. We need it up, you need it down. You don't hear us complaining about you leaving it down.

http://riffruff.mybrute.com
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Java-
post Dec 26 2007, 06:13 PM
Post #67


Veteran
**

Group: Members
Posts: 67
Joined: 18-November 07
Member No.: 30,637



Is that totally complete?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Dec 28 2007, 02:54 AM
Post #68


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



QUOTE(Hero.A @ Dec 26 2007, 02:18 PM) *

____________________________


I am going to totally rewrite this.

It will use a dictionary instead of a database.

It wil use Select Case for cmds.

I finally got a VB book ( The one recommended in the script creation forums) and its great!


________________________________

Beginning of the load sub allows you to customize commands

CODE

Option Explicit

Dim PersonalizeCmds
Dim dStartCmd
Dim dPoolCmd
Dim dSignCmd
Dim dOutCmd
Dim dCancelCmd
Dim dRanksOn
Dim dGameStatus
Dim FirstTime

Sub d_Event_Load()

If IsEmpty(FirstTime) Then

    PersonalizeCmds = MsgBox("Would you like to personalize the commands?", vbYesNo)

    If PersonalizeCmds = vbNo Then
        dStartCmd = "startgame"
        dPoolCmd = "pool"
        dSignCmd = "sign"
        dOutCmd = "out"
        dCancelCmd = "cancel"
     ElseIf PersonalizeCmds = vbYes Then
        dStartCmd = InputBox("Please enter a command for starting games (ALL LOWER CASE PLEASE). If you wish to leave this command as default leave this blank.
        If IsEmpty(dStartCmd) OR dStartCmd = " " Then
            dStartCmd = "startgame"
        End If
        dPoolCmd = InputBox("Please enter a command for showing players that are signed in. Leave blank for defualt")
        If IsEmpty(dPoolCmd) OR dPoolCmd = " " Then
            dPoolCmd = "pool"
        End If
        dSignCmd = InputBox("Please enter a command for siging into the game. Leave blank for default")
        If IsEmpty(dSignCmd) OR dSignCmd = " " Then
            dSignCmd = "sign"
        End If
        dOutCmd = InputBox("Please enter a command for exiting the game once signed in. Leave blank for default")
        If IsEmpty(dOutCmd) OR dOutCmd = " " Then
            dOutCmd = "out"
        End If
        dCancelCmd = InputBox("Please enter a command for canceling the game once started. Leave blank for default")
        If IsEmpty(dCancelCmd) OR dCancelCmd = " " THen
            dCancelCmd = "cancel
        End If
    Dim CmdsMsg
    CmdsMsg = "Your Commands Are : " & vbNewLine
    CmdsMsg = CmdsMsg + "StartGame : " & dStartCmd & vbNewLine
    CmdsMsg = CmdsMsg + "CancelGame : & dCancelCmd & vbNewLine
    CmdsMsg = CmdsMsg + "SignOut : " & dOutCmd & vbNewLine
    CmdsMsg = CmdsMsg + "Signin : " & dSignCmd & vbNewLine
    CmdsMsg = CmdsMsg + "Players Signed : " & dPoolCmd & vbNewLine
    
    MsgBox CmdsMsg
                
                RanksOn = MsgBox("Would you like to use the ranking system?", vbYesNo)
                If RanksOn = vbYes Then
                    RanksOn = "True"
                ElseIf RanksOn = vbNo Then
                    RanksOn = "False"
                End If

    
    FirstTime = "False"

Else Then




No this int the final code this is just an idea to allow personalization of commands.
I have a lot more written then i have here but i am going to be a little more finalized before i post it

I am using a txt document (FSO and such) to keep track of things. Really the only thing i need to know is how to delete the contents of an entire txt document.

Umm yeah so i wrote a lot more but this is still not going to work for anyone
CODE

'd
'.7
'Made by Hero.A
'//CHANGELOG//
'//Operational At 1.0

'//0.7 - Added most Command subs
'//0.6 - Added Ability to Personalize Cmds -
'//0.5 - Added Case for Commands
'//Help//
'Commands can be seen by typing .dcmds or /dcmds from inside bot (Your trigger instead of ".")
'To edit the commands inside the script go to the Sub d_LoadNoPersonalize
'


Dim PersonalizeCmds
Dim dStartCmd
Dim dPoolCmd
Dim dSignCmd
Dim dOutCmd
Dim dCancelCmd
Dim dConfirmCmd
Dim dShowCmds
Dim dRanksOn
Dim dGameStatus
Dim FirstTime
Dim dFSO, dPStream, line
Dim dmsg, Cmd, InBot
Dim GN, Clan
Dim TeamsAllowed
GN = 1

StartCmd_access = 20
PoolCmd_access = 0
SignCmd_access = 0
OutCmd_access = 0
CancelCmd_access = 0
ShowCmds_access = 0
ConfirmCmd_access = 0




'//On Load Of Script//

Sub d_Event_Load()

'//Personalize commands if wanted.

If IsEmpty(FirstTime) Then

PersonalizeCmds = MsgBox("Would you like to personalize the commands?", vbYesNo)

If PersonalizeCmds = vbNo Then
dStartCmd = "startgame"
dPoolCmd = "pool"
dSignCmd = "sign"
dOutCmd = "out"
dCancelCmd = "cancel"
d_LoadNoPersonalize()
ElseIf PersonalizeCmds = vbYes Then
dStartCmd = InputBox("Please enter a command for starting games (ALL LOWER CASE PLEASE). If you wish to leave this command as default leave this blank.
If IsEmpty(dStartCmd) OR dStartCmd = " " Then
dStartCmd = "startgame"
End If
dPoolCmd = InputBox("Please enter a command for showing players that are signed in. Leave blank for defualt")
If IsEmpty(dPoolCmd) OR dPoolCmd = " " Then
dPoolCmd = "pool"
End If
dSignCmd = InputBox("Please enter a command for siging into the game. Leave blank for default")
If IsEmpty(dSignCmd) OR dSignCmd = " " Then
dSignCmd = "sign"
End If
dOutCmd = InputBox("Please enter a command for exiting the game once signed in. Leave blank for default")
If IsEmpty(dOutCmd) OR dOutCmd = " " Then
dOutCmd = "out"
End If
dConfirmCmd = InputBox("Please enter a command for confirming the game. Leave blank for default")
If IsEmpty(dConfirmCmd) OR dConfirmCmd = " " Then
dConfirmCmd = "confirm"
End If
dChallengeCmd = InputBox("Please enter a command for challenging users. Leave blank for default")
If IsEmpty(dChallengeCmd) Or dChallengeCmd = " " Then
dChallengeCmd = "challenge"
End If
dCancelCmd = InputBox("Please enter a command for canceling the game once started. Leave blank for default")
If IsEmpty(dCancelCmd) OR dCancelCmd = " " THen
dCancelCmd = "cancel"
End If
Dim CmdsMsg
CmdsMsg = "Your Commands Are : " & vbNewLine
CmdsMsg = CmdsMsg + "StartGame : " & dStartCmd & vbNewLine
CmdsMsg = CmdsMsg + "CancelGame : & dCancelCmd & vbNewLine
CmdsMsg = CmdsMsg + "SignOut : " & dOutCmd & vbNewLine
CmdsMsg = CmdsMsg + "Signin : " & dSignCmd & vbNewLine
CmdsMsg = CmdsMsg + "Players Signed : " & dPoolCmd & vbNewLine

MsgBox CmdsMsg

Do While IsEmpty(Clan) OR Clan = " "
Clan = InputBox("Enter your clan name")
Loop

RanksOn = MsgBox("Would you like to use the ranking system?", vbYesNo)
If RanksOn = vbYes Then
RanksOn = "True"
ElseIf RanksOn = vbNo Then
RanksOn = "False"
End If

FirstTime = "False"
d_LoadNoPersonalize()

Else FirstTime = "False"
d_LoadNoPersonalize()

End Sub




'//Load without Personalize - Normal Load//

Sub d_LoadNoPersonalize()

AddChat vbBlue, "Welcome to the dota script. You have version 0.7"

'// Edit Commands INSIDE Script - This will overwrite choices in Personalization of cmds
dCancelCmd = dCancelCmd
dSignCmd = dSignCmd
dStartCmd = dStartCmd
dOutCmd = dOutCmd
dPoolCmd = dPoolCmd
dShowCmds = "dcmds"
dConfirmCmd = dConfirmCmd
dChallengeCmd = dChallengeCmd


Set dFSO = '// Not sure what I am using - Textfile or dictionary
Set dPStream = '// Above

End Sub




'//Commands//

Sub d_Event_Usertalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> Bot.Username Then
If Left(Message, 1) <> "/" Then
Exit Sub
End If
Else
If Left(Message, 1) <> BotVars.Trigger Then
Exit Sub
End If
End If

If Len(Message) < 2 Then Exit Sub
If InStr(Trim(Message), " ") = 0 Then
dmsg = Message & " "
Else
dmsg = Message
End If

If Left(Message, 1) = "/" Then
InBot = "True"
End If

Cmd = Split(Mid(Time(dmsg), 2))

Select Case LCase(Cmd(0))
Case dStartCmd
d_StartCmd Cmd, Username, myAccess, InBot
Case dCancelCmd
d_CancelCmd Cmd, Username, myAccess, InBot
Case dSignCmd
d_SignCmd Cmd, Username, myAccess, InBot
Case dOutCmd
d_OutCmd Cmd, Username, myAccess, InBot
Case dShowCmds
d_ShowCmds Cmd, Username, myAccess, InBot
Case dChallengeCmd
d_ChallengeCmd Cmd, Username, myAccess, InBot
End Select

End Sub





Sub d_ShowCmds(Cmd, Username, myAccess, InBot)


If InBot = "True" Then
AddChat vbBlue, "The Commands are: " & dSignCmd & " , " & dOutCmd & " , " & dCancelCmd & " , " & dPoolCmd & " , " & dStartCmd
Exit Sub
End If

If NOT myAccess >= ShowCmds_access Then
Exit Sub
End If


AddQ "The Commands are: " & dSignCmd & " , " & dOutCmd & " , " & dCancelCmd & " , " & dPoolCmd & " , " & dStartCmd

End Sub






Sub d_StartCmd(Cmd, Username, myAccess, InBot)

If InBot = "True" Then
AddChat vbRed. "Sorry you can't use this command in-bot"
Exit Sub
End If

If NOT myAccess >= StartCmds_access Then
Exit Sub
End If

Teams = Cmd(1)
Mode = Cmd(2)
Host = Username

If Mode = " " OR IsEmpty(Mode) OR Teams = " " OR IsEmpty(Teams) Then
AddChat vbRed, "Improper Command Use"
AddQ "Please use the command like so " & BotVars.Trigger & dStartCmd & " <Teams> <Mode>"
End If

AreTeamsAllowed(Teams)

GameOn = "Startgame"

AddQ "A League Game is about to begin! This is a " & Teams & " " & Mode & " game"

TimerEnabled "d", "startgame", True

End Sub







Sub d_Confirm(Cmd, Username, myAccess, InBot)

If InBot = "True" Then
AddChat vbRed, "This command cannot be used from inside the bot"
Exit Sub
End If

If IsEmpty(GameOn) Then
Exit Sub
End If

If Username <> Host Then
Exit Sub
End If


GN = GN + 1
AddQ "Confirmed"
AddQ "GN = " & Clan & GN & " This is a " & Teams & " " & Mode & " game. Created by " & Host

ReDim Gameon
ReDim Teams
ReDim Mode

End Sub




Sub d_Challenge(Cmd, Username, myAccess, InBot)


End Sub






'//Timer for startgame

Sub d_StartGame_Timer()

If Teams = "5v5" Then
Compare = 10
ElseIf Teams = "4v4" Then
Compare = 8
ElseIF Teams = "1v1" Then
Compare = 2
End If

If Compare > SignedAmnt Then
TimerEnabled "d", "startgame", FALSE
AddChat vbRed, "Passed the sign ammount"
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & dConfirmCmd & " to start the game"
ElseIf Compare = SignedAmnt Then
TimerEnabled "d", "startgame", FALSE
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & dConfirmCmd & " to start the game"
End If

End Sub


'//Custom Functions

Function AreTeamsAllowed(Teams)

If Teams <> "4v4" OR Teams <> "5v5 OR Teams <> "1v1" Then
AddChat vbRed, "Error the teams are not allowed"
AddQ "Please use 4v4 5v5 or 1v1 for teams"
TeamsAllowed = "False"
End If

End Function


Instead of fso ima use a dictionary. Made some functions

CODE


Set dicPlayers = CreateObject("Scripting.Dictionary")
Set dicScores = CreateObject("Scripting.Dictionary")


CODE


Function AddToPlayers(Username)

If Not dicPlayers.Exists(Username)
    dicPlayers.Item(Username) = Username
End If

End Function

Function RemoveFromPlayers(Username)

If dicPlayers.Exists(Username) Then
    dicPlayers.Remove(Username)
End If

End Function

Function ClearPlayers()

dicPlayers.RemoveAll()

End Function

Function calculatescore(Username, Score)

If dicScores.Exists(Username) Then

    curscore = dicScores.Item(Username)
    Score = curscore + Score

Else
Exit Function
End If

End Function

Function SetScore(Username, Score)

dicScores.Item(Username) = Score

End Function


Implimented some of the functions above

CODE

'd
'Version 0.72
'Made by Hero.A
'//CHANGELOG//
'//Operational At 1.0
'//0.72 Implimented some functions into code
'//0.7 - Set up Dict. Made Custom functions for Dict Scores/Players
'//0.6 - Added Ability to Personalize Cmds -
'//0.5 - Added Case for Commands
'//Help//
'Commands can be seen by typing .dcmds or /dcmds from inside bot (Your trigger instead of ".")
'To edit the commands inside the script go to the Sub d_LoadNoPersonalize
'


Dim PersonalizeCmds
Dim dStartCmd
Dim dPoolCmd
Dim dSignCmd
Dim dOutCmd
Dim dCancelCmd
Dim dConfirmCmd
Dim dShowCmds
Dim dRanksOn
Dim dGameStatus
Dim FirstTime
Dim dFSO, dPStream, line
Dim dmsg, Cmd, InBot
Dim GN, Clan
Dim TeamsAllowed
Dim dicPlayers, dicScores
Dim Score, curscore
GN = 1

StartCmd_access = 20
PoolCmd_access = 0
SignCmd_access = 0
OutCmd_access = 0
CancelCmd_access = 0
ShowCmds_access = 0
ConfirmCmd_access = 0




'//On Load Of Script//

Sub d_Event_Load()

'//Personalize commands if wanted.

If IsEmpty(FirstTime) Then

PersonalizeCmds = MsgBox("Would you like to personalize the commands?", vbYesNo)

If PersonalizeCmds = vbNo Then
dStartCmd = "startgame"
dPoolCmd = "pool"
dSignCmd = "sign"
dOutCmd = "out"
dCancelCmd = "cancel"
d_LoadNoPersonalize()
ElseIf PersonalizeCmds = vbYes Then
dStartCmd = InputBox("Please enter a command for starting games (ALL LOWER CASE PLEASE). If you wish to leave this command as default leave this blank.
If IsEmpty(dStartCmd) OR dStartCmd = " " Then
dStartCmd = "startgame"
End If
dPoolCmd = InputBox("Please enter a command for showing players that are signed in. Leave blank for defualt")
If IsEmpty(dPoolCmd) OR dPoolCmd = " " Then
dPoolCmd = "pool"
End If
dSignCmd = InputBox("Please enter a command for siging into the game. Leave blank for default")
If IsEmpty(dSignCmd) OR dSignCmd = " " Then
dSignCmd = "sign"
End If
dOutCmd = InputBox("Please enter a command for exiting the game once signed in. Leave blank for default")
If IsEmpty(dOutCmd) OR dOutCmd = " " Then
dOutCmd = "out"
End If
dConfirmCmd = InputBox("Please enter a command for confirming the game. Leave blank for default")
If IsEmpty(dConfirmCmd) OR dConfirmCmd = " " Then
dConfirmCmd = "confirm"
End If
dChallengeCmd = InputBox("Please enter a command for challenging users. Leave blank for default")
If IsEmpty(dChallengeCmd) Or dChallengeCmd = " " Then
dChallengeCmd = "challenge"
End If
dCancelCmd = InputBox("Please enter a command for canceling the game once started. Leave blank for default")
If IsEmpty(dCancelCmd) OR dCancelCmd = " " THen
dCancelCmd = "cancel"
End If
Dim CmdsMsg
CmdsMsg = "Your Commands Are : " & vbNewLine
CmdsMsg = CmdsMsg + "StartGame : " & dStartCmd & vbNewLine
CmdsMsg = CmdsMsg + "CancelGame : & dCancelCmd & vbNewLine
CmdsMsg = CmdsMsg + "SignOut : " & dOutCmd & vbNewLine
CmdsMsg = CmdsMsg + "Signin : " & dSignCmd & vbNewLine
CmdsMsg = CmdsMsg + "Players Signed : " & dPoolCmd & vbNewLine

MsgBox CmdsMsg

Do While IsEmpty(Clan) OR Clan = " "
Clan = InputBox("Enter your clan name")
Loop

RanksOn = MsgBox("Would you like to use the ranking system?", vbYesNo)
If RanksOn = vbYes Then
RanksOn = "True"
ElseIf RanksOn = vbNo Then
RanksOn = "False"
End If

FirstTime = "False"
d_LoadNoPersonalize()

Else FirstTime = "False"
d_LoadNoPersonalize()

End Sub




'//Load without Personalize - Normal Load//

Sub d_LoadNoPersonalize()

AddChat vbBlue, "Welcome to the dota script."

'// Edit Commands INSIDE Script - This will overwrite choices in Personalization of cmds
dCancelCmd = dCancelCmd
dSignCmd = dSignCmd
dStartCmd = dStartCmd
dOutCmd = dOutCmd
dPoolCmd = dPoolCmd
dShowCmds = "dcmds"
dConfirmCmd = dConfirmCmd
dChallengeCmd = dChallengeCmd


Set dicPlayers = CreateObject("Scripting.Dictionary")
Set dicScores = CreateObject("Scripting.Dictionary")

End Sub




'//Commands//

Sub d_Event_Usertalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> Bot.Username Then
If Left(Message, 1) <> "/" Then
Exit Sub
End If
Else
If Left(Message, 1) <> BotVars.Trigger Then
Exit Sub
End If
End If

If Len(Message) < 2 Then Exit Sub
If InStr(Trim(Message), " ") = 0 Then
dmsg = Message & " "
Else
dmsg = Message
End If

If Left(Message, 1) = "/" Then
InBot = "True"
End If

Cmd = Split(Mid(Time(dmsg), 2))

Select Case LCase(Cmd(0))
Case dStartCmd
d_StartCmd Cmd, Username, myAccess, InBot
Case dCancelCmd
d_CancelCmd Cmd, Username, myAccess, InBot
Case dSignCmd
d_SignCmd Cmd, Username, myAccess, InBot
Case dOutCmd
d_OutCmd Cmd, Username, myAccess, InBot
Case dShowCmds
d_ShowCmds Cmd, Username, myAccess, InBot
Case dChallengeCmd
d_ChallengeCmd Cmd, Username, myAccess, InBot
End Select

End Sub





Sub d_ShowCmds(Cmd, Username, myAccess, InBot)


If InBot = "True" Then
AddChat vbBlue, "The Commands are: " & dSignCmd & " , " & dOutCmd & " , " & dCancelCmd & " , " & dPoolCmd & " , " & dStartCmd
Exit Sub
End If

If NOT myAccess >= ShowCmds_access Then
Exit Sub
End If


AddQ "The Commands are: " & dSignCmd & " , " & dOutCmd & " , " & dCancelCmd & " , " & dPoolCmd & " , " & dStartCmd

End Sub






Sub d_StartCmd(Cmd, Username, myAccess, InBot)

If InBot = "True" Then
AddChat vbRed. "Sorry you can't use this command in-bot"
Exit Sub
End If

If NOT myAccess >= StartCmds_access Then
Exit Sub
End If

Teams = Cmd(1)
Mode = Cmd(2)
Host = Username

If Mode = " " OR IsEmpty(Mode) OR Teams = " " OR IsEmpty(Teams) Then
AddChat vbRed, "Improper Command Use"
AddQ "Please use the command like so " & BotVars.Trigger & dStartCmd & " <Teams> <Mode>"
End If

AreTeamsAllowed(Teams)

GameOn = "Startgame"

AddQ "A League Game is about to begin! This is a " & Teams & " " & Mode & " game"

TimerEnabled "d", "startgame", True

End Sub







Sub d_Confirm(Cmd, Username, myAccess, InBot)

If InBot = "True" Then
AddChat vbRed, "This command cannot be used from inside the bot"
Exit Sub
End If

If IsEmpty(GameOn) Then
Exit Sub
End If

If Username <> Host Then
Exit Sub
End If


GN = GN + 1
AddQ "Confirmed"
AddQ "GN = " & Clan & GN & " This is a " & Teams & " " & Mode & " game. Created by " & Host

ReDim Gameon
ReDim Teams
ReDim Mode
ReDim Host

ClearPlayers

End Sub



Sub d_SignCmd(Cmd, Username, myAccess, InBot)
IsSignedUp Username
If GameOn = "Startgame" Then
If usersigned = "true" Then
Exit Sub
End If
AddToPlayers Username
SignedAmnt = SignedAmnt + 1
ElseIf GameOn = "Challenge" Then
If usersigned = "true" Then
Exit Sub
End If


Else
Exit Sub
End If

End Sub



Sub d_ChallengeCmd(Cmd, Username, myAccess, InBot)


End Sub






'//Timer for startgame

Sub d_StartGame_Timer()

If Teams = "5v5" Then
Compare = 10
ElseIf Teams = "4v4" Then
Compare = 8
ElseIF Teams = "1v1" Then
Compare = 2
End If

If Compare > SignedAmnt Then
TimerEnabled "d", "startgame", FALSE
AddChat vbRed, "Passed the sign ammount"
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & dConfirmCmd & " to start the game"
ElseIf Compare = SignedAmnt Then
TimerEnabled "d", "startgame", FALSE
AddQ "The game is full!!"
AddQ "Please type " & BotVars.Trigger & dConfirmCmd & " to start the game"
End If

End Sub


'//Custom Functions

Function AreTeamsAllowed(Teams)

If Teams <> "4v4" OR Teams <> "5v5 OR Teams <> "1v1" Then
AddChat vbRed, "Error the teams are not allowed"
AddQ "Please use 4v4 5v5 or 1v1 for teams"
TeamsAllowed = "False"
End If

End Function

Function AddToPlayers(Username)

If Not dicPlayers.Exists(Username)
dicPlayers.Item(Username) = Username
End If

End Function

Function RemoveFromPlayers(Username)

If dicPlayers.Exists(Username) Then
dicPlayers.Remove(Username)
End If

End Function

Function ClearPlayers()

dicPlayers.RemoveAll()

End Function

Function calculatescore(Username, Score)

If dicScores.Exists(Username) Then

curscore = dicScores.Item(Username)
Score = curscore + Score

Else
Exit Function
End If

End Function

Function SetScore(Username, Score)

dicScores.Item(Username) = Score

End Function


This post has been edited by Hero.A: Dec 28 2007, 02:55 AM


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Java-
post Dec 30 2007, 11:42 AM
Post #69


Veteran
**

Group: Members
Posts: 67
Joined: 18-November 07
Member No.: 30,637



Can it work now?

Gotta keep this up top.

Please stop spamming this topic. If the plugin is finished, Hero.A will post it. -PhiX
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 2 2008, 04:15 PM
Post #70


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



I was traveling over the weekend sorry. I am on version 0.94 and it will work on 1.0.

I'll post it soon.

I wrote it in a notebook so i will have to type it up

Some beta versions of commands. I need to figure out how to show the pool.

Hows this look for pool
CODE

totalkeys = dicPlayers.Count
akeys = dicPlayers.Keys()

S = "Pool: "

Do While totalkeys < -1
    S = S + akeys(0, totalkeys) & " , "
    totalkeys = totalkeys - 1
Loop

AddQ S


And Some Command Subs which i have to put in the final script still

CODE

Sub d_SignCmd(Cmd, Username, myAccess, InBot)

If InBot Then
    AddChat vbRed, "Sorry you cannot use that command from inside the bot"
    Exit Sub
End If

If myAccess < SignCmd_Access Then
    Exit Sub
End If

If GameOn = "Startgame" Then
    If dicPlayers.Exists(Username) Then
        Exit Sub
    End If
    PlayersItemAdd(NAME, 0) = Username
    PlayersItemAdd(TEAM, 0) = " "
    dicPlayers.Item(Username) = PlayersItemAdd
    AddQ Username & " has signed into the game"
ElseIf GameOn = "Challenge" Then
    If dicPlayers.Exits(Username) Then
        Exit Sub
    End If

    If Cmd(1) <> 1 AND Cmd(1) <> "Team 1" Then
        Exit Sub
    Else If Cmd(1) <> 2 AND Cmd(1) <> "Team 2" Then
        Exit Sub
    End If

    PlayersItemAdd(NAME, 0) = Username
    PlayersItemAdd(TEAM, 0) = Cmd(1)
    dicPlayers.Item(Username) = PlayersItemAdd
    AddQ Username & " has signed into the game on " & Cmd(1)

End If

End Sub

Sub d_OutCmd(Cmd, Username, myAccess, InBot)

If InBot Then
    AddChat vbRed, "Sorry this command cannot be used from within the bot"
End If

If dicPlayers.Exists(Username) Then
    dicPlayers.Remove(Username)
    AddQ Username & " has signed out of the game"
End If

End Sub

Sub d_startgame_Timer()

If GameOn = "Startgame" Then
    
    If Teams = "4v4" Then
        Teams = 8
    ElseIf Teams = "5v5" Then
        Teams = 10
    ElseIf Teams = "1v1"
        Teams = 2
    Else
        AddChat vbRed, "Error the Teams are invalid: " & Teams
    End If
    
    Count = dicPlayers.Count
    If Count >= Teams Then
        GameOn = "StartgameReady"
        AddQ "The game is ready to begin, type " & BotVars.Trigger & dConfirmCmd & " to start"
        TimerEnabled "d", "startgame", FALSE
    End If

ElseIf GameOn = "Challenge" Then
    
    If Teams = "4v4" Then
        Teams = 8
    ElseIf Teams = "5v5" Then
        Teams = 10
    ElseIf Teams = "1v1"
        Teams = 2
    Else
        AddChat vbRed, "Error the Teams are invalid: " & Teams
    End If

    If Count >= Teams Then
        GameOn = "ChallengeReady"
        AddQ "The game is ready to begin, type " & BotVars.Trigger & dConfirmCmd & " to start"
    Else
        Time = Time + 1
        If Time = 3 Then
             Time = 0
             ShowThePool '//Not Complete
        End If
    End If
End If

End Sub


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
TazWa
post Jan 3 2008, 08:44 AM
Post #71


Jr. Member
**

Group: Members
Posts: 17
Joined: 20-January 07
Member No.: 16,577



Hey im looking forward to this new dota script i really need it for my clan the other links for it don't work so whenever u can post a link for it would be great
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 03:55 PM
Post #72


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



The old links expired after a day. It isn't complete yet.

My parents (cruel parents) arn't giving me enough time to type it all up.

Should be done sometime before January is over though

So the challenge thing was really getting me stuck. I made a version that does

Startgame
sign
out
pool
docmds

Here's the code

CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Const ShowCmd = "docmds"
Const SignCmd = "sign"
Const OutCmd = "out"
Const PoolCmd = "pool"
Const StartCmd = "startgame"

'Command Access
Const StartCmd_access = "60"
Const SignCmd_access = "0"
Const OutCmd_access = "0"
Const PoolCmd_access = "20"
Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Const UseFlags = False

Const StartCmd_flags = " "
Const SignCmd_flags = " "
Const OutCmd_flags = " "
Const PoolCmd_flags = " "
Const ShowCmd_flags = " "

'////// Accual Coding //////'


Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome tothe DoTa Script by Hero.A: Version 1.1 No Challenge"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select
End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Theen Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "d", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


This is now ready for testing. I can't test it now and it will probobly have a few mistakes

You can turn on and off emote commands and you can use access or flags for commands

Fixed a few typos

CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Const ShowCmd = "docmds"
Const SignCmd = "sign"
Const OutCmd = "out"
Const PoolCmd = "pool"
Const StartCmd = "startgame"

'Command Access
Const StartCmd_access = "60"
Const SignCmd_access = "0"
Const OutCmd_access = "0"
Const PoolCmd_access = "20"
Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Const UseFlags = False

Const StartCmd_flags = " "
Const SignCmd_flags = " "
Const OutCmd_flags = " "
Const PoolCmd_flags = " "
Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome tothe DoTa Script by Hero.A: Version 1.1 No Challenge"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

msg = " "

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "d", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


Having Error on load. This is going to need debugging since i am a new coder and slightly sloppy at times

QUOTE(ClanNGOC)

[12:59:52 AM] Load Call Error On File> C:\Documents and Settings\Michael\Desktop\SB\StealthBot\plugins\do.plug
[12:59:52 AM] Error Number: 13 Description: Type mismatch


Do Extra spaces case errors??

Ex

CODE

AddChat          vbRed, "Error"


Set all constants to Public
Fixed error in timer

CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = "60"
Public Const SignCmd_access = "0"
Public Const OutCmd_access = "0"
Public Const PoolCmd_access = "20"
Public Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.1 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function



Added so when team 1 or 2 is full it wont let you sign into it

CODE

'do
'1.2

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = "60"
Public Const SignCmd_access = "0"
Public Const OutCmd_access = "0"
Public Const PoolCmd_access = "20"
Public Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.2 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
If Not Cmd(1) <> 1 AND SignAllowed1 Then AddQ "Team Full" Exit Sub
If Not Cmd(1) <> 2 AND SignAllowed2 Then AddQ "Team Full" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Dim, count1, count2
count1 = 0
count2 = 0

For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
count1 = count1 + 1
ElseIf x = 2 Then
count2 = count2 + 1

End If
Next

If count1 >= 5 Then
SignAllowed1 = False
Else
SignAllowed1 = True
End If

If count2 >= 5 Then
SignAllowed2 = False
End If


Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


I am not sure if i did my For Each In Statements right

For If statements like so

If Not Blah = "hi" AND Blah2 = "hi"

Would that mean they blah would have to be inequal and blah2 would havee to be inequal?

Or do i need a second not after the AND

This post has been edited by Hero.A: Jan 7 2008, 01:06 AM


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 04:26 PM
Post #73


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



QUOTE
I am not sure if i did my For Each In Statements right

They're structured correctly, not sure if they will error though.
QUOTE
For If statements like so

If Not Blah = "hi" AND Blah2 = "hi"

Would that mean they blah would have to be inequal and blah2 would have to be inequal? Or do i need a second not after the AND

Blah and Blah2 must not equal "hi". I'm pretty sure you can do it this way, it's less confusing:
CODE
If Not (Blah = "hi" AND Blah2 = "hi") Then...


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 05:13 PM
Post #74


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



QUOTE(Hero.A @ Jan 7 2008, 03:55 PM) *

The old links expired after a day. It isn't complete yet.

My parents (cruel parents) arn't giving me enough time to type it all up.

Should be done sometime before January is over though

So the challenge thing was really getting me stuck. I made a version that does

Startgame
sign
out
pool
docmds

Here's the code

CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Const ShowCmd = "docmds"
Const SignCmd = "sign"
Const OutCmd = "out"
Const PoolCmd = "pool"
Const StartCmd = "startgame"

'Command Access
Const StartCmd_access = "60"
Const SignCmd_access = "0"
Const OutCmd_access = "0"
Const PoolCmd_access = "20"
Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Const UseFlags = False

Const StartCmd_flags = " "
Const SignCmd_flags = " "
Const OutCmd_flags = " "
Const PoolCmd_flags = " "
Const ShowCmd_flags = " "

'////// Accual Coding //////'


Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome tothe DoTa Script by Hero.A: Version 1.1 No Challenge"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select
End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Theen Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "d", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


This is now ready for testing. I can't test it now and it will probobly have a few mistakes

You can turn on and off emote commands and you can use access or flags for commands

Fixed a few typos

CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Const ShowCmd = "docmds"
Const SignCmd = "sign"
Const OutCmd = "out"
Const PoolCmd = "pool"
Const StartCmd = "startgame"

'Command Access
Const StartCmd_access = "60"
Const SignCmd_access = "0"
Const OutCmd_access = "0"
Const PoolCmd_access = "20"
Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Const UseFlags = False

Const StartCmd_flags = " "
Const SignCmd_flags = " "
Const OutCmd_flags = " "
Const PoolCmd_flags = " "
Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome tothe DoTa Script by Hero.A: Version 1.1 No Challenge"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

msg = " "

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "d", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


Having Error on load. This is going to need debugging since i am a new coder and slightly sloppy at times

QUOTE(ClanNGOC)

[12:59:52 AM] Load Call Error On File> C:\Documents and Settings\Michael\Desktop\SB\StealthBot\plugins\do.plug
[12:59:52 AM] Error Number: 13 Description: Type mismatch


Do Extra spaces case errors??

Ex

CODE

AddChat          vbRed, "Error"


Set all constants to Public
Fixed error in timer

CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = "60"
Public Const SignCmd_access = "0"
Public Const OutCmd_access = "0"
Public Const PoolCmd_access = "20"
Public Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.1 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function



Added so when team 1 or 2 is full it wont let you sign into it

CODE

'do
'1.2

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = "60"
Public Const SignCmd_access = "0"
Public Const OutCmd_access = "0"
Public Const PoolCmd_access = "20"
Public Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.2 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
If Not Cmd(1) <> 1 AND SignAllowed1 Then AddQ "Team Full" Exit Sub
If Not Cmd(1) <> 2 AND SignAllowed2 Then AddQ "Team Full" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Dim, count1, count2
count1 = 0
count2 = 0

For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
count1 = count1 + 1
ElseIf x = 2 Then
count2 = count2 + 1

End If
Next

If count1 >= 5 Then
SignAllowed1 = False
Else
SignAllowed1 = True
End If

If count2 >= 5 Then
SignAllowed2 = False
End If


Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


I am not sure if i did my For Each In Statements right

For If statements like so

If Not Blah = "hi" AND Blah2 = "hi"

Would that mean they blah would have to be inequal and blah2 would havee to be inequal?

Or do i need a second not after the AND



--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 05:16 PM
Post #75


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Yes, you know how to use quotes. What are you asking?


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 05:17 PM
Post #76


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Accident i didnt mean to hit add reply

Fixed if
CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = "60"
Public Const SignCmd_access = "0"
Public Const OutCmd_access = "0"
Public Const PoolCmd_access = "20"
Public Const ShowCmd_access = "20"

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.1 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
If Not (Cmd(1) <> 1 AND SignAllowed1) Then AddQ "Team Full" Exit Sub
If Not (Cmd(1) <> 2 AND SignAllowed2) Then AddQ "Team Full" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Dim, count1, count2
count1 = 0
count2 = 0

For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
count1 = count1 + 1
ElseIf x = 2 Then
count2 = count2 + 1

End If
Next

If count1 >= 5 Then
SignAllowed1 = False
Else
SignAllowed1 = True
End If

If count2 >= 5 Then
SignAllowed2 = False
End If


Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 05:19 PM
Post #77


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



No worries smile.gif


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 05:48 PM
Post #78


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



It still errors on load. I am not sure about any other ones because i still have to dic my other bot (on a diff comp) before i can use my new one.

Anyone see why it errors. Heres error again

[5:47:53 PM] 2 plugins loaded. Type /plugins in the bot to view them. Type /phelp for help using them.
[5:47:53 PM] Type /updates in the bot to view updates and new plugins that are available for download
.
[5:47:53 PM] Load Call Error On File> C:\Documents and Settings\Michael\Desktop\SB\StealthBot\plugins\do.plug
[5:47:53 PM] Error Number: 13 Description: Type mismatch



--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 06:03 PM
Post #79


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



CODE
Public Const StartCmd_access = "60"
Public Const SignCmd_access = "0"
Public Const OutCmd_access = "0"
Public Const PoolCmd_access = "20"
Public Const ShowCmd_access = "20"

Remove the quotes, they don't have to be Public.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 06:11 PM
Post #80


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Lol fixed quotes.Public dont cause errors so i dont mind. I used copy/paste anyway

CODE
'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = 60
Public Const SignCmd_access = 0
Public Const OutCmd_access = 0
Public Const PoolCmd_access = 20
Public Const ShowCmd_access = 20

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject(Scripting.Dictionary)

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.1 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
If Not (Cmd(1) <> 1 AND SignAllowed1) Then AddQ "Team Full" Exit Sub
If Not (Cmd(1) <> 2 AND SignAllowed2) Then AddQ "Team Full" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Dim, count1, count2
count1 = 0
count2 = 0

For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
count1 = count1 + 1
ElseIf x = 2 Then
count2 = count2 + 1

End If
Next

If count1 >= 5 Then
SignAllowed1 = False
Else
SignAllowed1 = True
End If

If count2 >= 5 Then
SignAllowed2 = False
End If


Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function


Still errors though


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 06:18 PM
Post #81


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Change to:
QUOTE
Set dPlayers = CreateObject("Scripting.Dictionary")


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 06:23 PM
Post #82


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Fixed

CODE
'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = 60
Public Const SignCmd_access = 0
Public Const OutCmd_access = 0
Public Const PoolCmd_access = 20
Public Const ShowCmd_access = 20

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn

Set dPlayers = CreateObject("Scripting.Dictionary")

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.1 No Challenge Command"
End Sub

Sub do_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2)))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
If Not (Cmd(1) <> 1 AND SignAllowed1) Then AddQ "Team Full" Exit Sub
If Not (Cmd(1) <> 2 AND SignAllowed2) Then AddQ "Team Full" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Dim, count1, count2
count1 = 0
count2 = 0

For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
count1 = count1 + 1
ElseIf x = 2 Then
count2 = count2 + 1

End If
Next

If count1 >= 5 Then
SignAllowed1 = False
Else
SignAllowed1 = True
End If

If count2 >= 5 Then
SignAllowed2 = False
End If


Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function

Still errors. Normally i dont get this error normally its inside events. Doesnt thatmean the error is before load sub?

Edi: missing a ")" in usertalk. Fixed

This post has been edited by Hero.A: Jan 7 2008, 06:25 PM


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 06:26 PM
Post #83


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Yes, and you must make the dPlayers Public wink.gif

EDIT:

QUOTE
Sub do_Event_UserTalk(Username, Flags, Message, Ping)


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 06:28 PM
Post #84


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Fixed both oof thhose ninja. Thanks
CODE

'do
'1.1

'Dota Script by Hero.A
'This version cannot do challenges

'Commands ~ Defualt
'Sign <team> - Signs In to a team. Team is required use 1 or 2
'Out - SIgns Out
'Startgame <teams> <mode> - Starts game. Teams can be 4v4 5v5 or 1v1 mode cann be anything
'pool - shows current players
'domds - lists commands




'//////Settings!!///////'

'Commands can be changed here
Public Const ShowCmd = "docmds"
Public Const SignCmd = "sign"
Public Const OutCmd = "out"
Public Const PoolCmd = "pool"
Public Const StartCmd = "startgame"

'Command Access
Public Const StartCmd_access = 60
Public Const SignCmd_access = 0
Public Const OutCmd_access = 0
Public Const PoolCmd_access = 20
Public Const ShowCmd_access = 20

'Do you want to emote all dota commands
Public Const EmoteCmdsOn = False

'Use Flags instead of access?? If so please set all the flags for the commands
Public Const UseFlags = False

Public Const StartCmd_flags = " "
Public Const SignCmd_flags = " "
Public Const OutCmd_flags = " "
Public Const PoolCmd_flags = " "
Public Const ShowCmd_flags = " "

'////// Accual Coding //////'

Public msg, Cmd, Team1, Team2, key, GameOn
Public dPlayers
Set dPlayers = CreateObject("Scripting.Dictionary")

Sub do_Event_Load()
TimerInterval "do", "PlayerCount", 1
TimerEnabled "do", "PlayerCount", False
AddChat vbBlue, "Welcome to the DoTa Script ~ by Hero.A: Version 1.1 No Challenge Command"
End Sub

Sub do_Event_UserTalk(Username, Flags, Message, Ping)

GetDBEntry Username, myAccess, myFlags

If Not Username <> BotVars.Username Then
If Left(Message, 1) <> "/" Then Exit Sub
Else
If Left(Message, 1) <> BotVars.Trigger Then Exit Sub
End If

If Len(Message) < 2 Then Exit Sub

If InStr(Trim(Message, " ")) = 0 Then
msg = Message & " "
Else
msg = Message
End If

Cmd = Split(Mid(Trim(msg), 2)))
msg = " "

Select Case
Case StartCmd: do_Start Cmd, Username, myAccess, myFlags
Case SignCmd: do_Sign Cmd, Username, myAccess, myFlags
Case OutCmd: do_Out Cmd, Username, myAccess, myFlags
Case PoolCmd: do_Pool Cmd, Usernamee, myAccess, myFlags
Case ShowCmd: do_Shows Cmd, Username, myAccess, myFlags
End Select

End Sub

Sub do_Sign(Cmd, Username, myAccss, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the sign command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InStr(myFlags, SignCmd_flags) = 0 Then Exit Sub
Else
If myAccess < SignCmd_access Then Exit Sub
End If

If Not dPlayers.Exists(Username) Then
If Cmd(1) <> 1 OR Cmd(1) <> 2 Then AddChat vbRed, "In correct team use" Exit Sub
If Not (Cmd(1) <> 1 AND SignAllowed1) Then AddQ "Team Full" Exit Sub
If Not (Cmd(1) <> 2 AND SignAllowed2) Then AddQ "Team Full" Exit Sub
dPlayers.Item(Username) = Cmd(1)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed into team " & Cmd(1)
Else
AddQ Username & " has signed into team " & Cmd(1)
End If
End If

End Sub


Sub do_Out(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbRed, "You cannot use the out command from inside the bot"
Exit Sub
End If

If Not GameOn Then Exit Sub

If UseFlags Then
If InSt(myFlags, OutCmd_flags) = 0 Then Exit Sub
Else
If myAccess < OutCmd_access Then Exit Sub
End If

If dPlayers.Exists(Username) Then
dPlayers.Remove(Usename)
If EmoteCmdsOn Then
AddQ "/me " & Username & " has signed out of the game"
Else
AddQ Username & " has signed out of the game"
End If
End If

End Sub


Sub do_Pool(Cmd, Username, myAccess, myFlags)

If Not GameOn Then Exit Sub

If Username = BotVars.Username Then
msg = "The Current pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next
AddChat vbBlue, msg
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, PoolCmd_flags) = 0 Then Exit Sub
Else
If myAccess < PoolCmd_access Then Exit Sub
End If

msg = "The Current Pool is: "
For Each key In dPlayers.Keys()
msg = msg & key & ", "
Next

If EmoteCmdsOn Then
AddQ "/me " & msg
Else
AddQ msg
End If

msg = " "

End Sub


Sub do_Start(Cmd, Username, myAccess, myFlags)


If GameOn Then Exit Sub

If Username = BotVars.Username Then
AddChat vbRed, "You can't use the startgame command from inside the bot"
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, StartCmd_flags) = 0 Then Exit Sub
Else
If myAccess < StartCmd_access Then Exit Sub
End If

If Cmd(1) = "5v5" Then
Teams = 10
ElseIf Cmd(1) = "4v4" Then
Teams = 8
ElseIf Cmd(1) = "1v1" Then
Teams = 2
Else
AddChat vbRed, "Invalid startgame usage"
Exit Sub
End If

If EmoteCmdsOn Then
AddQ "/me a game is about to begin"
AddQ "/me This game is a " & Cmd(1) & " " & Cmd(2)
Else
AddQ "A game is about to begin"
AddQ "This game is a " & Cmd(1) & " " & Cmd(2)
End If

GameOn = True
Mode = Cmd(2)
TimerEnabledd "do", "PlayerCount", True

End Sub

Sub do_Show(Cmd, Username, myAccess, myFlags)

If Username = BotVars.Username Then
AddChat vbBlue, "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd & ", " & ShowCmd
Exit Sub
End If

If UseFlags Then
If InStr(myFlags, ShowCmd_flags) = 0 Then Exit Sub
Else
If myAccess < ShowCmd_access Then Exit Sub
End If

AddQ "The current commands are: " & StartCmd & ", " & OutCmd & ", " & SignCmd & ", " & PoolCmd ", " & ShowCmd

End Sub

Sub do_PlayerCount_Timer()
If NotGameOn
AddChat vbRed, "Game On Error"
AddChat vbRed, "Stopping timer...."
TimerEnabled "do", "PlayerCount", False
Exit Sub
End If

Dim, count1, count2
count1 = 0
count2 = 0

For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
count1 = count1 + 1
ElseIf x = 2 Then
count2 = count2 + 1

End If
Next

If count1 >= 5 Then
SignAllowed1 = False
Else
SignAllowed1 = True
End If

If count2 >= 5 Then
SignAllowed2 = False
End If


Count = dPlayers.Count()
If Count = Teams Then
If EmoteCmdsOn Then
AddQ "/me The game is full!! The game mode is " & Mode
dspTeams()
GameOn = False
msg = " "

Else
AddQ "The game is full!! The game mode is " & Mode
dsppTeams()
End If
End If

End Sub

Function dspTeams()

Team1 = "Team1: "
Team2 = "Team2: "


For Each key In dPlayers.Keys()

x = dPlayers.Item(key)
If x = 1 Then
Team1 = Team1 & key & ", "
ElseIf x = 2 Then
Team2 = Teams2 & key & ", "
End If

Next

AddQ Team1
AddQ Team2

Team1 = " "
Team2 = " "

End Function

Of course error xD
[6:28:56 PM] UserTalk Call Error On File> C:\Documents and Settings\Michael\Desktop\SB\StealthBot\plugins\do.plug
[6:28:56 PM] Error Number: 13 Description: Type mismatch
I thought i did allthe usertalk right. Must have somting missing though

And Load



This post has been edited by Hero.A: Jan 7 2008, 06:29 PM


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 06:32 PM
Post #85


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Okay, start commenting out your Public Const lines one by one, saving each time and reloading your script (if you're getting the error everytime you reload the script).

Also, what are you trying to do with this line
CODE
If InStr(Trim(Message, " ")) = 0 Then


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 06:37 PM
Post #86


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



That will addaspace to the end of the message being inspected.Is it unnessecary

Also just to check i blanked out all public constants before i did 1 by 1.

That didnt help


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 06:38 PM
Post #87


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



You just have it written wrong.
CODE
If InStr(Message, " ") Then
    msg = Message & " "
Else
    msg = Message
End If


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 06:39 PM
Post #88


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Wouldnt that add a space if there is one? should i make it If NOt?


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Jan 7 2008, 06:43 PM
Post #89


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



QUOTE
If InStr(Message, " ") Then '// Checks if anywhere within the Message if a space occurs, if True Then...
msg = Message & " " '// set msg equal to the entire Message and adds one space to the end
Else '// If there ISN'T a space anywhere within the message, then...
msg = Message '// Set msg equal to the original Message
End If


This post has been edited by The-Black-Ninja: Jan 7 2008, 06:44 PM


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Jan 7 2008, 06:50 PM
Post #90


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



You misunderstood me i wanted it to add a space if it didnt have one.



I dont think i really need that though.


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

17 Pages V < 1 2 3 4 5 > » 
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th November 2019 - 07:46 PM
Skin by Andrea
Website Legal Information | Hosted by LunarPages