Results 1 to 8 of 8

Thread: Need Help Scripting!!!!!

  1. #1
    Join Date
    Oct 2008
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Need Help Scripting!!!!!

    Ok. I don't know where to start. Basiclly i don't want to take other peoples scripts so i went on heaps of tutorials to find out how to write my own. The best i found was the Unmatched Beginner's Tutorial
    I had a small problem though. Actually a big problem.
    The color functions on my SCAR program will not work!!!!

    I put this into my SCAR program as a test after the tut to see if it worked.

    SCAR Code:
    program FindAndClickOnColor;

    var
    x,y: Integer;

    const
    testcolor = 293491;

    begin
    if(FindColor(x,y,testcolor,0,0,100,100)) then
     begin
      MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
      Wait(100+random(10));
      ClickMouse(x,y,true);
     end;
    end.

    but it didn't work. in fact when i ran it this messege came up

    Successfully Compilled
    Successfully Executed
    WHAT!!!!
    Nothing had hapenned. It just said it had finished but nothing had hapenned.
    The same thing hapenned with my bit map searching scripts.
    This is what I made.

    SCAR Code:
    program BitmapClick;

    var
    rune: Integer;
    x,y: Integer;

    procedure LoadBmps;
    begin
       rune := BitmapFromString(512, 384, 'beNrt3V1LXFcUBmD9EemFBB' +
           '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' +
           'AAAAAAAAAAAAADAe/gTXjb/Bw==');
    end;

    procedure UseBitmap;
    begin
    if(FindBitmapIn(rune,x,y,0,0,100,100)) then
     begin
      MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
      Wait(1000+random(100));
      ClickMouse(x,y,true);
     end;
    end;

    procedure FreeBmps;
    begin
      FreeBitmap(rune);
    end;

    begin
     LoadBmps;
      UseBitmap;
     FreeBmps;
    end.

    Again
    Successfully Compiled
    Successfully Executed
    NOTHING HAD HAPENNED!!!!!!!!!!!!!!!!!!!!!!!!!

    Please somebody help me out!

  2. #2
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    This probably means that it isn't finding the color/bitmap. I would try this:
    SCAR Code:
    if(FindColor(blah,blah)) then
    begin
      // statements
    end else
    begin
      Writeln('Didnt find color!');
    end;
    Make sure it doesn't say "Didn't find color!".

    P.S. The bitmap is way too huge, so SCAR prbly won't be able to find it and it will like uber clog your RAM.

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  3. #3
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Quote Originally Posted by jis777 View Post
    SCAR Code:
    program FindAndClickOnColor;

    var
    x,y: Integer;

    const
    testcolor = 293491;

    begin
    if(FindColor(x,y,testcolor,0,0,100,100)) then
     begin
      MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
      Wait(100+random(10));
      ClickMouse(x,y,true);
     end;
    end.


    SCAR Code:
    program BitmapClick;

    var
    rune: Integer;
    x,y: Integer;

    procedure LoadBmps;
    begin
       rune := BitmapFromString(512, 384, 'beNrt3V1LXFcUBmD9EemFBB' +
           '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' +
           'AAAAAAAAAAAAADAe/gTXjb/Bw==');
    end;

    procedure UseBitmap;
    begin
    if(FindBitmapIn(rune,x,y,0,0,100,100)) then
     begin
      MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
      Wait(1000+random(100));
      ClickMouse(x,y,true);
     end;
    end;

    procedure FreeBmps;
    begin
      FreeBitmap(rune);
    end;

    begin
     LoadBmps;
      UseBitmap;
     FreeBmps;
    end.
    First of all, if you are going to use this for RS then don't use MMSE. Use MMouse. Also, ClickMouse should be Mouse.

    Here is what it should look like:
    SCAR Code:
    Program FindAndClickOnColor;

    Var
      x,y: Integer;

    Const
      testcolor = 293491;

    Begin
    if(FindColor(x,y,testcolor,0,0,100,100)) then
     begin
      MMouse(x,y,2,2);
      Wait(100+random(10));
      Mouse(x,y,true);
     end else
     begin
       WriteLn('Didn''t find color')
     end;  
    End.

    As for the Bitmap. It's waaaay to huge! Re-read through the bitmap tutorial to learn how to correctly make them. Try to use DTM's, they are much better and reliable. You should be able to fix the problems if you take the advice. Good luck with scripting!

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  4. #4
    Join Date
    Oct 2008
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok. I tried all of that and when I changed the colour to something I wanted this messege came up...
    Line 12: [Error] (12:1): Unknown identifier 'MMouse' in script
    ??????????

  5. #5
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    add
    SCAR Code:
    setupsrl;
    to the mainloop at the beginning...

  6. #6
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mormon, he also needs to add {.include srl/srl.scar} just under the Program FindAndClickOnColor; line.

  7. #7
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    he also needs to add activateclient; below setupsrl;

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    He also needs to get the SRL includes.

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
  •