Valhalla Legends Forums Archive | Visual Basic Programming | Mail Script Help

AuthorMessageTime
RcP
So far i have this:Code:
[code]Sub Event_UserTalk(Username, Flags, Message, Ping)
Dim quote

'If the user is trying to type in a command
If (Mid(Message, 1, 1) = ".") Then
Start = 2
getNextWord Message, Start, myCommand

Select Case (LCase(myCommand))
Case "test"
If (myAccess > -1) Then
msgRestOf = Mid(Message, Start) 'Store the users question
If (msgRestOf <> Empty) Then 'Make sure they asked a question
AddQ "/w *"&Username&" Question recived. Come back later and sheck for a reply"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set vFile = FSO.OpenTextFile("help.txt",8,True) ' 8 = append
vFile.WriteLine(msgRestOf)
vFile.Close
Set FSO = nothing ' free FSO
End If
End If
End Select
End If
End Sub [/code]

This writes to the file.

This goes at the end of script.txt allows for rest of the message:
Code:
[code]'Grabs the next word in a message
Sub getNextWord(Message, ByRef Start, ByRef Word)

'Loop through the message until we find the next space
Do Until (Mid(Message, Start, 1) = " " Or Start > Len(Message))
Word = Word & Mid(Message, Start, 1)
Start = Start + 1
Loop

'Skip the space
Start = Start + 1

End Sub[/code]


Things todo:
Have the message also show the person who asked the question, Time asked (day, hr, min, am/pm).
A read 1 line script for help.txt.
Ability to delete one question at a time.
In the script for reading the questions, Detecting a sertin flag and not alowing other people but them to use the script.



I hope anyone with good VB skills will take this and add onto it. If anyone does plz eather post the end script or anything you add.

[Editor(Grok): added code tags, fixed spelling of 'write']
February 29, 2004, 10:20 PM
Stealth
This is a repeat of this post on my VBScript forums:
http://stealthbot.net/forums.php?m=posts&q=2413

So it is worthwhile to note that that is VBScript, not full-fledged VB.
March 1, 2004, 3:41 PM
Tuberload
[quote author=Stealth link=board=31;threadid=5519;start=0#msg46908 date=1078155681]
This is a repeat of this post on my VBScript forums:
http://stealthbot.net/forums.php?m=posts&q=2413

So it is worthwhile to note that that is VBScript, not full-fledged VB.
[/quote]
Stealing members huh? ;)
March 2, 2004, 7:32 AM
TheMinistered
To incorperate such a mail system you could use 1000 different methods. I would have one file, a database, to store all mail to be sent out. Each entry in the table/database would include the sender & the message. Whenever a message has been read, it is simply deleted from the send database (perhaps added to another?). This task should not be a difficult one, and if you are finding yourself in trouble then I recommend going back and learning the fundamentals of the language you are using.
March 2, 2004, 1:15 PM
HdxBmx27
Bah! Ya that was Stealth_Tech posting in here w/o my permishion but who cares. Ya All i need right now this point in time to get this script working in the bare minamum is a way to have the variable for the username of the person who uses .help witch i have asked for in StealthBot forums.
~-~(HDX)~-~
March 3, 2004, 1:21 AM

Search