VBScript in VB

Posted on 2006-05-12
Last Modified: 2010-05-01
I am creating a cool Space fighting game called Stellar Attack Six. In this game the user will be able to script their own weapons using vbscript. For example:

sub initializeShot()
    xSpeed = 20 * cos(AngleOfNearestHeatSource)
    ySpeed = 20 * sin(AngleOfNearestHeatSource)
    HeatGenerated = 50
end sub

sub fireShotInterval()
    xSpeed = xSpeed + cos(AngleOfNearestHeatSource)
    ySpeed = ySpeed + sin(AngleOfNearestHeatSource)
end sub

sub impact(objectNumber as long)
    DammageRadius = (100 - fule)/10
    Dammage = 100 - fule
end sub

Ok, thats the general idea. But how do I take the written script and execute it within my program? Do I need some kind of control, or do I need to call an API? And is it possible for the scripter to do anything really sneaky, such as sctipting a virus to download off the internet? If so is there any way I can prevent this?
Question by:Sid_The_Kid
    LVL 37

    Accepted Solution

    Hi, you need Microsoft Script Control ...

    LVL 2

    Author Comment

    Thanks, I think I can figure out the rest.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now