TUG-O-WAR scar need to be tested

Discussion in 'Code Snippets and Tutorials' started by vic_loon46, Jan 8, 2009.

  1. vic_loon46

    vic_loon46 Level I

    Joined:
    Mar 4, 2008
    Messages:
    61
    Likes Received:
    4
    YUP it's me again :D
    this is a new script i made, it is needed to be tested
    (please, do not leech, i've been working on that for weeks)
    feel free to +rep

    Program Tug_o_War;
    Var x,y :integer;

    // By vic_loon46!


    // Auto Plays Tug_o_War
    // Size 750x450
    // Qaulity: Best
    // Will Send Scores Automaticly



    procedure perfectmouse(x, y, xran, yran, xshake, yshake, delay, delran: integer; left: boolean);
    var xx, yy, xx1, yy1, rand: integer;
    begin
    getmousepos(xx, yy);
    getmousepos(xx1, yy1);
    x:= x - xran + random(xran * 2)
    y:= y - yran + random(yran * 2)
    xx:= xx - x
    yy:= yy - y
    repeat
    if (xx > 0)or(xx = 0) then
    begin
    rand:= 1 + random(xshake)
    xx:= xx - (rand)
    xx1:= xx1 - (rand)
    end;
    if xx < 0 then
    begin
    rand:= 1 + random(xshake)
    xx:= xx + (rand)
    xx1:= xx1 + (rand)
    end;
    if (yy > 0)or(yy = 0) then
    begin
    rand:= 1 + random(xshake)
    yy:= yy - (rand)
    yy1:= yy1 - (rand)
    end;
    if yy < 0 then
    begin
    rand:= 1 + random(xshake)
    yy:= yy + (rand)
    yy1:= yy1 + (rand)
    end;
    movemouse(xx1, yy1);
    wait(delay + random(delran));
    until((xx = 0)and(yy = 0))
    wait(delay * 25 + random(delran * 7));
    getmousepos(xx, yy);
    clickmouse(xx, yy, left);
    end;


    Procedure ASDW;
    Begin
    Sendkeys('A');
    Wait(30+Random(50))
    Sendkeys('S');
    Wait(40+Random(50))
    Sendkeys('D');
    Wait(40+Random(50))
    Sendkeys('W');
    Wait(40+Random(50))
    end;


    Procedure StartScreen;
    begin
    If(FindColorTolerance(X,y,1636511,240, 357,240, 357,5)) Then begin
    Wait(1000+Random(1000))
    PerfectMouse(116, 427,1,1,2,2,1,2,True)
    Repeat
    Wait(100+Random(100))
    Until(Not(FindColorTolerance(X,y,1636511,240, 357,240, 357,5)))
    PerfectMouse(243, 216,1,1,2,2,1,2,True);
    Wait(1550+Random(600))
    case random(5) of
    0: PerfectMouse(156, 222,1,1,2,2,1,2,True);
    1: PerfectMouse(267, 220,1,1,2,2,1,2,True);
    2: PerfectMouse(374, 222,1,1,2,2,1,2,True);
    3: PerfectMouse(482, 214,1,1,2,2,1,2,True);
    4: PerfectMouse(588, 221,1,1,2,2,1,2,True);

    end;
    end;
    end;



    Procedure Play;
    begin
    If(FindColorTolerance(X,y,3246790,321, 70,321, 70,5)) Then
    ASDW;
    Wait(50+Random(100))
    SendKeys('A')
    end;


    procedure Ending;
    Begin
    If(FindColorTolerance(x,y,1514783,430, 425,430, 425,5))
    Then begin
    PerfectMouse(460, 426,1,1,2,2,2,2,True);
    Wait(10+Random(10))
    Repeat
    Wait(50+Random(100))
    Until(FindColorTolerance(x,y,16777215,311, 160,311, 160,5))
    Wait(500+Random(500))
    PerfectMouse(298, 155,1,1,2,2,1,2,True);
    Wait(4000+Random(2000))
    end;
    end;

    begin
    Activateclient;

    repeat;
    StartScreen;
    Wait(1+Random(1)) // :D
    Play;
    Ending;
    until(False);

    end.
     
    chelsea1 and Cacklenub like this.
  2. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    this is a really great script, very complex +rep

    it's too slow though... it has no chance of getting you a trophy, so all you need is to shorten the wait times a bit

    really good job though