my script up and running but now i ask for more help 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

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

my script up and running but now i ask for more help please

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

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

InnerCity
Posts: 105
Joined: 2003-05-17 00:35

Post by InnerCity » 2003-09-23 20:04

yes, you can, type something like:

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
and the bot will appear as an operator

i have seen this syntax in other bots
frmHub.RegisterBotName cStr(sBotName)
ask scripters about differences
Hi hi hoo

InnerCity
Posts: 105
Joined: 2003-05-17 00:35

Post by InnerCity » 2003-09-23 20:33

sorry, and ask them the instructions for the private dialogue, :D :D :D
and ask for a cigarrette for me
and another one for my girlfriend
and ask gadget when will be finished the new general bot
Hi hi hoo

TheNOP
Posts: 275
Joined: 2003-07-07 21:41
Location: Quebec

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

Code: Select all

frmHub.RegisterBotName(sBotName) 
should'nt this be ?

Code: Select all

frmHub.RegisterBotName("yourbotname") 
if you want to change the bot name,you will have to do so everywhere it is use trough the script.

Code: Select all

frmHub.RegisterBotName cStr(sBotName)
convert to a string, the data contain in (sBotName) variable and register the result.
allow you to reference the bot tru the script by a variable.
change the variable only, if you want to change the bot name.
TheNOP

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

TheNOP
Posts: 275
Joined: 2003-07-07 21:41
Location: Quebec

Post by TheNOP » 2003-09-23 23:44

thanks to the user that point to me that i made a misstake will writing. :roll:
:oops:
change the variable only, if you want to change the bot name.
i meant change the data that the variable contain.
ex: sBotName="Op_Rules", sBotName="My_Bot", etc..
TheNOP

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

Locked