Mirage Source

Free ORPG making software.
It is currently Fri Mar 29, 2024 7:55 am

All times are UTC




Post new topic Reply to topic  [ 101 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Adding SadScript Support
PostPosted: Thu Jun 01, 2006 8:05 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
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:
http://www.pscode.com/vb/scripts/ShowZi ... S367166177

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 andyd@vuetura.com
   
    '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!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 6:51 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
I'm having prblems with this one. Some help please?

Runtime Error '429': Cannot Create ActiveX Component

Highlites the following:


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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 7:15 pm 
Offline
Knowledgeable
User avatar

Joined: Thu Jun 29, 2006 12:11 am
Posts: 120
Is adding sadscript good?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 7:24 pm 
Offline
Knowledgeable

Joined: Thu Jun 15, 2006 8:20 pm
Posts: 158
Krloz wrote:
Is adding sadscript good?


little point unless you're releasing a game engine... that you want semi-customiseable... otherwise... why clutter the server folder?

_________________
Fallen Phoenix Online:
An online game world based on the Harry Potter books
www.fallenphoenix.org


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 7:35 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
I was going to use it so that I dont have to hard code 100 quests into the server modules lol.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 7:38 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
msscript.dll ... helps to find and register that :wink:

Now, to figure out how it works :?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 8:36 pm 
Offline
Regular
User avatar

Joined: Tue Jul 04, 2006 5:50 am
Posts: 98
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 8:52 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 9:13 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
God-Sent-Death wrote:
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 12:07 am 
Offline
Knowledgeable
User avatar

Joined: Thu Jun 29, 2006 12:11 am
Posts: 120
Kite wrote:
God-Sent-Death wrote:
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 1:01 am 
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.


Top
  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 1:49 am 
Offline
Regular
User avatar

Joined: Tue Jul 04, 2006 5:50 am
Posts: 98
A bit off-topic no?
Anyhow, *cough* http://www.worldofwarcraft.com/info/races/dancing.html


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 8:26 am 
Offline
Knowledgeable

Joined: Sat Jul 08, 2006 8:24 am
Posts: 339
http://splamm.com/elysium/forums/viewtopic.php?t=1309

TheYellowMole's Ultimate Guide to Sadscript. Never seen a better guide to sadscript. I suggest that people that add this, read the tut.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 7:42 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
Joost wrote:
http://splamm.com/elysium/forums/viewtopic.php?t=1309

TheYellowMole's Ultimate Guide to Sadscript. Never seen a better guide to sadscript. I suggest that people that add this, read the tut.


:shock: very nice :shock:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 04, 2007 6:17 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 04, 2007 8:12 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
your syntax is incorrect, eh?

Sub JoinGame(index)

' Send them welcome
PlayerMsg(index, "Test", white)
End Sub

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 04, 2007 10:01 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
still get the same error, no message


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 2:01 am 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
missing call?

Call PlayerMsg(index, "test" color)

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 1:28 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
Usually in VB6 you don't really need to put Call. But i'll give it a try. I doubt it's that though. I'll have to try and rip the system from somebody elses engine.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 5:28 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
if you use ( and ) you need to use call.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 5:45 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
Yep, if you use call, you need parentheses, if you don't use call, you can't use parentheses

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 3:53 am 
Offline
Knowledgeable

Joined: Tue May 30, 2006 5:11 am
Posts: 156
Location: Australia
GameBoy wrote:
Usually in VB6 you don't really need to put Call. But i'll give it a try. I doubt it's that though. I'll have to try and rip the system from somebody elses engine.


Im pretty sure only functions dont require the call.. function.. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 5:43 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
works for subs too. There's absolutely no "call <event>" in my code, what so ever.

I was just looking around. Is there something I need to add to clsCommands in order for SadScript to send data from the main.txt to the client?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 6:19 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
Sub SendData

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 4:09 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
that'll be why then :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 101 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group