Package org.dreambot.api.script
Class ScriptManager
- java.lang.Object
- 
- org.dreambot.api.script.ScriptManager
 
- 
 public class ScriptManager extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classScriptManager.State
 - 
Field SummaryFields Modifier and Type Field Description java.lang.String[]args
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaccountHasTotpKey()voidaddListener(java.util.EventListener listener)voidclearReloadedScript()booleancontainsListener(java.util.EventListener listener)org.dreambot.core.AccountgetAccount()java.lang.StringgetAccountNickname()Gets the currently selected account nickname from the Dreambot account managerintgetActiveInstances(int scriptId)Get the active number of instances purchased (or trialed) to a user for a script currently in usejava.util.List<java.lang.String>getAllScriptNames()Gets a list of all available script namesjava.lang.String[]getArgs()AbstractScriptgetCurrentScript()java.lang.ThreadgetIdleCameraThread()java.lang.ThreadgetIdleMouseThread()org.dreambot.internal.scripts.ScriptWrappergetLastRanScript()java.lang.ObjectgetLock()static ScriptManagergetScriptManager()ScriptManager.StategetState()intgetTotalInstances(int scriptId)Get the total number of instances purchased (or trialed) to a user for a scriptbooleanhasPremiumScript(int productId)Checks if the current user has access to a premium scriptint[]hasPremiumScripts(int... productIds)Checks if the current user has access to given premium scriptsbooleanhasPurchasedScript(int productId)Checks if the current user has an active purchase of a premium scriptint[]hasPurchasedScripts(int... productIds)Checks if the current user has an active purchase of the given premium scriptsbooleanhasSDNScript(int scriptId)Checks if the current user has access to an SDN scriptint[]hasSDNScripts(int... scriptIds)Checks if the current user has access to given SDN scriptsbooleanisAccountSet()booleanisPaused()booleanisRunning()voidpause()voidreloadLastScript()voidremoveListener(java.util.EventListener listener)voidresetArgs()voidresume()booleansetAccount(java.lang.String nickname)voidstart(java.lang.Class<? extends AbstractScript> scriptClass)voidstart(java.lang.String scriptName, java.lang.String... args)voidstart(org.dreambot.internal.scripts.ScriptWrapper scriptWrapper)AbstractScriptstartFromSchedule(AbstractScript script, java.util.Map<java.lang.reflect.Field,java.lang.Object> fields)Deprecated.voidstop()This will force stop the current script running, including killing the thread if necessary.voidstopWithScheduledStop()This will attempt to stop the current script nicely by blocking up to 5 minutes untilAbstractScript.onScheduledStop()returns true.
 
- 
- 
- 
Method Detail- 
getScriptManagerpublic static ScriptManager getScriptManager() 
 - 
startFromSchedule@Deprecated public AbstractScript startFromSchedule(AbstractScript script, java.util.Map<java.lang.reflect.Field,java.lang.Object> fields) Deprecated.
 - 
reloadLastScriptpublic void reloadLastScript() 
 - 
startpublic void start(org.dreambot.internal.scripts.ScriptWrapper scriptWrapper) 
 - 
startpublic void start(java.lang.String scriptName, java.lang.String... args)
 - 
startpublic void start(java.lang.Class<? extends AbstractScript> scriptClass) 
 - 
containsListenerpublic boolean containsListener(java.util.EventListener listener) 
 - 
addListenerpublic void addListener(java.util.EventListener listener) 
 - 
removeListenerpublic void removeListener(java.util.EventListener listener) 
 - 
pausepublic void pause() 
 - 
resumepublic void resume() 
 - 
stopWithScheduledStoppublic void stopWithScheduledStop() This will attempt to stop the current script nicely by blocking up to 5 minutes untilAbstractScript.onScheduledStop()returns true. This allows for the client to stop the script when a supported script says it's safe to stop.
 - 
stoppublic void stop() This will force stop the current script running, including killing the thread if necessary.This most likely shouldn't be used to stop your own script, see AbstractScript.stop()orstopWithScheduledStop()instead.
 - 
isPausedpublic boolean isPaused() 
 - 
isRunningpublic boolean isRunning() 
 - 
getStatepublic ScriptManager.State getState() 
 - 
setAccountpublic boolean setAccount(java.lang.String nickname) 
 - 
getAccountNicknamepublic java.lang.String getAccountNickname() Gets the currently selected account nickname from the Dreambot account manager- Returns:
- account nickname if an account is selected, otherwise null
 
 - 
accountHasTotpKeypublic boolean accountHasTotpKey() 
 - 
isAccountSetpublic boolean isAccountSet() 
 - 
getLockpublic java.lang.Object getLock() 
 - 
resetArgspublic void resetArgs() 
 - 
hasPremiumScriptpublic boolean hasPremiumScript(int productId) Checks if the current user has access to a premium script- Parameters:
- productId- The product ID of the script in the store, you can find it by looking in the URL of the product before the name
- Returns:
- true if the user has an active trial or if they have an active purchase of the script
 
 - 
hasPremiumScriptspublic int[] hasPremiumScripts(int... productIds) Checks if the current user has access to given premium scripts- Parameters:
- productIds- Array of the product IDs of the scripts in the store, you can find it by looking in the URL of the product before the name
- Returns:
- array of product ids that are owned by the user
 
 - 
hasPurchasedScriptpublic boolean hasPurchasedScript(int productId) Checks if the current user has an active purchase of a premium script- Parameters:
- productId- The product ID of the script in the store, you can find it by looking in the URL of the product before the name
- Returns:
- true only if the user has an active purchase of the script
 
 - 
hasPurchasedScriptspublic int[] hasPurchasedScripts(int... productIds) Checks if the current user has an active purchase of the given premium scripts- Parameters:
- productIds- The product IDs of the scripts in the store, you can find it by looking in the URL of the product before the name
- Returns:
- array of the product ids owned by the user
 
 - 
getTotalInstancespublic int getTotalInstances(int scriptId) Get the total number of instances purchased (or trialed) to a user for a script- Parameters:
- scriptId- The script ID of the SDN which can be found on the Uploaded Scripts page in the SDN
- Returns:
- the total number of instances allowed for this user, -1 if they have no access or if the product isn't instanced
 
 - 
getActiveInstancespublic int getActiveInstances(int scriptId) Get the active number of instances purchased (or trialed) to a user for a script currently in use- Parameters:
- scriptId- The script ID of the SDN which can be found on the Uploaded Scripts page in the SDN
- Returns:
- the active number of running instances by this user, -1 if they have no access or if the product isn't instanced
 
 - 
hasSDNScriptpublic boolean hasSDNScript(int scriptId) Checks if the current user has access to an SDN script- Parameters:
- scriptId- The script ID of the SDN, can be found on the Uploaded Scripts page in the SDN
- Returns:
- true if the user has access to that script, false otherwise
 
 - 
hasSDNScriptspublic int[] hasSDNScripts(int... scriptIds) Checks if the current user has access to given SDN scripts- Parameters:
- scriptIds- Script ID of the SDN, can be found on the uploaded scripts page in the SDN
- Returns:
- array of script IDs that the user has access to
 
 - 
getAllScriptNamespublic java.util.List<java.lang.String> getAllScriptNames() Gets a list of all available script names
 - 
clearReloadedScriptpublic void clearReloadedScript() 
 - 
getArgspublic java.lang.String[] getArgs() 
 - 
getLastRanScriptpublic org.dreambot.internal.scripts.ScriptWrapper getLastRanScript() 
 - 
getCurrentScriptpublic AbstractScript getCurrentScript() 
 - 
getAccountpublic org.dreambot.core.Account getAccount() 
 - 
getIdleMouseThreadpublic java.lang.Thread getIdleMouseThread() 
 - 
getIdleCameraThreadpublic java.lang.Thread getIdleCameraThread() 
 
- 
 
-