Difference between revisions of "Event FirstRun"

From StealthBot Wiki
Jump to: navigation, search
(added "history")
(See also)
Line 17: Line 17:
==See also==
==See also==
* [[Event_Load]]()
* [[Event_Load]]()
* [[Event_Shutdown]]()
* [[Script events]]
* [[Script events]]
* [[Scripting System]]
* [[Scripting System]]

Revision as of 09:04, 3 August 2009

This StealthBot scripting event occurs when the bot loads, but not after script reload.

The Event_FirstRun() event can be used to do special actions that should be done one time per bot lifetime.

Note that any global variable and object settings will be reset by reload script, so using this event for loading them will cause the variables and objects to only be set up until the first reload. In this case, use Event_Load() instead.


This event was added in StealthBot version 2.7.


After the first script load, the script will print "Hello world!" in green using the AddChat function.

' occurs on first script load only
Sub Event_FirstRun()
    AddChat vbGreen, "Hello world!"
End Sub

See also