Adding SadScript Support

  • Lunar Engine v0.2.6 is out now! Download and check it out here. The map editor is also now fixed!

grimsk8ter11

Member
Member
May 29, 2006
333
0
0
Gold
0
#1
First of many, before archive tutorials to be converted.

Diffculty 2/5 (mostly copy and paste ebcause I seriously cant explain half of what GSD told me xD)

First off make sure you have SadScript3:
<!-- m --><a class="postlink" href="http://www.pscode.com/vb/scripts/ShowZip.asp?lngWId=1&lngCodeId=36716&strZipAccessCode=tp%2FS367166177">http://www.pscode.com/vb/scripts/ShowZi ... S367166177</a><!-- m -->

Off the bat, ill tell you SadScript does not allow sending stungs to subs like so:
Code:
MyScript.ExecuteStatement "ScriptFile.txt", "SubNameHere " & "Hello"
not possible :p

Ok in the zip folder you should see DLL and Sample.
From the DLL folder copy the clsRC4 and clsSadScript put that into your game's server folder.
Now go into the Sample folder.
Copy clsCommands and put that into your game's server folder.
Good now open up your game's server project.
Now add all 3 of those Class Modules to your project.
Go to Project>Reference and make reference to: Mircrosoft Script Control 1.0

in modGlobals add this at the top:

Code:
Global MyScript As clsSadScript
Public clsScriptCommands As clsCommands
Now open clsSadScript and change:


Code:
Public Type define
    sVari As String
    sValue As String
End Type
to

Code:
Private Type define
    sVari As String
    sValue As String
End Type
Now find:
Code:
Sub InitServer()
Add this near the top:

Code:
Call SetStatus("Loading scripts...")
        Set MyScript = New clsSadScript
        Set clsScriptCommands = New clsCommands
        MyScript.ReadInCode App.Path & "\ScriptFile.txt", "\ScriptFile.txt", MyScript.SControl, False
        MyScript.SControl.AddObject "ScriptHardCode", clsScriptCommands, True
Note: You can change \ScriptFile.txt to whatever you want, just make sure you know this name for later.

Now add this anywhere you want the script to load:
Code:
MyScript.ExecuteStatement "ScriptFile.txt", "SubNameHere"
Now change SubNameHere to whatever sub you want it to load.
Ok now if you want variables like player index do this:
Code:
MyScript.ExecuteStatement "ScriptFile.txt", "SubNameHere " & index
Note the space after the SubNameHere, you will always need that.
Now if you want more variables do:
Code:
MyScript.ExecuteStatement "ScriptFile.txt", "SubNameHere " & index & "," & index
And so on!

Finnally replace all of clsRC4 with the following

Code:
Option Explicit
Private Const BLOCKSIZE = 256
Dim mnsBox(0 To 255) As Integer 'S-Box
Dim mnKeep(0 To 255) As Integer
Private mstrError As String
Private mstrPassword As String
Private mnErrorNumber As Long

Public Property Get ErrorNumber() As Long
    ErrorNumber = mnErrorNumber
End Property

Public Property Let Password(ByVal vData As String)
    mstrPassword = vData
    Initialize mstrPassword
End Property

Public Property Get Password() As String
    Password = mstrPassword
End Property

Public Property Get ErrorMessage() As String
    ErrorMessage = mstrError
End Property

Public Function EncryptFile(ByVal strSource As String, ByVal strTarget As String, Optional strPassword As String) As Boolean
Dim strNameRoutine As String ' Name of routine For logging and Error routine
Dim nResult As Long
Dim inbyte As Byte
Dim nIndex As Long
Dim nSourceFile As Integer
Dim nTargetFile As Integer
Dim nSourceSize As Long
Dim nChunkSize As Integer
Dim strInput As String
Dim strOutput As String
Dim blnContinue As Boolean
    On Local Error GoTo EncryptFile_Error
    ' InitialinIndexe variables
    strNameRoutine = "EncryptFile"
    nResult = 0 ' 0 = Failure - Must change To indicate success

    If mstrPassword = "" And strPassword = "" Then
        mstrError = "You need To enter a password For encrypten or decrypten"
        GoTo EncryptFile_Exit
    Else


        If Len(strPassword) And strPassword <> mstrPassword Then
            mstrPassword = strPassword
        End If
    End If


    If Len(strSource) = 0 Or Len(strTarget) = 0 Then
        mstrError = "Error - Source/Target name missing"
        GoTo EncryptFile_Exit
    End If


    If Len(Dir$(strSource)) = 0 Then
        mstrError = "Error missing source"
        GoTo EncryptFile_Exit
    End If


    If Len(Dir$(strTarget)) Then
        Kill strTarget
    End If
    ' get the file handles
    nSourceFile = FreeFile
    nSourceSize = FileLen(strSource)
    Open strSource For Binary As nSourceFile
    nTargetFile = FreeFile
    Open strTarget For Binary As nTargetFile
    blnContinue = False ' Set this so we reset the indexes in the first call...


    Do Until nIndex >= nSourceSize


        If nIndex + BLOCKSIZE > nSourceSize Then
            nChunkSize = nSourceSize - nIndex
        Else
            nChunkSize = BLOCKSIZE
        End If
        nIndex = nIndex + nChunkSize
        strInput = Space$(nChunkSize) ' init For getting data
        Get #nSourceFile, , strInput
        strOutput = EnDeCrypt(strInput, blnContinue)
        Put #nTargetFile, , strOutput
        blnContinue = True ' mark it so that we Do Not reset the indexes on subsuquent calls
    Loop
    ' clean up
    Close nSourceFile
    Close nTargetFile
    nResult = True
EncryptFile_Exit:
    On Local Error GoTo 0 ' turn off error trapping
    EncryptFile = nResult
    Exit Function
    ' Error Recovery & Logging
EncryptFile_Error:
    ' Log the error and exit routine
    mnErrorNumber = Err.Number
    mstrError = Err.Description & " In " & strNameRoutine
    nResult = 0 ' verify that we are Set To failure
    Resume EncryptFile_Exit
End Function

Public Function EncryptString(ByVal strSource As String, Optional strPassword As String) As String
Dim strNameRoutine As String ' Name of routine For logging and Error routine
Dim strResult As String
    On Local Error GoTo EnCryptString_Error
    ' Initialize variables
    strNameRoutine = "EnCryptString"
    strResult = "" ' 0 = Failure - Must change To indicate success
    ' make sure we have the files, names and
    '     basic requirements


    If mstrPassword = "" And strPassword = "" Then
        mstrError = "You need To enter a password For encrypten or decrypten"
        GoTo EnCryptString_Exit
    Else


        If Len(strPassword) And strPassword <> mstrPassword Then
            mstrPassword = strPassword
        End If
    End If

    If Len(strSource) = 0 Then
        mstrError = "Error - Source/Target name missing"
        GoTo EnCryptString_Exit
    End If
    strResult = EnDeCrypt(strSource, False)
EnCryptString_Exit:
    On Local Error GoTo 0 ' turn off error trapping
    EncryptString = strResult
    Exit Function
    ' Error Recovery & Logging
EnCryptString_Error:
    ' Log the error and exit routine
    mnErrorNumber = Err.Number
    mstrError = Err.Description & " In " & strNameRoutine
    strResult = "" ' verify that we are Set To failure
    Resume EnCryptString_Exit
End Function

Private Sub Initialize(ByVal strPassword As String)
    Dim temp As Integer
    Dim nBufferIndex As Integer
    Dim nPwdIndex As Integer
    'Save Password in Byte-Array
    nPwdIndex = 0


    For nBufferIndex = 0 To 255
        nPwdIndex = nPwdIndex + 1


        If nPwdIndex > Len(strPassword) Then
            nPwdIndex = 1
        End If
        mnKeep(nBufferIndex) = Asc(Mid$(strPassword, nPwdIndex, 1))
    Next nBufferIndex
    'INI S-Box


    For nBufferIndex = 0 To 255
        mnsBox(nBufferIndex) = nBufferIndex
    Next nBufferIndex
    nPwdIndex = 0


    For nBufferIndex = 0 To 255
        nPwdIndex = (nPwdIndex + mnsBox(nBufferIndex) + mnKeep(nBufferIndex)) Mod 256
        ' Swap( mnsBox(i),mnsBox(j) )
        temp = mnsBox(nBufferIndex)
        mnsBox(nBufferIndex) = mnsBox(nPwdIndex)
        mnsBox(nPwdIndex) = temp
    Next nBufferIndex
End Sub

Private Function EnDeCrypt(strSourceText As String, Optional blnContinue As Boolean) As String 'Only use this routine For short texts
    Static nIndex As Integer
    Static nIndex2 As Integer ' ok it's a poor name, but it is simply the second index...
    Dim nKeyByte As Integer
    Dim byteCypher As Byte
    Dim strCipher As String
    Dim nSwap As Integer
    Dim nTextIndex As Long


    If blnContinue = False Then
        Initialize mstrPassword ' we have To re-initialize everytime because of the array shuffle
        nIndex = 0
        nIndex2 = 0
    End If


    For nTextIndex = 1 To Len(strSourceText)
        nIndex = (nIndex + 1) Mod 256
        nIndex2 = (nIndex2 + mnsBox(nIndex)) Mod 256
        ' Swap( mnsBox(nIndex),mnsBox(nIndex2) )
        '
        nSwap = mnsBox(nIndex)
        mnsBox(nIndex) = mnsBox(nIndex2)
        mnsBox(nIndex2) = nSwap
        'Generate Keybyte nKeyByte
        nKeyByte = mnsBox((mnsBox(nIndex) + mnsBox(nIndex2)) Mod 256)
        'Plaintextbyte xor Keybyte
        byteCypher = Asc(Mid$(strSourceText, nTextIndex, 1)) Xor nKeyByte
        strCipher = strCipher & Chr$(byteCypher)
    Next nTextIndex
    EnDeCrypt = strCipher
End Function

Private Function EnDeCryptSingle(bytePlain As Byte, Optional blnContinue As Boolean) As Byte 'Use this routine For really huge files
    Static nIndex As Integer
    Static nIndex2 As Integer
    Dim nSwap As Integer
    Dim nKeyByte As Integer
    Dim byteCipher As Byte


    If blnContinue = False Then
        Initialize mstrPassword ' we have To re-initialize everytime because of the array shuffle
        nIndex = 0
        nIndex2 = 0
    End If
    ' get calculation values
    nIndex = (nIndex + 1) Mod 256
    nIndex2 = (nIndex2 + mnsBox(nIndex)) Mod 256
    ' Swap( mnsBox(nIndex),mnsBox(nIndex2) )
    '
    nSwap = mnsBox(nIndex)
    mnsBox(nIndex) = mnsBox(nIndex2)
    mnsBox(nIndex2) = nSwap
    'Generate nKeyByteeybyte nKeyByte
    nKeyByte = mnsBox((mnsBox(nIndex) + mnsBox(nIndex2)) Mod 256)
    'Plaintextbyte xor nKeyByteeybyte
    byteCipher = bytePlain Xor nKeyByte
    EnDeCryptSingle = byteCipher
End Function



Now replace clsSadScript with:
Code:
Option Explicit
Private Type define
    sVari As String
    sValue As String
End Type

Public WithEvents SControl         As ScriptControl
Private sAllCode()      As String
Private sSubs()         As String
Private sFunctions()    As String
Public p_colSubs        As Collection
Public p_colFuncs       As Collection
Public Path             As String
Private m_oCrypt        As clsRC4

Public Property Let FilePass(sPass As String)
    m_oCrypt.Password = sPass
End Property

'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Public Function ReadInCode(sfile As String, sModTitle As String, msc As ScriptControl, Optional bEncrypted As Boolean = False)
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim sTemp As String         'Holds each line as it comes in from the file
    Dim iTemp As Integer
    Dim sTotalTemp As String    'Holds all lines
    Dim sTempCode() As String   'Temporary Array to hold Include files
    Dim iFileNum As Integer     'File Number we're working with
    Dim sDefines() As define   'Defines to go through and change later
    'Set encryption object
    Set m_oCrypt = New clsRC4
   
    'Unencrypt file
    If bEncrypted = True Then
        If m_oCrypt.EncryptFile(sfile, sfile & "1") = True Then
            Kill sfile
            Name sfile & "1" As sfile
        Else
            MsgBox "Unencrypt FAILED!"
            Exit Function
        End If
    End If
   
    'Start Blank
    Erase sAllCode
    ReDim sDefines(0)
    iFileNum = FreeFile         'Get new file number (thats not in use)
   
    Open sfile For Input As iFileNum   'Open file
   
    Do Until EOF(iFileNum) = True                               'Loop until file is at the end
        Line Input #iFileNum, sTemp                             'Get 1 line and put in sTemp
        sTemp = Trim(Replace(sTemp, vbTab, ""))                 'Trim string, get rid of all tabs
        If Left(sTemp, 1) <> "#" And Trim(sTemp) <> "" Then     'If line is a comment, ignore
            sTotalTemp = sTotalTemp & sTemp & vbNewLine         'Add line to the string
        Else
            'Yeah we got include statement
            If LCase(Left(sTemp, 8)) = "#include" Then
                sTemp = Mid(sTemp, InStr(sTemp, "<") + 1, Len(sTemp) - InStr(sTemp, "<") - 1)
                sTemp = ReturnStringFromFile(Path & "\" & sTemp)
                sTotalTemp = sTemp & vbNewLine & sTotalTemp
            ElseIf LCase(Left(sTemp, 7)) = "#define" Then
                sTemp = Right(sTemp, Len(sTemp) - 8)
                sDefines(UBound(sDefines)).sVari = Mid(sTemp, 2, InStr(sTemp, "> <") - 2)
                sDefines(UBound(sDefines)).sValue = Mid(sTemp, InStr(sTemp, "> <") + 3, Len(sTemp) - InStr(sTemp, "> <") - 3)
                ReDim Preserve sDefines(UBound(sDefines) + 1)
            End If
        End If
    Loop
    If UBound(sDefines) <> 0 Then
        ReDim Preserve sDefines(UBound(sDefines) - 1)
    End If
   
    Close iFileNum                                      'Close file
   
    For iTemp = 0 To UBound(sDefines)
        sTotalTemp = Replace(sTotalTemp, sDefines(iTemp).sVari, sDefines(iTemp).sValue)
    Next
    sAllCode = Split(sTotalTemp, vbNewLine)     'Use split function and put all lines into array
   
    ReDim Preserve sAllCode(UBound(sAllCode) - 1)       'Get rid of last array element (which is blank)
    'Split string into collection
    GetSubs sAllCode
    GetFunctions sAllCode
   
    'Put collection into the script control
    msc.Modules.add sModTitle
    AddSubsToCode msc, sModTitle
    AddFuncsToCode msc, sModTitle
   
    'Encrypt file
    If bEncrypted = True Then
        If m_oCrypt.EncryptFile(sfile, sfile & "1") = True Then
            Kill sfile
            Name sfile & "1" As sfile
        Else
            MsgBox "Encrypt FAILED!"
        End If
    End If
   
End Function



'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Function ReturnStringFromFile(sfile As String) As String
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim sTotalTemp As String    'Holds each line as it comes in from the file
    Dim iFileNum As Integer     'File Number we're working with
    Dim sTemp As String
    iFileNum = FreeFile         'Get new file number (thats not in use)
    On Local Error GoTo filenotfound
    Open sfile For Input As iFileNum                   'Open file
    Err.Clear
    Do Until EOF(iFileNum) = True                               'Loop until file is at the end
        Line Input #iFileNum, sTemp                             'Get 1 line and put in sTemp
        sTemp = Trim(Replace(sTemp, vbTab, ""))                 'Trim string, get rid of all tabs
        If Left(sTemp, 1) <> "#" And Trim(sTemp) <> "" Then     'If line is a comment, ignore
            sTotalTemp = sTotalTemp & sTemp & vbNewLine         'Add line to the string
        Else
            'Yeah we got include statement
            If LCase(Left(sTemp, 8)) = "#include" Then
                sTemp = Mid(sTemp, InStr(sTemp, "<") + 1, Len(sTemp) - InStr(sTemp, "<") - 1)
                sTemp = ReturnStringFromFile(Path & "\" & sTemp)
                sTotalTemp = sTemp & vbNewLine & sTotalTemp
            End If
           
        End If
    Loop
    Close iFileNum
    ReturnStringFromFile = sTotalTemp
    Exit Function
filenotfound:
    Exit Function
End Function


'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Function GetSubs(sCode() As String)
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim iCount As Integer
    Dim iTemp As Integer
    Dim sTitle As String
    Dim sSub As String
   
    Set p_colSubs = New Collection
   
    For iCount = 0 To UBound(sCode)
        sSub = ""
        If LCase(Left(sCode(iCount), 3)) = "sub" Then
           
            For iTemp = 5 To Len(sCode(iCount))
                If Mid(sCode(iCount), iTemp, 1) = "(" Then
                    sTitle = Mid(sCode(iCount), 5, iTemp - 5)
                    Exit For
                End If
            Next
           
            Do Until LCase(sCode(iCount)) = "end sub"
                sSub = sSub & sCode(iCount) & vbNewLine
                iCount = iCount + 1
            Loop
            sSub = sSub & sCode(iCount)
            On Error Resume Next
            p_colSubs.add sSub, sTitle
            Err.Clear
        End If
    Next
End Function


'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Function AddSubsToCode(mscControl As ScriptControl, sModName As String)
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim iCount As Integer
    Dim sError As String
    Dim aTemp() As String
   
    On Error GoTo err1
   
    For iCount = 1 To p_colSubs.Count
         mscControl.Modules(sModName).AddCode p_colSubs(iCount)
         
    Next
    Exit Function
err1:
    'aTemp = Split(p_colSubs(iCount), vbNewLine)
    'sError = sError & "ERROR:Compiling Script :: " & Err.Description & vbNewLine
    'sError = sError & "Scripting File: " & sModName & ".thraka" & vbNewLine
    'sError = sError & "Scripting Sub: " & aTemp(0) & vbNewLine & vbNewLine
    'MsgBox "WARNING: Scripting errors can cripple the existing program.", vbCritical, "Warning"
End Function

'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Function GetFunctions(sCode() As String)
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim iCount As Integer
    Dim iTemp As Integer
    Dim sTitle As String
    Dim sFunc As String
   
    Set p_colFuncs = New Collection
   
    For iCount = 0 To UBound(sCode)
        sFunc = ""
        If LCase(Left(sCode(iCount), 8)) = "function" Then
           
            For iTemp = 10 To Len(sCode(iCount))
                If Mid(sCode(iCount), iTemp, 1) = "(" Then
                    sTitle = Mid(sCode(iCount), 10, iTemp - 10)
                    Exit For
                End If
            Next
           
            Do Until LCase(sCode(iCount)) = "end function"
                sFunc = sFunc & sCode(iCount) & vbNewLine
                iCount = iCount + 1
            Loop
            sFunc = sFunc & sCode(iCount)
            On Error Resume Next
            p_colFuncs.add sFunc, sTitle
            Err.Clear
        End If
    Next

End Function
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Function AddFuncsToCode(mscControl As ScriptControl, sModName As String)
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim iCount As Integer
    Dim sError As String
    Dim aTemp() As String
   
    On Error GoTo err1
   
    For iCount = 1 To p_colFuncs.Count
         mscControl.Modules(sModName).AddCode p_colFuncs(iCount)
    Next
    Exit Function
   
err1:
    'aTemp = Split(p_colFuncs(iCount), vbNewLine)
    'sError = sError & "ERROR:Compiling Script :: " & Err.Description & vbNewLine
    'sError = sError & "FILE: " & sModName & ".thraka" & vbNewLine
    'sError = sError & "FUNCTION: " & aTemp(0) & vbNewLine & vbNewLine
    'sError = sError & "More Information?"
    'MsgBox "WARNING: Scripting errors can cripple the existing program.", vbCritical, "Warning"
End Function
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Sub Class_Initialize()
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Set SControl = New ScriptControl
    SControl.Language = "vbScript"
End Sub
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Sub Class_Terminate()
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Set SControl = Nothing
    Set p_colFuncs = Nothing
    Set p_colSubs = Nothing
End Sub

'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Function RunCodeReturn(sModule As String, sCode As String, ParamArray abc() As Variant) As Variant
'PRIVATE BECAUSE I CANT GET IT TO WORK
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    Dim sError As String
    Dim aTemp() As String
    Dim bTemp As Variant
   
    'How the heck to pass a paramarray array to another function using a
    'paramarray array?? if ya know email me [email protected]
   
    'On Error GoTo ScriptErr
    If IsMissing(abc) Then
        bTemp = SControl.Modules(sModule).Run(sCode)
    Else
        bTemp = SControl.Modules(sModule).Run(sCode, abc)
    End If
   
    RunCodeReturn = bTemp
End Function

'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Public Function ExecuteStatement(sModule As String, sCode As String)
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
   
    On Error Resume Next
    SControl.Modules(sModule).ExecuteStatement sCode

End Function

Private Sub SControl_Error()
    Dim sError As String
   
    'MsgBox "TYPE: " & SControl.Error.Description & vbNewLine & "LINE: " & SControl.Error.Line & vbNewLine & "COLUMN: " & SControl.Error.Column & vbNewLine & "CODE: " & vbNewLine & "    " & SControl.Error.Text
   
    'sError = sError & "ERROR:Running Script :: " & Err.Description & vbNewLine
    'sError = sError & "More Information?"
   
    'If MsgBox(sError, vbYesNo Or vbCritical, "Scripting Error") = vbYes Then
    '    MsgBox "TYPE: " & SControl.Error.Description & vbNewLine & "LINE: " & SControl.Error.Line & vbNewLine & "COLUMN: " & SControl.Error.Column & vbNewLine & "CODE: " & vbNewLine & "    " & SControl.Error.Text
    'End If
   
    'MsgBox "WARNING: Scripting errors can cripple the existing program.", vbCritical, "Warning"
    Err.Clear
End Sub


Public Function EncryptFile(sfile As String, sPassword As String)
'
'   Nice function for someone who wants to encrypt a file
'

    If m_oCrypt.EncryptFile(sfile, sfile & "1", sPassword) = True Then
        Kill sfile
        Name sfile & "1" As sfile
    Else
        MsgBox "Encryption Failed"
    End If

End Function

That should be it!

If you got any questions just ask!
 

Leighland

Member
Member
Jun 14, 2006
148
0
0
Gold
0
#2
I'm having prblems with this one. Some help please?

Runtime Error '429': Cannot Create ActiveX Component

Highlites the following:


In clsSadScript.CLS
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Private Sub Class_Initialize()
'/////////////////////////////\/\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Set SControl = New ScriptControl
SControl.Language = "vbScript"
End Sub
 

GodSentDeath

Member
Member
Jul 3, 2006
82
0
0
Gold
0
#7
To figure out how to code anything, head over to Elysium Source forum and read up on the code for SadScript included in the engine :) I believe there is even a tutorial about SadScript in the forum somewhere.
 

Leighland

Member
Member
Jun 14, 2006
148
0
0
Gold
0
#8
Thanks, I'll go have a look over there. Went and downloaded the Diamond source and had a look at it to se ehow everything worked. Best way for me to learn is to see it lol :).


Had a few Type Mismatch errors but I got it to work. This should make quest creation a LOT easier :D
 

Robin

Veteran
Veteran
Member
Jun 16, 2006
2,555
0
0
Gold
0
#9
God-Sent-Death said:
To figure out how to code anything, head over to Elysium Source forum and read up on the code for SadScript included in the engine :) I believe there is even a tutorial about SadScript in the forum somewhere.
Hahahah. I find your avatar hilarious xD
 

Krloz

Member
Member
Jun 28, 2006
102
0
0
Gold
0
#10
Kite said:
God-Sent-Death said:
To figure out how to code anything, head over to Elysium Source forum and read up on the code for SadScript included in the engine :) I believe there is even a tutorial about SadScript in the forum somewhere.
Hahahah. I find your avatar hilarious xD
me too xD where did u got it from? :p
 
M

Matt

Guest
Guest
#11
<div class="bbWrapper">I think it's the dance that race does on the game WoW. Not sure, never played that race, I don't like going horde. They all look gay.</div>
 

GodSentDeath

Member
Member
Jul 3, 2006
82
0
0
Gold
0
#12
A bit off-topic no?
Anyhow, *cough* <!-- m --><a class="postlink" href="http://www.worldofwarcraft.com/info/races/dancing.html">http://www.worldofwarcraft.com/info/races/dancing.html</a><!-- m -->
 

Xlithan

Member
Member
Sep 20, 2006
319
0
0
www.player-realms.co.nr
Gold
0
#15
I know this is an old topic. But after following the tutorial, I add this to my script file...

Code:
Sub JoinGame(index)

    ' Send them welcome
    PlayerMsg index, "Test", white)
End Sub
Then add this in Sub JoinGame under the SendWelcome call

Code:
MyScript.ExecuteStatement "eScript.txt", "JoinGame " & Index
It doesn't print a message.