public MainScript() { config = ScriptSettings.Load("scripts\\3dMarker.ini"); Tick += OnTick; Interval = 1; }
private void LoadConfig(String fileName) { try { /*KEY SETTINGS*/ configSettings = ScriptSettings.Load(fileName); StartMode = configSettings.GetValue <Keys>("Key Settings", "StartSimplePowerMod", Keys.F10); StoreModel = configSettings.GetValue <Keys>("Key Settings", "SaveModelWithStrength", Keys.F11); NextStrength = configSettings.GetValue <Keys>("Key Settings", "NextStrength", Keys.F8); PrevStrength = configSettings.GetValue <Keys>("Key Settings", "PrevStrength", Keys.F7); /*VALUES SETTINGS*/ DEFAULT_STRENGTH = configSettings.GetValue <int>("Values Settings", "DefaultStrength", 30); STRENGTH_OFFSET = configSettings.GetValue <int>("Values Settings", "StrengthIncreaseDecreaseBy", 10); if (STRENGTH_OFFSET < 1) { STRENGTH_OFFSET = 1; } else if (STRENGTH_OFFSET > 2000) { STRENGTH_OFFSET = 2000; } ThereIsNoStoppingMe = configSettings.GetValue <bool>("Values Settings", "ThereIsNoStoppingMe", true); ThereIsNoStoppingMeAtAll = configSettings.GetValue <bool>("Values Settings", "ThereIsNoStoppingMeAtAll", true); WhereYouAimIsWhereYouThrow = configSettings.GetValue <bool>("Values Settings", "WhereYouAimIsWhereYouThrow", true); NeverRagdoll = configSettings.GetValue <bool>("Values Settings", "NeverRagdoll", true); EveryOne = configSettings.GetValue <bool>("Values Settings", "EveryOne", false); } catch (Exception e) { UI.Notify("~r~Error~w~: " + fileName.ToString() + " failed to load : " + e.ToString() + "."); DefaultValues(); } }
private void ParseConfig() { ScriptSettings settings; string path1 = @".\scripts\WebScriptHook.ini"; string pathFallback = @".\scripts\WebScriptHook\WebScriptHook.ini"; if (File.Exists(path1)) { settings = ScriptSettings.Load(path1); } else { // fallback settings = ScriptSettings.Load(pathFallback); } string host = settings.GetValue("Core", "HOST", "localhost"); string port = settings.GetValue("Core", "PORT", "25555"); int interval = settings.GetValue("Core", "INTERVAL", 10); Logger.Enable = settings.GetValue("Core", "LOGGING", false); //url = "http://localhost:" + port + "/push"; url = "ws://" + host + ":" + port + "/pushws"; sleepTime = interval; }
public SQLServerEntitySpacesDataStore(RequestContext context) { this._context = context; this._output = context.Zeus.Output; this._script = context.ScriptSettings; this._util = context.Utility; }
public InverseTorqueSP() { Tick += OnTick; Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); Settings = ScriptSettings.Load(@"scripts\InverseTorque\Options.ini"); Scaler = Settings.GetValue <float>("SETTINGS", "Scaler", 2f); }
/// <summary> /// Call this method first. This initializes everything that is /// necessary to run the application. /// </summary> /// <param name="MyMeta"></param> /// <param name="zeus"></param> public void Init(MyMeta.dbRoot MyMeta, Zeus.IZeusContext zeus, IZeusInput input, Dnp.Utils.Utils dnp, Dnp.Utils.ProgressDialog progressDialog) { // Initialize the ScriptSettings and save the input values from the MyGeneration form. try { _scriptSettings = ScriptSettings.InitInstance(input, MyMeta, dnp, _version); //_scriptSettings = new ScriptSettings(input, MyMeta, dnp, _version); _scriptSettings.SaveSettings(); } catch (Exception ex) { if (ex.InnerException != null) { throw new Exception("Error Saving ScriptSettings (inner): " + ex.InnerException.Message); } throw new Exception("Error Saving ScriptSettings: " + ex.Message + " - " + ex.StackTrace.ToString()); } // Populate the RequestContext class with all the values // needed to be passed to every code generating class. RequestContext context = new RequestContext(); context.Zeus = zeus; // Pass along the MyGeneration output context for saving files context.MyMeta = MyMeta; // Pass along the Database meta properties context.FileList = _fileList; // Start the ArrayList for printing the generated files context.ScriptSettings = _scriptSettings; // Store the saved form values context.Dialog = new ProgressDialogWrapper(progressDialog); // Get instance of Dialog wrapper context.Database = MyMeta.Databases[_scriptSettings.DatabaseName]; // Get the selected database context.Utility = new CommonUtility(); // Get instance of helper utility _context = context; }
private float destructionRadius = 6.0f; // game units public Main() { Tick += onTick; KeyUp += onKeyUp; dateTimeThatStarmanWasInitiated = janFirst1970; // now we set the value ss = ScriptSettings.Load(@"scripts\Starman.ini"); if (ss.GetValue("Settings", "JumpBoost") == null) { ss.SetValue("Settings", "JumpBoost", "true"); } if (ss.GetValue("Settings", "Key") == null) { ss.SetValue("Settings", "Key", "105"); } if (ss.GetValue("Settings", "VehiclePower") == null) { ss.SetValue("Settings", "VehiclePower", "20"); } if (ss.GetValue("Settings", "Volume") == null) { ss.SetValue("Settings", "Volume", "0.4"); } ss.Save(); }
public static void SaveSettings() { ScriptSettings settings = ScriptSettings.Load("./scripts/BackToTheFutureV/settings.ini"); CultureInfo info = CultureInfo.CreateSpecificCulture("en-US"); settings.SetValue("tcd", "position_x", TCDPosition.X.ToString("G", info)); settings.SetValue("tcd", "position_y", TCDPosition.Y.ToString("G", info)); settings.SetValue("tcd", "scale", TCDScale.ToString("G", info)); settings.SetValue("tcd", "background", TCDBackground.ToString()); settings.SetValue("time_circuits", "PlayFluxCapacitorSound", PlayFluxCapacitorSound); settings.SetValue("time_circuits", "play_diode_sound", PlayDiodeBeep); settings.SetValue("time_circuits", "use_input_toggle", UseInputToggle); settings.SetValue("speedo", "play_speedo_beep", PlaySpeedoBeep); settings.SetValue("vehicle", "PlayEngineSounds", PlayEngineSounds); settings.SetValue("vehicle", "CinematicSpawn", CinematicSpawn); settings.SetValue("fly_mode", "force_fly_mode", ForceFlyMode); settings.SetValue("fly_mode", "LandingSystem", LandingSystem); settings.SetValue("time_circuits", "GlowingWormholeEmitter", GlowingWormholeEmitter); settings.SetValue("time_circuits", "GlowingPlutoniumReactor", GlowingPlutoniumReactor); settings.SetValue("events", "LightningStrikeEvent", LightningStrikeEvent); settings.SetValue("events", "EngineStallEvent", EngineStallEvent); settings.SetValue("events", "TurbulenceEvent", TurbulenceEvent); settings.Save(); }
void ReadINI() { ScriptSettings settings = ScriptSettings.Load(@"scripts\ParticleFxPlayer.ini"); MenuKey = settings.GetValue("Control", "Menu Key", Keys.ShiftKey); MenuKey2 = settings.GetValue("Control", "Menu Key 2", Keys.N); }
public BusinessObjectsPropertiesRenderForeignKeyConstructorForDbContext(MyMeta.ITable table, RequestContext context) { this._context = context; this._table = table; this._script = context.ScriptSettings; this._output = context.Zeus.Output; }
public Script Build(string cSharpScript, ScriptSettings settings, PluginRepository pluginRepo) { var ruriLib = Assembly.GetAssembly(typeof(ScriptBuilder)); var plugins = pluginRepo != null?pluginRepo.GetPlugins() : Array.Empty <Assembly>(); var script = CSharpScript.Create( code: preScript.ToString() + cSharpScript + postScript.ToString(), options: ScriptOptions.Default .WithReferences(new Assembly[] { ruriLib }.Concat(plugins)) .WithImports(GetImports(settings)), globalsType: typeof(ScriptGlobals)); // Add references from RuriLib var ruriLibReferences = ruriLib.GetReferencedAssemblies(); script.Options.AddReferences(AppDomain.CurrentDomain.GetAssemblies() .Where(a => ruriLibReferences.Any(r => r.FullName == a.FullName))); // Add references from plugins var pluginReferences = plugins.SelectMany(p => p.GetReferencedAssemblies()); script.Options.AddReferences(AppDomain.CurrentDomain.GetAssemblies() .Where(a => pluginReferences.Any(p => p.FullName == a.FullName))); return(script); }
public EffectLayer UpdateLights(ScriptSettings settings, GameState state = null) { EffectLayer layer = new EffectLayer(this.ID); layer.PercentEffect(ForegroundColour, BackgroundColour, settings.Keys, DateTime.Now.Second, 60D); return(layer); }
/// <summary> /// Constructs a instance of script transformer /// </summary> /// <param name="minifier">Minifier</param> /// <param name="translators">List of translators</param> /// <param name="postProcessors">List of postprocessors</param> /// <param name="ignorePatterns">List of patterns of files and directories that /// should be ignored when processing</param> /// <param name="coreConfig">Configuration settings of core</param> public ScriptTransformer(IMinifier minifier, IList <ITranslator> translators, IList <IPostProcessor> postProcessors, string[] ignorePatterns, CoreSettings coreConfig) : base(ignorePatterns, coreConfig) { ScriptSettings scriptConfig = coreConfig.Scripts; UsePreMinifiedFiles = scriptConfig.UsePreMinifiedFiles; CombineFilesBeforeMinification = scriptConfig.CombineFilesBeforeMinification; _jsFilesWithMsStyleExtensions = Utils.ConvertToStringCollection( coreConfig.JsFilesWithMicrosoftStyleExtensions.Replace(';', ','), ',', true, true); IAssetContext scriptContext = BundleTransformerContext.Current.Scripts; _minifier = minifier ?? scriptContext.GetDefaultMinifierInstance(); _translators = (translators ?? scriptContext.GetDefaultTranslatorInstances()) .ToList() .AsReadOnly() ; _postProcessors = (postProcessors ?? scriptContext.GetDefaultPostProcessorInstances()) .ToList() .AsReadOnly() ; }
public BusinessObjectsPropertiesRenderForeignKeyConstructorForDbContext(MyMeta.ITable table, RequestContext context) { this._context = context; this._table = table; this._script = context.ScriptSettings; this._output = context.Zeus.Output; }
private void FindScriptCounts() { // Set wait pointer Cursor.Current = Cursors.WaitCursor; toolStripStatusLabel.Text = Properties.Resources.Counting_Code_Lines; Application.DoEvents(); try { // Get codelines object SiebelScriptLines codeLines = new SiebelScriptLines(_sciptVersion); // Apply settings ScriptSettings settings = new ScriptSettings { CountObjNameFilter = _scriptCountObjectNameFilter, CountUserNameFIlter = _scriptCountUserNameFilter, Version = _sciptVersion, IgnoreInactive = Settings.Default.ScriptIgnoreInactive }; _siebelApp.GetCodeLineCount(codeLines, settings, UpdateStatusBar); PopulateCodeLine(codeLines); } catch (Exception e3) { ShowError("Siebel Error", "A problem has occurred while counting code lines", e3.ToString()); } finally { // Set wait pointer Cursor.Current = Cursors.Default; toolStripStatusLabel.Text = Properties.Resources.Ready; Application.DoEvents(); } }
private void LoadIniFile() { try { this.Config = ScriptSettings.Load(this.f_Settings); this.modEnabled = (bool)this.Config.GetValue <bool>("SETTINGS", "modEnabled", (M0)1); this.reallifeDateTime = (bool)this.Config.GetValue <bool>("SETTINGS", "REALLIFE_DATETIME", (M0)0); this.displayArtificialHorizon = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_ARTIFICIAL_HORIZON", (M0)1); this.display3DRadar = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_3D_RADAR", (M0)1); this.displayMinimapRadar = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_MINIMAP_RADAR", (M0)1); this.displayMissileWarnSystem = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_MISSILE_WARN_SYSTEM", (M0)1); this.staticArtificialHorizon = (bool)this.Config.GetValue <bool>("SETTINGS", "STATIC_ARTIFICIAL_HORIZON", (M0)0); this.gpsRefreshRate = (long)this.Config.GetValue <long>("SETTINGS", "GPS_REFRESH_RATE", (M0)500L); this.getAllVehiclesInterval = (long)this.Config.GetValue <long>("SETTINGS", "3D_RADAR_REFRESH_RATE", (M0)10000L); this.getAllPropsInterval = (long)this.Config.GetValue <long>("SETTINGS", "MISSILE_WARN_SYSTEM_REFRESH_RATE", (M0)100L); this.color_HUD = Color.FromArgb((int)this.Config.GetValue <int>("SETTINGS", "HUD_A", (M0)(int)byte.MaxValue), (int)this.Config.GetValue <int>("SETTINGS", "HUD_R", (M0)67), (int)this.Config.GetValue <int>("SETTINGS", "HUD_G", (M0)197), (int)this.Config.GetValue <int>("SETTINGS", "HUD_B", (M0)0)); this.xOffsetRight = float.Parse(((string)this.Config.GetValue <string>("SETTINGS", "XOFFSET_RIGHT_ELEMENTS", (M0)"0.0")).Replace(',', '.'), (IFormatProvider)CultureInfo.InvariantCulture); this.SupportedAircraftList = new List <string>((IEnumerable <string>)File.ReadAllLines(this.f_Aircrafts)); this.blipRadius = 10000f; this.airplaneSprite = (BlipSprite)423; this.helicopterSprite = (BlipSprite)422; this.BlipColor = (BlipColor)2; this.onlyShowAircraftWithDriver = true; } catch (Exception ex) { UI.Notify("~r~Error~w~:Failed to load JET HUD settings."); } }
public static bool Save(this ScriptSettings settings) { Dictionary <String, List <Tuple <String, String> > > result = new Dictionary <String, List <Tuple <String, String> > >(); var mValues = (Dictionary <String, String>) typeof(ScriptSettings).GetField("mValues", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(settings); foreach (KeyValuePair <String, String> data in mValues) { String key = data.Key.Substring(data.Key.IndexOf("]", StringComparison.Ordinal) + 1); String section = data.Key.Remove(data.Key.IndexOf("]", StringComparison.Ordinal)).Substring(1); if (!result.ContainsKey(section)) { List <Tuple <String, String> > values = new List <Tuple <String, String> >(); values.Add(new Tuple <String, String>(key, data.Value)); result.Add(section, values); } else { result[section].Add(new Tuple <String, String>(key, data.Value)); } } StreamWriter writer = null; try { var mFileName = Path.Combine(Application.StartupPath, "scripts\\GTARPG\\config.ini"); writer = File.CreateText(mFileName); } catch (IOException) { return(false); } try { foreach (KeyValuePair <String, List <Tuple <String, String> > > section in result) { writer.WriteLine("[" + section.Key + "]"); foreach (Tuple <String, String> value in section.Value) { writer.WriteLine(value.Item1 + " = " + value.Item2); } writer.WriteLine(); } } catch (IOException) { return(false); } finally { writer.Close(); } return(true); }
public SpotifyRadio() { spotify = new SpotifyController(); moodMatcher = new MoodMatch(); isEngineOn = false; isSpotifyRadio = false; isEngineOn = false; matchMood = false; hasDevice = false; time = 0; File.Create("scripts/GTASpotify.log").Close(); config = ScriptSettings.Load("scripts/GTASpotify.ini"); menuKey = config.GetValue("Options", "MenuKey", Keys.F10); volume = config.GetValue <int>("Options", "Volume", 100); if (volume < 0 || volume > 100) { volume = 100; } defaultPlaylistId = config.GetValue <string>("Options", "DefaultPlaylist", ""); spotify.GuaranteeLogin(); if (spotify.obtainedSpotifyClient) { spotify.InitialSpotifyRequests(defaultPlaylistId); DisableRadioAds(); SetupMenu(); DashboardScaleform = new Scaleform("dashboard"); KeyDown += OnKeyDown; Tick += OnTick; } else { Logger.Log("ERROR: Did not login to Spotify"); } }
public SQLServerDbContextRepositoryDataStore(RequestContext context) { this._context = context; this._output = context.Zeus.Output; this._script = context.ScriptSettings; this._util = context.Utility; }
void LoadSettings() { if (File.Exists(@"scripts\IdleAnimations.ini")) { ScriptSettings config = ScriptSettings.Load(@"scripts\IdleAnimations.ini"); string idle = config.GetValue <string>("SETTINGS", "IdleAnimation", ""); if (idle != "") { Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation", "")); } if (idle != "") { Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation2", "")); } if (idle != "") { Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation3", "")); } if (idle != "") { Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation4", "")); } if (idle != "") { Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation5", "")); } GangIdle = config.GetValue <bool>("SETTINGS", "GangIdlesToo", true); TimeToIdle = config.GetValue <int>("SETTINGS", "TimeToIdle", 10) * 1000; } }
public SQLServerLinqToSqlDataStore(RequestContext context) { this._output = context.Zeus.Output; this._script = context.ScriptSettings; this._util = context.Utility; this._context = context; }
private void LoadSettingsFile() { bool loadSettingsSuccess = true; try { ModSettings = ScriptSettings.Load(modSettingsFile); } catch (Exception ex) { loadSettingsSuccess = false; UI.Notify(ex.Message); } /*if (loadSettingsSuccess) * { * keyCoordsKey = ModSettings.GetValue<Keys>("KEYS", "COORDKEY", Keys.F9); * keySaveFileKey = ModSettings.GetValue<Keys>("KEYS", "SAVEKEY", Keys.F10); * } * else * {*/ keyCoordsKey = Keys.I; keySaveFileKey = Keys.O; //} }
public void initializeINI() { config = ScriptSettings.Load("scripts\\DrugSelling.ini"); SellDrugsKey = config.GetValue <Keys>("Keys", "SellDrugsKey", Keys.O); OpenInventoryKey = config.GetValue <Keys>("Keys", "OpenInventoryKey", Keys.I); setDrugCarKey = config.GetValue <Keys>("Keys", "setDrugCarKey", Keys.F10); unsetDrugCarKey = config.GetValue <Keys>("Keys", "unsetDrugCarKey", Keys.F11); resetDealerKey = config.GetValue <Keys>("Keys", "resetDealerKey", Keys.End); deleteDealerKey = config.GetValue <Keys>("Keys", "deleteDealerKey", Keys.PageUp); marijuanaPrice = config.GetValue <int>("Sell Prices", "MarijuanaSellPrice", 270); cocainePrice = config.GetValue <int>("Sell Prices", "CocaineSellPrice", 600); crackPrice = config.GetValue <int>("Sell Prices", "CrackSellPrice", 300); ecstasyPrice = config.GetValue <int>("Sell Prices", "EcstasySellPrice", 150); amphetaminePrice = config.GetValue <int>("Sell Prices", "AmphetamineSellPrice", 75); heroinPrice = config.GetValue <int>("Sell Prices", "HeroinSellPrice", 150); marijuanaBuyPrice = config.GetValue <int>("Buy Prices", "MarijuanaBuyPrice", 270); cocaineBuyPrice = config.GetValue <int>("Buy Prices", "CocaineBuyePrice", 600); crackBuyPrice = config.GetValue <int>("Buy Prices", "CrackBuyPrice", 300); ecstasyBuyPrice = config.GetValue <int>("Buy Prices", "EcstasyBuyPrice", 150); amphetamineBuyPrice = config.GetValue <int>("Buy Prices", "AmphetamineBuyPrice", 75); heroinBuyPrice = config.GetValue <int>("Buy Prices", "HeroinBuyPrice", 150); sellerLocationX = config.GetValue <float>("Dealer Location", "sellerLocationX", 89.105f); sellerLocationY = config.GetValue <float>("Dealer Location", "sellerLocationY", -1912.354f); sellerLocationZ = config.GetValue <float>("Dealer Location", "sellerLocationZ", 20.867f); sellerAngle = config.GetValue <float>("Dealer Location", "sellerAngle", 143.448f); }
void ParseSettings() { try { Config = ScriptSettings.Load(@".\scripts\DragRace.ini"); activateKey = Config.GetValue("Keys", "OpenMenu", "O"); disableKey = Config.GetValue("Keys", "ManualEndRace", "NumPad1"); maxSpeed = Config.GetValue <int>("OpponentSettings", "MaxSpeed", 200); custom1x = Config.GetValue <int>("Race1", "X", -1959); custom1y = Config.GetValue <int>("Race1", "Y", 600); custom1z = Config.GetValue <int>("Race1", "Z", 119); custom2x = Config.GetValue <int>("Race2", "X", 497); custom2y = Config.GetValue <int>("Race2", "Y", -1132); custom2z = Config.GetValue <int>("Race2", "Z", 29); customs3x = Config.GetValue <int>("Race3", "StartX", 0); customs3y = Config.GetValue <int>("Race3", "StartY", 0); customs3z = Config.GetValue <int>("Race3", "StartZ", 0); custom3x = Config.GetValue <int>("Race3", "EndX", 0); custom3y = Config.GetValue <int>("Race3", "EndY", 0); custom3z = Config.GetValue <int>("Race3", "EndZ", 0); customh3 = Config.GetValue <int>("Race3", "StartHeading", 270); } catch { UI.Notify("There was an error loading the configuration file (.ini) make sure it exists!"); } }
public IAAsite() { IniSettings = ScriptSettings.Load("scripts\\IAAsite.ini"); BlipsActive = IniSettings.GetValue <bool>("Site Configuration", "Blips Active", false); BlipsLR = IniSettings.GetValue <bool>("Site Configuration", "Blips Borders", false); ProcessingZoneIAABlipColor = IniSettings.GetValue <int>("Blip Colors", "ProcessingZoneIAA bc", 0); Tick += OnTick; IPL(); if (BlipsActive) { Blip ProcessingZoneIAA = World.CreateBlip(new Vector3(2521.03f, -414.84f, 94.13f)); Function.Call(Hash.SET_BLIP_SPRITE, ProcessingZoneIAA, 468); Function.Call(Hash.SET_BLIP_COLOUR, ProcessingZoneIAA, ProcessingZoneIAABlipColor); Function.Call(Hash._0xF9113A30DE5C6670, "STRING"); Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, "IAA Data Processing Zone"); Function.Call(Hash._0xBC38B49BCB83BC9B, ProcessingZoneIAA); if (!BlipsLR) { Function.Call(Hash.SET_BLIP_AS_SHORT_RANGE, ProcessingZoneIAA, true); } } }
void ReadIni() { Logger.Clear(); Logger.Log(Logger.Level.INFO, $"Indicators"); Logger.Log(Logger.Level.INFO, $"Game version {Game.Version}"); Extensions.Init(); settings = ScriptSettings.Load("scripts\\tk0wnz-indicators.ini"); int i = 0; while (true) { string modelName = settings.GetValue("CARS", "ModelName" + i, "RESERVED_NO_VALUE"); int duration = settings.GetValue("CARS", "Duration" + i, -1); int debug = settings.GetValue("CARS", "Debug" + i, -1); if (modelName == null || modelName == "RESERVED_NO_VALUE" || duration == -1) { break; } blinkerParamsList.Add( new BlinkerParams { ModelName = modelName, Duration = duration, Debug = debug } ); ++i; } }
private void StartStarman() { string chosenTheme = starmanThemes[rnd.Next(1, starmanThemes.Length)]; while (chosenTheme == previousTheme) { chosenTheme = starmanThemes[rnd.Next(1, starmanThemes.Length)]; } previousTheme = chosenTheme; // get the settings when Starman is activated ScriptSettings tss = ScriptSettings.Load(@"scripts\Starman.ini"); volume = float.Parse(tss.GetValue("Settings", "Volume", "0.4")); tss = null; audioReader = new AudioFileReader("scripts/starman/" + chosenTheme + ".mp3"); audioReader.Volume = volume; DelayFadeOutSampleProvider fadeOut = new DelayFadeOutSampleProvider(audioReader); fadeOut.BeginFadeOut((starmanTime * 1000) - (fadeOutTime * 1000), fadeOutTime * 1000); waveOut = new WaveOutEvent(); waveOut.PlaybackStopped += waveOut_PlaybackStopped; waveOut.Init(fadeOut); waveOut.Play(); btb = new BarTimerBar("STARMAN POWER"); btb.Percentage = 1; btb.ForegroundColor = ExtendedColor.HSL2RGB(0, 1, 0.5); btb.BackgroundColor = ExtendedColor.HSL2RGB(0, 1, 0.3); tbPool.Add(btb); activated = true; SetInvulnerability(activated); }
public WcfForeignKeyPropertiesDtos(MyMeta.ITable table, RequestContext context) { this._context = context; this._table = table; this._script = context.ScriptSettings; this.output = context.Zeus.Output; }
/// <summary> /// Write our property values to the ini at <see cref="Path"/>. /// </summary> public void Write() { // Initialize variables. var type = GetType(); var properties = type.GetProperties(); var settings = ScriptSettings.Load(Path); // Loop through each of our properties. foreach (var property in properties) { // Get the serialized property and // validate it. var sp = TryGetSerializedProperty(property); if (sp == null) { continue; } // Now determine how to read this variable. GetInfo(property, sp, out var key, out var section, out var _); // Get and set the value. try { settings.SetValue(section, key, property.GetValue(this)); } catch { // ignored } } // Save the settings. settings.Save(); }
void OnGUI() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); if (scriptSettings == null) { scriptSettings = new ScriptSettings(); scriptSettings.FolderPath = FindCurrentFolderPath(); } scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, true, GUIStyle.none, GUI.skin.verticalScrollbar, GUIStyle.none); var editor = Editor.CreateEditor(scriptSettings); if (editor != null) { editor.OnInspectorGUI(); } EditorGUILayout.EndScrollView(); GUILayout.Space(5f); if (GUILayout.Button("Create script")) { CreateScript(scriptSettings); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); // The actual window code goes here }
bool DontSpawnOnfoot; // to make it work with assault teams mod public UndercoverCops() { IniSettings = ScriptSettings.Load("scripts\\Config.ini"); spawnrange = IniSettings.GetValue <int>("CONFIG", "SpawnRange", 100); DontSpawnOnfoot = IniSettings.GetValue <bool>("CONFIG", "DontSpawnOnfoot", false); Tick += update; Interval = interval; }
public ORMFrameworkBase(IDataStore dataStore, RequestContext context) : base(context.Zeus.Output) { this._dataStore = dataStore; this._context = context; this._script = context.ScriptSettings; this._database = context.Database; this._dialog = context.Dialog; }
/// <summary> /// Creates a new instance of ScriptEngine. /// </summary> /// <param name="Settings">The settings associated to the script engine.</param> /// <param name="scriptcheckinterval">The interval between each script update.</param> public ScriptEngine(ScriptSettings Settings, int scriptcheckinterval) { this.checkInterval = scriptcheckinterval; this.Settings = Settings; scriptCollection = new ScriptCollection(Settings); //scriptCheckerThread = new ProjectX_V3_Lib.Threading.BaseThread(new Threading.ThreadAction(Check_Updates), // scriptcheckinterval, "Script Engine"); //scriptCheckerThread.Start(); }
//public GenColumn(MyMeta.IColumn column, Zeus.IZeusOutput outputDest, MyMeta.ITable table, Dnp.Utils.Utils dnp) public GenColumn(MyMeta.IColumn column, MyMeta.ITable table, RequestContext context) { m_IColumn = column; script = ScriptSettings.GetInstance(); output = context.Zeus.Output; _util = new CommonUtility(); _table = table; m_DnpUtils = context.ScriptSettings.DnpUtils; }
public OptionsBlock(string json = null) : base(ScriptConstants.Blocks.Options, json) { if (json != null) return; Text = "Script settings initialized through direct assignment."; Settings = new ScriptSettings(); IsValid = true; }
void LoadSettings(string filepath) { try { Config = ScriptSettings.Load(filepath); activate = Config.GetValue("Keys", "Activate", "U"); name = Config.GetValue("Settings", "YourName", "127"); } catch (Exception e) { UI.Notify("~r~ERROR ~w~loading .ini file, ~b~make sure it exists."); UI.ShowSubtitle("~r~error: \n" + e.ToString()); } }
public override IReadOnlyList<string> Parse() { if (Settings != null) return EmptyStringList; try { if (Text.StartsWith("{") == false) Text = '{' + Text + '}'; Settings = JsonConvert.DeserializeObject<ScriptSettings>(Text); IsValid = true; } catch (JsonReaderException) { IsValid = false; } return EmptyStringList; }
public danknet() { settings = ScriptSettings.Load(configfile); this.View.MenuTransitions = true; Tick += OnTick; this.KeyDown += this.OnKeyDown; if (this.settings == null) { File.Create(configfile).Close(); File.WriteAllText(configfile, ("[" + sectionname + "]"+ Environment.NewLine + "Enable/Disable_Menu = F6" + Environment.NewLine + "Forward_on_noclip = W" + Environment.NewLine + "Back_on_noclip = S" + Environment.NewLine + "Left_on_noclip = A" + Environment.NewLine + "Right_on_noclip = D" + Environment.NewLine + "Increase_speed_on_noclip = Add" + Environment.NewLine + "Increase_speed_on_noclip = Subtract")); this.settings = ScriptSettings.Load(configfile); this.settings.SetValue<Keys>(sectionname, "Enable/Disable_Menu", Keys.F6); this.settings.SetValue<Keys>(sectionname, "Forward_on_noclip", Keys.W); this.settings.SetValue<Keys>(sectionname, "Back_on_noclip", Keys.S); this.settings.SetValue<Keys>(sectionname, "Left_on_noclip", Keys.A); this.settings.SetValue<Keys>(sectionname, "Right_on_noclip", Keys.D); this.settings.SetValue<Keys>(sectionname, "Increase_speed_on_noclip", Keys.Add); this.settings.SetValue<Keys>(sectionname, "Decrease_speed_on_noclip", Keys.Subtract); } if (File.Exists(tpfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(tpfilename)); //x newline y newline z newline name string nagme; //name Vector3 vec = new Vector3(); int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { vec.X = float.Parse(readed); } else if (no == 2) { vec.Y = float.Parse(readed); } else if (no == 3) { vec.Z = float.Parse(readed); } else if (no == 4) { nagme = readed; no = 0; tplist.Add(vec, nagme); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(tpfilename).Close(); } if (File.Exists(mdlfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(mdlfilename)); //name newline int of model string nagme = ""; //name int mdlno; int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { nagme = readed; } else if (no == 2) { mdlno = int.Parse(readed); no = 0; mdllist.Add(nagme, mdlno); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(mdlfilename).Close(); } if (File.Exists(pedfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(pedfilename)); //name newline int of model string nagme = ""; //name int mdlno; int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { nagme = readed; } else if (no == 2) { mdlno = int.Parse(readed); no = 0; pedlist.Add(nagme, mdlno); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(pedfilename).Close(); } }
/// <summary> /// Gets the namespace code for vb. /// </summary> /// <returns>Returns the namespace code.</returns> private static string getns2(ScriptSettings Settings) { StringBuilder namespaceBuilder = new StringBuilder(); foreach (string _namespace in Settings._namespaces.Values) { namespaceBuilder.Append("Imports ").Append(_namespace).Append(Environment.NewLine); } return namespaceBuilder.ToString(); }
public static void SetNamespaces(ScriptSettings settings) { Content = Content.Replace("__namespace__", getns(settings)); Content2 = Content2.Replace("__namespace__", getns2(settings)); }
/// <summary> /// Constructs a instance of script context /// </summary> /// <param name="scriptConfig">Configuration settings of processing script assets</param> public ScriptContext(ScriptSettings scriptConfig) : base(scriptConfig) { }
/// <summary> /// Loads the global script settings. /// </summary> public static void LoadSettings() { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("\tLoading Script Settings..."); cssettings = new ScriptSettings(); cssettings.AddNamespace("System"); cssettings.AddNamespace("ProjectX_V3_Game.Entities"); cssettings.AddNamespace("ProjectX_V3_Game.Core"); cssettings.AddNamespace("ProjectX_V3_Game.Data"); cssettings.AddNamespace("ProjectX_V3_Game.Calculations"); cssettings.AddNamespace("ProjectX_V3_Game.Packets.Message"); cssettings.AddNamespace("ProjectX_V3_Game.Packets"); cssettings.AddNamespace("ProjectX_V3_Game.Maps"); cssettings.AddNamespace("ProjectX_V3_Game.Tournaments"); cssettings.AddNamespace("ProjectX_V3_Game.Packets.NPC"); // will add some functions to this later, not entirely npc restricted, but mostly hence why it's also used by ItemScripts! ScriptEngine.SetNamespaces(cssettings); cssettings.Framework = "v4.0"; cssettings.Language = ScriptLanguage.CSharp; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("\tLoaded Script Settings..."); }
/// <summary> /// Creates a new instance of ScriptCollection. /// </summary> /// <param name="Settings">The settings associated with the script engine.</param> public ScriptCollection(ScriptSettings Settings) { scripts = new ConcurrentDictionary<uint, MethodInfo>(); this.Settings = Settings; }
void ParseSettings() { try { Config = ScriptSettings.Load(@".\scripts\DragRace.ini"); activateKey = Config.GetValue("Keys", "OpenMenu", "O"); disableKey = Config.GetValue("Keys", "ManualEndRace", "NumPad1"); maxSpeed = Config.GetValue<int>("OpponentSettings", "MaxSpeed", 200); custom1x = Config.GetValue<int>("Race1", "X", -1959); custom1y = Config.GetValue<int>("Race1", "Y", 600); custom1z = Config.GetValue<int>("Race1", "Z", 119); custom2x = Config.GetValue<int>("Race2", "X", 497); custom2y = Config.GetValue<int>("Race2", "Y", -1132); custom2z = Config.GetValue<int>("Race2", "Z", 29); customs3x = Config.GetValue<int>("Race3", "StartX", 0); customs3y = Config.GetValue<int>("Race3", "StartY", 0); customs3z = Config.GetValue<int>("Race3", "StartZ", 0); custom3x = Config.GetValue<int>("Race3", "EndX", 0); custom3y = Config.GetValue<int>("Race3", "EndY", 0); custom3z = Config.GetValue<int>("Race3", "EndZ", 0); customh3 = Config.GetValue<int>("Race3", "StartHeading", 270); } catch { UI.Notify("There was an error loading the configuration file (.ini) make sure it exists!"); } }
public yolonet() { settings = ScriptSettings.Load(configfile); this.View.MenuTransitions = true; Tick += OnTick; this.KeyDown += this.OnKeyDown; CheckForUpdate(); if (File.Exists("scripts//yolonet.dev")) { //testmode is debug mode, you don't need to use it. isontestmode = true; } if (File.Exists("scripts//controllermode.txt")) { controllermode = true; UI.Notify("Controller Mode is not working yet. It'll come l8r"); UI.Notify("*Insert skeleton pic* arda will surely deliver"); } if (File.Exists("scripts//nonumpadmode.txt")) { this.BackKey = Keys.Q; this.DownKey = Keys.S; this.UpKey = Keys.W; this.LeftKey = Keys.S; this.RightKey = Keys.D; this.ActivateKey = Keys.E; UI.Notify("No numpad mode on."); } if (this.settings == null) { File.Create(configfile).Close(); File.WriteAllText(configfile, ("[" + sectionname + "]" + Environment.NewLine + "Enable/Disable_Menu = F6" + Environment.NewLine + "Forward_on_noclip = W" + Environment.NewLine + "Back_on_noclip = S" + Environment.NewLine + "Left_on_noclip = A" + Environment.NewLine + "Right_on_noclip = D" + Environment.NewLine + "Increase_speed_on_noclip = Add" + Environment.NewLine + "Increase_speed_on_noclip = Subtract")); this.settings = ScriptSettings.Load(configfile); this.settings.SetValue<Keys>(sectionname, "Enable/Disable_Menu", Keys.F6); this.settings.SetValue<Keys>(sectionname, "Forward_on_noclip", Keys.W); this.settings.SetValue<Keys>(sectionname, "Back_on_noclip", Keys.S); this.settings.SetValue<Keys>(sectionname, "Left_on_noclip", Keys.A); this.settings.SetValue<Keys>(sectionname, "Right_on_noclip", Keys.D); this.settings.SetValue<Keys>(sectionname, "Increase_speed_on_noclip", Keys.Add); this.settings.SetValue<Keys>(sectionname, "Decrease_speed_on_noclip", Keys.Subtract); } if (File.Exists(tpfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(tpfilename)); //x newline y newline z newline name string nagme; //name Vector3 vec = new Vector3(); int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { vec.X = float.Parse(readed); } else if (no == 2) { vec.Y = float.Parse(readed); } else if (no == 3) { vec.Z = float.Parse(readed); } else if (no == 4) { nagme = readed; no = 0; tplist.Add(vec, nagme); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(tpfilename).Close(); } if (File.Exists(mdlfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(mdlfilename)); //name newline int of model string nagme = ""; //name int mdlno; int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { nagme = readed; } else if (no == 2) { mdlno = int.Parse(readed); no = 0; mdllist.Add(nagme, mdlno); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(mdlfilename).Close(); } if (File.Exists(pickupfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(pickupfilename)); //name newline int of model string nagme = ""; //name int mdlno; int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { nagme = readed; } else if (no == 2) { mdlno = int.Parse(readed); no = 0; pickuplist.Add(nagme, mdlno); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(pickupfilename).Close(); } if (File.Exists(pedfilename)) { List<string> readen = new List<string>(); readen.AddRange(File.ReadAllLines(pedfilename)); //name newline int of model string nagme = ""; //name int mdlno; int no = 0; foreach (string readed in readen) { no++; try { if (no == 1) { nagme = readed; } else if (no == 2) { mdlno = int.Parse(readed); no = 0; pedlist.Add(nagme, mdlno); } } catch { //this one is dangerous, file with bad format can crash script. } } } else { File.Create(pedfilename).Close(); } }