ReloadScript function

From StealthBot Wiki Backup
Revision as of 08:20, 1 December 2017 by Davnit (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The ReloadScript function causes the script system to reload.

Development

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

Documentation

'// RELOADSCRIPT
'// 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

Summary

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.

Syntax

ReloadScript

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
            ReloadScript
        End If
    End Sub
    

See also