Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread: Type Mismatch

  1. #1
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Type Mismatch

    Well finally I brought myself to try and script I'm trying to make a powerminer and here is what I have so far

    EDIT: Look at my most recent post to find what problem I'm having atm

    SCAR Code:
    program PowerMinerByScapian;
    var
      x,y, mouse:integer;
    const

    RockColor = 6908530; //put the color of the rock before the ; but after the =
    OreInventoryColor = ; //put the color of the ore as seen in your inventory (so Scar
                          //can find it when it's dropping the ores)

    procedure Mining;
    begin
     if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5))then
       mouse(x, y, 1, 1, true)
     else
       Writeln('Rock color not found, terminating script');
       TerminateScript;
    end;


    begin
     SetupSRL;
     ActivateClient;
     Mining;
    end.

    I'm getting

    Line 14: [Error] (14:6): Type mismatch in script
    Line 14 is

    SCAR Code:
    mouse(x, y, 1, 1, true)

    I have yet to add the dropping part and eventually randoms and antibans...

    Don't be too harsh, it's my first script Also if you see anything else that might be a problem please say what it is.

    Thanks in advance.

    EDIT: I'm trying the dropping now, after it right clicks on the ores, how do I make it so it clicks 'drop'?

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You can't have mouse declared as a variable since it's already a function in SRL. Change the name to something else. To solve your dropping issue, you can use ChooseOption('rop'); and that should drop the item if the text is there.
    :-)

  3. #3
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    K it's cuz you have 'mouse' declared a a variable..
    'Mouse' is already a function declared in SRL so there's no need to declare anything just include SRL like so:
    SCAR Code:
    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
    and then you can use it.

    Also one more thing.. In:
    SCAR Code:
    procedure Mining;
    begin
     if FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5) then
      Mouse(x, y, 1, 1, true)
     else
      begin //put a begin here
       Writeln('Rock color not found, terminating script');
       TerminateScript;
      end; //and an end here
    end;
    but a begin and an end around it when you want it to do more than one thing in an if then statement.
    Otherwise it will only do the first thing based on the if then statement and will always do the second thing (in this case it'd always do 'TerminateScript' even if the color was found).

    EDIT: 'Mouse' does click.. It's just written in SRL rather than internally in SCAR like 'ClickMouse' is so you have to be sure to include SRL in your script when using 'Mouse'.. (which btw is much better to use than 'ClickMouse')

  4. #4
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, I thought mouse was to click. I see now that it's ClickMouse? If so, In the Scar Manual it says you can ClickMouse on a coordinate, can you do it on a color?

    EDIT: Nvm, tyvm Derek, it's compiling now

    Time to try what Method said for the dropping...

  5. #5
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Your mining procedure needs a bit of a fixup. If you have an if/then/else statement, without any begins/ends...it'll only execute the next line of code. By doing it your way, it'll always TerminateScript after mining.

    It should be like this:

    SCAR Code:
    procedure Mining;
    begin
      if FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5) then
        Mouse(x, y, 1, 1, true)
      else
      begin  
        Writeln('Rock color not found, terminating script');
        TerminateScript;
      end;
    end;

    Quote Originally Posted by Runescapian123
    Oh, I thought mouse was to click. I see now that it's ClickMouse? If so, In the Scar Manual it says you can ClickMouse on a coordinate, can you do it on a color?
    All Mouse procedures click on a coordinate. This coordinate is defined by a colour...what I mean is: SCAR finds a colour, checks which coordinate the colour is at and stores it in the X, Y variables. It is then the scripters choice whether to move the mouse to X, Y or not. I hope I explained that well enough, if you can even consider it an explanation.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  6. #6
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, now when I want it to repeat until it finds the message in the chatbox 'your inventory is too full to hold any more ores' or something like that, how should I do it? And then how to repeat the dropping procedure until there are no more to drop?

    EDIT: Here is what I have now...
    SCAR Code:
    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
      var
        x,y:integer;
      const

        RockColor = 6908530; //put the color of the rock before the ; but after the =
        OreInventoryColor = 6908530; //put the color of the ore as seen in your inventory (so Scar
                          //can find it when it's dropping the ores)

    procedure Mining;
      begin
       if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5))then
         mouse(x, y, 1, 1, true)
       else
         begin
           Writeln('Rock color not found, terminating script');
           TerminateScript;
         end;
      end;

    procedure Drop;
      begin
        if(FindColorTolerance(x, y, OreInventoryColor, 1, 1, 100, 100, 5))then
          mouse(x, y, 1, 1, false)
          ChooseOption('rop');
        else
          begin
            Writeln('Cannot find ore color, terminating script');
            TerminateScript;
          end;
      end;


    begin
     SetupSRL;
     ActivateClient;
     Mining;
     Drop;
    end.

    It's giving me

    Line 28: [Error] (15056:1): Identifier expected in script
    (at the else in the drop procedure) It's probably a stupid mistake but I can't seem to find it -.-

    Btw still not sure about how to repeat until they're done and all.

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

    Default

    ahh
    SCAR Code:
    repeat
      if FindNPCChatText('your inventory is too full to hold any more ores') then
      begin
          ClickNPCChatText('your inventory');
          DropExcept(1);
      end;
      Mining;
    until (YourConstant = This) or (Not(loggedin);
    Like this you mean? I'm certain I don't have the drop bit right, and I don't know about the function choice for FindChatText. I've never worked with text or power leveling before.

    I think this should work though.
    Does this help, I hope?

    Edit:
    SCAR Code:
    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
      var
        x,y:integer;
      const

        RockColor = 6908530; //put the color of the rock before the ; but after the =
        OreInventoryColor = 6908530; //put the color of the ore as seen in your inventory (so Scar
                          //can find it when it's dropping the ores)

    procedure Mining;
      begin
       if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5))then
         mouse(x, y, 1, 1, true)
       else
         begin
           Writeln('Rock color not found, terminating script');
           TerminateScript;
         end;
      end;

    procedure Drop;
    begin
      if(FindColorTolerance(x, y, OreInventoryColor, 1, 1, 100, 100, 5))then
      begin
        mouse(x, y, 1, 1, false)
        ChooseOption('rop');
      end else                       //< you needed an end.
      begin
        Writeln('Cannot find ore color, terminating script');
        TerminateScript;
      end;
    end;


    begin
     SetupSRL;
     ActivateClient;
     Mining;
     Drop;
    end.
    Active only during the Summer...

  8. #8
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JackLKrawl View Post
    ahh
    SCAR Code:
    repeat
      if FindNPCChatText('your inventory is too full to hold any more ores') then
      begin
          ClickNPCChatText('your inventory');
          DropExcept(1);
      end;
      Mining;
    until (YourConstant = This) or (Not(loggedin);
    Like this you mean? I'm certain I don't have the drop bit right, and I don't know about the function choice for FindChatText. I've never worked with text or power leveling before.

    I think this should work though.
    Does this help, I hope?

    Edit:
    SCAR Code:
    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
      var
        x,y:integer;
      const

        RockColor = 6908530; //put the color of the rock before the ; but after the =
        OreInventoryColor = 6908530; //put the color of the ore as seen in your inventory (so Scar
                          //can find it when it's dropping the ores)

    procedure Mining;
      begin
       if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5))then
         mouse(x, y, 1, 1, true)
       else
         begin
           Writeln('Rock color not found, terminating script');
           TerminateScript;
         end;
      end;

    procedure Drop;
    begin
      if(FindColorTolerance(x, y, OreInventoryColor, 1, 1, 100, 100, 5))then
      begin
        mouse(x, y, 1, 1, false)
        ChooseOption('rop');
      end else                       //< you needed an end.
      begin
        Writeln('Cannot find ore color, terminating script');
        TerminateScript;
      end;
    end;


    begin
     SetupSRL;
     ActivateClient;
     Mining;
     Drop;
    end.
    For the identifier expected thing, that would make 6 ends and 5 begins if I put end in there?

    I'll try what you said about the finding chat thing in a moment...

    EDIT: Wait a min, If I just put DropExcept(1) then I don't need the whole Drop procedure lol.

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

    Default

    Quote Originally Posted by Runescapian321 View Post
    For the identifier expected thing, that would make 6 ends and 5 begins if I put end in there?

    I'll try what you said about the finding chat thing in a moment...

    EDIT: Wait a min, If I just put DropExcept(1) then I don't need the whole Drop procedure lol.
    Ehh? No, I don't think so. I see 3 begins and 3 ends in mine.
    It compiled when I put it through.
    I say keep that procedure, it'll show people you are thinking.
    C'mon man if you find any more problems you better hurry up so I can help you now, my grandparent is here. I plan on working on this in 6 hours, so I'll be going to bed earlier.
    Also, guys, don't 'do the script for him.' Answer what he asks, tell him what he does not do, but make sure he leaves knowing something. When I first came here you people irritated the hell out of me, telling me I had poor standards, that they were the worst standards you had ever seen, and didn't even give me the syntax. Then when I posted it I was told that it looked like I didn't even do it.
    Active only during the Summer...

  10. #10
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    You can also just do:
    SCAR Code:
    if InvFull then
    rather than finding the text saying that your inv is full..
    (InvFull will determine how many items are in your inventory and if there are 28 then will return true)

  11. #11
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok I changed it up a bit...

    SCAR Code:
    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
      var
        x,y:integer;
      const

        RockColor = 6908530; //put the color of the rock before the ; but after the =
        OreInventoryColor = 6908530; //put the color of the ore as seen in your inventory (so Scar
                          //can find it when it's dropping the ores)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;

        Players[0].Name := '';
        Players[0].Pass := '';
        Players[0].Nick := '';
        Players[0].Active :=True;
    end;




    procedure Mining;
      begin
       if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5))then
         mouse(x, y, 1, 1, true)
       else
         begin
           Writeln('Rock color not found, terminating script');
           TerminateScript;
         end;
       repeat until(InvFull)
       end;



    begin
     SetupSRL;
     ActivateClient;
     DeclarePlayers;
     Mining;
     DropExcept(1);
    end.




    Now I'm getting Line 45 type mismatch error (The DropExcept in the main loop)

    Once I get this compiling, will it go like

    Mining
    Drop
    Mining
    Drop
    Mining
    etc...

    Or will it just do

    Mining
    Drop
    Done

    If Mining, drop, done, I suppose I need to go read a tut on loops?

  12. #12
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    That's cuz the in the 'DropExcept' procedure the parameter is an array.. (so it needs to be surrounded by brackets)
    Ex. DropExcept([1, 2, 3])
    so in your case it'd look like
    SCAR Code:
    DropExcept([1]);

    and actually nothing is looping here =]]

    with loops you put everything you want to loop in between the repeat and the until.

    Ex.
    SCAR Code:
    repeat
      This;
    until (ThisHappens)

    so in your mining procedure you want to do:
    SCAR Code:
    procedure Mining;
      begin
        repeat //repeat here
          if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5))then
           mouse(x, y, 1, 1, true)
         else
           begin
             Writeln('Rock color not found, terminating script');
             TerminateScript;
           end;
         Wait(10000); //P.S. you may want a wait in between mining ores.. =]]
       until(InvFull) //until here
       end;

    then in your main loop:
    SCAR Code:
    begin
     SetupSRL;
     ActivateClient;
     DeclarePlayers;
     repeat //repeat here
       Mining;
       DropExcept([1]);
     until (false); //until here.. 'until (false)' will give you an INFINITE loop
    end.

    and then it will repeat like you said:
    "Mining
    Drop
    Mining
    Drop
    Mining
    etc..."

  13. #13
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Failsafes...
    In any loop do something like "if not LoggedIn then Break;" or have a count of tries and have it Break the loop after so many tries. Effective failsafes are some of the most important things in scripts.
    -You can call me Mick-



  14. #14
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm, maybe use a nice dropper by me?

    SCAR Code:
    procedure drop(dropitem : string);
    var
    bx, by, timeout, thing, itemc, itemc2 : Integer;
    begin
        case dropitem of
          'Log' :   thing := DTMFromString('78DA632C60626060636440068D29B60CFF813' +
                    '448F43F1030A6304179C880118904D2E94035A204D45403D5F010' +
                    '50530654C34A404D2C500D1F7E3500DACE0904');
     
          'Ore' :   thing := DTMFromString('78DA633CC4C4C0F0940105F4343532FC07D28' +
                    'C40FC1F08183702D53C6340038C48249006A9794340CD5EA09A4F' +
                    '04D41C04AA794740CD69A09AE704D49C07AAB94F40CD51A09A1B0' +
                    '4D4EC04AAB9875F0D00E1B81584');
     
     
        end;
      if not loggedin then exit;
      GameTab(4);
      begin
        repeat
          Try
          if not (FindDTM(thing, bx, by, MIX1, MIY1, MIX2, MIY2)) then break;
          except
            begin
              writeln('ERROR - Item to drop can only be Log or Ore, don''t forget big capitals');
              Exit;
            end;
          end;
          itemc := getcolor(bx, by);
          Mouse(bx, by, 10, 10, false)
          ChooseOption('Drop')
          wait(1);
          marktime(timeout);
          repeat
            wait(5);
            itemc2 := getcolor(bx, by);
            if itemc <> itemc2 then break;
          until(timefrommark(timeout)>2000);
        until (false)
      end;
    end;

    usage:
    SCAR Code:
    Drop('Ore');
    it's pretty fast
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  15. #15
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Woot! It's compiling with the Mining, Dropping, and Declareplayers (going to add other stuff today or after Christmas (probs after)), thanks Derek!

    Mick, thanks - now I know what failsafes are and see why I should go read a tut on them

    Negaal, thanks, but I'd rather try my own



    EDIT:
    Ok, so it's sort of working, but whats the best way to find a rock? Is color the only way? Or would DTM or Bitmap or w/e work better? What's the best way? You don't have to explain it to me, just say what it is and I'll go read a tut on it

    EDIT: (Still need above edit to be answered ) Here, I've been adding stuff to it, tell me what you think

    SCAR Code:
    //This is my first script, a powerminer. Put your pickaxe in the first inventory slot (DO NOT
    //TAKE ANYTHING ELSE) and fill in the info in lines 10-13 and 18-26

    //Big thanks to Derek for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/core/AntiBan.scar}
      var
        x,y:integer;
      const

        RockColor = 3890561; //put the color of the rock before the ; but after the =
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //How many players will you be using?
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.
    end;




    procedure Mining;
      begin
        repeat
          if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 20))then
              mouse(x, y, 1, 1, true)
          else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1])
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(6);
          case Ban of
            0: RandomRClickEvery(3 + random(9);
            1: LeaveScreenEvery(2 + random(14);
            2: HoverSkill('mining', False);
            3: PickUpMouseEvery(3 + random(4));
            4: AlmostLogout;
            5: Wait2(3 + random(9), true);
            6: BoredHuman;
        end;

      begin
        RandomRClickEvery(5)
        LeaveScreenEvery(2)
        HoverSkill(mining;false)
        PickUpMouseEvery(3)
      end;


    begin
     SetupSRL;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     repeat
       Mining;
       Drop;
       Randoms;
       Antiban;
     until(false)
    end.

    When I run it though, It opens up AntiBan.scar in another tab and says
    Line 24: [Error] (15060:11): Duplicate identifier 'RANDOMRCLICK' in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/core/AntiBan.scar

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

    Default

    Quote Originally Posted by Runescapian321 View Post
    Woot! It's compiling with the Mining, Dropping, and Declareplayers (going to add other stuff today or after Christmas (probs after)), thanks Derek!

    Mick, thanks - now I know what failsafes are and see why I should go read a tut on them

    Negaal, thanks, but I'd rather try my own



    EDIT:
    Ok, so it's sort of working, but whats the best way to find a rock? Is color the only way? Or would DTM or Bitmap or w/e work better? What's the best way? You don't have to explain it to me, just say what it is and I'll go read a tut on it

    EDIT: (Still need above edit to be answered ) Here, I've been adding stuff to it, tell me what you think

    SCAR Code:
    //This is my first script, a powerminer. Put your pickaxe in the first inventory slot (DO NOT
    //TAKE ANYTHING ELSE) and fill in the info in lines 10-13 and 18-26

    //Big thanks to Derek for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/core/AntiBan.scar}
      var
        x,y:integer;
      const

        RockColor = 3890561; //put the color of the rock before the ; but after the =
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //How many players will you be using?
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.
    end;




    procedure Mining;
      begin
        repeat
          if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 20))then
              mouse(x, y, 1, 1, true)
          else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1])
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(6);
          case Ban of
            0: RandomRClickEvery(3 + random(9);
            1: LeaveScreenEvery(2 + random(14);
            2: HoverSkill('mining', False);
            3: PickUpMouseEvery(3 + random(4));
            4: AlmostLogout;
            5: Wait2(3 + random(9), true);
            6: BoredHuman;
        end;

      begin
        RandomRClickEvery(5)
        LeaveScreenEvery(2)
        HoverSkill(mining;false)
        PickUpMouseEvery(3)
      end;


    begin
     SetupSRL;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     repeat
       Mining;
       Drop;
       Randoms;
       Antiban;
     until(false)
    end.

    When I run it though, It opens up AntiBan.scar in another tab and says
    You have to remove the srl/srl/core/antiban thingdoo.
    You should also add
    SCAR Code:
    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    to your declareplayers (line right next to end) because otherwise talking randoms will never be found.
    Active only during the Summer...

  17. #17
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JackLKrawl View Post
    You have to remove the srl/srl/core/antiban thingdoo.
    If I remove it then it tells me
    Line 66: [Error] (15094:4): Unknown identifier 'RandomRClickEvery' in script C:\Program Files\SCAR 3.12\Scripts\PowerMinerByScapian.scar
    EDIT: Btw anyone know the best way to find a rock? Colorfinding isn't working well...

    EDIT: (still looking for above edit answer ) Ops, forgot to edit something out in script, here it is again now
    SCAR Code:
    //This is my first script, a powerminer. Put your pickaxe in the first inventory slot (DO NOT
    //TAKE ANYTHING ELSE) and fill in the info in lines 10-13 and 18-26

    //Big thanks to Derek for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/core/AntiBan.scar}
      var
        x,y:integer;
      const

        RockColor = 3890561; //put the color of the rock before the ; but after the =
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //How many players will you be using?
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.
        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;




    procedure Mining;
      begin
        repeat
          if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 20))then
              mouse(x, y, 1, 1, true)
          else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1])
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(6);
          case Ban of
            0: RandomRClickEvery(3 + random(9);
            1: LeaveScreenEvery(2 + random(14);
            2: HoverSkill('mining', False);
            3: PickUpMouseEvery(3 + random(4));
            4: AlmostLogout;
            5: Wait2(3 + random(9), true);
            6: BoredHuman;
        end;
       
    procedure proggy;   //Took this and edited slightly from Pwnaz0r's UnRivaled guide
    Active: string;
      i : Integer;
    begin
      Writeln('****************************************************');
      Writeln('   Name    : '+ Players[CurrentPlayer].Name);
      Writeln('   Number  : '+ IntToStr(CurrentPlayer));
      Writeln('   Worked  : '+ IntToStr (Players[CurrentPlayer].Worked)+' minutes.');
      Writeln('   Banked  : '+ IntToStr (Players[CurrentPlayer].Banked) + ' loads.');
      Writeln('   Location: '+ Players[CurrentPlayer].loc);
      Writeln('   Level   : '+ IntToStr(Players[CurrentPlayer].Integer1));
      Writeln('****************************************************');
      for i := 0 to HowManyPlayers - 1 do
      begin
        if(Players[i].Active = True)then
          Active := 'True'
        else
          Active := 'False';
       Writeln (IntToStr(i) + ' : '+Players[i].Name + ' = ' + Active + '. - Lvl: '+IntToStr(Players[i].Integer1)+
            '. - B :'+IntToStr (Players[i].Banked)+' times.'+
            ' - '+IntToStr (Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
       end;
      Writeln('*****************************************************');
    end;




    begin
     SetupSRL;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     repeat
       Mining;
       Drop;
       Randoms;
       Antiban;
     until(false)
    end.

    Yeah, I know, the proggy isn't good yet, I'll work on it later. I'm still getting that duplicate Identifier error though.
    Line 24: [Error] (15060:11): Duplicate identifier 'RANDOMRCLICK' in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/core/AntiBan.scar
    Btw is the BMP thing at the end of my declare players right?

    EDIT: In SRL Stats are the custom variable things required, or are they optional?

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

    Default

    Quote Originally Posted by Runescapian321 View Post
    If I remove it then it tells me


    EDIT: Btw anyone know the best way to find a rock? Colorfinding isn't working well...

    EDIT: (still looking for above edit answer ) Ops, forgot to edit something out in script, here it is again now
    SCAR Code:
    //This is my first script, a powerminer. Put your pickaxe in the first inventory slot (DO NOT
    //TAKE ANYTHING ELSE) and fill in the info in lines 10-13 and 18-26

    //Big thanks to Derek for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/core/AntiBan.scar}
      var
        x,y:integer;
      const

        RockColor = 3890561; //put the color of the rock before the ; but after the =
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //How many players will you be using?
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.
        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;




    procedure Mining;
      begin
        repeat
          if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 20))then
              mouse(x, y, 1, 1, true)
          else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1])
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(6);
          case Ban of
            0: RandomRClickEvery(3 + random(9);
            1: LeaveScreenEvery(2 + random(14);
            2: HoverSkill('mining', False);
            3: PickUpMouseEvery(3 + random(4));
            4: AlmostLogout;
            5: Wait2(3 + random(9), true);
            6: BoredHuman;
        end;
       
    procedure proggy;   //Took this and edited slightly from Pwnaz0r's UnRivaled guide
    Active: string;
      i : Integer;
    begin
      Writeln('****************************************************');
      Writeln('   Name    : '+ Players[CurrentPlayer].Name);
      Writeln('   Number  : '+ IntToStr(CurrentPlayer));
      Writeln('   Worked  : '+ IntToStr (Players[CurrentPlayer].Worked)+' minutes.');
      Writeln('   Banked  : '+ IntToStr (Players[CurrentPlayer].Banked) + ' loads.');
      Writeln('   Location: '+ Players[CurrentPlayer].loc);
      Writeln('   Level   : '+ IntToStr(Players[CurrentPlayer].Integer1));
      Writeln('****************************************************');
      for i := 0 to HowManyPlayers - 1 do
      begin
        if(Players[i].Active = True)then
          Active := 'True'
        else
          Active := 'False';
       Writeln (IntToStr(i) + ' : '+Players[i].Name + ' = ' + Active + '. - Lvl: '+IntToStr(Players[i].Integer1)+
            '. - B :'+IntToStr (Players[i].Banked)+' times.'+
            ' - '+IntToStr (Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
       end;
      Writeln('*****************************************************');
    end;




    begin
     SetupSRL;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     repeat
       Mining;
       Drop;
       Randoms;
       Antiban;
     until(false)
    end.

    Yeah, I know, the proggy isn't good yet, I'll work on it later. I'm still getting that duplicate Identifier error though.


    Btw is the BMP thing at the end of my declare players right?

    EDIT: In SRL Stats are the custom variable things required, or are they optional?
    Switch the location of that.
    Remove {.include srl/srl/core/antiban.scar} and add it to the top of procedure AntiBan.
    Active only during the Summer...

  19. #19
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    No, take it out completely. Including SRL\SRL.scar also includes EVERY core file.
    :-)

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

    Default

    Quote Originally Posted by Method View Post
    No, take it out completely. Including SRL\SRL.scar also includes EVERY core file.
    Then why does it return unknown identifier?
    P.S.
    You forgot
    SCAR Code:
    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    in your tutorial.
    Active only during the Summer...

  21. #21
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    It gives him the Unknown Identifier because RandomRClickEvery was a function in the previous AntiBan.scar. It was in xAntiBan.scar, but the extended folder was removed and now it's no use. If he changes it to RandomRClick, it should work fine.

    EDIT: Also, LoginPlayer assigns NickNameBMP already, but I've added a note in my tutorial about that since some players start scripts already logged in.
    :-)

  22. #22
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Derek- View Post
    K it's cuz you have 'mouse' declared a a variable..
    'Mouse' is already a function declared in SRL so there's no need to declare anything just include SRL like so:
    SCAR Code:
    program PowerMinerByScapian;
    {.include SRL/SRL.scar}
    and then you can use it.

    Also one more thing.. In:
    SCAR Code:
    procedure Mining;
    begin
     if FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 5) then
      Mouse(x, y, 1, 1, true)
     else
      begin //put a begin here
       Writeln('Rock color not found, terminating script');
       TerminateScript;
      end; //and an end here
    end;
    but a begin and an end around it when you want it to do more than one thing in an if then statement.
    Otherwise it will only do the first thing based on the if then statement and will always do the second thing (in this case it'd always do 'TerminateScript' even if the color was found).

    EDIT: 'Mouse' does click.. It's just written in SRL rather than internally in SCAR like 'ClickMouse' is so you have to be sure to include SRL in your script when using 'Mouse'.. (which btw is much better to use than 'ClickMouse')
    Do you just like copying what others say...?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

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

    Default

    Quote Originally Posted by Santa_Clause View Post
    Do you just like copying what others say...?
    LOL, love it.
    Siggied.
    Active only during the Summer...

  24. #24
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, well that part is working now, thanks Method, but now I'm getting a weird error -.-
    SCAR Code:
    //This is my first script, a powerminer. Put your pickaxe in the first inventory slot (DO NOT
    //TAKE ANYTHING ELSE) and fill in the info in lines 10-13 and 18-26

    //Big thanks to Derek for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}

      var
        x,y:integer;
      const

        YourSRLId = '';  //Enter your SRL Stats ID number, if you don't have one go here - [url]http://www.stats.srl-forums.com/[/url]
        YourSRLPassword =''; //Your SRL Stats password

        RockColor = 3890561; //put the color of the rock before the ; but after the =
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //How many players will you be using?
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.
        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;




    procedure Mining;
      begin
        repeat
          if(FindColorTolerance(x, y, RockColor, 1, 1, 100, 100, 20))then
              mouse(x, y, 1, 1, true)
          else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1])
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(5);
          case Ban of
            0: RandomRClick;
            1: HoverSkill('mining', False);
            2: PickUpMouse;
            3: AlmostLogout;
            4: Wait2(3 + random(9), true);
            5: BoredHuman;
        end;



    begin
     SetupSRL;
     ScriptID := '532';
     SRLId := YourSRLId;
     SRLPassword:= YourSRLPassword;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     Randoms;
     AntiBan;
     repeat
       Mining;
       Drop;
       Randoms;
       AntiBan;
     until(false)
    end.

    It gives me
    Failed when compiling
    [Error] (15125:4): Identifier expected
    No line or anything

    Btw I took the proggy out since it was giving me some errors that I didn't feel like fixing now, I'll try it again later. I'm going to change the rock finding to FindObj or FindObjcustom (Which one do you think is better, if FindObj at all?), and add a pick and gas finder (does SRL have any of those built in?). But that will be in a few days, since now I'm too busy with my new iPod touch and Wii

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

    Default

    I think you need to add an end to procedure antiban.
    Active only during the Summer...

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Type Mismatch...
    By Raskolnikov in forum OSR Help
    Replies: 3
    Last Post: 10-18-2008, 05:56 AM
  2. Type mismatch
    By batnas in forum OSR Help
    Replies: 3
    Last Post: 04-24-2008, 06:48 PM
  3. Type Mismatch..
    By Nava2 in forum OSR Help
    Replies: 1
    Last Post: 04-23-2008, 07:44 PM
  4. Type mismatch Help
    By Ashur2Good in forum OSR Help
    Replies: 2
    Last Post: 05-23-2007, 03:47 PM

Posting Permissions

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