Visual Basic .NET Support
GrindFest supports Visual Basic .NET as an alternative to C# for writing bot scripts. This allows developers familiar with VB.NET syntax to use their preferred language.
Enabling Visual Basic Support
To use Visual Basic instead of C#, you need to start the game with a command line argument:
GrindFest.exe -language=visualbasic
How to Launch with Command Line Arguments
Method 1: Command Prompt
- Open Command Prompt (cmd)
- Navigate to your GrindFest installation directory
- Run the game with the VB flag:
GrindFest.exe -language=visualbasic
Method 2: Create a Shortcut
- Right-click on
GrindFest.exe
and select "Create shortcut" - Right-click the shortcut and select "Properties"
- In the "Target" field, add the argument at the end:
"C:\Path\To\GrindFest.exe" -language=visualbasic
- Click "OK" and use this shortcut to launch the game
Method 3: Steam Launch Options (if applicable)
- Right-click GrindFest in your Steam library
- Select "Properties"
- In the "Launch Options" field, enter:
-language=visualbasic
Visual Basic Syntax
When Visual Basic mode is enabled, you can write your bot scripts using VB.NET syntax instead of C#.
Basic Bot Example
Here's a simple bot that uses the Hero.Idle() method, written in Visual Basic:
' VB.NET version of a basic bot
Imports GrindFest
Public Class MyHero
Inherits AutomaticHero
' This method runs when the bot starts
Public Sub Start()
Say("Bot started in Visual Basic!")
End Sub
' This method runs continuously while the bot is active
Public Sub Update()
If Not IsBotting Then
Return
End If
' Make the hero fight enemies, drink potions, and pick up items
Idle()
End Sub
End Class
File Extensions
- Script files should have a
.vb
extension instead of.cs
IDE Support
Visual Basic .NET is supported by the same IDEs that support C#:
- Visual Studio Code (bundled with the game) - Install the VB.NET extension
- JetBrains Rider - Full VB.NET support included
- Visual Studio Community - Excellent VB.NET support
API Compatibility
All GrindFest APIs work identically in Visual Basic as they do in C#. The only difference is the syntax used to call them.