예제 #1
0
void handle_sent_chat_message(vector<char> packet, reader r){
	Bot* my_bot = Bot::instance();
	string message;

	r.read(U);
	r.read(message);

	// create stream with message
	stringstream stream;
	stream.str(message);

	// process
	string command;
	stream >> command;
	if (command == "/start"){
		my_bot->state = E_STATE_NOENEMY;

		// store star coords to save starting coords
		my_bot->start_X = my_bot->X;
		my_bot->start_Y = my_bot->Y;

		//GET FIRST PARAMETER
		//int whatever;
		//stream >> whatever;
		//cout << "Started with parameter " << whatever << endl;
	}
	else if (command == "/stop"){
		my_bot->state = E_STATE_STOPPED;
	}
	else if (command == "/monsters"){
		cout << "MONSTERS:" << endl;
		for each(auto mob in my_bot->monsters){
			cout << "Mob ID:" << mob.second.ID << ", coords: [" << mob.second.X << ", " << mob.second.Y << "]" << endl;
		}
	}
예제 #2
0
void handle_rest_packet(vector<char> packet, reader r){
	byte param;

	r.read(U);
	r.read(param);
	
	cout << "Rest packet sent with param: " << dec << (int)param << endl;
}
예제 #3
0
void handle_load_player(vector<char> packet, reader r){
	DWORD player_ID, p1, p2;
	r.read(U);
	r.read(player_ID);
	r.read(p1);
	r.read(p2);
	//cout << "Selected player ID = " << player_ID << endl;
}
예제 #4
0
void handle_use_item_packet(vector<char> packet, reader r){
	DWORD param;

	r.read(U);
	r.read(param);

	cout << "used item ID: " << hex << (int)param << endl;
}
예제 #5
0
void handle_skill_attack(vector<char> packet, reader r){
	DWORD monster_ID;
	byte skill_ID, p1;
	r.read(U);
	r.read(skill_ID);
	r.read(p1);
	r.read(monster_ID);
	cout << dec << "sent: Attack with Skill: skill_id=" << (int)skill_ID << ", p1 = " << (int)p1 << ", monster_id = " << (int)monster_ID << "time: " << GetTickCount() << endl;
}
예제 #6
0
void handle_preskill(vector<char> packet, reader r){
	DWORD monster_id;
	byte skill_id;
	r.read(U);
	r.read(skill_id);
	r.read(monster_id);
	cout << dec << "sent: Preskill with skill_id = " << (int)skill_id << ", monster_id = " << (int)monster_id << "time: " << GetTickCount() << endl;

}
예제 #7
0
void handle_attack(vector<char> packet, reader r){
	DWORD monster_ID, p2;
	byte p1;
	r.read(U);
	r.read(p1);
	r.read(monster_ID);
	r.read(p2);
	cout << dec << "sent: Attack, p1=" << (int)p1 << ", monster_id=" << (int)monster_ID << ", p3=" << (int)p2 << "time: " << GetTickCount() << endl;
}
예제 #8
0
void handle_move_end_packet(vector<char> packet, reader r){
	Bot* my_bot = Bot::instance();
	signed char dX, dY, dZ;
	r.read(U);
	r.read(dX);
	r.read(dY);
	r.read(dZ);
	my_bot->X += dX;
	my_bot->Y += dY;
	my_bot->Z += dZ;
	cout << "sent move end packet" << endl;
}
예제 #9
0
void handle_check_version_packet(vector<char> packet, reader r){
	// init maps in bot
	Bot* my_bot = Bot::instance();
	my_bot->setup();
	
	//read U
	r.read(U);

	// send login
	send_login_packet();
	//cout << "sent login packet" << endl;
}
symbol * assembler::read(symbol & ans)
{ string s = rdr.read();
  return identify(s, ans); }