Results 1 to 11 of 11

Thread: Silk runner

  1. #1
    Join Date
    Feb 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Silk runner

    Code:
    program silkrunning;
    var
      x, y :Integer;
    
    begin
      //This moves and left licks
        wait(1400); //1000ms = 1s
        Writeln('Finding the silk..')
    repeat
      //Find the silk stall(next to silver stall)
        if findcolor(x, y, 1643026,251,151, MS) then MMouse(x, y, 4, 4, True)
    
        else
    
    begin
      //This moves and left licks
        wait(1400); //1000ms = 1s
    repeat
        Writeln('Finding the silk again..')
      //Find the silk stall(next to silver stall)
        if findcolor(x, y, 2237264,251,151, MS) then MMouse(x, y, 4, 4, True)
    
        else
    
      end;
    end;
    
    		until(p07_InvFull)
    		if(p07_InvFull) then findcolor(x, y, 3290937, 308, 174, DB)
    end;
    
        else
    
    begin
    //This moves and left licks
    	wait(1400); //1000ms = 1s
    	writeln('Cant find the silk, logging you out');
    	Logout; //Logs you out
    end;
    Simba Crashes after running this script, i cant even compile it


    Program exception!
    Stacktrace:

    Exception class: EAccessViolation
    Message: Access violation
    $005CEC70
    $0042ABBA
    $005064E8
    $004436C2
    $005010A0
    $00501678
    $0040C37A
    $005804CF
    $764262FA
    $76426D3A
    $76430D27
    $7643794A
    $004252DA
    $764262FA
    $76426D3A
    $764277C4
    $7642788A
    Simba Version: 992


    I personal can code in HTML,Java,C++,VB. I know this has fortan / pascal type style of coding. If i need to use pointers in this please can you say otherwise thanks for looking / trying to help guys.

  2. #2
    Join Date
    Nov 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Quoted
    43 Post(s)

    Default

    You aren't defining procedures or functions. Make sure you define them something like:
    Code:
    function DoSomething(String: Argument): Boolean;
    var
        someString: String;
    begin
        WriteLn('Hello there.');
        Result := True;
    end;
    Last edited by Neodymium; 02-27-2013 at 10:09 PM.

  3. #3
    Join Date
    Feb 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I was asking if i need to use pointers in order to have low memory usage script but never mind, thanks for the link

  4. #4
    Join Date
    Feb 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Ah i see nice

  5. #5
    Join Date
    Nov 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Quoted
    43 Post(s)

    Default

    Sorry about my first reply, I misread your question.

    What you seem to be doing is implying the whole program runs top-down, but you need to create functions and call them in your main loop instead.
    Your last end (in your main loop) should be "end.", not "end;".
    I also suggest you use "Wait(RandomRange(high, low))" for your waits, so they are not static (and detectable).
    Also, try adding constants to your code (the colors for example) to make it a bit easier to edit (like when that area gets a color update) and more readable.

    Your fixed script would look something like:
    Code:
    program silkrunning;
    const
        SilkColor1 = 12345678;
        SilkColor2 = 87654321;
    
    var
        AGlobalInt: Integer;
    
    function FindAndThieve(): Boolean;
    var
      x, y :Integer;
    begin
        //This moves and left licks
        wait(1400); //1000ms = 1s
        Writeln('Finding the silk..')
        repeat
            //Find the silk stall(next to silver stall)
            if findcolor(x, y, 1643026,251,151, MS) then 
                MMouse(x, y, 4, 4, True)
            else
                begin
                    Writeln('Finding the silk again..')
                    //Find the silk stall(next to silver stall)
                    if findcolor(x, y, 2237264,251,151, MS) then
                        MMouse(x, y, 4, 4, True)
                    else
                        begin
                            Writeln('Finding the silk again..')
                            //Find the silk stall(next to silver stall)
                            if findcolor(x, y, 2237264,251,151, MS) then
                                MMouse(x, y, 4, 4, True)
                            else
                                begin
                                    writeln('Cant find the silk, logging you out');
    	                        Logout; //Logs you out
                                end;
                        end;
                end;
        until (p07_InvFull); // Not the real function name I think
        if(p07_InvFull) then
            findcolor(x, y, 3290937, 308, 174, DB);
    end;
    
    // Main loop, change this to what your 
    begin
        while (True) do
        begin
            FindAndThieve();
            Wait(RandomRange(100, 120));
        end;
    end.
    There are probably syntax errors, my if/then/else's may not by formatted correctly, etc.
    But you get the idea.
    Last edited by Neodymium; 02-27-2013 at 10:35 PM.

  6. #6
    Join Date
    Feb 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Pretty sure this is the wrong forum to post 07 Script help. Try moving this thread to "Forum: Old School Help"

  7. #7
    Join Date
    Mar 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    [Error] (19:45): Unknown identifier 'MS' at line 18
    Compiling failed.? that what i got

  8. #8
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by cocainenasir View Post
    [Error] (19:45): Unknown identifier 'MS' at line 18
    Compiling failed.? that what i got
    He hasn't even fixed it yet, slow down there leecher...

  9. #9
    Join Date
    Feb 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Plz also make a bank function!
    Thanx !!

  10. #10
    Join Date
    Feb 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    when i get the chance ill try fixing this program for now it will be on 'pause' until i have full understanding of this language.

  11. #11
    Join Date
    Feb 2013
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    I don't understand why this is called silkRUNNER

Thread Information

Users Browsing this Thread

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

Posting Permissions

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