Example #1
0
        void writesettings(Settings TmpSet)
        {
            using (StreamWriter sw = new StreamWriter(Environment.GetEnvironmentVariable("APPDATA") + "\\DiceBot2\\Psettings"))
            {
                sw.WriteLine("new");
                string temp2 = TmpSet.txtJDUser.Text + "," + TmpSet.txtJDPass.Text + ",";
                if (TmpSet.chkJDAutoLogin.Checked)
                    temp2 += "1,";
                else temp2 += "0";
                if (TmpSet.chkJDAutoStart.Checked)
                    temp2 += "1,";
                else temp2 += "0";
                string jdline = "";

                foreach (char c in temp2)
                {
                    jdline += ((int)c).ToString(System.Globalization.NumberFormatInfo.InvariantInfo) + " ";
                }
                sw.WriteLine(jdline);

                ////tray,botname,enableemail,emailaddress,emailwithdraw,emailinvest,emaillow,emailstreak,emailstreakval
                string msg = "";
                msg = (TmpSet.chkTray.Checked) ? "1" : "0";
                sw.WriteLine("tray|"+msg);
                sw.WriteLine("botname|" + TmpSet.txtBot.Text);
                msg = (TmpSet.chkEmail.Checked) ? "1" : "0";
                sw.WriteLine("enableemail|"+msg);
                sw.WriteLine("emailaddress|" + TmpSet.txtEmail.Text);
                msg = (TmpSet.chkEmailWithdraw.Checked) ? "1" : "0";
                sw.WriteLine("emailwithdraw|"+msg);
                msg = (TmpSet.chkEmailLowLimit.Checked) ? "1" : "0";
                sw.WriteLine("emaillow|"+msg);
                msg = (TmpSet.chkEmailStreak.Checked) ? "1" : "0";
                sw.WriteLine("emailstreak|"+msg);
                sw.WriteLine("emailstreakval|" + TmpSet.nudEmailStreak.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
                if (Emails == null)
                {
                    Emails = new Email("","");
                    Emails.SMTP = "emails11.secureserver.net";
                }
                sw.WriteLine("SMTP|" + Emails.SMTP);

                ////soundcoin,soundalarm,soundlower,soundstrea,soundstreakvalue

                msg = (TmpSet.chkSoundWithdraw.Checked) ? "1" : "0";
                sw.WriteLine("CoinEnabled|" + msg);
                sw.WriteLine("CoinPath|" + TmpSet.txtPathChing.Text);
                msg = (TmpSet.chkAlarm.Checked) ? "1" : "0";
                sw.WriteLine("AlarmEnabled|" + msg);
                msg = (TmpSet.chkSoundLowLimit.Checked) ? "1" : "0";
                sw.WriteLine("AlarmLowEnabled|" + msg);
                msg = (TmpSet.chkSoundStreak.Checked) ? "1" : "0";
                sw.WriteLine("AlarmStreakEnabled|" + msg);

                sw.WriteLine("AlarmStreakValue|" + TmpSet.nudSoundStreak.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
                sw.WriteLine("AlarmPath|" + TmpSet.txtPathAlarm.Text);

                sw.WriteLine("AutoGetSeed|"+ (autoseeds?"1":"0"));
                sw.WriteLine("NumLiveBets|" + TmpSet.nudLiveBetsNum.Value);

                sw.WriteLine("DonatePercentage|" +TmpSet.nudDonatePercentage.Value );
                sw.WriteLine("StartupMessage|" + (TmpSet.chkStartup.Checked?"1":"0"));
                sw.WriteLine("DonateMode|"+ (TmpSet.rdbDonateDont.Checked?"1":TmpSet.rdbDonateDefault.Checked?"2":"3"));

            }
        }
Example #2
0
        public cDiceBot()
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            Thread.CurrentThread.CurrentUICulture =  new CultureInfo("en-US");
            sqlite_helper.CheckDBS();
            InitializeComponent();
            PopulateSaveNames();
            PopoutChat.SendMessage += PopoutChat_SendMessage;
            SimWindow = new Simulate(this);
            StatsWindows.btnResetStats.Click += btnResetStats_Click;

            ControlsToDisable = new Control[] { btnApiBetHigh, btnApiBetLow, btnWithdraw, btnInvest, btnTip, btnStartHigh, btnStartLow, btnStartHigh2, btnStartLow2, btnMPWithdraw, btnMPDeposit };
            EnableNotLoggedInControls(false);
            basicToolStripMenuItem.Checked = true;
            chrtEmbeddedLiveChart.Series[0].Points.AddXY(0, 0);
            chrtEmbeddedLiveChart.ChartAreas[0].AxisX.Minimum = 0;
            #region tooltip Texts
            ToolTip tt = new ToolTip();
            tt.SetToolTip(gbZigZag , "After every n bets/wins/losses \n(as specified to the right), \nthe bot will switch from \nbetting high to low or vica verca");
            tt.SetToolTip(lblLowLimit,
                "When your balance goes below this\n" +
                "value, the bot will stop playing.\n" +
                "actions specified below");

            tt.SetToolTip(lblLimit,
                    "When your balance reaches this\n"+
                    "value, the bot will do one of \n" +
                    "the actions specified below.");

                tt.SetToolTip(lblLowLimit,
                "When your balance goes below this\n" +
                "value, the bot will stop playing.\n" +
                "actions specified below");
                tt.SetToolTip( lblAction,
                "The selected action will occur when\n" +
                "your balance goes above the limit as\n" +
                "specified above");
                tt.SetToolTip( lblAmount,
                "The amount that will be invested\n" +
                "or deposited when the limit is reached");
                tt.SetToolTip( lblAddress,
                "Btc Address that the funds get" +
                "withdrawn to\n");
                tt.SetToolTip( lblMinBet,
                "This is the first bet to be placed,\n" +
                "upon win, bet will reset to this value\n");
                tt.SetToolTip( lblChance,
                "Chance of winning, as entered into \n" +
                "the site\n");
                tt.SetToolTip( lblMultiplier,
                "Upon a loss, the bet will be \n" +
                "multiplied by this value. See\n" +
                "Max multiplies and After as well");
            tt.SetToolTip( lblMaxMultiplier,
                "In a losing streak, the bet will\n" +
                "will be multiplied untill the streak\n" +
                "reaches "+nudMaxMultiplies.Value.ToString("0.00000") +" bets. The following bets\n"+
                "will be with the same amount");
                tt.SetToolTip( lblAfter,
                "with every " + nudNbets.Value + " losses in a row,\n" +
                "the muliplier will be multiplied with\n" +
                nudDevider.Value.ToString("0.00000")+". The idea is to decrease the size\n"+
                "the multiplier, keep the value between\n"+
                "0.9 and 0.5. Minimum Multiplier is 1");
                tt.SetToolTip( lblAfter2,
            "with every " + nudNbets.Value.ToString() + " losses in a row,\n" +
            "the muliplier will be multiplied with\n" +
            nudDevider.Value.ToString("0.00000") + ". The idea is to decrease the size\n" +
            "the multiplier, keep the value between\n" +
            "0.9 and 0.5. Minimum Multiplier is 1");
                tt.SetToolTip( lblDevider,
            "with every " + nudNbets.Value.ToString() + " losses in a row,\n" +
            "the muliplier will be multiplied with\n" +
            nudDevider.Value.ToString("0.00000") + ". The idea is to decrease the size\n" +
            "the multiplier, keep the value between\n" +
            "0.9 and 0.5. Minimum Multiplier is 1");

            #endregion
                primeDiceToolStripMenuItem.Checked = true;

                bool frst = true;
            foreach (string s in dice999.cCurrencies)
            {
                ToolStripMenuItem tmpItem = new ToolStripMenuItem{ Text=s};

                if (frst)
                {
                    tmpItem.Checked = true;
                    frst = false;
                }

                diceToolStripMenuItem.DropDown.Items.Add(tmpItem);
                tmpItem.Click += btcToolStripMenuItem_Click;

                tmpItem.CheckedChanged += btcToolStripMenuItem_CheckedChanged;

            }

            foreach (string s in SafeDice.cCurrencies)
            {
                ToolStripMenuItem tmpItem = new ToolStripMenuItem { Text = s };

                if (frst)
                {
                    tmpItem.Checked = true;
                    frst = false;
                }

                safediceToolStripMenuItem.DropDown.Items.Add(tmpItem);
                tmpItem.Click += btcToolStripMenuItem_Click;

                tmpItem.CheckedChanged += btcToolStripMenuItem_CheckedChanged;

            }

            foreach (string s in bitdice.cCurrencies)
            {
                ToolStripMenuItem tmpItem = new ToolStripMenuItem { Text = s };

                if (frst)
                {
                    tmpItem.Checked = true;
                    frst = false;
                }

                bitDiceToolStripMenuItem.DropDown.Items.Add(tmpItem);
                tmpItem.Click += btcToolStripMenuItem_Click;

                tmpItem.CheckedChanged += btcToolStripMenuItem_CheckedChanged;

            }
            foreach (string s in CoinMillions.cCurrencies)
            {
                ToolStripMenuItem tmpItem = new ToolStripMenuItem { Text = s };

                if (frst)
                {
                    tmpItem.Checked = true;
                    frst = false;
                }

                coinMillionsToolStripMenuItem.DropDown.Items.Add(tmpItem);
                tmpItem.Click += btcToolStripMenuItem_Click;

                tmpItem.CheckedChanged += btcToolStripMenuItem_CheckedChanged;

            }

            if (!File.Exists(Environment.GetEnvironmentVariable("APPDATA") + "\\DiceBot2\\settings"))
            {
                if (MessageBox.Show("Dice Bot has detected that there are no default settings saved on this computer."+
                    "If this is the first time you are running Dice Bot, it is highly recommended you see the begginners guide"+
                    "\n\nGo to Beginners Guide now?", "Warning", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                {
                    Process.Start("https://bot.seuntjie.com/GettingStarted.aspx");
                }
                try
                {

                    Directory.CreateDirectory(Environment.GetEnvironmentVariable("APPDATA") + "\\DiceBot2");
                }
                catch
                {

                }
            }
            else
            {
                if (Emails == null)
                    Emails = new Email("", "");
                load();
                loadsettings();

            }

            tmStop.Enabled = true;

            Thread tGetVers = new Thread(new ThreadStart(getversion));
            tGetVers.Start();
            populateFiboNacci();

            if (autologin)
            {
                CurrentSite.FinishedLogin -= CurrentSite_FinishedLogin;
                CurrentSite.FinishedLogin += CurrentSite_FinishedLogin;
                CurrentSite.Login(username, password , txtApi2fa.Text);

            }
            Lua.RegisterFunction("withdraw",this, new dWithdraw(luaWithdraw).Method);
            Lua.RegisterFunction("invest", this, new dInvest(luainvest).Method);
            Lua.RegisterFunction("tip", this, new dtip(luatip).Method);
            Lua.RegisterFunction("stop", this, new dStop(luaStop).Method);
            Lua.RegisterFunction("resetseed", this, new dResetSeed(luaResetSeed).Method);
            Lua.RegisterFunction("print", this, new dWriteConsole(WriteConsole).Method);
            Lua.RegisterFunction("getHistory", this, new dluagethistory(luagethistory).Method);
            Lua.RegisterFunction("getHistoryByDate", this, new dluagethistory2(luagethistory).Method);
            Lua.RegisterFunction("getHistoryByQuery", this, new dQueryHistory(QueryHistory).Method);
            Lua.RegisterFunction("runsim",this, new dRunsim(runsim).Method);
            Lua.RegisterFunction("martingale", this, new dStrat(LuaMartingale).Method);
            Lua.RegisterFunction("labouchere", this, new dStrat(LuaLabouchere).Method);
            Lua.RegisterFunction("fibonacci", this, new dStrat(LuaFibonacci).Method);
            Lua.RegisterFunction("dalembert", this, new dStrat(LuaDAlember).Method);
            Lua.RegisterFunction("presetlist", this, new dStrat(LuaPreset).Method);
            Lua.RegisterFunction("resetstats", this, new dResetStats(resetstats).Method);
            Lua.RegisterFunction("setvalueint", this, new dSetValue(LuaSetValue).Method);
            Lua.RegisterFunction("setvaluestring", this, new dSetValue1(LuaSetValue).Method);
            Lua.RegisterFunction("setvaluedouble", this, new dSetValue2(LuaSetValue).Method);
            Lua.RegisterFunction("setvaluebool", this, new dSetValue3(LuaSetValue).Method);
            Lua.RegisterFunction("getvalue", this, new dGetValue(LuaGetValue).Method);
            Lua.RegisterFunction("loadstrategy", this, new dLoadStrat(LuaLoadStrat).Method);
            Lua.RegisterFunction("read", this, new dGetInput(GetInputForLua).Method);
        }