i am haveing problems wit a small script i would like to use for some op rules in my dc hub v.1 its realy bugging.me
i have made sure the oprules.txt file is in the correct path
C:\Program Files\Direct Connect Hub\Scripts
i unstand that the oprules are supppose come up as an private message
when i type +oprules which is the command to read the op rules nothing happens.
please please can anyone help many thanks shaun
'
' This script find and reads a specific .txt file
' And displays the content as a private message
' Works great in addition to general bot
'
' add as many commands as nessesary just make sure the .txt file exists
' and that "(sTheText, 6)))" is correct (number of letters in the command
' Make sure the loggpath is correct
'
' Made by: Gadget and Manic_Depresiv_Santa
'
Dim sBotName, LoggPath
Sub Main()
sBotName="Op Rules" '<---- The HelperBots name
LoggPath = "C:\Program Files\Direct Connect Hub\scripts" '<---- Path to the .txt file
End Sub
Sub DataArival(curUser, sCurData)
If (Left(sCurdata, 1) = "<") Then
lPos = InStr(1, sCurData, "> ")
sTheText = Mid(sCurData, lPos + 2)
'------------------Only OPs can use these commands-------------------------------
if (lcase(Left(sTheText, 8))) = "+oprules" and curUser.bOperator = true then
curUser.PrivateMessage cstr(sBotName), cstr(Read("oprules.txt"))
End If
End If
End Sub
Function Read(TextFile)
Dim temp
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(LoggPath & TextFile, 1, false)
temp = a.ReadAll
a.Close
Set a = nothing
Set fs = nothing
Read = temp
End Function
can anyone help me please
Moderator: Moderators
-
Sedulus
- Forum Moderator
- Posts: 687
- Joined: 2003-01-04 14:32
1) you should never use spaces in nicks (sBotName)
2) you're trying to read a file called: "C:\Program Files\Direct Connect Hub\scriptsoprules.txt", I'm guessing that's not the intention..
try adding a \ to the LoggPath
2) you're trying to read a file called: "C:\Program Files\Direct Connect Hub\scriptsoprules.txt", I'm guessing that's not the intention..
try adding a \ to the LoggPath
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
-
shaun.scargall
- Posts: 6
- Joined: 2003-09-22 16:06
thanks i guess you mean liek this
thanks i guess you mean liek this
Sub Main()
sBotName="OpRules" '<---- The HelperBots name
LoggPath = "C:\Program Files\Direct Connect Hub\scripts\oprules.txt" '<---- Path to the .txt file
End Sub
Sub Main()
sBotName="OpRules" '<---- The HelperBots name
LoggPath = "C:\Program Files\Direct Connect Hub\scripts\oprules.txt" '<---- Path to the .txt file
End Sub
-
TheNOP
- Posts: 275
- Joined: 2003-07-08 02:41
- Location: Quebec
Re: thanks i guess you mean liek this
shaun.scargall wrote:thanks i guess you mean liek this
Sub Main()
sBotName="OpRules" '<---- The HelperBots name
LoggPath = "C:\Program Files\Direct Connect Hub\scripts\oprules.txt" '<---- Path to the .txt file
End Sub
Code: Select all
LoggPath = "C:\Program Files\Direct Connect Hub\scripts\unless you have modify the part that load the text file
your mod to the path would look like:
C:\Program Files\Direct Connect Hub\scripts\oprules.txtoprules.txt
Who is online
Users browsing this forum: Google [Bot] and 0 guests