I have now got my script up and running thanks to everyone that helped
but now as ask for more help
the script runs in the main chat window as an private message but can it be open in an private message window as i have a quizz running in the main chat and how can i do it
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
'------------------Users and OPs can use these commands-------------------------
if (lcase(Left(sTheText, 6))) = "+rules" then
curUser.PrivateMessage cstr(sBotName), cstr(Read("rules.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
my script up and running but now i ask for more help please
Moderator: Moderators
-
- Posts: 6
- Joined: 2003-09-22 11:06
yes, you can, type something like:
and the bot will appear as an operator
i have seen this syntax in other bots
frmHub.RegisterBotName cStr(sBotName)
ask scripters about differences
Code: Select all
Sub Main()
sBotName="Op_Rules" '<---- The HelperBots name
LoggPath = "C:\Program Files\Direct Connect Hub\scripts\" '<---- Path to the .txt file
frmHub.RegisterBotName(sBotName) <-----THIS
End Sub
i have seen this syntax in other bots
frmHub.RegisterBotName cStr(sBotName)
ask scripters about differences
Hi hi hoo
Code: Select all
frmHub.RegisterBotName(sBotName)
Code: Select all
frmHub.RegisterBotName("yourbotname")
Code: Select all
frmHub.RegisterBotName cStr(sBotName)
allow you to reference the bot tru the script by a variable.
change the variable only, if you want to change the bot name.