Results 1 to 4 of 4

Thread: This is an error I don't know how to fix...

  1. #1
    Join Date
    Jul 2006
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    This is an error I don't know how to fix...

    I am making random parts of a tutorial island script, mainly just for fun seeing as I am a pretty big scripting noob. Here is my script I am using, it chooses a random look for your character then stops (took out the clicking of done so I could test it multiple times)

    I changed the script around a little bit and now it works better, but the mouse still spazzes out after it chooses the legs.

    Here it is:
    SCAR Code:
    program TutIsland;
    {.include SRL/SRL.scar}

    const
    extensivedebug=true; //say st00f?

    /////////////////BIG CHAR LOOK PICKER\\\\\\\\\\\\\\
    procedure anticlickmouse;
    var x,y:integer;
    begin
    getmousepos(x,y);
    holdmouse(x,y,true);
    wait(30+random(50));
    releasemouse(x,y,true);
    end;

    function ClickTimes(x,y,rx,ry,times:integer):integer;
    var timesa:integer;
    begin
    timesa:=0;
    CMouse(x,y,rx,ry,true);
    repeat
    clickmouseanti(x,y,true);
    timesa:=timesa+1;
    wait(500+random(300));
    until(timesa>=times);
    end;

    procedure RHead;
    begin
    case random(8) of
         0:ClickTimes(166,90,10,10,8);
         1:ClickTimes(166,90,10,10,1);
         2:ClickTimes(166,90,10,10,2);
         3:ClickTimes(166,90,10,10,3);
         4:ClickTimes(166,90,10,10,4);
         5:ClickTimes(166,90,10,10,5);
         6:ClickTimes(166,90,10,10,6);
         7:ClickTimes(166,90,10,10,7);
         end;
    end;

    procedure RJaw;
    begin
    case random(7) of
         0:ClickTimes(168,125,10,10,7);
         1:ClickTimes(168,125,10,10,1);
         2:ClickTimes(168,125,10,10,2);
         3:ClickTimes(168,125,10,10,3);
         4:ClickTimes(168,125,10,10,4);
         5:ClickTimes(168,125,10,10,5);
         6:ClickTimes(168,125,10,10,6);
         end;
    end;

    procedure RTorso;
    begin
    case random(7) of
         0:ClickTimes(164,161,10,10,7);
         1:ClickTimes(164,161,10,10,1);
         2:ClickTimes(164,161,10,10,2);
         3:ClickTimes(164,161,10,10,3);
         4:ClickTimes(164,161,10,10,4);
         5:ClickTimes(164,161,10,10,5);
         6:ClickTimes(164,161,10,10,6);
         end;
    end;

    procedure RArms;
    begin
    case random(7) of
         0:ClickTimes(163,195,10,10,7);
         1:ClickTimes(163,195,10,10,1);
         2:ClickTimes(163,195,10,10,2);
         3:ClickTimes(163,195,10,10,3);
         4:ClickTimes(163,195,10,10,4);
         5:ClickTimes(163,195,10,10,5);
         6:ClickTimes(163,195,10,10,6);
         end;
    end;

    procedure RHands;
    begin
    case random(2) of
         0:ClickTimes(163,195,10,10,1);
         1:ClickTimes(163,195,10,10,2);
         end;
    end;

    procedure RLegs;
    begin
    case random(7) of
         0:ClickTimes(164,265,10,10,7);
         1:ClickTimes(164,265,10,10,1);
         2:ClickTimes(163,265,10,10,2);
         3:ClickTimes(164,265,10,10,3);
         4:ClickTimes(163,265,10,10,4);
         5:ClickTimes(164,265,10,10,5);
         6:ClickTimes(163,265,10,10,6);
         end;
    end;

    procedure RFeet;
    begin
    case random(2) of
         0:ClickTimes(163,302,10,10,1);
         1:ClickTimes(163,302,10,10,2);
         end;
    end;

    procedure RHair;
    begin
    case random(7) of
         0:ClickTimes(467,96,10,10,1);
         1:ClickTimes(467,96,10,10,2);
         2:ClickTimes(467,96,10,10,3);
         3:ClickTimes(467,96,10,10,4);
         4:ClickTimes(467,96,10,10,5);
         5:ClickTimes(467,96,10,10,6);
         6:ClickTimes(467,96,10,10,7);
         end;
    end;

    procedure RTorso2;
    begin
    case random(7) of
         0:ClickTimes(467,129,10,10,7);
         1:ClickTimes(467,129,10,10,1);
         2:ClickTimes(467,129,10,10,2);
         3:ClickTimes(467,129,10,10,3);
         4:ClickTimes(467,129,10,10,4);
         5:ClickTimes(467,129,10,10,5);
         6:ClickTimes(467,129,10,10,6);
         end;
    end;

    procedure RLegs2;
    begin
    case random(7) of
         0:ClickTimes(463,164,10,10,7);
         1:ClickTimes(463,164,10,10,1);
         2:ClickTimes(463,164,10,10,2);
         3:ClickTimes(463,164,10,10,3);
         4:ClickTimes(463,164,10,10,4);
         5:ClickTimes(463,164,10,10,5);
         6:ClickTimes(463,164,10,10,6);
         7:ClickTimes(463,164,10,10,7);
         end;
    end;

    procedure RSkin;
    begin
    case random(7) of
         0:ClickTimes(463,164,10,10,7);
         1:ClickTimes(463,164,10,10,1);
         2:ClickTimes(463,164,10,10,2);
         3:ClickTimes(463,164,10,10,3);
         4:ClickTimes(463,164,10,10,4);
         5:ClickTimes(463,164,10,10,5);
         6:ClickTimes(463,164,10,10,6);
         7:ClickTimes(463,164,10,10,7);
         end;
    end;

    procedure ChooseLook;
    begin
    if findcolortolerance(x,y,2070783,243,16,259,31,10) then
       begin
       case random(2) of
       1:CMouse(446,290,10,10,true);
       2:wait(1+random(2));
       end;
       if extensivedebug=true then writeln('chose gender');
       RHead;
       if extensivedebug=true then writeln('chose head');
       wait(3000+random(500));
       RJaw;
       if extensivedebug=true then writeln('chose jaw');
       wait(3000+random(500));
       RTorso;
       if extensivedebug=true then writeln('chose torso');
       wait(3000+random(500));
       RHands;
       if extensivedebug=true then writeln('chose hands');
       wait(3000+random(500));
       RLegs;
       if extensivedebug=true then writeln('chose legs');
       wait(3000+random(500));
       RFeet;
       if extensivedebug=true then writeln('chose feet');
       wait(3000+random(500));
       RHair;
       if extensivedebug=true then writeln('chose hair');
       wait(3000+random(500));
       RTorso2;
       if extensivedebug=true then writeln('chose torso2');
       wait(3000+random(500));
       RLegs2;
       if extensivedebug=true then writeln('chose legs2');
       wait(3000+random(500));
       RSkin;
       if extensivedebug=true then writeln('chose skin');
       wait(3000+random(500));
       CMouse(261,284,10,10,true);
       if extensivedebug=true then writeln('done!');
       end;
    end;
       
    //////END CHAR LOOK PICKER\\\\\\\\\\\\\\

    procedure LogInp10x;
    begin
    end;


    begin
    chooselook;
    LogInp10x;
    end.


    The error I get isn't a message in the scar debug window.

    Whenever I run it, it works up until about the choosing of the torso. Once it gets there the mouse goes around the edges of the screen like crazy and spazzes out a whole bunch. Even when I stop the script the mouse is still screwing itself. Anyone know what the problem is?

    And if you want to edit this script and use it thats fine with me just put my name somewhere =P

  2. #2
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Btw Cases starts at 0: You have
    case random(7) of
    1:
    ...
    ...
    7:
    Case random(7) starts at number 0 and ends at number 6.

  3. #3
    Join Date
    Jul 2006
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I fixed that but it still happens...

  4. #4
    Join Date
    Oct 2006
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i tested it and made it compile and it worked, here it is oh and good job you dont mind me using it in my tut island script do you?
    SCAR Code:
    program TutIsland;
    {.include SRL/SRL.scar}

    const
    extensivedebug=true; //say st00f?

    /////////////////BIG CHAR LOOK PICKER\\\\\\\\\\\\\\
    procedure anticlickmouse;
    var x,y:integer;
    begin
    getmousepos(x,y);
    holdmouse(x,y,true);
    wait(30+random(50));
    releasemouse(x,y,true);
    end;

    function ClickTimes(x,y,rx,ry,times:integer):integer;
    var timesa:integer;
    begin
    timesa:=0;
    CMouse(x,y,rx,ry,true);
    repeat
    anticlickmouse;
    timesa:=timesa+1;
    wait(500+random(300));
    until(timesa>=times);
    end;

    procedure RHead;
    begin
    case random(8) of
         0:ClickTimes(166,90,10,10,8);
         1:ClickTimes(166,90,10,10,1);
         2:ClickTimes(166,90,10,10,2);
         3:ClickTimes(166,90,10,10,3);
         4:ClickTimes(166,90,10,10,4);
         5:ClickTimes(166,90,10,10,5);
         6:ClickTimes(166,90,10,10,6);
         7:ClickTimes(166,90,10,10,7);
         end;
    end;

    procedure RJaw;
    begin
    case random(7) of
         0:ClickTimes(168,125,10,10,7);
         1:ClickTimes(168,125,10,10,1);
         2:ClickTimes(168,125,10,10,2);
         3:ClickTimes(168,125,10,10,3);
         4:ClickTimes(168,125,10,10,4);
         5:ClickTimes(168,125,10,10,5);
         6:ClickTimes(168,125,10,10,6);
         end;
    end;

    procedure RTorso;
    begin
    case random(7) of
         0:ClickTimes(164,161,10,10,7);
         1:ClickTimes(164,161,10,10,1);
         2:ClickTimes(164,161,10,10,2);
         3:ClickTimes(164,161,10,10,3);
         4:ClickTimes(164,161,10,10,4);
         5:ClickTimes(164,161,10,10,5);
         6:ClickTimes(164,161,10,10,6);
         end;
    end;

    procedure RArms;
    begin
    case random(7) of
         0:ClickTimes(163,195,10,10,7);
         1:ClickTimes(163,195,10,10,1);
         2:ClickTimes(163,195,10,10,2);
         3:ClickTimes(163,195,10,10,3);
         4:ClickTimes(163,195,10,10,4);
         5:ClickTimes(163,195,10,10,5);
         6:ClickTimes(163,195,10,10,6);
         end;
    end;

    procedure RHands;
    begin
    case random(2) of
         0:ClickTimes(163,195,10,10,1);
         1:ClickTimes(163,195,10,10,2);
         end;
    end;

    procedure RLegs;
    begin
    case random(7) of
         0:ClickTimes(164,265,10,10,7);
         1:ClickTimes(164,265,10,10,1);
         2:ClickTimes(163,265,10,10,2);
         3:ClickTimes(164,265,10,10,3);
         4:ClickTimes(163,265,10,10,4);
         5:ClickTimes(164,265,10,10,5);
         6:ClickTimes(163,265,10,10,6);
         end;
    end;

    procedure RFeet;
    begin
    case random(2) of
         0:ClickTimes(163,302,10,10,1);
         1:ClickTimes(163,302,10,10,2);
         end;
    end;

    procedure RHair;
    begin
    case random(7) of
         0:ClickTimes(467,96,10,10,1);
         1:ClickTimes(467,96,10,10,2);
         2:ClickTimes(467,96,10,10,3);
         3:ClickTimes(467,96,10,10,4);
         4:ClickTimes(467,96,10,10,5);
         5:ClickTimes(467,96,10,10,6);
         6:ClickTimes(467,96,10,10,7);
         end;
    end;

    procedure RTorso2;
    begin
    case random(7) of
         0:ClickTimes(467,129,10,10,7);
         1:ClickTimes(467,129,10,10,1);
         2:ClickTimes(467,129,10,10,2);
         3:ClickTimes(467,129,10,10,3);
         4:ClickTimes(467,129,10,10,4);
         5:ClickTimes(467,129,10,10,5);
         6:ClickTimes(467,129,10,10,6);
         end;
    end;

    procedure RLegs2;
    begin
    case random(7) of
         0:ClickTimes(463,164,10,10,7);
         1:ClickTimes(463,164,10,10,1);
         2:ClickTimes(463,164,10,10,2);
         3:ClickTimes(463,164,10,10,3);
         4:ClickTimes(463,164,10,10,4);
         5:ClickTimes(463,164,10,10,5);
         6:ClickTimes(463,164,10,10,6);
         7:ClickTimes(463,164,10,10,7);
         end;
    end;

    procedure RSkin;
    begin
    case random(7) of
         0:ClickTimes(463,164,10,10,7);
         1:ClickTimes(463,164,10,10,1);
         2:ClickTimes(463,164,10,10,2);
         3:ClickTimes(463,164,10,10,3);
         4:ClickTimes(463,164,10,10,4);
         5:ClickTimes(463,164,10,10,5);
         6:ClickTimes(463,164,10,10,6);
         7:ClickTimes(463,164,10,10,7);
         end;
    end;

    procedure ChooseLook;
    begin
    if findcolortolerance(x,y,2070783,243,16,259,31,10) then
       begin
       case random(2) of
       1:CMouse(446,290,10,10,true);
       2:wait(1+random(2));
       end;
       if extensivedebug=true then writeln('chose gender');
       RHead;
       if extensivedebug=true then writeln('chose head');
       wait(3000+random(500));
       RJaw;
       if extensivedebug=true then writeln('chose jaw');
       wait(3000+random(500));
       RTorso;
       if extensivedebug=true then writeln('chose torso');
       wait(3000+random(500));
       RHands;
       if extensivedebug=true then writeln('chose hands');
       wait(3000+random(500));
       RLegs;
       if extensivedebug=true then writeln('chose legs');
       wait(3000+random(500));
       RFeet;
       if extensivedebug=true then writeln('chose feet');
       wait(3000+random(500));
       RHair;
       if extensivedebug=true then writeln('chose hair');
       wait(3000+random(500));
       RTorso2;
       if extensivedebug=true then writeln('chose torso2');
       wait(3000+random(500));
       RLegs2;
       if extensivedebug=true then writeln('chose legs2');
       wait(3000+random(500));
       RSkin;
       if extensivedebug=true then writeln('chose skin');
       wait(3000+random(500));
       CMouse(261,284,10,10,true);
       if extensivedebug=true then writeln('done!');
       end;
    end;

    //////END CHAR LOOK PICKER\\\\\\\\\\\\\\

    procedure LogInp10x;
    begin
    end;


    begin
    chooselook;
    LogInp10x;
    end.
    http://www.fenjer.com/adnan/SRLStats/555.png
    Only just fugured out how to get this stat thing working.... wasted all that time...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Smart error and Some kind of Math.scar error
    By FagetHax0r in forum OSR Help
    Replies: 6
    Last Post: 02-24-2008, 10:43 AM

Posting Permissions

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