Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] Whats wrong with my script?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Orcrist
Grandmaster Cheater
Reputation: 0

Joined: 13 Jul 2008
Posts: 748
Location: Some where under ground =P

PostPosted: Sun Feb 08, 2009 12:35 pm    Post subject: [Help] Whats wrong with my script? Reply with quote

Yeah I'm trying to make a simple Auto Clicker...
And This is my script
Code:
#include <iostream>
#include <windows.h>

int main()
{
   int clickSpeed;
   std::cout << "Hey there lazy bum...Want me to click your mouse for you, Mr.Lazy?\n"   Sleep(500);
   std::cout << "How fats do you want me to click it? Gear 1, Gear2, Gear 3, Gear 4, or Gear 5? Just type in 1, 2, 3, 4, or 5. Don't add the Gear!\n";
   std::cout << "Gear 1... Really Slow!\n";
   std::cout << "Gear 2... Its better...\n";
   std::cout << "Gear 3... Fast.\n";
   std::cout << "Gear 4... WTF SLOW DOWN TOOO FAAAASSSSTTT!!!!!!AAAAWWW!!!!\n";
   std::cout << "Gear 5... Only for the Pros.\n";
   std::cin >> clickSpeed;
   if
      (clickSpeed == 1)
   {
      std::cout << "I'll click for you in 5...\n";
      Sleep(1000);
      std::cout << "4...\n";
      Sleep(1000);
      std::cout << "3...\n";
      Sleep(1000);
      std::cout << "2...\n";
      Sleep(1000);
      std::cout << "1...\n";
      Sleep(1000);


   for
      (;;)
   {
      Sleep(500);
      mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
      std::cout << "I'm clicking Mr.Lazy! Hit the X To stop at the top right!\n";

   }
   }
   
   if
      (clickSpeed == 2)
   {
      std::cout << "I'll click for you in 5...\n";
      Sleep(1000);
      std::cout << "4...\n";
      Sleep(1000);
      std::cout << "3...\n";
      Sleep(1000);
      std::cout << "2...\n";
      Sleep(1000);
      std::cout << "1...\n";
      Sleep(1000);
       
      for
         (;;)
      {
      Sleep(200);
      mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
      std::cout << "I'm clicking Mr.Lazy! Hit the X To stop at the top right!\n";
      }
   }

   if
      (clickSpeed == 3)
   {
      std::cout << "I'll click for you in 5...\n";
      Sleep(1000);
      std::cout << "4...\n";
      Sleep(1000);
      std::cout << "3...\n";
      Sleep(1000);
      std::cout << "2...\n";
      Sleep(1000);
      std::cout << "1...\n";
      Sleep(1000);
      for
         (;;)
      {
      Sleep(100);
      mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
      std::cout << "I'm clicking Mr.Lazy! Hit the X To stop at the top right!\n";
      }
   }

   if
      (clickSpeed == 4)
   {
      std::cout << "I'll click for you in 5...\n";
      Sleep(1000);
      std::cout << "4...\n";
      Sleep(1000);
      std::cout << "3...\n";
      Sleep(1000);
      std::cout << "2...\n";
      Sleep(1000);
      std::cout << "1...\n";
      Sleep(1000);
      for
         (;;)
      {
         Sleep(50);
         mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
          mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
         std::cout << "I'm clicking Mr.Lazy! Hit the X To stop at the top right!\n";
      }
   }

   if
      (clickSpeed == 5)
   {
      std::cout << "I'll click for you in 5...\n";
      Sleep(1000);
      std::cout << "4...\n";
      Sleep(1000);
      std::cout << "3...\n";
      Sleep(1000);
      std::cout << "2...\n";
      Sleep(1000);
      std::cout << "1...\n";
      Sleep(1000);
      for
         (;;)
      {
         Sleep(20);
         mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
          mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
         std::cout << "I'm clicking Mr.Lazy! Hit the X To stop at the top right!\n";
      }
   }
   std::cout << "Wow Yuor IQ is -683! This isn't hard! Try it again....\n";
   system("pause");


               
    return 0;
}


It says on the error box C:\Documents and Settings\Nick\Desktop\Mr.LazyAC.cpp In function `int main()':
and then
Line: 7 File:C:\Documents and Settings\Nick\Desktop\Mr.LazyAC.cpp Message: expected `;' before "Sleep"

My line 7 says
Code:
 std::cout << "Hey there lazy bum...Want me to click your mouse for you, Mr.Lazy?\n"   Sleep(500);

_________________
Back to top
View user's profile Send private message AIM Address
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sun Feb 08, 2009 12:52 pm    Post subject: Reply with quote

Can't you read the error!? it clearly says:
';' expected before "Sleep".
Back to top
View user's profile Send private message MSN Messenger
Orcrist
Grandmaster Cheater
Reputation: 0

Joined: 13 Jul 2008
Posts: 748
Location: Some where under ground =P

PostPosted: Sun Feb 08, 2009 12:56 pm    Post subject: Reply with quote

oh wow im stupid lols....

EDIT: Okay i know this sounds noob but how do i change the text color in it? i just like completely forgot...
My mind just wiped... or somthin lols

_________________
Back to top
View user's profile Send private message AIM Address
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Feb 08, 2009 3:30 pm    Post subject: Reply with quote

SetConsoleTextAttribute()
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Feb 08, 2009 5:29 pm    Post subject: Reply with quote

Why don't you just use some simple math to determine the Sleep() length instead of 123983127 if's?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites