Results 1 to 7 of 7

Thread: Hello, this is my first script and i need some help

  1. #1
    Join Date
    Apr 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Hello, this is my first script and i need some help

    I'm making a little bot for my dofus character.

    Here i go

    Code:
    program Sadida;
    var x,y,i,x1,x2,y1,y2: integer;
    
    function Combat:boolean;
    begin
    result:= false;
    end;
    
    procedure Target;
    begin
      x1:=174;
      x2:=1266;
      y1:=46;
      y2:=683;
      repeat
      if(FindColor(x,y,10125919,x1+50,y1+50,x2+50,y2+50))= true then
      begin
      movemouse(x,y);
      x1:=x;
      x2:=x;
      y1:=y;
      y2:=y;
      end;
      until(combat=true)
    end;
    
    begin
    repeat
     Target;
    until(false)
    end.
    I want that my mouse will follow that moving pixel until the combat starts, but it doesn't work .

  2. #2
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Post

    Code:
    program Sadida;
    
    var 
      x,y,i,x1,x2,y1,y2: integer;
    
    const
      x1:=174;
      x2:=1266;
      y1:=46;
      y2:=683;
    
    function Combat:boolean;
    begin
      result:= false;
    end;
    
    procedure Target;
    begin
      repeat
        if(FindColor(x,y,10125919,x1,y1,x2,y2)) then
        begin
          MMouse(x,y,3,3);
        end;
      until(combat=true)
    end;
    
    begin
      SetupSRL;
      AcivateClient;
      repeat
        Target;
      until(false)
    end.
    This will follow the color "10125919" around, in an infinite loop, because your combat function doesn't do anything, except return false.

    But if its something like attacking a NPC you should click on it by using
    Code:
     
    procedure target;
    begin
      repeat
        if(FindColor(x,y,10125919,x1,y1,x2,y2)) then
        begin
          //add failsafe here, like isuptext, etc
         Mouse(x,y,5,5,true);
        end;
      until(combat=true);
    end;

    I dont play Dofus myself, so i dont know what i would be clicking on or how to add failsafes like runescape's.
    Last edited by mc_teo; 04-08-2009 at 09:51 AM.

  3. #3
    Join Date
    Apr 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know, i'm still building it, for now i just want to see it working piece by piece, that's why i made combat resulting always false.

    Why did you put x1,y1,x2,y2 as const? They are supposed to change.

    MMouse(x,y,3,3) what is this?

    Sorry for being a noob, i'm trying to learn

  4. #4
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its ok...

    Code:
    Procedure MMouse(x,y,rx,ry:integer)
    this just means Move Mouse to coordinates (x,y), while not going in a very computer straight line

    try this...
    Code:
    program New;
    {.include SRL/SRL.scar}
    
    begin
      MouseSpeed := 5;
      MMouse(880,350,20,20);
    end.
    this sets the mouse to move slower so you can see what MMouse actually does.

    the third and fourth numbers are for randomness...
    5 is the norm, as these set how close to the exact spot you want it to move. setting it 5 means it will look like a human's wobbly hand moving the mouse, yet moving where you want to go.


    I set x1,y1,x2,y2 to constant, because i thought they were the border, of the game screen, in which case you wouldn't want them to change...


    So what is it you want this script to eventually do?

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you forgot SetupSRL; mc_teo


    and I hope you will change the Combat function, as it's completely useless =X

    1. Results are False to begin with.. so that could just be function Combat: Boolean; begin end; and it would be the same =X

    2. it doesn't do anything

    Good luck

    If you want help with this, I can help you

    pm or add me on MSN.. panic._@live.com

  6. #6
    Join Date
    Apr 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, since there could be multiple monsters with that same color on that map, i thought that after finding the first mob, the script should follow that color only in a restricted area( Where the Target mob actually is.) that's why i've put x1,x2,y1,y2.
    I hope you understand what i'm trying to do :P
    99_ you're awesome i'm adding you :P
    Last edited by FLCL; 04-08-2009 at 11:57 AM.

  7. #7
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay... so your trying to target a specific monster?

    does anything show up if you hover your mouse over it...

    ill post a screenie in a min to show you



    when the mouse is over the man, it says attack man in the cornor,

    does anything like this happen to you?

    also add me on msn mc_teo@live.ie for more help
    Last edited by mc_teo; 04-08-2009 at 12:14 PM. Reason: added screenie

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •