Making a bot help

10/20/2012 12:45 blackout617#1
Hi i will try to make a bot i think to edit the udobot source for start but udobot it not safe and i fail to edit it :D can anyone give me a source or project file or anything for making a bot or auto bidder or skylab upgrader anything ?or only the login place source i try to make a login bot i will to login with id and pw but i can make only that its write id and pw and stops i cannot make that select server ?I Will start from an easy thing can anyone give me a source or project file that i can edit and make better :) )

Thankss.


And some questions what i need for making a bot ? I have vb6(c++,c# ....)and vb.net..

PLease no negative answers :)
10/20/2012 13:12 ZzEndayZz#2
Quote:
Originally Posted by blackout617 View Post
Hi i will try to make a bot i think to edit the udobot source for start but udobot it not safe and i fail to edit it :D can anyone give me a source or project file or anything for making a bot or auto bidder or skylab upgrader anything ?or only the login place source i try to make a login bot i will to login with id and pw but i can make only that its write id and pw and stops i cannot make that select server ?I Will start from an easy thing can anyone give me a source or project file that i can edit and make better :) )

Thankss.


And some questions what i need for making a bot ? I have vb6(c++,c# ....)and vb.net..

PLease no negative answers :)
BP updated their packets so don't even bother making a bot now.. ;)
10/20/2012 13:27 linksus#3
Sorry, but i think, when you so start to ask how you code a bot, than you don't need to start with a bot....
All ppl who think so, don't finish the own bot...
You must have experience with programming in the language and specific packets.....

I think you should start with tools.... ;)
10/20/2012 13:32 bossfong#4
Code:
			void getBaseInfo(std::string& url)
			{
				net::HTTPRequest req("GET", Poco::URI(url).getPathEtc());
				sess_.sendRequest(req);
				net::HTTPResponse resp;
				std::istream& resp_body_strm = sess_.receiveResponse(resp) >> std::noskipws;
				std::string resp_body = std::string(std::istream_iterator<char>(resp_body_strm), std::istream_iterator<char>());
				resp.getCookies(cookies_);

				if (resp.has("Location"))
				{
					sess_.sendRequest(*makeRequest("GET", "/indexInternal.es?action=internalMapRevolution"));
					net::HTTPResponse resp2;
					resp_body = std::string(std::istream_iterator<char>(sess_.receiveResponse(resp2) >> std::noskipws), std::istream_iterator<char>());
				}

				if (!Util::getBetween(resp_body, std::string("ionID\": \""), std::string("\","), SID_)) 
				{
					error_ = true;
		#ifdef _DEBUG
					std::ofstream f("getBaseInfo.html", std::ios::binary);
					f << resp_body;
		#endif
					return;
				}

				std::string uid_str;
				if (!Util::getBetween(resp_body, std::string("erID\": \""), std::string("\","), uid_str))
				{
					error_ = true;
		#ifdef _DEBUG
					std::ofstream f("getBaseInfo.html", std::ios::binary);
					f << resp_body;
		#endif
					return;
				}
				UID_ = UID(uid_str);

				std::string mapid_str;
				if (!Util::getBetween(resp_body, std::string("apID\": \""), std::string("\","), mapid_str))
				{
					error_ = true;
#ifdef _DEBUG
					std::ofstream f("getBaseInfo.html", std::ios::binary);
					f << resp_body;
#endif
					return;
				}
				mapID_ = atoi(mapid_str.c_str());


				std::string game_id;
				if (!Util::getBetween(resp_body, "\"pid\": \"", "\",",  game_id))
				{
					error_ = true;
#ifdef _DEBUG
					std::ofstream f("getBaseInfo.html", std::ios::binary);
					f << resp_body;
#endif
					return;
				}
				gameID_ = atoi(game_id.c_str());

				
			}
This is what I use to get needed information for the gameclient login. It takes the URL that you get for an active instance login.
To get this URL I do this:
Code:
			bool Authenticate(const std::string& username, const std::string& pw)
			{
				std::string username_enc, pw_enc; // Encode username & pw
				Poco::URI::encode(username, "=&+;", username_enc);
				Poco::URI::encode(pw, "=&+;", pw_enc);

				std::ostringstream req_body_content_strm; // prepare post body
				req_body_content_strm << "loginForm_default_username=" << username_enc << "&loginForm_default_password=" << pw_enc << "&loginForm_default_login_submit=Login";
				std::string req_body_content = req_body_content_strm.str();
		
				net::HTTPRequest req("POST", "/?locale=en&aid=0"); // send request
				req.setContentType("application/x-www-form-urlencoded");
				req.setContentLength(req_body_content.length());
				sess_.sendRequest(req) << req_body_content;
		
				net::HTTPResponse resp; // receive response
				std::istream& resp_body_strm = sess_.receiveResponse(resp);
				resp_body_strm >> std::noskipws;
				std::string resp_body  = std::string(std::istream_iterator<char>(resp_body_strm), std::istream_iterator<char>());
		
				if ((int)resp_body.find("serverSelection_ini ini_active", 0) < 1) // are we logged in?
				{
					/*std::ofstream f("login.html", std::ios::binary);
					f << resp_body;*/
					return false;
				}
		
				authenticated_ = true;
		
				int off = 0; // parse response body
				int found = 0;
				while((found = resp_body.find("serverSelection_ini ini_active", off)) > 0)
				{
					off += found + 2;
					std::string::size_type link_begin_pos = resp_body.find("target=\"", found) + 8;
					std::string::size_type link_end_pos = resp_body.find("\" onclick=", link_begin_pos);
					std::string link = resp_body.substr(link_begin_pos, link_end_pos - link_begin_pos);
					std::string servername = link.substr(7, link.find(".", 0) - 7);
					map_[servername] = link;
				}
				return true;
			}
This is all C++ using the awesome Poco libraries.
This code is not worth copy pasting, to anyone who thinks of doing that, believe me. But you can see how it basically works.
Also note, that this worked a few days ago. I don't know if it still does with the new update.
Also note that this might not be secure in terms of banning. This is optimized to reduce traffic, not for security.

Hope it helps.