help me please

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

shaun.scargall
Posts: 6
Joined: 2003-09-22 16:06

help me please

Post by shaun.scargall » 2003-09-23 14:18

:cry:

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

joakim_tosteberg
Forum Moderator
Posts: 587
Joined: 2003-05-07 07:38
Location: Sweden, Linkoping

Post by joakim_tosteberg » 2003-09-23 15:09

Are there supposed to be a smiley in the script?
Perhaps you should ahve ticked the box "Disable smilies in this post" befor you posted you post. :-)

shaun.scargall
Posts: 6
Joined: 2003-09-22 16:06

Re: help me please

Post by shaun.scargall » 2003-09-23 16:03

shaun.scargall wrote::cry:

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

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-09-23 20:13

here some pointers

users names can't have space in them, bots are kinda user too.
in your script it might be a CHR$(160) witch is ok, just make sure.

Code: Select all

LoggPath = "C:\Program Files\Direct Connect Hub\scripts" <---seem to miss a \ at the end

looking at the script it seem that the full path lock like:
C:\Program Files\Direct Connect Hub\scriptsoprules.txt.
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

Who is online

Users browsing this forum: Google [Bot] and 0 guests