ReloadScript function

From StealthBot Wiki
Jump to: navigation, search

The ReloadScript function causes the script system to reload.


The ReloadScript function was added to StealthBot in version 2.7 by Stealth.


'// Reloads the base script.txt file with any includes, equivalent to choosing
'//  that menu option on the bot's Settings menu
'// The command must wait before reloading the script so all operations are cleared.
Public Sub ReloadScript()
    SCReloadTimerID = SetTimer(frmChat.hWnd, 0, 400, AddressOf ScriptReload_TimerProc)
End Sub


This subroutine will reload the bots script system, and every loaded script. Global variable values will be reset. Remember to persist important information in bot settings during Event_Close() or in the routine that is reloading script.

The actual reload will occur after the current subroutine ends and the appropriate script events have been called.



Example usage

  • Reload on command (requires the creation of such a command using the CreateCommand function):
  • Sub Event_Command(Cmd)
        If Cmd.IsValid And Cmd.Name = "reloadscript" Then
        End If
    End Sub

See also