Results 1 to 10 of 10

Thread: im new to scripting please help

  1. #1
    Join Date
    Mar 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default im new to scripting please help

    im trying to auto farm in dofus and i copied someone elses script and added my own touches... the highlighted areas are what i added all i need is it to click wheat click reap then wait 10000 milliseconds then repeat, and on the times i level farming it needs to click okay (leveled) the part that im getting the error xD

    SCAR Code:
    var
    x,y:integer;
    function Leveled : boolean;
    begin
    if(FindColor(x, y, 16777215, 0, 0, 800, 600))then // Color and Co-ordinates of level notice
    end;

    function Wheat1 : boolean;
    begin
    if(FindColor(x, y, 6018541, 0, 0, 800, 600))then result:= true
    end;

    function Wheat2 : boolean;
    begin
    if(FindColor(x, y, 6142380, 0, 0, 800, 600))then result:= true
    end;

    function Wheat3 : boolean;
    begin
    if(FindColor(x, y, 2982807, 0, 0, 800, 600))then result:= true
    end;

    function Wheat4 : boolean;
    begin
    if(FindColor(x, y, 1949612, 0, 0, 800, 600))then result:= true
    end;

    function Wheat5 : boolean;
    begin
    if(FindColor(x, y, 3062228, 0, 0, 800, 600))then result:= true
    end;

    function Wheat6 : boolean;
    begin
    if(FindColor(x, y, 5887730, 0, 0, 800, 600))then result:= true
    end;

    function Wheat7 : boolean;
    begin
    if(FindColor(x, y, 5948127, 0, 0, 800, 600))then result:= true
    end;

    function Wheat8 : boolean;
    begin
    if(FindColor(x, y, 2991798, 0, 0, 800, 600))then result:= true
    end;

    function Wheat9 : boolean;
    begin
    if(FindColor(x, y, 10016511, 0, 0, 800, 600))then result:= true
    end;

    function Wheat10 : boolean;
    begin
    if(FindColor(x, y, 1219208, 0, 0, 800, 600))then result:= true
    end;

    function Wheat11 : boolean;
    begin
    if(FindColor(x, y, 2675114, 0, 0, 800, 600))then result:= true
    end;

    function Wheat : boolean;
    begin
    if(Wheat1) or (Wheat2) or (Wheat3) or (Wheat4) or (Wheat5) or (Wheat6) or (Wheat7) or (Wheat8) or (Wheat9) or (Wheat10) or (Wheat11)then result:= true
    end;

    procedure Farm;
    begin
    if(Wheat)then
    begin
    MoveMouseSmooth(x, y);
    Wait(100+random(200));
    HoldMouse(x, y, true);
    Wait(20+random(50));
    ReleaseMouse(x, y, true);
    Wait(100+random(200));
    MoveMouseSmooth(x+27, y+38);
    Wait(100+random(200));
    HoldMouse(x+27, y+38, true);
    Wait(20+random(50));
    ReleaseMouse(x+27, y+38, true);
    Wait(3000+random(500));
    MoveMouseSmooth(x+random(50) ,y+random(50));
    Wait(100+random(200));
    HoldMouse(x+random(50), y+random(50), true);
    Wait(20+random(50));
    ReleaseMouse(x+random(50), y+random(50), true);
    Wait(10000); //<--- However long it takes you to chop wheat!
    end;

    {
    right here in the "procedure" i get an error saying "Identifier expected in script"
    }

    begin
    if(Leveled)then
    begin
    MoveMouseSmooth(x, y);
    Wait(100+random(200));
    HoldMouse(x, y, true);
    Wait(20+random(50));
    ReleaseMouse(x, y, true);
    end;

    end.

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    after the procedure add an extra end; as it is missing one. you need to close the if and the procedure.

    also, we have [ scar] [/ scar] tags in these forums, i have added them to your post

    and as a final note, this script would be unsafe to auto with in runescape, although it would be fine in a private server.

    Make sure you read some tutorials, as MoveMouseSmooth and Hold/Release mouse are really not used anymore (not directly anyway).

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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

    Default

    thanks i was just using what someone said, and as for runescape its for a game called dofus
    and why would it be unsafe for runescape?

    this is what ive edited i didnt understand what you did at first but this is what i got now


    var
    x,y:integer;

    function Leveled : boolean;
    begin
    if(FindColor(x, y, 16777215, 0, 0, 800, 600))then result:=true
    end;

    function Wheat1 : boolean;
    begin
    if(FindColor(x, y, 6018541, 0, 0, 800, 600))then result:= true
    end;

    function Wheat2 : boolean;
    begin
    if(FindColor(x, y, 6142380, 0, 0, 800, 600))then result:= true
    end;

    function Wheat3 : boolean;
    begin
    if(FindColor(x, y, 2982807, 0, 0, 800, 600))then result:= true
    end;

    function Wheat4 : boolean;
    begin
    if(FindColor(x, y, 1949612, 0, 0, 800, 600))then result:= true
    end;

    function Wheat5 : boolean;
    begin
    if(FindColor(x, y, 3062228, 0, 0, 800, 600))then result:= true
    end;

    function Wheat6 : boolean;
    begin
    if(FindColor(x, y, 5887730, 0, 0, 800, 600))then result:= true
    end;

    function Wheat7 : boolean;
    begin
    if(FindColor(x, y, 5948127, 0, 0, 800, 600))then result:= true
    end;

    function Wheat8 : boolean;
    begin
    if(FindColor(x, y, 2991798, 0, 0, 800, 600))then result:= true
    end;

    function Wheat9 : boolean;
    begin
    if(FindColor(x, y, 10016511, 0, 0, 800, 600))then result:= true
    end;

    function Wheat10 : boolean;
    begin
    if(FindColor(x, y, 1219208, 0, 0, 800, 600))then result:= true
    end;

    function Wheat11 : boolean;
    begin
    if(FindColor(x, y, 2675114, 0, 0, 800, 600))then result:= true
    end;

    function Wheat : boolean;
    begin
    if(Wheat1) or (Wheat2) or (Wheat3) or (Wheat4) or (Wheat5) or (Wheat6) or (Wheat7) or (Wheat8) or (Wheat9) or (Wheat10) or (Wheat11)then result:= true
    end;

    function level : boolean;
    begin
    if(leveled)then result:= true
    end;

    procedure Farm;
    begin
    if(Wheat)then
    begin
    MoveMouseSmooth(x, y);
    Wait(100+random(200));
    HoldMouse(x, y, true);
    Wait(20+random(50));
    ReleaseMouse(x, y, true);
    Wait(100+random(200));
    MoveMouseSmooth(x+27, y+38);
    Wait(100+random(200));
    HoldMouse(x+27, y+38, true);
    Wait(20+random(50));
    ReleaseMouse(x+27, y+38, true);
    Wait(3000+random(500));
    MoveMouseSmooth(x+random(50) ,y+random(50));
    Wait(100+random(200));
    HoldMouse(x+random(50), y+random(50), true);
    Wait(20+random(50));
    ReleaseMouse(x+random(50), y+random(50), true);
    Wait(1000); //<--- However long it takes you to chop wheat!
    end;


    begin
    if(Level)then
    begin
    MoveMouseSmooth(x, y);
    Wait(100+random(200));
    HoldMouse(x, y, true);
    Wait(20+random(50));
    ReleaseMouse(x, y, true);
    end;
    end;

    end.[Error] (110:4): Semicolon (';') expected in script

  4. #4
    Join Date
    Mar 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i tried adding a semicolon but nothing changes... just more errors

  5. #5
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    var
    x,y:integer;
    function Leveled : boolean;
    begin
    if(FindColor(x, y, 16777215, 0, 0, 800, 600))then // Color and Co-ordinates of level notice
    end;
     
    function Wheat1 : boolean;
    begin
    if(FindColor(x, y, 6018541, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat2 : boolean;
    begin
    if(FindColor(x, y, 6142380, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat3 : boolean;
    begin
    if(FindColor(x, y, 2982807, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat4 : boolean;
    begin
    if(FindColor(x, y, 1949612, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat5 : boolean;
    begin
    if(FindColor(x, y, 3062228, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat6 : boolean;
    begin
    if(FindColor(x, y, 5887730, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat7 : boolean;
    begin
    if(FindColor(x, y, 5948127, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat8 : boolean;
    begin
    if(FindColor(x, y, 2991798, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat9 : boolean;
    begin
    if(FindColor(x, y, 10016511, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat10 : boolean;
    begin
    if(FindColor(x, y, 1219208, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat11 : boolean;
    begin
    if(FindColor(x, y, 2675114, 0, 0, 800, 600))then result:= true
    end;
     
    function Wheat : boolean;
    begin
    if(Wheat1) or (Wheat2) or (Wheat3) or (Wheat4) or (Wheat5) or (Wheat6) or (Wheat7) or (Wheat8) or (Wheat9) or (Wheat10) or (Wheat11)then result:= true
    end;
     
    procedure Farm;
    begin
    if(Wheat)then
    begin
    MoveMouseSmooth(x, y);
    Wait(100+random(200));
    HoldMouse(x, y, true);
    Wait(20+random(50));
    ReleaseMouse(x, y, true);
    Wait(100+random(200));
    MoveMouseSmooth(x+27, y+38);
    Wait(100+random(200));
    HoldMouse(x+27, y+38, true);
    Wait(20+random(50));
    ReleaseMouse(x+27, y+38, true);
    Wait(3000+random(500));
    MoveMouseSmooth(x+random(50) ,y+random(50));
    Wait(100+random(200));
    HoldMouse(x+random(50), y+random(50), true);
    Wait(20+random(50));
    ReleaseMouse(x+random(50), y+random(50), true);
    Wait(10000); //<--- However long it takes you to chop wheat!
    end;
    end;
     
    {
    right here in the "procedure" i get an error saying "Identifier expected in script"
    }

    begin
    if(Leveled)then
    begin
    MoveMouseSmooth(x, y);
    Wait(100+random(200));
    HoldMouse(x, y, true);
    Wait(20+random(50));
    ReleaseMouse(x, y, true);
    end;
     
    end.

    fixed it up for you. Unsafe for runescape because they detect the patterns move mouse smooth uses.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  6. #6
    Join Date
    Mar 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    that script actually loads but my mouse goes to top left and doesnt move...

  7. #7
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    http://www.srl-forums.com/forum/tuto...ners-f176.html

    that shall be your first source of help from now on

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  8. #8
    Join Date
    Mar 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    http://www.srl-forums.com/forum/tuto...ners-f176.html

    that shall be your first source of help from now on

    ~RM
    i found my error XD i was putting a procedure inside a procedure and getting stuff mixed up i dropped that one because of its size it was too complex for me but this 1 i got working and i wrote the procedure for leveling when i level and it works ill be happy xD sorry for my "noob-ness"
    var
    x, y: integer;
    function Targetwheat1 : Boolean;
    begin
    if(FindColor(x, y, 6016207, 0, 0, 800, 600))then result:= true
    end;

    function Targetwheat2 : Boolean;
    begin
    if(FindColor(x, y, 3466461, 0, 0, 800, 600))then result:= true
    end;

    function Nextwheat1 : Boolean;
    begin
    if(FindColor(x, y, 18096, 0, 0, 800, 600))then result:= true
    end;

    function Nextwheat2 : Boolean;
    begin
    if(FindColor(x, y, 1061237, 0, 0, 800, 600))then result:= true
    end;

    function Level : boolean;
    begin
    if(FindColor(x, y, 16777215, 0, 0, 800, 600))then result:=true
    end;

    Procedure Harvest;
    begin
    if (Targetwheat1)or(Targetwheat2) then
    wait(500);
    FindColor(x, y, 3466461, 0, 0, 800, 600);
    wait(500);
    clickmouse(x+5, y, true);
    wait(500);
    movemousesmooth(x+10, y+30);
    wait(500);
    clickmouse(x+10, y+30, true);
    wait(10100);
    end;

    Procedure Leveled;
    begin
    if (Level) then
    wait (550);
    FindColor(x, y, 16777215, 0, 0, 800, 600);
    clickmouse(x, y, true);
    end;

    function nowheat : Boolean;
    begin
    if(FindColor(x, y, 3466461, 0, 0, 800, 600))then result:= false
    end;

    Begin
    harvest;
    repeat
    if (nowheat) then
    harvest;
    if(nextwheat1)or(nextwheat2)then
    harvest;
    until(false);
    end.

  9. #9
    Join Date
    Jan 2009
    Location
    Somewhere
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Walkingdeath0 View Post
    i found my error XD i was putting a procedure inside a procedure and getting stuff mixed up i dropped that one because of its size it was too complex for me but this 1 i got working and i wrote the procedure for leveling when i level and it works ill be happy xD sorry for my "noob-ness"
    var
    x, y: integer;
    function Targetwheat1 : Boolean;
    begin
    if(FindColor(x, y, 6016207, 0, 0, 800, 600))then result:= true
    end;

    function Targetwheat2 : Boolean;
    begin
    if(FindColor(x, y, 3466461, 0, 0, 800, 600))then result:= true
    end;

    function Nextwheat1 : Boolean;
    begin
    if(FindColor(x, y, 18096, 0, 0, 800, 600))then result:= true
    end;

    function Nextwheat2 : Boolean;
    begin
    if(FindColor(x, y, 1061237, 0, 0, 800, 600))then result:= true
    end;

    function Level : boolean;
    begin
    if(FindColor(x, y, 16777215, 0, 0, 800, 600))then result:=true
    end;

    Procedure Harvest;
    begin
    if (Targetwheat1)or(Targetwheat2) then
    wait(500);
    FindColor(x, y, 3466461, 0, 0, 800, 600);
    wait(500);
    clickmouse(x+5, y, true);
    wait(500);
    movemousesmooth(x+10, y+30);
    wait(500);
    clickmouse(x+10, y+30, true);
    wait(10100);
    end;

    Procedure Leveled;
    begin
    if (Level) then
    wait (550);
    FindColor(x, y, 16777215, 0, 0, 800, 600);
    clickmouse(x, y, true);
    end;

    function nowheat : Boolean;
    begin
    if(FindColor(x, y, 3466461, 0, 0, 800, 600))then result:= false
    end;

    Begin
    harvest;
    repeat
    if (nowheat) then
    harvest;
    if(nextwheat1)or(nextwheat2)then
    harvest;
    until(false);
    end.
    1- Use SCAR Tags!
    2- Use Cases much cleaner and better
    3- Go read some tuts

  10. #10
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)
    Just a tip, replace the clickmouse, etc with MMouse and Mouse. Less detectable.

    SCAR Code:
    Procedure Harvest;
    begin
    if (Targetwheat1)or(Targetwheat2) then
    wait(500);
    FindColor(x, y, 3466461, 0, 0, 800, 600);
    wait(500);
    mouse(x, y, 5, 5, true);
    wait(500);
    MMouse(x, y, 5, 5);
    wait(500);
    mouse(x, y, 5, 5, true);
    wait(10100);
    end;

    Procedure Leveled;
    begin
    if (Level) then
    wait (550);
    FindColor(x, y, 16777215, 0, 0, 800, 600);
    mouse(x, y, 5, 5, true);
    end;

    like so.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. I need scripting help
    By PvH in forum OSR Help
    Replies: 2
    Last Post: 12-07-2007, 12:37 PM
  2. rsc scripting help?
    By owntpls in forum OSR Help
    Replies: 0
    Last Post: 11-23-2007, 11:57 AM
  3. Scripting Help!
    By camdo2 in forum OSR Help
    Replies: 4
    Last Post: 10-25-2007, 06:51 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
  •