Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-02-20 04:04:13

goeyfun
Member
From: Mighty Japan
Joined: 2015-02-18
Posts: 667

[Question] Reconnect Problem LOL.. I'm so Stupid =_=

Sometimes users can spam and crash the bot, but besides from not listening to spamming request, how can i recover and reconnect the bot? cuz it seems like it's not really working. Do i have to reset any variables?

con.OnDisconnect += delegate(object sender, string error)
                {
                    Program p = new Program();
                    connect(p.email, p.pass, p.worldid, p.accountOption);
                    return;
                }
static void connect(string a, string b, string c, int accountOption)
        {

            Console.WriteLine("[Bot] Trying to login...");
//..... More to go
        }

Ug3JzgO.png

Offline

#2 2015-02-20 09:12:04

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

Try changing this:

con.OnDisconnect += delegate(object sender, string error)
                {
                    Program p = new Program();
                    connect(p.email, p.pass, p.worldid, p.accountOption);
                    return;
                }

to this:

con.OnDisconnect += delegate(object sender, string error)
                {
                    Thread.Sleep(100); // just to prevent stack over flow
                    Program p = new Program();
                    connect(p.email, p.pass, p.worldid, p.accountOption);
                    return;
                }

If doesn't work, don't ask me.


http://i.imgur.com/bjvgH5L.png?1

Offline

#3 2015-02-20 16:23:57

Processor
Member
Joined: 2015-02-15
Posts: 2,246

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

marcoantonimsantos wrote:

Thread.Sleep(100); // just to prevent stack over flow

Congrats! I'm nominating you for http://www.thedailywtf.com/!

--------------
On-topic:

You should probably not create a new Program(), because that instance will probably not contain an email/pass/worldid... How about using "this.email", "this.pass", etc.?


I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.

Offline

#4 2015-02-20 16:27:57

ZeldaXD
EE Homeboy
From: Cyprus
Joined: 2015-02-15
Posts: 1,539
Website

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

how about not even using the "this.", whats wrong with those strings.


gLjTZE1.png

Offline

#5 2015-02-20 16:29:17

Processor
Member
Joined: 2015-02-15
Posts: 2,246

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

ZeldaXD wrote:

how about not even using the "this.", whats wrong with those strings.

Just to clarify my intentions. The same code gets generated either way.


I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.

Offline

#6 2015-02-20 17:07:00

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,837

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

You could make your life even easier, goeyfun, and use windows forms. It's a massive handicap to work with console.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#7 2015-02-20 19:05:09, last edited by Zumza (2015-02-20 19:07:06)

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,645

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

con.OnDisconnect += delegate(object sender, string error)
                {
                    connect(email, pass, worldid, accountOption);
                    return;
                }

I hope this will not work but try
I removed the Program object, i dont know why you need to use it.


Everybody edits, but some edit more than others

Offline

#8 2015-02-20 19:11:01

goeyfun
Member
From: Mighty Japan
Joined: 2015-02-18
Posts: 667

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

woohoo~ Thanks <3 Works now.. Yeahhh after getting the algorithm ready, ill move on to a form bot :3


Ug3JzgO.png

Offline

#9 2015-02-20 20:07:52

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,645

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

I just made a quick bot that spam to see the effect.
Conclusions: The final message is not final.... "Final Warning. You have said the same thing 1000 times." But after that i myself stop the bot so.... Hmmmmm


Everybody edits, but some edit more than others

Offline

#10 2015-02-20 21:02:08

goeyfun
Member
From: Mighty Japan
Joined: 2015-02-18
Posts: 667

Re: [Question] Reconnect Problem LOL.. I'm so Stupid =_=

just made a auto detect roomid from clipboard thingy, now no one will complain they dunno how to paste roomid into console bot LOL //forums.everybodyedits.com/img/smilies/tongue


Ug3JzgO.png

Offline

goeyfun1424462528475164

Board footer

Powered by FluxBB

[ Started around 1715019694.4433 - Generated in 0.038 seconds, 12 queries executed - Memory usage: 1.47 MiB (Peak: 1.62 MiB) ]