Results 1 to 9 of 9

Thread: First Script, Several Errors

  1. #1
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default First Script, Several Errors

    Ok I know that theres a section for first scripts, I don't want links to it. I wanted to avoid this, but honestly I am stuck.

    SCAR Code:
    program World16AirCrafter;                          //By JackLKrawl
    {.include srl/srl.scar}
    const
    Username = 'UserName'; //Fill these out, it's so I can steal
    Password = 'Password'; //your account.
    Chat = 8388736;//Change this to the trade color to be safe
    E = 0;         //Change this to the essence color
    Z = 0;         //This is how many times you want the script to craft airs.
    var
    x,y: integer;
    I: integer;
    Spammed: integer;
    Essence: integer;
    Tradedz: integer;
    procedure Spaminate;
      begin
      Spammed:=Spammed+1;
      Random(5);
      case random(5) of
      0: SendKeys('Open 2k!'+chr(13));
      1: SendKeys('Open 2k'+chr(13));
      2: SendKeys('Open 2k + Ess!'+chr(13));
      3: SendKeys('Open 2k + Ess Back!'+chr(13));
      4: SendKeys('Open 2000 + Essence Back!'+chr(13));
      end;
      end;
    Procedure FindChat;
      begin
      if (GetColor(12,451)=Chat) Then
      MoveMouseSmooth(12,451);
      Wait(300+random(20));
      ClickMouse(12,451, true);
      if (not(GetColor(12,451)=Chat)) Then
      repeat
      Spaminate;
      FindChat;
      until(GetColor(12,451)=chat);
      end;
    Procedure EnterGold;
    begin
    MoveMouseSmooth(577,228);
    ClickMouse(577,238,false);
    wait(700+random(20));
    MoveMouseSmooth(577,318);
    ClickMouse(577,318,true);
    wait(700+random(20));
    Sendkeys('2000');
    wait(334+random(986));
    Tradedz:=Tradedz+1
    end;
    Procedure EnterEssence;
    Begin
    MoveMouseSmooth(619,226); //fix these...
    ClickMouse(619,226,false);
    Wait(239+random(59));
    MoveMouseSmooth(619,318); //fix these...
    ClickMouse(619,318,true);
    wait(286+random(34));
    Sendkeys('25'+chr(13));
    Essence:=(Essence+1)*25;
    end;
    Procedure AcceptorDecline;
    begin
    If GetColor(331,92)=GetColor(324,290)=E then
    MoveMouseSmooth(263,186);
    ClickMouse(263,186,true);
    Wait(200+random(200));
    MoveMouseSmooth(222,311);
    ClickMouse(222,311,true);
    Wait(200+random(200));
    end;
    If(not)GetColor(331,92):=E or not(Getcolor(324,290):=E then
    MoveMouseSmooth(x,y);
    Wait(20+random(300);
    ClickMouse(x,y,true);
    end;
    Procedure CraftZehRunes;
    MoveMouseSmooth(x,y);
    ClickMouse(x,y,true);
    MoveMouseSmooth(x,y);
    ClickMouse(x,y,true);
    wait(3000+random(5000);
    Procedure Proggy;
    begin
    Writeln('----JACKLKRAWLS---WORLD16---Air---Crafter----')
    Writeln('You have spammed '+ inttostr(spammed)+' Innocent People');
    Writeln('You have traded '+ inttostr(tradedz)+' Air Runners');
    Writeln('You have made '+ inttostr(essence)+' Rune Essence into Airs!!')
    end;
    begin
    repeat
    SetupSRL;
    ChatAndFindChat;
    AntiRandoms;
    EnterGold;
    EnterEssence;
    AcceptOrDecline;
    CraftZehRunes;
    until(I=Z);
    end.

    My current error is
    Line 64: [Error] (12295:41): Type mismatch in script C:\Program Files\SCAR 3.11\Scripts\JackLKrawl's First Script.scar

    Also, I know this does not fulfill the scripting standards, I want it to work before I organize it.
    Active only during the Summer...

  2. #2
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    First thing to change, is change all the Clickmouses to Mouse(x,y,RandX,RandY,LeftClick); its much more human like.... Same thing for SendText, this is replaced by TypeSend which is also more human like... 3rd If the result of an If clause is morethan one line then you need a begin and end

    if(----)then
    begin
    ---;
    ---;
    end;

    Here is your script fixed, hope its what you meant, it compiles without any issues and i fixed it up...

    SCAR Code:
    program World16AirCrafter;                          //By JackLKrawl
    {.include srl/srl.scar}
    const
      Username = 'UserName'; //Fill these out, it's so I can steal
      Password = 'Password'; //your account.
      Chat = 8388736;//Change this to the trade color to be safe
      E = 0;         //Change this to the essence color
      Z = 0;         //This is how many times you want the script to craft airs.
    var
      x,y: integer;
      I: integer;
      Spammed: integer;
      Essence: integer;
      Tradedz: integer;

    procedure Spaminate;
    begin
      Spammed:=Spammed+1;
      Random(5);
        case random(5) of
          0: TypeSend('Open 2k!'+chr(13));
          1: TypeSend('Open 2k'+chr(13));
          2: TypeSend('Open 2k + Ess!'+chr(13));
          3: TypeSend('Open 2k + Ess Back!'+chr(13));
          4: TypeSend('Open 2000 + Essence Back!'+chr(13));
        end;
    end;

    Procedure FindChat;
    begin
        if (GetColor(12,451)=Chat) Then
        begin
          Mouse(12,451,5,5,true);
        end;
        if (not(GetColor(12,451)=Chat)) Then
        begin
            repeat
              Spaminate;
              FindChat;
            until(GetColor(12,451)=chat);
        end;
    end;

    Procedure EnterGold;
    begin
      Mouse(577,238,5,5,false);
      wait(700+random(20));
      Mouse(577,318,5,5,true);
      wait(700+random(20));
      TypeSend('2000');
      wait(334+random(986));
      Tradedz:=Tradedz+1
    end;

    Procedure EnterEssence;
    Begin
      Mouse(619,226,5,5,false);
      Wait(239+random(59));
      Mouse(619,318,5,5,true);
      wait(286+random(34));
      TypeSend('25'+chr(13));
      Essence:=(Essence+1)*25;
    end;
    Procedure AcceptorDecline;
    begin
        if((GetColor(331,92)= E) and (GetColor(324,290) = E)) then
        begin
          Mouse(263,186,5,5,true);
          Wait(200+random(200));
          Mouse(222,311,5,5,true);
          Wait(200+random(200));
        end;
        if not((GetColor(331,92)=E) or (Getcolor(324,290)=E)) then
        begin
          Mouse(x,y,5,5,true); // Where is the x+y from?
        end;
    end;

    Procedure CraftZehRunes;
    begin
      Mouse(x,y,5,5,true);  // X and Y have not been assigned
      Mouse(x,y,5,5,true);  // ""
      wait(3000+random(5000));
    end;

    Procedure Proggy;
    begin
      Writeln('----JACKLKRAWLS---WORLD16---Air---Crafter----')
      Writeln('You have spammed '+ inttostr(spammed)+' Innocent People');
      Writeln('You have traded '+ inttostr(tradedz)+' Air Runners');
      Writeln('You have made '+ inttostr(essence)+' Rune Essence into Airs!!')
    end;

    begin
        repeat
          SetupSRL;
          // ChatAndFindChat; <-- Says it doesnt exist
          // AntiRandoms;      <-- ""
          EnterGold;
          EnterEssence;
          AcceptOrDecline;
          CraftZehRunes;
        until(I=Z);
    end.
    The truth finally came out...


  3. #3
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Heres a srl version of your script with standers
    SCAR Code:
    program World16AirCrafter; //By JackLKrawl
    {.include srl/srl.scar}
    const
      Username = 'UserName'; //Fill these out, it's so I can steal
      Password = 'Password'; //your account.
      Chat = 8388736; //Change this to the trade color to be safe
      E = 0; //Change this to the essence color
      Z = 0; //This is how many times you want the script to craft airs.
    var
      x, y: integer;
      I: integer;
      Spammed: integer;
      Essence: integer;
      Tradedz: integer;

    procedure Spaminate;
    begin
      Spammed := Spammed + 1;
      Random(5);
      case random(5) of
        0: TypeSend('Open 2k!');
        1: TypeSend('Open 2k' + chr(13));
        2: TypeSend('Open 2k + Ess!' + chr(13));
        3: TypeSend('Open 2k + Ess Back!' + chr(13));
        4: TypeSend('Open 2000 + Essence Back!' + chr(13));
      end;
    end;

    procedure FindChat;
    begin
      if (GetColor(12, 451) = Chat) then
        Mouse(12, 451, 1, 1, true)
          if (not (GetColor(12, 451) = Chat)) then
          repeat
            Spaminate;
            FindChat;
          until (GetColor(12, 451) = chat);
    end;

    procedure EnterGold;
    begin
      Mouse(577, 228, 1, 1, False);
      wait(700 + random(20));
      Mouse(577, 318, 1, 1, true);
      wait(700 + random(20));
      typesend('2000');
      wait(334 + random(986));
      Tradedz := Tradedz + 1
    end;

    procedure EnterEssence;
    begin
      Mouse(619, 226, 1, 1, False); //fix these...
      Wait(239 + random(59));
      Mouse(619, 318, 1, 1, true); //fix these...
      wait(286 + random(34));
      TypeSend('25');
      Essence := (Essence + 1) * 25;
    end;

    procedure AcceptorDecline;
    begin
      begin
        if GetColor(331, 92) and GetColor(324, 290) = E then
          Mouse(263, 186, 1, 1, true);
          Wait(200 + random(200));
          Mouse(222, 311, 1, 1, true); ;
          Wait(200 + random(200));
      end;
      if not (GetColor(331, 92) := E) or not (Getcolor(324, 290) := E) then
      begin
        Mouse(x, y, 1, 1, true);
      end;

    procedure CraftZehRunes;
    begin
      Mouse(x, y, 1, 1, true);
      Mouse(x, y, 1, 1, true);
      wait(3000 + random(5000);
    end;

    procedure Proggy;
    begin
      Writeln('----JACKLKRAWLS---WORLD16---Air---Crafter----')
      Writeln('You have spammed ' + inttostr(spammed) + ' Innocent People');
      Writeln('You have traded ' + inttostr(tradedz) + ' Air Runners');
      Writeln('You have made ' + inttostr(essence) + ' Rune Essence into Airs!!')
    end;

      begin
        repeat
          SetupSRL;
          ChatAndFindChat;
          AntiRandoms;
          EnterGold;
          EnterEssence;
          AcceptOrDecline;
          CraftZehRunes;
        until (I = Z);
      end.

  4. #4
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    THANKYOU mat, THANKYOU. That MovemouseSmooth(x,y); ClickMouse(x,y); was driving me insane. Thanks for corrections, myles and mat.

    Edit:
    But I am curious about typesend. Do you still have to enter in chr(13))?
    Uhh actually. That's kinda obvious..Ignore ^
    Active only during the Summer...

  5. #5
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh yeah, and some of those I never added in because I was trying to get most of the script to run first <_<
    Active only during the Summer...

  6. #6
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dont double post need help look my sig
    ~Hermen

  7. #7
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, thanks ^^ I'll pm u if I ever need help
    Active only during the Summer...

  8. #8
    Join Date
    Sep 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I just dont know how to make scripts or run them so ehhhh

  9. #9
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    type send you dont need +chr(13) b/c typesend presses enter on its own so that is not needed

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Errors with my script...
    By Runescapian321 in forum OSR Help
    Replies: 4
    Last Post: 01-06-2008, 04:04 PM
  2. First Script/with errors.
    By hihi12340 in forum OSR Help
    Replies: 21
    Last Post: 06-19-2007, 02:22 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
  •