Results 1 to 4 of 4

Thread: Making script auto stop?

  1. #1
    Join Date
    Jan 2013
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Making script auto stop?

    So I read through all of coh3ns tut on the basics of coding in pascal and was able to make a bot using bitmaps and findcolor (for fletching). However I'm not sure of how I would go about making the bot stop when no logs are found. I attempted to do so with

    Code:
    procedure FindLogs;
    
    begin
    
      log := BitmapFromString(11, 13, 'meJxjZGBQC8xP6FwZ27rEuWCiU1' +
            '6fQ063fVaHbVqrTUozEDEyMABl49qXwxXA1UAQsgKd6BrnoilAZUA' +
            'FQARRjFUBMkJWAER6cQ2uJdNAyiCoYKJpRDFcAaYsEFnGVlkm1Bok' +
            't+olNgMRVAHMfIPArKiGeVZJDUAEkQUaCEEmYQVABGQATYYoUHJL0' +
            'AorhbDhCGg40AFwBUCLgB6BhwAEQUwAykLcGdOyCGgXxBmQcIhumg' +
            '9RgOwXZAVAR4bVzFTxTMFUAFEDAHbHrAw=');
    
            If (FindBitmapToleranceIn(log, x, y, 540, 116, 734, 462, 30)) then
               writeln('Found logs! Fletching logs.')
               else
                writeln('No logs, terminating script.');
                Terminatescript;
    
    
    end;
    However regardless of if it finds logs or not the script stops at that point if the "Terminatescript;" line is there. I'm not sure if I'm using the wrong command for this task or not, if anyone could help me out with this that would be great. I'd be willing to recode this part into a different type if needed to fix the problem.

  2. #2
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Try this

    Simba Code:
    procedure FindLogs;
    begin

      log := BitmapFromString(11, 13, 'meJxjZGBQC8xP6FwZ27rEuWCiU1' +
            '6fQ063fVaHbVqrTUozEDEyMABl49qXwxXA1UAQsgKd6BrnoilAZUA' +
            'FQARRjFUBMkJWAER6cQ2uJdNAyiCoYKJpRDFcAaYsEFnGVlkm1Bok' +
            't+olNgMRVAHMfIPArKiGeVZJDUAEkQUaCEEmYQVABGQATYYoUHJL0' +
            'AorhbDhCGg40AFwBUCLgB6BhwAEQUwAykLcGdOyCGgXxBmQcIhumg' +
            '9RgOwXZAVAR4bVzFTxTMFUAFEDAHbHrAw=');

            If (FindBitmapToleranceIn(log, x, y, 540, 116, 734, 462, 30)) then
               writeln('Found logs! Fletching logs.')
               else
               begin
                writeln('No logs, terminating script.');
                Terminatescript;
               end;

    end;

    Forum account issues? Please send me a PM

  3. #3
    Join Date
    Jan 2013
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thank you so much, I wasn't aware I needed begin/end for that. Thinking about it now it seems obvious that with 2 commands I'd need it.

  4. #4
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by girboy View Post
    Thank you so much, I wasn't aware I needed begin/end for that. Thinking about it now it seems obvious that with 2 commands I'd need it.
    No worries, If you just want to do 1 line of code then you wont need a begin end; but as you said, you wanted to do 2 lines of code so begin end; was needed

    Forum account issues? Please send me a PM

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
  •